@draftbit/core 43.2.5 → 43.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/lib/commonjs/components/Checkbox/Checkbox.js +13 -2
  2. package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -1
  3. package/lib/commonjs/components/DeprecatedFAB.js +4 -20
  4. package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
  5. package/lib/commonjs/components/Elevation.js +14 -3
  6. package/lib/commonjs/components/Elevation.js.map +1 -1
  7. package/lib/commonjs/index.js +0 -8
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/mappings/ActionSheet.js.map +1 -1
  10. package/lib/commonjs/mappings/Card.js +1 -2
  11. package/lib/commonjs/mappings/Card.js.map +1 -1
  12. package/lib/commonjs/mappings/Checkbox.js +1 -1
  13. package/lib/commonjs/mappings/Checkbox.js.map +1 -1
  14. package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
  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/Accordion/index.js.map +1 -1
  19. package/lib/module/components/Checkbox/Checkbox.js +13 -2
  20. package/lib/module/components/Checkbox/Checkbox.js.map +1 -1
  21. package/lib/module/components/Picker/PickerComponent.android.js +7 -10
  22. package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
  23. package/lib/module/components/Portal/PortalManager.js +1 -1
  24. package/lib/module/components/Portal/PortalManager.js.map +1 -1
  25. package/lib/module/components/RowBodyIcon.js.map +1 -1
  26. package/lib/module/index.js +0 -1
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/mappings/Card.js +1 -2
  29. package/lib/module/mappings/Card.js.map +1 -1
  30. package/lib/module/mappings/Checkbox.js +1 -1
  31. package/lib/module/mappings/Checkbox.js.map +1 -1
  32. package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -0
  33. package/lib/typescript/src/index.d.ts +0 -1
  34. package/package.json +3 -3
  35. package/src/components/Checkbox/Checkbox.js +10 -3
  36. package/src/components/Checkbox/Checkbox.tsx +15 -2
  37. package/src/index.js +0 -1
  38. package/src/index.tsx +0 -1
  39. package/src/mappings/Card.js +1 -1
  40. package/src/mappings/Card.ts +1 -1
  41. package/src/mappings/Checkbox.js +1 -1
  42. package/src/mappings/Checkbox.ts +1 -1
  43. package/lib/commonjs/components/ToggleButton.js +0 -86
  44. package/lib/commonjs/components/ToggleButton.js.map +0 -1
  45. package/lib/commonjs/mappings/ToggleButton.js +0 -60
  46. package/lib/commonjs/mappings/ToggleButton.js.map +0 -1
  47. package/lib/module/components/ToggleButton.js +0 -67
  48. package/lib/module/components/ToggleButton.js.map +0 -1
  49. package/lib/module/mappings/ToggleButton.js +0 -51
  50. package/lib/module/mappings/ToggleButton.js.map +0 -1
  51. package/lib/typescript/src/components/ToggleButton.d.ts +0 -24
  52. package/lib/typescript/src/mappings/ToggleButton.d.ts +0 -124
  53. package/src/components/ToggleButton.js +0 -39
  54. package/src/components/ToggleButton.tsx +0 -94
  55. package/src/mappings/ToggleButton.js +0 -50
  56. package/src/mappings/ToggleButton.ts +0 -62
@@ -2,10 +2,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
2
2
 
3
3
  import * as React from "react";
4
4
  import { View, StyleSheet } from "react-native";
5
+
5
6
  /**
6
7
  * Portal host is the component which actually renders all Portals.
7
8
  */
8
-
9
9
  export default class PortalManager extends React.PureComponent {
10
10
  constructor() {
11
11
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"sources":["PortalManager.js"],"names":["React","View","StyleSheet","PortalManager","PureComponent","portals","key","children","setState","state","map","item","filter","render","createElement","collapsable","pointerEvents","style","absoluteFill"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,EAAeC,UAAf,QAAiC,cAAjC;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;AAAoKC,QAAAA,KAAK,EAAEf,UAAU,CAACgB;AAAtL,OAA1B,EAAgOX,QAAhO,CAAxB;AAAA,KAAvB,CAAP;AACH;;AAtB0D","sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\n/**\n * Portal host is the component which actually renders all Portals.\n */\nexport default class PortalManager extends React.PureComponent {\n state = {\n portals: [],\n };\n mount = (key, children) => {\n this.setState((state) => ({\n portals: [...state.portals, { key, children }],\n }));\n };\n update = (key, children) => this.setState((state) => ({\n portals: state.portals.map((item) => {\n if (item.key === key) {\n return { ...item, children };\n }\n return item;\n }),\n }));\n unmount = (key) => this.setState((state) => ({\n portals: state.portals.filter((item) => item.key !== key),\n }));\n render() {\n return this.state.portals.map(({ key, children }) => (React.createElement(View, { key: key, collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */, pointerEvents: \"box-none\", style: StyleSheet.absoluteFill }, children)));\n }\n}\n"]}
1
+ {"version":3,"sources":["PortalManager.tsx"],"names":["React","View","StyleSheet","PortalManager","PureComponent","portals","key","children","setState","state","map","item","filter","render","absoluteFill"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,EAAeC,UAAf,QAAiC,cAAjC;;AASA;AACA;AACA;AACA,eAAe,MAAMC,aAAN,SAA4BH,KAAK,CAACI,aAAlC,CAA2D;AAAA;AAAA;;AAAA,mCACzD;AACbC,MAAAA,OAAO,EAAE;AADI,KADyD;;AAAA,mCAKhE,CAACC,GAAD,EAAcC,QAAd,KAA4C;AAClD,WAAKC,QAAL,CAAeC,KAAD,KAAY;AACxBJ,QAAAA,OAAO,EAAE,CAAC,GAAGI,KAAK,CAACJ,OAAV,EAAmB;AAAEC,UAAAA,GAAF;AAAOC,UAAAA;AAAP,SAAnB;AADe,OAAZ,CAAd;AAGD,KATuE;;AAAA,oCAW/D,CAACD,GAAD,EAAcC,QAAd,KACP,KAAKC,QAAL,CAAeC,KAAD,KAAY;AACxBJ,MAAAA,OAAO,EAAEI,KAAK,CAACJ,OAAN,CAAcK,GAAd,CAAmBC,IAAD,IAAU;AACnC,YAAIA,IAAI,CAACL,GAAL,KAAaA,GAAjB,EAAsB;AACpB,iBAAO,EAAE,GAAGK,IAAL;AAAWJ,YAAAA;AAAX,WAAP;AACD;;AACD,eAAOI,IAAP;AACD,OALQ;AADe,KAAZ,CAAd,CAZsE;;AAAA,qCAqB7DL,GAAD,IACR,KAAKE,QAAL,CAAeC,KAAD,KAAY;AACxBJ,MAAAA,OAAO,EAAEI,KAAK,CAACJ,OAAN,CAAcO,MAAd,CAAsBD,IAAD,IAAUA,IAAI,CAACL,GAAL,KAAaA,GAA5C;AADe,KAAZ,CAAd,CAtBsE;AAAA;;AA0BxEO,EAAAA,MAAM,GAAG;AACP,WAAO,KAAKJ,KAAL,CAAWJ,OAAX,CAAmBK,GAAnB,CAAuB;AAAA,UAAC;AAAEJ,QAAAA,GAAF;AAAOC,QAAAA;AAAP,OAAD;AAAA,0BAC5B,oBAAC,IAAD;AACE,QAAA,GAAG,EAAED,GADP;AAEE,QAAA,WAAW,EACT;AAAM;AAHV;AAKE,QAAA,aAAa,EAAC,UALhB;AAME,QAAA,KAAK,EAAEJ,UAAU,CAACY;AANpB,SAQGP,QARH,CAD4B;AAAA,KAAvB,CAAP;AAYD;;AAvCuE","sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet } from \"react-native\";\n\ntype State = {\n portals: Array<{\n key: number;\n children: React.ReactNode;\n }>;\n};\n\n/**\n * Portal host is the component which actually renders all Portals.\n */\nexport default class PortalManager extends React.PureComponent<{}, State> {\n state: State = {\n portals: [],\n };\n\n mount = (key: number, children: React.ReactNode) => {\n this.setState((state) => ({\n portals: [...state.portals, { key, children }],\n }));\n };\n\n update = (key: number, children: React.ReactNode) =>\n this.setState((state) => ({\n portals: state.portals.map((item) => {\n if (item.key === key) {\n return { ...item, children };\n }\n return item;\n }),\n }));\n\n unmount = (key: number) =>\n this.setState((state) => ({\n portals: state.portals.filter((item) => item.key !== key),\n }));\n\n render() {\n return this.state.portals.map(({ key, children }) => (\n <View\n key={key}\n collapsable={\n false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */\n }\n pointerEvents=\"box-none\"\n style={StyleSheet.absoluteFill}\n >\n {children}\n </View>\n ));\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["RowBodyIcon.js"],"names":["React","withTheme","Row","Config","RowBodyIcon","Icon","title","subtitle","icon","style","theme","colors","typography","createElement","titleTypeStyle","body1","titleColor","medium","subtitleTypeStyle","subtitle2","subtitleColor","light","right","name","size","rowSingleLineIconSize","color","marginLeft"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AACA,OAAOC,GAAP,MAAgB,OAAhB;AACA,OAAOC,MAAP,MAAmB,UAAnB;;AACA,MAAMC,WAAW,GAAG,QAA4E;AAAA,MAA3E;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA,QAAf;AAAyBC,IAAAA,IAAzB;AAA+BC,IAAAA,KAA/B;AAAsCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AAA7C,GAA2E;AAC5F,sBAAQZ,KAAK,CAACa,aAAN,CAAoBX,GAApB,EAAyB;AAAEY,IAAAA,cAAc,EAAEF,UAAU,CAACG,KAA7B;AAAoCC,IAAAA,UAAU,EAAEL,MAAM,CAACM,MAAvD;AAA+DC,IAAAA,iBAAiB,EAAEN,UAAU,CAACO,SAA7F;AAAwGC,IAAAA,aAAa,EAAET,MAAM,CAACU,KAA9H;AAAqIf,IAAAA,KAAK,EAAEA,KAA5I;AAAmJC,IAAAA,QAAQ,EAAEA,QAA7J;AAAuKe,IAAAA,KAAK,EAAE,mBAAOtB,KAAK,CAACa,aAAN,CAAoBR,IAApB,EAA0B;AAAEkB,MAAAA,IAAI,EAAEf,IAAR;AAAcgB,MAAAA,IAAI,EAAErB,MAAM,CAACsB,qBAA3B;AAAkDC,MAAAA,KAAK,EAAEf,MAAM,CAACU,KAAhE;AAAuEZ,MAAAA,KAAK,EAAE;AAAEkB,QAAAA,UAAU,EAAE;AAAd;AAA9E,KAA1B,CAArL;AAAqTlB,IAAAA,KAAK,EAAEA;AAA5T,GAAzB,CAAR;AACH,CAFD;;AAGA,eAAeR,SAAS,CAACG,WAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport Row from \"./Row\";\nimport Config from \"./Config\";\nconst RowBodyIcon = ({ Icon, title, subtitle, icon, style, theme: { colors, typography }, }) => {\n return (React.createElement(Row, { titleTypeStyle: typography.body1, titleColor: colors.medium, subtitleTypeStyle: typography.subtitle2, subtitleColor: colors.light, title: title, subtitle: subtitle, right: () => (React.createElement(Icon, { name: icon, size: Config.rowSingleLineIconSize, color: colors.light, style: { marginLeft: 16 } })), style: style }));\n};\nexport default withTheme(RowBodyIcon);\n"]}
1
+ {"version":3,"sources":["RowBodyIcon.tsx"],"names":["React","withTheme","Row","Config","RowBodyIcon","Icon","title","subtitle","icon","style","theme","colors","typography","body1","medium","subtitle2","light","rowSingleLineIconSize","marginLeft"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AAIA,OAAOC,GAAP,MAAgB,OAAhB;AACA,OAAOC,MAAP,MAAmB,UAAnB;;AAWA,MAAMC,WAA4B,GAAG,QAO/B;AAAA,MAPgC;AACpCC,IAAAA,IADoC;AAEpCC,IAAAA,KAFoC;AAGpCC,IAAAA,QAHoC;AAIpCC,IAAAA,IAJoC;AAKpCC,IAAAA,KALoC;AAMpCC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV;AAN6B,GAOhC;AACJ,sBACE,oBAAC,GAAD;AACE,IAAA,cAAc,EAAEA,UAAU,CAACC,KAD7B;AAEE,IAAA,UAAU,EAAEF,MAAM,CAACG,MAFrB;AAGE,IAAA,iBAAiB,EAAEF,UAAU,CAACG,SAHhC;AAIE,IAAA,aAAa,EAAEJ,MAAM,CAACK,KAJxB;AAKE,IAAA,KAAK,EAAEV,KALT;AAME,IAAA,QAAQ,EAAEC,QANZ;AAOE,IAAA,KAAK,EAAE,mBACL,oBAAC,IAAD;AACE,MAAA,IAAI,EAAEC,IADR;AAEE,MAAA,IAAI,EAAEL,MAAM,CAACc,qBAFf;AAGE,MAAA,KAAK,EAAEN,MAAM,CAACK,KAHhB;AAIE,MAAA,KAAK,EAAE;AAAEE,QAAAA,UAAU,EAAE;AAAd;AAJT,MARJ;AAeE,IAAA,KAAK,EAAET;AAfT,IADF;AAmBD,CA3BD;;AA6BA,eAAeR,SAAS,CAACG,WAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\nimport Row from \"./Row\";\nimport Config from \"./Config\";\nimport { StyleProp, ViewStyle } from \"react-native\";\n\ntype Props = {\n title?: string;\n subtitle?: string;\n icon: string;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst RowBodyIcon: React.FC<Props> = ({\n Icon,\n title,\n subtitle,\n icon,\n style,\n theme: { colors, typography },\n}) => {\n return (\n <Row\n titleTypeStyle={typography.body1}\n titleColor={colors.medium}\n subtitleTypeStyle={typography.subtitle2}\n subtitleColor={colors.light}\n title={title}\n subtitle={subtitle}\n right={() => (\n <Icon\n name={icon}\n size={Config.rowSingleLineIconSize}\n color={colors.light}\n style={{ marginLeft: 16 }}\n />\n )}\n style={style}\n />\n );\n};\n\nexport default withTheme(RowBodyIcon);\n"]}
@@ -22,7 +22,6 @@ export { default as StarRating } from "./components/StarRating";
22
22
  export { default as Surface } from "./components/Surface";
23
23
  export { default as Switch, SwitchRow } from "./components/Switch";
24
24
  export { default as TextField } from "./components/TextField";
25
- export { default as ToggleButton } from "./components/ToggleButton";
26
25
  export { default as Touchable } from "./components/Touchable";
27
26
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
28
27
  export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","ToggleButton","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"],"mappings":"AAAA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,WAAzC;AACA,SAASC,OAAO,IAAIC,QAApB,QAAoC,YAApC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,uBAAxC;AAEA,SAASC,IAAT,QAAqB,mBAArB;AACA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,qBAA3C;AACA,SAASL,OAAO,IAAIM,MAApB,QAAkC,0BAAlC;AACA,SAASN,OAAO,IAAIO,UAApB,QAAsC,yBAAtC;AACA,SAASP,OAAO,IAAIQ,IAApB,QAAgC,mBAAhC;AACA,SAASR,OAAO,IAAIS,QAApB,QAAoC,uBAApC;AACA,SAASC,QAAT,EAAmBC,aAAnB,EAAkCC,WAAlC,QAAqD,uBAArD;AACA,SAASZ,OAAO,I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ACA,SAASjD,OAAO,IAAIkD,UAApB,QAAsC,yBAAtC;AACA,SAASlD,OAAO,IAAImD,UAApB,QAAsC,oCAAtC;AACA,SAASnD,OAAO,IAAIoD,WAApB,QAAuC,0BAAvC;AACA,SAASpD,OAAO,IAAIqD,YAApB,QAAwC,2BAAxC;AACA,SAASrD,OAAO,IAAIsD,cAApB,QAA0C,6BAA1C;AACA,SAAStD,OAAO,IAAIuD,MAApB,QAAkC,4BAAlC;AACA,SAASvD,OAAO,IAAIwD,WAApB,QAAuC,0BAAvC;AACA,SAASxD,OAAO,IAAIyD,cAApB,QAA0C,6BAA1C;AACA,SAASzD,OAAO,IAAI0D,WAApB,QAAuC,0BAAvC;AACA,SAAS1D,OAAO,IAAI2D,uBAApB,QAAmD,sCAAnD;AACA,SAAS3D,OAAO,IAAI4D,oBAApB,QAAgD,mCAAhD;AACA,SAAS5D,OAAO,IAAI6D,MAApB,QAAkC,qBAAlC;AACA,SAAS7D,OAAO,IAAI8D,OAApB,QAAmC,sBAAnC;AACA,SAASC,YAAT,QAA6B,2BAA7B","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"],"mappings":"AAAA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,WAAzC;AACA,SAASC,OAAO,IAAIC,QAApB,QAAoC,YAApC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,uBAAxC;AAEA,SAASC,IAAT,QAAqB,mBAArB;AACA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,qBAA3C;AACA,SAASL,OAAO,IAAIM,MAApB,QAAkC,0BAAlC;AACA,SAASN,OAAO,IAAIO,UAApB,QAAsC,yBAAtC;AACA,SAASP,OAAO,IAAIQ,IAApB,QAAgC,mBAAhC;AACA,SAASR,OAAO,IAAIS,QAApB,QAAoC,uBAApC;AACA,SAASC,QAAT,EAAmBC,aAAnB,EAAkCC,WAAlC,QAAqD,uBAArD;AACA,SAASZ,OAAO,IAAIa,WAApB,QAAuC,0BAAvC;AACA,SAASb,OAAO,IAAIc,SAApB,QAAqC,wBAArC;AACA,SAASd,OAAO,IAAIe,OAApB,QAAmC,sBAAnC;AACA,SAASf,OAAO,IAAIgB,GAApB,QAA+B,kBAA/B;AACA,SAAShB,OAAO,IAAIiB,kBAApB,QAA8C,iCAA9C;AACA,SAAS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QAAkC,4BAAlC;AACA,SAAStD,OAAO,IAAIuD,WAApB,QAAuC,0BAAvC;AACA,SAASvD,OAAO,IAAIwD,cAApB,QAA0C,6BAA1C;AACA,SAASxD,OAAO,IAAIyD,WAApB,QAAuC,0BAAvC;AACA,SAASzD,OAAO,IAAI0D,uBAApB,QAAmD,sCAAnD;AACA,SAAS1D,OAAO,IAAI2D,oBAApB,QAAgD,mCAAhD;AACA,SAAS3D,OAAO,IAAI4D,MAApB,QAAkC,qBAAlC;AACA,SAAS5D,OAAO,IAAI6D,OAApB,QAAmC,sBAAnC;AACA,SAASC,YAAT,QAA6B,2BAA7B","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"]}
@@ -4,8 +4,7 @@ export const SEED_DATA = {
4
4
  tag: "Card",
5
5
  description: "A card you can customize however you'd like",
6
6
  category: COMPONENT_TYPES.card,
7
- triggers: [Triggers.OnPress],
8
- //TODO: when we support multiple triggers, add Triggers.OnPressIcon
7
+ triggers: [Triggers.OnPress, Triggers.OnPressIcon],
9
8
  props: {
10
9
  onPress: createActionProp(),
11
10
  onPressIcon: createActionProp({
@@ -1 +1 @@
1
- {"version":3,"sources":["Card.ts"],"names":["COMPONENT_TYPES","createElevationType","createTextProp","createImageProp","createIconProp","createAspectRatioProp","createStaticBoolProp","createTextStyle","createActionProp","Triggers","SEED_DATA","name","tag","description","category","card","triggers","OnPress","props","onPress","onPressIcon","handlerPropName","elevation","image","title","label","defaultValue","titleStyle","subtitle","subtitleStyle","descriptionStyle","icon","aspectRatio","textCentered"],"mappings":"AAAA,SACEA,eADF,EAEEC,mBAFF,EAGEC,cAHF,EAIEC,eAJF,EAKEC,cALF,EAMEC,qBANF,EAOEC,oBAPF,EAQEC,eARF,EASEC,gBATF,EAUEC,QAVF,QAWO,iBAXP;AAaA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,GAAG,EAAE,MAFkB;AAGvBC,EAAAA,WAAW,EAAE,6CAHU;AAIvBC,EAAAA,QAAQ,EAAEd,eAAe,CAACe,IAJH;AAKvBC,EAAAA,QAAQ,EAAE,CAACP,QAAQ,CAACQ,OAAV,CALa;AAKO;AAC9BC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAEX,gBAAgB,EADpB;AAELY,IAAAA,WAAW,EAAEZ,gBAAgB,CAAC;AAC5Ba,MAAAA,eAAe,EAAE;AADW,KAAD,CAFxB;AAKLC,IAAAA,SAAS,EAAErB,mBAAmB,CAAC,CAAD,CALzB;AAMLsB,IAAAA,KAAK,EAAEpB,eAAe,EANjB;AAOLqB,IAAAA,KAAK,EAAEtB,cAAc,CAAC;AACpBuB,MAAAA,KAAK,EAAE,OADa;AAEpBZ,MAAAA,WAAW,EAAE,kBAFO;AAGpB;AACAa,MAAAA,YAAY,EAAE;AAJM,KAAD,CAPhB;AAaLC,IAAAA,UAAU,EAAEpB,eAAe,CAAC;AAC1BkB,MAAAA,KAAK,EAAE;AADmB,KAAD,CAbtB;AAgBLG,IAAAA,QAAQ,EAAE1B,cAAc,CAAC;AACvBuB,MAAAA,KAAK,EAAE,UADgB;AAEvBZ,MAAAA,WAAW,EAAE,2BAFU;AAGvBa,MAAAA,YAAY,EAAE,IAHS,CAIvB;;AAJuB,KAAD,CAhBnB;AAsBLG,IAAAA,aAAa,EAAEtB,eAAe,CAAC;AAC7BkB,MAAAA,KAAK,EAAE;AADsB,KAAD,CAtBzB;AAyBLZ,IAAAA,WAAW,EAAEX,cAAc,CAAC;AAC1BuB,MAAAA,KAAK,EAAE,aADmB;AAE1BZ,MAAAA,WAAW,EAAE,mCAFa;AAG1B;AACA;AACAa,MAAAA,YAAY,EAAE;AALY,KAAD,CAzBtB;AAgCLI,IAAAA,gBAAgB,EAAEvB,eAAe,CAAC;AAChCkB,MAAAA,KAAK,EAAE;AADyB,KAAD,CAhC5B;AAmCLM,IAAAA,IAAI,EAAE3B,cAAc,EAnCf;AAoCL4B,IAAAA,WAAW,EAAE3B,qBAAqB,CAAC;AACjCqB,MAAAA,YAAY,EAAE;AADmB,KAAD,CApC7B;AAuCLO,IAAAA,YAAY,EAAE3B,oBAAoB,CAAC;AACjCmB,MAAAA,KAAK,EAAE,eAD0B;AAEjCZ,MAAAA,WAAW,EAAE;AAFoB,KAAD;AAvC7B;AANgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createElevationType,\n createTextProp,\n createImageProp,\n createIconProp,\n createAspectRatioProp,\n createStaticBoolProp,\n createTextStyle,\n createActionProp,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Card\",\n tag: \"Card\",\n description: \"A card you can customize however you'd like\",\n category: COMPONENT_TYPES.card,\n triggers: [Triggers.OnPress], //TODO: when we support multiple triggers, add Triggers.OnPressIcon\n props: {\n onPress: createActionProp(),\n onPressIcon: createActionProp({\n handlerPropName: \"onPressIcon\",\n }),\n elevation: createElevationType(3),\n image: createImageProp(),\n title: createTextProp({\n label: \"Title\",\n description: \"Large title text\",\n // defaultValue: \"Title\",\n defaultValue: null,\n }),\n titleStyle: createTextStyle({\n label: \"Title Style\",\n }),\n subtitle: createTextProp({\n label: \"Subtitle\",\n description: \"Text underneath the title\",\n defaultValue: null,\n // defaultValue: \"Edit me in the props panel on the right\",\n }),\n subtitleStyle: createTextStyle({\n label: \"Subtitle Style\",\n }),\n description: createTextProp({\n label: \"Description\",\n description: \"Smallest text underneath subtitle\",\n // defaultValue:\n // \"This bottom text is optional, but shows up to make your life a little easier!\",\n defaultValue: null,\n }),\n descriptionStyle: createTextStyle({\n label: \"Description Style\",\n }),\n icon: createIconProp(),\n aspectRatio: createAspectRatioProp({\n defaultValue: 1.5,\n }),\n textCentered: createStaticBoolProp({\n label: \"Centered Text\",\n description: \"Places your title and subtitle in the center\",\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["Card.ts"],"names":["COMPONENT_TYPES","createElevationType","createTextProp","createImageProp","createIconProp","createAspectRatioProp","createStaticBoolProp","createTextStyle","createActionProp","Triggers","SEED_DATA","name","tag","description","category","card","triggers","OnPress","OnPressIcon","props","onPress","onPressIcon","handlerPropName","elevation","image","title","label","defaultValue","titleStyle","subtitle","subtitleStyle","descriptionStyle","icon","aspectRatio","textCentered"],"mappings":"AAAA,SACEA,eADF,EAEEC,mBAFF,EAGEC,cAHF,EAIEC,eAJF,EAKEC,cALF,EAMEC,qBANF,EAOEC,oBAPF,EAQEC,eARF,EASEC,gBATF,EAUEC,QAVF,QAWO,iBAXP;AAaA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,GAAG,EAAE,MAFkB;AAGvBC,EAAAA,WAAW,EAAE,6CAHU;AAIvBC,EAAAA,QAAQ,EAAEd,eAAe,CAACe,IAJH;AAKvBC,EAAAA,QAAQ,EAAE,CAACP,QAAQ,CAACQ,OAAV,EAAmBR,QAAQ,CAACS,WAA5B,CALa;AAMvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAEZ,gBAAgB,EADpB;AAELa,IAAAA,WAAW,EAAEb,gBAAgB,CAAC;AAC5Bc,MAAAA,eAAe,EAAE;AADW,KAAD,CAFxB;AAKLC,IAAAA,SAAS,EAAEtB,mBAAmB,CAAC,CAAD,CALzB;AAMLuB,IAAAA,KAAK,EAAErB,eAAe,EANjB;AAOLsB,IAAAA,KAAK,EAAEvB,cAAc,CAAC;AACpBwB,MAAAA,KAAK,EAAE,OADa;AAEpBb,MAAAA,WAAW,EAAE,kBAFO;AAGpB;AACAc,MAAAA,YAAY,EAAE;AAJM,KAAD,CAPhB;AAaLC,IAAAA,UAAU,EAAErB,eAAe,CAAC;AAC1BmB,MAAAA,KAAK,EAAE;AADmB,KAAD,CAbtB;AAgBLG,IAAAA,QAAQ,EAAE3B,cAAc,CAAC;AACvBwB,MAAAA,KAAK,EAAE,UADgB;AAEvBb,MAAAA,WAAW,EAAE,2BAFU;AAGvBc,MAAAA,YAAY,EAAE,IAHS,CAIvB;;AAJuB,KAAD,CAhBnB;AAsBLG,IAAAA,aAAa,EAAEvB,eAAe,CAAC;AAC7BmB,MAAAA,KAAK,EAAE;AADsB,KAAD,CAtBzB;AAyBLb,IAAAA,WAAW,EAAEX,cAAc,CAAC;AAC1BwB,MAAAA,KAAK,EAAE,aADmB;AAE1Bb,MAAAA,WAAW,EAAE,mCAFa;AAG1B;AACA;AACAc,MAAAA,YAAY,EAAE;AALY,KAAD,CAzBtB;AAgCLI,IAAAA,gBAAgB,EAAExB,eAAe,CAAC;AAChCmB,MAAAA,KAAK,EAAE;AADyB,KAAD,CAhC5B;AAmCLM,IAAAA,IAAI,EAAE5B,cAAc,EAnCf;AAoCL6B,IAAAA,WAAW,EAAE5B,qBAAqB,CAAC;AACjCsB,MAAAA,YAAY,EAAE;AADmB,KAAD,CApC7B;AAuCLO,IAAAA,YAAY,EAAE5B,oBAAoB,CAAC;AACjCoB,MAAAA,KAAK,EAAE,eAD0B;AAEjCb,MAAAA,WAAW,EAAE;AAFoB,KAAD;AAvC7B;AANgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createElevationType,\n createTextProp,\n createImageProp,\n createIconProp,\n createAspectRatioProp,\n createStaticBoolProp,\n createTextStyle,\n createActionProp,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Card\",\n tag: \"Card\",\n description: \"A card you can customize however you'd like\",\n category: COMPONENT_TYPES.card,\n triggers: [Triggers.OnPress, Triggers.OnPressIcon],\n props: {\n onPress: createActionProp(),\n onPressIcon: createActionProp({\n handlerPropName: \"onPressIcon\",\n }),\n elevation: createElevationType(3),\n image: createImageProp(),\n title: createTextProp({\n label: \"Title\",\n description: \"Large title text\",\n // defaultValue: \"Title\",\n defaultValue: null,\n }),\n titleStyle: createTextStyle({\n label: \"Title Style\",\n }),\n subtitle: createTextProp({\n label: \"Subtitle\",\n description: \"Text underneath the title\",\n defaultValue: null,\n // defaultValue: \"Edit me in the props panel on the right\",\n }),\n subtitleStyle: createTextStyle({\n label: \"Subtitle Style\",\n }),\n description: createTextProp({\n label: \"Description\",\n description: \"Smallest text underneath subtitle\",\n // defaultValue:\n // \"This bottom text is optional, but shows up to make your life a little easier!\",\n defaultValue: null,\n }),\n descriptionStyle: createTextStyle({\n label: \"Description Style\",\n }),\n icon: createIconProp(),\n aspectRatio: createAspectRatioProp({\n defaultValue: 1.5,\n }),\n textCentered: createStaticBoolProp({\n label: \"Centered Text\",\n description: \"Places your title and subtitle in the center\",\n }),\n },\n};\n"]}
@@ -3,7 +3,7 @@ export const SEED_DATA = {
3
3
  name: "Checkbox",
4
4
  tag: "Checkbox",
5
5
  category: COMPONENT_TYPES.input,
6
- triggers: [Triggers.OnPress],
6
+ triggers: [Triggers.OnPress, Triggers.OnCheck, Triggers.OnUncheck],
7
7
  props: {
8
8
  fieldName: createFieldNameProp({
9
9
  defaultValue: "checkboxValue",
@@ -1 +1 @@
1
- {"version":3,"sources":["Checkbox.ts"],"names":["COMPONENT_TYPES","createBoolProp","createIconProp","createStaticNumberProp","createColorProp","createFieldNameProp","GROUPS","Triggers","SEED_DATA","name","tag","category","input","triggers","OnPress","props","fieldName","defaultValue","valuePropName","handlerPropName","color","group","basic","label","description","uncheckedColor","disabled","size","checkedIcon","u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,IAAAA,WAAW,EAAE1B,cAAc,CAAC;AAC1BqB,MAAAA,KAAK,EAAE,cADmB;AAE1BC,MAAAA,WAAW,EAAE,oDAFa;AAG1BP,MAAAA,YAAY,EAAE;AAHY,KAAD,CA3BtB;AAgCLY,IAAAA,aAAa,EAAE3B,cAAc,CAAC;AAC5BqB,MAAAA,KAAK,EAAE,gBADqB;AAE5BC,MAAAA,WAAW,EAAE,sDAFe;AAG5BP,MAAAA,YAAY,EAAE;AAHc,KAAD;AAhCxB;AALgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createBoolProp,\n createIconProp,\n createStaticNumberProp,\n createColorProp,\n createFieldNameProp,\n GROUPS,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Checkbox\",\n tag: \"Checkbox\",\n category: COMPONENT_TYPES.input,\n triggers: [Triggers.OnPress],\n props: {\n fieldName: createFieldNameProp({\n defaultValue: \"checkboxValue\",\n valuePropName: \"status\",\n handlerPropName: \"onPress\",\n }),\n color: createColorProp({\n group: GROUPS.basic,\n label: \"Color\",\n description: \"Color for the button (used when the checkbox is checked)\",\n defaultValue: null,\n }),\n uncheckedColor: createColorProp({\n group: GROUPS.basic,\n label: \"Unselected Color\",\n description: \"Color for the button when the checkbox is unchecked\",\n defaultValue: null,\n }),\n disabled: createBoolProp({\n label: \"Disabled\",\n description: \"Whether the checkbox is disabled\",\n }),\n size: createStaticNumberProp({\n label: \"Size\",\n description: \"Specifies the size of the icon\",\n defaultValue: null,\n }),\n checkedIcon: createIconProp({\n label: \"Checked Icon\",\n description: 'Icon to show when the checkbox status is \"checked\"',\n defaultValue: null,\n }),\n uncheckedIcon: createIconProp({\n label: \"Unchecked Icon\",\n description: 'Icon to show when the checkbox status is \"unchecked\"',\n defaultValue: null,\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["Checkbox.ts"],"names":["COMPONENT_TYPES","createBoolProp","createIconProp","createStaticNumberProp","createColorProp","createFieldNameProp","GROUPS","Triggers","SEED_DATA","name","tag","category","input","triggers","OnPress","OnCheck","OnUncheck","props","fieldName","defaultValue","valuePropName","handlerPropName","color","group","basic","label","description","uncheckedColor","disabled","size","checkedIcon","uncheckedIcon"],"mappings":"AAAA,SACEA,eADF,EAEEC,cAFF,EAGEC,cAHF,EAIEC,sBAJF,EAKEC,eALF,EAMEC,mBANF,EAOEC,MAPF,EAQEC,QARF,QASO,iBATP;AAWA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,UADiB;AAEvBC,EAAAA,GAAG,EAAE,UAFkB;AAGvBC,EAAAA,QAAQ,EAAEX,eAAe,CAACY,KAHH;AAIvBC,EAAAA,QAAQ,EAAE,CAACN,QAAQ,CAACO,OAAV,EAAmBP,QAAQ,CAACQ,OAA5B,EAAqCR,QAAQ,CAACS,SAA9C,CAJa;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAEb,mBAAmB,CAAC;AAC7Bc,MAAAA,YAAY,EAAE,eADe;AAE7BC,MAAAA,aAAa,EAAE,QAFc;AAG7BC,MAAAA,eAAe,EAAE;AAHY,KAAD,CADzB;AAMLC,IAAAA,KAAK,EAAElB,eAAe,CAAC;AACrBmB,MAAAA,KAAK,EAAEjB,MAAM,CAACkB,KADO;AAErBC,MAAAA,KAAK,EAAE,OAFc;AAGrBC,MAAAA,WAAW,EAAE,0DAHQ;AAIrBP,MAAAA,YAAY,EAAE;AAJO,KAAD,CANjB;AAYLQ,IAAAA,cAAc,EAAEvB,eAAe,CAAC;AAC9BmB,MAAAA,KAAK,EAAEjB,MAAM,CAACkB,KADgB;AAE9BC,MAAAA,KAAK,EAAE,kBAFuB;AAG9BC,MAAAA,WAAW,EAAE,qDAHiB;AAI9BP,MAAAA,YAAY,EAAE;AAJgB,KAAD,CAZ1B;AAkBLS,IAAAA,QAAQ,EAAE3B,cAAc,CAAC;AACvBwB,MAAAA,KAAK,EAAE,UADgB;AAEvBC,MAAAA,WAAW,EAAE;AAFU,KAAD,CAlBnB;AAsBLG,IAAAA,IAAI,EAAE1B,sBAAsB,CAAC;AAC3BsB,MAAAA,KAAK,EAAE,MADoB;AAE3BC,MAAAA,WAAW,EAAE,gCAFc;AAG3BP,MAAAA,YAAY,EAAE;AAHa,KAAD,CAtBvB;AA2BLW,IAAAA,WAAW,EAAE5B,cAAc,CAAC;AAC1BuB,MAAAA,KAAK,EAAE,cADmB;AAE1BC,MAAAA,WAAW,EAAE,oDAFa;AAG1BP,MAAAA,YAAY,EAAE;AAHY,KAAD,CA3BtB;AAgCLY,IAAAA,aAAa,EAAE7B,cAAc,CAAC;AAC5BuB,MAAAA,KAAK,EAAE,gBADqB;AAE5BC,MAAAA,WAAW,EAAE,sDAFe;AAG5BP,MAAAA,YAAY,EAAE;AAHc,KAAD;AAhCxB;AALgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createBoolProp,\n createIconProp,\n createStaticNumberProp,\n createColorProp,\n createFieldNameProp,\n GROUPS,\n Triggers,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Checkbox\",\n tag: \"Checkbox\",\n category: COMPONENT_TYPES.input,\n triggers: [Triggers.OnPress, Triggers.OnCheck, Triggers.OnUncheck],\n props: {\n fieldName: createFieldNameProp({\n defaultValue: \"checkboxValue\",\n valuePropName: \"status\",\n handlerPropName: \"onPress\",\n }),\n color: createColorProp({\n group: GROUPS.basic,\n label: \"Color\",\n description: \"Color for the button (used when the checkbox is checked)\",\n defaultValue: null,\n }),\n uncheckedColor: createColorProp({\n group: GROUPS.basic,\n label: \"Unselected Color\",\n description: \"Color for the button when the checkbox is unchecked\",\n defaultValue: null,\n }),\n disabled: createBoolProp({\n label: \"Disabled\",\n description: \"Whether the checkbox is disabled\",\n }),\n size: createStaticNumberProp({\n label: \"Size\",\n description: \"Specifies the size of the icon\",\n defaultValue: null,\n }),\n checkedIcon: createIconProp({\n label: \"Checked Icon\",\n description: 'Icon to show when the checkbox status is \"checked\"',\n defaultValue: null,\n }),\n uncheckedIcon: createIconProp({\n label: \"Unchecked Icon\",\n description: 'Icon to show when the checkbox status is \"unchecked\"',\n defaultValue: null,\n }),\n },\n};\n"]}
@@ -5,6 +5,8 @@ export interface CheckboxProps {
5
5
  status?: boolean;
6
6
  disabled?: boolean;
7
7
  onPress?: (checked: boolean) => void;
8
+ onCheck?: () => void;
9
+ onUncheck?: () => void;
8
10
  color?: string;
9
11
  uncheckedColor?: string;
10
12
  checkedIcon?: string;
@@ -22,7 +22,6 @@ export { default as StarRating } from "./components/StarRating";
22
22
  export { default as Surface } from "./components/Surface";
23
23
  export { default as Switch, SwitchRow } from "./components/Switch";
24
24
  export { default as TextField } from "./components/TextField";
25
- export { default as ToggleButton } from "./components/ToggleButton";
26
25
  export { default as Touchable } from "./components/Touchable";
27
26
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
28
27
  export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "43.2.5",
3
+ "version": "43.3.0",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^43.2.4",
44
+ "@draftbit/types": "^43.3.0",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.1.7",
@@ -79,5 +79,5 @@
79
79
  ]
80
80
  ]
81
81
  },
82
- "gitHead": "be0541b77883e9784181eaefc1eb7793cf6f77e5"
82
+ "gitHead": "cee0c8738a921c590f61de7eb85f5e2285950835"
83
83
  }
@@ -3,7 +3,7 @@ import { View, StyleSheet, } from "react-native";
3
3
  import { useTheme } from "../../theming";
4
4
  import Touchable from "../Touchable";
5
5
  import { usePrevious } from "../../hooks";
6
- const Checkbox = ({ Icon, status, disabled = false, onPress = () => { }, color, uncheckedColor, defaultValue, checkedIcon = "MaterialCommunityIcons/checkbox-marked", uncheckedIcon = "MaterialCommunityIcons/checkbox-blank-outline", size = 24, style, ...rest }) => {
6
+ const Checkbox = ({ Icon, status, disabled = false, onPress = () => { }, onCheck, onUncheck, color, uncheckedColor, defaultValue, checkedIcon = "MaterialCommunityIcons/checkbox-marked", uncheckedIcon = "MaterialCommunityIcons/checkbox-blank-outline", size = 24, style, ...rest }) => {
7
7
  const [internalValue, setInternalValue] = React.useState(status || defaultValue || false);
8
8
  React.useEffect(() => {
9
9
  if (status != null) {
@@ -23,8 +23,15 @@ const Checkbox = ({ Icon, status, disabled = false, onPress = () => { }, color,
23
23
  ? color || colors.primary
24
24
  : uncheckedColor || colors.primary;
25
25
  const handlePress = () => {
26
- setInternalValue(!internalValue);
27
- onPress(!internalValue);
26
+ const newValue = !internalValue;
27
+ setInternalValue(newValue);
28
+ onPress(newValue);
29
+ if (onCheck && newValue) {
30
+ onCheck();
31
+ }
32
+ if (onUncheck && !newValue) {
33
+ onUncheck();
34
+ }
28
35
  };
29
36
  return (React.createElement(Touchable, { ...rest, onPress: handlePress, disabled: disabled, accessibilityState: { disabled }, accessibilityRole: "button", accessibilityLiveRegion: "polite", style: [styles.container, style, { width: size, height: size }] },
30
37
  React.createElement(Icon, { style: styles.icon, name: internalValue ? checkedIcon : uncheckedIcon, size: size, color: checkboxColor }),
@@ -16,6 +16,8 @@ export interface CheckboxProps {
16
16
  status?: boolean;
17
17
  disabled?: boolean;
18
18
  onPress?: (checked: boolean) => void;
19
+ onCheck?: () => void;
20
+ onUncheck?: () => void;
19
21
  color?: string;
20
22
  uncheckedColor?: string;
21
23
  checkedIcon?: string;
@@ -31,6 +33,8 @@ const Checkbox: React.FC<CheckboxProps & TouchableHighlightProps & IconSlot> =
31
33
  status,
32
34
  disabled = false,
33
35
  onPress = () => {},
36
+ onCheck,
37
+ onUncheck,
34
38
  color,
35
39
  uncheckedColor,
36
40
  defaultValue,
@@ -68,8 +72,17 @@ const Checkbox: React.FC<CheckboxProps & TouchableHighlightProps & IconSlot> =
68
72
  : uncheckedColor || colors.primary;
69
73
 
70
74
  const handlePress = () => {
71
- setInternalValue(!internalValue);
72
- onPress(!internalValue);
75
+ const newValue = !internalValue;
76
+ setInternalValue(newValue);
77
+ onPress(newValue);
78
+
79
+ if (onCheck && newValue) {
80
+ onCheck();
81
+ }
82
+
83
+ if (onUncheck && !newValue) {
84
+ onUncheck();
85
+ }
73
86
  };
74
87
 
75
88
  return (
package/src/index.js CHANGED
@@ -22,7 +22,6 @@ export { default as StarRating } from "./components/StarRating";
22
22
  export { default as Surface } from "./components/Surface";
23
23
  export { default as Switch, SwitchRow } from "./components/Switch";
24
24
  export { default as TextField } from "./components/TextField";
25
- export { default as ToggleButton } from "./components/ToggleButton";
26
25
  export { default as Touchable } from "./components/Touchable";
27
26
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
28
27
  export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
package/src/index.tsx CHANGED
@@ -23,7 +23,6 @@ export { default as StarRating } from "./components/StarRating";
23
23
  export { default as Surface } from "./components/Surface";
24
24
  export { default as Switch, SwitchRow } from "./components/Switch";
25
25
  export { default as TextField } from "./components/TextField";
26
- export { default as ToggleButton } from "./components/ToggleButton";
27
26
  export { default as Touchable } from "./components/Touchable";
28
27
  export { AccordionGroup, AccordionItem } from "./components/Accordion";
29
28
  export {
@@ -4,7 +4,7 @@ export const SEED_DATA = {
4
4
  tag: "Card",
5
5
  description: "A card you can customize however you'd like",
6
6
  category: COMPONENT_TYPES.card,
7
- triggers: [Triggers.OnPress],
7
+ triggers: [Triggers.OnPress, Triggers.OnPressIcon],
8
8
  props: {
9
9
  onPress: createActionProp(),
10
10
  onPressIcon: createActionProp({
@@ -16,7 +16,7 @@ export const SEED_DATA = {
16
16
  tag: "Card",
17
17
  description: "A card you can customize however you'd like",
18
18
  category: COMPONENT_TYPES.card,
19
- triggers: [Triggers.OnPress], //TODO: when we support multiple triggers, add Triggers.OnPressIcon
19
+ triggers: [Triggers.OnPress, Triggers.OnPressIcon],
20
20
  props: {
21
21
  onPress: createActionProp(),
22
22
  onPressIcon: createActionProp({
@@ -3,7 +3,7 @@ export const SEED_DATA = {
3
3
  name: "Checkbox",
4
4
  tag: "Checkbox",
5
5
  category: COMPONENT_TYPES.input,
6
- triggers: [Triggers.OnPress],
6
+ triggers: [Triggers.OnPress, Triggers.OnCheck, Triggers.OnUncheck],
7
7
  props: {
8
8
  fieldName: createFieldNameProp({
9
9
  defaultValue: "checkboxValue",
@@ -13,7 +13,7 @@ export const SEED_DATA = {
13
13
  name: "Checkbox",
14
14
  tag: "Checkbox",
15
15
  category: COMPONENT_TYPES.input,
16
- triggers: [Triggers.OnPress],
16
+ triggers: [Triggers.OnPress, Triggers.OnCheck, Triggers.OnUncheck],
17
17
  props: {
18
18
  fieldName: createFieldNameProp({
19
19
  defaultValue: "checkboxValue",
@@ -1,86 +0,0 @@
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
@@ -1 +0,0 @@
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,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAIlB,OAAO,IAAI,IAAf,EAAqB;AACnBe,MAAAA,gBAAgB,CAACf,OAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,OAAD,CAJH;AAMAgB,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,QAAIhB,YAAY,IAAI,IAApB,EAA0B;AACxBa,MAAAA,gBAAgB,CAACb,YAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,YAAD,CAJH;;AAMA,QAAMiB,WAAW,GAAG,MAAM;AACxBJ,IAAAA,gBAAgB,CAAC,CAACD,aAAF,CAAhB;AACAb,IAAAA,OAAO,CAAC,CAACa,aAAF,CAAP;AACD,GAHD;;AAKA,sBACE,oBAAC,mBAAD;AACE,IAAA,IAAI,EAAEhB,IADR;AAEE,IAAA,IAAI,EAAEC,IAFR;AAGE,IAAA,IAAI,EAAEQ,QAHR;AAIE,IAAA,KAAK,EAAEO,aAAa,GAAGH,MAAM,CAACP,KAAD,CAAT,GAAmBO,MAAM,CAACN,cAAD,CAJ/C;AAKE,IAAA,OAAO,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"]}
@@ -1,60 +0,0 @@
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.button,
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
@@ -1 +0,0 @@
1
- {"version":3,"sources":["ToggleButton.ts"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","button","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,MAHH;AAIvBC,EAAAA,MAAM,EAAE,EAJe;AAKvBC,EAAAA,QAAQ,EAAE,CAACC,gBAASC,OAAV,CALa;AAMvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,8BADJ;AAELC,I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\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.button,\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,67 +0,0 @@
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
- import * as React from "react";
4
- import { withTheme } from "../theming";
5
- import { StyleSheet } from "react-native";
6
- import IconButton from "./IconButton";
7
-
8
- const ToggleButton = _ref => {
9
- let {
10
- Icon,
11
- icon,
12
- toggled = false,
13
- onPress = () => {},
14
- defaultValue,
15
- disabled = false,
16
- color = "primary",
17
- colorSecondary = "surface",
18
- borderColor = "divider",
19
- iconSize = 25,
20
- width = 50,
21
- height = 50,
22
- theme: {
23
- colors
24
- },
25
- style,
26
- ...rest
27
- } = _ref;
28
- const [internalValue, setInternalValue] = React.useState(toggled || defaultValue || false);
29
- React.useEffect(() => {
30
- if (toggled != null) {
31
- setInternalValue(toggled);
32
- }
33
- }, [toggled]);
34
- React.useEffect(() => {
35
- if (defaultValue != null) {
36
- setInternalValue(defaultValue);
37
- }
38
- }, [defaultValue]);
39
-
40
- const handlePress = () => {
41
- setInternalValue(!internalValue);
42
- onPress(!internalValue);
43
- };
44
-
45
- return /*#__PURE__*/React.createElement(IconButton, _extends({
46
- Icon: Icon,
47
- icon: icon,
48
- size: iconSize,
49
- color: internalValue ? colors[color] : colors[colorSecondary],
50
- onPress: handlePress,
51
- disabled: disabled,
52
- style: [styles.mainContainer, {
53
- width,
54
- height,
55
- backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
56
- borderColor: colors[borderColor]
57
- }, style]
58
- }, rest));
59
- };
60
-
61
- const styles = StyleSheet.create({
62
- mainContainer: {
63
- borderWidth: 1
64
- }
65
- });
66
- export default withTheme(ToggleButton);
67
- //# sourceMappingURL=ToggleButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["ToggleButton.tsx"],"names":["React","withTheme","StyleSheet","IconButton","ToggleButton","Icon","icon","toggled","onPress","defaultValue","disabled","color","colorSecondary","borderColor","iconSize","width","height","theme","colors","style","rest","internalValue","setInternalValue","useState","useEffect","handlePress","styles","mainContainer","backgroundColor","create","borderWidth"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,YAA1B;AAEA,SAAoBC,UAApB,QAAiD,cAAjD;AACA,OAAOC,UAAP,MAAuB,cAAvB;;AAoBA,MAAMC,YAA6B,GAAG,QAgBhC;AAAA,MAhBiC;AACrCC,IAAAA,IADqC;AAErCC,IAAAA,IAFqC;AAGrCC,IAAAA,OAAO,GAAG,KAH2B;AAIrCC,IAAAA,OAAO,GAAG,MAAM,CAAE,CAJmB;AAKrCC,IAAAA,YALqC;AAMrCC,IAAAA,QAAQ,GAAG,KAN0B;AAOrCC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,MAAAA,KADF;AAEEC,MAAAA,MAFF;AAGEY,MAAAA,eAAe,EAAEP,aAAa,GAC1BH,MAAM,CAACN,cAAD,CADoB,GAE1BM,MAAM,CAACP,KAAD,CALZ;AAMEE,MAAAA,WAAW,EAAEK,MAAM,CAACL,WAAD;AANrB,KAFK,EAULM,KAVK;AAPT,KAmBMC,IAnBN,EADF;AAuBD,CA7DD;;AA+DA,MAAMM,MAAM,GAAGxB,UAAU,CAAC2B,MAAX,CAAkB;AAC/BF,EAAAA,aAAa,EAAE;AACbG,IAAAA,WAAW,EAAE;AADA;AADgB,CAAlB,CAAf;AAMA,eAAe7B,SAAS,CAACG,YAAD,CAAxB","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../theming\";\nimport { colorTypes } from \"@draftbit/types\";\nimport { StyleProp, StyleSheet, ViewStyle } from \"react-native\";\nimport IconButton from \"./IconButton\";\nimport type { Theme } from \"../styles/DefaultTheme\";\nimport type { IconSlot } from \"../interfaces/Icon\";\n\ntype Props = {\n icon: string;\n toggled?: boolean;\n onPress?: (value: boolean) => void;\n defaultValue?: boolean;\n disabled?: boolean;\n color?: colorTypes;\n colorSecondary?: colorTypes;\n borderColor?: colorTypes;\n iconSize?: number;\n width?: number;\n height?: number;\n style?: StyleProp<ViewStyle>;\n theme: Theme;\n} & IconSlot;\n\nconst ToggleButton: React.FC<Props> = ({\n Icon,\n icon,\n toggled = false,\n onPress = () => {},\n defaultValue,\n disabled = false,\n color = \"primary\",\n colorSecondary = \"surface\",\n borderColor = \"divider\",\n iconSize = 25,\n width = 50,\n height = 50,\n theme: { colors },\n style,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<boolean>(\n toggled || defaultValue || false\n );\n\n React.useEffect(() => {\n if (toggled != null) {\n setInternalValue(toggled);\n }\n }, [toggled]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handlePress = () => {\n setInternalValue(!internalValue);\n onPress(!internalValue);\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={icon}\n size={iconSize}\n color={internalValue ? colors[color] : colors[colorSecondary]}\n onPress={handlePress}\n disabled={disabled}\n style={[\n styles.mainContainer,\n {\n width,\n height,\n backgroundColor: internalValue\n ? colors[colorSecondary]\n : colors[color],\n borderColor: colors[borderColor],\n },\n style,\n ]}\n {...rest}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n mainContainer: {\n borderWidth: 1,\n },\n});\n\nexport default withTheme(ToggleButton);\n"]}