@draftbit/core 46.11.1-c64d65.2 → 46.11.1-ca4afb.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/BottomSheet/BottomSheet.js +89 -0
- package/lib/commonjs/components/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +424 -0
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/index.js +14 -0
- package/lib/commonjs/components/BottomSheet/index.js.map +1 -0
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Checkbox/context.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js.map +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +0 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/commonjs/components/Picker/Picker.js +13 -4
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/Shadow.js +11 -2
- package/lib/commonjs/components/Shadow.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js +18 -57
- package/lib/commonjs/components/TabView/TabView.js +8 -15
- package/lib/commonjs/components/TabView/TabView.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/AccordionItem.js.map +1 -1
- package/lib/commonjs/mappings/DeckSwiper.js +2 -2
- package/lib/commonjs/mappings/DeckSwiper.js.map +1 -1
- package/lib/commonjs/mappings/DeckSwiperCard.js +1 -2
- package/lib/commonjs/mappings/DeckSwiperCard.js.map +1 -1
- package/lib/commonjs/mappings/Layout.js +4 -4
- package/lib/commonjs/mappings/Layout.js.map +1 -1
- package/lib/commonjs/mappings/Picker.js.map +1 -1
- package/lib/commonjs/mappings/Shadow.js +2 -2
- package/lib/commonjs/mappings/Shadow.js.map +1 -1
- package/lib/commonjs/utilities.js +9 -1
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/ActionSheet/ActionSheetCancel.js.map +1 -1
- package/lib/module/components/Banner.js +4 -23
- package/lib/module/components/Banner.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +81 -0
- package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +430 -0
- package/lib/module/components/BottomSheet/BottomSheetComponent.js.map +1 -0
- package/{src/components/BottomSheet/index.ts.tmp → lib/module/components/BottomSheet/index.js} +1 -0
- package/lib/module/components/BottomSheet/index.js.map +1 -0
- package/lib/module/components/Card.js.map +1 -1
- package/lib/module/components/CircleImage.js +1 -15
- package/lib/module/components/CircleImage.js.map +1 -1
- package/lib/module/components/Container.js +4 -16
- package/lib/module/components/Container.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +13 -9
- package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/module/components/DeckSwiper/DeckSwiper.js +1 -1
- package/lib/module/components/DeckSwiper/DeckSwiper.js.map +1 -1
- package/lib/module/components/DeckSwiper/DeckSwiperCard.js +0 -1
- package/lib/module/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/module/components/Markdown.js.map +1 -1
- package/lib/module/components/Picker/Picker.js +13 -4
- package/lib/module/components/Picker/Picker.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +3 -21
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/Portal/PortalConsumer.js +1 -2
- package/lib/module/components/Portal/PortalConsumer.js.map +1 -1
- package/lib/module/components/Portal/PortalHost.js +14 -44
- package/lib/module/components/Portal/PortalHost.js.map +1 -1
- package/lib/module/components/ProgressCircle.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +5 -23
- package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/module/components/RadioButton/index.js.map +1 -1
- package/lib/module/components/Row.js.map +1 -1
- package/lib/module/components/RowBodyIcon.js.map +1 -1
- package/lib/module/components/Shadow.js +11 -2
- package/lib/module/components/Shadow.js.map +1 -1
- package/lib/module/components/Swiper/SwiperItem.js.map +1 -1
- package/lib/module/components/TabView/TabView.js +1 -1
- package/lib/module/components/TabView/TabView.js.map +1 -1
- package/lib/module/components/Touchable.web.js.map +1 -1
- package/lib/module/components/YoutubePlayer/YoutubePlayerProps.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/AccordionItem.js.map +1 -1
- package/lib/module/mappings/AudioPlayer.js.map +1 -1
- package/lib/module/mappings/CardInline.js.map +1 -1
- package/lib/module/mappings/DeckSwiper.js +3 -3
- package/lib/module/mappings/DeckSwiper.js.map +1 -1
- package/lib/module/mappings/DeckSwiperCard.js +2 -3
- package/lib/module/mappings/DeckSwiperCard.js.map +1 -1
- package/lib/module/mappings/Divider.js.map +1 -1
- package/lib/module/mappings/FlashList.js.map +1 -1
- package/lib/module/mappings/Layout.js +4 -4
- package/lib/module/mappings/Layout.js.map +1 -1
- package/lib/module/mappings/ProgressIndicator.js.map +1 -1
- package/lib/module/mappings/RadioButtonGroup.js.map +1 -1
- package/lib/module/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/module/mappings/Shadow.js +3 -3
- package/lib/module/mappings/Shadow.js.map +1 -1
- package/lib/module/styles/shadow.js.map +1 -1
- package/lib/module/utilities.js +6 -0
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +20 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +170 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts +2 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
- package/lib/typescript/src/components/Shadow.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DeckSwiper.d.ts +1 -1
- package/lib/typescript/src/mappings/DeckSwiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts +0 -1
- package/lib/typescript/src/mappings/DeckSwiperCard.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Shadow.d.ts.map +1 -1
- package/lib/typescript/src/utilities.d.ts +2 -0
- package/lib/typescript/src/utilities.d.ts.map +1 -1
- package/package.json +5 -3
- package/src/components/BottomSheet/BottomSheet.js +56 -0
- package/src/components/BottomSheet/BottomSheetComponent.js +437 -0
- package/src/components/DeckSwiper/DeckSwiper.js +1 -1
- package/src/components/DeckSwiper/DeckSwiper.tsx +1 -1
- package/src/components/DeckSwiper/DeckSwiperCard.js +0 -1
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +0 -1
- package/src/components/Picker/Picker.js +16 -4
- package/src/components/Picker/Picker.tsx +25 -5
- package/src/components/Shadow.js +11 -2
- package/src/components/Shadow.tsx +15 -3
- package/src/components/TabView/TabView.js +1 -1
- package/src/components/TabView/TabView.tsx +1 -1
- package/src/index.js +1 -0
- package/src/index.tsx +2 -0
- package/src/mappings/DeckSwiper.js +7 -3
- package/src/mappings/DeckSwiper.ts +7 -3
- package/src/mappings/DeckSwiperCard.js +10 -3
- package/src/mappings/DeckSwiperCard.ts +10 -6
- package/src/mappings/Layout.js +4 -4
- package/src/mappings/Layout.ts +4 -4
- package/src/mappings/Shadow.js +9 -3
- package/src/mappings/Shadow.ts +9 -3
- package/src/utilities.js +9 -0
- package/src/utilities.ts +19 -0
- package/lib/commonjs/mappings/NativeBase/Layout.js +0 -97
- package/lib/commonjs/mappings/NativeBase/Layout.js.map +0 -1
- package/lib/module/components/BottomSheet/BottomSheet.tsx.tmp +0 -120
- package/lib/module/components/BottomSheet/BottomSheetComponent.tsx.tmp +0 -895
- package/lib/module/mappings/NativeBase/Layout.js +0 -90
- package/lib/module/mappings/NativeBase/Layout.js.map +0 -1
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +0 -107
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +0 -1
- package/src/components/BottomSheet/BottomSheet.tsx.tmp +0 -120
- package/src/components/BottomSheet/BottomSheetComponent.tsx.tmp +0 -895
- package/src/mappings/NativeBase/Layout.js +0 -111
- package/src/mappings/NativeBase/Layout.ts +0 -130
- /package/{lib/commonjs/components/BottomSheet/BottomSheet.tsx.tmp → src/components/BottomSheet/BottomSheet.tsx} +0 -0
- /package/{lib/commonjs/components/BottomSheet/BottomSheetComponent.tsx.tmp → src/components/BottomSheet/BottomSheetComponent.tsx} +0 -0
- /package/{lib/commonjs/components/BottomSheet/index.ts.tmp → src/components/BottomSheet/index.js} +0 -0
- /package/{lib/module/components/BottomSheet/index.ts.tmp → src/components/BottomSheet/index.ts} +0 -0
package/src/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export { default as Shadow } from "./components/Shadow";
|
|
|
35
35
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
36
36
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
37
37
|
export { default as Markdown } from "./components/Markdown";
|
|
38
|
+
export { BottomSheet } from "./components/BottomSheet";
|
|
38
39
|
export { YoutubePlayer } from "./components/YoutubePlayer";
|
|
39
40
|
export { Table, TableRow, TableCell } from "./components/Table";
|
|
40
41
|
/* Deprecated: Fix or Delete! */
|
package/src/index.tsx
CHANGED
|
@@ -58,6 +58,8 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
|
58
58
|
export { TabView, TabViewItem } from "./components/TabView";
|
|
59
59
|
export { default as Markdown } from "./components/Markdown";
|
|
60
60
|
|
|
61
|
+
export { BottomSheet } from "./components/BottomSheet";
|
|
62
|
+
|
|
61
63
|
export { YoutubePlayer } from "./components/YoutubePlayer";
|
|
62
64
|
|
|
63
65
|
export { Table, TableRow, TableCell } from "./components/Table";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, Triggers, createActionProp, createStaticNumberProp, createStaticBoolProp,
|
|
1
|
+
import { COMPONENT_TYPES, Triggers, createActionProp, createStaticNumberProp, createStaticBoolProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Deck Swiper",
|
|
4
4
|
tag: "DeckSwiper",
|
|
5
5
|
description: "Deck swiper container",
|
|
6
6
|
category: COMPONENT_TYPES.swiper,
|
|
7
|
-
stylesPanelSections:
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Size,
|
|
9
|
+
StylesPanelSections.Margins,
|
|
10
|
+
StylesPanelSections.Effects,
|
|
11
|
+
],
|
|
8
12
|
layout: {
|
|
9
|
-
|
|
13
|
+
position: "absolute",
|
|
10
14
|
},
|
|
11
15
|
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
12
16
|
props: {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createActionProp,
|
|
5
5
|
createStaticNumberProp,
|
|
6
6
|
createStaticBoolProp,
|
|
7
|
-
|
|
7
|
+
StylesPanelSections,
|
|
8
8
|
} from "@draftbit/types";
|
|
9
9
|
|
|
10
10
|
export const SEED_DATA = {
|
|
@@ -12,9 +12,13 @@ export const SEED_DATA = {
|
|
|
12
12
|
tag: "DeckSwiper",
|
|
13
13
|
description: "Deck swiper container",
|
|
14
14
|
category: COMPONENT_TYPES.swiper,
|
|
15
|
-
stylesPanelSections:
|
|
15
|
+
stylesPanelSections: [
|
|
16
|
+
StylesPanelSections.Size,
|
|
17
|
+
StylesPanelSections.Margins,
|
|
18
|
+
StylesPanelSections.Effects,
|
|
19
|
+
],
|
|
16
20
|
layout: {
|
|
17
|
-
|
|
21
|
+
position: "absolute",
|
|
18
22
|
},
|
|
19
23
|
triggers: [Triggers.OnIndexChanged, Triggers.OnEndReached],
|
|
20
24
|
props: {
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, StylesPanelSections } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Deck Swiper Card",
|
|
4
4
|
tag: "DeckSwiperCard",
|
|
5
5
|
description: "Single Deck Swiper Card item to be used in DeckSwiper",
|
|
6
6
|
category: COMPONENT_TYPES.swiper,
|
|
7
|
-
stylesPanelSections:
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.LayoutFlexItems,
|
|
9
|
+
StylesPanelSections.LayoutContent,
|
|
10
|
+
StylesPanelSections.Background,
|
|
11
|
+
StylesPanelSections.Size,
|
|
12
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
13
|
+
StylesPanelSections.Borders,
|
|
14
|
+
StylesPanelSections.Effects,
|
|
15
|
+
],
|
|
8
16
|
layout: {
|
|
9
|
-
flex: 1,
|
|
10
17
|
alignItems: "center",
|
|
11
18
|
justifyContent: "center",
|
|
12
19
|
padding: 20,
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
COMPONENT_TYPES,
|
|
3
|
-
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
|
-
} from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, StylesPanelSections } from "@draftbit/types";
|
|
5
2
|
|
|
6
3
|
export const SEED_DATA = {
|
|
7
4
|
name: "Deck Swiper Card",
|
|
8
5
|
tag: "DeckSwiperCard",
|
|
9
6
|
description: "Single Deck Swiper Card item to be used in DeckSwiper",
|
|
10
7
|
category: COMPONENT_TYPES.swiper,
|
|
11
|
-
stylesPanelSections:
|
|
8
|
+
stylesPanelSections: [
|
|
9
|
+
StylesPanelSections.LayoutFlexItems,
|
|
10
|
+
StylesPanelSections.LayoutContent,
|
|
11
|
+
StylesPanelSections.Background,
|
|
12
|
+
StylesPanelSections.Size,
|
|
13
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
14
|
+
StylesPanelSections.Borders,
|
|
15
|
+
StylesPanelSections.Effects,
|
|
16
|
+
],
|
|
12
17
|
layout: {
|
|
13
|
-
flex: 1,
|
|
14
18
|
alignItems: "center",
|
|
15
19
|
justifyContent: "center",
|
|
16
20
|
padding: 20,
|
package/src/mappings/Layout.js
CHANGED
|
@@ -31,7 +31,7 @@ export const SEED_DATA = [
|
|
|
31
31
|
{
|
|
32
32
|
name: "Spacer",
|
|
33
33
|
tag: "Spacer",
|
|
34
|
-
category: COMPONENT_TYPES.
|
|
34
|
+
category: COMPONENT_TYPES.layout,
|
|
35
35
|
props: {
|
|
36
36
|
top: {
|
|
37
37
|
label: "Top",
|
|
@@ -106,7 +106,7 @@ export const SEED_DATA = [
|
|
|
106
106
|
{
|
|
107
107
|
name: "Center",
|
|
108
108
|
tag: "Center",
|
|
109
|
-
category: COMPONENT_TYPES.
|
|
109
|
+
category: COMPONENT_TYPES.layout,
|
|
110
110
|
stylesPanelSections: [StylesPanelSections.NoStyles],
|
|
111
111
|
props: {
|
|
112
112
|
width: {
|
|
@@ -144,7 +144,7 @@ export const SEED_DATA = [
|
|
|
144
144
|
{
|
|
145
145
|
name: "Circle",
|
|
146
146
|
tag: "Circle",
|
|
147
|
-
category: COMPONENT_TYPES.
|
|
147
|
+
category: COMPONENT_TYPES.layout,
|
|
148
148
|
stylesPanelSections: [StylesPanelSections.NoStyles],
|
|
149
149
|
props: {
|
|
150
150
|
size: {
|
|
@@ -172,7 +172,7 @@ export const SEED_DATA = [
|
|
|
172
172
|
{
|
|
173
173
|
name: "Square",
|
|
174
174
|
tag: "Square",
|
|
175
|
-
category: COMPONENT_TYPES.
|
|
175
|
+
category: COMPONENT_TYPES.layout,
|
|
176
176
|
stylesPanelSections: [StylesPanelSections.NoStyles],
|
|
177
177
|
props: {
|
|
178
178
|
size: {
|
package/src/mappings/Layout.ts
CHANGED
|
@@ -38,7 +38,7 @@ export const SEED_DATA = [
|
|
|
38
38
|
{
|
|
39
39
|
name: "Spacer",
|
|
40
40
|
tag: "Spacer",
|
|
41
|
-
category: COMPONENT_TYPES.
|
|
41
|
+
category: COMPONENT_TYPES.layout,
|
|
42
42
|
props: {
|
|
43
43
|
top: {
|
|
44
44
|
label: "Top",
|
|
@@ -113,7 +113,7 @@ export const SEED_DATA = [
|
|
|
113
113
|
{
|
|
114
114
|
name: "Center",
|
|
115
115
|
tag: "Center",
|
|
116
|
-
category: COMPONENT_TYPES.
|
|
116
|
+
category: COMPONENT_TYPES.layout,
|
|
117
117
|
stylesPanelSections: [StylesPanelSections.NoStyles],
|
|
118
118
|
props: {
|
|
119
119
|
width: {
|
|
@@ -151,7 +151,7 @@ export const SEED_DATA = [
|
|
|
151
151
|
{
|
|
152
152
|
name: "Circle",
|
|
153
153
|
tag: "Circle",
|
|
154
|
-
category: COMPONENT_TYPES.
|
|
154
|
+
category: COMPONENT_TYPES.layout,
|
|
155
155
|
stylesPanelSections: [StylesPanelSections.NoStyles],
|
|
156
156
|
props: {
|
|
157
157
|
size: {
|
|
@@ -179,7 +179,7 @@ export const SEED_DATA = [
|
|
|
179
179
|
{
|
|
180
180
|
name: "Square",
|
|
181
181
|
tag: "Square",
|
|
182
|
-
category: COMPONENT_TYPES.
|
|
182
|
+
category: COMPONENT_TYPES.layout,
|
|
183
183
|
stylesPanelSections: [StylesPanelSections.NoStyles],
|
|
184
184
|
props: {
|
|
185
185
|
size: {
|
package/src/mappings/Shadow.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, createColorProp, createStaticNumberProp, createStaticBoolProp, createDisabledProp, GROUPS, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Shadow",
|
|
4
4
|
tag: "Shadow",
|
|
5
5
|
description: "A cross-platform, universal shadow.",
|
|
6
6
|
category: COMPONENT_TYPES.view,
|
|
7
|
-
stylesPanelSections:
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.Size,
|
|
9
|
+
StylesPanelSections.Margins,
|
|
10
|
+
StylesPanelSections.Position,
|
|
11
|
+
StylesPanelSections.Borders,
|
|
12
|
+
StylesPanelSections.Effects,
|
|
13
|
+
],
|
|
8
14
|
props: {
|
|
9
15
|
disabled: createDisabledProp({
|
|
10
16
|
description: "Disables the shadow.",
|
|
@@ -26,7 +32,7 @@ export const SEED_DATA = {
|
|
|
26
32
|
paintInside: createStaticBoolProp({
|
|
27
33
|
label: "Paint Inside",
|
|
28
34
|
description: "Apply the shadow below/inside the content.",
|
|
29
|
-
defaultValue:
|
|
35
|
+
defaultValue: true,
|
|
30
36
|
}),
|
|
31
37
|
stretch: createStaticBoolProp({
|
|
32
38
|
label: "Stretch",
|
package/src/mappings/Shadow.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
|
-
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
4
3
|
createColorProp,
|
|
5
4
|
createStaticNumberProp,
|
|
6
5
|
createStaticBoolProp,
|
|
7
6
|
createDisabledProp,
|
|
8
7
|
GROUPS,
|
|
8
|
+
StylesPanelSections,
|
|
9
9
|
} from "@draftbit/types";
|
|
10
10
|
|
|
11
11
|
export const SEED_DATA = {
|
|
@@ -13,7 +13,13 @@ export const SEED_DATA = {
|
|
|
13
13
|
tag: "Shadow",
|
|
14
14
|
description: "A cross-platform, universal shadow.",
|
|
15
15
|
category: COMPONENT_TYPES.view,
|
|
16
|
-
stylesPanelSections:
|
|
16
|
+
stylesPanelSections: [
|
|
17
|
+
StylesPanelSections.Size,
|
|
18
|
+
StylesPanelSections.Margins,
|
|
19
|
+
StylesPanelSections.Position,
|
|
20
|
+
StylesPanelSections.Borders,
|
|
21
|
+
StylesPanelSections.Effects,
|
|
22
|
+
],
|
|
17
23
|
props: {
|
|
18
24
|
disabled: createDisabledProp({
|
|
19
25
|
description: "Disables the shadow.",
|
|
@@ -35,7 +41,7 @@ export const SEED_DATA = {
|
|
|
35
41
|
paintInside: createStaticBoolProp({
|
|
36
42
|
label: "Paint Inside",
|
|
37
43
|
description: "Apply the shadow below/inside the content.",
|
|
38
|
-
defaultValue:
|
|
44
|
+
defaultValue: true,
|
|
39
45
|
}),
|
|
40
46
|
stretch: createStaticBoolProp({
|
|
41
47
|
label: "Stretch",
|
package/src/utilities.js
CHANGED
|
@@ -65,6 +65,15 @@ export function extractBorderAndMarginStyles(style, additionalBorderStyles, addi
|
|
|
65
65
|
]), identity);
|
|
66
66
|
return { borderStyles, marginStyles };
|
|
67
67
|
}
|
|
68
|
+
export const sizeStyleNames = ["width", "height"];
|
|
69
|
+
export function extractSizeStyles(style, additionalSizeStyles) {
|
|
70
|
+
const flatStyle = StyleSheet.flatten(style || {});
|
|
71
|
+
const sizeStyles = pickBy(pick(flatStyle, [
|
|
72
|
+
...sizeStyleNames,
|
|
73
|
+
...(additionalSizeStyles ? additionalSizeStyles : []),
|
|
74
|
+
]), identity);
|
|
75
|
+
return sizeStyles;
|
|
76
|
+
}
|
|
68
77
|
/**
|
|
69
78
|
* Merges a style object on top of another style object. In React Native,
|
|
70
79
|
* keys with undefined values in a style object will still override styles
|
package/src/utilities.ts
CHANGED
|
@@ -98,6 +98,25 @@ export function extractBorderAndMarginStyles(
|
|
|
98
98
|
return { borderStyles, marginStyles };
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
export const sizeStyleNames = ["width", "height"];
|
|
102
|
+
|
|
103
|
+
export function extractSizeStyles(
|
|
104
|
+
style: StyleProp<any>,
|
|
105
|
+
additionalSizeStyles?: string[]
|
|
106
|
+
) {
|
|
107
|
+
const flatStyle = StyleSheet.flatten(style || {});
|
|
108
|
+
|
|
109
|
+
const sizeStyles = pickBy(
|
|
110
|
+
pick(flatStyle, [
|
|
111
|
+
...sizeStyleNames,
|
|
112
|
+
...(additionalSizeStyles ? additionalSizeStyles : []),
|
|
113
|
+
]),
|
|
114
|
+
identity
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return sizeStyles;
|
|
118
|
+
}
|
|
119
|
+
|
|
101
120
|
/**
|
|
102
121
|
* Merges a style object on top of another style object. In React Native,
|
|
103
122
|
* keys with undefined values in a style object will still override styles
|
|
@@ -1,97 +0,0 @@
|
|
|
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.testing /*.layout*/,
|
|
10
|
-
packageName: "native-base",
|
|
11
|
-
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS
|
|
12
|
-
};
|
|
13
|
-
const CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX = _types.CONTAINER_COMPONENT_STYLES_SECTIONS.filter(item => item !== _types.StylesPanelSections.LayoutFlexItems && item !== _types.StylesPanelSections.LayoutContent);
|
|
14
|
-
const SEED_DATA = [{
|
|
15
|
-
name: "Aspect Ratio",
|
|
16
|
-
tag: "AspectRatio",
|
|
17
|
-
description: "Controls the size of the undefined dimension of a node or child component using an aspect ratio",
|
|
18
|
-
...SHARED_SEED_DATA,
|
|
19
|
-
props: {
|
|
20
|
-
ratio: (0, _types.createStaticNumberProp)({
|
|
21
|
-
label: "Ratio",
|
|
22
|
-
description: "The aspect ratio of the container in decimal format (ex: 3/4 -> 1.33)",
|
|
23
|
-
defaultValue: 1.33
|
|
24
|
-
})
|
|
25
|
-
},
|
|
26
|
-
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Effects]
|
|
27
|
-
}, {
|
|
28
|
-
name: "Box",
|
|
29
|
-
tag: "Box",
|
|
30
|
-
description: "This is a generic component for low level layout needs. It is similar to a div in HTML",
|
|
31
|
-
...SHARED_SEED_DATA
|
|
32
|
-
}, {
|
|
33
|
-
name: "Center",
|
|
34
|
-
tag: "Center",
|
|
35
|
-
description: "Center aligns its contents to the center within itself",
|
|
36
|
-
...SHARED_SEED_DATA,
|
|
37
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
38
|
-
}, {
|
|
39
|
-
name: "Circle",
|
|
40
|
-
tag: "Circle",
|
|
41
|
-
description: "Center aligns its contents to the center within itself with a round border radius",
|
|
42
|
-
...SHARED_SEED_DATA,
|
|
43
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX
|
|
44
|
-
}, {
|
|
45
|
-
name: "Column",
|
|
46
|
-
tag: "Column",
|
|
47
|
-
description: "Column aligns items vertically",
|
|
48
|
-
layout: {
|
|
49
|
-
flexDirection: "column"
|
|
50
|
-
},
|
|
51
|
-
...SHARED_SEED_DATA
|
|
52
|
-
}, {
|
|
53
|
-
name: "Row",
|
|
54
|
-
tag: "Row",
|
|
55
|
-
description: "Column aligns items horizontally",
|
|
56
|
-
layout: {
|
|
57
|
-
flexDirection: "row"
|
|
58
|
-
},
|
|
59
|
-
...SHARED_SEED_DATA
|
|
60
|
-
}, {
|
|
61
|
-
name: "Spacer",
|
|
62
|
-
tag: "Spacer",
|
|
63
|
-
description: "An adjustable, empty space that can be used to tune the spacing between child elements within Flex",
|
|
64
|
-
layout: {
|
|
65
|
-
flex: 1
|
|
66
|
-
},
|
|
67
|
-
...SHARED_SEED_DATA,
|
|
68
|
-
stylesPanelSections: [_types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.Background, _types.StylesPanelSections.Margins]
|
|
69
|
-
}, {
|
|
70
|
-
name: "Stack",
|
|
71
|
-
tag: "Stack",
|
|
72
|
-
description: "Stack aligns items vertically or horizontally based on the direction prop",
|
|
73
|
-
...SHARED_SEED_DATA,
|
|
74
|
-
props: {
|
|
75
|
-
isDisabled: (0, _types.createBoolProp)({
|
|
76
|
-
label: "Disabled",
|
|
77
|
-
description: "If true, the Stack will be disabled"
|
|
78
|
-
}),
|
|
79
|
-
isInvalid: (0, _types.createBoolProp)({
|
|
80
|
-
label: "Invalid",
|
|
81
|
-
description: "If true, the Stack will be invalid"
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
name: "ZStack",
|
|
86
|
-
tag: "ZStack",
|
|
87
|
-
description: "ZStack aligns items to the z-axis",
|
|
88
|
-
...SHARED_SEED_DATA,
|
|
89
|
-
props: {
|
|
90
|
-
reversed: (0, _types.createBoolProp)({
|
|
91
|
-
label: "Reversed",
|
|
92
|
-
description: "Determines whether to reverse the direction of items"
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
}];
|
|
96
|
-
exports.SEED_DATA = SEED_DATA;
|
|
97
|
-
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SHARED_SEED_DATA","category","COMPONENT_TYPES","testing","packageName","stylesPanelSections","CONTAINER_COMPONENT_STYLES_SECTIONS","CONTAINER_COMPONENT_STYLES_WITHOUT_FLEX","filter","item","StylesPanelSections","LayoutFlexItems","LayoutContent","SEED_DATA","name","tag","description","props","ratio","createStaticNumberProp","label","defaultValue","Background","Size","Margins","Position","Borders","Effects","layout","flexDirection","flex","LayoutSelectedItem","isDisabled","createBoolProp","isInvalid","reversed"],"sourceRoot":"../../../../src","sources":["mappings/NativeBase/Layout.ts"],"mappings":"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"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
View,
|
|
5
|
-
StyleProp,
|
|
6
|
-
ViewStyle,
|
|
7
|
-
ScrollViewProps,
|
|
8
|
-
} from "react-native";
|
|
9
|
-
|
|
10
|
-
import BottomSheetComponent from "./BottomSheetComponent";
|
|
11
|
-
import type { Theme } from "../../styles/DefaultTheme";
|
|
12
|
-
import { withTheme } from "../../theming";
|
|
13
|
-
|
|
14
|
-
export interface BottomSheetProps extends ScrollViewProps {
|
|
15
|
-
snapPoints?: (string | number)[];
|
|
16
|
-
initialSnapIndex?: number;
|
|
17
|
-
showHandle?: boolean;
|
|
18
|
-
handleColor?: string;
|
|
19
|
-
topBorderRadius?: number;
|
|
20
|
-
borderWidth?: number;
|
|
21
|
-
borderColor?: string;
|
|
22
|
-
onSettle?: (index: number) => void;
|
|
23
|
-
style?: StyleProp<ViewStyle>;
|
|
24
|
-
theme: Theme;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const BottomSheet: React.FC<React.PropsWithChildren<BottomSheetProps>> = ({
|
|
28
|
-
theme,
|
|
29
|
-
snapPoints = ["10%", "50%", "80%"],
|
|
30
|
-
initialSnapIndex = 0,
|
|
31
|
-
showHandle = true,
|
|
32
|
-
handleColor = theme.colors.divider,
|
|
33
|
-
topBorderRadius = 20,
|
|
34
|
-
borderWidth = 1,
|
|
35
|
-
borderColor = theme.colors.divider,
|
|
36
|
-
onSettle,
|
|
37
|
-
style,
|
|
38
|
-
children,
|
|
39
|
-
...rest
|
|
40
|
-
}) => {
|
|
41
|
-
const backgroundColor =
|
|
42
|
-
(style as ViewStyle)?.backgroundColor || theme.colors.background;
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<View style={styles.parentContainer} pointerEvents="box-none">
|
|
46
|
-
<BottomSheetComponent
|
|
47
|
-
componentType="ScrollView"
|
|
48
|
-
snapPoints={snapPoints}
|
|
49
|
-
initialSnapIndex={initialSnapIndex}
|
|
50
|
-
renderHandle={() => (
|
|
51
|
-
<>
|
|
52
|
-
{showHandle && (
|
|
53
|
-
<View
|
|
54
|
-
style={[
|
|
55
|
-
styles.handleContainer,
|
|
56
|
-
{
|
|
57
|
-
backgroundColor,
|
|
58
|
-
borderTopLeftRadius: topBorderRadius,
|
|
59
|
-
borderTopRightRadius: topBorderRadius,
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
>
|
|
63
|
-
<View
|
|
64
|
-
style={[styles.handle, { backgroundColor: handleColor }]}
|
|
65
|
-
/>
|
|
66
|
-
</View>
|
|
67
|
-
)}
|
|
68
|
-
</>
|
|
69
|
-
)}
|
|
70
|
-
contentContainerStyle={[styles.contentContainerStyle, style]}
|
|
71
|
-
containerStyle={StyleSheet.flatten([
|
|
72
|
-
styles.containerStyle,
|
|
73
|
-
{
|
|
74
|
-
backgroundColor,
|
|
75
|
-
borderTopLeftRadius: topBorderRadius,
|
|
76
|
-
borderTopRightRadius: topBorderRadius,
|
|
77
|
-
borderWidth,
|
|
78
|
-
borderColor,
|
|
79
|
-
},
|
|
80
|
-
])}
|
|
81
|
-
onSettle={onSettle}
|
|
82
|
-
{...rest}
|
|
83
|
-
>
|
|
84
|
-
{children}
|
|
85
|
-
</BottomSheetComponent>
|
|
86
|
-
</View>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const styles = StyleSheet.create({
|
|
91
|
-
//Render on top of everything
|
|
92
|
-
parentContainer: {
|
|
93
|
-
position: "absolute",
|
|
94
|
-
left: 0,
|
|
95
|
-
right: 0,
|
|
96
|
-
top: 0,
|
|
97
|
-
bottom: 0,
|
|
98
|
-
zIndex: 10,
|
|
99
|
-
overflow: "hidden",
|
|
100
|
-
},
|
|
101
|
-
contentContainerStyle: {
|
|
102
|
-
paddingHorizontal: 16,
|
|
103
|
-
paddingVertical: 10,
|
|
104
|
-
},
|
|
105
|
-
containerStyle: {
|
|
106
|
-
flex: 1,
|
|
107
|
-
overflow: "hidden",
|
|
108
|
-
},
|
|
109
|
-
handleContainer: {
|
|
110
|
-
alignItems: "center",
|
|
111
|
-
paddingVertical: 20,
|
|
112
|
-
},
|
|
113
|
-
handle: {
|
|
114
|
-
width: 40,
|
|
115
|
-
height: 2,
|
|
116
|
-
borderRadius: 4,
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
export default withTheme(BottomSheet);
|