@draftbit/core 46.10.3-0bad1e.2 → 46.10.3-1ab4b6.2

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.
Files changed (129) hide show
  1. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
  2. package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
  3. package/lib/commonjs/components/FAB.js +4 -18
  4. package/lib/commonjs/components/Shadow.js +15 -2
  5. package/lib/commonjs/components/Table/Table.js +123 -0
  6. package/lib/commonjs/components/Table/TableCell.js +49 -0
  7. package/lib/commonjs/components/Table/TableCommon.js +30 -0
  8. package/lib/commonjs/components/Table/TableRow.js +61 -0
  9. package/lib/commonjs/components/Table/index.js +27 -0
  10. package/lib/commonjs/index.js +19 -7
  11. package/lib/commonjs/mappings/Layout.js +85 -177
  12. package/lib/commonjs/mappings/Table.js +140 -0
  13. package/lib/module/components/Table/Table.js +114 -0
  14. package/lib/module/components/Table/TableCell.js +41 -0
  15. package/lib/module/components/Table/TableCommon.js +21 -0
  16. package/lib/module/components/Table/TableRow.js +53 -0
  17. package/lib/module/components/Table/index.js +3 -0
  18. package/lib/module/index.js +1 -1
  19. package/lib/module/mappings/Layout.js +86 -178
  20. package/lib/module/mappings/Table.js +133 -0
  21. package/lib/typescript/src/components/Table/Table.d.ts +19 -0
  22. package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
  23. package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
  24. package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
  25. package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
  26. package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
  27. package/lib/typescript/src/components/{DeprecatedCardWrapper.d.ts → Table/TableRow.d.ts} +7 -8
  28. package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
  29. package/lib/typescript/src/components/Table/index.d.ts +4 -0
  30. package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
  31. package/lib/typescript/src/index.d.ts +1 -1
  32. package/lib/typescript/src/index.d.ts.map +1 -1
  33. package/lib/typescript/src/mappings/Layout.d.ts +72 -108
  34. package/lib/typescript/src/mappings/Layout.d.ts.map +1 -1
  35. package/lib/typescript/src/mappings/{CardBlock.d.ts → Table.d.ts} +129 -81
  36. package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
  37. package/package.json +3 -3
  38. package/src/components/Table/Table.js +93 -0
  39. package/src/components/Table/Table.tsx +176 -0
  40. package/src/components/Table/TableCell.js +31 -0
  41. package/src/components/Table/TableCell.tsx +63 -0
  42. package/src/components/Table/TableCommon.js +12 -0
  43. package/src/components/Table/TableCommon.ts +40 -0
  44. package/src/components/Table/TableRow.js +37 -0
  45. package/src/components/Table/TableRow.tsx +77 -0
  46. package/src/components/Table/index.js +3 -0
  47. package/src/components/Table/index.tsx +3 -0
  48. package/src/index.js +1 -1
  49. package/src/index.tsx +2 -1
  50. package/src/mappings/Layout.js +100 -176
  51. package/src/mappings/Layout.ts +116 -178
  52. package/src/mappings/Table.js +150 -0
  53. package/src/mappings/Table.ts +170 -0
  54. package/lib/commonjs/components/Container.js +0 -93
  55. package/lib/commonjs/components/DeprecatedCardWrapper.js +0 -40
  56. package/lib/commonjs/components/DeprecatedFAB.js +0 -157
  57. package/lib/commonjs/components/ProgressIndicator.js +0 -55
  58. package/lib/commonjs/components/ResizeMode.js +0 -5
  59. package/lib/commonjs/mappings/CardBlock.js +0 -126
  60. package/lib/commonjs/mappings/CardContainer.js +0 -108
  61. package/lib/commonjs/mappings/CardContainerRating.js +0 -130
  62. package/lib/commonjs/mappings/CardContainerShortImage.js +0 -124
  63. package/lib/commonjs/mappings/CardInline.js +0 -59
  64. package/lib/commonjs/mappings/Container.js +0 -37
  65. package/lib/commonjs/mappings/NativeBase/Layout.js +0 -97
  66. package/lib/commonjs/mappings/ProgressIndicator.js +0 -188
  67. package/lib/module/components/Container.js +0 -83
  68. package/lib/module/components/DeprecatedCardWrapper.js +0 -32
  69. package/lib/module/components/DeprecatedFAB.js +0 -147
  70. package/lib/module/components/ProgressIndicator.js +0 -45
  71. package/lib/module/components/ResizeMode.js +0 -1
  72. package/lib/module/mappings/CardBlock.js +0 -119
  73. package/lib/module/mappings/CardContainer.js +0 -101
  74. package/lib/module/mappings/CardContainerRating.js +0 -123
  75. package/lib/module/mappings/CardContainerShortImage.js +0 -117
  76. package/lib/module/mappings/CardInline.js +0 -52
  77. package/lib/module/mappings/Container.js +0 -30
  78. package/lib/module/mappings/NativeBase/Layout.js +0 -90
  79. package/lib/module/mappings/ProgressIndicator.js +0 -181
  80. package/lib/typescript/src/components/Container.d.ts +0 -21
  81. package/lib/typescript/src/components/Container.d.ts.map +0 -1
  82. package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +0 -1
  83. package/lib/typescript/src/components/DeprecatedFAB.d.ts +0 -56
  84. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +0 -1
  85. package/lib/typescript/src/components/ProgressIndicator.d.ts +0 -24
  86. package/lib/typescript/src/components/ProgressIndicator.d.ts.map +0 -1
  87. package/lib/typescript/src/components/ResizeMode.d.ts +0 -2
  88. package/lib/typescript/src/components/ResizeMode.d.ts.map +0 -1
  89. package/lib/typescript/src/mappings/CardBlock.d.ts.map +0 -1
  90. package/lib/typescript/src/mappings/CardContainer.d.ts +0 -102
  91. package/lib/typescript/src/mappings/CardContainer.d.ts.map +0 -1
  92. package/lib/typescript/src/mappings/CardContainerRating.d.ts +0 -108
  93. package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +0 -1
  94. package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +0 -139
  95. package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +0 -1
  96. package/lib/typescript/src/mappings/CardInline.d.ts +0 -62
  97. package/lib/typescript/src/mappings/CardInline.d.ts.map +0 -1
  98. package/lib/typescript/src/mappings/Container.d.ts +0 -55
  99. package/lib/typescript/src/mappings/Container.d.ts.map +0 -1
  100. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +0 -107
  101. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +0 -1
  102. package/lib/typescript/src/mappings/ProgressIndicator.d.ts +0 -181
  103. package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +0 -1
  104. package/src/components/Container.js +0 -43
  105. package/src/components/Container.tsx +0 -116
  106. package/src/components/DeprecatedCardWrapper.js +0 -18
  107. package/src/components/DeprecatedCardWrapper.tsx +0 -46
  108. package/src/components/DeprecatedFAB.js +0 -114
  109. package/src/components/DeprecatedFAB.tsx +0 -231
  110. package/src/components/ProgressIndicator.js +0 -27
  111. package/src/components/ProgressIndicator.tsx +0 -71
  112. package/src/components/ResizeMode.js +0 -1
  113. package/src/components/ResizeMode.ts +0 -7
  114. package/src/mappings/CardBlock.js +0 -123
  115. package/src/mappings/CardBlock.ts +0 -136
  116. package/src/mappings/CardContainer.js +0 -104
  117. package/src/mappings/CardContainer.ts +0 -116
  118. package/src/mappings/CardContainerRating.js +0 -126
  119. package/src/mappings/CardContainerRating.ts +0 -137
  120. package/src/mappings/CardContainerShortImage.js +0 -120
  121. package/src/mappings/CardContainerShortImage.ts +0 -130
  122. package/src/mappings/CardInline.js +0 -52
  123. package/src/mappings/CardInline.ts +0 -61
  124. package/src/mappings/Container.js +0 -30
  125. package/src/mappings/Container.ts +0 -41
  126. package/src/mappings/NativeBase/Layout.js +0 -101
  127. package/src/mappings/NativeBase/Layout.ts +0 -116
  128. package/src/mappings/ProgressIndicator.js +0 -181
  129. package/src/mappings/ProgressIndicator.ts +0 -190
@@ -1,200 +1,124 @@
1
- import { GROUPS, FORM_TYPES, PROP_TYPES, COMPONENT_TYPES, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections, createStaticBoolProp, } from "@draftbit/types";
2
+ const SHARED_SEED_DATA = {
3
+ category: COMPONENT_TYPES.layout,
4
+ packageName: "native-base",
5
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
6
+ };
7
+ const CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX = CONTAINER_COMPONENT_STYLES_SECTIONS.filter((item) => item !== StylesPanelSections.LayoutFlexItems &&
8
+ item !== StylesPanelSections.LayoutContent);
2
9
  export const SEED_DATA = [
3
10
  {
4
- name: "Row",
5
- tag: "Row",
6
- category: COMPONENT_TYPES.deprecated,
7
- stylesPanelSections: [StylesPanelSections.NoStyles],
11
+ name: "Aspect Ratio",
12
+ tag: "AspectRatio",
13
+ description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
14
+ ...SHARED_SEED_DATA,
8
15
  props: {
9
- justifyContent: {
10
- label: "Align Horizontally",
11
- group: GROUPS.style,
12
- description: "Align Items Horizontally (on the X Axis)",
13
- formType: FORM_TYPES.string,
14
- propType: PROP_TYPES.STRING,
15
- defaultValue: "flex-start",
16
- editable: true,
17
- required: false,
18
- },
19
- alignItems: {
20
- label: "Align Vertically",
21
- group: GROUPS.style,
22
- description: "Align Items Vertically (on the Y Axis)",
23
- formType: FORM_TYPES.string,
24
- propType: PROP_TYPES.STRING,
25
- defaultValue: "flex-start",
26
- editable: true,
27
- required: false,
28
- },
16
+ ratio: createStaticNumberProp({
17
+ label: "Ratio",
18
+ description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
19
+ defaultValue: 1.33,
20
+ }),
29
21
  },
22
+ stylesPanelSections: [
23
+ StylesPanelSections.Background,
24
+ StylesPanelSections.Size,
25
+ StylesPanelSections.Margins,
26
+ StylesPanelSections.Position,
27
+ StylesPanelSections.Borders,
28
+ StylesPanelSections.Effects,
29
+ ],
30
30
  },
31
31
  {
32
- name: "Spacer",
33
- tag: "Spacer",
34
- category: COMPONENT_TYPES.layout,
32
+ name: "Box",
33
+ tag: "Box",
34
+ description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
35
+ ...SHARED_SEED_DATA,
36
+ },
37
+ {
38
+ name: "Center",
39
+ tag: "Center",
40
+ description: "Center aligns its contents to the center within itself",
41
+ ...SHARED_SEED_DATA,
42
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
43
+ },
44
+ {
45
+ name: "Circle",
46
+ tag: "Circle",
47
+ description: "Center aligns its contents to the center within itself with a round border radius",
48
+ ...SHARED_SEED_DATA,
49
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
50
+ },
51
+ {
52
+ name: "Container",
53
+ tag: "Container",
54
+ description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
35
55
  props: {
36
- top: {
37
- label: "Top",
38
- description: "Top",
39
- formType: FORM_TYPES.number,
40
- propType: PROP_TYPES.NUMBER,
41
- group: GROUPS.style,
42
- defaultValue: 8,
43
- editable: true,
44
- required: false,
45
- },
46
- right: {
47
- label: "Right",
48
- description: "Right",
49
- formType: FORM_TYPES.number,
50
- propType: PROP_TYPES.NUMBER,
51
- group: GROUPS.style,
52
- defaultValue: 8,
53
- editable: true,
54
- required: false,
55
- },
56
- bottom: {
57
- label: "Bottom",
58
- description: "Bottom",
59
- formType: FORM_TYPES.number,
60
- propType: PROP_TYPES.NUMBER,
61
- group: GROUPS.style,
62
- defaultValue: 8,
63
- editable: true,
64
- required: false,
65
- },
66
- left: {
67
- label: "Left",
68
- description: "Left",
69
- formType: FORM_TYPES.number,
70
- propType: PROP_TYPES.NUMBER,
71
- group: GROUPS.style,
72
- defaultValue: 8,
73
- editable: true,
74
- required: false,
75
- },
56
+ centerContent: createStaticBoolProp({
57
+ label: "Center content",
58
+ description: "Center child elements based on their content width",
59
+ defaultValue: true,
60
+ }),
76
61
  },
62
+ ...SHARED_SEED_DATA,
77
63
  },
78
64
  {
79
- name: "Stack",
80
- tag: "Stack",
81
- category: COMPONENT_TYPES.deprecated,
82
- stylesPanelSections: [StylesPanelSections.NoStyles],
83
- props: {
84
- justifyContent: {
85
- group: GROUPS.style,
86
- label: "Justify",
87
- description: "Justify horizontally",
88
- formType: FORM_TYPES.string,
89
- propType: PROP_TYPES.STRING,
90
- defaultValue: "flex-start",
91
- editable: true,
92
- required: false,
93
- },
94
- alignItems: {
95
- group: GROUPS.style,
96
- label: "Align",
97
- description: "Vertical align",
98
- formType: FORM_TYPES.string,
99
- propType: PROP_TYPES.STRING,
100
- defaultValue: "flex-start",
101
- editable: true,
102
- required: false,
103
- },
65
+ name: "Column",
66
+ tag: "Column",
67
+ description: "Column aligns items vertically",
68
+ layout: {
69
+ flexDirection: "column",
104
70
  },
71
+ ...SHARED_SEED_DATA,
105
72
  },
106
73
  {
107
- name: "Center",
108
- tag: "Center",
109
- category: COMPONENT_TYPES.layout,
110
- stylesPanelSections: [StylesPanelSections.NoStyles],
111
- props: {
112
- width: {
113
- label: "Width",
114
- description: "Width",
115
- formType: FORM_TYPES.number,
116
- propType: PROP_TYPES.NUMBER,
117
- group: GROUPS.style,
118
- defaultValue: 240,
119
- editable: true,
120
- required: false,
121
- },
122
- height: {
123
- label: "Height",
124
- description: "Height",
125
- formType: FORM_TYPES.number,
126
- propType: PROP_TYPES.NUMBER,
127
- group: GROUPS.style,
128
- defaultValue: 200,
129
- editable: true,
130
- required: false,
131
- },
132
- bgColor: {
133
- label: "Background Color",
134
- description: "Background color",
135
- formType: FORM_TYPES.color,
136
- propType: PROP_TYPES.THEME,
137
- editable: true,
138
- required: false,
139
- defaultValue: "light",
140
- group: GROUPS.style,
141
- },
74
+ name: "Row",
75
+ tag: "Row",
76
+ description: "Column aligns items horizontally",
77
+ layout: {
78
+ flexDirection: "row",
142
79
  },
80
+ ...SHARED_SEED_DATA,
143
81
  },
144
82
  {
145
- name: "Circle",
146
- tag: "Circle",
147
- category: COMPONENT_TYPES.layout,
148
- stylesPanelSections: [StylesPanelSections.NoStyles],
83
+ name: "Spacer",
84
+ tag: "Spacer",
85
+ description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
86
+ layout: {
87
+ flex: 1,
88
+ },
89
+ ...SHARED_SEED_DATA,
90
+ stylesPanelSections: [
91
+ StylesPanelSections.LayoutSelectedItem,
92
+ StylesPanelSections.Background,
93
+ StylesPanelSections.Margins,
94
+ ],
95
+ },
96
+ {
97
+ name: "Stack",
98
+ tag: "Stack",
99
+ description: "Stack aligns items vertically or horizontally based on the direction prop",
100
+ ...SHARED_SEED_DATA,
149
101
  props: {
150
- size: {
151
- label: "Size",
152
- description: "Size",
153
- formType: FORM_TYPES.number,
154
- propType: PROP_TYPES.NUMBER,
155
- group: GROUPS.style,
156
- defaultValue: 50,
157
- editable: true,
158
- required: false,
159
- },
160
- bgColor: {
161
- label: "Background Color",
162
- description: "Background color",
163
- formType: FORM_TYPES.color,
164
- propType: PROP_TYPES.THEME,
165
- editable: true,
166
- required: false,
167
- defaultValue: "light",
168
- group: GROUPS.style,
169
- },
102
+ isDisabled: createBoolProp({
103
+ label: "Disabled",
104
+ description: "If true, the Stack will be disabled",
105
+ }),
106
+ isInvalid: createBoolProp({
107
+ label: "Invalid",
108
+ description: "If true, the Stack will be invalid",
109
+ }),
170
110
  },
171
111
  },
172
112
  {
173
- name: "Square",
174
- tag: "Square",
175
- category: COMPONENT_TYPES.layout,
176
- stylesPanelSections: [StylesPanelSections.NoStyles],
113
+ name: "ZStack",
114
+ tag: "ZStack",
115
+ description: "ZStack aligns items to the z-axis",
116
+ ...SHARED_SEED_DATA,
177
117
  props: {
178
- size: {
179
- label: "Size",
180
- description: "Size",
181
- formType: FORM_TYPES.number,
182
- propType: PROP_TYPES.NUMBER,
183
- group: GROUPS.style,
184
- defaultValue: 50,
185
- editable: true,
186
- required: false,
187
- },
188
- bgColor: {
189
- label: "Background Color",
190
- description: "Background color",
191
- formType: FORM_TYPES.color,
192
- propType: PROP_TYPES.THEME,
193
- editable: true,
194
- required: false,
195
- defaultValue: "light",
196
- group: GROUPS.style,
197
- },
118
+ reversed: createBoolProp({
119
+ label: "Reversed",
120
+ description: "Determines whether to reverse the direction of items",
121
+ }),
198
122
  },
199
123
  },
200
124
  ];
@@ -1,207 +1,145 @@
1
1
  import {
2
- GROUPS,
3
- FORM_TYPES,
4
- PROP_TYPES,
5
2
  COMPONENT_TYPES,
3
+ createBoolProp,
4
+ CONTAINER_COMPONENT_STYLES_SECTIONS,
5
+ createStaticNumberProp,
6
6
  StylesPanelSections,
7
+ createStaticBoolProp,
7
8
  } from "@draftbit/types";
8
9
 
10
+ const SHARED_SEED_DATA = {
11
+ category: COMPONENT_TYPES.layout,
12
+ packageName: "native-base",
13
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
14
+ };
15
+
16
+ const CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX =
17
+ CONTAINER_COMPONENT_STYLES_SECTIONS.filter(
18
+ (item) =>
19
+ item !== StylesPanelSections.LayoutFlexItems &&
20
+ item !== StylesPanelSections.LayoutContent
21
+ );
22
+
9
23
  export const SEED_DATA = [
10
24
  {
11
- name: "Row",
12
- tag: "Row",
13
- category: COMPONENT_TYPES.deprecated,
14
- stylesPanelSections: [StylesPanelSections.NoStyles],
25
+ name: "Aspect Ratio",
26
+ tag: "AspectRatio",
27
+ description:
28
+ "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
29
+ ...SHARED_SEED_DATA,
15
30
  props: {
16
- justifyContent: {
17
- label: "Align Horizontally",
18
- group: GROUPS.style,
19
- description: "Align Items Horizontally (on the X Axis)",
20
- formType: FORM_TYPES.string,
21
- propType: PROP_TYPES.STRING,
22
- defaultValue: "flex-start",
23
- editable: true,
24
- required: false,
25
- },
26
- alignItems: {
27
- label: "Align Vertically",
28
- group: GROUPS.style,
29
- description: "Align Items Vertically (on the Y Axis)",
30
- formType: FORM_TYPES.string,
31
- propType: PROP_TYPES.STRING,
32
- defaultValue: "flex-start",
33
- editable: true,
34
- required: false,
35
- },
31
+ ratio: createStaticNumberProp({
32
+ label: "Ratio",
33
+ description:
34
+ "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
35
+ defaultValue: 1.33,
36
+ }),
36
37
  },
38
+ stylesPanelSections: [
39
+ StylesPanelSections.Background,
40
+ StylesPanelSections.Size,
41
+ StylesPanelSections.Margins,
42
+ StylesPanelSections.Position,
43
+ StylesPanelSections.Borders,
44
+ StylesPanelSections.Effects,
45
+ ],
37
46
  },
38
47
  {
39
- name: "Spacer",
40
- tag: "Spacer",
41
- category: COMPONENT_TYPES.layout,
48
+ name: "Box",
49
+ tag: "Box",
50
+ description:
51
+ "This is a generic component for low level layout needs. It is similar to a div in HTML",
52
+ ...SHARED_SEED_DATA,
53
+ },
54
+ {
55
+ name: "Center",
56
+ tag: "Center",
57
+ description: "Center aligns its contents to the center within itself",
58
+ ...SHARED_SEED_DATA,
59
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
60
+ },
61
+ {
62
+ name: "Circle",
63
+ tag: "Circle",
64
+ description:
65
+ "Center aligns its contents to the center within itself with a round border radius",
66
+ ...SHARED_SEED_DATA,
67
+ stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
68
+ },
69
+ {
70
+ name: "Container",
71
+ tag: "Container",
72
+ description:
73
+ "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
42
74
  props: {
43
- top: {
44
- label: "Top",
45
- description: "Top",
46
- formType: FORM_TYPES.number,
47
- propType: PROP_TYPES.NUMBER,
48
- group: GROUPS.style,
49
- defaultValue: 8,
50
- editable: true,
51
- required: false,
52
- },
53
- right: {
54
- label: "Right",
55
- description: "Right",
56
- formType: FORM_TYPES.number,
57
- propType: PROP_TYPES.NUMBER,
58
- group: GROUPS.style,
59
- defaultValue: 8,
60
- editable: true,
61
- required: false,
62
- },
63
- bottom: {
64
- label: "Bottom",
65
- description: "Bottom",
66
- formType: FORM_TYPES.number,
67
- propType: PROP_TYPES.NUMBER,
68
- group: GROUPS.style,
69
- defaultValue: 8,
70
- editable: true,
71
- required: false,
72
- },
73
- left: {
74
- label: "Left",
75
- description: "Left",
76
- formType: FORM_TYPES.number,
77
- propType: PROP_TYPES.NUMBER,
78
- group: GROUPS.style,
79
- defaultValue: 8,
80
- editable: true,
81
- required: false,
82
- },
75
+ centerContent: createStaticBoolProp({
76
+ label: "Center content",
77
+ description: "Center child elements based on their content width",
78
+ defaultValue: true,
79
+ }),
83
80
  },
81
+ ...SHARED_SEED_DATA,
84
82
  },
85
83
  {
86
- name: "Stack",
87
- tag: "Stack",
88
- category: COMPONENT_TYPES.deprecated,
89
- stylesPanelSections: [StylesPanelSections.NoStyles],
90
- props: {
91
- justifyContent: {
92
- group: GROUPS.style,
93
- label: "Justify",
94
- description: "Justify horizontally",
95
- formType: FORM_TYPES.string,
96
- propType: PROP_TYPES.STRING,
97
- defaultValue: "flex-start",
98
- editable: true,
99
- required: false,
100
- },
101
- alignItems: {
102
- group: GROUPS.style,
103
- label: "Align",
104
- description: "Vertical align",
105
- formType: FORM_TYPES.string,
106
- propType: PROP_TYPES.STRING,
107
- defaultValue: "flex-start",
108
- editable: true,
109
- required: false,
110
- },
84
+ name: "Column",
85
+ tag: "Column",
86
+ description: "Column aligns items vertically",
87
+ layout: {
88
+ flexDirection: "column",
111
89
  },
90
+ ...SHARED_SEED_DATA,
112
91
  },
113
92
  {
114
- name: "Center",
115
- tag: "Center",
116
- category: COMPONENT_TYPES.layout,
117
- stylesPanelSections: [StylesPanelSections.NoStyles],
118
- props: {
119
- width: {
120
- label: "Width",
121
- description: "Width",
122
- formType: FORM_TYPES.number,
123
- propType: PROP_TYPES.NUMBER,
124
- group: GROUPS.style,
125
- defaultValue: 240,
126
- editable: true,
127
- required: false,
128
- },
129
- height: {
130
- label: "Height",
131
- description: "Height",
132
- formType: FORM_TYPES.number,
133
- propType: PROP_TYPES.NUMBER,
134
- group: GROUPS.style,
135
- defaultValue: 200,
136
- editable: true,
137
- required: false,
138
- },
139
- bgColor: {
140
- label: "Background Color",
141
- description: "Background color",
142
- formType: FORM_TYPES.color,
143
- propType: PROP_TYPES.THEME,
144
- editable: true,
145
- required: false,
146
- defaultValue: "light",
147
- group: GROUPS.style,
148
- },
93
+ name: "Row",
94
+ tag: "Row",
95
+ description: "Column aligns items horizontally",
96
+ layout: {
97
+ flexDirection: "row",
149
98
  },
99
+ ...SHARED_SEED_DATA,
150
100
  },
151
101
  {
152
- name: "Circle",
153
- tag: "Circle",
154
- category: COMPONENT_TYPES.layout,
155
- stylesPanelSections: [StylesPanelSections.NoStyles],
102
+ name: "Spacer",
103
+ tag: "Spacer",
104
+ description:
105
+ "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
106
+ layout: {
107
+ flex: 1,
108
+ },
109
+ ...SHARED_SEED_DATA,
110
+ stylesPanelSections: [
111
+ StylesPanelSections.LayoutSelectedItem,
112
+ StylesPanelSections.Background,
113
+ StylesPanelSections.Margins,
114
+ ],
115
+ },
116
+ {
117
+ name: "Stack",
118
+ tag: "Stack",
119
+ description:
120
+ "Stack aligns items vertically or horizontally based on the direction prop",
121
+ ...SHARED_SEED_DATA,
156
122
  props: {
157
- size: {
158
- label: "Size",
159
- description: "Size",
160
- formType: FORM_TYPES.number,
161
- propType: PROP_TYPES.NUMBER,
162
- group: GROUPS.style,
163
- defaultValue: 50,
164
- editable: true,
165
- required: false,
166
- },
167
- bgColor: {
168
- label: "Background Color",
169
- description: "Background color",
170
- formType: FORM_TYPES.color,
171
- propType: PROP_TYPES.THEME,
172
- editable: true,
173
- required: false,
174
- defaultValue: "light",
175
- group: GROUPS.style,
176
- },
123
+ isDisabled: createBoolProp({
124
+ label: "Disabled",
125
+ description: "If true, the Stack will be disabled",
126
+ }),
127
+ isInvalid: createBoolProp({
128
+ label: "Invalid",
129
+ description: "If true, the Stack will be invalid",
130
+ }),
177
131
  },
178
132
  },
179
133
  {
180
- name: "Square",
181
- tag: "Square",
182
- category: COMPONENT_TYPES.layout,
183
- stylesPanelSections: [StylesPanelSections.NoStyles],
134
+ name: "ZStack",
135
+ tag: "ZStack",
136
+ description: "ZStack aligns items to the z-axis",
137
+ ...SHARED_SEED_DATA,
184
138
  props: {
185
- size: {
186
- label: "Size",
187
- description: "Size",
188
- formType: FORM_TYPES.number,
189
- propType: PROP_TYPES.NUMBER,
190
- group: GROUPS.style,
191
- defaultValue: 50,
192
- editable: true,
193
- required: false,
194
- },
195
- bgColor: {
196
- label: "Background Color",
197
- description: "Background color",
198
- formType: FORM_TYPES.color,
199
- propType: PROP_TYPES.THEME,
200
- editable: true,
201
- required: false,
202
- defaultValue: "light",
203
- group: GROUPS.style,
204
- },
139
+ reversed: createBoolProp({
140
+ label: "Reversed",
141
+ description: "Determines whether to reverse the direction of items",
142
+ }),
205
143
  },
206
144
  },
207
145
  ];