@draftbit/core 43.3.0 → 43.3.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.
Files changed (37) hide show
  1. package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js.map +1 -1
  2. package/lib/commonjs/components/DeprecatedFAB.js +20 -4
  3. package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
  4. package/lib/commonjs/components/Elevation.js +3 -14
  5. package/lib/commonjs/components/Elevation.js.map +1 -1
  6. package/lib/commonjs/components/ToggleButton.js +86 -0
  7. package/lib/commonjs/components/ToggleButton.js.map +1 -0
  8. package/lib/commonjs/index.js +8 -0
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/mappings/ActionSheet.js.map +1 -1
  11. package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
  12. package/lib/commonjs/mappings/ToggleButton.js +60 -0
  13. package/lib/commonjs/mappings/ToggleButton.js.map +1 -0
  14. package/lib/commonjs/mappings/Touchable.js.map +1 -1
  15. package/lib/commonjs/mappings/Video.js.map +1 -1
  16. package/lib/commonjs/mappings/WebView.js.map +1 -1
  17. package/lib/module/components/Picker/PickerComponent.android.js +10 -7
  18. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
  19. package/lib/module/components/ToggleButton.js +67 -0
  20. package/lib/module/components/ToggleButton.js.map +1 -0
  21. package/lib/module/components/Touchable.js +16 -3
  22. package/lib/module/components/Touchable.js.map +1 -1
  23. package/lib/module/index.js +1 -0
  24. package/lib/module/index.js.map +1 -1
  25. package/lib/module/mappings/CardBlock.js.map +1 -1
  26. package/lib/module/mappings/ToggleButton.js +51 -0
  27. package/lib/module/mappings/ToggleButton.js.map +1 -0
  28. package/lib/typescript/src/components/ToggleButton.d.ts +24 -0
  29. package/lib/typescript/src/index.d.ts +1 -0
  30. package/lib/typescript/src/mappings/ToggleButton.d.ts +124 -0
  31. package/package.json +2 -2
  32. package/src/components/ToggleButton.js +39 -0
  33. package/src/components/ToggleButton.tsx +94 -0
  34. package/src/index.js +1 -0
  35. package/src/index.tsx +1 -0
  36. package/src/mappings/ToggleButton.js +50 -0
  37. package/src/mappings/ToggleButton.ts +62 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["ActionSheetCancel.tsx"],"names":["ActionSheetCancel","label","color","style","onPress"],"mappings":";;;;;;;AAAA;;AAEA;;;;AASA,MAAMA,iBAAkC,GAAG,QAKrC;AAAA,MALsC;AAC1CC,IAAAA,KAAK,GAAG,QADkC;AAE1CC,IAAAA,KAF0C;AAG1CC,IAAAA,KAH0C;AAI1CC,IAAAA;AAJ0C,GAKtC;AACJ,sBACE,6BAAC,wBAAD;AACE,IAAA,KAAK,EAAEH,KADT;AAEE,IAAA,KAAK,EAAEC,KAAK,IAAI,SAFlB;AAGE,IAAA,KAAK,EAAE,CAACC,KAAD,CAHT;AAIE,IAAA,OAAO,EAAEC;AAJX,IADF;AAQD,CAdD;;eAgBeJ,iB","sourcesContent":["import React from \"react\";\nimport { StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport ActionSheetItem from \"./ActionSheetItem\";\n\ntype Props = {\n label: string;\n color: string;\n style?: StyleProp<ViewStyle | TextStyle>;\n onPress?: () => void;\n};\n\nconst ActionSheetCancel: React.FC<Props> = ({\n label = \"Cancel\",\n color,\n style,\n onPress,\n}) => {\n return (\n <ActionSheetItem\n label={label}\n color={color || \"#FF453A\"}\n style={[style]}\n onPress={onPress}\n />\n );\n};\n\nexport default ActionSheetCancel;\n"]}
1
+ {"version":3,"sources":["ActionSheetCancel.js"],"names":["ActionSheetCancel","label","color","style","onPress","React","createElement","ActionSheetItem"],"mappings":";;;;;;;AAAA;;AACA;;;;AACA,MAAMA,iBAAiB,GAAG,QAAkD;AAAA,MAAjD;AAAEC,IAAAA,KAAK,GAAG,QAAV;AAAoBC,IAAAA,KAApB;AAA2BC,IAAAA,KAA3B;AAAkCC,IAAAA;AAAlC,GAAiD;AACxE,sBAAQC,eAAMC,aAAN,CAAoBC,wBAApB,EAAqC;AAAEN,IAAAA,KAAK,EAAEA,KAAT;AAAgBC,IAAAA,KAAK,EAAEA,KAAK,IAAI,SAAhC;AAA2CC,IAAAA,KAAK,EAAE,CAACA,KAAD,CAAlD;AAA2DC,IAAAA,OAAO,EAAEA;AAApE,GAArC,CAAR;AACH,CAFD;;eAGeJ,iB","sourcesContent":["import React from \"react\";\nimport ActionSheetItem from \"./ActionSheetItem\";\nconst ActionSheetCancel = ({ label = \"Cancel\", color, style, onPress, }) => {\n return (React.createElement(ActionSheetItem, { label: label, color: color || \"#FF453A\", style: [style], onPress: onPress }));\n};\nexport default ActionSheetCancel;\n"]}
@@ -27,8 +27,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  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; }
29
29
 
30
- 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); }
31
-
32
30
  const FAB = _ref => {
33
31
  let {
34
32
  Icon,
@@ -130,7 +128,7 @@ const FAB = _ref => {
130
128
  style: [{
131
129
  elevation
132
130
  }, style]
133
- }, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
131
+ }, /*#__PURE__*/React.createElement(_Touchable.default, { ...rest,
134
132
  onPress: onPress,
135
133
  accessibilityState: {
136
134
  disabled
@@ -138,7 +136,7 @@ const FAB = _ref => {
138
136
  accessibilityRole: "button",
139
137
  disabled: disabled || loading,
140
138
  style: buttonStyles
141
- }), /*#__PURE__*/React.createElement(_reactNative.View, {
139
+ }, /*#__PURE__*/React.createElement(_reactNative.View, {
142
140
  style: styles.content
143
141
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
144
142
  style: iconStyle
@@ -181,5 +179,23 @@ const styles = _reactNative.StyleSheet.create({
181
179
 
182
180
  var _default = (0, _theming.withTheme)(FAB);
183
181
 
182
+ exports.default = _default;
183
+ //# sourceMappingURL=DeprecatedFAB.js.map },
184
+ icon: {
185
+ alignItems: "center",
186
+ justifyContent: "center",
187
+ width: _Config.default.buttonIconSize
188
+ },
189
+ fixed: {
190
+ left: 0,
191
+ right: 0,
192
+ bottom: 0,
193
+ height: 64,
194
+ borderRadius: 0
195
+ }
196
+ });
197
+
198
+ var _default = (0, _theming.withTheme)(FAB);
199
+
184
200
  exports.default = _default;
185
201
  //# sourceMappingURL=DeprecatedFAB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["DeprecatedFAB.tsx"],"names":["FAB","Icon","icon","disabled","type","loading","color","colorOverride","label","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","alignItems","justifyContent","buttonStyles","styles","button","contentStyle","content","textStyle","textAlign","iconStyle","width","Config","buttonIconSize","FABSize","height","FABBorderRadius","push","marginLeft","marginRight","margin","FABFixedHeight","alignSelf","create","borderStyle","flexDirection","fixed","left","right","bottom"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAuDA,MAAMA,GAAoB,GAAG,QAavB;AAAA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ArB;AAAwB,IAAA,KAAK,EAAE,CAAC+B,SAAD,EAAYvB,UAAU,CAACoB,MAAvB;AAA/B,KACG5B,KADH,CADI,GAIF,IArBN,CARF,CADF,CADF;AAoCD,CAvID;;AAyIA,MAAM2B,MAAM,GAAGP,wBAAW0B,MAAX,CAAkB;AAC/BlB,EAAAA,MAAM,EAAE;AACNmB,IAAAA,WAAW,EAAE;AADP,GADuB;AAI/BjB,EAAAA,OAAO,EAAE;AACPkB,IAAAA,aAAa,EAAE,KADR;AAEPxB,IAAAA,UAAU,EAAE,QAFL;AAGPC,IAAAA,cAAc,EAAE;AAHT,GAJsB;AAS/B/B,EAAAA,IAAI,EAAE;AACJ8B,IAAAA,UAAU,EAAE,QADR;AAEJC,IAAAA,cAAc,EAAE,QAFZ;AAGJS,IAAAA,KAAK,EAAEC,gBAAOC;AAHV,GATyB;AAc/Ba,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,CADD;AAELC,IAAAA,KAAK,EAAE,CAFF;AAGLC,IAAAA,MAAM,EAAE,CAHH;AAILd,IAAAA,MAAM,EAAE,EAJH;AAKLf,IAAAA,YAAY,EAAE;AALT;AAdwB,CAAlB,CAAf;;eAuBe,wBAAU/B,GAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n ActivityIndicator,\n View,\n StyleSheet,\n TouchableHighlightProps,\n StyleProp,\n ViewStyle,\n TextStyle,\n} from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Text from \"./Text\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\n\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\n/**\n * A floating action button represents the primary action in an application.\n *\n * <div class=\"screenshots\">\n * <img src=\"screenshots/fab-1.png\" />\n * <img src=\"screenshots/fab-2.png\" />\n * </div>\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { StyleSheet } from 'react-native';\n * import { FAB } from '@draftbit/ui';\n *\n * const MyComponent = () => (\n * <FAB\n * style={styles.fab}\n * type=\"outline\"\n * icon=\"add\"\n * onPress={() => console.log('Pressed')}\n * />\n * );\n *\n * const styles = StyleSheet.create({\n * fab: {\n * position: 'absolute',\n * margin: 16,\n * right: 0,\n * bottom: 0,\n * },\n * })\n *\n * export default MyComponent;\n * ```\n */\n\ntype Props = {\n disabled?: boolean;\n type?: \"solid\" | \"extended\" | \"outline\" | \"fixed\" | \"standard\";\n loading?: boolean;\n icon?: string;\n color?: string;\n label?: string;\n onPress: () => void;\n elevation?: number;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n} & TouchableHighlightProps &\n IconSlot;\n\nconst FAB: React.FC<Props> = ({\n Icon,\n icon,\n disabled = false,\n type = \"solid\",\n loading = false,\n color: colorOverride,\n label,\n onPress,\n elevation = 0,\n style,\n theme: { colors, disabledOpacity, roundness, typography },\n ...rest\n}) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n\n if (type === \"standard\" || type === \"extended\" || type === \"fixed\") {\n backgroundColor = buttonColor;\n\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = colors.surface;\n }\n } else {\n backgroundColor = \"transparent\";\n\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n textColor = buttonColor;\n }\n }\n\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n } else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n } else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n\n const buttonStyle: StyleProp<ViewStyle> = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n const buttonStyles: StyleProp<ViewStyle>[] = [styles.button, buttonStyle];\n\n const contentStyle: StyleProp<ViewStyle>[] = [styles.content];\n\n const textStyle: StyleProp<TextStyle> = {\n textAlign: \"center\",\n color: textColor,\n };\n\n const iconStyle: StyleProp<ViewStyle>[] = [\n styles.icon,\n {\n width: Config.buttonIconSize,\n },\n ];\n\n if (type === \"standard\" || type === \"outline\") {\n buttonStyle.width = Config.FABSize;\n buttonStyle.height = Config.FABSize;\n buttonStyle.borderRadius = Config.FABBorderRadius;\n\n contentStyle.push({\n width: Config.FABSize,\n height: Config.FABSize,\n });\n }\n\n if (type === \"extended\" || type === \"fixed\") {\n iconStyle.push({\n marginLeft: 16,\n marginRight: -8,\n });\n\n textStyle.margin = 16;\n }\n\n if (type === \"fixed\") {\n buttonStyles.push({\n height: Config.FABFixedHeight,\n alignSelf: \"stretch\",\n });\n }\n\n return (\n <Elevation style={[{ elevation }, style]}>\n <Touchable\n {...rest}\n onPress={onPress}\n accessibilityState={{ disabled }}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n style={buttonStyles}\n >\n <View style={styles.content}>\n {icon && loading !== true ? (\n <View style={iconStyle}>\n <Icon\n name={icon}\n size={Config.buttonIconSize}\n color={textColor}\n />\n </View>\n ) : null}\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={textColor}\n style={iconStyle}\n />\n ) : null}\n {label ? (\n <Text numberOfLines={1} style={[textStyle, typography.button]}>\n {label}\n </Text>\n ) : null}\n </View>\n </Touchable>\n </Elevation>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n alignItems: \"center\",\n justifyContent: \"center\",\n width: Config.buttonIconSize,\n },\n fixed: {\n left: 0,\n right: 0,\n bottom: 0,\n height: 64,\n borderRadius: 0,\n },\n});\n\nexport default withTheme(FAB);\n"]}
1
+ {"version":3,"sources":["DeprecatedFAB.js"],"names":["FAB","Icon","icon","disabled","type","loading","color","colorOverride","label","onPress","elevation","style","theme","colors","disabledOpacity","roundness","typography","rest","backgroundColor","borderColor","textColor","borderWidth","buttonColor","primary","surface","alpha","rgb","string","StyleSheet","hairlineWidth","buttonStyle","borderRadius","alignItems","justifyContent","buttonStyles","styles","button","contentStyle","content","textStyle","textAlign","iconStyle","width","Config","buttonIconSize","FABSize","height","FABBorderRadius","push","marginLeft","marginRight","margin","FABFixedHeight","alignSelf","React","createElement","Elevation","Touchable","accessibilityState","accessibilityRole","View","name","size","ActivityIndicator","Text","numberOfLines","create","borderStyle","flexDirection","fixed","left","right","bottom"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,GAAG,GAAG,QAAuM;AAAA,MAAtM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,QAAQ,GAAG,KAAzB;AAAgCC,IAAAA,IAAI,GAAG,OAAvC;AAAgDC,IAAAA,OAAO,GAAG,KAA1D;AAAiEC,IAAAA,KAAK,EAAEC,aAAxE;AAAuFC,IAAAA,KAAvF;AAA8FC,IAAAA,OAA9F;AAAuGC,IAAAA,SAAS,GAAG,CAAnH;AAAsHC,IAAAA,KAAtH;AAA6HC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,eAAV;AAA2BC,MAAAA,SAA3B;AAAsCC,MAAAA;AAAtC,KAApI;AAAwL,OAAGC;AAA3L,GAAsM;AAC/M,MAAIC,eAAJ,EAAqBC,WAArB,EAAkCC,SAAlC,EAA6CC,WAA7C;AACA,QAAMC,WAAW,GAAGf,aAAa,IAAIM,MAAM,CAACU,OAA5C;;AACA,MAAInB,IAAI,KAAK,UAAT,IAAuBA,IAAI,KAAK,UAAhC,IAA8CA,IAAI,KAAK,OAA3D,EAAoE;AAChEc,IAAAA,eAAe,GAAGI,WAAlB;;AACA,QAAInB,QAAJ,EAAc;AACViB,MAAAA,SAAS,GAAG,oBAAMP,MAAM,CAACW,OAAb,EAAsBC,KAAtB,CAA4BX,eAA5B,EA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,IAAAA,KAAK,EAAEC,gBAAOC;AAHZ,GATuB;AAc7ByB,EAAAA,KAAK,EAAE;AACHC,IAAAA,IAAI,EAAE,CADH;AAEHC,IAAAA,KAAK,EAAE,CAFJ;AAGHC,IAAAA,MAAM,EAAE,CAHL;AAIH1B,IAAAA,MAAM,EAAE,EAJL;AAKHf,IAAAA,YAAY,EAAE;AALX;AAdsB,CAAlB,CAAf;;eAsBe,wBAAU/B,GAAV,C","sourcesContent":["import * as React from \"react\";\nimport { ActivityIndicator, View, StyleSheet, } from \"react-native\";\nimport color from \"color\";\nimport Config from \"./Config\";\nimport Text from \"./Text\";\nimport Touchable from \"./Touchable\";\nimport Elevation from \"./Elevation\";\nimport { withTheme } from \"../theming\";\nconst FAB = ({ Icon, icon, disabled = false, type = \"solid\", loading = false, color: colorOverride, label, onPress, elevation = 0, style, theme: { colors, disabledOpacity, roundness, typography }, ...rest }) => {\n let backgroundColor, borderColor, textColor, borderWidth;\n const buttonColor = colorOverride || colors.primary;\n if (type === \"standard\" || type === \"extended\" || type === \"fixed\") {\n backgroundColor = buttonColor;\n if (disabled) {\n textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = colors.surface;\n }\n }\n else {\n backgroundColor = \"transparent\";\n if (disabled) {\n textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n textColor = buttonColor;\n }\n }\n if (type === \"outline\") {\n if (disabled) {\n borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();\n }\n else {\n borderColor = buttonColor;\n }\n borderWidth = StyleSheet.hairlineWidth;\n }\n else {\n borderColor = \"transparent\";\n borderWidth = 0;\n }\n const buttonStyle = {\n backgroundColor,\n borderColor,\n borderWidth,\n borderRadius: roundness,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n const buttonStyles = [styles.button, buttonStyle];\n const contentStyle = [styles.content];\n const textStyle = {\n textAlign: \"center\",\n color: textColor,\n };\n const iconStyle = [\n styles.icon,\n {\n width: Config.buttonIconSize,\n },\n ];\n if (type === \"standard\" || type === \"outline\") {\n buttonStyle.width = Config.FABSize;\n buttonStyle.height = Config.FABSize;\n buttonStyle.borderRadius = Config.FABBorderRadius;\n contentStyle.push({\n width: Config.FABSize,\n height: Config.FABSize,\n });\n }\n if (type === \"extended\" || type === \"fixed\") {\n iconStyle.push({\n marginLeft: 16,\n marginRight: -8,\n });\n textStyle.margin = 16;\n }\n if (type === \"fixed\") {\n buttonStyles.push({\n height: Config.FABFixedHeight,\n alignSelf: \"stretch\",\n });\n }\n return (React.createElement(Elevation, { style: [{ elevation }, style] },\n React.createElement(Touchable, { ...rest, onPress: onPress, accessibilityState: { disabled }, accessibilityRole: \"button\", disabled: disabled || loading, style: buttonStyles },\n React.createElement(View, { style: styles.content },\n icon && loading !== true ? (React.createElement(View, { style: iconStyle },\n React.createElement(Icon, { name: icon, size: Config.buttonIconSize, color: textColor }))) : null,\n loading ? (React.createElement(ActivityIndicator, { size: \"small\", color: textColor, style: iconStyle })) : null,\n label ? (React.createElement(Text, { numberOfLines: 1, style: [textStyle, typography.button] }, label)) : null))));\n};\nconst styles = StyleSheet.create({\n button: {\n borderStyle: \"solid\",\n },\n content: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n icon: {\n alignItems: \"center\",\n justifyContent: \"center\",\n width: Config.buttonIconSize,\n },\n fixed: {\n left: 0,\n right: 0,\n bottom: 0,\n height: 64,\n borderRadius: 0,\n },\n});\nexport default withTheme(FAB);\n"]}
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  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; }
21
21
 
22
+ 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); }
23
+
22
24
  /* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
23
25
  const Elevation = _ref => {
24
26
  let {
@@ -35,24 +37,11 @@ const Elevation = _ref => {
35
37
  colors
36
38
  } = theme;
37
39
  const borderRadius = radius;
38
- return /*#__PURE__*/React.createElement(_reactNative.Animated.View, { ...rest,
40
+ return /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({}, rest, {
39
41
  style: [{
40
42
  borderRadius,
41
43
  backgroundColor: colors.surface
42
44
  }, elevation ? (0, _shadow.default)(elevation) : null, style]
43
- }, /*#__PURE__*/React.createElement(_reactNative.View, {
44
- style: {
45
- overflow: "hidden",
46
- borderRadius
47
- }
48
- }, children));
49
- };
50
-
51
- var _default = (0, _theming.withTheme)(Elevation);
52
-
53
- exports.default = _default;
54
- //# sourceMappingURL=Elevation.js.mape
55
- }, elevation ? (0, _shadow.default)(elevation) : null, style]
56
45
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
57
46
  style: {
58
47
  overflow: "hidden",
@@ -1 +1 @@
1
- {"version":3,"sources":["Elevation.js"],"names":["Elevation","style","theme","children","rest","elevation","borderRadius","radius","StyleSheet","flatten","colors","React","createElement","Animated","View","backgroundColor","surface","overflow"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AACA;AACA,MAAMA,SAAS,GAAG,QAAyC;AAAA,MAAxC;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA,QAAhB;AAA0B,OAAGC;AAA7B,GAAwC;AACvD,QAAM;AAAEC,IAAAA,SAAS,GAAG,CAAd;AAAiBC,IAAAA,YAAY,EAAEC;AAA/B,MAA0CC,wBAAWC,OAAX,CAAmBR,KAAnB,KAA6B,EAA7E;AACA,QAAM;AAAES,IAAAA;AAAF,MAAaR,KAAnB;AACA,QAAMI,YAAY,GAAGC,MAArB;AACA,sBAAQI,KAAK,CAACC,aAAN,CAAoBC,sBAASC,IAA7B,EAAmC,EAAE,GAAGV,IAAL;AAAWH,IAAAA,KAAK,EAAE,CACrD;AACIK,MAAAA,YADJ;AAEIS,MAAAA,eAAe,EAAEL,MAAM,CAACM;AAF5B,KADqD,EAKrDX,SAAS,GAAG,qBAAOA,SAAP,CAAH,GAAuB,IALqB,EAMrDJ,KANqD;AAAlB,GAAnC,eAQJU,KAAK,CAACC,aAAN,CAAoBE,iBAApB,EAA0B;AAAEb,IAAAA,KAAK,EAAE;AAAEgB,MAAAA,QAAQ,EAAE,QAAZ;AAAsBX,MAAAA;AAAtB;AAAT,GAA1B,EAA2EH,QAA3E,CARI,CAAR;AASH,CAbD;;eAce,wBAAUH,SAAV,C","sourcesContent":["import * as React from \"react\";\nimport { Animated, StyleSheet, View, } from \"react-native\";\nimport shadow from \"../styles/shadow\";\nimport { withTheme } from \"../theming\";\n/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */\nconst Elevation = ({ style, theme, children, ...rest }) => {\n const { elevation = 4, borderRadius: radius } = StyleSheet.flatten(style) || {};\n const { colors } = theme;\n const borderRadius = radius;\n return (React.createElement(Animated.View, { ...rest, style: [\n {\n borderRadius,\n backgroundColor: colors.surface,\n },\n elevation ? shadow(elevation) : null,\n style,\n ] },\n React.createElement(View, { style: { overflow: \"hidden\", borderRadius } }, children)));\n};\nexport default withTheme(Elevation);\n"]}
1
+ {"version":3,"sources":["Elevation.tsx"],"names":["Elevation","style","theme","children","rest","elevation","borderRadius","radius","StyleSheet","flatten","colors","backgroundColor","surface","overflow"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;AACA;;;;;;;;;;AAQA;AACA,MAAMA,SAA0B,GAAG,QAAyC;AAAA,MAAxC;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA,QAAhB;AAA0B,OAAGC;AAA7B,GAAwC;AAC1E,QAAM;AAAEC,IAAAA,SAAS,GAAG,CAAd;AAAiBC,IAAAA,YAAY,EAAEC;AAA/B,MACJC,wBAAWC,OAAX,CAAmBR,KAAnB,KAA6B,EAD/B;AAEA,QAAM;AAAES,IAAAA;AAAF,MAAaR,KAAnB;AACA,QAAMI,YAAY,GAAGC,MAArB;AAEA,sBACE,oBAAC,qBAAD,CAAU,IAAV,eACMH,IADN;AAEE,IAAA,KAAK,EAAE,CACL;AACEE,MAAAA,YADF;AAEEK,MAAAA,eAAe,EAAED,MAAM,CAACE;AAF1B,KADK,EAKLP,SAAS,GAAG,qBAAOA,SAAP,CAAH,GAAuB,IAL3B,EAMLJ,KANK;AAFT,mBAWE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAE;AAAEY,MAAAA,QAAQ,EAAE,QAAZ;AAAsBP,MAAAA;AAAtB;AAAb,KAAoDH,QAApD,CAXF,CADF;AAeD,CArBD;;eAuBe,wBAAUH,SAAV,C","sourcesContent":["import * as React from \"react\";\nimport {\n Animated,\n StyleSheet,\n ViewProps,\n StyleProp,\n ViewStyle,\n View,\n} from \"react-native\";\nimport shadow from \"../styles/shadow\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\n\ntype Props = {\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & ViewProps;\n\n/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */\nconst Elevation: React.FC<Props> = ({ style, theme, children, ...rest }) => {\n const { elevation = 4, borderRadius: radius } =\n StyleSheet.flatten(style) || {};\n const { colors } = theme;\n const borderRadius = radius;\n\n return (\n <Animated.View\n {...rest}\n style={[\n {\n borderRadius,\n backgroundColor: colors.surface,\n },\n elevation ? shadow(elevation) : null,\n style,\n ]}\n >\n <View style={{ overflow: \"hidden\", borderRadius }}>{children}</View>\n </Animated.View>\n );\n};\n\nexport default withTheme(Elevation);\n"]}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var React = _interopRequireWildcard(require("react"));
9
+
10
+ var _theming = require("../theming");
11
+
12
+ var _reactNative = require("react-native");
13
+
14
+ var _IconButton = _interopRequireDefault(require("./IconButton"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ 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; }
21
+
22
+ 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); }
23
+
24
+ const ToggleButton = _ref => {
25
+ let {
26
+ Icon,
27
+ icon,
28
+ toggled = false,
29
+ onPress = () => {},
30
+ defaultValue,
31
+ disabled = false,
32
+ color = "primary",
33
+ colorSecondary = "surface",
34
+ borderColor = "divider",
35
+ iconSize = 25,
36
+ width = 50,
37
+ height = 50,
38
+ theme: {
39
+ colors
40
+ },
41
+ style,
42
+ ...rest
43
+ } = _ref;
44
+ const [internalValue, setInternalValue] = React.useState(toggled || defaultValue || false);
45
+ React.useEffect(() => {
46
+ if (toggled != null) {
47
+ setInternalValue(toggled);
48
+ }
49
+ }, [toggled]);
50
+ React.useEffect(() => {
51
+ if (defaultValue != null) {
52
+ setInternalValue(defaultValue);
53
+ }
54
+ }, [defaultValue]);
55
+
56
+ const handlePress = () => {
57
+ setInternalValue(!internalValue);
58
+ onPress(!internalValue);
59
+ };
60
+
61
+ return /*#__PURE__*/React.createElement(_IconButton.default, _extends({
62
+ Icon: Icon,
63
+ icon: icon,
64
+ size: iconSize,
65
+ color: internalValue ? colors[color] : colors[colorSecondary],
66
+ onPress: handlePress,
67
+ disabled: disabled,
68
+ style: [styles.mainContainer, {
69
+ width,
70
+ height,
71
+ backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
72
+ borderColor: colors[borderColor]
73
+ }, style]
74
+ }, rest));
75
+ };
76
+
77
+ const styles = _reactNative.StyleSheet.create({
78
+ mainContainer: {
79
+ borderWidth: 1
80
+ }
81
+ });
82
+
83
+ var _default = (0, _theming.withTheme)(ToggleButton);
84
+
85
+ exports.default = _default;
86
+ //# sourceMappingURL=ToggleButton.js.map
@@ -0,0 +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","Style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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,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,EAAER,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,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"]}
@@ -369,6 +369,12 @@ Object.defineProperty(exports, "ThemeProvider", {
369
369
  return _theming.ThemeProvider;
370
370
  }
371
371
  });
372
+ Object.defineProperty(exports, "ToggleButton", {
373
+ enumerable: true,
374
+ get: function () {
375
+ return _ToggleButton.default;
376
+ }
377
+ });
372
378
  Object.defineProperty(exports, "Touchable", {
373
379
  enumerable: true,
374
380
  get: function () {
@@ -440,6 +446,8 @@ var _Switch = _interopRequireWildcard(require("./components/Switch"));
440
446
 
441
447
  var _TextField = _interopRequireDefault(require("./components/TextField"));
442
448
 
449
+ var _ToggleButton = _interopRequireDefault(require("./components/ToggleButton"));
450
+
443
451
  var _Touchable = _interopRequireDefault(require("./components/Touchable"));
444
452
 
445
453
  var _Accordion = require("./components/Accordion");
@@ -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;;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 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.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 +1 @@
1
- {"version":3,"sources":["ActionSheet.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","container","props","visible","group","GROUPS","data","label"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,cADe;AAErBC,EAAAA,GAAG,EAAE,aAFgB;AAGrBC,EAAAA,WAAW,EAAE,wBAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAJL;AAKrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,OAAO,EAAE,iCAAqB;AAC1BC,MAAAA,KAAK,EAAEC,cAAOC,IADY;AAE1BC,MAAAA,KAAK,EAAE;AAFmB,KAArB;AADN;AALc,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createStaticBoolProp, GROUPS } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Action Sheet\",\n tag: \"ActionSheet\",\n description: \"Action Sheet container\",\n category: COMPONENT_TYPES.container,\n props: {\n visible: createStaticBoolProp({\n group: GROUPS.data,\n label: \"Show Action Sheet\",\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["ActionSheet.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","container","props","visible","group","GROUPS","data","label"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,cADiB;AAEvBC,EAAAA,GAAG,EAAE,aAFkB;AAGvBC,EAAAA,WAAW,EAAE,wBAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAJH;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,iCAAqB;AAC5BC,MAAAA,KAAK,EAAEC,cAAOC,IADc;AAE5BC,MAAAA,KAAK,EAAE;AAFqB,KAArB;AADJ;AALgB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createStaticBoolProp, GROUPS } from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Action Sheet\",\n tag: \"ActionSheet\",\n description: \"Action Sheet container\",\n category: COMPONENT_TYPES.container,\n props: {\n visible: createStaticBoolProp({\n group: GROUPS.data,\n label: \"Show Action Sheet\",\n }),\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["RadioButtonRow.ts"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","props","label","description","required","defaultValue","direction","options","value","color","group","GROUPS","basic","unselectedColor"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,kBADiB;AAEvBC,EAAAA,GAAG,EAAE,gBAFkB;AAGvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAHH;AAIvBC,EAAAA,MAAM,EAAE,EAJe;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,2BAAe;AACpBA,MAAAA,KAAK,EAAE,OADa;AAEpBC,MAAAA,WAAW,EAAE,qCAFO;AAGpBC,MAAAA,QAAQ,EAAE,IAHU;AAIpBC,MAAAA,YAAY,EAAE;AAJM,KAAf,CADF;AAOLC,IAAAA,SAAS,EAAE,+BAAmB;AAC5BJ,MAAAA,KAAK,EAAE,WADqB;AAE5BC,MAAAA,WAAW,EACT,8DAH0B;AAI5BI,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,aAAR;AAJmB,KAAnB,CAPN;AAaLC,IAAAA,KAAK,EAAE,2BAAe;AACpBN,MAAAA,KAAK,EAAE,OADa;AAEpBC,MAAAA,WAAW,EAAE,2BAFO;AAGpBE,MAAAA,YAAY,EAAE,IAHM;AAIpBD,MAAAA,QAAQ,EAAE;AAJU,KAAf,CAbF;AAmBLK,IAAAA,KAAK,EAAE,4BAAgB;AACrBC,MAAAA,KAAK,EAAEC,cAAOC,KADO;AAErBT,MAAAA,WAAW,EAAE,sBAFQ;AAGrBE,MAAAA,YAAY,EAAE;AAHO,KAAhB,CAnBF;AAwBLQ,IAAAA,eAAe,EAAE,4BAAgB;AAC/BH,MAAAA,KAAK,EAAEC,cAAOC,KADiB;AAE/BV,MAAAA,KAAK,EAAE,kBAFwB;AAG/BC,MAAAA,WAAW,EAAE,iCAHkB;AAI/BE,MAAAA,YAAY,EAAE;AAJiB,KAAhB;AAxBZ;AALgB,CAAlB","sourcesContent":["import {\n createTextProp,\n createTextEnumProp,\n COMPONENT_TYPES,\n createColorProp,\n GROUPS,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Radio Button Row\",\n tag: \"RadioButtonRow\",\n category: COMPONENT_TYPES.input,\n layout: {},\n props: {\n label: createTextProp({\n label: \"Label\",\n description: \"Label to show with the radio button\",\n required: true,\n defaultValue: \"First Option\",\n }),\n direction: createTextEnumProp({\n label: \"Direction\",\n description:\n \"Whether the checkbox will appear on the left or on the right\",\n options: [\"row\", \"row-reverse\"],\n }),\n value: createTextProp({\n label: \"Value\",\n description: \"Value of the radio button\",\n defaultValue: null,\n required: true,\n }),\n color: createColorProp({\n group: GROUPS.basic,\n description: \"Color for the button\",\n defaultValue: \"primary\",\n }),\n unselectedColor: createColorProp({\n group: GROUPS.basic,\n label: \"Unselected Color\",\n description: \"Unselected Color for the button\",\n defaultValue: \"primary\",\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["RadioButtonRow.js"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","props","label","description","required","defaultValue","direction","options","value","color","group","GROUPS","basic","unselectedColor"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,kBADe;AAErBC,EAAAA,GAAG,EAAE,gBAFgB;AAGrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAHL;AAIrBC,EAAAA,MAAM,EAAE,EAJa;AAKrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,KAAK,EAAE,2BAAe;AAClBA,MAAAA,KAAK,EAAE,OADW;AAElBC,MAAAA,WAAW,EAAE,qCAFK;AAGlBC,MAAAA,QAAQ,EAAE,IAHQ;AAIlBC,MAAAA,YAAY,EAAE;AAJI,KAAf,CADJ;AAOHC,IAAAA,SAAS,EAAE,+BAAmB;AAC1BJ,MAAAA,KAAK,EAAE,WADmB;AAE1BC,MAAAA,WAAW,EAAE,8DAFa;AAG1BI,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,aAAR;AAHiB,KAAnB,CAPR;AAYHC,IAAAA,KAAK,EAAE,2BAAe;AAClBN,MAAAA,KAAK,EAAE,OADW;AAElBC,MAAAA,WAAW,EAAE,2BAFK;AAGlBE,MAAAA,YAAY,EAAE,IAHI;AAIlBD,MAAAA,QAAQ,EAAE;AAJQ,KAAf,CAZJ;AAkBHK,IAAAA,KAAK,EAAE,4BAAgB;AACnBC,MAAAA,KAAK,EAAEC,cAAOC,KADK;AAEnBT,MAAAA,WAAW,EAAE,sBAFM;AAGnBE,MAAAA,YAAY,EAAE;AAHK,KAAhB,CAlBJ;AAuBHQ,IAAAA,eAAe,EAAE,4BAAgB;AAC7BH,MAAAA,KAAK,EAAEC,cAAOC,KADe;AAE7BV,MAAAA,KAAK,EAAE,kBAFsB;AAG7BC,MAAAA,WAAW,EAAE,iCAHgB;AAI7BE,MAAAA,YAAY,EAAE;AAJe,KAAhB;AAvBd;AALc,CAAlB","sourcesContent":["import { createTextProp, createTextEnumProp, COMPONENT_TYPES, createColorProp, GROUPS, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Radio Button Row\",\n tag: \"RadioButtonRow\",\n category: COMPONENT_TYPES.input,\n layout: {},\n props: {\n label: createTextProp({\n label: \"Label\",\n description: \"Label to show with the radio button\",\n required: true,\n defaultValue: \"First Option\",\n }),\n direction: createTextEnumProp({\n label: \"Direction\",\n description: \"Whether the checkbox will appear on the left or on the right\",\n options: [\"row\", \"row-reverse\"],\n }),\n value: createTextProp({\n label: \"Value\",\n description: \"Value of the radio button\",\n defaultValue: null,\n required: true,\n }),\n color: createColorProp({\n group: GROUPS.basic,\n description: \"Color for the button\",\n defaultValue: \"primary\",\n }),\n unselectedColor: createColorProp({\n group: GROUPS.basic,\n label: \"Unselected Color\",\n description: \"Unselected Color for the button\",\n defaultValue: \"primary\",\n }),\n },\n};\n"]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+
8
+ var _types = require("@draftbit/types");
9
+
10
+ const SEED_DATA = {
11
+ name: "Toggle Button",
12
+ tag: "ToggleButton",
13
+ category: _types.COMPONENT_TYPES.deprecated,
14
+ layout: {},
15
+ triggers: [_types.Triggers.OnPress],
16
+ props: {
17
+ onPress: (0, _types.createActionProp)(),
18
+ icon: (0, _types.createIconProp)({
19
+ required: true
20
+ }),
21
+ iconSize: (0, _types.createIconSizeProp)(),
22
+ fieldName: (0, _types.createFieldNameProp)({
23
+ defaultValue: false,
24
+ valuePropName: "toggled"
25
+ }),
26
+ disabled: (0, _types.createBoolProp)({
27
+ label: "Disabled",
28
+ description: "Whether the button should be disabled",
29
+ group: _types.GROUPS.basic
30
+ }),
31
+ color: (0, _types.createColorProp)({
32
+ group: _types.GROUPS.basic
33
+ }),
34
+ colorSecondary: (0, _types.createColorProp)({
35
+ label: "Secondary Color",
36
+ group: _types.GROUPS.basic
37
+ }),
38
+ borderColor: (0, _types.createColorProp)({
39
+ label: "Border Color",
40
+ group: _types.GROUPS.basic
41
+ }),
42
+ width: (0, _types.createStaticNumberProp)({
43
+ label: "Width",
44
+ description: "Width",
45
+ defaultValue: 50
46
+ }),
47
+ height: (0, _types.createStaticNumberProp)({
48
+ label: "Height",
49
+ description: "Height",
50
+ defaultValue: 50
51
+ }),
52
+ toggled: (0, _types.createBoolProp)({
53
+ label: "Toggled",
54
+ description: "Whether the button should show the toggled state",
55
+ defaultValue: false
56
+ })
57
+ }
58
+ };
59
+ exports.SEED_DATA = SEED_DATA;
60
+ //# sourceMappingURL=ToggleButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ToggleButton.ts"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","deprecated","layout","triggers","Triggers","OnPress","props","onPress","icon","required","iconSize","fieldName","defaultValue","valuePropName","disabled","label","description","group","GROUPS","basic","color","colorSecondary","borderColor","width","height","toggled"],"mappings":";;;;;;;AAAA;;AAaO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,eADiB;AAEvBC,EAAAA,GAAG,EAAE,cAFkB;AAGvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,UAHH;AAIvBC,EAAAA,MAAM,EAAE,EAJe;AAKvBC,EAAAA,QAAQ,EAAE,CAACC,gBAASC,OAAV,CALa;AAMvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,8BADJ;AAELC,IAAAA,IAAI,EAAE,2BAAe;AACnBC,MAAAA,QAAQ,EAAE;AADS,KAAf,CAFD;AAKLC,IAAAA,QAAQ,EAAE,gCALL;AAMLC,IAAAA,SAAS,EAAE,gCAAoB;AAC7BC,MAAAA,YAAY,EAAE,KADe;AAE7BC,MAAAA,aAAa,EAAE;AAFc,KAApB,CANN;AAULC,IAAAA,QAAQ,EAAE,2BAAe;AACvBC,MAAAA,KAAK,EAAE,UADgB;AAEvBC,MAAAA,WAAW,EAAE,uCAFU;AAGvBC,MAAAA,KAAK,EAAEC,cAAOC;AAHS,KAAf,CAVL;AAeLC,IAAAA,KAAK,EAAE,4BAAgB;AACrBH,MAAAA,KAAK,EAAEC,cAAOC;AADO,KAAhB,CAfF;AAkBLE,IAAAA,cAAc,EAAE,4BAAgB;AAC9BN,MAAAA,KAAK,EAAE,iBADuB;AAE9BE,MAAAA,KAAK,EAAEC,cAAOC;AAFgB,KAAhB,CAlBX;AAsBLG,IAAAA,WAAW,EAAE,4BAAgB;AAC3BP,MAAAA,KAAK,EAAE,cADoB;AAE3BE,MAAAA,KAAK,EAAEC,cAAOC;AAFa,KAAhB,CAtBR;AA0BLI,IAAAA,KAAK,EAAE,mCAAuB;AAC5BR,MAAAA,KAAK,EAAE,OADqB;AAE5BC,MAAAA,WAAW,EAAE,OAFe;AAG5BJ,MAAAA,YAAY,EAAE;AAHc,KAAvB,CA1BF;AA+BLY,IAAAA,MAAM,EAAE,mCAAuB;AAC7BT,MAAAA,KAAK,EAAE,QADsB;AAE7BC,MAAAA,WAAW,EAAE,QAFgB;AAG7BJ,MAAAA,YAAY,EAAE;AAHe,KAAvB,CA/BH;AAoCLa,IAAAA,OAAO,EAAE,2BAAe;AACtBV,MAAAA,KAAK,EAAE,SADe;AAEtBC,MAAAA,WAAW,EAAE,kDAFS;AAGtBJ,MAAAA,YAAY,EAAE;AAHQ,KAAf;AApCJ;AANgB,CAAlB","sourcesContent":["import {\n GROUPS,\n COMPONENT_TYPES,\n createIconProp,\n createBoolProp,\n createColorProp,\n createStaticNumberProp,\n createFieldNameProp,\n createIconSizeProp,\n createActionProp,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Toggle Button\",\n tag: \"ToggleButton\",\n category: COMPONENT_TYPES.deprecated,\n layout: {},\n triggers: [Triggers.OnPress],\n props: {\n onPress: createActionProp(),\n icon: createIconProp({\n required: true,\n }),\n iconSize: createIconSizeProp(),\n fieldName: createFieldNameProp({\n defaultValue: false,\n valuePropName: \"toggled\",\n }),\n disabled: createBoolProp({\n label: \"Disabled\",\n description: \"Whether the button should be disabled\",\n group: GROUPS.basic,\n }),\n color: createColorProp({\n group: GROUPS.basic,\n }),\n colorSecondary: createColorProp({\n label: \"Secondary Color\",\n group: GROUPS.basic,\n }),\n borderColor: createColorProp({\n label: \"Border Color\",\n group: GROUPS.basic,\n }),\n width: createStaticNumberProp({\n label: \"Width\",\n description: \"Width\",\n defaultValue: 50,\n }),\n height: createStaticNumberProp({\n label: \"Height\",\n description: \"Height\",\n defaultValue: 50,\n }),\n toggled: createBoolProp({\n label: \"Toggled\",\n description: \"Whether the button should show the toggled state\",\n defaultValue: false,\n }),\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Touchable.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","button","layout","triggers","Triggers","OnPress","props","onPress"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,WADe;AAErBC,EAAAA,GAAG,EAAE,WAFgB;AAGrBC,EAAAA,WAAW,EAAE,8BAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,MAJL;AAKrBC,EAAAA,MAAM,EAAE,EALa;AAMrBC,EAAAA,QAAQ,EAAE,CAACC,gBAASC,OAAV,CANW;AAOrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,OAAO,EAAE;AADN;AAPc,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createActionProp, Triggers } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Touchable\",\n tag: \"Touchable\",\n description: \"Simple button with no styles\",\n category: COMPONENT_TYPES.button,\n layout: {},\n triggers: [Triggers.OnPress],\n props: {\n onPress: createActionProp(),\n },\n};\n"]}
1
+ {"version":3,"sources":["Touchable.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","button","layout","triggers","Triggers","OnPress","props","onPress"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,WADiB;AAEvBC,EAAAA,GAAG,EAAE,WAFkB;AAGvBC,EAAAA,WAAW,EAAE,8BAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,MAJH;AAKvBC,EAAAA,MAAM,EAAE,EALe;AAMvBC,EAAAA,QAAQ,EAAE,CAACC,gBAASC,OAAV,CANa;AAOvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE;AADJ;AAPgB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createActionProp, Triggers } from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Touchable\",\n tag: \"Touchable\",\n description: \"Simple button with no styles\",\n category: COMPONENT_TYPES.button,\n layout: {},\n triggers: [Triggers.OnPress],\n props: {\n onPress: createActionProp(),\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Video.js"],"names":["SEED_DATA","name","tag","description","doc_link","code_link","category","COMPONENT_TYPES","media","layout","height","props","source","label","defaultValue","usePoster","posterSource","group","GROUPS","basic","resizeMode","isMuted","useNativeControls","shouldPlay","isLooping","positionMillis","min","step","precision","rate","max","volume"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,OADe;AAErBC,EAAAA,GAAG,EAAE,OAFgB;AAGrBC,EAAAA,WAAW,EAAE,8BAHQ;AAIrBC,EAAAA,QAAQ,EAAE,iDAJW;AAKrBC,EAAAA,SAAS,EAAE,yEALU;AAMrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KANL;AAOrBC,EAAAA,MAAM,EAAE;AACJC,IAAAA,MAAM,EAAE;AADJ,GAPa;AAUrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,MAAM,EAAE,6BAAiB;AACrBC,MAAAA,KAAK,EAAE,QADc;AAErBV,MAAAA,WAAW,EAAE,0CAFQ;AAGrBW,MAAAA,YAAY,EAAE;AAHO,KAAjB,CADL;AAMHC,IAAAA,SAAS,EAAE,iCAAqB;AAC5BF,MAAAA,KAAK,EAAE,WADqB;AAE5BV,MAAAA,WAAW,EAAE,2CAFe;AAG5BW,MAAAA,YAAY,EAAE;AAHc,KAArB,CANR;AAWHE,IAAAA,YAAY,EAAE,6BAAiB;AAC3BH,MAAAA,KAAK,EAAE,kBADoB;AAE3BV,MAAAA,WAAW,EAAE,mEAFc;AAG3BW,MAAAA,YAAY,EAAE,0DAHa;AAI3BG,MAAAA,KAAK,EAAEC,cAAOC;AAJa,KAAjB,CAXX;AAiBHC,IAAAA,UAAU,EAAE,kCAjBT;AAkBHC,IAAAA,OA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;AAKrBH,MAAAA,IAAI,EAAE,GALe;AAMrBC,MAAAA,SAAS,EAAE,CANU;AAOrBX,MAAAA,KAAK,EAAEC,cAAOC;AAPO,KAAjB;AApDL;AAVc,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createStaticBoolProp, createSourceProp, createResizeModeProp, createNumberProp, GROUPS, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Video\",\n tag: \"Video\",\n description: \"Given a URL, display a video\",\n doc_link: \"https://docs.expo.io/versions/latest/sdk/video/\",\n code_link: \"https://github.com/expo/expo/blob/master/packages/expo-av/src/Video.tsx\",\n category: COMPONENT_TYPES.media,\n layout: {\n height: 215,\n },\n props: {\n source: createSourceProp({\n label: \"Source\",\n description: \"The source of the video data to display.\",\n defaultValue: \"http://static.draftbit.com/videos/intro-to-draftbit.mp4\",\n }),\n usePoster: createStaticBoolProp({\n label: \"Thumbnail\",\n description: \"Show a thumbnail before the video starts.\",\n defaultValue: false,\n }),\n posterSource: createSourceProp({\n label: \"Thumbnail Source\",\n description: \"The optional image to display over the video while it is loading.\",\n defaultValue: \"https://static.draftbit.com/videos/intro-to-draftbit.png\",\n group: GROUPS.basic,\n }),\n resizeMode: createResizeModeProp(),\n isMuted: createStaticBoolProp({\n label: \"Mute Audio\",\n description: \"Mute the audio of the video.\",\n }),\n useNativeControls: createStaticBoolProp({\n label: \"Use Native Controls\",\n description: \"Display the playback controls, allowing users to play or pause the video.\",\n defaultValue: true,\n }),\n shouldPlay: createStaticBoolProp({\n label: \"Play Automatically\",\n description: \"Start playing the video after loading is finished.\",\n }),\n isLooping: createStaticBoolProp({\n label: \"Loop Video\",\n description: \"Automatically replay the video.\",\n }),\n positionMillis: createNumberProp({\n label: \"Starting Point\",\n description: \"Set a certian starting point of the video\",\n min: 0,\n step: 0.01,\n precision: 2,\n group: GROUPS.basic,\n }),\n rate: createNumberProp({\n label: \"Playback Rate\",\n description: \"The playback rate of the media. This value must be between 0.0 and 32.0 (Default: 1)\",\n min: 0,\n max: 32,\n step: 0.25,\n precision: 2,\n group: GROUPS.basic,\n }),\n volume: createNumberProp({\n label: \"Volume\",\n description: \"The volume of the audio for this media. This value must be between 0.0 (silence) and 1.0 (maximum volume). (Default: .5)\",\n min: 0,\n max: 1,\n step: 0.1,\n precision: 1,\n group: GROUPS.basic,\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["Video.ts"],"names":["SEED_DATA","name","tag","description","doc_link","code_link","category","COMPONENT_TYPES","media","layout","height","props","source","label","defaultValue","usePoster","posterSource","group","GROUPS","basic","resizeMode","isMuted","useNativeControls","shouldPlay","isLooping","positionMillis","min","step","precision","rate","max","volume"],"mappings":";;;;;;;AAAA;;AASO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,OADiB;AAEvBC,EAAAA,GAAG,EAAE,OAFkB;AAGvBC,EAAAA,WAAW,EAAE,8BAHU;AAIvBC,EAAAA,QAAQ,EAAE,iDAJa;AAKvBC,EAAAA,SAAS,EACP,yEANqB;AAOvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAPH;AAQvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,MAAM,EAAE;AADF,GARe;AAWvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BAAiB;AACvBC,MAAAA,KAAK,EAAE,QADgB;AAEvBV,MAAAA,WAAW,EAAE,0CAFU;AAGvBW,MAAAA,YAAY,EAAE;AAHS,KAAjB,CADH;AAMLC,IAAAA,SAAS,EAAE,iCAAqB;AAC9BF,MAAAA,KAAK,EAAE,WADuB;AAE9BV,MAAAA,WAAW,EAAE,2CAFiB;AAG9BW,MAAAA,YAAY,EAAE;AAHgB,KAArB,CANN;AAWLE,IAAAA,YAAY,EAAE,6BAAiB;AAC7BH,MAAAA,KAAK,EAAE,kBADsB;AAE7BV,MAAAA,WAAW,EACT,mEAH2B;AAI7BW,MAAAA,YAAY,EAAE,0DAJe;AAK7BG,MAAAA,KAAK,EAAEC,cAAOC;AALe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AIvBuB,MAAAA,GAAG,EAAE,CAJkB;AAKvBI,MAAAA,GAAG,EAAE,CALkB;AAMvBH,MAAAA,IAAI,EAAE,GANiB;AAOvBC,MAAAA,SAAS,EAAE,CAPY;AAQvBX,MAAAA,KAAK,EAAEC,cAAOC;AARS,KAAjB;AAvDH;AAXgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createStaticBoolProp,\n createSourceProp,\n createResizeModeProp,\n createNumberProp,\n GROUPS,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Video\",\n tag: \"Video\",\n description: \"Given a URL, display a video\",\n doc_link: \"https://docs.expo.io/versions/latest/sdk/video/\",\n code_link:\n \"https://github.com/expo/expo/blob/master/packages/expo-av/src/Video.tsx\",\n category: COMPONENT_TYPES.media,\n layout: {\n height: 215,\n },\n props: {\n source: createSourceProp({\n label: \"Source\",\n description: \"The source of the video data to display.\",\n defaultValue: \"http://static.draftbit.com/videos/intro-to-draftbit.mp4\",\n }),\n usePoster: createStaticBoolProp({\n label: \"Thumbnail\",\n description: \"Show a thumbnail before the video starts.\",\n defaultValue: false,\n }),\n posterSource: createSourceProp({\n label: \"Thumbnail Source\",\n description:\n \"The optional image to display over the video while it is loading.\",\n defaultValue: \"https://static.draftbit.com/videos/intro-to-draftbit.png\",\n group: GROUPS.basic,\n }),\n resizeMode: createResizeModeProp(),\n isMuted: createStaticBoolProp({\n label: \"Mute Audio\",\n description: \"Mute the audio of the video.\",\n }),\n useNativeControls: createStaticBoolProp({\n label: \"Use Native Controls\",\n description:\n \"Display the playback controls, allowing users to play or pause the video.\",\n defaultValue: true,\n }),\n shouldPlay: createStaticBoolProp({\n label: \"Play Automatically\",\n description: \"Start playing the video after loading is finished.\",\n }),\n isLooping: createStaticBoolProp({\n label: \"Loop Video\",\n description: \"Automatically replay the video.\",\n }),\n positionMillis: createNumberProp({\n label: \"Starting Point\",\n description: \"Set a certian starting point of the video\",\n min: 0,\n step: 0.01,\n precision: 2,\n group: GROUPS.basic,\n }),\n rate: createNumberProp({\n label: \"Playback Rate\",\n description:\n \"The playback rate of the media. This value must be between 0.0 and 32.0 (Default: 1)\",\n min: 0,\n max: 32,\n step: 0.25,\n precision: 2,\n group: GROUPS.basic,\n }),\n volume: createNumberProp({\n label: \"Volume\",\n description:\n \"The volume of the audio for this media. This value must be between 0.0 (silence) and 1.0 (maximum volume). (Default: .5)\",\n min: 0,\n max: 1,\n step: 0.1,\n precision: 1,\n group: GROUPS.basic,\n }),\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["WebView.js"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","flex","props","source","defaultValue"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,UADe;AAErBC,EAAAA,GAAG,EAAE,SAFgB;AAGrBC,EAAAA,WAAW,EAAE,kCAHQ;AAIrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJL;AAKrBC,EAAAA,MAAM,EAAE;AAAEC,IAAAA,IAAI,EAAE;AAAR,GALa;AAMrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,MAAM,EAAE,6BAAiB;AACrBC,MAAAA,YAAY,EAAE;AADO,KAAjB;AADL;AANc,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createSourceProp } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Web View\",\n tag: \"WebView\",\n description: \"Render web content inside a view\",\n category: COMPONENT_TYPES.media,\n layout: { flex: 1 },\n props: {\n source: createSourceProp({\n defaultValue: \"https://reactnative.dev\",\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["WebView.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","flex","props","source","defaultValue"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,UADiB;AAEvBC,EAAAA,GAAG,EAAE,SAFkB;AAGvBC,EAAAA,WAAW,EAAE,kCAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJH;AAKvBC,EAAAA,MAAM,EAAE;AAAEC,IAAAA,IAAI,EAAE;AAAR,GALe;AAMvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BAAiB;AACvBC,MAAAA,YAAY,EAAE;AADS,KAAjB;AADH;AANgB,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createSourceProp } from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Web View\",\n tag: \"WebView\",\n description: \"Render web content inside a view\",\n category: COMPONENT_TYPES.media,\n layout: { flex: 1 },\n props: {\n source: createSourceProp({\n defaultValue: \"https://reactnative.dev\",\n }),\n },\n};\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 } from "react-native";
3
5
  import omit from "lodash.omit";
@@ -89,15 +91,16 @@ const Picker = _ref => {
89
91
  key: o.value
90
92
  }))), /*#__PURE__*/React.createElement(View, {
91
93
  pointerEvents: "none"
92
- }, /*#__PURE__*/React.createElement(TextField, { ...props,
94
+ }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
93
95
  value: selectedLabel,
94
- placeholder: placeholder,
95
- // @ts-ignore
96
- ref: textField,
97
- disabled: disabled,
98
- // @ts-expect-error
96
+ placeholder: placeholder // @ts-ignore
97
+ ,
98
+ ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
99
+ ,
100
+ disabled: disabled // @ts-expect-error
101
+ ,
99
102
  style: stylesWithoutMargin
100
- }))));
103
+ })))));
101
104
  };
102
105
 
103
106
  const styles = StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"sources":["PickerComponent.android.js"],"names":["React","View","StyleSheet","omit","withTheme","Picker","NativePicker","extractStyles","TextField","Touchable","style","options","placeholder","selectedValue","disabled","onValueChange","onValueChangeOverride","props","viewStyles","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","backgroundColor","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","textField","useRef","undefined","itemValue","itemIndex","toggleFocus","current","stylesWithoutMargin","flatten","selectedLabel","find","o","value","label","createElement","onPress","styles","container","enabled","opacity","position","top","left","right","bottom","width","map","Item","key","pointerEvents","ref","create","alignSelf"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,EAAeC,UAAf,QAAiC,cAAjC;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,SAASC,SAAT,QAA0B,eAA1B;AACA,SAASC,MAAM,IAAIC,YAAnB,QAAuC,6BAAvC;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;;AACA,MAAMJ,MAAM,GAAG,QAAkI;AAAA;;AAAA,MAAjI;AAAEK,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA,aAA/B;AAA8CC,IAAAA,QAAQ,GAAG,KAAzD;AAAgEC,IAAAA,aAAa,EAAEC,qBAAqB,GAAG,MAAM,CAAG,CAAhH;AAAkH,OAAGC;AAArH,GAAiI;AAC7I,QAAM;AAAEC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,YAAF;AAAgB;AACpCC,MAAAA,WADoB;AACP;AACbC,MAAAA,cAFoB;AAEJ;AAChBC,MAAAA,gBAHoB;AAGF;AAClBC,MAAAA,iBAJoB;AAID;AACnBC,MAAAA,eALoB;AAKH;AACjBC,MAAAA,WANoB;AAMP;AACbC,MAAAA,eAPoB;AAOH;AACjBC,MAAAA,OARoB;AAQX;AACTC,MAAAA,UAToB;AASR;AACZC,MAAAA,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View, StyleSheet } from \"react-native\";\nimport omit from \"lodash.omit\";\nimport { withTheme } from \"../../theming\";\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\nimport { extractStyles } from \"../../utilities\";\nimport TextField from \"../TextField\";\nimport Touchable from \"../Touchable\";\nconst Picker = ({ style, options, placeholder, selectedValue, disabled = false, onValueChange: onValueChangeOverride = () => { }, ...props }) => {\n const { viewStyles: { borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderRightWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderBottomWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderLeftWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n backgroundColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n padding, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingTop, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingRight, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingBottom, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingLeft, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...viewStyles }, } = extractStyles(style);\n const textField = React.useRef(undefined);\n const onValueChange = (itemValue, itemIndex) => {\n toggleFocus();\n onValueChangeOverride(itemValue, itemIndex);\n };\n const toggleFocus = () => {\n if (!disabled) {\n // @ts-ignore\n textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()\n }\n };\n const stylesWithoutMargin = style &&\n omit(StyleSheet.flatten(style), [\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n ]);\n const selectedLabel = selectedValue &&\n (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);\n return (React.createElement(Touchable, { disabled: disabled, onPress: toggleFocus, style: [styles.container, viewStyles] },\n React.createElement(View, null,\n React.createElement(NativePicker, { enabled: !disabled, selectedValue: selectedValue, onValueChange: onValueChange, style: {\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n } }, options.map((o) => (React.createElement(NativePicker.Item, { label: o.label, value: o.value, key: o.value })))),\n React.createElement(View, { pointerEvents: \"none\" },\n React.createElement(TextField, { ...props, value: selectedLabel, placeholder: placeholder, \n // @ts-ignore\n ref: textField, disabled: disabled, \n // @ts-expect-error\n style: stylesWithoutMargin })))));\n};\nconst styles = StyleSheet.create({\n container: {\n alignSelf: \"stretch\",\n },\n});\nexport default withTheme(Picker);\n"]}
1
+ {"version":3,"sources":["PickerComponent.android.tsx"],"names":["React","View","StyleSheet","omit","withTheme","Picker","NativePicker","extractStyles","TextField","Touchable","style","options","placeholder","selectedValue","disabled","onValueChange","onValueChangeOverride","props","viewStyles","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","backgroundColor","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","textField","useRef","undefined","itemValue","itemIndex","toggleFocus","current","stylesWithoutMargin","flatten","selectedLabel","find","o","value","label","styles","container","opacity","position","top","left","right","bottom","width","map","create","alignSelf"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,EAAeC,UAAf,QAAiC,cAAjC;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,SAASC,SAAT,QAA0B,eAA1B;AACA,SAASC,MAAM,IAAIC,YAAnB,QAAuC,6BAAvC;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;;AAGA,MAAMJ,MAAsC,GAAG,QAQzC;AAAA;;AAAA,MAR0C;AAC9CK,IAAAA,KAD8C;AAE9CC,IAAAA,OAF8C;AAG9CC,IAAAA,WAH8C;AAI9CC,IAAAA,aAJ8C;AAK9CC,IAA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E;AADF;AADoB,CAAlB,CAAf;AAMA,eAAerD,SAAS,CAACC,MAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nimport omit from \"lodash.omit\";\nimport { withTheme } from \"../../theming\";\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\nimport { extractStyles } from \"../../utilities\";\n\nimport TextField from \"../TextField\";\nimport Touchable from \"../Touchable\";\nimport { PickerComponentProps } from \"./PickerTypes\";\n\nconst Picker: React.FC<PickerComponentProps> = ({\n style,\n options,\n placeholder,\n selectedValue,\n disabled = false,\n onValueChange: onValueChangeOverride = () => {},\n ...props\n}) => {\n const {\n viewStyles: {\n borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderRightWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderBottomWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderLeftWidth, // eslint-disable-line @typescript-eslint/no-unused-vars\n borderColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n backgroundColor, // eslint-disable-line @typescript-eslint/no-unused-vars\n padding, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingTop, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingRight, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingBottom, // eslint-disable-line @typescript-eslint/no-unused-vars\n paddingLeft, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...viewStyles\n },\n } = extractStyles(style);\n\n const textField = React.useRef<typeof TextField | undefined>(undefined);\n\n const onValueChange = (itemValue: string, itemIndex: number) => {\n toggleFocus();\n onValueChangeOverride(itemValue, itemIndex);\n };\n\n const toggleFocus = () => {\n if (!disabled) {\n // @ts-ignore\n textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()\n }\n };\n\n const stylesWithoutMargin =\n style &&\n omit(StyleSheet.flatten(style), [\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n ]);\n\n const selectedLabel =\n selectedValue &&\n (options.find((o) => o.value === selectedValue)?.label ?? selectedValue);\n\n return (\n <Touchable\n disabled={disabled}\n onPress={toggleFocus}\n style={[styles.container, viewStyles]}\n >\n <View>\n <NativePicker\n enabled={!disabled}\n selectedValue={selectedValue}\n onValueChange={onValueChange}\n style={{\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n }}\n >\n {options.map((o) => (\n <NativePicker.Item label={o.label} value={o.value} key={o.value} />\n ))}\n </NativePicker>\n <View pointerEvents=\"none\">\n <TextField\n {...props}\n value={selectedLabel}\n placeholder={placeholder}\n // @ts-ignore\n ref={textField} // cannot determine if ref is of correct type due to component being wrapped in a withTheme()\n disabled={disabled}\n // @ts-expect-error\n style={stylesWithoutMargin}\n />\n </View>\n </View>\n </Touchable>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: \"stretch\",\n },\n});\n\nexport default withTheme(Picker);\n"]}