@draftbit/core 46.5.2-13b65f.2 → 46.5.2-5f6e91.0

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 (143) hide show
  1. package/lib/commonjs/components/Button.js +15 -27
  2. package/lib/commonjs/components/CardBlock.js +13 -4
  3. package/lib/commonjs/components/CardContainerRating.js +13 -4
  4. package/lib/commonjs/components/CardContainerShortImage.js +15 -4
  5. package/lib/commonjs/components/Carousel.js +30 -8
  6. package/lib/commonjs/components/Checkbox/Checkbox.js +3 -1
  7. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
  8. package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
  9. package/lib/commonjs/components/CircleImage.js +15 -1
  10. package/lib/commonjs/components/CircularProgress.js +26 -8
  11. package/lib/commonjs/components/DatePicker/DatePicker.js +4 -0
  12. package/lib/commonjs/components/DatePicker/DatePickerComponent.js +6 -0
  13. package/lib/commonjs/components/DeprecatedButton.js +151 -0
  14. package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
  15. package/lib/commonjs/components/DeprecatedFAB.js +2 -1
  16. package/lib/commonjs/components/Elevation.js +14 -2
  17. package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
  18. package/lib/commonjs/components/FormRow.js +16 -2
  19. package/lib/commonjs/components/IconButton.js +19 -4
  20. package/lib/commonjs/components/Image.js +17 -2
  21. package/lib/commonjs/components/Layout.js +40 -19
  22. package/lib/commonjs/components/Picker/Picker.js +13 -7
  23. package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
  24. package/lib/commonjs/components/Picker/PickerComponent.ios.js +38 -13
  25. package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
  26. package/lib/commonjs/components/Portal/PortalHost.js +44 -15
  27. package/lib/commonjs/components/ProgressBar.js +37 -7
  28. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +23 -5
  29. package/lib/commonjs/components/Slider.js +21 -4
  30. package/lib/commonjs/components/Surface.js +14 -2
  31. package/lib/commonjs/components/Switch.js +19 -10
  32. package/lib/commonjs/components/Text.js +50 -4
  33. package/lib/commonjs/components/Touchable.js +27 -28
  34. package/lib/commonjs/components/Touchable.web.js +9 -0
  35. package/lib/commonjs/constants.js +1 -1
  36. package/lib/commonjs/hooks.js +1 -2
  37. package/lib/commonjs/mappings/Button.js +10 -13
  38. package/lib/commonjs/mappings/Touchable.js +20 -0
  39. package/lib/commonjs/styles/overlay.js +1 -3
  40. package/lib/module/components/AnimatedCircularProgress.js +13 -1
  41. package/lib/module/components/Button.js +9 -21
  42. package/lib/module/components/CardContainer.js +14 -4
  43. package/lib/module/components/Checkbox/Checkbox.js +3 -2
  44. package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
  45. package/lib/module/components/Checkbox/CheckboxRow.js +24 -6
  46. package/lib/module/components/Checkbox/context.js +1 -1
  47. package/lib/module/components/CircleImage.js +16 -1
  48. package/lib/module/components/DatePicker/DatePicker.js +4 -0
  49. package/lib/module/components/DatePicker/DatePickerComponent.js +6 -0
  50. package/lib/module/components/DeprecatedButton.js +141 -0
  51. package/lib/module/components/DeprecatedCardWrapper.js +2 -2
  52. package/lib/module/components/DeprecatedFAB.js +25 -4
  53. package/lib/module/components/Divider.js +18 -1
  54. package/lib/module/components/Elevation.js +14 -2
  55. package/lib/module/components/IconButton.js +21 -4
  56. package/lib/module/components/Layout.js +42 -21
  57. package/lib/module/components/Picker/Picker.js +4 -3
  58. package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
  59. package/lib/module/components/Picker/PickerComponent.web.js +21 -3
  60. package/lib/module/components/Portal/PortalHost.js +45 -15
  61. package/lib/module/components/Portal/PortalManager.js +33 -7
  62. package/lib/module/components/ProgressBar.js +39 -7
  63. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
  64. package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
  65. package/lib/module/components/ScreenContainer.js +21 -4
  66. package/lib/module/components/Slider.js +21 -4
  67. package/lib/module/components/StepIndicator.js +58 -18
  68. package/lib/module/components/Surface.js +15 -1
  69. package/lib/module/components/TextField.js +78 -28
  70. package/lib/module/components/ToggleButton.js +16 -2
  71. package/lib/module/components/Touchable.js +10 -25
  72. package/lib/module/components/Touchable.web.js +2 -0
  73. package/lib/module/constants.js +1 -2
  74. package/lib/module/hooks.js +1 -2
  75. package/lib/module/index.js +1 -3
  76. package/lib/module/mappings/Button.js +11 -14
  77. package/lib/module/mappings/FieldSearchBarFull.js +4 -1
  78. package/lib/module/mappings/StarRating.js +7 -2
  79. package/lib/module/mappings/Touchable.js +13 -0
  80. package/lib/module/styles/overlay.js +1 -3
  81. package/lib/typescript/src/components/Button.d.ts +0 -2
  82. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  83. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
  84. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
  85. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +2 -0
  86. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
  87. package/lib/typescript/src/components/DatePicker/DatePickerComponent.d.ts.map +1 -1
  88. package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +2 -0
  89. package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts.map +1 -1
  90. package/lib/typescript/src/components/DeprecatedButton.d.ts +54 -0
  91. package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -0
  92. package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -1
  93. package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
  94. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
  95. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  96. package/lib/typescript/src/components/Touchable.d.ts +2 -9
  97. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  98. package/lib/typescript/src/components/Touchable.web.d.ts +3 -0
  99. package/lib/typescript/src/components/Touchable.web.d.ts.map +1 -0
  100. package/lib/typescript/src/mappings/Button.d.ts +4 -113
  101. package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
  102. package/lib/typescript/src/mappings/Touchable.d.ts +22 -0
  103. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -0
  104. package/package.json +3 -3
  105. package/src/components/Button.js +11 -18
  106. package/src/components/Button.tsx +11 -45
  107. package/src/components/Checkbox/Checkbox.js +3 -2
  108. package/src/components/Checkbox/Checkbox.tsx +7 -5
  109. package/src/components/DatePicker/DatePicker.js +2 -2
  110. package/src/components/DatePicker/DatePicker.tsx +6 -0
  111. package/src/components/DatePicker/DatePickerComponent.js +3 -3
  112. package/src/components/DatePicker/DatePickerComponent.tsx +6 -0
  113. package/src/components/DatePicker/DatePickerComponentType.ts +2 -0
  114. package/src/components/DeprecatedButton.js +95 -0
  115. package/src/components/DeprecatedButton.tsx +214 -0
  116. package/src/components/DeprecatedCardWrapper.js +2 -2
  117. package/src/components/DeprecatedCardWrapper.tsx +4 -3
  118. package/src/components/DeprecatedFAB.js +3 -2
  119. package/src/components/DeprecatedFAB.tsx +5 -5
  120. package/src/components/Picker/Picker.js +4 -3
  121. package/src/components/Picker/Picker.tsx +4 -4
  122. package/src/components/Picker/PickerComponent.ios.js +1 -1
  123. package/src/components/Picker/PickerComponent.ios.tsx +1 -1
  124. package/src/components/Touchable.js +11 -16
  125. package/src/components/Touchable.tsx +11 -42
  126. package/src/components/Touchable.web.js +2 -0
  127. package/src/components/Touchable.web.tsx +3 -0
  128. package/src/mappings/Button.js +10 -13
  129. package/src/mappings/Button.ts +10 -13
  130. package/src/mappings/Touchable.js +17 -0
  131. package/src/mappings/Touchable.ts +23 -0
  132. package/lib/commonjs/components/Pressable.js +0 -48
  133. package/lib/commonjs/mappings/Pressable.js +0 -34
  134. package/lib/module/components/Pressable.js +0 -40
  135. package/lib/module/mappings/Pressable.js +0 -27
  136. package/lib/typescript/src/components/Pressable.d.ts +0 -18
  137. package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
  138. package/lib/typescript/src/mappings/Pressable.d.ts +0 -76
  139. package/lib/typescript/src/mappings/Pressable.d.ts.map +0 -1
  140. package/src/components/Pressable.js +0 -17
  141. package/src/components/Pressable.tsx +0 -67
  142. package/src/mappings/Pressable.js +0 -34
  143. package/src/mappings/Pressable.ts +0 -42
@@ -1,76 +0,0 @@
1
- export declare const SEED_DATA: {
2
- stylesPanelSections: string[];
3
- layout: {};
4
- triggers: string[];
5
- props: {
6
- onPress: {
7
- label: string;
8
- description: string;
9
- editable: boolean;
10
- required: boolean;
11
- formType: string;
12
- propType: string;
13
- defaultValue: null;
14
- group: string;
15
- };
16
- onLongPress: {
17
- label: string;
18
- description: string;
19
- editable: boolean;
20
- required: boolean;
21
- formType: string;
22
- propType: string;
23
- defaultValue: null;
24
- group: string;
25
- };
26
- activeOpacity: {
27
- label: string;
28
- description: string;
29
- formType: string;
30
- propType: string;
31
- group: string;
32
- defaultValue: null;
33
- editable: boolean;
34
- required: boolean;
35
- step: number;
36
- };
37
- disabledOpacity: {
38
- label: string;
39
- description: string;
40
- formType: string;
41
- propType: string;
42
- group: string;
43
- defaultValue: null;
44
- editable: boolean;
45
- required: boolean;
46
- step: number;
47
- };
48
- delayLongPress: {
49
- label: string;
50
- description: string;
51
- formType: string;
52
- propType: string;
53
- group: string;
54
- defaultValue: null;
55
- editable: boolean;
56
- required: boolean;
57
- step: number;
58
- };
59
- hitSlop: {
60
- label: string;
61
- description: string;
62
- formType: string;
63
- propType: string;
64
- group: string;
65
- defaultValue: null;
66
- editable: boolean;
67
- required: boolean;
68
- step: number;
69
- };
70
- };
71
- name: string;
72
- tag: string;
73
- description: string;
74
- category: string;
75
- }[];
76
- //# sourceMappingURL=Pressable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Pressable.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAerB,CAAC"}
@@ -1,17 +0,0 @@
1
- import React, { useCallback } from "react";
2
- import { Pressable as NativePressable, } from "react-native";
3
- export default function Pressable({ children, disabled, onPress, onLongPress, hitSlop, delayLongPress, activeOpacity, disabledOpacity, style, ...props }) {
4
- const getOpacity = useCallback((pressed) => {
5
- if (disabled) {
6
- return disabledOpacity;
7
- }
8
- else {
9
- if (pressed)
10
- return activeOpacity;
11
- else
12
- return 1;
13
- }
14
- }, [activeOpacity, disabled, disabledOpacity]);
15
- const _style = useCallback(({ pressed }) => [style, { opacity: getOpacity(pressed) }], [getOpacity, style]);
16
- return (React.createElement(NativePressable, { onPress: onPress, onLongPress: onLongPress, disabled: disabled, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: _style, ...props }, children));
17
- }
@@ -1,67 +0,0 @@
1
- import React, { useCallback } from "react";
2
- import {
3
- Pressable as NativePressable,
4
- PressableProps,
5
- PressableStateCallbackType,
6
- StyleProp,
7
- ViewStyle,
8
- } from "react-native";
9
-
10
- type Props = {
11
- disabled?: boolean;
12
- children: React.ReactNode;
13
- style?: ViewStyle;
14
- onPress?: () => void;
15
- onLongPress?: () => void;
16
- delayLongPress?: number;
17
- hitSlop?: number;
18
- pressRetentionOffset?: number;
19
- activeOpacity?: number;
20
- disabledOpacity?: number;
21
- } & PressableProps;
22
-
23
- export type StyleType = (
24
- state: PressableStateCallbackType
25
- ) => StyleProp<ViewStyle>;
26
-
27
- export default function Pressable({
28
- children,
29
- disabled,
30
- onPress,
31
- onLongPress,
32
- hitSlop,
33
- delayLongPress,
34
- activeOpacity,
35
- disabledOpacity,
36
- style,
37
- ...props
38
- }: Props) {
39
- const getOpacity = useCallback(
40
- (pressed: boolean) => {
41
- if (disabled) {
42
- return disabledOpacity;
43
- } else {
44
- if (pressed) return activeOpacity;
45
- else return 1;
46
- }
47
- },
48
- [activeOpacity, disabled, disabledOpacity]
49
- );
50
- const _style = useCallback<StyleType>(
51
- ({ pressed }) => [style as ViewStyle, { opacity: getOpacity(pressed) }],
52
- [getOpacity, style]
53
- );
54
- return (
55
- <NativePressable
56
- onPress={onPress}
57
- onLongPress={onLongPress}
58
- disabled={disabled}
59
- delayLongPress={delayLongPress ? delayLongPress : 500}
60
- hitSlop={hitSlop ? hitSlop : 8}
61
- style={_style}
62
- {...props}
63
- >
64
- {children}
65
- </NativePressable>
66
- );
67
- }
@@ -1,34 +0,0 @@
1
- import { COMPONENT_TYPES, createActionProp, Triggers, createNumberProp, StylesPanelSections, } from "@draftbit/types";
2
- const SEED_DATA_PROPS = {
3
- stylesPanelSections: [
4
- StylesPanelSections.Size,
5
- StylesPanelSections.Margins,
6
- StylesPanelSections.Borders,
7
- ],
8
- layout: {},
9
- triggers: [Triggers.OnPress, Triggers.OnLongPress],
10
- props: {
11
- onPress: createActionProp(),
12
- onLongPress: createActionProp(),
13
- activeOpacity: createNumberProp(),
14
- disabledOpacity: createNumberProp(),
15
- delayLongPress: createNumberProp(),
16
- hitSlop: createNumberProp(),
17
- },
18
- };
19
- export const SEED_DATA = [
20
- {
21
- name: "Touchable",
22
- tag: "Touchable",
23
- description: "An interactive view with no styles",
24
- category: COMPONENT_TYPES.deprecated,
25
- ...SEED_DATA_PROPS,
26
- },
27
- {
28
- name: "Pressable",
29
- tag: "Pressable",
30
- description: "An interactive view with no styles",
31
- category: COMPONENT_TYPES.button,
32
- ...SEED_DATA_PROPS,
33
- },
34
- ];
@@ -1,42 +0,0 @@
1
- import {
2
- COMPONENT_TYPES,
3
- createActionProp,
4
- Triggers,
5
- createNumberProp,
6
- StylesPanelSections,
7
- } from "@draftbit/types";
8
-
9
- const SEED_DATA_PROPS = {
10
- stylesPanelSections: [
11
- StylesPanelSections.Size,
12
- StylesPanelSections.Margins,
13
- StylesPanelSections.Borders,
14
- ],
15
- layout: {},
16
- triggers: [Triggers.OnPress, Triggers.OnLongPress],
17
- props: {
18
- onPress: createActionProp(),
19
- onLongPress: createActionProp(),
20
- activeOpacity: createNumberProp(),
21
- disabledOpacity: createNumberProp(),
22
- delayLongPress: createNumberProp(),
23
- hitSlop: createNumberProp(),
24
- },
25
- };
26
-
27
- export const SEED_DATA = [
28
- {
29
- name: "Touchable",
30
- tag: "Touchable",
31
- description: "An interactive view with no styles",
32
- category: COMPONENT_TYPES.deprecated,
33
- ...SEED_DATA_PROPS,
34
- },
35
- {
36
- name: "Pressable",
37
- tag: "Pressable",
38
- description: "An interactive view with no styles",
39
- category: COMPONENT_TYPES.button,
40
- ...SEED_DATA_PROPS,
41
- },
42
- ];