@korsolutions/ui 0.0.47 → 0.0.49
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.
- package/dist/module/primitives/alert/alert-icon.js +11 -6
- package/dist/module/primitives/alert/alert-icon.js.map +1 -1
- package/dist/module/primitives/alert/variants/default.js +5 -1
- package/dist/module/primitives/alert/variants/default.js.map +1 -1
- package/dist/module/primitives/alert/variants/destructive.js +5 -1
- package/dist/module/primitives/alert/variants/destructive.js.map +1 -1
- package/dist/module/themes/provider.js.map +1 -1
- package/dist/module/themes/utils.js.map +1 -1
- package/dist/module/types/props.types.js +2 -0
- package/dist/module/types/util.types.js +2 -0
- package/dist/module/types/util.types.js.map +1 -0
- package/dist/typescript/src/primitives/alert/alert-icon.d.ts +3 -7
- package/dist/typescript/src/primitives/alert/alert-icon.d.ts.map +1 -1
- package/dist/typescript/src/primitives/alert/types.d.ts +1 -1
- package/dist/typescript/src/primitives/alert/types.d.ts.map +1 -1
- package/dist/typescript/src/primitives/alert/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/primitives/alert/variants/destructive.d.ts.map +1 -1
- package/dist/typescript/src/themes/provider.d.ts +2 -1
- package/dist/typescript/src/themes/provider.d.ts.map +1 -1
- package/dist/typescript/src/themes/utils.d.ts +2 -1
- package/dist/typescript/src/themes/utils.d.ts.map +1 -1
- package/dist/typescript/src/types/props.types.d.ts +11 -0
- package/dist/typescript/src/types/props.types.d.ts.map +1 -1
- package/dist/typescript/src/types/util.types.d.ts +4 -0
- package/dist/typescript/src/types/util.types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/primitives/alert/alert-icon.tsx +9 -11
- package/src/primitives/alert/types.ts +1 -1
- package/src/primitives/alert/variants/default.tsx +5 -1
- package/src/primitives/alert/variants/destructive.tsx +5 -1
- package/src/themes/provider.tsx +2 -1
- package/src/themes/utils.ts +2 -1
- package/src/types/props.types.ts +14 -0
- package/src/types/util.types.ts +5 -0
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { View } from "react-native";
|
|
5
4
|
import { useAlert } from "./context.js";
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export function AlertIcon(
|
|
6
|
+
export function AlertIcon({
|
|
7
|
+
render: Component,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
8
10
|
const alert = useAlert();
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
11
|
+
const composedProps = {
|
|
12
|
+
...alert.styles?.icon,
|
|
12
13
|
...props,
|
|
13
|
-
style:
|
|
14
|
+
style: [alert.styles?.icon?.style, props.style]
|
|
15
|
+
};
|
|
16
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
17
|
+
absoluteStrokeWidth: true,
|
|
18
|
+
...composedProps
|
|
14
19
|
});
|
|
15
20
|
}
|
|
16
21
|
//# sourceMappingURL=alert-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useAlert","jsx","_jsx","AlertIcon","render","Component","props","alert","composedProps","styles","icon","style","absoluteStrokeWidth"],"sourceRoot":"../../../../src","sources":["primitives/alert/alert-icon.tsx"],"mappings":";;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ;AAAoB,SAAAC,GAAA,IAAAC,IAAA;AAIrC,OAAO,SAASC,SAASA,CAAC;EAAEC,MAAM,EAAEC,SAAS;EAAE,GAAGC;AAA+C,CAAC,EAAE;EAClG,MAAMC,KAAK,GAAGP,QAAQ,CAAC,CAAC;EAExB,MAAMQ,aAAa,GAAG;IACpB,GAAGD,KAAK,CAACE,MAAM,EAAEC,IAAI;IACrB,GAAGJ,KAAK;IACRK,KAAK,EAAE,CAACJ,KAAK,CAACE,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEL,KAAK,CAACK,KAAK;EAChD,CAAC;EAED,oBAAOT,IAAA,CAACG,SAAS;IAACO,mBAAmB;IAAA,GAAKJ;EAAa,CAAG,CAAC;AAC7D","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useThemedStyles","useAlertVariantDefault","colors","radius","fontSize","root","padding","backgroundColor","background","borderRadius","borderWidth","borderColor","border","flexDirection","gap","icon","
|
|
1
|
+
{"version":3,"names":["useThemedStyles","useAlertVariantDefault","colors","radius","fontSize","root","padding","backgroundColor","background","borderRadius","borderWidth","borderColor","border","flexDirection","gap","icon","color","foreground","size","style","marginTop","body","flex","title","fontWeight","marginBottom","description","mutedForeground","lineHeight"],"sourceRoot":"../../../../../src","sources":["primitives/alert/variants/default.tsx"],"mappings":";;AACA,SAASA,eAAe;AAExB,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAmB;EACvD,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,MAAmB;IAC9CC,IAAI,EAAE;MACJC,OAAO,EAAE,EAAE;MACXC,eAAe,EAAEL,MAAM,CAACM,UAAU;MAClCC,YAAY,EAAEN,MAAM;MACpBO,WAAW,EAAE,CAAC;MACdC,WAAW,EAAET,MAAM,CAACU,MAAM;MAC1BC,aAAa,EAAE,KAAK;MACpBC,GAAG,EAAE;IACP,CAAC;IACDC,IAAI,EAAE;MACJC,KAAK,EAAEd,MAAM,CAACe,UAAU;MACxBC,IAAI,EAAE,EAAE;MACRC,KAAK,EAAE;QACLC,SAAS,EAAE;MACb;IACF,CAAC;IACDC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR,CAAC;IACDC,KAAK,EAAE;MACLnB,QAAQ,EAAEA,QAAQ;MAClBoB,UAAU,EAAE,KAAK;MACjBR,KAAK,EAAEd,MAAM,CAACe,UAAU;MACxBQ,YAAY,EAAE;IAChB,CAAC;IACDC,WAAW,EAAE;MACXtB,QAAQ,EAAEA,QAAQ,GAAG,KAAK;MAC1BY,KAAK,EAAEd,MAAM,CAACyB,eAAe;MAC7BC,UAAU,EAAE;IACd;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useThemedStyles","useAlertVariantDestructive","colors","radius","fontSize","root","padding","backgroundColor","background","borderRadius","borderWidth","borderColor","danger","flexDirection","gap","icon","marginTop","body","flex","title","fontWeight","
|
|
1
|
+
{"version":3,"names":["useThemedStyles","useAlertVariantDestructive","colors","radius","fontSize","root","padding","backgroundColor","background","borderRadius","borderWidth","borderColor","danger","flexDirection","gap","icon","color","size","style","marginTop","body","flex","title","fontWeight","marginBottom","description","lineHeight","opacity"],"sourceRoot":"../../../../../src","sources":["primitives/alert/variants/destructive.tsx"],"mappings":";;AACA,SAASA,eAAe;AAExB,OAAO,MAAMC,0BAA0B,GAAGA,CAAA,KAAmB;EAC3D,OAAOD,eAAe,CACpB,CAAC;IAAEE,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,MAAmB;IAC9CC,IAAI,EAAE;MACJC,OAAO,EAAE,EAAE;MACXC,eAAe,EAAEL,MAAM,CAACM,UAAU;MAClCC,YAAY,EAAEN,MAAM;MACpBO,WAAW,EAAE,CAAC;MACdC,WAAW,EAAET,MAAM,CAACU,MAAM;MAC1BC,aAAa,EAAE,KAAK;MACpBC,GAAG,EAAE;IACP,CAAC;IACDC,IAAI,EAAE;MACJC,KAAK,EAAEd,MAAM,CAACU,MAAM;MACpBK,IAAI,EAAE,EAAE;MACRC,KAAK,EAAE;QACLC,SAAS,EAAE;MACb;IACF,CAAC;IACDC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR,CAAC;IACDC,KAAK,EAAE;MACLlB,QAAQ,EAAEA,QAAQ;MAClBmB,UAAU,EAAE,KAAK;MACjBP,KAAK,EAAEd,MAAM,CAACU,MAAM;MACpBY,YAAY,EAAE;IAChB,CAAC;IACDC,WAAW,EAAE;MACXrB,QAAQ,EAAEA,QAAQ,GAAG,KAAK;MAC1BY,KAAK,EAAEd,MAAM,CAACU,MAAM;MACpBc,UAAU,EAAE,EAAE;MACdC,OAAO,EAAE;IACX;EACF,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useContext","useEffect","useState","useColorScheme","defaultThemeAssets","mergeThemeAssets","jsx","_jsx","ThemeContext","ThemeProvider","props","children","theme","systemColorScheme","colorScheme","setColorScheme","themeAssets","colors","Provider","value","radius","fontFamily","letterSpacing","fontSize","useTheme","context","Error"],"sourceRoot":"../../../src","sources":["themes/provider.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useEffect","useState","useColorScheme","defaultThemeAssets","mergeThemeAssets","jsx","_jsx","ThemeContext","ThemeProvider","props","children","theme","systemColorScheme","colorScheme","setColorScheme","themeAssets","colors","Provider","value","radius","fontFamily","letterSpacing","fontSize","useTheme","context","Error"],"sourceRoot":"../../../src","sources":["themes/provider.tsx"],"mappings":";;AACA,SAASA,aAAa,EAA0BC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC9F,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,kBAAkB;AAE3B,SAASC,gBAAgB;AAAkB,SAAAC,GAAA,IAAAC,IAAA;AAY3C,MAAMC,YAAY,gBAAGT,aAAa,CAAsB,IAAI,CAAC;AAM7D,OAAO,MAAMU,aAAa,GAAIC,KAAyB,IAAK;EAC1D,MAAM;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAGF,KAAK;EAEjC,MAAMG,iBAAiB,GAAGV,cAAc,CAAC,CAAC;EAC1C,MAAM,CAACW,WAAW,EAAEC,cAAc,CAAC,GAAGb,QAAQ,CAAcW,iBAAiB,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;EAE5G,MAAMG,WAAW,GAAGJ,KAAK,GAAGP,gBAAgB,CAACD,kBAAkB,EAAEQ,KAAK,CAAC,GAAGR,kBAAkB;EAE5F,MAAMa,MAAM,GAAGD,WAAW,CAACC,MAAM,CAACH,WAAW,CAAC;EAE9Cb,SAAS,CAAC,MAAM;IACd,IAAIY,iBAAiB,EAAE;MACrBE,cAAc,CAACF,iBAAiB,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjE;EACF,CAAC,EAAE,CAACA,iBAAiB,CAAC,CAAC;EAEvB,oBACEN,IAAA,CAACC,YAAY,CAACU,QAAQ;IACpBC,KAAK,EAAE;MACLL,WAAW;MACXC,cAAc;MACdE,MAAM;MACNG,MAAM,EAAEJ,WAAW,CAACI,MAAM;MAC1BC,UAAU,EAAEL,WAAW,CAACK,UAAU;MAClCC,aAAa,EAAEN,WAAW,CAACM,aAAa;MACxCC,QAAQ,EAAEP,WAAW,CAACO;IACxB,CAAE;IAAAZ,QAAA,EAEDA;EAAQ,CACY,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMa,QAAQ,GAAGA,CAAA,KAAM;EAC5B,MAAMC,OAAO,GAAGzB,UAAU,CAACQ,YAAY,CAAC;EACxC,IAAI,CAACiB,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EACA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mergeThemeAssets","base","override","colors","light","dark","radius","fontFamily","letterSpacing","fontSize"],"sourceRoot":"../../../src","sources":["themes/utils.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["mergeThemeAssets","base","override","colors","light","dark","radius","fontFamily","letterSpacing","fontSize"],"sourceRoot":"../../../src","sources":["themes/utils.ts"],"mappings":";;AAGA,OAAO,SAASA,gBAAgBA,CAACC,IAAiB,EAAEC,QAAkC,EAAe;EACnG,OAAO;IACLC,MAAM,EAAE;MACNC,KAAK,EAAE;QAAE,GAAGH,IAAI,CAACE,MAAM,CAACC,KAAK;QAAE,GAAGF,QAAQ,CAACC,MAAM,EAAEC;MAAM,CAAC;MAC1DC,IAAI,EAAE;QAAE,GAAGJ,IAAI,CAACE,MAAM,CAACE,IAAI;QAAE,GAAGH,QAAQ,CAACC,MAAM,EAAEE;MAAK;IACxD,CAAC;IACDC,MAAM,EAAEJ,QAAQ,CAACI,MAAM,IAAIL,IAAI,CAACK,MAAM;IACtCC,UAAU,EAAEL,QAAQ,CAACK,UAAU,IAAIN,IAAI,CAACM,UAAU;IAClDC,aAAa,EAAEN,QAAQ,CAACM,aAAa,IAAIP,IAAI,CAACO,aAAa;IAC3DC,QAAQ,EAAEP,QAAQ,CAACO,QAAQ,IAAIR,IAAI,CAACQ;EACtC,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/util.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsWithRequiredRender, SvgProps } from "../../types/props.types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
style?: StyleProp<ViewStyle>;
|
|
7
|
-
}
|
|
8
|
-
export declare function AlertIcon(props: PropsWithRender<AlertIconProps>): React.JSX.Element;
|
|
3
|
+
export type AlertIconProps = SvgProps;
|
|
4
|
+
export declare function AlertIcon({ render: Component, ...props }: PropsWithRequiredRender<AlertIconProps>): React.JSX.Element;
|
|
9
5
|
//# sourceMappingURL=alert-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-icon.d.ts","sourceRoot":"","sources":["../../../../../src/primitives/alert/alert-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"alert-icon.d.ts","sourceRoot":"","sources":["../../../../../src/primitives/alert/alert-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEtC,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,CAAC,cAAc,CAAC,qBAUjG"}
|
|
@@ -5,7 +5,7 @@ import type { AlertRootProps } from "./alert-root";
|
|
|
5
5
|
import type { AlertTitleProps } from "./alert-title";
|
|
6
6
|
export interface AlertStyles {
|
|
7
7
|
root?: AlertRootProps["style"];
|
|
8
|
-
icon?: AlertIconProps
|
|
8
|
+
icon?: AlertIconProps;
|
|
9
9
|
body?: AlertBodyProps["style"];
|
|
10
10
|
title?: AlertTitleProps["style"];
|
|
11
11
|
description?: AlertDescriptionProps["style"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/primitives/alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/primitives/alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;CAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/alert/variants/default.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,sBAAsB,QAAO,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/alert/variants/default.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,sBAAsB,QAAO,WAmCzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destructive.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/alert/variants/destructive.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,0BAA0B,QAAO,
|
|
1
|
+
{"version":3,"file":"destructive.d.ts","sourceRoot":"","sources":["../../../../../../src/primitives/alert/variants/destructive.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,0BAA0B,QAAO,WAoC7C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DeepPartial } from "../types/util.types";
|
|
1
2
|
import { type PropsWithChildren } from "react";
|
|
2
3
|
import type { Colors, ColorScheme, FontFamily, FontSize, LetterSpacing, Radius, ThemeAssets } from "./types";
|
|
3
4
|
interface ThemeContext {
|
|
@@ -11,7 +12,7 @@ interface ThemeContext {
|
|
|
11
12
|
}
|
|
12
13
|
declare const ThemeContext: import("react").Context<ThemeContext | null>;
|
|
13
14
|
export interface ThemeProviderProps extends PropsWithChildren {
|
|
14
|
-
theme?:
|
|
15
|
+
theme?: DeepPartial<ThemeAssets>;
|
|
15
16
|
}
|
|
16
17
|
export declare const ThemeProvider: (props: ThemeProviderProps) => import("react").JSX.Element;
|
|
17
18
|
export declare const useTheme: () => ThemeContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/themes/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAmC,MAAM,OAAO,CAAC;AAG/F,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG7G,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,YAAY,8CAA2C,CAAC;AAE9D,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/themes/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAiB,KAAK,iBAAiB,EAAmC,MAAM,OAAO,CAAC;AAG/F,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG7G,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,YAAY,8CAA2C,CAAC;AAE9D,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,KAAK,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,gCA+BtD,CAAC;AAEF,eAAO,MAAM,QAAQ,oBAMpB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DeepPartial } from "../types/util.types";
|
|
1
2
|
import type { ThemeAssets } from "./types";
|
|
2
|
-
export declare function mergeThemeAssets(base: ThemeAssets, override:
|
|
3
|
+
export declare function mergeThemeAssets(base: ThemeAssets, override: DeepPartial<ThemeAssets>): ThemeAssets;
|
|
3
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/themes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/themes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,WAAW,CAAC,GAAG,WAAW,CAWnG"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import type { ColorValue, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
1
2
|
export type PropsWithRender<P> = P & {
|
|
2
3
|
render?: (props: P) => React.ReactNode;
|
|
3
4
|
};
|
|
5
|
+
export type PropsWithRequiredRender<P> = P & {
|
|
6
|
+
render: (props: P) => React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type SvgProps = {
|
|
9
|
+
size?: number;
|
|
10
|
+
color?: ColorValue;
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
absoluteStrokeWidth?: boolean;
|
|
13
|
+
style?: StyleProp<ViewStyle & TextStyle>;
|
|
14
|
+
};
|
|
4
15
|
//# sourceMappingURL=props.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.types.d.ts","sourceRoot":"","sources":["../../../../src/types/props.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CACxC,CAAC"}
|
|
1
|
+
{"version":3,"file":"props.types.d.ts","sourceRoot":"","sources":["../../../../src/types/props.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI,CAAC,GAAG;IAC3C,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;CAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.types.d.ts","sourceRoot":"","sources":["../../../../src/types/util.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACzC;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,GACD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsWithRequiredRender, SvgProps } from "@/types/props.types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
4
3
|
import { useAlert } from "./context";
|
|
5
4
|
|
|
6
|
-
export
|
|
7
|
-
children?: React.ReactNode;
|
|
5
|
+
export type AlertIconProps = SvgProps;
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function AlertIcon(props: PropsWithRender<AlertIconProps>) {
|
|
7
|
+
export function AlertIcon({ render: Component, ...props }: PropsWithRequiredRender<AlertIconProps>) {
|
|
13
8
|
const alert = useAlert();
|
|
14
9
|
|
|
15
|
-
const
|
|
10
|
+
const composedProps = {
|
|
11
|
+
...alert.styles?.icon,
|
|
12
|
+
...props,
|
|
13
|
+
style: [alert.styles?.icon?.style, props.style],
|
|
14
|
+
};
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
return <Component {...props} style={composedStyle} />;
|
|
16
|
+
return <Component absoluteStrokeWidth {...composedProps} />;
|
|
19
17
|
}
|
|
@@ -6,7 +6,7 @@ import type { AlertTitleProps } from "./alert-title";
|
|
|
6
6
|
|
|
7
7
|
export interface AlertStyles {
|
|
8
8
|
root?: AlertRootProps["style"];
|
|
9
|
-
icon?: AlertIconProps
|
|
9
|
+
icon?: AlertIconProps;
|
|
10
10
|
body?: AlertBodyProps["style"];
|
|
11
11
|
title?: AlertTitleProps["style"];
|
|
12
12
|
description?: AlertDescriptionProps["style"];
|
package/src/themes/provider.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DeepPartial } from "@/types/util.types";
|
|
1
2
|
import { createContext, type PropsWithChildren, useContext, useEffect, useState } from "react";
|
|
2
3
|
import { useColorScheme } from "react-native";
|
|
3
4
|
import { defaultThemeAssets } from "./default";
|
|
@@ -17,7 +18,7 @@ interface ThemeContext {
|
|
|
17
18
|
const ThemeContext = createContext<ThemeContext | null>(null);
|
|
18
19
|
|
|
19
20
|
export interface ThemeProviderProps extends PropsWithChildren {
|
|
20
|
-
theme?:
|
|
21
|
+
theme?: DeepPartial<ThemeAssets>;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export const ThemeProvider = (props: ThemeProviderProps) => {
|
package/src/themes/utils.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { DeepPartial } from "@/types/util.types";
|
|
1
2
|
import type { ThemeAssets } from "./types";
|
|
2
3
|
|
|
3
|
-
export function mergeThemeAssets(base: ThemeAssets, override:
|
|
4
|
+
export function mergeThemeAssets(base: ThemeAssets, override: DeepPartial<ThemeAssets>): ThemeAssets {
|
|
4
5
|
return {
|
|
5
6
|
colors: {
|
|
6
7
|
light: { ...base.colors.light, ...override.colors?.light },
|
package/src/types/props.types.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import type { ColorValue, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
|
|
1
3
|
export type PropsWithRender<P> = P & {
|
|
2
4
|
render?: (props: P) => React.ReactNode;
|
|
3
5
|
};
|
|
6
|
+
|
|
7
|
+
export type PropsWithRequiredRender<P> = P & {
|
|
8
|
+
render: (props: P) => React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type SvgProps = {
|
|
12
|
+
size?: number;
|
|
13
|
+
color?: ColorValue;
|
|
14
|
+
strokeWidth?: number;
|
|
15
|
+
absoluteStrokeWidth?: boolean;
|
|
16
|
+
style?: StyleProp<ViewStyle & TextStyle>;
|
|
17
|
+
};
|