@draftbit/core 43.2.5-1c4256.0 → 43.2.5-4ece9c.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/lib/commonjs/components/AnimatedCircularProgress.js +4 -2
  2. package/lib/commonjs/components/AnimatedCircularProgress.js.map +1 -1
  3. package/lib/commonjs/components/Carousel.js +3 -0
  4. package/lib/commonjs/components/Carousel.js.map +1 -1
  5. package/lib/commonjs/components/CircleImage.js +17 -3
  6. package/lib/commonjs/components/DeprecatedFAB.js +20 -4
  7. package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
  8. package/lib/commonjs/components/Divider.js +3 -13
  9. package/lib/commonjs/components/Divider.js.map +1 -1
  10. package/lib/commonjs/components/Elevation.js +3 -14
  11. package/lib/commonjs/components/Elevation.js.map +1 -1
  12. package/lib/commonjs/components/Image.js +4 -15
  13. package/lib/commonjs/components/Image.js.map +1 -1
  14. package/lib/commonjs/components/Layout.js +19 -38
  15. package/lib/commonjs/components/Layout.js.map +1 -1
  16. package/lib/commonjs/components/StarRating.js +23 -5
  17. package/lib/commonjs/components/StarRating.js.map +1 -1
  18. package/lib/commonjs/components/Swiper/SwiperItem.js.map +1 -1
  19. package/lib/commonjs/components/ToggleButton.js +3 -3
  20. package/lib/commonjs/components/ToggleButton.js.map +1 -1
  21. package/lib/commonjs/index.js.map +1 -1
  22. package/lib/commonjs/mappings/AudioPlayer.js.map +1 -1
  23. package/lib/commonjs/mappings/Carousel.js +1 -3
  24. package/lib/commonjs/mappings/Carousel.js.map +1 -1
  25. package/lib/commonjs/mappings/Image.js.map +1 -1
  26. package/lib/commonjs/mappings/Modal.js.map +1 -1
  27. package/lib/commonjs/mappings/Surface.js.map +1 -1
  28. package/lib/module/components/Carousel.js +3 -0
  29. package/lib/module/components/Carousel.js.map +1 -1
  30. package/lib/module/components/StarRating.js +5 -4
  31. package/lib/module/components/StarRating.js.map +1 -1
  32. package/lib/module/components/ToggleButton.js +3 -3
  33. package/lib/module/components/ToggleButton.js.map +1 -1
  34. package/lib/module/mappings/Carousel.js +1 -3
  35. package/lib/module/mappings/Carousel.js.map +1 -1
  36. package/lib/typescript/src/mappings/Carousel.d.ts +1 -3
  37. package/package.json +2 -2
  38. package/src/components/Carousel.js +3 -0
  39. package/src/components/Carousel.tsx +3 -0
  40. package/src/components/ToggleButton.js +5 -3
  41. package/src/components/ToggleButton.tsx +5 -3
  42. package/src/mappings/Carousel.js +1 -3
  43. package/src/mappings/Carousel.ts +1 -3
@@ -15,8 +15,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
 
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
 
18
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
-
20
18
  const StarRating = _ref => {
21
19
  let {
22
20
  Icon,
@@ -47,9 +45,10 @@ const StarRating = _ref => {
47
45
  !!onPress && onPress(r);
48
46
  }, [onPress]);
49
47
  const ratingRounded = Math.round(localRating * 2) / 2;
50
- return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
51
- style: [styles.container, style]
52
- }, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
48
+ return /*#__PURE__*/React.createElement(_reactNative.View, {
49
+ style: [styles.container, style],
50
+ ...rest
51
+ }, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
53
52
  key: i,
54
53
  style: {
55
54
  display: "flex"
@@ -93,5 +92,24 @@ const styles = _reactNative.StyleSheet.create({
93
92
 
94
93
  var _default = (0, _theming.withTheme)(StarRating);
95
94
 
95
+ exports.default = _default;
96
+ //# sourceMappingURL=StarRating.js.mapx",
97
+ flexDirection: "row",
98
+ position: "absolute",
99
+ top: 0,
100
+ right: 0,
101
+ left: 0,
102
+ bottom: 0,
103
+ zIndex: 1
104
+ },
105
+ pressable: {
106
+ flex: 1,
107
+ height: "100%",
108
+ width: "50%"
109
+ }
110
+ });
111
+
112
+ var _default = (0, _theming.withTheme)(StarRating);
113
+
96
114
  exports.default = _default;
97
115
  //# sourceMappingURL=StarRating.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["StarRating.tsx"],"names":["StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","React","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","styles","container","Array","map","_","i","display","touchContainer","pressable","StyleSheet","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width"],"mappings":";;;;;;;AAAA;;AACA;;AAOA;;;;;;;;AAiBA,MAAMA,UAA2B,GAAG,QAY9B;AAAA,MAZ+B;AACnCC,IAAAA,IADmC;AAEnCC,IAAAA,QAAQ,GAAG,EAFwB;AAGnCC,IAAAA,QAAQ,GAAG,CAHwB;AAInCC,IAAAA,MAAM,GAAG,CAJ0B;AAKnCC,IAAAA,YALmC;AAMnCC,IAAAA,UAAU,GAAG,KANsB;AAOnCC,IAAAA,WAPmC;AAQnCC,IAAAA,aARmC;AASnCC,IAAAA,KATmC;AAUnCC,IAAAA,OAVmC;AAWnC,OAA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,CAAhB,GAAoBrB,WAApB,GAAkCC;AAP3C,IADF,EAUGF,UAAU,iBACT,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAEiB,MAAM,CAACO;AAApB,kBACE,oBAAC,sBAAD;AACE,IAAA,KAAK,EAAEP,MAAM,CAACQ,SADhB;AAEE,IAAA,OAAO,EAAE,MAAMd,aAAa,CAACW,CAAC,GAAG,GAAL;AAF9B,IADF,eAKE,oBAAC,sBAAD;AACE,IAAA,KAAK,EAAEL,MAAM,CAACQ,SADhB;AAEE,IAAA,OAAO,EAAE,MAAMd,aAAa,CAACW,CAAC,GAAG,CAAL;AAF9B,IALF,CAXJ,CADD,CADH,CADF;AA6BD,CApED;;AAsEA,MAAML,MAAM,GAAGS,wBAAWC,MAAX,CAAkB;AAC/BT,EAAAA,SAAS,EAAE;AACTU,IAAAA,aAAa,EAAE,KADN;AAETC,IAAAA,UAAU,EAAE;AAFH,GADoB;AAK/BL,EAAAA,cAAc,EAAE;AACdD,IAAAA,OAAO,EAAE,MADK;AAEdK,IAAAA,aAAa,EAAE,KAFD;AAGdE,IAAAA,QAAQ,EAAE,UAHI;AAIdC,IAAAA,GAAG,EAAE,CAJS;AAKdC,IAAAA,KAAK,EAAE,CALO;AAMdC,IAAAA,IAAI,EAAE,CANQ;AAOdC,IAAAA,MAAM,EAAE,CAPM;AAQdC,IAAAA,MAAM,EAAE;AARM,GALe;AAe/BV,EAAAA,SAAS,EAAE;AACTW,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,MAAM,EAAE,MAFC;AAGTC,IAAAA,KAAK,EAAE;AAHE;AAfoB,CAAlB,CAAf;;eAsBe,wBAAU5C,UAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n View,\n StyleSheet,\n StyleProp,\n ViewStyle,\n Pressable,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n starSize?: number;\n maxStars?: number;\n rating?: number;\n defaultValue?: number;\n isEditable?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n onPress?: (newValue: number) => void;\n} & IconSlot;\n\nconst StarRating: React.FC<Props> = ({\n Icon,\n starSize = 16,\n maxStars = 5,\n rating = 0,\n defaultValue,\n isEditable = false,\n activeColor,\n inactiveColor,\n style,\n onPress,\n ...rest\n}) => {\n const [localRating, setLocalRating] = React.useState<number>(\n rating || defaultValue || 0\n );\n\n React.useEffect(() => {\n if (rating != null) {\n setLocalRating(rating);\n }\n }, [rating]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setLocalRating(defaultValue);\n }\n }, [defaultValue]);\n\n const ratingHandler = React.useCallback(\n (r) => {\n setLocalRating(r);\n !!onPress && onPress(r);\n },\n [onPress]\n );\n\n const ratingRounded = Math.round(localRating * 2) / 2;\n\n return (\n <View style={[styles.container, style]} {...rest}>\n {[...Array(maxStars)].map((_, i) => (\n <View key={i} style={{ display: \"flex\" }}>\n <Icon\n name={\n ratingRounded - i === 0.5\n ? \"MaterialIcons/star-half\"\n : \"MaterialIcons/star\"\n }\n size={starSize}\n color={ratingRounded > i ? activeColor : inactiveColor}\n />\n {isEditable && (\n <View style={styles.touchContainer}>\n <Pressable\n style={styles.pressable}\n onPress={() => ratingHandler(i + 0.5)}\n />\n <Pressable\n style={styles.pressable}\n onPress={() => ratingHandler(i + 1)}\n />\n </View>\n )}\n </View>\n ))}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n touchContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n position: \"absolute\",\n top: 0,\n right: 0,\n left: 0,\n bottom: 0,\n zIndex: 1,\n },\n pressable: {\n flex: 1,\n height: \"100%\",\n width: \"50%\",\n },\n});\n\nexport default withTheme(StarRating);\n"]}
1
+ {"version":3,"sources":["StarRating.js"],"names":["StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","React","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","createElement","View","styles","container","Array","map","_","i","key","display","name","size","color","touchContainer","Pressable","pressable","StyleSheet","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AACA,MAAMA,UAAU,GAAG,QAA8I;AAAA,MAA7I;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,QAAQ,GAAG,EAAnB;AAAuBC,IAAAA,QAAQ,GAAG,CAAlC;AAAqCC,IAAAA,MAAM,GAAG,CAA9C;AAAiDC,IAAAA,YAAjD;AAA+DC,IAAAA,UAAU,GAAG,KAA5E;AAAmFC,IAAAA,WAAnF;AAAgGC,IAAAA,aAAhG;AAA+GC,IAAAA,KAA/G;AAAsHC,IAAAA,OAAtH;AAA+H,OAAGC;AAAlI,GAA6I;AAC7J,QAAM,CAACC,WAAD,EAAcC,cAAd,IAAgCC,KAAK,CAACC,QAAN,CAAeX,MAAM,IAAIC,YAAV,IAA0B,CAAzC,CAAtC;AACAS,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AAClB,QAAIZ,MAAM,IAAI,IAAd,EAAoB;AAChBS,MAAAA,cAAc,CAACT,MAAD,CAAd;AACH;AACJ,GAJD,EAIG,CAACA,MAAD,CAJH;AAKAU,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AAClB,QAAIX,YAAY,IAAI,IAApB,EAA0B;AACtBQ,MAAAA,cAAc,CAACR,YAAD,CAAd;AACH;AACJ,GAJD,EAIG,CAACA,YAAD,CAJH;AAKA,QAAMY,aAAa,GAAGH,KAAK,CAACI,WAAN,CAAmBC,CAAD,IAAO;AAC3CN,IAAAA,cAAc,CAACM,CAAD,CAAd;AACA,KAAC,CAACT,OAAF,IAAaA,OAAO,CAACS,CAAD,CAApB;AACH,GAHqB,EAGnB,CAACT,OAAD,CAHmB,CAAtB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AAL;AAAvD,GAA/B,CAFW,CAJkG,CAApC,CAAzE,CAAR;AAOH,CAxBD;;AAyBA,MAAML,MAAM,GAAGc,wBAAWC,MAAX,CAAkB;AAC7Bd,EAAAA,SAAS,EAAE;AACPe,IAAAA,aAAa,EAAE,KADR;AAEPC,IAAAA,UAAU,EAAE;AAFL,GADkB;AAK7BN,EAAAA,cAAc,EAAE;AACZJ,IAAAA,OAAO,EAAE,MADG;AAEZS,IAAAA,aAAa,EAAE,KAFH;AAGZE,IAAAA,QAAQ,EAAE,UAHE;AAIZC,IAAAA,GAAG,EAAE,CAJO;AAKZC,IAAAA,KAAK,EAAE,CALK;AAMZC,IAAAA,IAAI,EAAE,CANM;AAOZC,IAAAA,MAAM,EAAE,CAPI;AAQZC,IAAAA,MAAM,EAAE;AARI,GALa;AAe7BV,EAAAA,SAAS,EAAE;AACPW,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,MAAM,EAAE,MAFD;AAGPC,IAAAA,KAAK,EAAE;AAHA;AAfkB,CAAlB,CAAf;;eAqBe,wBAAUnD,UAAV,C","sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet, Pressable, } from \"react-native\";\nimport { withTheme } from \"../theming\";\nconst StarRating = ({ Icon, starSize = 16, maxStars = 5, rating = 0, defaultValue, isEditable = false, activeColor, inactiveColor, style, onPress, ...rest }) => {\n const [localRating, setLocalRating] = React.useState(rating || defaultValue || 0);\n React.useEffect(() => {\n if (rating != null) {\n setLocalRating(rating);\n }\n }, [rating]);\n React.useEffect(() => {\n if (defaultValue != null) {\n setLocalRating(defaultValue);\n }\n }, [defaultValue]);\n const ratingHandler = React.useCallback((r) => {\n setLocalRating(r);\n !!onPress && onPress(r);\n }, [onPress]);\n const ratingRounded = Math.round(localRating * 2) / 2;\n return (React.createElement(View, { style: [styles.container, style], ...rest }, [...Array(maxStars)].map((_, i) => (React.createElement(View, { key: i, style: { display: \"flex\" } },\n React.createElement(Icon, { name: ratingRounded - i === 0.5\n ? \"MaterialIcons/star-half\"\n : \"MaterialIcons/star\", size: starSize, color: ratingRounded > i ? activeColor : inactiveColor }),\n isEditable && (React.createElement(View, { style: styles.touchContainer },\n React.createElement(Pressable, { style: styles.pressable, onPress: () => ratingHandler(i + 0.5) }),\n React.createElement(Pressable, { style: styles.pressable, onPress: () => ratingHandler(i + 1) }))))))));\n};\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n touchContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n position: \"absolute\",\n top: 0,\n right: 0,\n left: 0,\n bottom: 0,\n zIndex: 1,\n },\n pressable: {\n flex: 1,\n height: \"100%\",\n width: \"50%\",\n },\n});\nexport default withTheme(StarRating);\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["SwiperItem.tsx"],"names":["styles","StyleSheet","create","wrapper","flex","SwiperItem","children","style"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA,MAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,IAAI,EAAE;AADC;AADsB,CAAlB,CAAf;;AAWA,MAAMC,UAAU,GAAG;AAAA,MAAC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAD;AAAA,sBACjB,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAACP,MAAM,CAACG,OAAR,EAAiBI,KAAjB;AAAb,KAAuCD,QAAvC,CADiB;AAAA,CAAnB;;eAIeD,U","sourcesContent":["import React from \"react\";\nimport { View, StyleSheet, StyleProp, ViewStyle } from \"react-native\";\n\nconst styles = StyleSheet.create({\n wrapper: {\n flex: 1,\n },\n});\n\nexport interface SwiperProps {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nconst SwiperItem = ({ children, style }: SwiperProps) => (\n <View style={[styles.wrapper, style]}>{children}</View>\n);\n\nexport default SwiperItem;\n"]}
1
+ {"version":3,"sources":["SwiperItem.js"],"names":["styles","StyleSheet","create","wrapper","flex","SwiperItem","children","style","React","createElement","View"],"mappings":";;;;;;;AAAA;;AACA;;;;AACA,MAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC7BC,EAAAA,OAAO,EAAE;AACLC,IAAAA,IAAI,EAAE;AADD;AADoB,CAAlB,CAAf;;AAKA,MAAMC,UAAU,GAAG;AAAA,MAAC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAD;AAAA,sBAA0BC,eAAMC,aAAN,CAAoBC,iBAApB,EAA0B;AAAEH,IAAAA,KAAK,EAAE,CAACP,MAAM,CAACG,OAAR,EAAiBI,KAAjB;AAAT,GAA1B,EAA8DD,QAA9D,CAA1B;AAAA,CAAnB;;eACeD,U","sourcesContent":["import React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nconst styles = StyleSheet.create({\n wrapper: {\n flex: 1,\n },\n});\nconst SwiperItem = ({ children, style }) => (React.createElement(View, { style: [styles.wrapper, style] }, children));\nexport default SwiperItem;\n"]}
@@ -54,8 +54,8 @@ const ToggleButton = _ref => {
54
54
  }, [defaultValue]);
55
55
 
56
56
  const handlePress = () => {
57
- setInternalValue(!toggled);
58
- onPress(!toggled);
57
+ setInternalValue(!internalValue);
58
+ onPress(!internalValue);
59
59
  };
60
60
 
61
61
  return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
@@ -68,7 +68,7 @@ const ToggleButton = _ref => {
68
68
  style: [styles.mainContainer, {
69
69
  width,
70
70
  height,
71
- backgroundColor: toggled ? colors[colorSecondary] : colors[color],
71
+ backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
72
72
  borderColor: colors[borderColor]
73
73
  }, style]
74
74
  }, rest));
@@ -1 +1 @@
1
- {"version":3,"sources":["ToggleButton.tsx"],"names":["ToggleButton","Icon","icon","toggled","onPress","defaultValue","disabled","color","colorSecondary","borderColor","iconSize","width","height","theme","colors","style","rest","internalValue","setInternalValue","React","useState","useEffect","handlePress","styles","mainContainer","backgroundColor","StyleS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AAA,IAAI,EAAEF,IADR;AAEE,IAAA,IAAI,EAAEC,IAFR;AAGE,IAAA,IAAI,EAAEQ,QAHR;AAIE,IAAA,KAAK,EAAEO,aAAa,GAAGH,MAAM,CAACP,KAAD,CAAT,GAAmBO,MAAM,CAACN,cAAD,CAJ/C;AAKE,IAAA,OAAO,EAAEc,WALX;AAME,IAAA,QAAQ,EAAEhB,QANZ;AAOE,IAAA,KAAK,EAAE,CACLiB,MAAM,CAACC,aADF,EAEL;AACEb,MAAAA,KADF;AAEEC,MAAAA,MAFF;AAGEa,MAAAA,eAAe,EAAEtB,OAAO,GAAGW,MAAM,CAACN,cAAD,CAAT,GAA4BM,MAAM,CAACP,KAAD,CAH5D;AAIEE,MAAAA,WAAW,EAAEK,MAAM,CAACL,WAAD;AAJrB,KAFK,EAQLM,KARK;AAPT,KAiBMC,IAjBN,EADF;AAqBD,CA3DD;;AA6DA,MAAMO,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,aAAa,EAAE;AACbI,IAAAA,WAAW,EAAE;AADA;AADgB,CAAlB,CAAf;;eAMe,wBAAU5B,YAAV,C","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport { colorTypes } from \"@draftbit/types\";\nimport { StyleProp, StyleSheet, ViewStyle } from \"react-native\";\nimport IconButton from \"./IconButton\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n icon: string;\n toggled?: boolean;\n onPress?: (value: boolean) => void;\n defaultValue?: boolean;\n disabled?: boolean;\n color?: colorTypes;\n colorSecondary?: colorTypes;\n borderColor?: colorTypes;\n iconSize?: number;\n width?: number;\n height?: number;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst ToggleButton: React.FC<Props> = ({\n Icon,\n icon,\n toggled = false,\n onPress = () => {},\n defaultValue,\n disabled = false,\n color = \"primary\",\n colorSecondary = \"surface\",\n borderColor = \"divider\",\n iconSize = 25,\n width = 50,\n height = 50,\n theme: { colors },\n style,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<boolean>(\n toggled || defaultValue || false\n );\n\n React.useEffect(() => {\n if (toggled != null) {\n setInternalValue(toggled);\n }\n }, [toggled]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handlePress = () => {\n setInternalValue(!toggled);\n onPress(!toggled);\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={icon}\n size={iconSize}\n color={internalValue ? colors[color] : colors[colorSecondary]}\n onPress={handlePress}\n disabled={disabled}\n style={[\n styles.mainContainer,\n {\n width,\n height,\n backgroundColor: toggled ? colors[colorSecondary] : colors[color],\n borderColor: colors[borderColor],\n },\n style,\n ]}\n {...rest}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n mainContainer: {\n borderWidth: 1,\n },\n});\n\nexport default withTheme(ToggleButton);\n"]}
1
+ {"version":3,"sources":["ToggleButton.tsx"],"names":["ToggleButton","Icon","icon","toggled","onPress","defaultValue","disabled","color","colorSecondary","borderColor","iconSize","width","height","theme","colors","style","rest","internalValue","setInternalValue","React","useState","useEffect","handlePress","styles","mainContainer","backgroundColor","StyleSheet","create","borderWidth"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;;;AAoBA,MAAMA,YAA6B,GAAG,QAgBhC;AAAA,MAhBiC;AACrCC,IAAAA,IADqC;AAErCC,IAAAA,IAFqC;AAGrCC,IAAAA,OAAO,GAAG,KAH2B;AAIrCC,IAAAA,OAAO,GAAG,MAAM,CAAE,CAJmB;AAKrCC,IAAAA,YALqC;AAMrCC,IAAAA,QAAQ,GAAG,KAN0B;AAOrCC,IAAAA,KAAK,GAAG,SAP6B;AAQrCC,IAAAA,cAAc,GAAG,SARoB;AASrCC,IAAAA,WAAW,GAAG,SATuB;AAUrCC,IAAAA,QAAQ,GAAG,EAV0B;AAWrCC,IAAAA,KAAK,G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,EAAEK,MAAM,CAACL,WAAD;AANrB,KAFK,EAULM,KAVK;AAPT,KAmBMC,IAnBN,EADF;AAuBD,CA7DD;;AA+DA,MAAMO,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,aAAa,EAAE;AACbI,IAAAA,WAAW,EAAE;AADA;AADgB,CAAlB,CAAf;;eAMe,wBAAU5B,YAAV,C","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport { colorTypes } from \"@draftbit/types\";\nimport { StyleProp, StyleSheet, ViewStyle } from \"react-native\";\nimport IconButton from \"./IconButton\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n icon: string;\n toggled?: boolean;\n onPress?: (value: boolean) => void;\n defaultValue?: boolean;\n disabled?: boolean;\n color?: colorTypes;\n colorSecondary?: colorTypes;\n borderColor?: colorTypes;\n iconSize?: number;\n width?: number;\n height?: number;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst ToggleButton: React.FC<Props> = ({\n Icon,\n icon,\n toggled = false,\n onPress = () => {},\n defaultValue,\n disabled = false,\n color = \"primary\",\n colorSecondary = \"surface\",\n borderColor = \"divider\",\n iconSize = 25,\n width = 50,\n height = 50,\n theme: { colors },\n style,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<boolean>(\n toggled || defaultValue || false\n );\n\n React.useEffect(() => {\n if (toggled != null) {\n setInternalValue(toggled);\n }\n }, [toggled]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handlePress = () => {\n setInternalValue(!internalValue);\n onPress(!internalValue);\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={icon}\n size={iconSize}\n color={internalValue ? colors[color] : colors[colorSecondary]}\n onPress={handlePress}\n disabled={disabled}\n style={[\n styles.mainContainer,\n {\n width,\n height,\n backgroundColor: internalValue\n ? colors[colorSecondary]\n : colors[color],\n borderColor: colors[borderColor],\n },\n style,\n ]}\n {...rest}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n mainContainer: {\n borderWidth: 1,\n },\n});\n\nexport default withTheme(ToggleButton);\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AASA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
1
+ {"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport { ActionSheet, ActionSheetItem, ActionSheetCancel, } from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\nexport { Center, Circle, Square, Row, Stack, Spacer, } from \"./components/Layout\";\nexport { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from \"./components/RadioButton/index\";\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["AudioPlayer.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","props","source","group","GROUPS","data","label","editable","required","defaultValue","formType","FORM_TYPES","sourceUrl","propType","PROP_TYPES","OBJECT"],"mappings":";;;;;;;AAAA;;AAOO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,cADiB;AAEvBC,EAAAA,GAAG,EAAE,aAFkB;AAGvBC,EAAAA,WAAW,EAAE,2CAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJH;AAKvBC,EAAAA,MAAM,EAAE,EALe;AAMvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE;AACNC,MAAAA,KAAK,EAAEC,cAAOC,IADR;AAENC,MAAAA,KAAK,EAAE,QAFD;AAGNV,MAAAA,WAAW,EAAE,oCAHP;AAINW,MAAAA,QAAQ,EAAE,IAJJ;AAKNC,MAAAA,QAAQ,EAAE,IALJ;AAMNC,MAAAA,YAAY,EACV,+DAPI;AAQNC,MAAAA,QAAQ,EAAEC,kBAAWC,SARf;AASNC,MAAAA,QAAQ,EAAEC,kBAAWC;AATf;AADH;AANgB,CAAlB","sourcesContent":["import {\n GROUPS,\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Audio Player\",\n tag: \"AudioPlayer\",\n description: \"Given a source URL, plays sounds & audio!\",\n category: COMPONENT_TYPES.media,\n layout: {},\n props: {\n source: {\n group: GROUPS.data,\n label: \"Source\",\n description: \"The source URL for the audio file.\",\n editable: true,\n required: true,\n defaultValue:\n \"https://static.draftbit.com/audio/intro-to-draftbit-audio.mp3\",\n formType: FORM_TYPES.sourceUrl,\n propType: PROP_TYPES.OBJECT,\n },\n },\n};\n"]}
1
+ {"version":3,"sources":["AudioPlayer.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","props","source","group","GROUPS","data","label","editable","required","defaultValue","formType","FORM_TYPES","sourceUrl","propType","PROP_TYPES","OBJECT"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,cADe;AAErBC,EAAAA,GAAG,EAAE,aAFgB;AAGrBC,EAAAA,WAAW,EAAE,2CAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJL;AAKrBC,EAAAA,MAAM,EAAE,EALa;AAMrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,MAAM,EAAE;AACJC,MAAAA,KAAK,EAAEC,cAAOC,IADV;AAEJC,MAAAA,KAAK,EAAE,QAFH;AAGJV,MAAAA,WAAW,EAAE,oCAHT;AAIJW,MAAAA,QAAQ,EAAE,IAJN;AAKJC,MAAAA,QAAQ,EAAE,IALN;AAMJC,MAAAA,YAAY,EAAE,+DANV;AAOJC,MAAAA,QAAQ,EAAEC,kBAAWC,SAPjB;AAQJC,MAAAA,QAAQ,EAAEC,kBAAWC;AARjB;AADL;AANc,CAAlB","sourcesContent":["import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Audio Player\",\n tag: \"AudioPlayer\",\n description: \"Given a source URL, plays sounds & audio!\",\n category: COMPONENT_TYPES.media,\n layout: {},\n props: {\n source: {\n group: GROUPS.data,\n label: \"Source\",\n description: \"The source URL for the audio file.\",\n editable: true,\n required: true,\n defaultValue: \"https://static.draftbit.com/audio/intro-to-draftbit-audio.mp3\",\n formType: FORM_TYPES.sourceUrl,\n propType: PROP_TYPES.OBJECT,\n },\n },\n};\n"]}
@@ -12,9 +12,7 @@ const SEED_DATA = [{
12
12
  tag: "Carousel",
13
13
  category: _types.COMPONENT_TYPES.media,
14
14
  description: "A horizontal scrolling carousel of images",
15
- layout: {
16
- height: 250
17
- },
15
+ layout: {},
18
16
  props: {
19
17
  resizeMode: (0, _types.createResizeModeProp)(),
20
18
  dotColor: (0, _types.createColorProp)({
@@ -1 +1 @@
1
- {"version":3,"sources":["Carousel.ts"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","media","description","layout","height","props","resizeMode","dotColor","label"],"mappings":";;;;;;;AAAA;;AAMO,MAAMA,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,UADR;AAEEC,EAAAA,GAAG,EAAE,UAFP;AAGEC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAH5B;AAIEC,EAAAA,WAAW,EAAE,2CAJf;AAKEC,EAAAA,MAAM,EAAE;AACNC,IAAAA,MAAM,EAAE;AADF,GALV;AAQEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE,kCADP;AAELC,IAAAA,QAAQ,EAAE,4BAAgB;AACxBC,MAAAA,KAAK,EAAE;AADiB,KAAhB;AAFL;AART,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createResizeModeProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Carousel\",\n tag: \"Carousel\",\n category: COMPONENT_TYPES.media,\n description: \"A horizontal scrolling carousel of images\",\n layout: {\n height: 250,\n },\n props: {\n resizeMode: createResizeModeProp(),\n dotColor: createColorProp({\n label: \"Dot color\",\n }),\n },\n },\n];\n"]}
1
+ {"version":3,"sources":["Carousel.ts"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","media","description","layout","props","resizeMode","dotColor","label"],"mappings":";;;;;;;AAAA;;AAMO,MAAMA,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,UADR;AAEEC,EAAAA,GAAG,EAAE,UAFP;AAGEC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAH5B;AAIEC,EAAAA,WAAW,EAAE,2CAJf;AAKEC,EAAAA,MAAM,EAAE,EALV;AAMEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE,kCADP;AAELC,IAAAA,QAAQ,EAAE,4BAAgB;AACxBC,MAAAA,KAAK,EAAE;AADiB,KAAhB;AAFL;AANT,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createResizeModeProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Carousel\",\n tag: \"Carousel\",\n category: COMPONENT_TYPES.media,\n description: \"A horizontal scrolling carousel of images\",\n layout: {},\n props: {\n resizeMode: createResizeModeProp(),\n dotColor: createColorProp({\n label: \"Dot color\",\n }),\n },\n },\n];\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Image.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","width","height","props","source","resizeMode"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,OADe;AAErBC,EAAAA,GAAG,EAAE,OAFgB;AAGrBC,EAAAA,WAAW,EAAE,yBAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJL;AAKrBC,EAAAA,MAAM,EAAE;AACJC,IAAAA,KAAK,EAAE,GADH;AAEJC,IAAAA,MAAM,EAAE;AAFJ,GALa;AASrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,MAAM,EAAE,6BADL;AAEHC,IAAAA,UAAU,EAAE;AAFT;AATc,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createImageProp, createResizeModeProp, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Image\",\n tag: \"Image\",\n description: \"A basic Image Component\",\n category: COMPONENT_TYPES.media,\n layout: {\n width: 250,\n height: 250,\n },\n props: {\n source: createImageProp(),\n resizeMode: createResizeModeProp(),\n },\n};\n"]}
1
+ {"version":3,"sources":["Image.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","width","height","props","source","resizeMode"],"mappings":";;;;;;;AAAA;;AAMO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,OADiB;AAEvBC,EAAAA,GAAG,EAAE,OAFkB;AAGvBC,EAAAA,WAAW,EAAE,yBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJH;AAKvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,KAAK,EAAE,GADD;AAENC,IAAAA,MAAM,EAAE;AAFF,GALe;AASvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BADH;AAELC,IAAAA,UAAU,EAAE;AAFP;AATgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createImageProp,\n createResizeModeProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Image\",\n tag: \"Image\",\n description: \"A basic Image Component\",\n category: COMPONENT_TYPES.media,\n layout: {\n width: 250,\n height: 250,\n },\n props: {\n source: createImageProp(),\n resizeMode: createResizeModeProp(),\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Modal.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","container","props","animationType","group","GROUPS","basic","label","options","editable","required","formType","FORM_TYPES","flatArray","propType","PROP_TYPES","STRING","defaultValue","transparent","visible","data","presentationStyle"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,OADiB;AAEvBC,EAAAA,GAAG,EAAE,OAFkB;AAGvBC,EAAAA,WAAW,EAAE,yBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAJH;AA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\n createBoolProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Modal\",\n tag: \"Modal\",\n description: \"A basic Modal Component\",\n category: COMPONENT_TYPES.container,\n props: {\n animationType: {\n group: GROUPS.basic,\n label: \"Animation Type\",\n description: \"Animation Type\",\n options: [\"slide\", \"fade\", \"none\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"none\",\n },\n transparent: createBoolProp({\n group: GROUPS.basic,\n label: \"Transparent\",\n description:\n \"Determines whether the modal will fill the entire view. Setting this to true will render the modal over a transparent background\",\n }),\n visible: createBoolProp({\n group: GROUPS.data,\n label: \"Visible\",\n description: \"Determines whether the modal is visible\",\n }),\n presentationStyle: {\n group: GROUPS.basic,\n label: \"Presentation Style\",\n description: \"Presentation Style\",\n options: [\"fullScreen\", \"pageSheet\", \"formSheet\", \"overFullScreen\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n },\n};\n"]}
1
+ {"version":3,"sources":["Modal.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","container","props","animationType","group","GROUPS","basic","label","options","editable","required","formType","FORM_TYPES","flatArray","propType","PROP_TYPES","STRING","defaultValue","transparent","visible","data","presentationStyle"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,OADe;AAErBC,EAAAA,GAAG,EAAE,OAFgB;AAGrBC,EAAAA,WAAW,EAAE,yBAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAJL;AAKrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,aAAa,EAAE;AACXC,MAAAA,KAAK,EAAEC,cAAOC,KADH;AAEXC,MAAAA,KAAK,EAAE,gBAFI;AAGXT,MAAAA,WAAW,EAAE,gBAHF;AAIXU,MAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,MAAV,EAAkB,MAAlB,CAJE;AAKXC,MAAAA,QAAQ,EAAE,IALC;AAMXC,MAAAA,QAAQ,EAAE,KANC;AAOXC,MAAAA,QAAQ,EAAEC,kBAAWC,SAPV;AAQXC,MAAAA,QAAQ,EAAEC,kBAAWC,MARV;AASXC,MAAAA,YAAY,EAAE;AATH,KADZ;AAYHC,IAAAA,WAAW,EAAE,2BAAe;AACxBd,MAAAA,KAAK,EAAEC,cAAOC,KADU;AAExBC,MAAAA,KAAK,EAAE,aAFiB;AAGxBT,MAAAA,WAAW,EAAE;AAHW,KAAf,CAZV;AAiBHqB,IAAAA,OAAO,EAAE,2BAAe;AACpBf,MAAAA,KAAK,EAAEC,cAAOe,IADM;AAEpBb,MAAAA,KAAK,EAAE,SAFa;AAGpBT,MAAAA,WAAW,EAAE;AAHO,KAAf,CAjBN;AAsBHuB,IAAAA,iBAAiB,EAAE;AACfjB,MAAAA,KAAK,EAAEC,cAAOC,KADC;AAEfC,MAAAA,KAAK,EAAE,oBAFQ;AAGfT,MAAAA,WAAW,EAAE,oBAHE;AAIfU,MAAAA,OAAO,EAAE,CAAC,YAAD,EAAe,WAAf,EAA4B,WAA5B,EAAyC,gBAAzC,CAJM;AAKfC,MAAAA,QAAQ,EAAE,IALK;AAMfC,MAAAA,QAAQ,EAAE,KANK;AAOfC,MAAAA,QAAQ,EAAEC,kBAAWC,SAPN;AAQfC,MAAAA,QAAQ,EAAEC,kBAAWC,MARN;AASfC,MAAAA,YAAY,EAAE;AATC;AAtBhB;AALc,CAAlB","sourcesContent":["import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, createBoolProp, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Modal\",\n tag: \"Modal\",\n description: \"A basic Modal Component\",\n category: COMPONENT_TYPES.container,\n props: {\n animationType: {\n group: GROUPS.basic,\n label: \"Animation Type\",\n description: \"Animation Type\",\n options: [\"slide\", \"fade\", \"none\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"none\",\n },\n transparent: createBoolProp({\n group: GROUPS.basic,\n label: \"Transparent\",\n description: \"Determines whether the modal will fill the entire view. Setting this to true will render the modal over a transparent background\",\n }),\n visible: createBoolProp({\n group: GROUPS.data,\n label: \"Visible\",\n description: \"Determines whether the modal is visible\",\n }),\n presentationStyle: {\n group: GROUPS.basic,\n label: \"Presentation Style\",\n description: \"Presentation Style\",\n options: [\"fullScreen\", \"pageSheet\", \"formSheet\", \"overFullScreen\"],\n editable: true,\n required: false,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Surface.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","layout","minHeight","props","elevation"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,SADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,uBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,MAJH;AAKvBA,EAAAA,MAAM,EAAE;AACNC,IAAAA,SAAS,EAAE;AADL,GALe;AAQvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,gCAAoB,CAApB;AADN;AARgB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createElevationType } from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Surface\",\n tag: \"Surface\",\n description: \"An elevated container\",\n category: COMPONENT_TYPES.layout,\n layout: {\n minHeight: 40,\n },\n props: {\n elevation: createElevationType(0),\n },\n};\n"]}
1
+ {"version":3,"sources":["Surface.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","layout","minHeight","props","elevation"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,SADe;AAErBC,EAAAA,GAAG,EAAE,SAFgB;AAGrBC,EAAAA,WAAW,EAAE,uBAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,MAJL;AAKrBA,EAAAA,MAAM,EAAE;AACJC,IAAAA,SAAS,EAAE;AADP,GALa;AAQrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,SAAS,EAAE,gCAAoB,CAApB;AADR;AARc,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createElevationType } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Surface\",\n tag: \"Surface\",\n description: \"An elevated container\",\n category: COMPONENT_TYPES.layout,\n layout: {\n minHeight: 40,\n },\n props: {\n elevation: createElevationType(0),\n },\n};\n"]}
@@ -103,6 +103,9 @@ function Carousel(_ref2) {
103
103
 
104
104
  const styles = StyleSheet.create({
105
105
  container: {
106
+ height: 250,
107
+ position: "relative",
108
+ width: screenWidth,
106
109
  backgroundColor: "#eee"
107
110
  },
108
111
  pager: {
@@ -1 +1 @@
1
- {"version":3,"sources":["Carousel.tsx"],"names":["React","withTheme","ScrollView","View","StyleSheet","Dimensions","Image","screenWidth","get","width","Pager","color","index","length","styles","pager","Array","from","map","_","i","current","opacity","size","bullet","backgroundColor","height","Carousel","data","children","dotColor","style","rest","setIndex","useState","Children","count","itemsLength","slides","isArray","flatten","slideWidth","slideHeight","container","nativeEvent","layoutWidth","layoutMeasurement","offset","contentOffset","x","currentIndex","Math","ceil","item","uri","child","s","props","cloneElement","create","position","bottom","left","right","flexDirection","justifyContent","alignItems","marginHorizontal","borderRadius"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AACA,SACEC,UADF,EAEEC,IAFF,EAGEC,UAHF,EAIEC,UAJF,QAOO,cAPP;AAQA,OAAOC,KAAP,MAAkB,SAAlB;AAEA,MAAMC,WAAW,GAAGF,UAAU,CAACG,GAAX,CAAe,QAAf,EAAyBC,KAA7C;;AASA,SAASC,KAAT,OAQG;AAA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;AALX;AAbuB,CAAlB,CAAf;AAsBA,eAAexB,SAAS,CAAC0B,QAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport {\n ScrollView,\n View,\n StyleSheet,\n Dimensions,\n StyleProp,\n ViewStyle,\n} from \"react-native\";\nimport Image from \"./Image\";\n\nconst screenWidth = Dimensions.get(\"window\").width;\n\ntype Props = {\n data?: any[];\n children?: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n dotColor?: string;\n};\n\nfunction Pager({\n color,\n index,\n length,\n}: {\n color: string;\n index: number;\n length: number;\n}) {\n return (\n <View style={styles.pager}>\n {Array.from({ length }).map((_, i) => {\n const current = index === i;\n const opacity = current ? 1 : 0.5;\n const size = current ? 10 : 8;\n return (\n <View\n key={i}\n style={[\n styles.bullet,\n { backgroundColor: color, opacity, width: size, height: size },\n ]}\n />\n );\n })}\n </View>\n );\n}\n\nfunction Carousel({\n data,\n children,\n dotColor = \"strong\",\n style,\n ...rest\n}: Props) {\n const [index, setIndex] = React.useState(0);\n\n const length = React.Children.count(children);\n const itemsLength = (data?.length ?? 0) + length;\n const slides = Array.isArray(data) ? data : [];\n\n const { width, height } = StyleSheet.flatten(style || {});\n const slideWidth = width || screenWidth;\n const slideHeight = height || 250;\n\n return (\n <View style={[styles.container, style]} {...rest}>\n <ScrollView\n pagingEnabled\n horizontal\n decelerationRate=\"fast\"\n scrollEventThrottle={200}\n showsHorizontalScrollIndicator={false}\n onScroll={({ nativeEvent }) => {\n const layoutWidth = nativeEvent.layoutMeasurement.width;\n const offset = nativeEvent.contentOffset.x;\n const currentIndex = Math.ceil(offset / layoutWidth);\n setIndex(currentIndex);\n }}\n >\n {slides.length > 0\n ? slides.map((item, i) => {\n return (\n <Image\n key={i}\n resizeMode=\"cover\"\n source={typeof item === \"string\" ? { uri: item } : item}\n style={[{ width: slideWidth, height: slideHeight }]}\n />\n );\n })\n : null}\n {React.Children.map(children, (child: any) => {\n const s = child?.props?.style || {};\n return (\n <View style={{ width: slideWidth }}>\n {React.cloneElement(child, {\n style: { ...s, width: slideWidth },\n })}\n </View>\n );\n })}\n </ScrollView>\n <Pager color={dotColor} index={index} length={itemsLength} />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"#eee\",\n },\n pager: {\n position: \"absolute\",\n bottom: 12,\n left: 0,\n right: 0,\n flexDirection: \"row\",\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n bullet: {\n marginHorizontal: 2,\n width: 10,\n height: 10,\n borderRadius: 20,\n backgroundColor: \"#000\",\n },\n});\n\nexport default withTheme(Carousel);\n"]}
1
+ {"version":3,"sources":["Carousel.tsx"],"names":["React","withTheme","ScrollView","View","StyleSheet","Dimensions","Image","screenWidth","get","width","Pager","color","index","length","styles","pager","Array","from","map","_","i","current","opacity","size","bullet","backgroundColor","height","Carousel","data","children","dotColor","style","rest","setIndex","useState","Children","count","itemsLength","slides","isArray","flatten","slideWidth","slideHeight","container","nativeEvent","layoutWidth","layoutMeasurement","offset","contentOffset","x","currentIndex","Math","ceil","item","uri","child","s","props","cloneElement","create","position","bottom","left","right","flexDirection","justifyContent","alignItems","marginHorizontal","borderRadius"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AACA,SACEC,UADF,EAEEC,IAFF,EAGEC,UAHF,EAIEC,UAJF,QAOO,cAPP;AAQA,OAAOC,KAAP,MAAkB,SAAlB;AAEA,MAAMC,WAAW,GAAGF,UAAU,CAACG,GAAX,CAAe,QAAf,EAAyBC,KAA7C;;AASA,SAASC,KAAT,OAQG;AAAA,MARY;AACbC,IAAAA,KADa;AAEbC,IAAAA,KAFa;AAGbC,IAAAA;AAHa,GAQZ;AACD,sBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,KACGC,KAAK,CAACC,IAAN,CAAW;AAAEJ,IAAAA;AAAF,GAAX,EAAuBK,GAAvB,C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\nimport {\n ScrollView,\n View,\n StyleSheet,\n Dimensions,\n StyleProp,\n ViewStyle,\n} from \"react-native\";\nimport Image from \"./Image\";\n\nconst screenWidth = Dimensions.get(\"window\").width;\n\ntype Props = {\n data?: any[];\n children?: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n dotColor?: string;\n};\n\nfunction Pager({\n color,\n index,\n length,\n}: {\n color: string;\n index: number;\n length: number;\n}) {\n return (\n <View style={styles.pager}>\n {Array.from({ length }).map((_, i) => {\n const current = index === i;\n const opacity = current ? 1 : 0.5;\n const size = current ? 10 : 8;\n return (\n <View\n key={i}\n style={[\n styles.bullet,\n { backgroundColor: color, opacity, width: size, height: size },\n ]}\n />\n );\n })}\n </View>\n );\n}\n\nfunction Carousel({\n data,\n children,\n dotColor = \"strong\",\n style,\n ...rest\n}: Props) {\n const [index, setIndex] = React.useState(0);\n\n const length = React.Children.count(children);\n const itemsLength = (data?.length ?? 0) + length;\n const slides = Array.isArray(data) ? data : [];\n\n const { width, height } = StyleSheet.flatten(style || {});\n const slideWidth = width || screenWidth;\n const slideHeight = height || 250;\n\n return (\n <View style={[styles.container, style]} {...rest}>\n <ScrollView\n pagingEnabled\n horizontal\n decelerationRate=\"fast\"\n scrollEventThrottle={200}\n showsHorizontalScrollIndicator={false}\n onScroll={({ nativeEvent }) => {\n const layoutWidth = nativeEvent.layoutMeasurement.width;\n const offset = nativeEvent.contentOffset.x;\n const currentIndex = Math.ceil(offset / layoutWidth);\n setIndex(currentIndex);\n }}\n >\n {slides.length > 0\n ? slides.map((item, i) => {\n return (\n <Image\n key={i}\n resizeMode=\"cover\"\n source={typeof item === \"string\" ? { uri: item } : item}\n style={[{ width: slideWidth, height: slideHeight }]}\n />\n );\n })\n : null}\n {React.Children.map(children, (child: any) => {\n const s = child?.props?.style || {};\n return (\n <View style={{ width: slideWidth }}>\n {React.cloneElement(child, {\n style: { ...s, width: slideWidth },\n })}\n </View>\n );\n })}\n </ScrollView>\n <Pager color={dotColor} index={index} length={itemsLength} />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n height: 250,\n position: \"relative\",\n width: screenWidth,\n backgroundColor: \"#eee\",\n },\n pager: {\n position: \"absolute\",\n bottom: 12,\n left: 0,\n right: 0,\n flexDirection: \"row\",\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n bullet: {\n marginHorizontal: 2,\n width: 10,\n height: 10,\n borderRadius: 20,\n backgroundColor: \"#000\",\n },\n});\n\nexport default withTheme(Carousel);\n"]}
@@ -1,3 +1,5 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
1
3
  import * as React from "react";
2
4
  import { View, StyleSheet, Pressable } from "react-native";
3
5
  import { withTheme } from "../theming";
@@ -32,10 +34,9 @@ const StarRating = _ref => {
32
34
  !!onPress && onPress(r);
33
35
  }, [onPress]);
34
36
  const ratingRounded = Math.round(localRating * 2) / 2;
35
- return /*#__PURE__*/React.createElement(View, {
36
- style: [styles.container, style],
37
- ...rest
38
- }, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
37
+ return /*#__PURE__*/React.createElement(View, _extends({
38
+ style: [styles.container, style]
39
+ }, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
39
40
  key: i,
40
41
  style: {
41
42
  display: "flex"
@@ -1 +1 @@
1
- {"version":3,"sources":["StarRating.js"],"names":["React","View","StyleSheet","Pressable","withTheme","StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","createElement","styles","container","Array","map","_","i","key","display","name","size","color","touchContainer","pressable","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAA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AAC7BZ,EAAAA,SAAS,EAAE;AACPa,IAAAA,aAAa,EAAE,KADR;AAEPC,IAAAA,UAAU,EAAE;AAFL,GADkB;AAK7BJ,EAAAA,cAAc,EAAE;AACZJ,IAAAA,OAAO,EAAE,MADG;AAEZO,IAAAA,aAAa,EAAE,KAFH;AAGZE,IAAAA,QAAQ,EAAE,UAHE;AAIZC,IAAAA,GAAG,EAAE,CAJO;AAKZC,IAAAA,KAAK,EAAE,CALK;AAMZC,IAAAA,IAAI,EAAE,CANM;AAOZC,IAAAA,MAAM,EAAE,CAPI;AAQZC,IAAAA,MAAM,EAAE;AARI,GALa;AAe7BT,EAAAA,SAAS,EAAE;AACPU,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,MAAM,EAAE,MAFD;AAGPC,IAAAA,KAAK,EAAE;AAHA;AAfkB,CAAlB,CAAf;AAqBA,eAAehD,SAAS,CAACC,UAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet, Pressable, } from \"react-native\";\nimport { withTheme } from \"../theming\";\nconst StarRating = ({ Icon, starSize = 16, maxStars = 5, rating = 0, defaultValue, isEditable = false, activeColor, inactiveColor, style, onPress, ...rest }) => {\n const [localRating, setLocalRating] = React.useState(rating || defaultValue || 0);\n React.useEffect(() => {\n if (rating != null) {\n setLocalRating(rating);\n }\n }, [rating]);\n React.useEffect(() => {\n if (defaultValue != null) {\n setLocalRating(defaultValue);\n }\n }, [defaultValue]);\n const ratingHandler = React.useCallback((r) => {\n setLocalRating(r);\n !!onPress && onPress(r);\n }, [onPress]);\n const ratingRounded = Math.round(localRating * 2) / 2;\n return (React.createElement(View, { style: [styles.container, style], ...rest }, [...Array(maxStars)].map((_, i) => (React.createElement(View, { key: i, style: { display: \"flex\" } },\n React.createElement(Icon, { name: ratingRounded - i === 0.5\n ? \"MaterialIcons/star-half\"\n : \"MaterialIcons/star\", size: starSize, color: ratingRounded > i ? activeColor : inactiveColor }),\n isEditable && (React.createElement(View, { style: styles.touchContainer },\n React.createElement(Pressable, { style: styles.pressable, onPress: () => ratingHandler(i + 0.5) }),\n React.createElement(Pressable, { style: styles.pressable, onPress: () => ratingHandler(i + 1) }))))))));\n};\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n touchContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n position: \"absolute\",\n top: 0,\n right: 0,\n left: 0,\n bottom: 0,\n zIndex: 1,\n },\n pressable: {\n flex: 1,\n height: \"100%\",\n width: \"50%\",\n },\n});\nexport default withTheme(StarRating);\n"]}
1
+ {"version":3,"sources":["StarRating.tsx"],"names":["React","View","StyleSheet","Pressable","withTheme","StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","styles","container","Array","map","_","i","display","touchContainer","pressable","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,IADF,EAEEC,UAFF,EAKEC,SALF,QAMO,cANP;AAOA,SAASC,SAAT,QAA0B,YAA1B;;AAiBA,MAAMC,UAA2B,GAAG,QAY9B;AAAA,MAZ+B;AACnCC,IAAAA,IADmC;AAEnCC,IAAAA,QAAQ,GAAG,EAFwB;AAGnCC,IAAAA,QAAQ,GAAG,CAHwB;AAInCC,IAAAA,MAAM,GAAG,CAJ0B;AAKnCC,IAAAA,YALmC;AAMnCC,IAAAA,UAAU,GAAG,KANsB;AAOnCC,IAAAA,WAPmC;AAQnCC,IAAAA,aARmC;AASnCC,IAAAA,KATmC;AAUnCC,IAAAA,OAVmC;AAWnC,OAAGC;AAXgC,GAY/B;AACJ,QAAM,CAACC,WAAD,EAAcC,cAAd,IAAgClB,KAAK,CAACmB,QAAN,CACpCV,MAAM,IAAIC,YAAV,IAA0B,CADU,CAAtC;AAIAV,EAAAA,KAAK,CAACoB,SA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K,EAAEP,MAAM,CAACQ,SADhB;AAEE,IAAA,OAAO,EAAE,MAAMd,aAAa,CAACW,CAAC,GAAG,GAAL;AAF9B,IADF,eAKE,oBAAC,SAAD;AACE,IAAA,KAAK,EAAEL,MAAM,CAACQ,SADhB;AAEE,IAAA,OAAO,EAAE,MAAMd,aAAa,CAACW,CAAC,GAAG,CAAL;AAF9B,IALF,CAXJ,CADD,CADH,CADF;AA6BD,CApED;;AAsEA,MAAML,MAAM,GAAGzB,UAAU,CAACkC,MAAX,CAAkB;AAC/BR,EAAAA,SAAS,EAAE;AACTS,IAAAA,aAAa,EAAE,KADN;AAETC,IAAAA,UAAU,EAAE;AAFH,GADoB;AAK/BJ,EAAAA,cAAc,EAAE;AACdD,IAAAA,OAAO,EAAE,MADK;AAEdI,IAAAA,aAAa,EAAE,KAFD;AAGdE,IAAAA,QAAQ,EAAE,UAHI;AAIdC,IAAAA,GAAG,EAAE,CAJS;AAKdC,IAAAA,KAAK,EAAE,CALO;AAMdC,IAAAA,IAAI,EAAE,CANQ;AAOdC,IAAAA,MAAM,EAAE,CAPM;AAQdC,IAAAA,MAAM,EAAE;AARM,GALe;AAe/BT,EAAAA,SAAS,EAAE;AACTU,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,MAAM,EAAE,MAFC;AAGTC,IAAAA,KAAK,EAAE;AAHE;AAfoB,CAAlB,CAAf;AAsBA,eAAe3C,SAAS,CAACC,UAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport {\n View,\n StyleSheet,\n StyleProp,\n ViewStyle,\n Pressable,\n} from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n starSize?: number;\n maxStars?: number;\n rating?: number;\n defaultValue?: number;\n isEditable?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n onPress?: (newValue: number) => void;\n} & IconSlot;\n\nconst StarRating: React.FC<Props> = ({\n Icon,\n starSize = 16,\n maxStars = 5,\n rating = 0,\n defaultValue,\n isEditable = false,\n activeColor,\n inactiveColor,\n style,\n onPress,\n ...rest\n}) => {\n const [localRating, setLocalRating] = React.useState<number>(\n rating || defaultValue || 0\n );\n\n React.useEffect(() => {\n if (rating != null) {\n setLocalRating(rating);\n }\n }, [rating]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setLocalRating(defaultValue);\n }\n }, [defaultValue]);\n\n const ratingHandler = React.useCallback(\n (r) => {\n setLocalRating(r);\n !!onPress && onPress(r);\n },\n [onPress]\n );\n\n const ratingRounded = Math.round(localRating * 2) / 2;\n\n return (\n <View style={[styles.container, style]} {...rest}>\n {[...Array(maxStars)].map((_, i) => (\n <View key={i} style={{ display: \"flex\" }}>\n <Icon\n name={\n ratingRounded - i === 0.5\n ? \"MaterialIcons/star-half\"\n : \"MaterialIcons/star\"\n }\n size={starSize}\n color={ratingRounded > i ? activeColor : inactiveColor}\n />\n {isEditable && (\n <View style={styles.touchContainer}>\n <Pressable\n style={styles.pressable}\n onPress={() => ratingHandler(i + 0.5)}\n />\n <Pressable\n style={styles.pressable}\n onPress={() => ratingHandler(i + 1)}\n />\n </View>\n )}\n </View>\n ))}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n touchContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n position: \"absolute\",\n top: 0,\n right: 0,\n left: 0,\n bottom: 0,\n zIndex: 1,\n },\n pressable: {\n flex: 1,\n height: \"100%\",\n width: \"50%\",\n },\n});\n\nexport default withTheme(StarRating);\n"]}
@@ -38,8 +38,8 @@ const ToggleButton = _ref => {
38
38
  }, [defaultValue]);
39
39
 
40
40
  const handlePress = () => {
41
- setInternalValue(!toggled);
42
- onPress(!toggled);
41
+ setInternalValue(!internalValue);
42
+ onPress(!internalValue);
43
43
  };
44
44
 
45
45
  return /*#__PURE__*/React.createElement(IconButton, _extends({
@@ -52,7 +52,7 @@ const ToggleButton = _ref => {
52
52
  style: [styles.mainContainer, {
53
53
  width,
54
54
  height,
55
- backgroundColor: toggled ? colors[colorSecondary] : colors[color],
55
+ backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
56
56
  borderColor: colors[borderColor]
57
57
  }, style]
58
58
  }, rest));
@@ -1 +1 @@
1
- {"version":3,"sources":["ToggleButton.tsx"],"names":["React","withTheme","StyleSheet","IconButton","ToggleButton","Icon","icon","toggled","onPress","defaultValue","disabled","color","colorSecondary","borderColor","iconSize","width","height","theme","colors","style","rest","internalValue","setInternalValue","useState","useEffect","handlePress","styles","mainContainer","backgroundColor","create","borderWidth"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AAEA,SAAoBC,UAApB,QAAiD,cAAjD;AACA,OAAOC,UAAP,MAAuB,cAAvB;;AAoBA,MAAMC,YAA6B,GAAG,QAgBhC;AAAA,MAhBiC;AACrCC,IAAAA,IADqC;AAErCC,IAAAA,IAFqC;AAGrCC,IAAAA,OAAO,GAAG,KAH2B;AAIrCC,IAAAA,OAAO,GAAG,MAAM,CAAE,CAJmB;AAKrCC,IAAAA,YALqC;AAMrCC,IAAAA,QAAQ,GAAG,KAN0B;AAOrCC,IAAAA,KAAK,GAAG,SAP6B;AAQrCC,IAAAA,cAAc,GAAG,SARoB;AASrCC,IAAAA,WAAW,GAAG,SATuB;AAUrCC,IAAAA,QAAQ,GAAG,EAV0B;AAWrCC,IAAAA,KAAK,GAAG,EAX6B;AAYrCC,IAAAA,MAAM,GAAG,EAZ4B;AAarCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA;AAAF,KAb8B;AAcrCC,IAAAA,KAdqC;AAerC,OAAGC;AAfkC,GAgBjC;AACJ,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCtB,KAAK,CAACuB,QAAN,CACxChB,OAAO,IAAIE,YAAX,IAA2B,KADa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AxB","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport { colorTypes } from \"@draftbit/types\";\nimport { StyleProp, StyleSheet, ViewStyle } from \"react-native\";\nimport IconButton from \"./IconButton\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n icon: string;\n toggled?: boolean;\n onPress?: (value: boolean) => void;\n defaultValue?: boolean;\n disabled?: boolean;\n color?: colorTypes;\n colorSecondary?: colorTypes;\n borderColor?: colorTypes;\n iconSize?: number;\n width?: number;\n height?: number;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst ToggleButton: React.FC<Props> = ({\n Icon,\n icon,\n toggled = false,\n onPress = () => {},\n defaultValue,\n disabled = false,\n color = \"primary\",\n colorSecondary = \"surface\",\n borderColor = \"divider\",\n iconSize = 25,\n width = 50,\n height = 50,\n theme: { colors },\n style,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<boolean>(\n toggled || defaultValue || false\n );\n\n React.useEffect(() => {\n if (toggled != null) {\n setInternalValue(toggled);\n }\n }, [toggled]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handlePress = () => {\n setInternalValue(!toggled);\n onPress(!toggled);\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={icon}\n size={iconSize}\n color={internalValue ? colors[color] : colors[colorSecondary]}\n onPress={handlePress}\n disabled={disabled}\n style={[\n styles.mainContainer,\n {\n width,\n height,\n backgroundColor: toggled ? colors[colorSecondary] : colors[color],\n borderColor: colors[borderColor],\n },\n style,\n ]}\n {...rest}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n mainContainer: {\n borderWidth: 1,\n },\n});\n\nexport default withTheme(ToggleButton);\n"]}
1
+ {"version":3,"sources":["ToggleButton.tsx"],"names":["React","withTheme","StyleSheet","IconButton","ToggleButton","Icon","icon","toggled","onPress","defaultValue","disabled","color","colorSecondary","borderColor","iconSize","width","height","theme","colors","style","rest","internalValue","setInternalValue","useState","useEffect","handlePress","styles","mainContainer","backgroundColor","create","borderWidth"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AAEA,SAAoBC,UAApB,QAAiD,cAAjD;AACA,OAAOC,UAAP,MAAuB,cAAvB;;AAoBA,MAAMC,YAA6B,GAAG,QAgBhC;AAAA,MAhBiC;AACrCC,IAAAA,IADqC;AAErCC,IAAAA,IAFqC;AAGrCC,IAAAA,OAAO,GAAG,KAH2B;AAIrCC,IAAAA,OAAO,GAAG,MAAM,CAAE,CAJmB;AAKrCC,IAAAA,YALqC;AAMrCC,IAAAA,QAAQ,GAAG,KAN0B;AAOrCC,IAAAA,KAAK,GAAG,SAP6B;AAQrCC,IAAAA,cAAc,GAAG,SARoB;AASrCC,IAAAA,WAAW,GAAG,SATuB;AAUrCC,IAAAA,QAAQ,GAAG,EAV0B;AAWrCC,IAAAA,KAAK,GAAG,EAX6B;AAYrCC,IAAAA,MAAM,GAAG,EAZ4B;AAarCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA;AAAF,KAb8B;AAcrCC,IAAAA,KAdqC;AAerC,OAAGC;AAfkC,GAgBjC;AACJ,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCtB,KAAK,CAACuB,QAAN,CACxChB,OAAO,IAAIE,YAAX,IAA2B,KADa,CAA1C;AAIAT,EAAAA,KAAK,CAACwB,SAAN,CAAgB,MAAM;AACpB,QAAIjB,OAAO,IAAI,IAAf,EAAqB;AACnBe,MAAAA,gBAAgB,CAACf,OAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,OAAD,CAJH;AAMAP,EAAAA,KAAK,CAACwB,SAAN,CAAgB,MAAM;AACpB,QAAIf,YAAY,IAAI,IAApB,EAA0B;AACxBa,MAAAA,gBAAgB,CAACb,YAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,YAAD,CAJH;;AAMA,QAAMgB,WAAW,GAAG,MAAM;AACxBH,IAAAA,gBAAgB,CAAC,CAACD,aAAF,CAAhB;AACAb,IAAAA,OAAO,CAAC,CAACa,aAAF,CAAP;AACD,GAHD;;AAKA,sBACE,oBAAC,UAAD;AACE,IAAA,IAAI,EAAEhB,IADR;AAEE,IAAA,IAAI,EAAEC,IAFR;AAGE,IAAA,IAAI,EAAEQ,QAHR;AAIE,IAAA,KAAK,EAAEO,aAAa,GAAGH,MAAM,CAACP,KAAD,CAAT,GAAmBO,MAAM,CAACN,cAAD,CAJ/C;AAKE,IAAA,OAAO,EAAEa,WALX;AAME,IAAA,QAAQ,EAAEf,QANZ;AAOE,IAAA,KAAK,EAAE,CACLgB,MAAM,CAACC,aADF,EAEL;AACEZ,MAAAA,KADF;AAEEC,MAAAA,MAFF;AAGEY,MAAAA,eAAe,EAAEP,aAAa,GAC1BH,MAAM,CAACN,cAAD,CADoB,GAE1BM,MAAM,CAACP,KAAD,CALZ;AAMEE,MAAAA,WAAW,EAAEK,MAAM,CAACL,WAAD;AANrB,KAFK,EAULM,KAVK;AAPT,KAmBMC,IAnBN,EADF;AAuBD,CA7DD;;AA+DA,MAAMM,MAAM,GAAGxB,UAAU,CAAC2B,MAAX,CAAkB;AAC/BF,EAAAA,aAAa,EAAE;AACbG,IAAAA,WAAW,EAAE;AADA;AADgB,CAAlB,CAAf;AAMA,eAAe7B,SAAS,CAACG,YAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport { colorTypes } from \"@draftbit/types\";\nimport { StyleProp, StyleSheet, ViewStyle } from \"react-native\";\nimport IconButton from \"./IconButton\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n icon: string;\n toggled?: boolean;\n onPress?: (value: boolean) => void;\n defaultValue?: boolean;\n disabled?: boolean;\n color?: colorTypes;\n colorSecondary?: colorTypes;\n borderColor?: colorTypes;\n iconSize?: number;\n width?: number;\n height?: number;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst ToggleButton: React.FC<Props> = ({\n Icon,\n icon,\n toggled = false,\n onPress = () => {},\n defaultValue,\n disabled = false,\n color = \"primary\",\n colorSecondary = \"surface\",\n borderColor = \"divider\",\n iconSize = 25,\n width = 50,\n height = 50,\n theme: { colors },\n style,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<boolean>(\n toggled || defaultValue || false\n );\n\n React.useEffect(() => {\n if (toggled != null) {\n setInternalValue(toggled);\n }\n }, [toggled]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handlePress = () => {\n setInternalValue(!internalValue);\n onPress(!internalValue);\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={icon}\n size={iconSize}\n color={internalValue ? colors[color] : colors[colorSecondary]}\n onPress={handlePress}\n disabled={disabled}\n style={[\n styles.mainContainer,\n {\n width,\n height,\n backgroundColor: internalValue\n ? colors[colorSecondary]\n : colors[color],\n borderColor: colors[borderColor],\n },\n style,\n ]}\n {...rest}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n mainContainer: {\n borderWidth: 1,\n },\n});\n\nexport default withTheme(ToggleButton);\n"]}
@@ -4,9 +4,7 @@ export const SEED_DATA = [{
4
4
  tag: "Carousel",
5
5
  category: COMPONENT_TYPES.media,
6
6
  description: "A horizontal scrolling carousel of images",
7
- layout: {
8
- height: 250
9
- },
7
+ layout: {},
10
8
  props: {
11
9
  resizeMode: createResizeModeProp(),
12
10
  dotColor: createColorProp({
@@ -1 +1 @@
1
- {"version":3,"sources":["Carousel.ts"],"names":["COMPONENT_TYPES","createResizeModeProp","createColorProp","SEED_DATA","name","tag","category","media","description","layout","height","props","resizeMode","dotColor","label"],"mappings":"AAAA,SACEA,eADF,EAEEC,oBAFF,EAGEC,eAHF,QAIO,iBAJP;AAMA,OAAO,MAAMC,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,UADR;AAEEC,EAAAA,GAAG,EAAE,UAFP;AAGEC,EAAAA,QAAQ,EAAEN,eAAe,CAACO,KAH5B;AAIEC,EAAAA,WAAW,EAAE,2CAJf;AAKEC,EAAAA,MAAM,EAAE;AACNC,IAAAA,MAAM,EAAE;AADF,GALV;AAQEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAEX,oBAAoB,EAD3B;AAELY,IAAAA,QAAQ,EAAEX,eAAe,CAAC;AACxBY,MAAAA,KAAK,EAAE;AADiB,KAAD;AAFpB;AART,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createResizeModeProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Carousel\",\n tag: \"Carousel\",\n category: COMPONENT_TYPES.media,\n description: \"A horizontal scrolling carousel of images\",\n layout: {\n height: 250,\n },\n props: {\n resizeMode: createResizeModeProp(),\n dotColor: createColorProp({\n label: \"Dot color\",\n }),\n },\n },\n];\n"]}
1
+ {"version":3,"sources":["Carousel.ts"],"names":["COMPONENT_TYPES","createResizeModeProp","createColorProp","SEED_DATA","name","tag","category","media","description","layout","props","resizeMode","dotColor","label"],"mappings":"AAAA,SACEA,eADF,EAEEC,oBAFF,EAGEC,eAHF,QAIO,iBAJP;AAMA,OAAO,MAAMC,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,UADR;AAEEC,EAAAA,GAAG,EAAE,UAFP;AAGEC,EAAAA,QAAQ,EAAEN,eAAe,CAACO,KAH5B;AAIEC,EAAAA,WAAW,EAAE,2CAJf;AAKEC,EAAAA,MAAM,EAAE,EALV;AAMEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAEV,oBAAoB,EAD3B;AAELW,IAAAA,QAAQ,EAAEV,eAAe,CAAC;AACxBW,MAAAA,KAAK,EAAE;AADiB,KAAD;AAFpB;AANT,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createResizeModeProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Carousel\",\n tag: \"Carousel\",\n category: COMPONENT_TYPES.media,\n description: \"A horizontal scrolling carousel of images\",\n layout: {},\n props: {\n resizeMode: createResizeModeProp(),\n dotColor: createColorProp({\n label: \"Dot color\",\n }),\n },\n },\n];\n"]}
@@ -3,9 +3,7 @@ export declare const SEED_DATA: {
3
3
  tag: string;
4
4
  category: string;
5
5
  description: string;
6
- layout: {
7
- height: number;
8
- };
6
+ layout: {};
9
7
  props: {
10
8
  resizeMode: {
11
9
  group: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "43.2.5-1c4256.0+1c4256f2",
3
+ "version": "43.2.5-4ece9c.0+4ece9c37",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -79,5 +79,5 @@
79
79
  ]
80
80
  ]
81
81
  },
82
- "gitHead": "1c4256f227d245b6fdd1604d297747bd8dd50700"
82
+ "gitHead": "4ece9c37d903c96c2a09b1bf4b52e6f397fe8745"
83
83
  }
@@ -44,6 +44,9 @@ function Carousel({ data, children, dotColor = "strong", style, ...rest }) {
44
44
  }
45
45
  const styles = StyleSheet.create({
46
46
  container: {
47
+ height: 250,
48
+ position: "relative",
49
+ width: screenWidth,
47
50
  backgroundColor: "#eee",
48
51
  },
49
52
  pager: {
@@ -110,6 +110,9 @@ function Carousel({
110
110
 
111
111
  const styles = StyleSheet.create({
112
112
  container: {
113
+ height: 250,
114
+ position: "relative",
115
+ width: screenWidth,
113
116
  backgroundColor: "#eee",
114
117
  },
115
118
  pager: {
@@ -15,15 +15,17 @@ const ToggleButton = ({ Icon, icon, toggled = false, onPress = () => { }, defaul
15
15
  }
16
16
  }, [defaultValue]);
17
17
  const handlePress = () => {
18
- setInternalValue(!toggled);
19
- onPress(!toggled);
18
+ setInternalValue(!internalValue);
19
+ onPress(!internalValue);
20
20
  };
21
21
  return (React.createElement(IconButton, { Icon: Icon, icon: icon, size: iconSize, color: internalValue ? colors[color] : colors[colorSecondary], onPress: handlePress, disabled: disabled, style: [
22
22
  styles.mainContainer,
23
23
  {
24
24
  width,
25
25
  height,
26
- backgroundColor: toggled ? colors[colorSecondary] : colors[color],
26
+ backgroundColor: internalValue
27
+ ? colors[colorSecondary]
28
+ : colors[color],
27
29
  borderColor: colors[borderColor],
28
30
  },
29
31
  style,
@@ -56,8 +56,8 @@ const ToggleButton: React.FC<Props> = ({
56
56
  }, [defaultValue]);
57
57
 
58
58
  const handlePress = () => {
59
- setInternalValue(!toggled);
60
- onPress(!toggled);
59
+ setInternalValue(!internalValue);
60
+ onPress(!internalValue);
61
61
  };
62
62
 
63
63
  return (
@@ -73,7 +73,9 @@ const ToggleButton: React.FC<Props> = ({
73
73
  {
74
74
  width,
75
75
  height,
76
- backgroundColor: toggled ? colors[colorSecondary] : colors[color],
76
+ backgroundColor: internalValue
77
+ ? colors[colorSecondary]
78
+ : colors[color],
77
79
  borderColor: colors[borderColor],
78
80
  },
79
81
  style,
@@ -5,9 +5,7 @@ export const SEED_DATA = [
5
5
  tag: "Carousel",
6
6
  category: COMPONENT_TYPES.media,
7
7
  description: "A horizontal scrolling carousel of images",
8
- layout: {
9
- height: 250,
10
- },
8
+ layout: {},
11
9
  props: {
12
10
  resizeMode: createResizeModeProp(),
13
11
  dotColor: createColorProp({
@@ -10,9 +10,7 @@ export const SEED_DATA = [
10
10
  tag: "Carousel",
11
11
  category: COMPONENT_TYPES.media,
12
12
  description: "A horizontal scrolling carousel of images",
13
- layout: {
14
- height: 250,
15
- },
13
+ layout: {},
16
14
  props: {
17
15
  resizeMode: createResizeModeProp(),
18
16
  dotColor: createColorProp({