@draftbit/core 47.0.0 → 47.0.1-50db3c.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.
- package/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
- package/lib/commonjs/components/Button.js +31 -22
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -3
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -2
- package/lib/commonjs/components/DeprecatedFAB.js +1 -2
- package/lib/commonjs/components/Justification.js +5 -1
- package/lib/commonjs/components/Picker/Picker.js +3 -4
- package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/commonjs/components/Pressable.js +59 -0
- package/lib/commonjs/components/ResizeMode.js +5 -1
- package/lib/commonjs/components/Touchable.js +27 -11
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/Button.js +21 -10
- package/lib/commonjs/mappings/Pressable.js +52 -0
- package/lib/module/components/Button.js +25 -16
- package/lib/module/components/Checkbox/Checkbox.js +2 -3
- package/lib/module/components/DeprecatedCardWrapper.js +2 -2
- package/lib/module/components/DeprecatedFAB.js +2 -3
- package/lib/module/components/Justification.js +1 -0
- package/lib/module/components/Picker/Picker.js +3 -4
- package/lib/module/components/Picker/PickerComponent.ios.js +1 -1
- package/lib/module/components/Pressable.js +40 -0
- package/lib/module/components/ResizeMode.js +1 -0
- package/lib/module/components/Touchable.js +25 -10
- package/lib/module/mappings/Button.js +22 -11
- package/lib/module/mappings/Pressable.js +45 -0
- package/lib/typescript/src/components/Button.d.ts +2 -0
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts +18 -0
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/Touchable.d.ts +9 -2
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +113 -4
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Pressable.d.ts +76 -0
- package/lib/typescript/src/mappings/Pressable.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/Provider.js +9 -0
- package/src/components/Accordion/AccordionGroup.js +44 -0
- package/src/components/Accordion/AccordionItem.js +32 -0
- package/src/components/Accordion/index.js +2 -0
- package/src/components/ActionSheet/ActionSheet.js +45 -0
- package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
- package/src/components/ActionSheet/ActionSheetItem.js +30 -0
- package/src/components/ActionSheet/index.js +3 -0
- package/src/components/AnimatedCircularProgress.js +43 -0
- package/src/components/AspectRatio.js +18 -0
- package/src/components/AvatarEdit.js +30 -0
- package/src/components/Banner.js +109 -0
- package/src/components/Button.js +118 -0
- package/src/components/Button.tsx +49 -18
- package/src/components/Card.js +57 -0
- package/src/components/CardBlock.js +54 -0
- package/src/components/CardContainer.js +69 -0
- package/src/components/CardContainerRating.js +79 -0
- package/src/components/CardContainerShortImage.js +33 -0
- package/src/components/CardInline.js +36 -0
- package/src/components/Carousel.js +68 -0
- package/src/components/Checkbox/Checkbox.js +62 -0
- package/src/components/Checkbox/Checkbox.tsx +5 -7
- package/src/components/Checkbox/CheckboxGroup.js +21 -0
- package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
- package/src/components/Checkbox/CheckboxRow.js +78 -0
- package/src/components/Checkbox/context.js +14 -0
- package/src/components/Checkbox/index.js +3 -0
- package/src/components/CircleImage.js +8 -0
- package/src/components/CircularProgress.js +81 -0
- package/src/components/Config.js +64 -0
- package/src/components/Container.js +43 -0
- package/src/components/DatePicker/DatePicker.js +377 -0
- package/src/components/DatePicker/DatePickerComponent.js +13 -0
- package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
- package/src/components/DatePicker/DatePickerComponentType.js +1 -0
- package/src/components/DeprecatedCardWrapper.js +18 -0
- package/src/components/DeprecatedCardWrapper.tsx +3 -4
- package/src/components/DeprecatedFAB.js +114 -0
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Divider.js +13 -0
- package/src/components/Elevation.js +20 -0
- package/src/components/FAB.js +46 -0
- package/src/components/FieldSearchBarFull.js +53 -0
- package/src/components/FormRow.js +19 -0
- package/src/components/Header.js +44 -0
- package/src/components/HeaderLarge.js +7 -0
- package/src/components/HeaderMedium.js +7 -0
- package/src/components/HeaderOverline.js +7 -0
- package/src/components/IconButton.js +35 -0
- package/src/components/Image.js +47 -0
- package/src/components/Justification.js +1 -0
- package/src/components/Layout.js +50 -0
- package/src/components/NumberInput.js +49 -0
- package/src/components/Picker/Picker.js +266 -0
- package/src/components/Picker/Picker.tsx +4 -4
- package/src/components/Picker/PickerComponent.android.js +69 -0
- package/src/components/Picker/PickerComponent.ios.js +79 -0
- package/src/components/Picker/PickerComponent.ios.tsx +1 -1
- package/src/components/Picker/PickerComponent.web.js +70 -0
- package/src/components/Picker/PickerTypes.js +1 -0
- package/src/components/Portal/Portal.js +35 -0
- package/src/components/Portal/PortalConsumer.js +27 -0
- package/src/components/Portal/PortalHost.js +107 -0
- package/src/components/Portal/PortalManager.js +32 -0
- package/src/components/Pressable.js +17 -0
- package/src/components/Pressable.tsx +67 -0
- package/src/components/ProgressBar.js +118 -0
- package/src/components/ProgressCircle.js +13 -0
- package/src/components/ProgressIndicator.js +27 -0
- package/src/components/RadioButton/RadioButton.js +17 -0
- package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
- package/src/components/RadioButton/RadioButtonGroup.js +43 -0
- package/src/components/RadioButton/RadioButtonRow.js +76 -0
- package/src/components/RadioButton/context.js +14 -0
- package/src/components/RadioButton/index.js +4 -0
- package/src/components/ResizeMode.js +1 -0
- package/src/components/Row.js +48 -0
- package/src/components/RowBodyIcon.js +8 -0
- package/src/components/RowHeadlineImageCaption.js +12 -0
- package/src/components/RowHeadlineImageIcon.js +14 -0
- package/src/components/SVG.js +13 -0
- package/src/components/ScreenContainer.js +34 -0
- package/src/components/Slider.js +63 -0
- package/src/components/StarRating.js +50 -0
- package/src/components/StepIndicator.js +346 -0
- package/src/components/Stepper.js +41 -0
- package/src/components/Surface.js +32 -0
- package/src/components/Swiper/Swiper.js +29 -0
- package/src/components/Swiper/SwiperItem.js +9 -0
- package/src/components/Swiper/index.js +2 -0
- package/src/components/Switch.js +56 -0
- package/src/components/Text.js +33 -0
- package/src/components/TextField.js +428 -0
- package/src/components/ToggleButton.js +39 -0
- package/src/components/Touchable.js +17 -0
- package/src/components/Touchable.tsx +42 -11
- package/src/components/Typography.js +36 -0
- package/src/components/useAuthState.js +31 -0
- package/src/constants.js +10 -0
- package/src/hooks.js +12 -0
- package/src/index.js +52 -0
- package/src/interfaces/Icon.js +8 -0
- package/src/mappings/Accordion.js +41 -0
- package/src/mappings/AccordionItem.js +16 -0
- package/src/mappings/ActionSheet.js +13 -0
- package/src/mappings/ActionSheetCancel.js +19 -0
- package/src/mappings/ActionSheetItem.js +23 -0
- package/src/mappings/ActivityIndicator.js +58 -0
- package/src/mappings/AudioPlayer.js +57 -0
- package/src/mappings/AvatarEdit.js +38 -0
- package/src/mappings/Banner.js +32 -0
- package/src/mappings/BlurView.js +42 -0
- package/src/mappings/Button.js +98 -0
- package/src/mappings/Button.ts +21 -10
- package/src/mappings/Card.js +52 -0
- package/src/mappings/CardBlock.js +123 -0
- package/src/mappings/CardContainer.js +104 -0
- package/src/mappings/CardContainerRating.js +126 -0
- package/src/mappings/CardContainerShortImage.js +120 -0
- package/src/mappings/CardInline.js +52 -0
- package/src/mappings/Carousel.js +19 -0
- package/src/mappings/Checkbox.js +46 -0
- package/src/mappings/CheckboxGroup.js +26 -0
- package/src/mappings/CheckboxRow.js +61 -0
- package/src/mappings/CircleImage.js +25 -0
- package/src/mappings/Container.js +30 -0
- package/src/mappings/CustomCode.js +8 -0
- package/src/mappings/DatePicker.js +176 -0
- package/src/mappings/Divider.js +27 -0
- package/src/mappings/FAB.js +37 -0
- package/src/mappings/Fetch.js +13 -0
- package/src/mappings/FieldSearchBarFull.js +50 -0
- package/src/mappings/FlashList.js +33 -0
- package/src/mappings/FlatList.js +24 -0
- package/src/mappings/HeaderLarge.js +29 -0
- package/src/mappings/HeaderMedium.js +55 -0
- package/src/mappings/HeaderOverline.js +55 -0
- package/src/mappings/Icon.js +32 -0
- package/src/mappings/IconButton.js +35 -0
- package/src/mappings/Image.js +35 -0
- package/src/mappings/ImageBackground.js +29 -0
- package/src/mappings/KeyboardAvoidingView.js +41 -0
- package/src/mappings/KeyboardAwareScrollView.js +50 -0
- package/src/mappings/Layout.js +200 -0
- package/src/mappings/LinearGradient.js +77 -0
- package/src/mappings/MapCallout.js +21 -0
- package/src/mappings/MapMarker.js +47 -0
- package/src/mappings/MapView.js +139 -0
- package/src/mappings/Modal.js +42 -0
- package/src/mappings/NumberInput.js +254 -0
- package/src/mappings/Picker.js +148 -0
- package/src/mappings/Pressable.js +52 -0
- package/src/mappings/Pressable.ts +63 -0
- package/src/mappings/ProgressBar.js +101 -0
- package/src/mappings/ProgressCircle.js +109 -0
- package/src/mappings/ProgressIndicator.js +181 -0
- package/src/mappings/RadioButton.js +51 -0
- package/src/mappings/RadioButtonGroup.js +17 -0
- package/src/mappings/RadioButtonRow.js +42 -0
- package/src/mappings/RowBodyIcon.js +75 -0
- package/src/mappings/RowHeadlineImageCaption.js +167 -0
- package/src/mappings/RowHeadlineImageIcon.js +99 -0
- package/src/mappings/SVG.js +20 -0
- package/src/mappings/SafeAreaView.js +33 -0
- package/src/mappings/ScrollView.js +31 -0
- package/src/mappings/Slider.js +60 -0
- package/src/mappings/StarRating.js +43 -0
- package/src/mappings/Stepper.js +32 -0
- package/src/mappings/Surface.js +14 -0
- package/src/mappings/Swiper.js +60 -0
- package/src/mappings/SwiperItem.js +8 -0
- package/src/mappings/Switch.js +81 -0
- package/src/mappings/Text.js +251 -0
- package/src/mappings/TextArea.js +274 -0
- package/src/mappings/TextField.js +391 -0
- package/src/mappings/TextInput.js +402 -0
- package/src/mappings/ToggleButton.js +50 -0
- package/src/mappings/Video.js +81 -0
- package/src/mappings/View.js +207 -0
- package/src/mappings/WebView.js +88 -0
- package/src/styles/DarkTheme.js +26 -0
- package/src/styles/DefaultTheme.js +111 -0
- package/src/styles/fonts.js +62 -0
- package/src/styles/overlay.js +60 -0
- package/src/styles/shadow.js +51 -0
- package/src/theming.js +3 -0
- package/src/utilities.js +102 -0
- package/lib/commonjs/components/DeprecatedButton.js +0 -151
- package/lib/commonjs/components/Touchable.web.js +0 -9
- package/lib/commonjs/mappings/Touchable.js +0 -20
- package/lib/module/components/DeprecatedButton.js +0 -141
- package/lib/module/components/Touchable.web.js +0 -2
- package/lib/module/mappings/Touchable.js +0 -13
- package/lib/typescript/src/components/DeprecatedButton.d.ts +0 -54
- package/lib/typescript/src/components/DeprecatedButton.d.ts.map +0 -1
- package/lib/typescript/src/components/Touchable.web.d.ts +0 -3
- package/lib/typescript/src/components/Touchable.web.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +0 -22
- package/lib/typescript/src/mappings/Touchable.d.ts.map +0 -1
- package/src/components/DeprecatedButton.tsx +0 -214
- package/src/components/Touchable.web.tsx +0 -3
- package/src/mappings/Touchable.ts +0 -23
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createIconProp, createTextProp, createImageProp, createStaticBoolProp, } from "@draftbit/types";
|
|
2
|
+
const SEED_DATA_PROPS = {
|
|
3
|
+
title: createTextProp({
|
|
4
|
+
label: "Title",
|
|
5
|
+
description: "Headline text to display",
|
|
6
|
+
}),
|
|
7
|
+
icon: createIconProp({
|
|
8
|
+
defaultValue: null,
|
|
9
|
+
}),
|
|
10
|
+
};
|
|
11
|
+
const IMAGE_PROP = createImageProp();
|
|
12
|
+
const MULTILINE_PROP = createStaticBoolProp({
|
|
13
|
+
defaultValue: true,
|
|
14
|
+
editable: false,
|
|
15
|
+
});
|
|
16
|
+
const SUBTITLE_PROP = createTextProp({
|
|
17
|
+
label: "Subtitle",
|
|
18
|
+
description: "Subtitle text to display",
|
|
19
|
+
defaultValue: "San Diego",
|
|
20
|
+
});
|
|
21
|
+
export const SEED_DATA = [
|
|
22
|
+
{
|
|
23
|
+
name: "Row Single Line Headline Icon",
|
|
24
|
+
tag: "RowHeadlineImageIcon",
|
|
25
|
+
description: "A row with left aligned headline text and a right aligned icon",
|
|
26
|
+
category: COMPONENT_TYPES.row,
|
|
27
|
+
layout: {},
|
|
28
|
+
props: {
|
|
29
|
+
...SEED_DATA_PROPS,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "Row Single Line Headline Icon Image",
|
|
34
|
+
tag: "RowHeadlineImageIcon",
|
|
35
|
+
description: "A row with left aligned image and headline text and a right aligned icon",
|
|
36
|
+
category: COMPONENT_TYPES.row,
|
|
37
|
+
layout: {},
|
|
38
|
+
props: {
|
|
39
|
+
...SEED_DATA_PROPS,
|
|
40
|
+
image: IMAGE_PROP,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "Row Double Line Headline Icon",
|
|
45
|
+
tag: "RowHeadlineImageIcon",
|
|
46
|
+
description: "A row with left aligned headline text and subtitle text and a right aligned icon",
|
|
47
|
+
category: COMPONENT_TYPES.row,
|
|
48
|
+
layout: {},
|
|
49
|
+
props: {
|
|
50
|
+
...SEED_DATA_PROPS,
|
|
51
|
+
subtitle: SUBTITLE_PROP,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "Row Double Line Headline Image Icon",
|
|
56
|
+
tag: "RowHeadlineImageIcon",
|
|
57
|
+
description: "A row with left aligned headline text and subtitle text and a right aligned icon",
|
|
58
|
+
category: COMPONENT_TYPES.row,
|
|
59
|
+
layout: {},
|
|
60
|
+
props: {
|
|
61
|
+
...SEED_DATA_PROPS,
|
|
62
|
+
image: IMAGE_PROP,
|
|
63
|
+
subtitle: SUBTITLE_PROP,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "Row Multiline Headline Icon",
|
|
68
|
+
tag: "RowHeadlineImageIcon",
|
|
69
|
+
description: "A row with left aligned headline text and multiline subtitle text and a right aligned icon",
|
|
70
|
+
category: COMPONENT_TYPES.row,
|
|
71
|
+
layout: {},
|
|
72
|
+
props: {
|
|
73
|
+
...SEED_DATA_PROPS,
|
|
74
|
+
multilineSubtitle: MULTILINE_PROP,
|
|
75
|
+
subtitle: createTextProp({
|
|
76
|
+
label: "Subtitle",
|
|
77
|
+
description: "Subtitle text to display",
|
|
78
|
+
defaultValue: "San Diego is a city on the Pacific coast of California known for its beaches, parks and warm climate",
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Row Multiline Headline Image Icon",
|
|
84
|
+
tag: "RowHeadlineImageIcon",
|
|
85
|
+
description: "A row with left aligned image, headline text, and multiline subtitle text, and a right aligned icon",
|
|
86
|
+
category: COMPONENT_TYPES.row,
|
|
87
|
+
layout: {},
|
|
88
|
+
props: {
|
|
89
|
+
...SEED_DATA_PROPS,
|
|
90
|
+
image: IMAGE_PROP,
|
|
91
|
+
multilineSubtitle: MULTILINE_PROP,
|
|
92
|
+
subtitle: createTextProp({
|
|
93
|
+
label: "Subtitle",
|
|
94
|
+
description: "Subtitle text to display",
|
|
95
|
+
defaultValue: "San Diego is a city on the Pacific coast of California known for its beaches, parks and warm climate",
|
|
96
|
+
}),
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createSVGProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "SVG",
|
|
4
|
+
tag: "SVG",
|
|
5
|
+
description: "An SVG component",
|
|
6
|
+
category: COMPONENT_TYPES.media,
|
|
7
|
+
layout: {
|
|
8
|
+
width: 100,
|
|
9
|
+
height: 100,
|
|
10
|
+
},
|
|
11
|
+
stylesPanelSections: [
|
|
12
|
+
StylesPanelSections.Size,
|
|
13
|
+
StylesPanelSections.Margins,
|
|
14
|
+
StylesPanelSections.Position,
|
|
15
|
+
StylesPanelSections.Effects,
|
|
16
|
+
],
|
|
17
|
+
props: {
|
|
18
|
+
source: createSVGProp(),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "SafeAreaView",
|
|
4
|
+
tag: "SafeAreaView",
|
|
5
|
+
description: "A basic View that handles safe area",
|
|
6
|
+
category: COMPONENT_TYPES.deprecated,
|
|
7
|
+
props: {
|
|
8
|
+
edges: {
|
|
9
|
+
group: GROUPS.basic,
|
|
10
|
+
name: "edges",
|
|
11
|
+
label: "edges",
|
|
12
|
+
description: "Provides edges to be used by safe area view",
|
|
13
|
+
editable: true,
|
|
14
|
+
required: false,
|
|
15
|
+
formType: FORM_TYPES.flatArray,
|
|
16
|
+
propType: PROP_TYPES.STRING,
|
|
17
|
+
options: ["right", "bottom", "left", "top"],
|
|
18
|
+
defaultValue: ["right", "bottom", "left", "top"],
|
|
19
|
+
},
|
|
20
|
+
mode: {
|
|
21
|
+
group: GROUPS.basic,
|
|
22
|
+
name: "mode",
|
|
23
|
+
label: "mode",
|
|
24
|
+
description: "Mode used by safe area view",
|
|
25
|
+
editable: true,
|
|
26
|
+
required: false,
|
|
27
|
+
options: ["padding", "margin"],
|
|
28
|
+
formType: FORM_TYPES.flatArray,
|
|
29
|
+
propType: PROP_TYPES.STRING,
|
|
30
|
+
defaultValue: "padding",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Scroll View",
|
|
4
|
+
tag: "ScrollView",
|
|
5
|
+
description: "A basic ScrollView component",
|
|
6
|
+
category: COMPONENT_TYPES.view,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
layout: {},
|
|
9
|
+
props: {
|
|
10
|
+
horizontal: createStaticBoolProp({
|
|
11
|
+
label: "Horizontal",
|
|
12
|
+
description: "Render your list horizontally",
|
|
13
|
+
defaultValue: false,
|
|
14
|
+
}),
|
|
15
|
+
showsHorizontalScrollIndicator: createStaticBoolProp({
|
|
16
|
+
label: "Show Horizontal Scroll Indicator",
|
|
17
|
+
description: "When true, shows a horizontal scroll indicator. The default value is true.",
|
|
18
|
+
defaultValue: false,
|
|
19
|
+
}),
|
|
20
|
+
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
21
|
+
label: "Show Vertical Scroll Indicator",
|
|
22
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
23
|
+
defaultValue: true,
|
|
24
|
+
}),
|
|
25
|
+
bounces: createStaticBoolProp({
|
|
26
|
+
label: "Bounce",
|
|
27
|
+
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
28
|
+
defaultValue: true,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, GROUPS, createNumberProp, createColorProp, createFieldNameProp, createIconProp, Triggers, BLOCK_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Slider",
|
|
4
|
+
tag: "Slider",
|
|
5
|
+
description: "A component used to set a value in a range",
|
|
6
|
+
category: COMPONENT_TYPES.control,
|
|
7
|
+
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
8
|
+
layout: {
|
|
9
|
+
marginLeft: 12,
|
|
10
|
+
marginRight: 12,
|
|
11
|
+
},
|
|
12
|
+
triggers: [Triggers.OnValueChange],
|
|
13
|
+
props: {
|
|
14
|
+
fieldName: createFieldNameProp({
|
|
15
|
+
defaultValue: "sliderValue",
|
|
16
|
+
handlerPropName: "onValueChange",
|
|
17
|
+
valuePropName: "value",
|
|
18
|
+
}),
|
|
19
|
+
minimumValue: createNumberProp({
|
|
20
|
+
group: GROUPS.basic,
|
|
21
|
+
label: "Min Value",
|
|
22
|
+
min: 0,
|
|
23
|
+
max: 1000,
|
|
24
|
+
}),
|
|
25
|
+
maximumValue: createNumberProp({
|
|
26
|
+
group: GROUPS.basic,
|
|
27
|
+
label: "Max Value",
|
|
28
|
+
min: 1,
|
|
29
|
+
max: 10000,
|
|
30
|
+
}),
|
|
31
|
+
step: createNumberProp({
|
|
32
|
+
group: GROUPS.basic,
|
|
33
|
+
label: "Step",
|
|
34
|
+
min: 0,
|
|
35
|
+
max: 100,
|
|
36
|
+
step: 0.01,
|
|
37
|
+
precision: 2,
|
|
38
|
+
}),
|
|
39
|
+
leftIcon: createIconProp({
|
|
40
|
+
label: "Left Icon",
|
|
41
|
+
defaultValue: null,
|
|
42
|
+
}),
|
|
43
|
+
rightIcon: createIconProp({
|
|
44
|
+
label: "Right Icon",
|
|
45
|
+
defaultValue: null,
|
|
46
|
+
}),
|
|
47
|
+
minimumTrackTintColor: createColorProp({
|
|
48
|
+
label: "Min Track Color",
|
|
49
|
+
defaultValue: null,
|
|
50
|
+
}),
|
|
51
|
+
maximumTrackTintColor: createColorProp({
|
|
52
|
+
label: "Max Track Color",
|
|
53
|
+
defaultValue: null,
|
|
54
|
+
}),
|
|
55
|
+
thumbTintColor: createColorProp({
|
|
56
|
+
label: "Thumb Color",
|
|
57
|
+
defaultValue: null,
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createStaticNumberProp, createFieldNameProp, createStaticBoolProp, Triggers, createColorProp, BLOCK_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Star Rating",
|
|
4
|
+
tag: "StarRating",
|
|
5
|
+
description: "A star rating component",
|
|
6
|
+
category: COMPONENT_TYPES.control,
|
|
7
|
+
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
8
|
+
triggers: [Triggers.OnPress],
|
|
9
|
+
props: {
|
|
10
|
+
starSize: createStaticNumberProp({
|
|
11
|
+
label: "Star size",
|
|
12
|
+
description: "Size of each individual star",
|
|
13
|
+
defaultValue: 16,
|
|
14
|
+
min: 8,
|
|
15
|
+
max: 36,
|
|
16
|
+
step: 1,
|
|
17
|
+
}),
|
|
18
|
+
fieldName: createFieldNameProp({
|
|
19
|
+
defaultValue: "ratingValue",
|
|
20
|
+
handlerPropName: "onPress",
|
|
21
|
+
valuePropName: "rating", // the value prop in this component
|
|
22
|
+
}),
|
|
23
|
+
maxStars: createStaticNumberProp({
|
|
24
|
+
label: "Max stars",
|
|
25
|
+
description: "The max number of stars",
|
|
26
|
+
defaultValue: 5,
|
|
27
|
+
min: 0,
|
|
28
|
+
max: 10,
|
|
29
|
+
step: 1,
|
|
30
|
+
}),
|
|
31
|
+
isEditable: createStaticBoolProp({
|
|
32
|
+
label: "Editable",
|
|
33
|
+
}),
|
|
34
|
+
activeColor: createColorProp({
|
|
35
|
+
label: "Active Color",
|
|
36
|
+
defaultValue: "primary",
|
|
37
|
+
}),
|
|
38
|
+
inactiveColor: createColorProp({
|
|
39
|
+
label: "Inactive Color",
|
|
40
|
+
defaultValue: "divider",
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createIconSizeProp, createColorProp, createFieldNameProp, createStaticNumberProp, Triggers, BLOCK_STYLES_SECTIONS, StylesPanelSections, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [
|
|
3
|
+
{
|
|
4
|
+
name: "Stepper",
|
|
5
|
+
tag: "Stepper",
|
|
6
|
+
description: "A component used to control the quantity of something",
|
|
7
|
+
category: COMPONENT_TYPES.control,
|
|
8
|
+
stylesPanelSections: [
|
|
9
|
+
StylesPanelSections.Typography,
|
|
10
|
+
...BLOCK_STYLES_SECTIONS,
|
|
11
|
+
],
|
|
12
|
+
layout: {},
|
|
13
|
+
triggers: [Triggers.OnChange],
|
|
14
|
+
props: {
|
|
15
|
+
fieldName: createFieldNameProp({
|
|
16
|
+
defaultValue: "stepperValue",
|
|
17
|
+
handlerPropName: "onChange",
|
|
18
|
+
valuePropName: "value",
|
|
19
|
+
}),
|
|
20
|
+
iconSize: createIconSizeProp({ defaultValue: 24 }),
|
|
21
|
+
iconColor: createColorProp({ defaultValue: "strong" }),
|
|
22
|
+
min: createStaticNumberProp({
|
|
23
|
+
label: "Minimum",
|
|
24
|
+
description: "Minimum Number",
|
|
25
|
+
}),
|
|
26
|
+
max: createStaticNumberProp({
|
|
27
|
+
label: "Maximum",
|
|
28
|
+
description: "Maximum Number",
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createElevationType, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Surface",
|
|
4
|
+
tag: "Surface",
|
|
5
|
+
description: "An elevated container",
|
|
6
|
+
category: COMPONENT_TYPES.container,
|
|
7
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
+
layout: {
|
|
9
|
+
minHeight: 40,
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
elevation: createElevationType(0),
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, createBoolProp, createNumberProp, createTextProp, createColorProp, GROUPS, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = {
|
|
3
|
+
name: "Swiper",
|
|
4
|
+
tag: "Swiper",
|
|
5
|
+
description: "Swiper container",
|
|
6
|
+
category: COMPONENT_TYPES.swiper,
|
|
7
|
+
layout: {
|
|
8
|
+
height: 300,
|
|
9
|
+
width: "100%",
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
from: createNumberProp({
|
|
13
|
+
group: GROUPS.basic,
|
|
14
|
+
label: "Initial Slide",
|
|
15
|
+
}),
|
|
16
|
+
loop: createBoolProp({
|
|
17
|
+
group: GROUPS.basic,
|
|
18
|
+
label: "Loop",
|
|
19
|
+
}),
|
|
20
|
+
timeout: createNumberProp({
|
|
21
|
+
group: GROUPS.basic,
|
|
22
|
+
label: "Timeout",
|
|
23
|
+
defaultValue: 0,
|
|
24
|
+
}),
|
|
25
|
+
vertical: createBoolProp({
|
|
26
|
+
group: GROUPS.basic,
|
|
27
|
+
label: "Vertical",
|
|
28
|
+
defaultValue: false,
|
|
29
|
+
}),
|
|
30
|
+
prevTitle: createTextProp({
|
|
31
|
+
group: GROUPS.basic,
|
|
32
|
+
label: "Previous Title",
|
|
33
|
+
defaultValue: "",
|
|
34
|
+
}),
|
|
35
|
+
nextTitle: createTextProp({
|
|
36
|
+
group: GROUPS.basic,
|
|
37
|
+
label: "Next Title",
|
|
38
|
+
defaultValue: "",
|
|
39
|
+
}),
|
|
40
|
+
prevTitleColor: createColorProp({
|
|
41
|
+
label: "Previous Title Color",
|
|
42
|
+
}),
|
|
43
|
+
nextTitleColor: createColorProp({
|
|
44
|
+
label: "Next Title Color",
|
|
45
|
+
}),
|
|
46
|
+
dotColor: createColorProp({
|
|
47
|
+
label: "Dot Color",
|
|
48
|
+
defaultValue: "light",
|
|
49
|
+
}),
|
|
50
|
+
dotActiveColor: createColorProp({
|
|
51
|
+
label: "Dot Active Color",
|
|
52
|
+
defaultValue: "primary",
|
|
53
|
+
}),
|
|
54
|
+
dotsTouchable: createBoolProp({
|
|
55
|
+
group: GROUPS.basic,
|
|
56
|
+
label: "Dots Touchable",
|
|
57
|
+
defaultValue: true,
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, GROUPS, createBoolProp, createColorProp, createFieldNameProp, createTextProp, createRowDirectionProp, Triggers, StylesPanelSections, BLOCK_STYLES_SECTIONS, } from "@draftbit/types";
|
|
2
|
+
const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
|
|
3
|
+
export const SEED_DATA = [
|
|
4
|
+
{
|
|
5
|
+
name: "Switch",
|
|
6
|
+
tag: "Switch",
|
|
7
|
+
category: COMPONENT_TYPES.control,
|
|
8
|
+
stylesPanelSections: BLOCK_STYLES_SECTIONS,
|
|
9
|
+
layout: {},
|
|
10
|
+
triggers: SEED_DATA_TRIGGERS,
|
|
11
|
+
props: {
|
|
12
|
+
disabled: createBoolProp({
|
|
13
|
+
label: "Disabled",
|
|
14
|
+
description: "Boolean to handle disabling the switch",
|
|
15
|
+
}),
|
|
16
|
+
fieldName: createFieldNameProp({
|
|
17
|
+
handlerPropName: "onValueChange",
|
|
18
|
+
valuePropName: "value",
|
|
19
|
+
defaultValue: "switchValue",
|
|
20
|
+
}),
|
|
21
|
+
activeTrackColor: createColorProp({
|
|
22
|
+
label: "Active Track Color",
|
|
23
|
+
}),
|
|
24
|
+
inactiveTrackColor: createColorProp({
|
|
25
|
+
label: "Inactive Track Color",
|
|
26
|
+
}),
|
|
27
|
+
activeThumbColor: createColorProp({
|
|
28
|
+
label: "Active Thumb Color",
|
|
29
|
+
}),
|
|
30
|
+
inactiveThumbColor: createColorProp({
|
|
31
|
+
label: "Inactive Thumb Color",
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "Switch Row",
|
|
37
|
+
tag: "SwitchRow",
|
|
38
|
+
category: COMPONENT_TYPES.control,
|
|
39
|
+
stylesPanelSections: [
|
|
40
|
+
StylesPanelSections.Typography,
|
|
41
|
+
StylesPanelSections.Margins,
|
|
42
|
+
StylesPanelSections.Effects,
|
|
43
|
+
],
|
|
44
|
+
layout: {
|
|
45
|
+
marginLeft: 0,
|
|
46
|
+
marginRight: 0,
|
|
47
|
+
},
|
|
48
|
+
triggers: SEED_DATA_TRIGGERS,
|
|
49
|
+
props: {
|
|
50
|
+
label: createTextProp({
|
|
51
|
+
label: "Label",
|
|
52
|
+
description: "Label to show with the checkbox",
|
|
53
|
+
required: true,
|
|
54
|
+
defaultValue: "First Option",
|
|
55
|
+
}),
|
|
56
|
+
direction: createRowDirectionProp(),
|
|
57
|
+
disabled: createBoolProp({
|
|
58
|
+
label: "Disabled",
|
|
59
|
+
description: "Boolean to handle disabling the switch",
|
|
60
|
+
group: GROUPS.data,
|
|
61
|
+
}),
|
|
62
|
+
fieldName: createFieldNameProp({
|
|
63
|
+
handlerPropName: "onValueChange",
|
|
64
|
+
valuePropName: "value",
|
|
65
|
+
defaultValue: "switchValue",
|
|
66
|
+
}),
|
|
67
|
+
activeTrackColor: createColorProp({
|
|
68
|
+
label: "Active Track Color",
|
|
69
|
+
}),
|
|
70
|
+
inactiveTrackColor: createColorProp({
|
|
71
|
+
label: "Inactive Track Color",
|
|
72
|
+
}),
|
|
73
|
+
activeThumbColor: createColorProp({
|
|
74
|
+
label: "Active Thumb Color",
|
|
75
|
+
}),
|
|
76
|
+
inactiveThumbColor: createColorProp({
|
|
77
|
+
label: "Inactive Thumb Color",
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
];
|