@korsolutions/ui 0.0.62 → 0.0.64
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/components/avatar/components/avatar-image.js.map +1 -1
- package/dist/module/components/badge/badge.js +30 -0
- package/dist/module/components/badge/badge.js.map +1 -0
- package/dist/module/components/badge/context.js.map +1 -1
- package/dist/module/components/badge/index.js +1 -6
- package/dist/module/components/badge/index.js.map +1 -1
- package/dist/module/components/badge/variants/default.js +17 -14
- package/dist/module/components/badge/variants/default.js.map +1 -1
- package/dist/module/components/badge/variants/secondary.js +17 -14
- package/dist/module/components/badge/variants/secondary.js.map +1 -1
- package/dist/module/components/input/input.js.map +1 -1
- package/dist/module/components/menu/components/menu-checkbox-item.js +4 -2
- package/dist/module/components/menu/components/menu-checkbox-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-item.js +4 -2
- package/dist/module/components/menu/components/menu-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-radio-item.js +4 -2
- package/dist/module/components/menu/components/menu-radio-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-trigger.js +2 -7
- package/dist/module/components/menu/components/menu-trigger.js.map +1 -1
- package/dist/module/components/popover/components/popover-trigger.js +3 -8
- package/dist/module/components/popover/components/popover-trigger.js.map +1 -1
- package/dist/module/components/portal/portal.js +5 -4
- package/dist/module/components/portal/portal.js.map +1 -1
- package/dist/module/components/select/components/select-overlay.js +1 -0
- package/dist/module/components/select/components/select-overlay.js.map +1 -1
- package/dist/module/components/select/variants/default.js +5 -2
- package/dist/module/components/select/variants/default.js.map +1 -1
- package/dist/module/components/tabs/components/tabs-item.js +1 -1
- package/dist/module/components/tabs/components/tabs-item.js.map +1 -1
- package/dist/module/components/toast/components/toast-icon.js.map +1 -1
- package/dist/module/hooks/use-is-react-navigation-modal.js +41 -0
- package/dist/module/hooks/use-is-react-navigation-modal.js.map +1 -0
- package/dist/module/{components/tabs → hooks}/use-organized-children.js +2 -2
- package/dist/module/hooks/use-organized-children.js.map +1 -0
- package/dist/module/hooks/use-relative-position.js +20 -12
- package/dist/module/hooks/use-relative-position.js.map +1 -1
- package/dist/module/index.js +3 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/themes/provider.js.map +1 -1
- package/dist/module/utils/normalize-layout.js +10 -0
- package/dist/module/utils/normalize-layout.js.map +1 -1
- package/dist/typescript/src/components/avatar/components/avatar-image.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/badge.d.ts +12 -0
- package/dist/typescript/src/components/badge/badge.d.ts.map +1 -0
- package/dist/typescript/src/components/badge/context.d.ts +1 -2
- package/dist/typescript/src/components/badge/context.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/index.d.ts +1 -8
- package/dist/typescript/src/components/badge/index.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/types.d.ts +6 -5
- package/dist/typescript/src/components/badge/types.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/variants/secondary.d.ts.map +1 -1
- package/dist/typescript/src/components/input/input.d.ts +1 -1
- package/dist/typescript/src/components/input/input.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-checkbox-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-radio-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/types.d.ts +2 -1
- package/dist/typescript/src/components/menu/types.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/components/popover-trigger.d.ts +1 -1
- package/dist/typescript/src/components/popover/components/popover-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/portal/portal.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/select/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/toast/components/toast-icon.d.ts +1 -1
- package/dist/typescript/src/components/toast/components/toast-icon.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-is-react-navigation-modal.d.ts +3 -0
- package/dist/typescript/src/hooks/use-is-react-navigation-modal.d.ts.map +1 -0
- package/dist/typescript/src/hooks/use-organized-children.d.ts +5 -0
- package/dist/typescript/src/hooks/use-organized-children.d.ts.map +1 -0
- package/dist/typescript/src/hooks/use-relative-position.d.ts +1 -1
- package/dist/typescript/src/hooks/use-relative-position.d.ts.map +1 -1
- package/dist/typescript/src/index.d.ts.map +1 -1
- package/dist/typescript/src/themes/provider.d.ts +3 -3
- package/dist/typescript/src/themes/provider.d.ts.map +1 -1
- package/dist/typescript/src/types/props.types.d.ts +2 -1
- package/dist/typescript/src/types/props.types.d.ts.map +1 -1
- package/dist/typescript/src/utils/normalize-layout.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/components/avatar-image.tsx +14 -2
- package/src/components/badge/badge.tsx +46 -0
- package/src/components/badge/context.ts +1 -2
- package/src/components/badge/index.ts +1 -10
- package/src/components/badge/types.ts +6 -6
- package/src/components/badge/variants/default.tsx +17 -14
- package/src/components/badge/variants/secondary.tsx +17 -14
- package/src/components/input/input.tsx +6 -2
- package/src/components/menu/components/menu-checkbox-item.tsx +9 -2
- package/src/components/menu/components/menu-item.tsx +9 -2
- package/src/components/menu/components/menu-radio-item.tsx +9 -2
- package/src/components/menu/components/menu-trigger.tsx +2 -7
- package/src/components/menu/types.ts +2 -1
- package/src/components/popover/components/popover-trigger.tsx +8 -10
- package/src/components/portal/portal.tsx +4 -3
- package/src/components/select/components/select-overlay.tsx +1 -0
- package/src/components/select/variants/default.tsx +4 -1
- package/src/components/tabs/components/tabs-item.tsx +1 -1
- package/src/components/toast/components/toast-icon.tsx +1 -1
- package/src/hooks/use-is-react-navigation-modal.ts +56 -0
- package/src/{components/tabs → hooks}/use-organized-children.tsx +3 -3
- package/src/hooks/use-relative-position.ts +33 -18
- package/src/index.tsx +4 -0
- package/src/themes/provider.tsx +5 -3
- package/src/types/props.types.ts +2 -1
- package/src/utils/normalize-layout.ts +10 -0
- package/dist/module/components/badge/components/badge-label.js +0 -17
- package/dist/module/components/badge/components/badge-label.js.map +0 -1
- package/dist/module/components/badge/components/badge-root.js +0 -27
- package/dist/module/components/badge/components/badge-root.js.map +0 -1
- package/dist/module/components/menu/use-organized-children.js +0 -39
- package/dist/module/components/menu/use-organized-children.js.map +0 -1
- package/dist/module/components/tabs/use-organized-children.js.map +0 -1
- package/dist/typescript/src/components/badge/components/badge-label.d.ts +0 -9
- package/dist/typescript/src/components/badge/components/badge-label.d.ts.map +0 -1
- package/dist/typescript/src/components/badge/components/badge-root.d.ts +0 -13
- package/dist/typescript/src/components/badge/components/badge-root.d.ts.map +0 -1
- package/dist/typescript/src/components/menu/use-organized-children.d.ts +0 -3
- package/dist/typescript/src/components/menu/use-organized-children.d.ts.map +0 -1
- package/dist/typescript/src/components/tabs/use-organized-children.d.ts +0 -5
- package/dist/typescript/src/components/tabs/use-organized-children.d.ts.map +0 -1
- package/src/components/badge/components/badge-label.tsx +0 -21
- package/src/components/badge/components/badge-root.tsx +0 -36
- package/src/components/menu/use-organized-children.tsx +0 -38
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { calculateComposedStyles } from "../../../utils/calculate-styles.js";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { View } from "react-native";
|
|
6
|
-
import { BadgeContext } from "../context.js";
|
|
7
|
-
import { BadgeVariants } from "../variants/index.js";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export function BadgeRoot(props) {
|
|
10
|
-
const variantStyles = BadgeVariants[props.variant || "default"]();
|
|
11
|
-
const customStyle = props.color ? {
|
|
12
|
-
backgroundColor: props.color
|
|
13
|
-
} : undefined;
|
|
14
|
-
const composedStyle = calculateComposedStyles(variantStyles, "default", "root", props.style);
|
|
15
|
-
const Component = props.render ?? View;
|
|
16
|
-
return /*#__PURE__*/_jsx(BadgeContext.Provider, {
|
|
17
|
-
value: {
|
|
18
|
-
state: "default",
|
|
19
|
-
styles: variantStyles
|
|
20
|
-
},
|
|
21
|
-
children: /*#__PURE__*/_jsx(Component, {
|
|
22
|
-
...props,
|
|
23
|
-
style: [composedStyle, customStyle]
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=badge-root.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["calculateComposedStyles","React","View","BadgeContext","BadgeVariants","jsx","_jsx","BadgeRoot","props","variantStyles","variant","customStyle","color","backgroundColor","undefined","composedStyle","style","Component","render","Provider","value","state","styles","children"],"sourceRoot":"../../../../../src","sources":["components/badge/components/badge-root.tsx"],"mappings":";;AACA,SAASA,uBAAuB,QAAQ,oCAAiC;AACzE,OAAOC,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,QAAwB,cAAc;AACnE,SAASC,YAAY,QAAQ,eAAY;AACzC,SAASC,aAAa,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAY5C,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAMC,aAAa,GAAGL,aAAa,CAACI,KAAK,CAACE,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC;EAEjE,MAAMC,WAAW,GAAGH,KAAK,CAACI,KAAK,GAAG;IAAEC,eAAe,EAAEL,KAAK,CAACI;EAAM,CAAC,GAAGE,SAAS;EAE9E,MAAMC,aAAa,GAAGf,uBAAuB,CAACS,aAAa,EAAE,SAAS,EAAE,MAAM,EAAED,KAAK,CAACQ,KAAK,CAAC;EAE5F,MAAMC,SAAS,GAAGT,KAAK,CAACU,MAAM,IAAIhB,IAAI;EACtC,oBACEI,IAAA,CAACH,YAAY,CAACgB,QAAQ;IACpBC,KAAK,EAAE;MACLC,KAAK,EAAE,SAAS;MAChBC,MAAM,EAAEb;IACV,CAAE;IAAAc,QAAA,eAEFjB,IAAA,CAACW,SAAS;MAAA,GAAKT,KAAK;MAAEQ,KAAK,EAAE,CAACD,aAAa,EAAEJ,WAAW;IAAE,CAAE;EAAC,CACxC,CAAC;AAE5B","ignoreList":[]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useMemo } from "react";
|
|
4
|
-
import { Text } from "react-native";
|
|
5
|
-
import { getElementProp } from "../../utils/element-utils.js";
|
|
6
|
-
import { Icon } from "../icon/index.js";
|
|
7
|
-
import { useMenu } from "./context.js";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export function useOrganizedChildren(children) {
|
|
10
|
-
const menu = useMenu();
|
|
11
|
-
const organizedChildren = useMemo(() => {
|
|
12
|
-
if (typeof children === "string") {
|
|
13
|
-
return /*#__PURE__*/_jsx(Text, {
|
|
14
|
-
style: menu.styles?.itemText,
|
|
15
|
-
children: children
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
if (Array.isArray(children)) {
|
|
19
|
-
return children.map((child, index) => {
|
|
20
|
-
if (typeof child === "string") {
|
|
21
|
-
return /*#__PURE__*/_jsx(Text, {
|
|
22
|
-
style: menu.styles?.itemText,
|
|
23
|
-
children: child
|
|
24
|
-
}, index);
|
|
25
|
-
} else if (/*#__PURE__*/React.isValidElement(child) && child.type === Icon) {
|
|
26
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
27
|
-
key: child.key,
|
|
28
|
-
...menu.styles?.itemIcon,
|
|
29
|
-
style: [menu.styles?.itemIcon?.style, getElementProp(child, "style")]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return child;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return children;
|
|
36
|
-
}, [children, menu.styles?.itemIcon]);
|
|
37
|
-
return organizedChildren;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=use-organized-children.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Text","getElementProp","Icon","useMenu","jsx","_jsx","useOrganizedChildren","children","menu","organizedChildren","style","styles","itemText","Array","isArray","map","child","index","isValidElement","type","cloneElement","key","itemIcon"],"sourceRoot":"../../../../src","sources":["components/menu/use-organized-children.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,cAAc,QAAQ,8BAA2B;AAC1D,SAASC,IAAI,QAAQ,kBAAS;AAC9B,SAASC,OAAO,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpC,OAAO,SAASC,oBAAoBA,CAACC,QAAyB,EAAE;EAC9D,MAAMC,IAAI,GAAGL,OAAO,CAAC,CAAC;EAEtB,MAAMM,iBAAiB,GAAGV,OAAO,CAAC,MAAM;IACtC,IAAI,OAAOQ,QAAQ,KAAK,QAAQ,EAAE;MAChC,oBAAOF,IAAA,CAACL,IAAI;QAACU,KAAK,EAAEF,IAAI,CAACG,MAAM,EAAEC,QAAS;QAAAL,QAAA,EAAEA;MAAQ,CAAO,CAAC;IAC9D;IACA,IAAIM,KAAK,CAACC,OAAO,CAACP,QAAQ,CAAC,EAAE;MAC3B,OAAOA,QAAQ,CAACQ,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;QACpC,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;UAC7B,oBACEX,IAAA,CAACL,IAAI;YAAaU,KAAK,EAAEF,IAAI,CAACG,MAAM,EAAEC,QAAS;YAAAL,QAAA,EAC5CS;UAAK,GADGC,KAEL,CAAC;QAEX,CAAC,MAAM,IAAI,aAAAnB,KAAK,CAACoB,cAAc,CAACF,KAAK,CAAC,IAAIA,KAAK,CAACG,IAAI,KAAKjB,IAAI,EAAE;UAC7D,oBAAOJ,KAAK,CAACsB,YAAY,CAACJ,KAAK,EAA6B;YAC1DK,GAAG,EAAEL,KAAK,CAACK,GAAG;YACd,GAAGb,IAAI,CAACG,MAAM,EAAEW,QAAQ;YACxBZ,KAAK,EAAE,CACLF,IAAI,CAACG,MAAM,EAAEW,QAAQ,EAAEZ,KAAK,EAC5BT,cAAc,CAACe,KAAK,EAAE,OAAO,CAAC;UAElC,CAAC,CAAC;QACJ;QACA,OAAOA,KAAK;MACd,CAAC,CAAC;IACJ;IACA,OAAOT,QAAQ;EACjB,CAAC,EAAE,CAACA,QAAQ,EAAEC,IAAI,CAACG,MAAM,EAAEW,QAAQ,CAAC,CAAC;EACrC,OAAOb,iBAAiB;AAC1B","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Text","getElementProp","Icon","jsx","_jsx","useOrganizedChildren","children","textStyle","iconProps","organizedChildren","style","Array","isArray","map","child","index","isValidElement","type","cloneElement","key"],"sourceRoot":"../../../../src","sources":["components/tabs/use-organized-children.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,QAAwC,cAAc;AACnE,SAASC,cAAc,QAAQ,8BAA2B;AAC1D,SAASC,IAAI,QAAwB,kBAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,OAAO,SAASC,oBAAoBA,CAClCC,QAAyB,EACzBC,SAA2C,EAC3CC,SAAgC,EAChC;EACA,MAAMC,iBAAiB,GAAGV,OAAO,CAAC,MAAM;IACtC,IAAI,OAAOO,QAAQ,KAAK,QAAQ,EAAE;MAChC,oBAAOF,IAAA,CAACJ,IAAI;QAACU,KAAK,EAAEH,SAAU;QAAAD,QAAA,EAAEA;MAAQ,CAAO,CAAC;IAClD;IACA,IAAIK,KAAK,CAACC,OAAO,CAACN,QAAQ,CAAC,EAAE;MAC3B,OAAOA,QAAQ,CAACO,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;QACpC,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;UAC7B,oBACEV,IAAA,CAACJ,IAAI;YAAaU,KAAK,EAAEH,SAAU;YAAAD,QAAA,EAChCQ;UAAK,GADGC,KAEL,CAAC;QAEX,CAAC,MAAM,IAAI,aAAAjB,KAAK,CAACkB,cAAc,CAACF,KAAK,CAAC,IAAIA,KAAK,CAACG,IAAI,KAAKf,IAAI,EAAE;UAC7D,oBAAOJ,KAAK,CAACoB,YAAY,CAACJ,KAAK,EAA6B;YAC1DK,GAAG,EAAEL,KAAK,CAACK,GAAG;YACd,GAAGX,SAAS;YACZE,KAAK,EAAE,CAACF,SAAS,EAAEE,KAAK,EAAET,cAAc,CAACa,KAAK,EAAE,OAAO,CAAC;UAC1D,CAAC,CAAC;QACJ;QACA,OAAOA,KAAK;MACd,CAAC,CAAC;IACJ;IACA,OAAOR,QAAQ;EACjB,CAAC,EAAE,CAACA,QAAQ,EAAEE,SAAS,EAAED,SAAS,CAAC,CAAC;EAEpC,OAAOE,iBAAiB;AAC1B","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { type StyleProp, type TextStyle } from "react-native";
|
|
3
|
-
export interface BadgeLabelProps {
|
|
4
|
-
children?: string;
|
|
5
|
-
render?: (props: BadgeLabelProps) => React.ReactNode;
|
|
6
|
-
style?: StyleProp<TextStyle>;
|
|
7
|
-
}
|
|
8
|
-
export declare function BadgeLabel(props: BadgeLabelProps): React.JSX.Element;
|
|
9
|
-
//# sourceMappingURL=badge-label.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"badge-label.d.ts","sourceRoot":"","sources":["../../../../../../src/components/badge/components/badge-label.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,SAAS,CAAC;IAErD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAOhD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ElementChildren } from "../../../types/element.types";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { type StyleProp, type ViewStyle } from "react-native";
|
|
4
|
-
import { BadgeVariants } from "../variants";
|
|
5
|
-
export interface BadgeRootProps {
|
|
6
|
-
variant?: keyof typeof BadgeVariants;
|
|
7
|
-
color?: string;
|
|
8
|
-
children?: ElementChildren;
|
|
9
|
-
render?: (props: BadgeRootProps) => React.ReactNode;
|
|
10
|
-
style?: StyleProp<ViewStyle>;
|
|
11
|
-
}
|
|
12
|
-
export declare function BadgeRoot(props: BadgeRootProps): React.JSX.Element;
|
|
13
|
-
//# sourceMappingURL=badge-root.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"badge-root.d.ts","sourceRoot":"","sources":["../../../../../../src/components/badge/components/badge-root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAEpD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAkB9C"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare function useOrganizedChildren(children: React.ReactNode): number | bigint | boolean | any[] | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
3
|
-
//# sourceMappingURL=use-organized-children.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-organized-children.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/use-organized-children.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,kSA+B7D"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { type StyleProp, type TextStyle } from "react-native";
|
|
3
|
-
import { type IconProps } from "../icon";
|
|
4
|
-
export declare function useOrganizedChildren(children: React.ReactNode, textStyle: StyleProp<TextStyle> | undefined, iconProps: IconProps | undefined): number | bigint | boolean | any[] | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
5
|
-
//# sourceMappingURL=use-organized-children.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-organized-children.d.ts","sourceRoot":"","sources":["../../../../../src/components/tabs/use-organized-children.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,EAC3C,SAAS,EAAE,SAAS,GAAG,SAAS,kSA4BjC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { type StyleProp, Text, type TextStyle } from "react-native";
|
|
4
|
-
import { useBadge } from "../context";
|
|
5
|
-
|
|
6
|
-
export interface BadgeLabelProps {
|
|
7
|
-
children?: string;
|
|
8
|
-
|
|
9
|
-
render?: (props: BadgeLabelProps) => React.ReactNode;
|
|
10
|
-
|
|
11
|
-
style?: StyleProp<TextStyle>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function BadgeLabel(props: BadgeLabelProps) {
|
|
15
|
-
const badge = useBadge();
|
|
16
|
-
|
|
17
|
-
const composedStyle = calculateComposedStyles(badge.styles, badge.state, "label", props.style);
|
|
18
|
-
|
|
19
|
-
const Component = props.render ?? Text;
|
|
20
|
-
return <Component {...props} style={composedStyle} />;
|
|
21
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ElementChildren } from "../../../types/element.types";
|
|
2
|
-
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
5
|
-
import { BadgeContext } from "../context";
|
|
6
|
-
import { BadgeVariants } from "../variants";
|
|
7
|
-
|
|
8
|
-
export interface BadgeRootProps {
|
|
9
|
-
variant?: keyof typeof BadgeVariants;
|
|
10
|
-
color?: string;
|
|
11
|
-
children?: ElementChildren;
|
|
12
|
-
|
|
13
|
-
render?: (props: BadgeRootProps) => React.ReactNode;
|
|
14
|
-
|
|
15
|
-
style?: StyleProp<ViewStyle>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function BadgeRoot(props: BadgeRootProps) {
|
|
19
|
-
const variantStyles = BadgeVariants[props.variant || "default"]();
|
|
20
|
-
|
|
21
|
-
const customStyle = props.color ? { backgroundColor: props.color } : undefined;
|
|
22
|
-
|
|
23
|
-
const composedStyle = calculateComposedStyles(variantStyles, "default", "root", props.style);
|
|
24
|
-
|
|
25
|
-
const Component = props.render ?? View;
|
|
26
|
-
return (
|
|
27
|
-
<BadgeContext.Provider
|
|
28
|
-
value={{
|
|
29
|
-
state: "default",
|
|
30
|
-
styles: variantStyles,
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
<Component {...props} style={[composedStyle, customStyle]} />
|
|
34
|
-
</BadgeContext.Provider>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from "react";
|
|
2
|
-
import { Text } from "react-native";
|
|
3
|
-
import { getElementProp } from "../../utils/element-utils";
|
|
4
|
-
import { Icon } from "../icon";
|
|
5
|
-
import { useMenu } from "./context";
|
|
6
|
-
|
|
7
|
-
export function useOrganizedChildren(children: React.ReactNode) {
|
|
8
|
-
const menu = useMenu();
|
|
9
|
-
|
|
10
|
-
const organizedChildren = useMemo(() => {
|
|
11
|
-
if (typeof children === "string") {
|
|
12
|
-
return <Text style={menu.styles?.itemText}>{children}</Text>;
|
|
13
|
-
}
|
|
14
|
-
if (Array.isArray(children)) {
|
|
15
|
-
return children.map((child, index) => {
|
|
16
|
-
if (typeof child === "string") {
|
|
17
|
-
return (
|
|
18
|
-
<Text key={index} style={menu.styles?.itemText}>
|
|
19
|
-
{child}
|
|
20
|
-
</Text>
|
|
21
|
-
);
|
|
22
|
-
} else if (React.isValidElement(child) && child.type === Icon) {
|
|
23
|
-
return React.cloneElement(child as React.ReactElement<any>, {
|
|
24
|
-
key: child.key,
|
|
25
|
-
...menu.styles?.itemIcon,
|
|
26
|
-
style: [
|
|
27
|
-
menu.styles?.itemIcon?.style,
|
|
28
|
-
getElementProp(child, "style"),
|
|
29
|
-
],
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return child;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return children;
|
|
36
|
-
}, [children, menu.styles?.itemIcon]);
|
|
37
|
-
return organizedChildren;
|
|
38
|
-
}
|