@draftbit/core 47.0.1-17098e.2 → 47.0.1-2aab54.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 (141) hide show
  1. package/lib/commonjs/components/Button.js +15 -27
  2. package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
  3. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
  4. package/lib/commonjs/components/DeprecatedButton.js +151 -0
  5. package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
  6. package/lib/commonjs/components/DeprecatedFAB.js +2 -1
  7. package/lib/commonjs/components/Picker/Picker.js +4 -3
  8. package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
  9. package/lib/commonjs/components/Touchable.js +11 -27
  10. package/lib/commonjs/components/Touchable.web.js +9 -0
  11. package/lib/commonjs/index.js +25 -82
  12. package/lib/commonjs/mappings/Button.js +10 -14
  13. package/lib/commonjs/mappings/NativeBase/AlertDialog.js +93 -0
  14. package/lib/commonjs/mappings/NativeBase/Button.js +84 -0
  15. package/lib/commonjs/mappings/NativeBase/DataDisplay.js +48 -0
  16. package/lib/commonjs/mappings/NativeBase/Feedback.js +74 -0
  17. package/lib/commonjs/mappings/NativeBase/Layout.js +114 -0
  18. package/lib/commonjs/mappings/NativeBase/Media.js +49 -0
  19. package/lib/commonjs/mappings/NativeBase/Menu.js +111 -0
  20. package/lib/commonjs/mappings/NativeBase/Modal.js +93 -0
  21. package/lib/commonjs/mappings/NativeBase/Other.js +94 -0
  22. package/lib/commonjs/mappings/NativeBase/Popover.js +99 -0
  23. package/lib/commonjs/mappings/Touchable.js +20 -0
  24. package/lib/module/components/Button.js +9 -21
  25. package/lib/module/components/Checkbox/Checkbox.js +3 -2
  26. package/lib/module/components/DeprecatedButton.js +141 -0
  27. package/lib/module/components/DeprecatedCardWrapper.js +2 -2
  28. package/lib/module/components/DeprecatedFAB.js +3 -2
  29. package/lib/module/components/Picker/Picker.js +4 -3
  30. package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
  31. package/lib/module/components/Touchable.js +10 -25
  32. package/lib/module/components/Touchable.web.js +2 -0
  33. package/lib/module/index.js +121 -31
  34. package/lib/module/mappings/Button.js +11 -15
  35. package/lib/module/mappings/NativeBase/AlertDialog.js +86 -0
  36. package/lib/module/mappings/NativeBase/Button.js +86 -0
  37. package/lib/module/mappings/NativeBase/DataDisplay.js +41 -0
  38. package/lib/module/mappings/NativeBase/Feedback.js +67 -0
  39. package/lib/module/mappings/NativeBase/Layout.js +107 -0
  40. package/lib/module/mappings/NativeBase/Media.js +42 -0
  41. package/lib/module/mappings/NativeBase/Menu.js +104 -0
  42. package/lib/module/mappings/NativeBase/Modal.js +86 -0
  43. package/lib/module/mappings/NativeBase/Other.js +87 -0
  44. package/lib/module/mappings/NativeBase/Popover.js +92 -0
  45. package/lib/module/mappings/Touchable.js +13 -0
  46. package/lib/typescript/src/components/Button.d.ts +0 -2
  47. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  48. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
  49. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
  50. package/lib/typescript/src/components/DeprecatedButton.d.ts +54 -0
  51. package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -0
  52. package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -1
  53. package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
  54. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
  55. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  56. package/lib/typescript/src/components/Touchable.d.ts +2 -9
  57. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  58. package/lib/typescript/src/components/Touchable.web.d.ts +3 -0
  59. package/lib/typescript/src/components/Touchable.web.d.ts.map +1 -0
  60. package/lib/typescript/src/index.d.ts +102 -29
  61. package/lib/typescript/src/index.d.ts.map +1 -1
  62. package/lib/typescript/src/mappings/Button.d.ts +2 -224
  63. package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
  64. package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts +134 -0
  65. package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts.map +1 -0
  66. package/lib/typescript/src/mappings/NativeBase/Button.d.ts +1 -0
  67. package/lib/typescript/src/mappings/NativeBase/Button.d.ts.map +1 -0
  68. package/lib/typescript/src/mappings/{Pressable.d.ts → NativeBase/DataDisplay.d.ts} +34 -40
  69. package/lib/typescript/src/mappings/NativeBase/DataDisplay.d.ts.map +1 -0
  70. package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts +2 -0
  71. package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts.map +1 -0
  72. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +146 -0
  73. package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
  74. package/lib/typescript/src/mappings/NativeBase/Media.d.ts +48 -0
  75. package/lib/typescript/src/mappings/NativeBase/Media.d.ts.map +1 -0
  76. package/lib/typescript/src/mappings/NativeBase/Menu.d.ts +227 -0
  77. package/lib/typescript/src/mappings/NativeBase/Menu.d.ts.map +1 -0
  78. package/lib/typescript/src/mappings/NativeBase/Modal.d.ts +133 -0
  79. package/lib/typescript/src/mappings/NativeBase/Modal.d.ts.map +1 -0
  80. package/lib/typescript/src/mappings/NativeBase/Other.d.ts +179 -0
  81. package/lib/typescript/src/mappings/NativeBase/Other.d.ts.map +1 -0
  82. package/lib/typescript/src/mappings/NativeBase/Popover.d.ts +136 -0
  83. package/lib/typescript/src/mappings/NativeBase/Popover.d.ts.map +1 -0
  84. package/lib/typescript/src/mappings/Touchable.d.ts +22 -0
  85. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
  86. package/package.json +3 -3
  87. package/src/components/Button.js +11 -18
  88. package/src/components/Button.tsx +11 -45
  89. package/src/components/Checkbox/Checkbox.js +3 -2
  90. package/src/components/Checkbox/Checkbox.tsx +7 -5
  91. package/src/components/DeprecatedButton.js +95 -0
  92. package/src/components/DeprecatedButton.tsx +214 -0
  93. package/src/components/DeprecatedCardWrapper.js +2 -2
  94. package/src/components/DeprecatedCardWrapper.tsx +4 -3
  95. package/src/components/DeprecatedFAB.js +3 -2
  96. package/src/components/DeprecatedFAB.tsx +5 -5
  97. package/src/components/Picker/Picker.js +4 -3
  98. package/src/components/Picker/Picker.tsx +4 -4
  99. package/src/components/Picker/PickerComponent.ios.js +1 -1
  100. package/src/components/Picker/PickerComponent.ios.tsx +1 -1
  101. package/src/components/Touchable.js +11 -16
  102. package/src/components/Touchable.tsx +11 -42
  103. package/src/components/Touchable.web.js +2 -0
  104. package/src/components/Touchable.web.tsx +3 -0
  105. package/src/index.js +112 -31
  106. package/src/index.tsx +123 -43
  107. package/src/mappings/Button.js +10 -14
  108. package/src/mappings/Button.ts +10 -14
  109. package/src/mappings/NativeBase/AlertDialog.js +103 -0
  110. package/src/mappings/NativeBase/AlertDialog.ts +118 -0
  111. package/src/mappings/NativeBase/Button.js +84 -0
  112. package/src/mappings/NativeBase/Button.ts +83 -0
  113. package/src/mappings/NativeBase/DataDisplay.js +54 -0
  114. package/src/mappings/NativeBase/DataDisplay.ts +64 -0
  115. package/src/mappings/NativeBase/Feedback.js +89 -0
  116. package/src/mappings/NativeBase/Feedback.ts +100 -0
  117. package/src/mappings/NativeBase/Layout.js +140 -0
  118. package/src/mappings/NativeBase/Layout.ts +152 -0
  119. package/src/mappings/NativeBase/Media.js +56 -0
  120. package/src/mappings/NativeBase/Media.ts +65 -0
  121. package/src/mappings/NativeBase/Menu.js +134 -0
  122. package/src/mappings/NativeBase/Menu.ts +150 -0
  123. package/src/mappings/NativeBase/Modal.js +103 -0
  124. package/src/mappings/NativeBase/Modal.ts +118 -0
  125. package/src/mappings/NativeBase/Other.js +123 -0
  126. package/src/mappings/NativeBase/Other.ts +139 -0
  127. package/src/mappings/NativeBase/Popover.js +123 -0
  128. package/src/mappings/NativeBase/Popover.ts +136 -0
  129. package/src/mappings/Touchable.js +17 -0
  130. package/src/mappings/Touchable.ts +23 -0
  131. package/lib/commonjs/components/Pressable.js +0 -48
  132. package/lib/commonjs/mappings/Pressable.js +0 -52
  133. package/lib/module/components/Pressable.js +0 -40
  134. package/lib/module/mappings/Pressable.js +0 -45
  135. package/lib/typescript/src/components/Pressable.d.ts +0 -18
  136. package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
  137. package/lib/typescript/src/mappings/Pressable.d.ts.map +0 -1
  138. package/src/components/Pressable.js +0 -17
  139. package/src/components/Pressable.tsx +0 -67
  140. package/src/mappings/Pressable.js +0 -52
  141. package/src/mappings/Pressable.ts +0 -63
@@ -0,0 +1,93 @@
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.NBModal,
10
+ packageName: "native-base",
11
+ stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects]
12
+ };
13
+ const SEED_DATA = [{
14
+ name: "Modal",
15
+ tag: "Modal",
16
+ 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.",
17
+ ...SHARED_SEED_DATA,
18
+ layout: {},
19
+ triggers: [_types.Triggers.OnClose, _types.Triggers.OnOpen],
20
+ props: {
21
+ isOpen: (0, _types.createBoolProp)({
22
+ label: "Is Open",
23
+ description: "If true, the modal will open. Useful for controllable state behavior."
24
+ }),
25
+ defaultIsOpen: (0, _types.createStaticBoolProp)({
26
+ label: "Default Is Open",
27
+ description: "If true, the modal will be opened by default."
28
+ }),
29
+ avoidKeyboard: (0, _types.createStaticBoolProp)({
30
+ label: "Avoid Keyboard",
31
+ description: "If true and the keyboard is opened, the modal will move up equivalent to the keyboard height.",
32
+ defaultValue: false
33
+ }),
34
+ closeOnOverlayClick: (0, _types.createStaticBoolProp)({
35
+ label: "Close on Overlay Click",
36
+ description: "If true, the modal will close when the overlay is clicked.",
37
+ defaultValue: true
38
+ }),
39
+ isKeyboardDismissable: (0, _types.createStaticBoolProp)({
40
+ label: "Is Keyboard Dismissable",
41
+ description: "If true, the modal will close when the keyboard is dismissed.",
42
+ defaultValue: true
43
+ }),
44
+ backdropVisible: (0, _types.createStaticBoolProp)({
45
+ label: "Backdrop Visible",
46
+ description: "If true, the backdrop element is visible.",
47
+ defaultValue: true
48
+ }),
49
+ animationPreset: (0, _types.createTextEnumProp)({
50
+ label: "Animation Preset",
51
+ description: "The animation preset to use for the modal.",
52
+ options: ["slide", "fade", "none"],
53
+ defaultValue: "fade"
54
+ }),
55
+ useRNModal: (0, _types.createStaticBoolProp)({
56
+ label: "Use RN Modal",
57
+ description: "If true, the modal will use the RN Modal component."
58
+ }),
59
+ onOpen: (0, _types.createActionProp)(),
60
+ onClose: (0, _types.createActionProp)()
61
+ }
62
+ }, {
63
+ name: "Modal Content",
64
+ tag: "Modal.Content",
65
+ description: "The container for the modal dialog's content.",
66
+ ...SHARED_SEED_DATA,
67
+ props: {}
68
+ }, {
69
+ name: "Modal Header",
70
+ tag: "Modal.Header",
71
+ description: "The header that labels the modal dialog.",
72
+ ...SHARED_SEED_DATA,
73
+ props: {}
74
+ }, {
75
+ name: "Modal Footer",
76
+ tag: "Modal.Footer",
77
+ description: "The footer that houses the modal actions.",
78
+ ...SHARED_SEED_DATA,
79
+ props: {}
80
+ }, {
81
+ name: "Modal Body",
82
+ tag: "Modal.Body",
83
+ description: "A wrapper that houses the modal's main content",
84
+ ...SHARED_SEED_DATA,
85
+ props: {}
86
+ }, {
87
+ name: "Modal Close Button",
88
+ tag: "Modal.CloseButton",
89
+ description: "The button that closes the modal.",
90
+ ...SHARED_SEED_DATA,
91
+ props: {}
92
+ }];
93
+ exports.SEED_DATA = SEED_DATA;
@@ -0,0 +1,94 @@
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 SEED_DATA = [{
9
+ name: "FAB",
10
+ tag: "Fab",
11
+ description: "A floating action button (FAB) is a circular icon button that hovers over content to execute a primary action in the application.",
12
+ category: _types.COMPONENT_TYPES.NBForms,
13
+ packageName: "native-base",
14
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
15
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
16
+ stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects],
17
+ layout: {},
18
+ triggers: {},
19
+ props: {
20
+ placement: (0, _types.createTextEnumProp)({
21
+ label: "Placement",
22
+ description: "The placement of the Fab relative to the device.",
23
+ options: ["bottom-right", "top-right", "top-left", "bottom-left"],
24
+ defaultValue: "bottom-right"
25
+ }),
26
+ label: (0, _types.createTextProp)({
27
+ label: "Label",
28
+ description: "The Text to be displayed in Fab."
29
+ }),
30
+ icon: (0, _types.createIconProp)({
31
+ label: "Icon",
32
+ description: "Icon to be displayed in Fab. "
33
+ })
34
+ }
35
+ }, {
36
+ name: "Tooltip",
37
+ tag: "Tooltip",
38
+ description: "A tooltip provides a brief, informative message when a user interacts with an element. Methods of tooltip initiation include: through a mouse-hover gesture or a keyboard-hover gesture.",
39
+ category: _types.COMPONENT_TYPES.NBOther,
40
+ packageName: "native-base",
41
+ allowChildren: true,
42
+ stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects],
43
+ layout: {},
44
+ triggers: [_types.Triggers.OnOpen, _types.Triggers.OnClose],
45
+ props: {
46
+ label: (0, _types.createTextProp)({
47
+ label: "Label",
48
+ description: "The Text to be displayed in Tooltip."
49
+ }),
50
+ isOpen: (0, _types.createBoolProp)({
51
+ label: "Is Open",
52
+ description: "Whether the tooltip is open or not."
53
+ }),
54
+ isDisabled: (0, _types.createDisabledProp)(),
55
+ defaultIsOpen: (0, _types.createStaticBoolProp)({
56
+ label: "Default Is Open",
57
+ description: "Whether the tooltip is open by default",
58
+ defaultValue: false
59
+ }),
60
+ onOpen: (0, _types.createActionProp)(),
61
+ onClose: (0, _types.createActionProp)(),
62
+ openDelay: (0, _types.createStaticNumberProp)({
63
+ label: "Open Delay",
64
+ description: "Delay in ms before tooltip opens",
65
+ defaultValue: 0
66
+ }),
67
+ closeDelay: (0, _types.createStaticNumberProp)({
68
+ label: "Close Delay",
69
+ description: "Delay in ms before tooltip closes",
70
+ defaultValue: 0
71
+ }),
72
+ placement: (0, _types.createTextEnumProp)({
73
+ label: "Placement",
74
+ description: "The placement of the menu",
75
+ options: ["bottom", "top", "left", "right", "top left", "top right", "bottom left", "bottom right", "right bottom", "right top", "left bottom", "left top"],
76
+ defaultValue: "bottom"
77
+ }),
78
+ arrowSize: (0, _types.createStaticNumberProp)({
79
+ label: "Arrow Size",
80
+ description: "The size of the arrow",
81
+ defaultValue: 12
82
+ }),
83
+ hasArrow: (0, _types.createStaticBoolProp)({
84
+ label: "Has Arrow",
85
+ description: "Whether the tooltip has an arrow",
86
+ defaultValue: false
87
+ }),
88
+ offset: (0, _types.createStaticNumberProp)({
89
+ label: "Offset",
90
+ description: "The distance between the triggere and the tooltip."
91
+ })
92
+ }
93
+ }];
94
+ exports.SEED_DATA = SEED_DATA;
@@ -0,0 +1,99 @@
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.NBPopover,
10
+ packageName: "native-base",
11
+ stylesPanelSections: [_types.StylesPanelSections.LayoutFlexItems, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.LayoutContent, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects],
12
+ layout: {},
13
+ triggers: {}
14
+ };
15
+ const SEED_DATA = [{
16
+ name: "Popover",
17
+ tag: "Popover",
18
+ description: "Popover floats around a trigger. It is a non-modal dialog used to provide contextual information to the user. It should be paired with a pressable trigger element.",
19
+ ...SHARED_SEED_DATA,
20
+ allowChildren: true,
21
+ props: {
22
+ isOpen: (0, _types.createBoolProp)({
23
+ label: "Is Open",
24
+ description: "If true, the popover is open. Useful for controlling the open state."
25
+ }),
26
+ defaultIsOpen: (0, _types.createStaticBoolProp)({
27
+ label: "Default Is Open",
28
+ description: "If true, the popover will be opened by default."
29
+ }),
30
+ trapFocus: (0, _types.createStaticBoolProp)({
31
+ label: "Trap Focus",
32
+ description: "Whether popover should trap focus."
33
+ }),
34
+ shouldFlip: (0, _types.createStaticBoolProp)({
35
+ label: "Should Flip",
36
+ description: "Whether popover should flip when it reaches the edge of the screen.",
37
+ defaultValue: true
38
+ }),
39
+ shouldOverlapWithTrigger: (0, _types.createStaticBoolProp)({
40
+ label: "Should Overlap With Trigger",
41
+ description: "Whether popover should overlap with trigger.",
42
+ defaultValue: false
43
+ }),
44
+ isKeyboardDismissable: (0, _types.createStaticBoolProp)({
45
+ label: "Is Keyboard Dismissable",
46
+ description: "If true, the popover will close when the keyboard is dismissed.",
47
+ defaultValue: true
48
+ }),
49
+ placement: (0, _types.createTextEnumProp)({
50
+ label: "Placement",
51
+ description: "The placement of the popover",
52
+ options: ["bottom", "top", "left", "right", "top left", "top right", "bottom left", "bottom right", "right bottom", "right top", "left bottom", "left top"],
53
+ defaultValue: "bottom left"
54
+ }),
55
+ useRNModal: (0, _types.createStaticBoolProp)({
56
+ label: "Use RN Modal",
57
+ description: "If true, the popover will use the RN Modal component."
58
+ }),
59
+ onOpen: (0, _types.createActionProp)(),
60
+ onClose: (0, _types.createActionProp)()
61
+ }
62
+ }, {
63
+ name: "Popover Arrow",
64
+ tag: "Popover.Arrow",
65
+ description: "The popover arrow.",
66
+ ...SHARED_SEED_DATA,
67
+ props: {}
68
+ }, {
69
+ name: "Popover Body",
70
+ tag: "Popover.Body",
71
+ description: "The body of the popover.",
72
+ ...SHARED_SEED_DATA,
73
+ props: {}
74
+ }, {
75
+ name: "Popover Content",
76
+ tag: "Popover.Content",
77
+ description: "The popover itself.",
78
+ ...SHARED_SEED_DATA,
79
+ props: {}
80
+ }, {
81
+ name: "Popover Close Button",
82
+ tag: "Popover.CloseButton",
83
+ description: "The button that closes the popover.",
84
+ ...SHARED_SEED_DATA,
85
+ props: {}
86
+ }, {
87
+ name: "Popover Header",
88
+ tag: "Popover.Header",
89
+ description: "The header of the popover.",
90
+ ...SHARED_SEED_DATA,
91
+ props: {}
92
+ }, {
93
+ name: "Popover Trigger",
94
+ tag: "Popover.Trigger",
95
+ description: "Used to wrap the reference (or trigger) element.",
96
+ ...SHARED_SEED_DATA,
97
+ props: {}
98
+ }];
99
+ exports.SEED_DATA = SEED_DATA;
@@ -0,0 +1,20 @@
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 SEED_DATA = {
9
+ name: "Touchable",
10
+ tag: "Touchable",
11
+ description: "Simple button with no styles",
12
+ category: _types.COMPONENT_TYPES.button,
13
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Borders],
14
+ layout: {},
15
+ triggers: [_types.Triggers.OnPress],
16
+ props: {
17
+ onPress: (0, _types.createActionProp)()
18
+ }
19
+ };
20
+ exports.SEED_DATA = SEED_DATA;
@@ -1,5 +1,5 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useCallback } from "react";
2
+ import * as React from "react";
3
3
  import { Text, Pressable, Platform, StyleSheet, ActivityIndicator } from "react-native";
4
4
  import { withTheme } from "../theming";
5
5
  const CONSTANTS = {
@@ -14,9 +14,6 @@ function Base(_ref) {
14
14
  icon,
15
15
  title,
16
16
  onPress,
17
- onLongPress,
18
- activeOpacity,
19
- disabledOpacity,
20
17
  loading,
21
18
  disabled,
22
19
  style,
@@ -55,26 +52,17 @@ function Base(_ref) {
55
52
  if (textAlign === "right") {
56
53
  buttonStyles.justifyContent = "flex-end";
57
54
  }
58
- const getOpacity = useCallback(pressed => {
59
- if (disabled) {
60
- return disabledOpacity;
61
- } else {
62
- if (pressed) return activeOpacity;else return 1;
63
- }
64
- }, [activeOpacity, disabled, disabledOpacity]);
65
- const _style = useCallback(_ref2 => {
66
- let {
67
- pressed
68
- } = _ref2;
69
- return [buttonStyles, {
70
- opacity: getOpacity(pressed)
71
- }];
72
- }, [getOpacity, buttonStyles]);
73
55
  return /*#__PURE__*/React.createElement(Pressable, _extends({
74
56
  onPress: onPress,
75
- onLongPress: onLongPress,
76
57
  disabled: disabled || loading,
77
- style: (styles.base, _style)
58
+ style: _ref2 => {
59
+ let {
60
+ pressed
61
+ } = _ref2;
62
+ return [styles.base, {
63
+ opacity: pressed || disabled ? 0.75 : 1
64
+ }, buttonStyles];
65
+ }
78
66
  }, props), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
79
67
  size: "small",
80
68
  color: color,
@@ -1,7 +1,8 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  import * as React from "react";
3
- import { View, StyleSheet, Pressable } from "react-native";
3
+ import { View, StyleSheet } from "react-native";
4
4
  import { useTheme } from "../../theming";
5
+ import Touchable from "../Touchable";
5
6
  import { usePrevious } from "../../hooks";
6
7
  const Checkbox = _ref => {
7
8
  let {
@@ -50,7 +51,7 @@ const Checkbox = _ref => {
50
51
  onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
51
52
  }
52
53
  };
53
- return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
54
+ return /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
54
55
  onPress: handlePress,
55
56
  disabled: disabled,
56
57
  accessibilityState: {
@@ -0,0 +1,141 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import * as React from "react";
3
+ import { ActivityIndicator, View, Text, StyleSheet } from "react-native";
4
+ import color from "color";
5
+ import Config from "./Config";
6
+ import Touchable from "./Touchable";
7
+ import Elevation from "./Elevation";
8
+ import { withTheme } from "../theming";
9
+ const Button = _ref => {
10
+ let {
11
+ Icon,
12
+ icon,
13
+ disabled = false,
14
+ type = "solid",
15
+ loading = false,
16
+ labelColor,
17
+ color: colorOverride,
18
+ children,
19
+ onPress,
20
+ elevation = 0,
21
+ style,
22
+ theme: {
23
+ colors,
24
+ disabledOpacity,
25
+ roundness,
26
+ typography
27
+ },
28
+ ...rest
29
+ } = _ref;
30
+ let backgroundColor, borderColor, textColor, borderWidth;
31
+ const buttonColor = colorOverride || colors.primary;
32
+ if (type === "solid") {
33
+ backgroundColor = buttonColor;
34
+ if (disabled) {
35
+ textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();
36
+ } else {
37
+ textColor = labelColor || colors.surface;
38
+ }
39
+ } else {
40
+ backgroundColor = "transparent";
41
+ if (disabled) {
42
+ textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
43
+ } else {
44
+ textColor = labelColor || buttonColor;
45
+ }
46
+ }
47
+ if (type === "outline") {
48
+ if (disabled) {
49
+ borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
50
+ } else {
51
+ borderColor = buttonColor;
52
+ }
53
+ borderWidth = StyleSheet.hairlineWidth;
54
+ } else {
55
+ borderColor = "transparent";
56
+ borderWidth = 0;
57
+ }
58
+ const buttonStyle = {
59
+ backgroundColor,
60
+ borderColor,
61
+ borderWidth,
62
+ borderRadius: roundness
63
+ };
64
+ const textStyle = {
65
+ textAlign: "center",
66
+ color: textColor,
67
+ marginVertical: 16,
68
+ marginHorizontal: 16
69
+ };
70
+ const iconStyle = [styles.icon, {
71
+ marginLeft: 16,
72
+ marginRight: -8,
73
+ width: Config.buttonIconSize
74
+ }];
75
+ const {
76
+ margin,
77
+ marginEnd,
78
+ marginTop,
79
+ marginLeft,
80
+ marginRight,
81
+ marginBottom,
82
+ marginHorizontal,
83
+ marginVertical,
84
+ ...innerStyles
85
+ } = StyleSheet.flatten(style || {});
86
+ const margins = {
87
+ margin,
88
+ marginEnd,
89
+ marginTop,
90
+ marginLeft,
91
+ marginRight,
92
+ marginBottom,
93
+ marginHorizontal,
94
+ marginVertical
95
+ };
96
+ return /*#__PURE__*/React.createElement(Elevation, {
97
+ style: {
98
+ elevation,
99
+ alignSelf: "stretch",
100
+ ...margins
101
+ }
102
+ }, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
103
+ onPress: onPress,
104
+ accessibilityState: {
105
+ disabled
106
+ },
107
+ accessibilityRole: "button",
108
+ disabled: disabled || loading,
109
+ style: [styles.button, buttonStyle, innerStyles]
110
+ }), /*#__PURE__*/React.createElement(View, {
111
+ style: styles.content
112
+ }, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
113
+ style: iconStyle
114
+ }, /*#__PURE__*/React.createElement(Icon, {
115
+ name: icon,
116
+ size: Config.buttonIconSize,
117
+ color: textColor
118
+ })) : null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
119
+ size: "small",
120
+ color: textColor,
121
+ style: iconStyle
122
+ }) : null, /*#__PURE__*/React.createElement(Text, {
123
+ numberOfLines: 1,
124
+ style: [textStyle, typography.button]
125
+ }, children))));
126
+ };
127
+ const styles = StyleSheet.create({
128
+ button: {
129
+ minWidth: 64,
130
+ borderStyle: "solid"
131
+ },
132
+ content: {
133
+ flexDirection: "row",
134
+ alignItems: "center",
135
+ justifyContent: "center"
136
+ },
137
+ icon: {
138
+ width: Config.buttonIconSize
139
+ }
140
+ });
141
+ export default withTheme(Button);
@@ -1,7 +1,7 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  import React from "react";
3
3
  import { withTheme } from "../theming";
4
- import { Pressable } from "react-native";
4
+ import Touchable from "./Touchable";
5
5
  const getWidth = numColumns => {
6
6
  switch (numColumns) {
7
7
  case 1:
@@ -21,7 +21,7 @@ const Card = _ref => {
21
21
  ...rest
22
22
  } = _ref;
23
23
  const width = getWidth(numColumns);
24
- return /*#__PURE__*/React.createElement(Pressable, _extends({
24
+ return /*#__PURE__*/React.createElement(Touchable, _extends({
25
25
  disabled: !onPress,
26
26
  onPress: onPress,
27
27
  style: [style, {
@@ -1,9 +1,10 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  import * as React from "react";
3
- import { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
3
+ import { ActivityIndicator, View, StyleSheet } from "react-native";
4
4
  import color from "color";
5
5
  import Config from "./Config";
6
6
  import Text from "./Text";
7
+ import Touchable from "./Touchable";
7
8
  import Elevation from "./Elevation";
8
9
  import { withTheme } from "../theming";
9
10
  const FAB = _ref => {
@@ -97,7 +98,7 @@ const FAB = _ref => {
97
98
  style: [{
98
99
  elevation
99
100
  }, style]
100
- }, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
101
+ }, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
101
102
  onPress: onPress,
102
103
  accessibilityState: {
103
104
  disabled
@@ -1,11 +1,12 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Text, Platform, Dimensions, Pressable } from "react-native";
2
+ import { View, StyleSheet, Text, Platform, Dimensions } from "react-native";
3
3
  import { omit, pickBy, identity, isObject } from "lodash";
4
4
  import { SafeAreaView } from "react-native-safe-area-context";
5
5
  import { Picker as NativePicker } from "@react-native-picker/picker";
6
6
  import { withTheme } from "../../theming";
7
7
  import Portal from "../Portal/Portal";
8
- import { Button } from "../Button";
8
+ import Button from "../DeprecatedButton";
9
+ import Touchable from "../Touchable";
9
10
  import { extractStyles, extractBorderAndMarginStyles, borderStyleNames, marginStyleNames } from "../../utilities";
10
11
  function normalizeOptions(options) {
11
12
  if (options.length === 0) {
@@ -197,7 +198,7 @@ const Picker = _ref => {
197
198
  /* marginsContainer */
198
199
  React.createElement(View, {
199
200
  style: [styles.marginsContainer, marginStyles]
200
- }, /*#__PURE__*/React.createElement(Pressable, {
201
+ }, /*#__PURE__*/React.createElement(Touchable, {
201
202
  disabled: disabled,
202
203
  onPress: togglePickerVisible,
203
204
  style: styles.touchableContainer
@@ -6,7 +6,7 @@ import omit from "lodash.omit";
6
6
  import { Picker as NativePicker } from "@react-native-picker/picker";
7
7
  import { withTheme } from "../../theming";
8
8
  import Portal from "../Portal/Portal";
9
- import { Button } from "../Button";
9
+ import Button from "../DeprecatedButton";
10
10
  import TextField from "../TextField";
11
11
  import Touchable from "../Touchable";
12
12
  import { extractStyles } from "../../utilities";
@@ -1,40 +1,25 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useCallback } from "react";
2
+ import React from "react";
3
3
  import { Pressable } from "react-native";
4
4
  export default function Touchable(_ref) {
5
5
  let {
6
6
  children,
7
7
  disabled,
8
8
  onPress,
9
- onLongPress,
10
- hitSlop,
11
- delayLongPress,
12
- activeOpacity,
13
- disabledOpacity,
14
9
  style,
15
10
  ...props
16
11
  } = _ref;
17
- const getOpacity = useCallback(pressed => {
18
- if (disabled) {
19
- return disabledOpacity;
20
- } else {
21
- if (pressed) return activeOpacity;else return 1;
22
- }
23
- }, [activeOpacity, disabled, disabledOpacity]);
24
- const _style = useCallback(_ref2 => {
25
- let {
26
- pressed
27
- } = _ref2;
28
- return [style, {
29
- opacity: getOpacity(pressed)
30
- }];
31
- }, [getOpacity, style]);
32
12
  return /*#__PURE__*/React.createElement(Pressable, _extends({
33
13
  onPress: onPress,
34
- onLongPress: onLongPress,
35
14
  disabled: disabled,
36
- delayLongPress: delayLongPress ? delayLongPress : 500,
37
- hitSlop: hitSlop ? hitSlop : 8,
38
- style: _style
15
+ hitSlop: 8,
16
+ style: _ref2 => {
17
+ let {
18
+ pressed
19
+ } = _ref2;
20
+ return [{
21
+ opacity: pressed || disabled ? 0.75 : 1
22
+ }, style];
23
+ }
39
24
  }, props), children);
40
25
  }
@@ -0,0 +1,2 @@
1
+ import { TouchableOpacity } from "react-native";
2
+ export default TouchableOpacity;