@draftbit/core 46.10.3-6f5759.2 → 46.10.3-e89832.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 (69) hide show
  1. package/lib/commonjs/components/AnimatedCircularProgress.js +12 -1
  2. package/lib/commonjs/components/AvatarEdit.js +15 -4
  3. package/lib/commonjs/components/Banner.js +23 -4
  4. package/lib/commonjs/components/Button.js +33 -10
  5. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
  6. package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
  7. package/lib/commonjs/components/Container.js +15 -4
  8. package/lib/commonjs/components/DeprecatedButton.js +20 -3
  9. package/lib/commonjs/components/Divider.js +14 -1
  10. package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
  11. package/lib/commonjs/components/Layout.js +40 -19
  12. package/lib/commonjs/components/NumberInput.js +12 -3
  13. package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
  14. package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
  15. package/lib/commonjs/components/Portal/PortalManager.js +34 -8
  16. package/lib/commonjs/components/RadioButton/RadioButton.js +13 -2
  17. package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +9 -1
  18. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +15 -2
  19. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +23 -5
  20. package/lib/commonjs/components/Row.js +73 -0
  21. package/lib/commonjs/components/RowBodyIcon.js +45 -0
  22. package/lib/commonjs/components/RowHeadlineImageCaption.js +45 -0
  23. package/lib/commonjs/components/RowHeadlineImageIcon.js +51 -0
  24. package/lib/commonjs/components/ScreenContainer.js +24 -6
  25. package/lib/commonjs/components/Shadow.js +15 -2
  26. package/lib/commonjs/components/Slider.js +21 -4
  27. package/lib/commonjs/components/StarRating.js +23 -4
  28. package/lib/commonjs/components/StepIndicator.js +57 -18
  29. package/lib/commonjs/components/Surface.js +14 -2
  30. package/lib/commonjs/components/Text.js +50 -4
  31. package/lib/commonjs/components/TextField.js +76 -28
  32. package/lib/commonjs/components/ToggleButton.js +15 -2
  33. package/lib/commonjs/components/Touchable.js +15 -2
  34. package/lib/commonjs/constants.js +1 -1
  35. package/lib/commonjs/index.js +21 -0
  36. package/lib/commonjs/styles/overlay.js +1 -3
  37. package/lib/commonjs/utilities.js +1 -2
  38. package/lib/module/components/Row.js +63 -0
  39. package/lib/module/components/RowBodyIcon.js +35 -0
  40. package/lib/module/components/RowHeadlineImageCaption.js +35 -0
  41. package/lib/module/components/RowHeadlineImageIcon.js +41 -0
  42. package/lib/module/index.js +3 -0
  43. package/lib/typescript/src/components/Row.d.ts +21 -0
  44. package/lib/typescript/src/components/Row.d.ts.map +1 -0
  45. package/lib/typescript/src/components/RowBodyIcon.d.ts +16 -0
  46. package/lib/typescript/src/components/RowBodyIcon.d.ts.map +1 -0
  47. package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts +16 -0
  48. package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts.map +1 -0
  49. package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts +18 -0
  50. package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts.map +1 -0
  51. package/lib/typescript/src/index.d.ts +3 -0
  52. package/lib/typescript/src/index.d.ts.map +1 -1
  53. package/package.json +3 -3
  54. package/src/components/Row.js +48 -0
  55. package/src/components/Row.tsx +108 -0
  56. package/src/components/RowBodyIcon.js +8 -0
  57. package/src/components/RowBodyIcon.tsx +47 -0
  58. package/src/components/RowHeadlineImageCaption.js +12 -0
  59. package/src/components/RowHeadlineImageCaption.tsx +49 -0
  60. package/src/components/RowHeadlineImageIcon.js +14 -0
  61. package/src/components/RowHeadlineImageIcon.tsx +61 -0
  62. package/src/index.js +3 -0
  63. package/src/index.tsx +3 -0
  64. package/lib/commonjs/mappings/NativeBase/Layout.js +0 -107
  65. package/lib/module/mappings/NativeBase/Layout.js +0 -100
  66. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +0 -117
  67. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +0 -1
  68. package/src/mappings/NativeBase/Layout.js +0 -112
  69. package/src/mappings/NativeBase/Layout.ts +0 -133
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { withTheme } from "../theming";
3
+ import type { Theme } from "../styles/DefaultTheme";
4
+ import type { IconSlot } from "../interfaces/Icon";
5
+
6
+ import Row from "./Row";
7
+ import Config from "./Config";
8
+ import { ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
9
+
10
+ type Props = {
11
+ title?: string;
12
+ image: string | ImageSourcePropType;
13
+ subtitle?: string;
14
+ multilineSubtitle?: boolean;
15
+ icon: string;
16
+ style?: StyleProp<ViewStyle>;
17
+ theme: Theme;
18
+ } & IconSlot;
19
+
20
+ const RowHeadlineImageIcon: React.FC<React.PropsWithChildren<Props>> = ({
21
+ Icon,
22
+ icon,
23
+ title,
24
+ image,
25
+ subtitle,
26
+ multilineSubtitle = false,
27
+ style,
28
+ theme: { colors, typography },
29
+ }) => {
30
+ return (
31
+ <Row
32
+ titleTypeStyle={typography.headline6}
33
+ titleColor={colors.strong}
34
+ subtitleTypeStyle={typography.body2}
35
+ subtitleColor={colors.medium}
36
+ title={title}
37
+ subtitle={subtitle}
38
+ multilineSubtitle={multilineSubtitle}
39
+ image={image}
40
+ right={() => (
41
+ <Icon
42
+ name={icon}
43
+ size={
44
+ multilineSubtitle
45
+ ? Config.rowMultiLineIconSize
46
+ : Config.rowSingleLineIconSize
47
+ }
48
+ color={colors.light}
49
+ style={{
50
+ marginLeft: 16,
51
+ alignSelf: multilineSubtitle ? "flex-start" : "center",
52
+ marginTop: multilineSubtitle ? 4 : 0,
53
+ }}
54
+ />
55
+ )}
56
+ style={style}
57
+ />
58
+ );
59
+ };
60
+
61
+ export default withTheme(RowHeadlineImageIcon);
package/src/index.js CHANGED
@@ -42,6 +42,9 @@ export { default as DatePicker } from "./components/DatePicker/DatePicker";
42
42
  export { default as Picker } from "./components/Picker/Picker";
43
43
  export { default as ProgressBar } from "./components/ProgressBar";
44
44
  export { default as ProgressCircle } from "./components/ProgressCircle";
45
+ export { default as RowBodyIcon } from "./components/RowBodyIcon";
46
+ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImageCaption";
47
+ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
45
48
  export { default as Slider } from "./components/Slider";
46
49
  export { default as Stepper } from "./components/Stepper";
47
50
  export { useAuthState } from "./components/useAuthState";
package/src/index.tsx CHANGED
@@ -67,6 +67,9 @@ export { default as DatePicker } from "./components/DatePicker/DatePicker";
67
67
  export { default as Picker } from "./components/Picker/Picker";
68
68
  export { default as ProgressBar } from "./components/ProgressBar";
69
69
  export { default as ProgressCircle } from "./components/ProgressCircle";
70
+ export { default as RowBodyIcon } from "./components/RowBodyIcon";
71
+ export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImageCaption";
72
+ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
70
73
  export { default as Slider } from "./components/Slider";
71
74
  export { default as Stepper } from "./components/Stepper";
72
75
  export { useAuthState } from "./components/useAuthState";
@@ -1,107 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SEED_DATA = void 0;
7
- var _types = require("@draftbit/types");
8
- const SHARED_SEED_DATA = {
9
- category: _types.COMPONENT_TYPES.layout,
10
- packageName: "native-base",
11
- stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS
12
- };
13
- const CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX = _types.CONTAINER_COMPONENT_STYLES_SECTIONS.filter(item => item !== _types.StylesPanelSections.LayoutFlexItems && item !== _types.StylesPanelSections.LayoutContent);
14
- const SEED_DATA = [{
15
- name: "Aspect Ratio",
16
- tag: "AspectRatio",
17
- description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
18
- ...SHARED_SEED_DATA,
19
- props: {
20
- ratio: (0, _types.createStaticNumberProp)({
21
- label: "Ratio",
22
- description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
23
- defaultValue: 1.33
24
- })
25
- }
26
- }, {
27
- name: "Box",
28
- tag: "Box",
29
- description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
30
- ...SHARED_SEED_DATA
31
- }, {
32
- name: "Center",
33
- tag: "Center",
34
- description: "Center aligns its contents to the center within itself",
35
- ...SHARED_SEED_DATA,
36
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
37
- }, {
38
- name: "Circle",
39
- tag: "Circle",
40
- description: "Center aligns its contents to the center within itself with a round border radius",
41
- ...SHARED_SEED_DATA,
42
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
43
- }, {
44
- name: "Container",
45
- tag: "Container",
46
- description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
47
- ...SHARED_SEED_DATA
48
- }, {
49
- name: "Column",
50
- tag: "Column",
51
- description: "Column aligns items vertically",
52
- layout: {
53
- flexDirection: "column"
54
- },
55
- ...SHARED_SEED_DATA
56
- }, {
57
- name: "Row",
58
- tag: "Row",
59
- description: "Column aligns items horizontally",
60
- layout: {
61
- flexDirection: "row"
62
- },
63
- ...SHARED_SEED_DATA
64
- }, {
65
- name: "Spacer",
66
- tag: "Spacer",
67
- description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
68
- ...SHARED_SEED_DATA,
69
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
70
- }, {
71
- name: "Stack",
72
- tag: "Stack",
73
- description: "Stack aligns items vertically or horizontally based on the direction prop",
74
- ...SHARED_SEED_DATA,
75
- props: {
76
- direction: (0, _types.createTextEnumProp)({
77
- label: "Direction",
78
- description: "The direction of the Stack",
79
- options: ["row", "column"],
80
- defaultValue: "column"
81
- }),
82
- reversed: (0, _types.createBoolProp)({
83
- label: "Reversed",
84
- description: "Determines whether to reverse the direction of items"
85
- }),
86
- isDisabled: (0, _types.createBoolProp)({
87
- label: "Disabled",
88
- description: "If true, the Stack will be disabled"
89
- }),
90
- isInvalid: (0, _types.createBoolProp)({
91
- label: "Invalid",
92
- description: "If true, the Stack will be invalid"
93
- })
94
- }
95
- }, {
96
- name: "ZStack",
97
- tag: "ZStack",
98
- description: "ZStack aligns items to the z-axis",
99
- ...SHARED_SEED_DATA,
100
- props: {
101
- reversed: (0, _types.createBoolProp)({
102
- label: "Reversed",
103
- description: "Determines whether to reverse the direction of items"
104
- })
105
- }
106
- }];
107
- exports.SEED_DATA = SEED_DATA;
@@ -1,100 +0,0 @@
1
- import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections } 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 && item !== StylesPanelSections.LayoutContent);
8
- export const SEED_DATA = [{
9
- name: "Aspect Ratio",
10
- tag: "AspectRatio",
11
- description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
12
- ...SHARED_SEED_DATA,
13
- props: {
14
- ratio: createStaticNumberProp({
15
- label: "Ratio",
16
- description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
17
- defaultValue: 1.33
18
- })
19
- }
20
- }, {
21
- name: "Box",
22
- tag: "Box",
23
- description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
24
- ...SHARED_SEED_DATA
25
- }, {
26
- name: "Center",
27
- tag: "Center",
28
- description: "Center aligns its contents to the center within itself",
29
- ...SHARED_SEED_DATA,
30
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
31
- }, {
32
- name: "Circle",
33
- tag: "Circle",
34
- description: "Center aligns its contents to the center within itself with a round border radius",
35
- ...SHARED_SEED_DATA,
36
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
37
- }, {
38
- name: "Container",
39
- tag: "Container",
40
- description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
41
- ...SHARED_SEED_DATA
42
- }, {
43
- name: "Column",
44
- tag: "Column",
45
- description: "Column aligns items vertically",
46
- layout: {
47
- flexDirection: "column"
48
- },
49
- ...SHARED_SEED_DATA
50
- }, {
51
- name: "Row",
52
- tag: "Row",
53
- description: "Column aligns items horizontally",
54
- layout: {
55
- flexDirection: "row"
56
- },
57
- ...SHARED_SEED_DATA
58
- }, {
59
- name: "Spacer",
60
- tag: "Spacer",
61
- description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
62
- ...SHARED_SEED_DATA,
63
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
64
- }, {
65
- name: "Stack",
66
- tag: "Stack",
67
- description: "Stack aligns items vertically or horizontally based on the direction prop",
68
- ...SHARED_SEED_DATA,
69
- props: {
70
- direction: createTextEnumProp({
71
- label: "Direction",
72
- description: "The direction of the Stack",
73
- options: ["row", "column"],
74
- defaultValue: "column"
75
- }),
76
- reversed: createBoolProp({
77
- label: "Reversed",
78
- description: "Determines whether to reverse the direction of items"
79
- }),
80
- isDisabled: createBoolProp({
81
- label: "Disabled",
82
- description: "If true, the Stack will be disabled"
83
- }),
84
- isInvalid: createBoolProp({
85
- label: "Invalid",
86
- description: "If true, the Stack will be invalid"
87
- })
88
- }
89
- }, {
90
- name: "ZStack",
91
- tag: "ZStack",
92
- description: "ZStack aligns items to the z-axis",
93
- ...SHARED_SEED_DATA,
94
- props: {
95
- reversed: createBoolProp({
96
- label: "Reversed",
97
- description: "Determines whether to reverse the direction of items"
98
- })
99
- }
100
- }];
@@ -1,117 +0,0 @@
1
- export declare const SEED_DATA: ({
2
- props: {
3
- ratio: {
4
- label: string;
5
- description: string;
6
- formType: string;
7
- propType: string;
8
- group: string;
9
- defaultValue: null;
10
- editable: boolean;
11
- required: boolean;
12
- step: number;
13
- };
14
- direction?: undefined;
15
- reversed?: undefined;
16
- isDisabled?: undefined;
17
- isInvalid?: undefined;
18
- };
19
- category: string;
20
- packageName: string;
21
- stylesPanelSections: string[];
22
- name: string;
23
- tag: string;
24
- description: string;
25
- } | {
26
- category: string;
27
- packageName: string;
28
- stylesPanelSections: string[];
29
- name: string;
30
- tag: string;
31
- description: string;
32
- } | {
33
- category: string;
34
- packageName: string;
35
- stylesPanelSections: string[];
36
- name: string;
37
- tag: string;
38
- description: string;
39
- layout: {
40
- flexDirection: string;
41
- };
42
- } | {
43
- props: {
44
- direction: {
45
- group: string;
46
- label: string;
47
- description: string;
48
- editable: boolean;
49
- required: boolean;
50
- formType: string;
51
- propType: string;
52
- defaultValue: null;
53
- options: never[];
54
- };
55
- reversed: {
56
- label: string;
57
- description: string;
58
- formType: string;
59
- propType: string;
60
- defaultValue: boolean;
61
- editable: boolean;
62
- required: boolean;
63
- group: string;
64
- };
65
- isDisabled: {
66
- label: string;
67
- description: string;
68
- formType: string;
69
- propType: string;
70
- defaultValue: boolean;
71
- editable: boolean;
72
- required: boolean;
73
- group: string;
74
- };
75
- isInvalid: {
76
- label: string;
77
- description: string;
78
- formType: string;
79
- propType: string;
80
- defaultValue: boolean;
81
- editable: boolean;
82
- required: boolean;
83
- group: string;
84
- };
85
- ratio?: undefined;
86
- };
87
- category: string;
88
- packageName: string;
89
- stylesPanelSections: string[];
90
- name: string;
91
- tag: string;
92
- description: string;
93
- } | {
94
- props: {
95
- reversed: {
96
- label: string;
97
- description: string;
98
- formType: string;
99
- propType: string;
100
- defaultValue: boolean;
101
- editable: boolean;
102
- required: boolean;
103
- group: string;
104
- };
105
- ratio?: undefined;
106
- direction?: undefined;
107
- isDisabled?: undefined;
108
- isInvalid?: undefined;
109
- };
110
- category: string;
111
- packageName: string;
112
- stylesPanelSections: string[];
113
- name: string;
114
- tag: string;
115
- description: string;
116
- })[];
117
- //# sourceMappingURL=Layout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/NativeBase/Layout.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8GrB,CAAC"}
@@ -1,112 +0,0 @@
1
- import { COMPONENT_TYPES, createTextEnumProp, createBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, createStaticNumberProp, StylesPanelSections, } 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);
9
- export const SEED_DATA = [
10
- {
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,
15
- props: {
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
- }),
21
- },
22
- },
23
- {
24
- name: "Box",
25
- tag: "Box",
26
- description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
27
- ...SHARED_SEED_DATA,
28
- },
29
- {
30
- name: "Center",
31
- tag: "Center",
32
- description: "Center aligns its contents to the center within itself",
33
- ...SHARED_SEED_DATA,
34
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
35
- },
36
- {
37
- name: "Circle",
38
- tag: "Circle",
39
- description: "Center aligns its contents to the center within itself with a round border radius",
40
- ...SHARED_SEED_DATA,
41
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
42
- },
43
- {
44
- name: "Container",
45
- tag: "Container",
46
- description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
47
- ...SHARED_SEED_DATA,
48
- },
49
- {
50
- name: "Column",
51
- tag: "Column",
52
- description: "Column aligns items vertically",
53
- layout: {
54
- flexDirection: "column",
55
- },
56
- ...SHARED_SEED_DATA,
57
- },
58
- {
59
- name: "Row",
60
- tag: "Row",
61
- description: "Column aligns items horizontally",
62
- layout: {
63
- flexDirection: "row",
64
- },
65
- ...SHARED_SEED_DATA,
66
- },
67
- {
68
- name: "Spacer",
69
- tag: "Spacer",
70
- description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
71
- ...SHARED_SEED_DATA,
72
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
73
- },
74
- {
75
- name: "Stack",
76
- tag: "Stack",
77
- description: "Stack aligns items vertically or horizontally based on the direction prop",
78
- ...SHARED_SEED_DATA,
79
- props: {
80
- direction: createTextEnumProp({
81
- label: "Direction",
82
- description: "The direction of the Stack",
83
- options: ["row", "column"],
84
- defaultValue: "column",
85
- }),
86
- reversed: createBoolProp({
87
- label: "Reversed",
88
- description: "Determines whether to reverse the direction of items",
89
- }),
90
- isDisabled: createBoolProp({
91
- label: "Disabled",
92
- description: "If true, the Stack will be disabled",
93
- }),
94
- isInvalid: createBoolProp({
95
- label: "Invalid",
96
- description: "If true, the Stack will be invalid",
97
- }),
98
- },
99
- },
100
- {
101
- name: "ZStack",
102
- tag: "ZStack",
103
- description: "ZStack aligns items to the z-axis",
104
- ...SHARED_SEED_DATA,
105
- props: {
106
- reversed: createBoolProp({
107
- label: "Reversed",
108
- description: "Determines whether to reverse the direction of items",
109
- }),
110
- },
111
- },
112
- ];
@@ -1,133 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createTextEnumProp,
4
- createBoolProp,
5
- CONTAINER_COMPONENT_STYLES_SECTIONS,
6
- createStaticNumberProp,
7
- StylesPanelSections,
8
- } from "@draftbit/types";
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
-
23
- export const SEED_DATA = [
24
- {
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,
30
- props: {
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
- }),
37
- },
38
- },
39
- {
40
- name: "Box",
41
- tag: "Box",
42
- description:
43
- "This is a generic component for low level layout needs. It is similar to a div in HTML",
44
- ...SHARED_SEED_DATA,
45
- },
46
- {
47
- name: "Center",
48
- tag: "Center",
49
- description: "Center aligns its contents to the center within itself",
50
- ...SHARED_SEED_DATA,
51
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
52
- },
53
- {
54
- name: "Circle",
55
- tag: "Circle",
56
- description:
57
- "Center aligns its contents to the center within itself with a round border radius",
58
- ...SHARED_SEED_DATA,
59
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
60
- },
61
- {
62
- name: "Container",
63
- tag: "Container",
64
- description:
65
- "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
66
- ...SHARED_SEED_DATA,
67
- },
68
- {
69
- name: "Column",
70
- tag: "Column",
71
- description: "Column aligns items vertically",
72
- layout: {
73
- flexDirection: "column",
74
- },
75
- ...SHARED_SEED_DATA,
76
- },
77
- {
78
- name: "Row",
79
- tag: "Row",
80
- description: "Column aligns items horizontally",
81
- layout: {
82
- flexDirection: "row",
83
- },
84
- ...SHARED_SEED_DATA,
85
- },
86
- {
87
- name: "Spacer",
88
- tag: "Spacer",
89
- description:
90
- "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
91
- ...SHARED_SEED_DATA,
92
- stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX,
93
- },
94
- {
95
- name: "Stack",
96
- tag: "Stack",
97
- description:
98
- "Stack aligns items vertically or horizontally based on the direction prop",
99
- ...SHARED_SEED_DATA,
100
- props: {
101
- direction: createTextEnumProp({
102
- label: "Direction",
103
- description: "The direction of the Stack",
104
- options: ["row", "column"],
105
- defaultValue: "column",
106
- }),
107
- reversed: createBoolProp({
108
- label: "Reversed",
109
- description: "Determines whether to reverse the direction of items",
110
- }),
111
- isDisabled: createBoolProp({
112
- label: "Disabled",
113
- description: "If true, the Stack will be disabled",
114
- }),
115
- isInvalid: createBoolProp({
116
- label: "Invalid",
117
- description: "If true, the Stack will be invalid",
118
- }),
119
- },
120
- },
121
- {
122
- name: "ZStack",
123
- tag: "ZStack",
124
- description: "ZStack aligns items to the z-axis",
125
- ...SHARED_SEED_DATA,
126
- props: {
127
- reversed: createBoolProp({
128
- label: "Reversed",
129
- description: "Determines whether to reverse the direction of items",
130
- }),
131
- },
132
- },
133
- ];