@draftbit/core 43.3.0 → 43.3.4-a9cc72.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 (48) hide show
  1. package/lib/commonjs/components/Divider.js +3 -13
  2. package/lib/commonjs/components/Divider.js.map +1 -1
  3. package/lib/commonjs/components/Stepper.js +28 -19
  4. package/lib/commonjs/components/Stepper.js.map +1 -1
  5. package/lib/commonjs/components/ToggleButton.js +86 -0
  6. package/lib/commonjs/components/ToggleButton.js.map +1 -0
  7. package/lib/commonjs/index.js +8 -0
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/mappings/ActionSheet.js.map +1 -1
  10. package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
  11. package/lib/commonjs/mappings/Stepper.js +9 -0
  12. package/lib/commonjs/mappings/Stepper.js.map +1 -1
  13. package/lib/commonjs/mappings/ToggleButton.js +60 -0
  14. package/lib/commonjs/mappings/ToggleButton.js.map +1 -0
  15. package/lib/commonjs/mappings/Touchable.js.map +1 -1
  16. package/lib/commonjs/mappings/Video.js.map +1 -1
  17. package/lib/commonjs/mappings/WebView.js.map +1 -1
  18. package/lib/module/components/Picker/PickerComponent.android.js +10 -7
  19. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
  20. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +4 -5
  21. package/lib/module/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
  22. package/lib/module/components/Stepper.js +27 -19
  23. package/lib/module/components/Stepper.js.map +1 -1
  24. package/lib/module/components/ToggleButton.js +67 -0
  25. package/lib/module/components/ToggleButton.js.map +1 -0
  26. package/lib/module/index.js +1 -0
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/mappings/MapMarker.js.map +1 -1
  29. package/lib/module/mappings/Stepper.js +10 -1
  30. package/lib/module/mappings/Stepper.js.map +1 -1
  31. package/lib/module/mappings/ToggleButton.js +51 -0
  32. package/lib/module/mappings/ToggleButton.js.map +1 -0
  33. package/lib/typescript/src/components/Stepper.d.ts +2 -0
  34. package/lib/typescript/src/components/ToggleButton.d.ts +24 -0
  35. package/lib/typescript/src/index.d.ts +1 -0
  36. package/lib/typescript/src/mappings/Stepper.d.ts +22 -0
  37. package/lib/typescript/src/mappings/ToggleButton.d.ts +124 -0
  38. package/package.json +3 -3
  39. package/src/components/Stepper.js +23 -21
  40. package/src/components/Stepper.tsx +27 -19
  41. package/src/components/ToggleButton.js +39 -0
  42. package/src/components/ToggleButton.tsx +94 -0
  43. package/src/index.js +1 -0
  44. package/src/index.tsx +1 -0
  45. package/src/mappings/Stepper.js +10 -1
  46. package/src/mappings/Stepper.ts +10 -0
  47. package/src/mappings/ToggleButton.js +50 -0
  48. package/src/mappings/ToggleButton.ts +62 -0
@@ -15,6 +15,8 @@ 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
+
18
20
  const Divider = _ref => {
19
21
  let {
20
22
  style,
@@ -24,19 +26,7 @@ const Divider = _ref => {
24
26
  },
25
27
  ...rest
26
28
  } = _ref;
27
- return /*#__PURE__*/React.createElement(_reactNative.View, {
28
- style: [{
29
- backgroundColor: color || colors.divider,
30
- height: _reactNative.StyleSheet.hairlineWidth
31
- }, style],
32
- ...rest
33
- });
34
- };
35
-
36
- var _default = (0, _theming.withTheme)(Divider);
37
-
38
- exports.default = _default;
39
- //# sourceMappingURL=Divider.js.map /*#__PURE__*/React.createElement(_reactNative.View, _extends({
29
+ return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
40
30
  style: [{
41
31
  backgroundColor: color || colors.divider,
42
32
  height: _reactNative.StyleSheet.hairlineWidth
@@ -1 +1 @@
1
- {"version":3,"sources":["Divider.js"],"names":["Divider","style","color","theme","colors","rest","React","createElement","View","backgroundColor","divider","height","StyleSheet","hairlineWidth"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AACA,MAAMA,OAAO,GAAG,QAAkD;AAAA,MAAjD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA,KAAK,EAAE;AAAEC,MAAAA;AAAF,KAAvB;AAAmC,OAAGC;AAAtC,GAAiD;AAC9D,sBAAQC,KAAK,CAACC,aAAN,CAAoBC,iBAApB,EAA0B;AAAEP,IAAAA,KAAK,EAAE,CACnC;AACIQ,MAAAA,eAAe,EAAEP,KAAK,IAAIE,MAAM,CAACM,OADrC;AAEIC,MAAAA,MAAM,EAAEC,wBAAWC;AAFvB,KADmC,EAKnCZ,KALmC,CAAT;AAM3B,OAAGI;AANwB,GAA1B,CAAR;AAOH,CARD;;eASe,wBAAUL,OAAV,C","sourcesContent":["import * as React from \"react\";\nimport { StyleSheet, View } from \"react-native\";\nimport { withTheme } from \"../theming\";\nconst Divider = ({ style, color, theme: { colors }, ...rest }) => {\n return (React.createElement(View, { style: [\n {\n backgroundColor: color || colors.divider,\n height: StyleSheet.hairlineWidth,\n },\n style,\n ], ...rest }));\n};\nexport default withTheme(Divider);\n"]}
1
+ {"version":3,"sources":["Divider.tsx"],"names":["Divider","style","color","theme","colors","rest","backgroundColor","divider","height","StyleSheet","hairlineWidth"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AASA,MAAMA,OAAwB,GAAG,QAK3B;AAAA,MAL4B;AAChCC,IAAAA,KADgC;AAEhCC,IAAAA,KAFgC;AAGhCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA;AAAF,KAHyB;AAIhC,OAAGC;AAJ6B,GAK5B;AACJ,sBACE,oBAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACL;AACEC,MAAAA,eAAe,EAAEJ,KAAK,IAAIE,MAAM,CAACG,OADnC;AAEEC,MAAAA,MAAM,EAAEC,wBAAWC;AAFrB,KADK,EAKLT,KALK;AADT,KAQMI,IARN,EADF;AAYD,CAlBD;;eAoBe,wBAAUL,OAAV,C","sourcesContent":["import * as React from \"react\";\nimport { StyleSheet, View, StyleProp, ViewStyle } from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport theme from \"../styles/DefaultTheme\";\n\ntype Props = {\n style?: StyleProp<ViewStyle>;\n color?: string;\n theme: typeof theme;\n};\n\nconst Divider: React.FC<Props> = ({\n style,\n color,\n theme: { colors },\n ...rest\n}) => {\n return (\n <View\n style={[\n {\n backgroundColor: color || colors.divider,\n height: StyleSheet.hairlineWidth,\n },\n style,\n ]}\n {...rest}\n />\n );\n};\n\nexport default withTheme(Divider);\n"]}
@@ -13,6 +13,8 @@ var _theming = require("../theming");
13
13
 
14
14
  var _IconButton = _interopRequireDefault(require("./IconButton"));
15
15
 
16
+ var _lodash = _interopRequireDefault(require("lodash.isnumber"));
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
18
20
  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); }
@@ -23,6 +25,8 @@ const Stepper = _ref => {
23
25
  let {
24
26
  Icon,
25
27
  value,
28
+ min,
29
+ max,
26
30
  style,
27
31
  onChange,
28
32
  defaultValue,
@@ -38,32 +42,37 @@ const Stepper = _ref => {
38
42
  } = _ref;
39
43
  const [stateValue, setStateValue] = React.useState(value || defaultValue || 0);
40
44
  React.useEffect(() => {
41
- if (value != null) {
42
- setStateValue(value);
45
+ if (value || value === 0) {
46
+ onChange && onChange(stateValue);
43
47
  }
44
- }, [value]);
48
+ }, [onChange, stateValue, value]);
45
49
  React.useEffect(() => {
46
- if (defaultValue != null) {
47
- setStateValue(defaultValue);
50
+ let newValue = value || defaultValue || 0;
51
+
52
+ if ((0, _lodash.default)(max) && newValue > max) {
53
+ newValue = max;
48
54
  }
49
- }, [defaultValue]);
50
55
 
51
- const handleMinus = () => {
52
- if (value || value === 0) {
53
- onChange && onChange(value - 1);
54
- } else {
55
- setStateValue(stateValue - 1);
56
+ if ((0, _lodash.default)(min) && newValue < min) {
57
+ newValue = min;
56
58
  }
57
- };
58
59
 
59
- const handlePlus = () => {
60
- if (value || value === 0) {
61
- onChange && onChange(value + 1);
62
- } else {
63
- setStateValue(stateValue + 1);
60
+ setStateValue(newValue);
61
+ }, [defaultValue, value, min, max]);
62
+ const handleMinus = React.useCallback(() => {
63
+ if ((0, _lodash.default)(min) && value === min) {
64
+ return;
65
+ }
66
+
67
+ setStateValue(stateValue - 1);
68
+ }, [min, stateValue, value]);
69
+ const handlePlus = React.useCallback(() => {
70
+ if ((0, _lodash.default)(max) && value === max) {
71
+ return;
64
72
  }
65
- };
66
73
 
74
+ setStateValue(stateValue + 1);
75
+ }, [max, stateValue, value]);
67
76
  return /*#__PURE__*/React.createElement(_reactNative.View, {
68
77
  style: [{
69
78
  flexDirection: "row"
@@ -76,7 +85,7 @@ const Stepper = _ref => {
76
85
  onPress: handleMinus,
77
86
  size: iconSize,
78
87
  color: iconColor,
79
- disabled: value ? value === 0 : stateValue === 0
88
+ disabled: stateValue === 0
80
89
  }), /*#__PURE__*/React.createElement(_reactNative.Text, {
81
90
  style: [typography.body1, {
82
91
  textAlign: "center",
@@ -1 +1 @@
1
- {"version":3,"sources":["Stepper.tsx"],"names":["Stepper","Icon","value","style","onChange","defaultValue","theme","colors","typography","roundness","iconSize","iconColor","strong","borderRadius","typeStyle","stateValue","setStateValue","React","useState","useEffect","handleMinus","handlePlus","flexDirection","body1","textAlign","alignSelf","color","medium","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAIA;;;;;;;;AAcA,MAAMA,OAAwB,GAAG,QAW3B;AAAA,MAX4B;AAChCC,IAAAA,IADgC;AAEhCC,IAAAA,KAFgC;AAGhCC,IAAAA,KAHgC;AAIhCC,IAAAA,QAJgC;AAKhCC,IAAAA,YALgC;AAMhCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,UAAV;AAAsBC,MAAAA;AAAtB,KANyB;AAOhCC,IAAAA,QAAQ,GAAG,EAPqB;AAQhCC,IAAAA,SAAS,GAAGJ,MAAM,CAACK,MARa;AAShCC,IAAAA,YAAY,GAAGJ,SATiB;AAUhCK,IAAAA;AAVgC,GAW5B;AACJ,QAAM,CAACC,UAAD,EAAaC,aAAb,IAA8BC,KAAK,CAACC,QAAN,CAClChB,KAAK,IAAIG,YAAT,IAAyB,CADS,CAApC;AAIAY,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAIjB,KAAK,IAAI,IAAb,EAAmB;AACjBc,MAAAA,aAAa,CAACd,KAAD,CAAb;AACD;AACF,GAJD,EAIG,CAACA,KAAD,CAJH;AAMAe,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAId,YAAY,IAAI,IAApB,EAA0B;AACxBW,MAAAA,aAAa,CAACX,YAAD,CAAb;AACD;AACF,GAJD,EAIG,CAACA,YAAD,CAJH;;AAMA,QAAMe,WAAW,GAAG,MAAM;AACxB,QAAIlB,K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EAAEoB,UAHX;AAIE,IAAA,IAAI,EAAEX,QAJR;AAKE,IAAA,KAAK,EAAEC;AALT,IA7BF,CADF;AAuCD,CAnFD;;eAqFe,wBAAUX,OAAV,C","sourcesContent":["import * as React from \"react\";\nimport { View, Text, StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\nimport IconButton from \"./IconButton\";\n\ntype Props = {\n value?: number;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n onChange?: (value: number) => void;\n defaultValue?: number;\n iconSize?: number;\n iconColor?: string;\n borderRadius?: number;\n typeStyle?: StyleProp<TextStyle>;\n} & IconSlot;\n\nconst Stepper: React.FC<Props> = ({\n Icon,\n value,\n style,\n onChange,\n defaultValue,\n theme: { colors, typography, roundness },\n iconSize = 24,\n iconColor = colors.strong,\n borderRadius = roundness,\n typeStyle,\n}) => {\n const [stateValue, setStateValue] = React.useState(\n value || defaultValue || 0\n );\n\n React.useEffect(() => {\n if (value != null) {\n setStateValue(value);\n }\n }, [value]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setStateValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handleMinus = () => {\n if (value || value === 0) {\n onChange && onChange(value - 1);\n } else {\n setStateValue(stateValue - 1);\n }\n };\n\n const handlePlus = () => {\n if (value || value === 0) {\n onChange && onChange(value + 1);\n } else {\n setStateValue(stateValue + 1);\n }\n };\n\n return (\n <View\n style={[\n { flexDirection: \"row\" },\n style,\n borderRadius ? { borderRadius } : {},\n ]}\n >\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/remove\"\n onPress={handleMinus}\n size={iconSize}\n color={iconColor}\n disabled={value ? value === 0 : stateValue === 0}\n />\n <Text\n style={[\n typography.body1,\n {\n textAlign: \"center\",\n alignSelf: \"center\",\n color: colors.medium,\n marginHorizontal: 8,\n },\n typeStyle,\n ]}\n >\n {value || stateValue}\n </Text>\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/add\"\n onPress={handlePlus}\n size={iconSize}\n color={iconColor}\n />\n </View>\n );\n};\n\nexport default withTheme(Stepper);\n"]}
1
+ {"version":3,"sources":["Stepper.tsx"],"names":["Stepper","Icon","value","min","max","style","onChange","defaultValue","theme","colors","typography","roundness","iconSize","iconColor","strong","borderRadius","typeStyle","stateValue","setStateValue","React","useState","useEffect","newValue","handleMinus","useCallback","handlePlus","flexDirection","body1","textAlign","alignSelf","color","medium","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;;;;;;;AAgBA,MAAMA,OAAwB,GAAG,QAa3B;AAAA,MAb4B;AAChCC,IAAAA,IADgC;AAEhCC,IAAAA,KAFgC;AAGhCC,IAAAA,GAHgC;AAIhCC,IAAAA,GAJgC;AAKhCC,IAAAA,KALgC;AAMhCC,IAAAA,QANgC;AAOhCC,IAAAA,YAPgC;AAQhCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,UAAV;AAAsBC,MAAAA;AAAtB,KARyB;AAShCC,IAAAA,QAAQ,GAAG,EATqB;AAUhCC,IAAAA,SAAS,GAAGJ,MAAM,CAACK,MAVa;AAWhCC,IAAAA,YAAY,GAAGJ,SAXiB;AAYhCK,IAAAA;AAZgC,GAa5B;AACJ,QAAM,CAACC,UAAD,EAAaC,aAAb,IAA8BC,KAAK,CAACC,QAAN,CAClClB,KAAK,IAAIK,YAAT,IAAyB,CADS,CAApC;AAIAY,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAInB,KAAK,IAAIA,KAAK,KAAK,CAAvB,EAA0B;AACxBI,MAAAA,QAAQ,IAAIA,QAAQ,CAACW,UAAD,CAApB;AACD;AACF,GAJD,EAIG,CAACX,QAAD,EAAWW,UAAX,EAAuBf,KAAvB,CAJH;AAMAiB,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAIC,QAAQ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AAME,IAAA,QAAQ,EAAEI,UAAU,KAAK;AAN3B,IAPF,eAeE,oBAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACLP,UAAU,CAACiB,KADN,EAEL;AACEC,MAAAA,SAAS,EAAE,QADb;AAEEC,MAAAA,SAAS,EAAE,QAFb;AAGEC,MAAAA,KAAK,EAAErB,MAAM,CAACsB,MAHhB;AAIEC,MAAAA,gBAAgB,EAAE;AAJpB,KAFK,EAQLhB,SARK;AADT,KAYGd,KAAK,IAAIe,UAZZ,CAfF,eA6BE,oBAAC,mBAAD;AACE,IAAA,IAAI,EAAEhB,IADR;AAEE,IAAA,IAAI,EAAC,mBAFP;AAGE,IAAA,OAAO,EAAEwB,UAHX;AAIE,IAAA,IAAI,EAAEb,QAJR;AAKE,IAAA,KAAK,EAAEC;AALT,IA7BF,CADF;AAuCD,CAxFD;;eA0Fe,wBAAUb,OAAV,C","sourcesContent":["import * as React from \"react\";\nimport { View, Text, StyleProp, ViewStyle, TextStyle } from \"react-native\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\nimport IconButton from \"./IconButton\";\nimport isNumber from \"lodash.isnumber\";\n\ntype Props = {\n value?: number;\n min?: number;\n max?: number;\n theme: Theme;\n style?: StyleProp<ViewStyle>;\n onChange?: (value: number) => void;\n defaultValue?: number;\n iconSize?: number;\n iconColor?: string;\n borderRadius?: number;\n typeStyle?: StyleProp<TextStyle>;\n} & IconSlot;\n\nconst Stepper: React.FC<Props> = ({\n Icon,\n value,\n min,\n max,\n style,\n onChange,\n defaultValue,\n theme: { colors, typography, roundness },\n iconSize = 24,\n iconColor = colors.strong,\n borderRadius = roundness,\n typeStyle,\n}) => {\n const [stateValue, setStateValue] = React.useState(\n value || defaultValue || 0\n );\n\n React.useEffect(() => {\n if (value || value === 0) {\n onChange && onChange(stateValue);\n }\n }, [onChange, stateValue, value]);\n\n React.useEffect(() => {\n let newValue = value || defaultValue || 0;\n if (isNumber(max) && newValue > max) {\n newValue = max;\n }\n if (isNumber(min) && newValue < min) {\n newValue = min;\n }\n setStateValue(newValue);\n }, [defaultValue, value, min, max]);\n\n const handleMinus = React.useCallback(() => {\n if (isNumber(min) && value === min) {\n return;\n }\n setStateValue(stateValue - 1);\n }, [min, stateValue, value]);\n\n const handlePlus = React.useCallback(() => {\n if (isNumber(max) && value === max) {\n return;\n }\n setStateValue(stateValue + 1);\n }, [max, stateValue, value]);\n\n return (\n <View\n style={[\n { flexDirection: \"row\" },\n style,\n borderRadius ? { borderRadius } : {},\n ]}\n >\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/remove\"\n onPress={handleMinus}\n size={iconSize}\n color={iconColor}\n disabled={stateValue === 0}\n />\n <Text\n style={[\n typography.body1,\n {\n textAlign: \"center\",\n alignSelf: \"center\",\n color: colors.medium,\n marginHorizontal: 8,\n },\n typeStyle,\n ]}\n >\n {value || stateValue}\n </Text>\n <IconButton\n Icon={Icon}\n icon=\"MaterialIcons/add\"\n onPress={handlePlus}\n size={iconSize}\n color={iconColor}\n />\n </View>\n );\n};\n\nexport default withTheme(Stepper);\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","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,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,IAAoCC,KAAK,CAACC,QAAN,CACxCjB,OAAO,IAAIE,YAAX,IAA2B,KADa,CAA1C;AAIAc,EAAAA,K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ming\";\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"]}
@@ -25,6 +25,15 @@ const SEED_DATA = [{
25
25
  }),
26
26
  iconColor: (0, _types.createColorProp)({
27
27
  defaultValue: "strong"
28
+ }),
29
+ min: (0, _types.createStaticNumberProp)({
30
+ label: "Minimum",
31
+ description: "Minimum Number",
32
+ defaultValue: 0
33
+ }),
34
+ max: (0, _types.createStaticNumberProp)({
35
+ label: "Maximum",
36
+ description: "Maximum Number"
28
37
  })
29
38
  }
30
39
  }];
@@ -1 +1 @@
1
- {"version":3,"sources":["Stepper.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","input","layout","triggers","Triggers","OnChange","props","fieldName","defaultValue","handlerPropName","valuePropName","iconSize","iconColor"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,SADR;AAEEC,EAAAA,GAAG,EAAE,SAFP;AAGEC,EAAAA,WAAW,EAAE,uDAHf;AAIEC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJ5B;AAKEC,EAAAA,MAAM,EAAE,EALV;AAMEC,EAAAA,QAAQ,EAAE,CAACC,gBAASC,QAAV,CANZ;AAOEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,gCAAoB;AAC7BC,MAAAA,YAAY,EAAE,cADe;AAE7BC,MAAAA,eAAe,EAAE,UAFY;AAG7BC,MAAAA,aAAa,EAAE;AAHc,KAApB,CADN;AAMLC,IAAAA,QAAQ,EAAE,+BAAmB;AAAEH,MAAAA,YAAY,EAAE;AAAhB,KAAnB,CANL;AAOLI,IAAAA,SAAS,EAAE,4BAAgB;AAAEJ,MAAAA,YAAY,EAAE;AAAhB,KAAhB;AAPN;AAPT,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createIconSizeProp,\n createColorProp,\n createFieldNameProp,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Stepper\",\n tag: \"Stepper\",\n description: \"A component used to control the quantity of something\",\n category: COMPONENT_TYPES.input,\n layout: {},\n triggers: [Triggers.OnChange],\n props: {\n fieldName: createFieldNameProp({\n defaultValue: \"stepperValue\",\n handlerPropName: \"onChange\",\n valuePropName: \"value\",\n }),\n iconSize: createIconSizeProp({ defaultValue: 24 }),\n iconColor: createColorProp({ defaultValue: \"strong\" }),\n },\n },\n];\n"]}
1
+ {"version":3,"sources":["Stepper.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","input","layout","triggers","Triggers","OnChange","props","fieldName","defaultValue","handlerPropName","valuePropName","iconSize","iconColor","min","label","max"],"mappings":";;;;;;;AAAA;;AASO,MAAMA,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,SADR;AAEEC,EAAAA,GAAG,EAAE,SAFP;AAGEC,EAAAA,WAAW,EAAE,uDAHf;AAIEC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAJ5B;AAKEC,EAAAA,MAAM,EAAE,EALV;AAMEC,EAAAA,QAAQ,EAAE,CAACC,gBAASC,QAAV,CANZ;AAOEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,gCAAoB;AAC7BC,MAAAA,YAAY,EAAE,cADe;AAE7BC,MAAAA,eAAe,EAAE,UAFY;AAG7BC,MAAAA,aAAa,EAAE;AAHc,KAApB,CADN;AAMLC,IAAAA,QAAQ,EAAE,+BAAmB;AAAEH,MAAAA,YAAY,EAAE;AAAhB,KAAnB,CANL;AAOLI,IAAAA,SAAS,EAAE,4BAAgB;AAAEJ,MAAAA,YAAY,EAAE;AAAhB,KAAhB,CAPN;AAQLK,IAAAA,GAAG,EAAE,mCAAuB;AAC1BC,MAAAA,KAAK,EAAE,SADmB;AAE1BhB,MAAAA,WAAW,EAAE,gBAFa;AAG1BU,MAAAA,YAAY,EAAE;AAHY,KAAvB,CARA;AAaLO,IAAAA,GAAG,EAAE,mCAAuB;AAC1BD,MAAAA,KAAK,EAAE,SADmB;AAE1BhB,MAAAA,WAAW,EAAE;AAFa,KAAvB;AAbA;AAPT,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createIconSizeProp,\n createColorProp,\n createFieldNameProp,\n createStaticNumberProp,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Stepper\",\n tag: \"Stepper\",\n description: \"A component used to control the quantity of something\",\n category: COMPONENT_TYPES.input,\n layout: {},\n triggers: [Triggers.OnChange],\n props: {\n fieldName: createFieldNameProp({\n defaultValue: \"stepperValue\",\n handlerPropName: \"onChange\",\n valuePropName: \"value\",\n }),\n iconSize: createIconSizeProp({ defaultValue: 24 }),\n iconColor: createColorProp({ defaultValue: \"strong\" }),\n min: createStaticNumberProp({\n label: \"Minimum\",\n description: \"Minimum Number\",\n defaultValue: 0,\n }),\n max: createStaticNumberProp({\n label: \"Maximum\",\n description: \"Maximum Number\",\n }),\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","color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CAAuB;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,OAAO,EAAE,iCAAqB;AAC1BR,MAAAA,KAAK,EAAE,YADmB;AAE1BV,MAAAA,WAAW,EAAE;AAFa,KAArB,CAlBN;AAsBHmB,IAAAA,iBAAiB,EAAE,iCAAqB;AACpCT,MAAAA,KAAK,EAAE,qBAD6B;AAEpCV,MAAAA,WA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, 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,KAAjB,CAXT;AAkBLC,IAAAA,UAAU,EAAE,kCAlBP;AAmBLC,IAAAA,OAAO,EAAE,iCAAqB;AAC5BR,MAAAA,KAAK,EAAE,YADqB;AAE5BV,MAAAA,WAAW,EAAE;AAFe,KAArB,CAnBJ;AAuBLmB,IAAAA,iBAAi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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,YAVoB;AAUN;AACdC,MAAAA,aAXoB;AAWL;AACfC,MAAAA,WAZoB;AAYP;AACb,SAAGb;AAbiB;AAAd,MAaeX,aAAa,CAACG,KAAD,CAblC;AAcA,QAAMsB,SAAS,GAAGhC,KAAK,CAACiC,MAAN,CAAaC,SAAb,CAAlB;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;AAInHC,MAAAA,IAAI,EAAE,CAJ6G;AAKnHC,MAAAA,KAAK,EAAE,CAL4G;AAMnHC,MAAAA,MAAM,EAAE,CAN2G;AAOnHC,MAAAA,KAAK,EAAE;AAP4G;AAAzF,GAAlC,EAQS9C,OAAO,CAAC+C,GAAR,CAAaf,CAAD,iBAAQ3C,KAAK,CAAC8C,aAAN,CAAoBxC,YAAY,CAACqD,IAAjC,EAAuC;AAAEd,IAAAA,KAAK,EAAEF,CAAC,CAACE,KAAX;AAAkBD,IAAAA,KAAK,EAAED,CAAC,CAACC,KAA3B;AAAkCgB,IAAAA,GAAG,EAAEjB,CAAC,CAACC;AAAzC,GAAvC,CAApB,CART,CADJ,eAUI5C,KAAK,CAAC8C,aAAN,CAAoB7C,IAApB,EAA0B;AAAE4D,IAAAA,aAAa,EAAE;AAAjB,GAA1B,eACI7D,KAAK,CAAC8C,aAAN,CAAoBtC,SAApB,EAA+B,EAAE,GAAGS,KAAL;AAAY2B,IAAAA,KAAK,EAAEH,aAAnB;AAAkC7B,IAAAA,WAAW,EAAEA,WAA/C;AAC3B;AACAkD,IAAAA,GAAG,EAAE9B,SAFsB;AAEXlB,IAAAA,QAAQ,EAAEA,QAFC;AAG3B;AACAJ,IAAAA,KAAK,EAAE6B;AAJoB,GAA/B,CADJ,CAVJ,CADI,CAAR;AAiBH,CArDD;;AAsDA,MAAMS,MAAM,GAAG9C,UAAU,CAAC6D,MAAX,CAAkB;AAC7Bd,EAAAA,SAAS,EAAE;AACPe,IAAAA,SAAS,EAAE;AADJ;AADkB,CAAlB,CAAf;AAKA,eAAe5D,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\";\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,IAAAA,QAAQ,GAAG,KALmC;AAM9CC,IAAAA,aAAa,EAAEC,qBAAqB,GAAG,MAAM,CAAE,CAND;AAO9C,OAAGC;AAP2C,GAQ1C;AACJ,QAAM;AACJC,IAAAA,UAAU,EAAE;AACVC,MAAAA,YADU;AACI;AACdC,MAAAA,WAFU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,kBAKE,oBAAC,IAAD,qBACE,oBAAC,YAAD;AACE,IAAA,OAAO,EAAE,CAACJ,QADZ;AAEE,IAAA,aAAa,EAAED,aAFjB;AAGE,IAAA,aAAa,EAAEE,aAHjB;AAIE,IAAA,KAAK,EAAE;AACLiC,MAAAA,OAAO,EAAE,CADJ;AAELC,MAAAA,QAAQ,EAAE,UAFL;AAGLC,MAAAA,GAAG,EAAE,CAHA;AAILC,MAAAA,IAAI,EAAE,CAJD;AAKLC,MAAAA,KAAK,EAAE,CALF;AAMLC,MAAAA,MAAM,EAAE,CANH;AAOLC,MAAAA,KAAK,EAAE;AAPF;AAJT,KAcG3C,OAAO,CAAC4C,GAAR,CAAaZ,CAAD,iBACX,oBAAC,YAAD,CAAc,IAAd;AAAmB,IAAA,KAAK,EAAEA,CAAC,CAACE,KAA5B;AAAmC,IAAA,KAAK,EAAEF,CAAC,CAACC,KAA5C;AAAmD,IAAA,GAAG,EAAED,CAAC,CAACC;AAA1D,IADD,CAdH,CADF,eAmBE,oBAAC,IAAD;AAAM,IAAA,aAAa,EAAC;AAApB,kBACE,oBAAC,SAAD,eACM3B,KADN;AAEE,IAAA,KAAK,EAAEwB,aAFT;AAGE,IAAA,WAAW,EAAE7B,WAHf,CAIE;AAJF;AAKE,IAAA,GAAG,EAAEoB,SALP,CAKkB;AALlB;AAME,IAAA,QAAQ,EAAElB,QANZ,CAOE;AAPF;AAQE,IAAA,KAAK,EAAEyB;AART,KADF,CAnBF,CALF,CADF;AAwCD,CAhGD;;AAkGA,MAAMO,MAAM,GAAG5C,UAAU,CAACsD,MAAX,CAAkB;AAC/BT,EAAAA,SAAS,EAAE;AACTU,IAAAA,SAAS,EAAE;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"]}
@@ -1,5 +1,3 @@
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
-
3
1
  import React from "react";
4
2
  import { View } from "react-native";
5
3
  import Text from "../Text";
@@ -22,9 +20,10 @@ const RadioButtonFieldGroup = _ref => {
22
20
  fontSize: theme.typography.headline4.fontSize,
23
21
  color: theme.typography.headline4.color
24
22
  }, labelStyle]
25
- }, label), /*#__PURE__*/React.createElement(RadioButtonGroup, _extends({
26
- theme: theme
27
- }, rest), children));
23
+ }, label), /*#__PURE__*/React.createElement(RadioButtonGroup, {
24
+ theme: theme,
25
+ ...rest
26
+ }, children));
28
27
  };
29
28
 
30
29
  export default withTheme(RadioButtonFieldGroup);