@draftbit/core 46.8.1-fe4ccb.2 → 46.8.1
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/DeckSwiper/DeckSwiper.js +38 -4
- package/lib/commonjs/components/Picker/Picker.js +8 -9
- package/lib/commonjs/components/ScreenContainer.js +2 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/mappings/Accordion.js +1 -0
- package/lib/commonjs/mappings/AccordionItem.js +1 -0
- package/lib/commonjs/mappings/ActionSheet.js +1 -0
- package/lib/commonjs/mappings/ActionSheetCancel.js +1 -0
- package/lib/commonjs/mappings/ActionSheetItem.js +1 -0
- package/lib/commonjs/mappings/LinearGradient.js +1 -0
- package/lib/commonjs/mappings/MapCallout.js +1 -0
- package/lib/commonjs/mappings/MapMarker.js +1 -0
- package/lib/commonjs/mappings/MapView.js +1 -0
- package/lib/commonjs/mappings/Swiper.js +1 -0
- package/lib/commonjs/mappings/SwiperItem.js +2 -1
- package/lib/commonjs/mappings/TextArea.js +1 -0
- package/lib/commonjs/mappings/TextField.js +1 -0
- package/lib/module/components/DeckSwiper/DeckSwiper.js +38 -4
- package/lib/module/components/Picker/Picker.js +8 -9
- package/lib/module/components/ScreenContainer.js +2 -1
- package/lib/module/index.js +0 -1
- package/lib/module/mappings/Accordion.js +2 -1
- package/lib/module/mappings/AccordionItem.js +2 -1
- package/lib/module/mappings/ActionSheet.js +2 -1
- package/lib/module/mappings/ActionSheetCancel.js +2 -1
- package/lib/module/mappings/ActionSheetItem.js +2 -1
- package/lib/module/mappings/LinearGradient.js +2 -1
- package/lib/module/mappings/MapCallout.js +2 -1
- package/lib/module/mappings/MapMarker.js +2 -1
- package/lib/module/mappings/MapView.js +2 -1
- package/lib/module/mappings/Swiper.js +2 -1
- package/lib/module/mappings/SwiperItem.js +3 -2
- package/lib/module/mappings/TextArea.js +2 -1
- package/lib/module/mappings/TextField.js +1 -0
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +8 -2
- package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts.map +1 -1
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +2 -3
- 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/ScreenContainer.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Accordion.d.ts +1 -0
- package/lib/typescript/src/mappings/Accordion.d.ts.map +1 -1
- package/lib/typescript/src/mappings/AccordionItem.d.ts +1 -0
- package/lib/typescript/src/mappings/AccordionItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheet.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/LinearGradient.d.ts +1 -0
- package/lib/typescript/src/mappings/LinearGradient.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapCallout.d.ts +1 -0
- package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapMarker.d.ts +1 -0
- package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Swiper.d.ts +1 -0
- package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/SwiperItem.d.ts +1 -0
- package/lib/typescript/src/mappings/SwiperItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TextArea.d.ts +1 -0
- package/lib/typescript/src/mappings/TextArea.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TextField.d.ts +1 -1
- package/lib/typescript/src/mappings/TextField.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/components/DeckSwiper/DeckSwiper.js +33 -3
- package/src/components/DeckSwiper/DeckSwiper.tsx +51 -9
- package/src/components/DeckSwiper/DeckSwiperCard.js +1 -1
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +3 -6
- package/src/components/Picker/Picker.js +7 -8
- package/src/components/Picker/Picker.tsx +7 -9
- package/src/components/ScreenContainer.js +2 -1
- package/src/components/ScreenContainer.tsx +2 -1
- package/src/index.js +0 -1
- package/src/index.tsx +0 -2
- package/src/mappings/Accordion.js +10 -1
- package/src/mappings/Accordion.ts +10 -0
- package/src/mappings/AccordionItem.js +2 -1
- package/src/mappings/AccordionItem.ts +2 -0
- package/src/mappings/ActionSheet.js +2 -1
- package/src/mappings/ActionSheet.ts +7 -1
- package/src/mappings/ActionSheetCancel.js +2 -1
- package/src/mappings/ActionSheetCancel.ts +2 -0
- package/src/mappings/ActionSheetItem.js +2 -1
- package/src/mappings/ActionSheetItem.ts +2 -0
- package/src/mappings/LinearGradient.js +6 -1
- package/src/mappings/LinearGradient.ts +6 -0
- package/src/mappings/MapCallout.js +2 -1
- package/src/mappings/MapCallout.ts +2 -0
- package/src/mappings/MapMarker.js +2 -1
- package/src/mappings/MapMarker.ts +2 -0
- package/src/mappings/MapView.js +2 -1
- package/src/mappings/MapView.ts +2 -0
- package/src/mappings/Swiper.js +10 -1
- package/src/mappings/Swiper.ts +10 -0
- package/src/mappings/SwiperItem.js +2 -1
- package/src/mappings/SwiperItem.ts +5 -1
- package/src/mappings/TextArea.js +10 -1
- package/src/mappings/TextArea.ts +10 -0
- package/src/mappings/TextField.js +9 -0
- package/src/mappings/TextField.ts +9 -0
- package/lib/commonjs/components/Shadow.js +0 -42
- package/lib/commonjs/mappings/Shadow.js +0 -94
- package/lib/module/components/Shadow.js +0 -34
- package/lib/module/mappings/Shadow.js +0 -87
- package/lib/typescript/src/components/Shadow.d.ts +0 -24
- package/lib/typescript/src/components/Shadow.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Shadow.d.ts +0 -173
- package/lib/typescript/src/mappings/Shadow.d.ts.map +0 -1
- package/src/components/Shadow.js +0 -16
- package/src/components/Shadow.tsx +0 -58
- package/src/mappings/Shadow.js +0 -87
- package/src/mappings/Shadow.ts +0 -95
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeckSwiperCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"DeckSwiperCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AA6BD,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK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9B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;;;;AAyaF,wBAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,aAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,UAAkB,EAClB,WAAmB,EACnB,iBAAyB,EACzB,cAAsB,EACtB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ScreenContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,aAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,UAAkB,EAClB,WAAmB,EACnB,iBAAyB,EACzB,cAAsB,EACtB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,oBAAoB,eAyCtB;;;;AAYD,wBAA0C"}
|
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { default as Shadow } from "./components/Shadow";
|
|
35
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
36
35
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
37
36
|
export { default as Picker } from "./components/Picker/Picker";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WA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AE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EACL,WAAW,EACX,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,GAAG,EACH,KAAK,EACL,MAAM,GACP,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Accordion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Accordion.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/AccordionItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/AccordionItem.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAerB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheet.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAYrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheetCancel.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetCancel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActionSheetCancel.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetCancel.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheetItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActionSheetItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/ActionSheetItem.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearGradient.d.ts","sourceRoot":"","sources":["../../../../src/mappings/LinearGradient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LinearGradient.d.ts","sourceRoot":"","sources":["../../../../src/mappings/LinearGradient.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapCallout.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapCallout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapCallout.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapCallout.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapMarker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapMarker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapMarker.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapMarker.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapView.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/MapView.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8IrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Swiper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Swiper.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Swiper.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwiperItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/SwiperItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwiperItem.d.ts","sourceRoot":"","sources":["../../../../src/mappings/SwiperItem.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextArea.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextArea.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgSrB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare const SEED_DATA: ({
|
|
|
6
6
|
preview_image_url: string;
|
|
7
7
|
supports_list_render: boolean;
|
|
8
8
|
triggers: string[];
|
|
9
|
+
stylesPanelSections: string[];
|
|
9
10
|
props: {
|
|
10
11
|
type: {
|
|
11
12
|
label: string;
|
|
@@ -310,7 +311,6 @@ export declare const SEED_DATA: ({
|
|
|
310
311
|
};
|
|
311
312
|
};
|
|
312
313
|
layout: {};
|
|
313
|
-
stylesPanelSections?: undefined;
|
|
314
314
|
} | {
|
|
315
315
|
name: string;
|
|
316
316
|
tag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextField.ts"],"names":[],"mappings":"AA6TA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/mappings/TextField.ts"],"names":[],"mappings":"AA6TA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyGrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.8.1
|
|
3
|
+
"version": "46.8.1",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.8.1
|
|
44
|
+
"@draftbit/types": "^46.8.1",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
56
|
"react-native-deck-swiper": "^2.0.12",
|
|
57
57
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
58
|
-
"react-native-shadow-2": "^7.0.6",
|
|
59
58
|
"react-native-svg": "12.3.0",
|
|
60
59
|
"react-native-typography": "^1.4.1",
|
|
61
60
|
"react-native-web-swiper": "^2.2.3"
|
|
@@ -93,5 +92,5 @@
|
|
|
93
92
|
]
|
|
94
93
|
]
|
|
95
94
|
},
|
|
96
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "85d8eebb959e07970330c830dd205a5c95e55ecd"
|
|
97
96
|
}
|
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
3
|
import DeckSwiperComponent from "react-native-deck-swiper";
|
|
4
|
-
const DeckSwiper = ({ onIndexChanged, onEndReached, startCardIndex = 0, infiniteSwiping = false, verticalEnabled = true, horizontalEnabled = true, visibleCardCount = 1, style, children, }) => {
|
|
4
|
+
const DeckSwiper = ({ onIndexChanged, onEndReached, startCardIndex = 0, infiniteSwiping = false, verticalEnabled = true, horizontalEnabled = true, visibleCardCount = 1, data, keyExtractor, renderItem, style, children, }) => {
|
|
5
|
+
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
6
|
+
if ((data && !renderItem) || (renderItem && !data)) {
|
|
7
|
+
throw new Error("'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both");
|
|
8
|
+
}
|
|
9
|
+
if (data && renderItem && children) {
|
|
10
|
+
console.warn("'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'");
|
|
11
|
+
}
|
|
5
12
|
const childrenArray = React.useMemo(() => React.Children.toArray(children), [children]);
|
|
6
13
|
// an array of indices based on children count
|
|
7
14
|
const cardsFillerData = React.useMemo(() => Array.from(Array(childrenArray.length).keys()), [childrenArray]);
|
|
15
|
+
const cardsData = data || cardsFillerData;
|
|
16
|
+
const renderCard = (card, index) => {
|
|
17
|
+
if (renderItem) {
|
|
18
|
+
return renderItem({ item: card, index });
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return React.createElement(React.Fragment, null, childrenArray[index]);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const renderFirstCard = () => {
|
|
25
|
+
if (cardsData.length) {
|
|
26
|
+
return renderCard(cardsData[0], 0);
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
};
|
|
30
|
+
const cardKeyExtractor = (card) => {
|
|
31
|
+
if (keyExtractor) {
|
|
32
|
+
return keyExtractor(card);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return card === null || card === void 0 ? void 0 : card.toString();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
8
38
|
/**
|
|
9
39
|
* By default react-native-deck-swiper positions everything with absolute position.
|
|
10
40
|
* To overcome this, it is wrapped in a View to be able to add the component in any layout structure.
|
|
@@ -15,8 +45,8 @@ const DeckSwiper = ({ onIndexChanged, onEndReached, startCardIndex = 0, infinite
|
|
|
15
45
|
* This effectivley makes the default height of the container be the height of the first card.
|
|
16
46
|
*/
|
|
17
47
|
return (React.createElement(View, null,
|
|
18
|
-
React.createElement(View, { style: styles.containerHeightFiller },
|
|
19
|
-
React.createElement(DeckSwiperComponent, { cards:
|
|
48
|
+
React.createElement(View, { style: styles.containerHeightFiller }, renderFirstCard()),
|
|
49
|
+
React.createElement(DeckSwiperComponent, { cards: cardsData, renderCard: renderCard, keyExtractor: cardKeyExtractor, containerStyle: StyleSheet.flatten([styles.cardsContainer, style]), cardStyle: styles.card, onSwiped: onIndexChanged, onSwipedAll: onEndReached, cardIndex: startCardIndex, infinite: infiniteSwiping, verticalSwipe: verticalEnabled, horizontalSwipe: horizontalEnabled, showSecondCard: visibleCardCount > 1, stackSize: visibleCardCount, backgroundColor: "transparent", cardVerticalMargin: 0, cardHorizontalMargin: 0 })));
|
|
20
50
|
};
|
|
21
51
|
const styles = StyleSheet.create({
|
|
22
52
|
cardsContainer: {
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { StyleProp, ViewStyle, StyleSheet, View } from "react-native";
|
|
3
3
|
import DeckSwiperComponent from "react-native-deck-swiper";
|
|
4
4
|
|
|
5
|
-
export interface DeckSwiperProps {
|
|
5
|
+
export interface DeckSwiperProps<T> {
|
|
6
6
|
onIndexChanged?: (index: number) => void;
|
|
7
7
|
onEndReached?: () => void;
|
|
8
8
|
startCardIndex?: number;
|
|
@@ -10,10 +10,13 @@ export interface DeckSwiperProps {
|
|
|
10
10
|
verticalEnabled?: boolean;
|
|
11
11
|
horizontalEnabled?: boolean;
|
|
12
12
|
visibleCardCount?: number;
|
|
13
|
+
data?: Array<T>;
|
|
14
|
+
keyExtractor?: (item: T) => string;
|
|
15
|
+
renderItem?: ({ item, index }: { item: T; index: number }) => JSX.Element;
|
|
13
16
|
style?: StyleProp<ViewStyle>;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
|
-
const DeckSwiper
|
|
19
|
+
const DeckSwiper = <T extends object>({
|
|
17
20
|
onIndexChanged,
|
|
18
21
|
onEndReached,
|
|
19
22
|
startCardIndex = 0,
|
|
@@ -21,9 +24,25 @@ const DeckSwiper: React.FC<React.PropsWithChildren<DeckSwiperProps>> = ({
|
|
|
21
24
|
verticalEnabled = true,
|
|
22
25
|
horizontalEnabled = true,
|
|
23
26
|
visibleCardCount = 1,
|
|
27
|
+
data,
|
|
28
|
+
keyExtractor,
|
|
29
|
+
renderItem,
|
|
24
30
|
style,
|
|
25
31
|
children,
|
|
26
|
-
}) => {
|
|
32
|
+
}: React.PropsWithChildren<DeckSwiperProps<T>>) => {
|
|
33
|
+
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
34
|
+
if ((data && !renderItem) || (renderItem && !data)) {
|
|
35
|
+
throw new Error(
|
|
36
|
+
"'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both"
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (data && renderItem && children) {
|
|
41
|
+
console.warn(
|
|
42
|
+
"'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'"
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
27
46
|
const childrenArray = React.useMemo(
|
|
28
47
|
() => React.Children.toArray(children),
|
|
29
48
|
[children]
|
|
@@ -35,6 +54,31 @@ const DeckSwiper: React.FC<React.PropsWithChildren<DeckSwiperProps>> = ({
|
|
|
35
54
|
[childrenArray]
|
|
36
55
|
);
|
|
37
56
|
|
|
57
|
+
const cardsData = data || cardsFillerData;
|
|
58
|
+
|
|
59
|
+
const renderCard = (card: any, index: number): JSX.Element => {
|
|
60
|
+
if (renderItem) {
|
|
61
|
+
return renderItem({ item: card, index });
|
|
62
|
+
} else {
|
|
63
|
+
return <>{childrenArray[index]}</>;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const renderFirstCard = (): JSX.Element | undefined => {
|
|
68
|
+
if (cardsData.length) {
|
|
69
|
+
return renderCard(cardsData[0], 0);
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const cardKeyExtractor = (card: any) => {
|
|
75
|
+
if (keyExtractor) {
|
|
76
|
+
return keyExtractor(card);
|
|
77
|
+
} else {
|
|
78
|
+
return card?.toString();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
38
82
|
/**
|
|
39
83
|
* By default react-native-deck-swiper positions everything with absolute position.
|
|
40
84
|
* To overcome this, it is wrapped in a View to be able to add the component in any layout structure.
|
|
@@ -47,13 +91,11 @@ const DeckSwiper: React.FC<React.PropsWithChildren<DeckSwiperProps>> = ({
|
|
|
47
91
|
|
|
48
92
|
return (
|
|
49
93
|
<View>
|
|
50
|
-
<View style={styles.containerHeightFiller}>
|
|
51
|
-
{childrenArray.length && childrenArray[0]}
|
|
52
|
-
</View>
|
|
94
|
+
<View style={styles.containerHeightFiller}>{renderFirstCard()}</View>
|
|
53
95
|
<DeckSwiperComponent
|
|
54
|
-
cards={
|
|
55
|
-
renderCard={
|
|
56
|
-
keyExtractor={
|
|
96
|
+
cards={cardsData as any[]}
|
|
97
|
+
renderCard={renderCard}
|
|
98
|
+
keyExtractor={cardKeyExtractor}
|
|
57
99
|
containerStyle={
|
|
58
100
|
StyleSheet.flatten([styles.cardsContainer, style]) as
|
|
59
101
|
| object
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
3
|
import { withTheme } from "../../theming";
|
|
4
|
-
const DeckSwiperCard = ({ style, children, theme
|
|
4
|
+
const DeckSwiperCard = ({ style, children, theme }) => (React.createElement(View, { style: [
|
|
5
5
|
styles.card,
|
|
6
6
|
{
|
|
7
7
|
backgroundColor: theme.colors.background,
|
|
@@ -5,15 +5,12 @@ import { withTheme } from "../../theming";
|
|
|
5
5
|
|
|
6
6
|
export interface DeckSwiperCardProps {
|
|
7
7
|
style?: StyleProp<ViewStyle>;
|
|
8
|
-
children: React.ReactNode;
|
|
9
8
|
theme: Theme;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
const DeckSwiperCard: React.FC<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
theme,
|
|
16
|
-
}) => (
|
|
11
|
+
const DeckSwiperCard: React.FC<
|
|
12
|
+
React.PropsWithChildren<DeckSwiperCardProps>
|
|
13
|
+
> = ({ style, children, theme }) => (
|
|
17
14
|
<View
|
|
18
15
|
style={[
|
|
19
16
|
styles.card,
|
|
@@ -36,6 +36,8 @@ const isWeb = Platform.OS === "web";
|
|
|
36
36
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
37
37
|
const disabledColor = "rgb(240, 240, 240)";
|
|
38
38
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
39
|
+
//Empty string for 'value' is treated as a non-value
|
|
40
|
+
//reason: Draftbit uses empty string as initial value for string state*/
|
|
39
41
|
const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style, placeholder, value, disabled = false, assistiveText, label, iconColor = unstyledColor, iconSize = 24, leftIconMode = "inset", leftIconName, placeholderTextColor = unstyledColor, rightIconName, type = "solid", autoDismissKeyboard = true, }) => {
|
|
40
42
|
var _a, _b;
|
|
41
43
|
const androidPickerRef = React.useRef(undefined);
|
|
@@ -45,12 +47,12 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
45
47
|
setPickerVisible(!pickerVisible);
|
|
46
48
|
};
|
|
47
49
|
React.useEffect(() => {
|
|
48
|
-
if (value != null) {
|
|
50
|
+
if (value != null && value !== "") {
|
|
49
51
|
setInternalValue(value);
|
|
50
52
|
}
|
|
51
53
|
}, [value]);
|
|
52
54
|
React.useEffect(() => {
|
|
53
|
-
if (defaultValue != null) {
|
|
55
|
+
if (defaultValue != null && defaultValue !== "") {
|
|
54
56
|
setInternalValue(defaultValue);
|
|
55
57
|
}
|
|
56
58
|
}, [defaultValue]);
|
|
@@ -65,10 +67,7 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
65
67
|
Keyboard.dismiss();
|
|
66
68
|
}
|
|
67
69
|
}, [pickerVisible, autoDismissKeyboard]);
|
|
68
|
-
const
|
|
69
|
-
const pickerOptions = placeholder
|
|
70
|
-
? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
|
|
71
|
-
: normalizedOptions;
|
|
70
|
+
const pickerOptions = normalizeOptions(options);
|
|
72
71
|
const { viewStyles, textStyles } = extractStyles(style);
|
|
73
72
|
const additionalBorderStyles = ["backgroundColor"];
|
|
74
73
|
const additionalMarginStyles = [
|
|
@@ -163,10 +162,10 @@ const Picker = ({ error, options = [], onValueChange, defaultValue, Icon, style,
|
|
|
163
162
|
...(disabled ? { color: unstyledColor } : {}),
|
|
164
163
|
};
|
|
165
164
|
const handleValueChange = (newValue, itemIndex) => {
|
|
166
|
-
if (
|
|
165
|
+
if (newValue !== "") {
|
|
167
166
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
|
|
167
|
+
setInternalValue(newValue);
|
|
168
168
|
}
|
|
169
|
-
setInternalValue(newValue);
|
|
170
169
|
};
|
|
171
170
|
return (
|
|
172
171
|
/* marginsContainer */
|
|
@@ -92,6 +92,8 @@ const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
|
92
92
|
const disabledColor = "rgb(240, 240, 240)";
|
|
93
93
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
94
94
|
|
|
95
|
+
//Empty string for 'value' is treated as a non-value
|
|
96
|
+
//reason: Draftbit uses empty string as initial value for string state*/
|
|
95
97
|
const Picker: React.FC<PickerProps> = ({
|
|
96
98
|
error,
|
|
97
99
|
options = [],
|
|
@@ -126,13 +128,13 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
126
128
|
};
|
|
127
129
|
|
|
128
130
|
React.useEffect(() => {
|
|
129
|
-
if (value != null) {
|
|
131
|
+
if (value != null && value !== "") {
|
|
130
132
|
setInternalValue(value);
|
|
131
133
|
}
|
|
132
134
|
}, [value]);
|
|
133
135
|
|
|
134
136
|
React.useEffect(() => {
|
|
135
|
-
if (defaultValue != null) {
|
|
137
|
+
if (defaultValue != null && defaultValue !== "") {
|
|
136
138
|
setInternalValue(defaultValue);
|
|
137
139
|
}
|
|
138
140
|
}, [defaultValue]);
|
|
@@ -149,11 +151,7 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
149
151
|
}
|
|
150
152
|
}, [pickerVisible, autoDismissKeyboard]);
|
|
151
153
|
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
const pickerOptions = placeholder
|
|
155
|
-
? [{ value: placeholder, label: placeholder }, ...normalizedOptions]
|
|
156
|
-
: normalizedOptions;
|
|
154
|
+
const pickerOptions = normalizeOptions(options);
|
|
157
155
|
|
|
158
156
|
const { viewStyles, textStyles } = extractStyles(style);
|
|
159
157
|
|
|
@@ -304,10 +302,10 @@ const Picker: React.FC<PickerProps> = ({
|
|
|
304
302
|
};
|
|
305
303
|
|
|
306
304
|
const handleValueChange = (newValue: string, itemIndex: number) => {
|
|
307
|
-
if (
|
|
305
|
+
if (newValue !== "") {
|
|
308
306
|
onValueChange?.(newValue, itemIndex);
|
|
307
|
+
setInternalValue(newValue);
|
|
309
308
|
}
|
|
310
|
-
setInternalValue(newValue);
|
|
311
309
|
};
|
|
312
310
|
|
|
313
311
|
return (
|
|
@@ -3,7 +3,8 @@ import { StyleSheet, ScrollView, View, } from "react-native";
|
|
|
3
3
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
4
|
import { withTheme } from "../theming";
|
|
5
5
|
function ScreenContainer({ scrollable = false, hasSafeArea = false, hasBottomSafeArea = false, hasTopSafeArea = false, theme, style, children, ...rest }) {
|
|
6
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
const backgroundColor = ((_a = StyleSheet.flatten(style)) === null || _a === void 0 ? void 0 : _a.backgroundColor) || theme.colors.background;
|
|
7
8
|
const edges = ["left", "right"];
|
|
8
9
|
if (hasSafeArea || hasTopSafeArea) {
|
|
9
10
|
edges.push("top");
|
|
@@ -31,7 +31,8 @@ function ScreenContainer({
|
|
|
31
31
|
children,
|
|
32
32
|
...rest
|
|
33
33
|
}: ScreenContainerProps) {
|
|
34
|
-
const backgroundColor =
|
|
34
|
+
const backgroundColor =
|
|
35
|
+
StyleSheet.flatten(style)?.backgroundColor || theme.colors.background;
|
|
35
36
|
|
|
36
37
|
const edges: Edge[] = ["left", "right"];
|
|
37
38
|
if (hasSafeArea || hasTopSafeArea) {
|
package/src/index.js
CHANGED
|
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
|
|
|
31
31
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
33
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
34
|
-
export { default as Shadow } from "./components/Shadow";
|
|
35
34
|
export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
|
|
36
35
|
/* Deprecated: Fix or Delete! */
|
|
37
36
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
package/src/index.tsx
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumberProp, createIconProp, createTextProp, createStaticBoolProp, createColorProp, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createNumberProp, createIconProp, createTextProp, createStaticBoolProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Accordion",
|
|
4
4
|
tag: "AccordionGroup",
|
|
5
5
|
description: "An expandable container containing components",
|
|
6
6
|
category: COMPONENT_TYPES.container,
|
|
7
|
+
stylesPanelSections: [
|
|
8
|
+
StylesPanelSections.LayoutSelectedItem,
|
|
9
|
+
StylesPanelSections.Background,
|
|
10
|
+
StylesPanelSections.Size,
|
|
11
|
+
StylesPanelSections.MarginsAndPaddings,
|
|
12
|
+
StylesPanelSections.Position,
|
|
13
|
+
StylesPanelSections.Borders,
|
|
14
|
+
StylesPanelSections.Effects,
|
|
15
|
+
],
|
|
7
16
|
layout: {
|
|
8
17
|
paddingTop: 8,
|
|
9
18
|
paddingRight: 8,
|