@draftbit/core 47.0.1-df014a.2 → 47.0.1-e04fa3.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 (95) hide show
  1. package/lib/commonjs/index.js +25 -82
  2. package/lib/commonjs/mappings/NativeBase/AlertDialog.js +102 -0
  3. package/lib/commonjs/mappings/NativeBase/Button.js +84 -0
  4. package/lib/commonjs/mappings/NativeBase/DataDisplay.js +61 -0
  5. package/lib/commonjs/mappings/NativeBase/Feedback.js +74 -0
  6. package/lib/commonjs/mappings/NativeBase/Layout.js +114 -0
  7. package/lib/commonjs/mappings/NativeBase/Media.js +49 -0
  8. package/lib/commonjs/mappings/NativeBase/Menu.js +111 -0
  9. package/lib/commonjs/mappings/NativeBase/Modal.js +93 -0
  10. package/lib/commonjs/mappings/NativeBase/Other.js +94 -0
  11. package/lib/commonjs/mappings/NativeBase/Popover.js +99 -0
  12. package/lib/commonjs/mappings/NativeBase/Select.js +65 -0
  13. package/lib/commonjs/mappings/NativeBase/Slider.js +81 -0
  14. package/lib/module/components/AvatarEdit.js +4 -15
  15. package/lib/module/components/CardBlock.js +4 -14
  16. package/lib/module/components/CircleImage.js +1 -16
  17. package/lib/module/components/DeprecatedCardWrapper.js +1 -18
  18. package/lib/module/components/FAB.js +4 -22
  19. package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
  20. package/lib/module/components/Picker/PickerComponent.web.js +3 -21
  21. package/lib/module/components/Switch.js +10 -21
  22. package/lib/module/components/TextField.js +28 -78
  23. package/lib/module/components/Touchable.js +1 -18
  24. package/lib/module/index.js +121 -31
  25. package/lib/module/mappings/NativeBase/AlertDialog.js +95 -0
  26. package/lib/module/mappings/NativeBase/Button.js +86 -0
  27. package/lib/module/mappings/NativeBase/DataDisplay.js +54 -0
  28. package/lib/module/mappings/NativeBase/Feedback.js +67 -0
  29. package/lib/module/mappings/NativeBase/Layout.js +107 -0
  30. package/lib/module/mappings/NativeBase/Media.js +42 -0
  31. package/lib/module/mappings/NativeBase/Menu.js +104 -0
  32. package/lib/module/mappings/NativeBase/Modal.js +86 -0
  33. package/lib/module/mappings/NativeBase/Other.js +87 -0
  34. package/lib/module/mappings/NativeBase/Popover.js +92 -0
  35. package/lib/module/mappings/NativeBase/Select.js +58 -0
  36. package/lib/module/mappings/NativeBase/Slider.js +74 -0
  37. package/lib/typescript/src/index.d.ts +102 -29
  38. package/lib/typescript/src/index.d.ts.map +1 -1
  39. package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts +146 -0
  40. package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts.map +1 -0
  41. package/lib/typescript/src/mappings/NativeBase/Button.d.ts +1 -0
  42. package/lib/typescript/src/mappings/NativeBase/Button.d.ts.map +1 -0
  43. package/lib/typescript/src/mappings/NativeBase/DataDisplay.d.ts +96 -0
  44. package/lib/typescript/src/mappings/NativeBase/DataDisplay.d.ts.map +1 -0
  45. package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts +2 -0
  46. package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts.map +1 -0
  47. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +146 -0
  48. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
  49. package/lib/typescript/src/mappings/NativeBase/Media.d.ts +48 -0
  50. package/lib/typescript/src/mappings/NativeBase/Media.d.ts.map +1 -0
  51. package/lib/typescript/src/mappings/NativeBase/Menu.d.ts +227 -0
  52. package/lib/typescript/src/mappings/NativeBase/Menu.d.ts.map +1 -0
  53. package/lib/typescript/src/mappings/NativeBase/Modal.d.ts +133 -0
  54. package/lib/typescript/src/mappings/NativeBase/Modal.d.ts.map +1 -0
  55. package/lib/typescript/src/mappings/NativeBase/Other.d.ts +179 -0
  56. package/lib/typescript/src/mappings/NativeBase/Other.d.ts.map +1 -0
  57. package/lib/typescript/src/mappings/NativeBase/Popover.d.ts +136 -0
  58. package/lib/typescript/src/mappings/NativeBase/Popover.d.ts.map +1 -0
  59. package/lib/typescript/src/mappings/NativeBase/Select.d.ts +156 -0
  60. package/lib/typescript/src/mappings/NativeBase/Select.d.ts.map +1 -0
  61. package/lib/typescript/src/mappings/NativeBase/Slider.d.ts +200 -0
  62. package/lib/typescript/src/mappings/NativeBase/Slider.d.ts.map +1 -0
  63. package/package.json +3 -3
  64. package/src/index.js +112 -31
  65. package/src/index.tsx +123 -43
  66. package/src/mappings/NativeBase/AlertDialog.js +112 -0
  67. package/src/mappings/NativeBase/AlertDialog.ts +128 -0
  68. package/src/mappings/NativeBase/Button.js +84 -0
  69. package/src/mappings/NativeBase/Button.ts +83 -0
  70. package/src/mappings/NativeBase/DataDisplay.js +67 -0
  71. package/src/mappings/NativeBase/DataDisplay.ts +79 -0
  72. package/src/mappings/NativeBase/Feedback.js +89 -0
  73. package/src/mappings/NativeBase/Feedback.ts +100 -0
  74. package/src/mappings/NativeBase/Layout.js +140 -0
  75. package/src/mappings/NativeBase/Layout.ts +152 -0
  76. package/src/mappings/NativeBase/Media.js +56 -0
  77. package/src/mappings/NativeBase/Media.ts +65 -0
  78. package/src/mappings/NativeBase/Menu.js +134 -0
  79. package/src/mappings/NativeBase/Menu.ts +150 -0
  80. package/src/mappings/NativeBase/Modal.js +103 -0
  81. package/src/mappings/NativeBase/Modal.ts +118 -0
  82. package/src/mappings/NativeBase/Other.js +123 -0
  83. package/src/mappings/NativeBase/Other.ts +139 -0
  84. package/src/mappings/NativeBase/Popover.js +123 -0
  85. package/src/mappings/NativeBase/Popover.ts +136 -0
  86. package/src/mappings/NativeBase/Select.js +71 -0
  87. package/src/mappings/NativeBase/Select.ts +85 -0
  88. package/src/mappings/NativeBase/Slider.js +89 -0
  89. package/src/mappings/NativeBase/Slider.ts +105 -0
  90. package/lib/commonjs/mappings/DatePickerModal.js +0 -74
  91. package/lib/module/mappings/DatePickerModal.js +0 -65
  92. package/lib/typescript/src/mappings/DatePickerModal.d.ts +0 -153
  93. package/lib/typescript/src/mappings/DatePickerModal.d.ts.map +0 -1
  94. package/src/mappings/DatePickerModal.js +0 -73
  95. package/src/mappings/DatePickerModal.ts +0 -91
@@ -0,0 +1,95 @@
1
+ import { COMPONENT_TYPES, StylesPanelSections, Triggers, createBoolProp, createStaticBoolProp, createTextEnumProp, createActionProp, createStaticNumberProp } from "@draftbit/types";
2
+ const SHARED_SEED_DATA = {
3
+ category: COMPONENT_TYPES.NBAlert,
4
+ packageName: "native-base",
5
+ stylesPanelSections: [StylesPanelSections.LayoutFlexItems, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.LayoutContent, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects],
6
+ layout: {}
7
+ };
8
+ export const SEED_DATA = [{
9
+ name: "Alert Dialog",
10
+ tag: "AlertDialog",
11
+ description: "AlertDialog is used when a user needs to be interrupted with a mandatory confirmation or call-to-action. AlertDialog composes Modal so you can use all its props.",
12
+ ...SHARED_SEED_DATA,
13
+ triggers: [Triggers.OnClose],
14
+ props: {
15
+ /* https://github.com/GeekyAnts/NativeBase/blob/master/src/components/composites/AlertDialog/types.tsx */
16
+ isOpen: createBoolProp({
17
+ label: "Is Open",
18
+ description: "If true, the modal will open. Useful for controllable state behavior."
19
+ }),
20
+ defaultIsOpen: createStaticBoolProp({
21
+ label: "Default Is Open",
22
+ description: "If true, the modal will be opened by default."
23
+ }),
24
+ size: createStaticNumberProp({
25
+ label: "Size",
26
+ description: "The size of the AlertDialog"
27
+ }),
28
+ avoidKeyboard: createStaticBoolProp({
29
+ label: "Avoid Keyboard",
30
+ description: "If true and the keyboard is opened, the modal will move up equivalent to the keyboard height.",
31
+ defaultValue: false
32
+ }),
33
+ closeOnOverlayClick: createStaticBoolProp({
34
+ label: "Close on Overlay Click",
35
+ description: "If true, the modal will close when the overlay is clicked.",
36
+ defaultValue: true
37
+ }),
38
+ isKeyboardDismissable: createStaticBoolProp({
39
+ label: "Is Keyboard Dismissable",
40
+ description: "If true, the modal will close when the keyboard is dismissed.",
41
+ defaultValue: true
42
+ }),
43
+ overlayVisible: createStaticBoolProp({
44
+ label: "Overlay Visible",
45
+ description: "If true, the overlay element is visible.",
46
+ defaultValue: true
47
+ }),
48
+ backdropVisible: createStaticBoolProp({
49
+ label: "Backdrop Visible",
50
+ description: "If true, the backdrop element is visible.",
51
+ defaultValue: true
52
+ }),
53
+ animationPreset: createTextEnumProp({
54
+ label: "Animation Preset",
55
+ description: "The animation preset to use for the modal.",
56
+ options: ["slide", "fade", "none"],
57
+ defaultValue: "fade"
58
+ }),
59
+ useRNModal: createStaticBoolProp({
60
+ label: "Use RN Modal",
61
+ description: "If true, the modal will use the RN Modal component."
62
+ }),
63
+ onClose: createActionProp()
64
+ }
65
+ }, {
66
+ name: "Alert Header",
67
+ tag: "AlertDialog.Header",
68
+ description: "Contains the title announced by screen readers.",
69
+ ...SHARED_SEED_DATA,
70
+ props: {}
71
+ }, {
72
+ name: "Alert Body",
73
+ tag: "AlertDialog.Body",
74
+ description: "Contains the description announced by screen readers.",
75
+ ...SHARED_SEED_DATA,
76
+ props: {}
77
+ }, {
78
+ name: "Alert Footer",
79
+ tag: "AlertDialog.Footer",
80
+ description: "Contains the actions of the dialog.",
81
+ ...SHARED_SEED_DATA,
82
+ props: {}
83
+ }, {
84
+ name: "Alert Content",
85
+ tag: "AlertDialog.Content",
86
+ description: "The wrapper for the alert dialog's content.",
87
+ ...SHARED_SEED_DATA,
88
+ props: {}
89
+ }, {
90
+ name: "Alert Close Button",
91
+ tag: "AlertDialog.CloseButton",
92
+ description: "The button that closes the dialog",
93
+ ...SHARED_SEED_DATA,
94
+ props: {}
95
+ }];
@@ -0,0 +1,86 @@
1
+ /* Temporarily Commented Out
2
+
3
+
4
+ import {
5
+ COMPONENT_TYPES,
6
+ StylesPanelSections,
7
+ createTextEnumProp,
8
+ createBoolProp,
9
+ createIconProp,
10
+ } from "@draftbit/types";
11
+
12
+ const SHARED_SEED_DATA = {
13
+ category: COMPONENT_TYPES.NBForms,
14
+ packageName: "native-base",
15
+ stylesPanelSections: [
16
+ StylesPanelSections.LayoutFlexItems,
17
+ StylesPanelSections.LayoutSelectedItem,
18
+ StylesPanelSections.LayoutContent,
19
+ StylesPanelSections.Background,
20
+ StylesPanelSections.Size,
21
+ StylesPanelSections.MarginsAndPaddings,
22
+ StylesPanelSections.Position,
23
+ StylesPanelSections.Borders,
24
+ StylesPanelSections.Effects,
25
+ ],
26
+ layout: {},
27
+ triggers: {},
28
+ };
29
+
30
+ export const SEED_DATA = [
31
+ {
32
+ name: "Button",
33
+ tag: "Button",
34
+ description:
35
+ "The Button component triggers an event or an action. Examples can be submitting forms and deleting a data point.",
36
+ ...SHARED_SEED_DATA,
37
+ props: {
38
+ isLoading: createBoolProp({
39
+ label: "Loading",
40
+ description: "If true, the button will show a spinner.",
41
+ }),
42
+ isDisabled: createBoolProp({
43
+ label: "Disabled",
44
+ description: "If true, the button will be disabled.",
45
+ }),
46
+ leftIcon: createIconProp({
47
+ label: "Left Icon",
48
+ description: "The icon to display on the left side of the button",
49
+ }),
50
+ rightIcon: createIconProp({
51
+ label: "Right Icon",
52
+ description: "The icon to display on the right side of the button",
53
+ }),
54
+ spinnerPlacement: createTextEnumProp({
55
+ label: "Spinner Placement",
56
+ description: "The placement of the spinner",
57
+ options: ["start", "end"],
58
+ defaultValue: "start",
59
+ }),
60
+ },
61
+ },
62
+ {
63
+ name: "Button Group",
64
+ tag: "ButtonGroup",
65
+ description:
66
+ "Used to group buttons whose actions are related, with an option to flush them together.",
67
+ ...SHARED_SEED_DATA,
68
+ allowChildren: true,
69
+ props: {
70
+ direction: createTextEnumProp({
71
+ label: "Direction",
72
+ description: "The direction of the button group",
73
+ options: ["row", "column"],
74
+ defaultValue: "row",
75
+ }),
76
+ isAttached: createBoolProp({
77
+ label: "Attached",
78
+ description: "If true, the buttons will be attached",
79
+ }),
80
+ },
81
+ },
82
+ ];
83
+ */ },
84
+ },
85
+ ];
86
+ */
@@ -0,0 +1,54 @@
1
+ import { COMPONENT_TYPES, StylesPanelSections, createTextEnumProp, createIconProp, createStaticNumberProp } from "@draftbit/types";
2
+ const SHARED_SEED_DATA = {
3
+ category: COMPONENT_TYPES.NBDataDisplay,
4
+ packageName: "native-base",
5
+ stylesPanelSections: [StylesPanelSections.LayoutFlexItems, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.LayoutContent, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects],
6
+ layout: {},
7
+ triggers: {}
8
+ };
9
+ export const SEED_DATA = [{
10
+ name: "Badge",
11
+ tag: "Badge",
12
+ doc_link: "https://docs.nativebase.io/badge",
13
+ code_link: "https://github.com/GeekyAnts/NativeBase/tree/master/src/components/composites/Badge",
14
+ description: "Badges allow the highlighting of an item’s status. This provides quick recognition.",
15
+ ...SHARED_SEED_DATA,
16
+ props: {
17
+ /* */
18
+ leftIcon: createIconProp({
19
+ label: "Left Icon",
20
+ description: "The left icon element to use in the button."
21
+ }),
22
+ rightIcon: createIconProp({
23
+ label: "Right Icon",
24
+ description: "The right icon element to use in the button."
25
+ }),
26
+ startIcon: createIconProp({
27
+ label: "Start Icon",
28
+ description: "The start icon element to use in the button."
29
+ }),
30
+ endIcon: createIconProp({
31
+ label: "End Icon",
32
+ description: "The end icon element to use in the button."
33
+ })
34
+ }
35
+ }, {
36
+ name: "Divider",
37
+ tag: "Divider",
38
+ doc_link: "https://docs.nativebase.io/divider",
39
+ code_link: "https://github.com/GeekyAnts/NativeBase/tree/master/src/components/composites/Divider",
40
+ description: "Divider can visually separate content in a given list or group.",
41
+ ...SHARED_SEED_DATA,
42
+ props: {
43
+ orientation: createTextEnumProp({
44
+ label: "Orientation",
45
+ description: "The orientation of the divider",
46
+ options: ["horizontal", "vertical"]
47
+ }),
48
+ thickness: createStaticNumberProp({
49
+ label: "Thickness",
50
+ description: "The thickness of the divider",
51
+ defaultValue: 1
52
+ })
53
+ }
54
+ }];
@@ -0,0 +1,67 @@
1
+ import { COMPONENT_TYPES, StylesPanelSections, createTextEnumProp, createNumberProp, createIconProp } from "@draftbit/types";
2
+ const SHARED_SEED_DATA = {
3
+ category: COMPONENT_TYPES.NBFeedback,
4
+ packageName: "native-base",
5
+ stylesPanelSections: [StylesPanelSections.LayoutFlexItems, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.LayoutContent, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects],
6
+ layout: {},
7
+ triggers: {}
8
+ };
9
+ export const SEED_DATA = [{
10
+ name: "Alert",
11
+ tag: "Alert",
12
+ description: "Wrapper component. Alerts convey a state that can influence a system, feature, or page.",
13
+ ...SHARED_SEED_DATA,
14
+ props: {
15
+ status: createTextEnumProp({
16
+ label: "Status",
17
+ description: "The status of the alert",
18
+ options: ["success", "warning", "error", "info"],
19
+ defaultValue: "info"
20
+ }),
21
+ variant: createTextEnumProp({
22
+ label: "Variant",
23
+ description: "The variant of the alert style to use.",
24
+ options: ["subtle", "solid", "outline", "left-accent", "top-accent", "outline-light"],
25
+ defaultValue: "subtle"
26
+ })
27
+ }
28
+ }, {
29
+ name: "Alert Icon",
30
+ tag: "Alert.Icon",
31
+ description: "The visual icon for the alert that changes based on the status prop.",
32
+ ...SHARED_SEED_DATA,
33
+ props: {
34
+ icon: createIconProp({
35
+ label: "Icon",
36
+ description: "The icon to display"
37
+ })
38
+ }
39
+ }, {
40
+ name: "Progress",
41
+ tag: "Progress",
42
+ description: "Progress helps show the progress status for a time-consuming task that consists of several steps.",
43
+ ...SHARED_SEED_DATA,
44
+ props: {
45
+ value: createNumberProp({
46
+ label: "Value",
47
+ description: "The value of the progress bar",
48
+ defaultValue: 0,
49
+ min: 0,
50
+ max: 100
51
+ }),
52
+ min: createNumberProp({
53
+ label: "Min",
54
+ description: "The minimum value of the progress bar",
55
+ defaultValue: 0,
56
+ min: 0,
57
+ max: 100
58
+ }),
59
+ max: createNumberProp({
60
+ label: "Max",
61
+ description: "The maximum value of the progress bar",
62
+ defaultValue: 100,
63
+ min: 0,
64
+ max: 100
65
+ })
66
+ }
67
+ }, {}];
@@ -0,0 +1,107 @@
1
+ import { COMPONENT_TYPES, StylesPanelSections, createTextEnumProp, createBoolProp } from "@draftbit/types";
2
+ const NB_LAYOUT_PROPS = {
3
+ category: COMPONENT_TYPES.NBLayout,
4
+ packageName: "native-base",
5
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
6
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
7
+ stylesPanelSections: [StylesPanelSections.LayoutFlexItems, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.LayoutContent, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects],
8
+ allowChildren: true,
9
+ layout: {},
10
+ triggers: {}
11
+ };
12
+ export const SEED_DATA = [{
13
+ name: "Aspect Ratio",
14
+ tag: "AspectRatio",
15
+ description: "AspectRatio controls the size of the undefined dimension of a node or child component.",
16
+ ...NB_LAYOUT_PROPS,
17
+ props: {
18
+ ratio: createTextEnumProp({
19
+ label: "Ratio",
20
+ description: "The aspect ratio of the container",
21
+ options: ["1 / 1", "4 / 3", "3 / 2", "16 / 9", "2 / 1", "3 / 4", "2 / 3", "9 / 16", "1 / 2"],
22
+ defaultValue: "4 / 3"
23
+ })
24
+ }
25
+ }, {
26
+ name: "Box",
27
+ tag: "Box",
28
+ description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
29
+ ...NB_LAYOUT_PROPS
30
+ }, {
31
+ name: "Center",
32
+ tag: "Center",
33
+ description: "Centers its child",
34
+ ...NB_LAYOUT_PROPS
35
+ }, {
36
+ name: "Square",
37
+ tag: "Square",
38
+ description: "Centers its child inside a square",
39
+ ...NB_LAYOUT_PROPS
40
+ }, {
41
+ name: "Circle",
42
+ tag: "Circle",
43
+ description: "Centers its child inside a circle",
44
+ ...NB_LAYOUT_PROPS
45
+ }, {
46
+ name: "Column",
47
+ tag: "Column",
48
+ description: "Column aligns items vertically",
49
+ ...NB_LAYOUT_PROPS
50
+ }, {
51
+ name: "Container",
52
+ tag: "Container",
53
+ description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid.",
54
+ ...NB_LAYOUT_PROPS
55
+ }, {
56
+ name: "Flex",
57
+ tag: "Flex",
58
+ description: "A Box with Flexbox properties. ",
59
+ ...NB_LAYOUT_PROPS
60
+ }, {
61
+ name: "Spacer",
62
+ tag: "Spacer",
63
+ description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
64
+ ...NB_LAYOUT_PROPS
65
+ }, {
66
+ name: "Row",
67
+ tag: "Row",
68
+ description: "Column aligns items horizontally",
69
+ ...NB_LAYOUT_PROPS,
70
+ props: {}
71
+ }, {
72
+ name: "Stack",
73
+ tag: "Stack",
74
+ description: "Stack aligns items vertically or horizontally based on the direction prop.",
75
+ ...NB_LAYOUT_PROPS,
76
+ props: {
77
+ direction: createTextEnumProp({
78
+ label: "Direction",
79
+ description: "The direction of the Stack",
80
+ options: ["row", "column"],
81
+ defaultValue: "column"
82
+ }),
83
+ reversed: createBoolProp({
84
+ label: "Reversed",
85
+ description: "Determines whether to reverse the direction of items."
86
+ }),
87
+ isDisabled: createBoolProp({
88
+ label: "Disabled",
89
+ description: "If true, the Stack will be disabled."
90
+ }),
91
+ isInvalid: createBoolProp({
92
+ label: "Invalid",
93
+ description: "If true, the Stack will be invalid."
94
+ })
95
+ }
96
+ }, {
97
+ name: "ZStack",
98
+ tag: "ZStack",
99
+ description: "ZStack aligns items to the z-axis.",
100
+ ...NB_LAYOUT_PROPS,
101
+ props: {
102
+ reversed: createBoolProp({
103
+ label: "Reversed",
104
+ description: "Determines whether to reverse the direction of items."
105
+ })
106
+ }
107
+ }];
@@ -0,0 +1,42 @@
1
+ import { COMPONENT_TYPES, StylesPanelSections, createImageProp, createTextEnumProp, createTextProp } from "@draftbit/types";
2
+ const NB_MEDIA_PROPS = {
3
+ category: COMPONENT_TYPES.NBLayout,
4
+ packageName: "native-base",
5
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
6
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
7
+ stylesPanelSections: [StylesPanelSections.LayoutFlexItems, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.LayoutContent, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects],
8
+ layout: {},
9
+ triggers: {}
10
+ };
11
+ const AVATAR_PROPS = {
12
+ props: {
13
+ source: createImageProp(),
14
+ size: createTextEnumProp({
15
+ label: "Size",
16
+ description: "The size of the avatar.",
17
+ options: ["xs", "sm", "md", "lg", "xl", "2xl"]
18
+ }),
19
+ wrapperRef: createTextProp({
20
+ label: "Reference",
21
+ description: "Reference to be attached to the Avatar wrapper.",
22
+ defaultValue: "User Avatar"
23
+ })
24
+ }
25
+ };
26
+ export const SEED_DATA = [{
27
+ name: "Avatar",
28
+ tag: "Avatar",
29
+ description: "An image that represents the user",
30
+ ...NB_MEDIA_PROPS,
31
+ ...AVATAR_PROPS
32
+ }, {
33
+ name: "Avatar Badge",
34
+ tag: "AvatarBadge",
35
+ description: "A wrapper that displays its content on the bottom right corner of the avatar.",
36
+ ...NB_MEDIA_PROPS
37
+ }, {
38
+ name: "Avatar Group",
39
+ tag: "AvatarGroup",
40
+ description: "A wrapper to stack multiple avatars together",
41
+ ...NB_MEDIA_PROPS
42
+ }];
@@ -0,0 +1,104 @@
1
+ import { COMPONENT_TYPES, createActionProp, createStaticBoolProp, createTextEnumProp, StylesPanelSections, Triggers, createStaticNumberProp, createDisabledProp, createTextProp } from "@draftbit/types";
2
+ const SHARED_SEED_DATA = {
3
+ category: COMPONENT_TYPES.NBMenu,
4
+ packageName: "native-base",
5
+ stylesPanelSections: [StylesPanelSections.LayoutFlexItems, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.LayoutContent, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects],
6
+ layout: {},
7
+ allowChildren: true
8
+ };
9
+ export const SEED_DATA = [{
10
+ name: "Menu",
11
+ tag: "Menu",
12
+ description: "Menu generates a dropdown menu along with the menu button design pattern.",
13
+ ...SHARED_SEED_DATA,
14
+ triggers: [Triggers.OnOpen, Triggers.OnClose],
15
+ props: {
16
+ onOpen: createActionProp(),
17
+ onClose: createActionProp(),
18
+ closeOnSelect: createStaticBoolProp({
19
+ label: "Close on Select",
20
+ description: "Close the menu when an item is selected",
21
+ defaultValue: true
22
+ }),
23
+ defaultIsOpen: createStaticBoolProp({
24
+ label: "Default Is Open",
25
+ description: "Whether the menu is open by default",
26
+ defaultValue: false
27
+ }),
28
+ placement: createTextEnumProp({
29
+ label: "Placement",
30
+ description: "The placement of the menu",
31
+ options: ["bottom", "top", "left", "right", "top left", "top right", "bottom left", "bottom right", "right bottom", "right top", "left bottom", "left top"],
32
+ defaultValue: "bottom left"
33
+ }),
34
+ offset: createStaticNumberProp({
35
+ label: "Offset",
36
+ description: "The distance applied along the main axis between the trigger and the menu."
37
+ }),
38
+ crossOffset: createStaticNumberProp({
39
+ label: "Cross Offset",
40
+ description: "The distance applied along the cross axis between the trigger and the menu."
41
+ }),
42
+ shouldFlip: createStaticBoolProp({
43
+ label: "Should Flip",
44
+ description: "Whether popover should flip when it reaches the edge of the screen.",
45
+ defaultValue: true
46
+ })
47
+ }
48
+ }, {
49
+ name: "Menu Item",
50
+ tag: "Menu.Item",
51
+ description: "An individual item in the menu.",
52
+ ...SHARED_SEED_DATA,
53
+ props: {
54
+ isDisabled: createDisabledProp(),
55
+ textValue: createTextProp({
56
+ label: "Text Value",
57
+ description: "The text value available for the typeahead menu feature."
58
+ })
59
+ }
60
+ }, {
61
+ name: "Menu Group",
62
+ tag: "Menu.Group",
63
+ description: "A wrapper to group related menu items.",
64
+ ...SHARED_SEED_DATA,
65
+ props: {
66
+ title: createTextProp({
67
+ label: "Title",
68
+ description: "The title of the menu group."
69
+ })
70
+ }
71
+ }, {
72
+ name: "Menu Option Group",
73
+ tag: "Menu.OptionGroup",
74
+ description: "A wrapper for checkable menu items (radio and checkbox).",
75
+ ...SHARED_SEED_DATA,
76
+ triggers: [Triggers.OnChange],
77
+ props: {
78
+ type: createTextEnumProp({
79
+ label: "Type",
80
+ description: "The type of the menu option group.",
81
+ options: ["checkbox", "radio"],
82
+ defaultValue: "checkbox"
83
+ }),
84
+ onChange: createActionProp()
85
+ }
86
+ }, {
87
+ name: "Menu Item Option",
88
+ tag: "Menu.ItemOption",
89
+ description: "The checkable menu item to be used with Menu Option Group.",
90
+ ...SHARED_SEED_DATA,
91
+ props: {
92
+ isDisabled: createDisabledProp(),
93
+ textValue: createTextProp({
94
+ label: "Text Value",
95
+ description: "The text value available for the typeahead menu feature."
96
+ })
97
+ }
98
+ }, {
99
+ name: "Menu Trigger",
100
+ tag: "Menu.Trigger",
101
+ description: "Used to wrap the reference (or trigger) element.",
102
+ ...SHARED_SEED_DATA,
103
+ props: {}
104
+ }];
@@ -0,0 +1,86 @@
1
+ import { COMPONENT_TYPES, createActionProp, createBoolProp, createStaticBoolProp, createTextEnumProp, StylesPanelSections, Triggers } from "@draftbit/types";
2
+ const SHARED_SEED_DATA = {
3
+ category: COMPONENT_TYPES.NBModal,
4
+ packageName: "native-base",
5
+ stylesPanelSections: [StylesPanelSections.LayoutFlexItems, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.LayoutContent, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Borders, StylesPanelSections.Effects]
6
+ };
7
+ export const SEED_DATA = [{
8
+ name: "Modal",
9
+ tag: "Modal",
10
+ description: "A Modal is an overlay on the primary window or another dialog window. Content behind the modal dialog remains inert and users cannot interact with it.",
11
+ ...SHARED_SEED_DATA,
12
+ layout: {},
13
+ triggers: [Triggers.OnClose, Triggers.OnOpen],
14
+ props: {
15
+ isOpen: createBoolProp({
16
+ label: "Is Open",
17
+ description: "If true, the modal will open. Useful for controllable state behavior."
18
+ }),
19
+ defaultIsOpen: createStaticBoolProp({
20
+ label: "Default Is Open",
21
+ description: "If true, the modal will be opened by default."
22
+ }),
23
+ avoidKeyboard: createStaticBoolProp({
24
+ label: "Avoid Keyboard",
25
+ description: "If true and the keyboard is opened, the modal will move up equivalent to the keyboard height.",
26
+ defaultValue: false
27
+ }),
28
+ closeOnOverlayClick: createStaticBoolProp({
29
+ label: "Close on Overlay Click",
30
+ description: "If true, the modal will close when the overlay is clicked.",
31
+ defaultValue: true
32
+ }),
33
+ isKeyboardDismissable: createStaticBoolProp({
34
+ label: "Is Keyboard Dismissable",
35
+ description: "If true, the modal will close when the keyboard is dismissed.",
36
+ defaultValue: true
37
+ }),
38
+ backdropVisible: createStaticBoolProp({
39
+ label: "Backdrop Visible",
40
+ description: "If true, the backdrop element is visible.",
41
+ defaultValue: true
42
+ }),
43
+ animationPreset: createTextEnumProp({
44
+ label: "Animation Preset",
45
+ description: "The animation preset to use for the modal.",
46
+ options: ["slide", "fade", "none"],
47
+ defaultValue: "fade"
48
+ }),
49
+ useRNModal: createStaticBoolProp({
50
+ label: "Use RN Modal",
51
+ description: "If true, the modal will use the RN Modal component."
52
+ }),
53
+ onOpen: createActionProp(),
54
+ onClose: createActionProp()
55
+ }
56
+ }, {
57
+ name: "Modal Content",
58
+ tag: "Modal.Content",
59
+ description: "The container for the modal dialog's content.",
60
+ ...SHARED_SEED_DATA,
61
+ props: {}
62
+ }, {
63
+ name: "Modal Header",
64
+ tag: "Modal.Header",
65
+ description: "The header that labels the modal dialog.",
66
+ ...SHARED_SEED_DATA,
67
+ props: {}
68
+ }, {
69
+ name: "Modal Footer",
70
+ tag: "Modal.Footer",
71
+ description: "The footer that houses the modal actions.",
72
+ ...SHARED_SEED_DATA,
73
+ props: {}
74
+ }, {
75
+ name: "Modal Body",
76
+ tag: "Modal.Body",
77
+ description: "A wrapper that houses the modal's main content",
78
+ ...SHARED_SEED_DATA,
79
+ props: {}
80
+ }, {
81
+ name: "Modal Close Button",
82
+ tag: "Modal.CloseButton",
83
+ description: "The button that closes the modal.",
84
+ ...SHARED_SEED_DATA,
85
+ props: {}
86
+ }];