@draftbit/core 46.4.4-602cb9.2 → 46.4.4-618dac.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 (64) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +5 -25
  2. package/lib/commonjs/components/BottomSheet/BottomSheet.native.js +68 -0
  3. package/lib/commonjs/components/BottomSheet/BottomSheet.web.js +97 -0
  4. package/lib/commonjs/components/BottomSheet/index.js +15 -0
  5. package/lib/commonjs/components/BottomSheet/types.js +5 -0
  6. package/lib/commonjs/components/Checkbox/CheckboxGroup.js +3 -18
  7. package/lib/commonjs/components/CircleImage.js +16 -2
  8. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -6
  9. package/lib/commonjs/components/Divider.js +2 -16
  10. package/lib/commonjs/components/Text.js +6 -2
  11. package/lib/commonjs/components/TextField.js +5 -1
  12. package/lib/commonjs/index.js +8 -0
  13. package/lib/commonjs/mappings/BottomSheet.js +22 -0
  14. package/lib/commonjs/mappings/DatePicker.js +0 -1
  15. package/lib/commonjs/mappings/TextField.js +1 -1
  16. package/lib/commonjs/mappings/TextInput.js +1 -1
  17. package/lib/module/components/BottomSheet/BottomSheet.native.js +50 -0
  18. package/lib/module/components/BottomSheet/BottomSheet.web.js +78 -0
  19. package/lib/module/components/BottomSheet/index.js +2 -0
  20. package/lib/module/components/BottomSheet/types.js +1 -0
  21. package/lib/module/components/DatePicker/DatePicker.js +1 -5
  22. package/lib/module/components/Text.js +6 -2
  23. package/lib/module/components/TextField.js +5 -1
  24. package/lib/module/index.js +1 -0
  25. package/lib/module/mappings/BottomSheet.js +13 -0
  26. package/lib/module/mappings/DatePicker.js +1 -2
  27. package/lib/module/mappings/TextField.js +1 -1
  28. package/lib/module/mappings/TextInput.js +1 -1
  29. package/lib/typescript/src/components/BottomSheet/BottomSheet.native.d.ts +4 -0
  30. package/lib/typescript/src/components/BottomSheet/BottomSheet.web.d.ts +4 -0
  31. package/lib/typescript/src/components/BottomSheet/index.d.ts +1 -0
  32. package/lib/typescript/src/components/BottomSheet/types.d.ts +8 -0
  33. package/lib/typescript/src/components/Text.d.ts +2 -1
  34. package/lib/typescript/src/components/TextField.d.ts +2 -1
  35. package/lib/typescript/src/index.d.ts +1 -0
  36. package/lib/typescript/src/mappings/BottomSheet.d.ts +19 -0
  37. package/lib/typescript/src/mappings/DatePicker.d.ts +0 -1
  38. package/lib/typescript/src/mappings/TextField.d.ts +2 -2
  39. package/lib/typescript/src/mappings/TextInput.d.ts +1 -1
  40. package/package.json +5 -3
  41. package/src/components/BottomSheet/BottomSheet.native.js +37 -0
  42. package/src/components/BottomSheet/BottomSheet.native.tsx +60 -0
  43. package/src/components/BottomSheet/BottomSheet.web.js +56 -0
  44. package/src/components/BottomSheet/BottomSheet.web.tsx +90 -0
  45. package/src/components/BottomSheet/index.js +2 -0
  46. package/src/components/BottomSheet/index.tsx +2 -0
  47. package/src/components/BottomSheet/types.js +1 -0
  48. package/src/components/BottomSheet/types.tsx +8 -0
  49. package/src/components/DatePicker/DatePicker.js +0 -3
  50. package/src/components/DatePicker/DatePicker.tsx +0 -4
  51. package/src/components/Text.js +8 -2
  52. package/src/components/Text.tsx +6 -1
  53. package/src/components/TextField.js +6 -1
  54. package/src/components/TextField.tsx +7 -1
  55. package/src/index.js +1 -0
  56. package/src/index.tsx +1 -0
  57. package/src/mappings/BottomSheet.js +20 -0
  58. package/src/mappings/BottomSheet.ts +25 -0
  59. package/src/mappings/DatePicker.js +1 -9
  60. package/src/mappings/DatePicker.ts +0 -9
  61. package/src/mappings/TextField.js +1 -1
  62. package/src/mappings/TextField.ts +1 -1
  63. package/src/mappings/TextInput.js +1 -1
  64. package/src/mappings/TextInput.ts +1 -1
@@ -52,6 +52,7 @@ export type Props = {
52
52
  IconSlot;
53
53
 
54
54
  interface State {
55
+ nativeProps: any;
55
56
  labeled: Animated.Value;
56
57
  focused?: boolean;
57
58
  placeholder?: string | undefined;
@@ -73,6 +74,7 @@ class TextField extends React.Component<Props, State> {
73
74
  }
74
75
 
75
76
  state: State = {
77
+ nativeProps: {},
76
78
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
77
79
  focused: false,
78
80
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -207,7 +209,10 @@ class TextField extends React.Component<Props, State> {
207
209
  * @internal
208
210
  */
209
211
  setNativeProps(args: Props) {
210
- return this._root && this._root.setNativeProps(args);
212
+ this.setState((state) => ({
213
+ ...state,
214
+ nativeState: args || {},
215
+ }));
211
216
  }
212
217
 
213
218
  isFocused() {
@@ -566,6 +571,7 @@ class TextField extends React.Component<Props, State> {
566
571
  underlineColorAndroid: "transparent",
567
572
  style: inputStyles,
568
573
  ...rest,
574
+ ...this.state.nativeProps,
569
575
  value: this.state.value,
570
576
  })}
571
577
  </View>
package/src/index.js CHANGED
@@ -29,6 +29,7 @@ export { default as Touchable } from "./components/Touchable";
29
29
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
30
30
  export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
+ export { BottomSheet } from "./components/BottomSheet";
32
33
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
34
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
35
  /* Deprecated: Fix or Delete! */
package/src/index.tsx CHANGED
@@ -34,6 +34,7 @@ export {
34
34
  ActionSheetCancel,
35
35
  } from "./components/ActionSheet";
36
36
  export { Swiper, SwiperItem } from "./components/Swiper";
37
+ export { BottomSheet } from "./components/BottomSheet";
37
38
 
38
39
  export {
39
40
  Center,
@@ -0,0 +1,20 @@
1
+ import { COMPONENT_TYPES, createNumberProp, StylesPanelSections, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Bottom Sheet",
4
+ tag: "BottomSheet",
5
+ category: COMPONENT_TYPES.container,
6
+ stylesPanelSections: [
7
+ StylesPanelSections.Background,
8
+ StylesPanelSections.Borders,
9
+ StylesPanelSections.Size,
10
+ StylesPanelSections.MarginsAndPaddings,
11
+ StylesPanelSections.Position,
12
+ StylesPanelSections.Effects,
13
+ ],
14
+ props: {
15
+ step: createNumberProp({
16
+ label: "Step",
17
+ description: "Step can be -1, 0, 1, or 2.",
18
+ }),
19
+ },
20
+ };
@@ -0,0 +1,25 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createNumberProp,
4
+ StylesPanelSections,
5
+ } from "@draftbit/types";
6
+
7
+ export const SEED_DATA = {
8
+ name: "Bottom Sheet",
9
+ tag: "BottomSheet",
10
+ category: COMPONENT_TYPES.container,
11
+ stylesPanelSections: [
12
+ StylesPanelSections.Background,
13
+ StylesPanelSections.Borders,
14
+ StylesPanelSections.Size,
15
+ StylesPanelSections.MarginsAndPaddings,
16
+ StylesPanelSections.Position,
17
+ StylesPanelSections.Effects,
18
+ ],
19
+ props: {
20
+ step: createNumberProp({
21
+ label: "Step",
22
+ description: "Step can be -1, 0, 1, or 2.",
23
+ }),
24
+ },
25
+ };
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, StylesPanelSections, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, GROUPS, Triggers, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  label: {
4
4
  label: "Label",
@@ -139,14 +139,6 @@ export const SEED_DATA = [
139
139
  category: COMPONENT_TYPES.input,
140
140
  layout: null,
141
141
  triggers: [Triggers.OnDateChange],
142
- StylesPanelSections: [
143
- StylesPanelSections.Background,
144
- StylesPanelSections.Borders,
145
- StylesPanelSections.MarginsAndPaddings,
146
- StylesPanelSections.Position,
147
- StylesPanelSections.Size,
148
- StylesPanelSections.Typography,
149
- ],
150
142
  props: {
151
143
  ...SEED_DATA_PROPS,
152
144
  type: {
@@ -5,7 +5,6 @@ import {
5
5
  FIELD_NAME,
6
6
  GROUPS,
7
7
  Triggers,
8
- StylesPanelSections,
9
8
  } from "@draftbit/types";
10
9
 
11
10
  const SEED_DATA_PROPS = {
@@ -151,14 +150,6 @@ export const SEED_DATA = [
151
150
  category: COMPONENT_TYPES.input,
152
151
  layout: null,
153
152
  triggers: [Triggers.OnDateChange],
154
- StylesPanelSections: [
155
- StylesPanelSections.Background,
156
- StylesPanelSections.Borders,
157
- StylesPanelSections.MarginsAndPaddings,
158
- StylesPanelSections.Position,
159
- StylesPanelSections.Size,
160
- StylesPanelSections.Typography,
161
- ],
162
153
  props: {
163
154
  ...SEED_DATA_PROPS,
164
155
  type: {
@@ -16,7 +16,7 @@ const SEED_DATA_PROPS = {
16
16
  description: "Can automatically capitalize sentences, words, and characters (Default: none).",
17
17
  editable: true,
18
18
  required: false,
19
- defaultValue: null,
19
+ defaultValue: "none",
20
20
  options: ["none", "sentences", "words", "characters"],
21
21
  formType: FORM_TYPES.flatArray,
22
22
  propType: PROP_TYPES.STRING,
@@ -30,7 +30,7 @@ const SEED_DATA_PROPS = {
30
30
  "Can automatically capitalize sentences, words, and characters (Default: none).",
31
31
  editable: true,
32
32
  required: false,
33
- defaultValue: null,
33
+ defaultValue: "none",
34
34
  options: ["none", "sentences", "words", "characters"],
35
35
  formType: FORM_TYPES.flatArray,
36
36
  propType: PROP_TYPES.STRING,
@@ -104,7 +104,7 @@ export const SEED_DATA = [
104
104
  description: "Can automatically capitalize sentences, words, and characters (Default: none).",
105
105
  editable: true,
106
106
  required: false,
107
- defaultValue: null,
107
+ defaultValue: "none",
108
108
  options: ["none", "sentences", "words", "characters"],
109
109
  formType: FORM_TYPES.flatArray,
110
110
  propType: PROP_TYPES.STRING,
@@ -121,7 +121,7 @@ export const SEED_DATA = [
121
121
  "Can automatically capitalize sentences, words, and characters (Default: none).",
122
122
  editable: true,
123
123
  required: false,
124
- defaultValue: null,
124
+ defaultValue: "none",
125
125
  options: ["none", "sentences", "words", "characters"],
126
126
  formType: FORM_TYPES.flatArray,
127
127
  propType: PROP_TYPES.STRING,