@draftbit/core 49.6.1-d21713.2 → 49.6.1-d928a6.2

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.
@@ -1 +1 @@
1
- var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Toast/Toast.tsx";import React from"react";import{StyleSheet}from"react-native";import{View,Text}from"react-native";import{extractBorderAndMarginStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";var Toast=function Toast(_ref){var _ref$visible=_ref.visible,visible=_ref$visible===void 0?false:_ref$visible,title=_ref.title,style=_ref.style,labelStyle=_ref.labelStyle;if(!visible)return null;var containerStyle=StyleSheet.flatten([extractBorderAndMarginStyles(style).marginStyles]);return _jsx(View,{style:containerStyle,children:_jsx(Text,{style:[labelStyle],children:title})});};export default Toast;
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Toast/Toast.tsx";import React from"react";import{View,Text}from"react-native";import{extractStyles}from"../../utilities";import{withTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";var Toast=function Toast(_ref){var _ref$visible=_ref.visible,visible=_ref$visible===void 0?false:_ref$visible,title=_ref.title,style=_ref.style,theme=_ref.theme;if(!visible)return null;var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsx(View,{style:[{backgroundColor:"rgba(0,0,0,0.7)"},viewStyles],children:_jsx(Text,{style:[{color:theme.colors.text.strong},textStyles],children:title})});};export default withTheme(Toast);
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
- import { StyleProp, TextStyle, ViewStyle } from "react-native";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ import { ReadTheme } from "@draftbit/theme";
3
4
  declare type Props = {
4
5
  visible: boolean;
5
6
  title: string;
6
- labelStyle?: StyleProp<TextStyle>;
7
7
  style?: StyleProp<ViewStyle>;
8
+ theme: ReadTheme;
8
9
  };
9
- declare const Toast: React.FC<React.PropsWithChildren<Props>>;
10
- export default Toast;
10
+ declare const _default: React.ComponentType<Omit<React.PropsWithChildren<Props>, "theme">>;
11
+ export default _default;
@@ -1,15 +1,23 @@
1
1
  import React from "react";
2
- import { StyleSheet } from "react-native";
3
2
  import { View, Text } from "react-native";
4
- import { extractBorderAndMarginStyles } from "../../utilities";
5
- const Toast = ({ visible = false, title, style, labelStyle, }) => {
3
+ import { extractStyles } from "../../utilities";
4
+ import { withTheme } from "@draftbit/theme";
5
+ const Toast = ({ visible = false, title, style, theme, }) => {
6
6
  if (!visible)
7
7
  return null;
8
- const containerStyle = StyleSheet.flatten([
9
- extractBorderAndMarginStyles(style).marginStyles,
10
- ]);
11
- return (React.createElement(View, { style: containerStyle },
12
- React.createElement(Text, { style: [labelStyle] }, title)));
8
+ const { textStyles, viewStyles } = extractStyles(style);
9
+ return (React.createElement(View, { style: [
10
+ {
11
+ backgroundColor: "rgba(0,0,0,0.7)",
12
+ },
13
+ viewStyles,
14
+ ] },
15
+ React.createElement(Text, { style: [
16
+ {
17
+ color: theme.colors.text.strong,
18
+ },
19
+ textStyles,
20
+ ] }, title)));
13
21
  };
14
- export default Toast;
22
+ export default withTheme(Toast);
15
23
  //# sourceMappingURL=Toast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAmC,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAS/D,MAAM,KAAK,GAA6C,CAAC,EACvD,OAAO,GAAG,KAAK,EACf,KAAK,EACL,KAAK,EACL,UAAU,GACX,EAAE,EAAE;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;QACxC,4BAA4B,CAAC,KAAK,CAAC,CAAC,YAAY;KACjD,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,IAAI,IAAC,KAAK,EAAE,cAAc;QACzB,oBAAC,IAAI,IAAC,KAAK,EAAE,CAAC,UAAU,CAAC,IAAG,KAAK,CAAQ,CACpC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AASvD,MAAM,KAAK,GAA6C,CAAC,EACvD,OAAO,GAAG,KAAK,EACf,KAAK,EACL,KAAK,EACL,KAAK,GACN,EAAE,EAAE;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,CACL,oBAAC,IAAI,IACH,KAAK,EAAE;YACL;gBACE,eAAe,EAAE,iBAAiB;aACnC;YACD,UAAU;SACX;QAED,oBAAC,IAAI,IACH,KAAK,EAAE;gBACL;oBACE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;iBAChC;gBACD,UAAU;aACX,IAEA,KAAK,CACD,CACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,KAAK,CAAC,CAAC"}