@korsolutions/ui 0.0.47 → 0.0.48
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/types/props.types.js +2 -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/types/props.types.d.ts +11 -0
- package/dist/typescript/src/types/props.types.d.ts.map +1 -1
- 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/types/props.types.ts +14 -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,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,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"}
|
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/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
|
+
};
|