@draftbit/core 47.0.1-54c307.2 → 47.0.1-9e8c6d.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 (97) hide show
  1. package/lib/commonjs/components/Button.js +3 -3
  2. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -3
  3. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
  4. package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
  5. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
  6. package/lib/commonjs/components/DeprecatedButton.js +3 -27
  7. package/lib/commonjs/components/DeprecatedFAB.js +1 -2
  8. package/lib/commonjs/components/Layout.js +40 -19
  9. package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
  10. package/lib/commonjs/components/Pressable.js +37 -0
  11. package/lib/commonjs/components/ProgressBar.js +37 -7
  12. package/lib/commonjs/components/Swiper/Swiper.js +2 -0
  13. package/lib/commonjs/components/Touchable.js +8 -3
  14. package/lib/commonjs/constants.js +1 -1
  15. package/lib/commonjs/index.js +7 -0
  16. package/lib/commonjs/mappings/Button.js +39 -10
  17. package/lib/commonjs/mappings/FlashList.js +45 -2
  18. package/lib/commonjs/mappings/FlatList.js +12 -0
  19. package/lib/commonjs/mappings/Swiper.js +2 -0
  20. package/lib/commonjs/mappings/Touchable.js +47 -7
  21. package/lib/module/components/Button.js +3 -3
  22. package/lib/module/components/Checkbox/Checkbox.js +2 -3
  23. package/lib/module/components/Checkbox/CheckboxGroupRow.js +2 -3
  24. package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
  25. package/lib/module/components/DatePicker/DatePicker.js +1 -1
  26. package/lib/module/components/DeprecatedButton.js +4 -28
  27. package/lib/module/components/DeprecatedFAB.js +2 -3
  28. package/lib/module/components/Pressable.js +30 -0
  29. package/lib/module/components/Swiper/Swiper.js +2 -0
  30. package/lib/module/components/Touchable.js +8 -3
  31. package/lib/module/constants.js +1 -0
  32. package/lib/module/index.js +1 -0
  33. package/lib/module/mappings/Button.js +40 -11
  34. package/lib/module/mappings/FlashList.js +46 -3
  35. package/lib/module/mappings/FlatList.js +13 -1
  36. package/lib/module/mappings/Swiper.js +3 -1
  37. package/lib/module/mappings/Touchable.js +49 -9
  38. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  39. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
  40. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
  41. package/lib/typescript/src/components/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
  42. package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
  43. package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
  44. package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -1
  45. package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
  46. package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
  47. package/lib/typescript/src/components/Pressable.d.ts +10 -0
  48. package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
  49. package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -1
  50. package/lib/typescript/src/components/Swiper/Swiper.d.ts.map +1 -1
  51. package/lib/typescript/src/components/Touchable.d.ts +5 -6
  52. package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
  53. package/lib/typescript/src/index.d.ts +1 -0
  54. package/lib/typescript/src/index.d.ts.map +1 -1
  55. package/lib/typescript/src/mappings/Button.d.ts +113 -4
  56. package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
  57. package/lib/typescript/src/mappings/FlashList.d.ts +112 -2
  58. package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
  59. package/lib/typescript/src/mappings/FlatList.d.ts +42 -0
  60. package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
  61. package/lib/typescript/src/mappings/Swiper.d.ts +11 -0
  62. package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
  63. package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
  64. package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
  65. package/package.json +3 -3
  66. package/src/components/Button.js +3 -3
  67. package/src/components/Button.tsx +14 -4
  68. package/src/components/Checkbox/Checkbox.js +2 -3
  69. package/src/components/Checkbox/Checkbox.tsx +5 -7
  70. package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
  71. package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
  72. package/src/components/Checkbox/CheckboxRow.js +2 -3
  73. package/src/components/Checkbox/CheckboxRow.tsx +3 -3
  74. package/src/components/DatePicker/DatePicker.js +1 -1
  75. package/src/components/DatePicker/DatePicker.tsx +1 -1
  76. package/src/components/DeprecatedButton.js +4 -16
  77. package/src/components/DeprecatedButton.tsx +7 -31
  78. package/src/components/DeprecatedFAB.js +2 -3
  79. package/src/components/DeprecatedFAB.tsx +5 -5
  80. package/src/components/Pressable.js +12 -0
  81. package/src/components/Pressable.tsx +44 -0
  82. package/src/components/Swiper/Swiper.js +2 -2
  83. package/src/components/Swiper/Swiper.tsx +3 -0
  84. package/src/components/Touchable.js +3 -3
  85. package/src/components/Touchable.tsx +11 -7
  86. package/src/index.js +1 -0
  87. package/src/index.tsx +1 -0
  88. package/src/mappings/Button.js +39 -10
  89. package/src/mappings/Button.ts +41 -10
  90. package/src/mappings/FlashList.js +77 -31
  91. package/src/mappings/FlashList.ts +82 -30
  92. package/src/mappings/FlatList.js +13 -1
  93. package/src/mappings/FlatList.ts +16 -0
  94. package/src/mappings/Swiper.js +3 -1
  95. package/src/mappings/Swiper.ts +4 -0
  96. package/src/mappings/Touchable.js +50 -7
  97. package/src/mappings/Touchable.ts +53 -6
@@ -2,22 +2,69 @@ import {
2
2
  COMPONENT_TYPES,
3
3
  createActionProp,
4
4
  Triggers,
5
+ createStaticNumberProp,
5
6
  StylesPanelSections,
6
7
  } from "@draftbit/types";
7
8
 
8
- export const SEED_DATA = {
9
- name: "Touchable",
10
- tag: "Touchable",
11
- description: "Simple button with no styles",
12
- category: COMPONENT_TYPES.button,
9
+ const SEED_DATA_PROPS = {
13
10
  stylesPanelSections: [
14
11
  StylesPanelSections.Size,
15
12
  StylesPanelSections.Margins,
16
13
  StylesPanelSections.Borders,
17
14
  ],
18
15
  layout: {},
19
- triggers: [Triggers.OnPress],
16
+ triggers: [Triggers.OnPress, Triggers.OnLongPress],
20
17
  props: {
21
18
  onPress: createActionProp(),
19
+ onLongPress: createActionProp(),
20
+ activeOpacity: createStaticNumberProp({
21
+ label: "Active Opacity",
22
+ description: "The opacity when the button is pressed.",
23
+ defaultValue: 0.8,
24
+ min: 0,
25
+ max: 1,
26
+ step: 0.01,
27
+ precision: 2,
28
+ required: false,
29
+ }),
30
+ disabledOpacity: createStaticNumberProp({
31
+ label: "Disabled Opacity",
32
+ description: "The opacity when the button is disabled.",
33
+ defaultValue: 0.8,
34
+ min: 0,
35
+ max: 1,
36
+ step: 0.01,
37
+ precision: 2,
38
+ required: false,
39
+ }),
40
+ delayLongPress: createStaticNumberProp({
41
+ label: "Delay Long Press",
42
+ description:
43
+ "Duration (in milliseconds) from onPressIn before onLongPress is called.",
44
+ required: false,
45
+ }),
46
+ hitSlop: createStaticNumberProp({
47
+ label: "Hit Slop",
48
+ description:
49
+ "Sets additional distance outside of element in which a press can be detected.",
50
+ required: false,
51
+ }),
22
52
  },
23
53
  };
54
+
55
+ export const SEED_DATA = [
56
+ {
57
+ name: "Touchable",
58
+ tag: "Touchable",
59
+ description: "An interactive view with no styles",
60
+ category: COMPONENT_TYPES.button,
61
+ ...SEED_DATA_PROPS,
62
+ },
63
+ {
64
+ name: "Pressable",
65
+ tag: "Pressable",
66
+ description: "An interactive view with no styles",
67
+ category: COMPONENT_TYPES.button,
68
+ ...SEED_DATA_PROPS,
69
+ },
70
+ ];