@korsolutions/ui 0.0.25 → 0.0.27

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,6 +1,7 @@
1
- import { Et as InputStyles, K as AvatarStyles, L as BadgeStyles, M as TextareaPrimitiveBaseProps, P as TextareaStyles, T as DropdownMenuStyles, V as ToastStyles, Z as EmptyStyles, _ as PopoverStyles, a as CalendarStyles, ft as SelectStyles, kt as FieldStyles, r as CalendarRootProps, rt as CardStyles, ut as SelectRootBaseProps, wt as InputPrimitiveBaseProps, x as PopoverTriggerRef, xt as ButtonStyles, yt as ButtonPrimitiveRootProps } from "../index-DLFYQx-P.mjs";
1
+ import { $ as EmptyStyles, C as PopoverTriggerRef, Ct as ButtonStyles, D as DropdownMenuStyles, Et as InputPrimitiveBaseProps, I as TextareaStyles, J as AvatarStyles, Ot as InputStyles, P as TextareaPrimitiveBaseProps, U as ToastStyles, a as CalendarStyles, at as CardStyles, ft as SelectRootBaseProps, jt as FieldStyles, mt as SelectStyles, r as CalendarRootProps, xt as ButtonPrimitiveRootProps, y as PopoverStyles, z as BadgeStyles } from "../index-_EJRToiG.mjs";
2
2
  import "../use-relative-position-DBzhrBU7.mjs";
3
- import { t as NumericMaskFormat } from "../use-numeric-mask-B9WZG25o.mjs";
3
+ import "../portal.constants-ClRV24_C.mjs";
4
+ import { t as NumericMaskFormat } from "../use-numeric-mask-D4zqPOnE.mjs";
4
5
  import React from "react";
5
6
  import { ImageSource, PressableProps, TextProps, TextStyle } from "react-native";
6
7
 
@@ -1,5 +1,5 @@
1
- import { i as useThemedStyles, r as ToastComponent, t as ToastAPI } from "../toast-manager-BCt2uAJl.mjs";
2
- import { a as TextareaPrimitive, c as AvatarPrimitive, d as SelectPrimitive, f as ButtonPrimitive, i as DropdownMenuPrimitive, l as EmptyPrimitive, m as FieldPrimitive, n as PopoverPrimitive, o as BadgePrimitive, p as InputPrimitive, r as usePopover, t as CalendarPrimitive, u as CardPrimitive } from "../primitives-1609Y7eP.mjs";
1
+ import { i as useThemedStyles, r as ToastComponent, t as ToastAPI } from "../toast-manager-B5sELMqc.mjs";
2
+ import { a as TextareaPrimitive, c as AvatarPrimitive, d as SelectPrimitive, f as ButtonPrimitive, i as DropdownMenuPrimitive, l as EmptyPrimitive, m as FieldPrimitive, n as PopoverPrimitive, o as BadgePrimitive, p as InputPrimitive, r as usePopover, t as CalendarPrimitive, u as CardPrimitive } from "../primitives-8eataXpJ.mjs";
3
3
  import "../use-relative-position-BTKEyT1F.mjs";
4
4
  import { t as useNumericMask } from "../use-numeric-mask-BQlz1Pus.mjs";
5
5
  import React, { forwardRef, useEffect, useState } from "react";
@@ -777,7 +777,10 @@ function DropdownMenu(props) {
777
777
  //#region src/components/popover/variants/default.tsx
778
778
  const usePopoverVariantDefault = () => {
779
779
  return useThemedStyles(({ colors, radius }) => ({
780
- overlay: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
780
+ overlay: {
781
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
782
+ zIndex: 999
783
+ },
781
784
  content: {
782
785
  backgroundColor: colors.surface,
783
786
  borderRadius: radius,
@@ -1,5 +1,5 @@
1
1
  import { i as useRelativePosition, n as DEFAULT_POSITION, r as LayoutPosition, t as DEFAULT_LAYOUT } from "../use-relative-position-DBzhrBU7.mjs";
2
- import { i as useNumericMask, n as UseNumericMaskOptions, r as UseNumericMaskReturn, t as NumericMaskFormat } from "../use-numeric-mask-B9WZG25o.mjs";
2
+ import { i as useNumericMask, n as UseNumericMaskOptions, r as UseNumericMaskReturn, t as NumericMaskFormat } from "../use-numeric-mask-D4zqPOnE.mjs";
3
3
 
4
4
  //#region src/hooks/use-screen-size.d.ts
5
5
  type ScreenSize = "mobile" | "tablet" | "desktop";
@@ -1,5 +1,6 @@
1
1
  import { r as LayoutPosition } from "./use-relative-position-DBzhrBU7.mjs";
2
- import * as react7 from "react";
2
+ import { n as PortalHostProps, r as PortalProps } from "./portal.constants-ClRV24_C.mjs";
3
+ import * as react10 from "react";
3
4
  import React$1, { Dispatch, RefAttributes } from "react";
4
5
  import { ImageSource, ImageStyle, LayoutRectangle, PressableProps, StyleProp, TextInput, TextInputProps, TextProps, TextStyle, View, ViewProps, ViewStyle } from "react-native";
5
6
 
@@ -67,7 +68,7 @@ interface InputPrimitiveProps extends InputPrimitiveBaseProps {
67
68
  render?: (props: InputPrimitiveProps) => React.ReactNode;
68
69
  styles?: InputStyles;
69
70
  }
70
- declare const InputPrimitive: react7.ForwardRefExoticComponent<Omit<InputPrimitiveProps, "ref"> & react7.RefAttributes<TextInput>>;
71
+ declare const InputPrimitive: react10.ForwardRefExoticComponent<Omit<InputPrimitiveProps, "ref"> & react10.RefAttributes<TextInput>>;
71
72
  //#endregion
72
73
  //#region src/primitives/button/button-label.d.ts
73
74
  interface ButtonPrimitiveLabelProps {
@@ -153,7 +154,7 @@ interface SelectOptionProps {
153
154
  render?: (props: SelectOptionProps) => React.ReactElement;
154
155
  style?: StyleProp<TextStyle>;
155
156
  }
156
- declare function SelectOption(props: SelectOptionProps): react7.JSX.Element;
157
+ declare function SelectOption(props: SelectOptionProps): react10.JSX.Element;
157
158
  //#endregion
158
159
  //#region src/primitives/select/types.d.ts
159
160
  type SelectState = "default" | "disabled";
@@ -434,7 +435,7 @@ interface TextareaPrimitiveProps extends TextareaPrimitiveBaseProps {
434
435
  render?: (props: TextareaPrimitiveProps) => React.ReactNode;
435
436
  styles?: TextareaStyles;
436
437
  }
437
- declare function TextareaPrimitive(props: TextareaPrimitiveProps): react7.JSX.Element;
438
+ declare function TextareaPrimitive(props: TextareaPrimitiveProps): react10.JSX.Element;
438
439
  //#endregion
439
440
  //#region src/primitives/dropdown-menu/dropdown-menu-trigger.d.ts
440
441
  interface DropdownMenuTriggerProps extends PressableProps {
@@ -505,7 +506,7 @@ declare function DropdownMenuPortal(props: DropdownMenuPortalProps): React$1.JSX
505
506
  //#region src/primitives/dropdown-menu/index.d.ts
506
507
  declare const DropdownMenuPrimitive: {
507
508
  Root: typeof DropdownMenuRoot;
508
- Trigger: react7.ForwardRefExoticComponent<DropdownMenuTriggerProps & react7.RefAttributes<DropdownMenuTriggerRef>>;
509
+ Trigger: react10.ForwardRefExoticComponent<DropdownMenuTriggerProps & react10.RefAttributes<DropdownMenuTriggerRef>>;
509
510
  Portal: typeof DropdownMenuPortal;
510
511
  Overlay: typeof DropdownMenuOverlay;
511
512
  Content: typeof DropdownMenuContent;
@@ -579,19 +580,32 @@ interface PopoverContext {
579
580
  setTriggerPosition: Dispatch<React.SetStateAction<LayoutPosition>>;
580
581
  styles?: PopoverStyles;
581
582
  }
582
- declare const PopoverContext: react7.Context<PopoverContext | undefined>;
583
+ declare const PopoverContext: react10.Context<PopoverContext | undefined>;
583
584
  declare const usePopover: () => PopoverContext;
584
585
  //#endregion
585
586
  //#region src/primitives/popover/index.d.ts
586
587
  declare const PopoverPrimitive: {
587
588
  Root: typeof PopoverRoot;
588
- Trigger: react7.ForwardRefExoticComponent<PopoverTriggerProps & react7.RefAttributes<PopoverTriggerRef>>;
589
+ Trigger: react10.ForwardRefExoticComponent<PopoverTriggerProps & react10.RefAttributes<PopoverTriggerRef>>;
589
590
  Portal: typeof PopoverPortal;
590
591
  Overlay: typeof PopoverOverlay;
591
592
  Content: typeof PopoverContent;
592
593
  Close: typeof PopoverClose;
593
594
  };
594
595
  //#endregion
596
+ //#region src/primitives/portal/portal.d.ts
597
+ declare function NativePortalHost({
598
+ name,
599
+ container
600
+ }: PortalHostProps): react10.JSX.Element | null;
601
+ declare const PortalHost: typeof NativePortalHost;
602
+ declare function NativePortal({
603
+ name,
604
+ hostName,
605
+ children
606
+ }: PortalProps): react10.JSX.Element;
607
+ declare const Portal: typeof NativePortal;
608
+ //#endregion
595
609
  //#region src/primitives/calendar/calendar-weeks.d.ts
596
610
  interface CalendarWeekProps extends ViewProps {
597
611
  index: number;
@@ -687,4 +701,4 @@ declare const CalendarPrimitive: {
687
701
  Day: typeof CalendarDay;
688
702
  };
689
703
  //#endregion
690
- export { EmptyMediaProps as $, DropdownMenuTriggerProps as A, FieldErrorProps as At, ToastRootProps as B, DropdownMenuPortalProps as C, InputPrimitive as Ct, DropdownMenuDividerProps as D, FieldPrimitive as Dt, DropdownMenuOverlayProps as E, InputStyles as Et, BadgePrimitive as F, AvatarRootProps as G, ToastDescriptionProps as H, BadgeRootProps as I, AvatarFallbackProps as J, AvatarStyles as K, BadgeStyles as L, TextareaPrimitiveBaseProps as M, FieldLabelProps as Mt, TextareaPrimitiveProps as N, DropdownMenuButtonProps as O, FieldPrimitiveRootProps as Ot, TextareaStyles as P, EmptyTitleProps as Q, BadgeLabelProps as R, DropdownMenuPrimitive as S, ButtonPrimitiveLabelProps as St, DropdownMenuStyles as T, InputPrimitiveProps as Tt, ToastTitleProps as U, ToastStyles as V, AvatarPrimitive as W, EmptyRootProps as X, EmptyPrimitive as Y, EmptyStyles as Z, PopoverStyles as _, SelectTriggerProps as _t, CalendarStyles as a, CardBodyProps as at, PopoverTriggerProps as b, ButtonState as bt, CalendarDayProps as c, SelectPrimitive as ct, PopoverPrimitive as d, SelectRootProps as dt, EmptyDescriptionProps as et, PopoverContext as f, SelectStyles as ft, PopoverRootProps as g, SelectValueProps as gt, PopoverPortalProps as h, SelectOverlayProps as ht, CalendarDayState as i, CardFooterProps as it, TextareaPrimitive as j, FieldDescriptionProps as jt, DropdownMenuContentProps as k, FieldStyles as kt, CalendarWeekLabelsProps as l, SelectPortalProps as lt, PopoverCloseProps as m, SelectContentProps as mt, CalendarNavButtonProps as n, CardRootProps as nt, CalendarTitleProps as o, CardTitleProps as ot, usePopover as p, SelectOptionProps as pt, AvatarImageProps as q, CalendarRootProps as r, CardStyles as rt, CalendarHeaderProps as s, CardHeaderProps as st, CalendarPrimitive as t, CardPrimitive as tt, CalendarWeeksProps as u, SelectRootBaseProps as ut, PopoverOverlayProps as v, ButtonPrimitive as vt, DropdownMenuRootProps as w, InputPrimitiveBaseProps as wt, PopoverTriggerRef as x, ButtonStyles as xt, PopoverContentProps as y, ButtonPrimitiveRootProps as yt, ToastPrimitive as z };
704
+ export { EmptyStyles as $, DropdownMenuButtonProps as A, FieldPrimitiveRootProps as At, BadgeLabelProps as B, PopoverTriggerRef as C, ButtonStyles as Ct, DropdownMenuStyles as D, InputPrimitiveProps as Dt, DropdownMenuRootProps as E, InputPrimitiveBaseProps as Et, TextareaPrimitiveProps as F, ToastTitleProps as G, ToastRootProps as H, TextareaStyles as I, AvatarStyles as J, AvatarPrimitive as K, BadgePrimitive as L, DropdownMenuTriggerProps as M, FieldErrorProps as Mt, TextareaPrimitive as N, FieldDescriptionProps as Nt, DropdownMenuOverlayProps as O, InputStyles as Ot, TextareaPrimitiveBaseProps as P, FieldLabelProps as Pt, EmptyRootProps as Q, BadgeRootProps as R, PopoverTriggerProps as S, ButtonState as St, DropdownMenuPortalProps as T, InputPrimitive as Tt, ToastStyles as U, ToastPrimitive as V, ToastDescriptionProps as W, AvatarFallbackProps as X, AvatarImageProps as Y, EmptyPrimitive as Z, PopoverPortalProps as _, SelectOverlayProps as _t, CalendarStyles as a, CardStyles as at, PopoverOverlayProps as b, ButtonPrimitive as bt, CalendarDayProps as c, CardTitleProps as ct, Portal as d, SelectPortalProps as dt, EmptyTitleProps as et, PortalHost as f, SelectRootBaseProps as ft, PopoverCloseProps as g, SelectContentProps as gt, usePopover as h, SelectOptionProps as ht, CalendarDayState as i, CardRootProps as it, DropdownMenuContentProps as j, FieldStyles as jt, DropdownMenuDividerProps as k, FieldPrimitive as kt, CalendarWeekLabelsProps as l, CardHeaderProps as lt, PopoverContext as m, SelectStyles as mt, CalendarNavButtonProps as n, EmptyDescriptionProps as nt, CalendarTitleProps as o, CardFooterProps as ot, PopoverPrimitive as p, SelectRootProps as pt, AvatarRootProps as q, CalendarRootProps as r, CardPrimitive as rt, CalendarHeaderProps as s, CardBodyProps as st, CalendarPrimitive as t, EmptyMediaProps as tt, CalendarWeeksProps as u, SelectPrimitive as ut, PopoverRootProps as v, SelectValueProps as vt, DropdownMenuPrimitive as w, ButtonPrimitiveLabelProps as wt, PopoverContentProps as x, ButtonPrimitiveRootProps as xt, PopoverStyles as y, SelectTriggerProps as yt, BadgeStyles as z };
package/dist/index.d.mts CHANGED
@@ -1,14 +1,6 @@
1
- import * as react5 from "react";
1
+ import { n as PortalHostProps } from "./portal.constants-ClRV24_C.mjs";
2
+ import * as react7 from "react";
2
3
 
3
- //#region src/primitives/portal/portal.constants.d.ts
4
- interface PortalHostProps {
5
- name?: string;
6
- container?: {
7
- ios?: React.ComponentType<React.PropsWithChildren>;
8
- android?: React.ComponentType<React.PropsWithChildren>;
9
- };
10
- }
11
- //#endregion
12
4
  //#region src/themes/types.d.ts
13
5
  type ThemeName = "default";
14
6
  type ColorScheme = "light" | "dark";
@@ -46,7 +38,7 @@ interface ThemeContext {
46
38
  setTheme: (themeName: ThemeName) => void;
47
39
  themeName: ThemeName;
48
40
  }
49
- declare const ThemeContext: react5.Context<ThemeContext | null>;
41
+ declare const ThemeContext: react7.Context<ThemeContext | null>;
50
42
  declare const useTheme: () => ThemeContext;
51
43
  //#endregion
52
44
  //#region src/index.d.ts
@@ -57,6 +49,6 @@ interface ProviderProps {
57
49
  declare const UniversalUIProvider: ({
58
50
  children,
59
51
  portalContainer
60
- }: ProviderProps) => react5.JSX.Element;
52
+ }: ProviderProps) => react7.JSX.Element;
61
53
  //#endregion
62
54
  export { ProviderProps, UniversalUIProvider, useTheme };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as ThemeProvider, n as ToastContainer, o as useTheme } from "./toast-manager-BCt2uAJl.mjs";
2
- import { g as PortalHost } from "./primitives-1609Y7eP.mjs";
1
+ import { a as ThemeProvider, n as ToastContainer, o as useTheme } from "./toast-manager-B5sELMqc.mjs";
2
+ import { g as PortalHost } from "./primitives-8eataXpJ.mjs";
3
3
  import "./use-relative-position-BTKEyT1F.mjs";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
 
@@ -0,0 +1,16 @@
1
+ //#region src/primitives/portal/portal.constants.d.ts
2
+ declare const DEFAULT_PORTAL_HOST = "__KOR_PORTAL_HOST__";
3
+ interface PortalHostProps {
4
+ name?: string;
5
+ container?: {
6
+ ios?: React.ComponentType<React.PropsWithChildren>;
7
+ android?: React.ComponentType<React.PropsWithChildren>;
8
+ };
9
+ }
10
+ interface PortalProps {
11
+ name: string;
12
+ hostName?: string;
13
+ children: React.ReactNode;
14
+ }
15
+ //#endregion
16
+ export { PortalHostProps as n, PortalProps as r, DEFAULT_PORTAL_HOST as t };
@@ -1,3 +1,4 @@
1
- import { $ as EmptyMediaProps, A as DropdownMenuTriggerProps, At as FieldErrorProps, B as ToastRootProps, C as DropdownMenuPortalProps, Ct as InputPrimitive, D as DropdownMenuDividerProps, Dt as FieldPrimitive, E as DropdownMenuOverlayProps, Et as InputStyles, F as BadgePrimitive, G as AvatarRootProps, H as ToastDescriptionProps, I as BadgeRootProps, J as AvatarFallbackProps, K as AvatarStyles, L as BadgeStyles, M as TextareaPrimitiveBaseProps, Mt as FieldLabelProps, N as TextareaPrimitiveProps, O as DropdownMenuButtonProps, Ot as FieldPrimitiveRootProps, P as TextareaStyles, Q as EmptyTitleProps, R as BadgeLabelProps, S as DropdownMenuPrimitive, St as ButtonPrimitiveLabelProps, T as DropdownMenuStyles, Tt as InputPrimitiveProps, U as ToastTitleProps, V as ToastStyles, W as AvatarPrimitive, X as EmptyRootProps, Y as EmptyPrimitive, Z as EmptyStyles, _t as SelectTriggerProps, a as CalendarStyles, at as CardBodyProps, b as PopoverTriggerProps, bt as ButtonState, c as CalendarDayProps, ct as SelectPrimitive, d as PopoverPrimitive, dt as SelectRootProps, et as EmptyDescriptionProps, f as PopoverContext, ft as SelectStyles, g as PopoverRootProps, gt as SelectValueProps, h as PopoverPortalProps, ht as SelectOverlayProps, i as CalendarDayState, it as CardFooterProps, j as TextareaPrimitive, jt as FieldDescriptionProps, k as DropdownMenuContentProps, kt as FieldStyles, l as CalendarWeekLabelsProps, lt as SelectPortalProps, m as PopoverCloseProps, mt as SelectContentProps, n as CalendarNavButtonProps, nt as CardRootProps, o as CalendarTitleProps, ot as CardTitleProps, p as usePopover, pt as SelectOptionProps, q as AvatarImageProps, r as CalendarRootProps, rt as CardStyles, s as CalendarHeaderProps, st as CardHeaderProps, t as CalendarPrimitive, tt as CardPrimitive, u as CalendarWeeksProps, ut as SelectRootBaseProps, v as PopoverOverlayProps, vt as ButtonPrimitive, w as DropdownMenuRootProps, wt as InputPrimitiveBaseProps, x as PopoverTriggerRef, xt as ButtonStyles, y as PopoverContentProps, yt as ButtonPrimitiveRootProps, z as ToastPrimitive } from "../index-DLFYQx-P.mjs";
1
+ import { $ as EmptyStyles, A as DropdownMenuButtonProps, At as FieldPrimitiveRootProps, B as BadgeLabelProps, C as PopoverTriggerRef, Ct as ButtonStyles, D as DropdownMenuStyles, Dt as InputPrimitiveProps, E as DropdownMenuRootProps, Et as InputPrimitiveBaseProps, F as TextareaPrimitiveProps, G as ToastTitleProps, H as ToastRootProps, I as TextareaStyles, J as AvatarStyles, K as AvatarPrimitive, L as BadgePrimitive, M as DropdownMenuTriggerProps, Mt as FieldErrorProps, N as TextareaPrimitive, Nt as FieldDescriptionProps, O as DropdownMenuOverlayProps, Ot as InputStyles, P as TextareaPrimitiveBaseProps, Pt as FieldLabelProps, Q as EmptyRootProps, R as BadgeRootProps, S as PopoverTriggerProps, St as ButtonState, T as DropdownMenuPortalProps, Tt as InputPrimitive, U as ToastStyles, V as ToastPrimitive, W as ToastDescriptionProps, X as AvatarFallbackProps, Y as AvatarImageProps, Z as EmptyPrimitive, _ as PopoverPortalProps, _t as SelectOverlayProps, a as CalendarStyles, at as CardStyles, b as PopoverOverlayProps, bt as ButtonPrimitive, c as CalendarDayProps, ct as CardTitleProps, d as Portal, dt as SelectPortalProps, et as EmptyTitleProps, f as PortalHost, ft as SelectRootBaseProps, g as PopoverCloseProps, gt as SelectContentProps, h as usePopover, ht as SelectOptionProps, i as CalendarDayState, it as CardRootProps, j as DropdownMenuContentProps, jt as FieldStyles, k as DropdownMenuDividerProps, kt as FieldPrimitive, l as CalendarWeekLabelsProps, lt as CardHeaderProps, m as PopoverContext, mt as SelectStyles, n as CalendarNavButtonProps, nt as EmptyDescriptionProps, o as CalendarTitleProps, ot as CardFooterProps, p as PopoverPrimitive, pt as SelectRootProps, q as AvatarRootProps, r as CalendarRootProps, rt as CardPrimitive, s as CalendarHeaderProps, st as CardBodyProps, t as CalendarPrimitive, tt as EmptyMediaProps, u as CalendarWeeksProps, ut as SelectPrimitive, v as PopoverRootProps, vt as SelectValueProps, w as DropdownMenuPrimitive, wt as ButtonPrimitiveLabelProps, x as PopoverContentProps, xt as ButtonPrimitiveRootProps, yt as SelectTriggerProps, z as BadgeStyles } from "../index-_EJRToiG.mjs";
2
2
  import "../use-relative-position-DBzhrBU7.mjs";
3
- export { AvatarFallbackProps, AvatarImageProps, AvatarPrimitive, AvatarRootProps, AvatarStyles, BadgeLabelProps, BadgePrimitive, BadgeRootProps, BadgeStyles, ButtonPrimitive, ButtonPrimitiveLabelProps, ButtonPrimitiveRootProps, ButtonState, ButtonStyles, CalendarDayProps, CalendarDayState, CalendarHeaderProps, CalendarNavButtonProps, CalendarPrimitive, CalendarRootProps, CalendarStyles, CalendarTitleProps, CalendarWeekLabelsProps, CalendarWeeksProps, CardBodyProps, CardFooterProps, CardHeaderProps, CardPrimitive, CardRootProps, CardStyles, CardTitleProps, DropdownMenuButtonProps, DropdownMenuContentProps, DropdownMenuDividerProps, DropdownMenuOverlayProps, DropdownMenuPortalProps, DropdownMenuPrimitive, DropdownMenuRootProps, DropdownMenuStyles, DropdownMenuTriggerProps, EmptyDescriptionProps, EmptyMediaProps, EmptyPrimitive, EmptyRootProps, EmptyStyles, EmptyTitleProps, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FieldPrimitive, FieldPrimitiveRootProps, FieldStyles, InputPrimitive, InputPrimitiveBaseProps, InputPrimitiveProps, InputStyles, PopoverCloseProps, PopoverContentProps, PopoverContext, PopoverOverlayProps, PopoverPortalProps, PopoverPrimitive, PopoverRootProps, PopoverTriggerProps, PopoverTriggerRef, SelectContentProps, SelectOptionProps, SelectOverlayProps, SelectPortalProps, SelectPrimitive, SelectRootBaseProps, SelectRootProps, SelectStyles, SelectTriggerProps, SelectValueProps, TextareaPrimitive, TextareaPrimitiveBaseProps, TextareaPrimitiveProps, TextareaStyles, ToastDescriptionProps, ToastPrimitive, ToastRootProps, ToastStyles, ToastTitleProps, usePopover };
3
+ import { n as PortalHostProps, r as PortalProps, t as DEFAULT_PORTAL_HOST } from "../portal.constants-ClRV24_C.mjs";
4
+ export { AvatarFallbackProps, AvatarImageProps, AvatarPrimitive, AvatarRootProps, AvatarStyles, BadgeLabelProps, BadgePrimitive, BadgeRootProps, BadgeStyles, ButtonPrimitive, ButtonPrimitiveLabelProps, ButtonPrimitiveRootProps, ButtonState, ButtonStyles, CalendarDayProps, CalendarDayState, CalendarHeaderProps, CalendarNavButtonProps, CalendarPrimitive, CalendarRootProps, CalendarStyles, CalendarTitleProps, CalendarWeekLabelsProps, CalendarWeeksProps, CardBodyProps, CardFooterProps, CardHeaderProps, CardPrimitive, CardRootProps, CardStyles, CardTitleProps, DEFAULT_PORTAL_HOST, DropdownMenuButtonProps, DropdownMenuContentProps, DropdownMenuDividerProps, DropdownMenuOverlayProps, DropdownMenuPortalProps, DropdownMenuPrimitive, DropdownMenuRootProps, DropdownMenuStyles, DropdownMenuTriggerProps, EmptyDescriptionProps, EmptyMediaProps, EmptyPrimitive, EmptyRootProps, EmptyStyles, EmptyTitleProps, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FieldPrimitive, FieldPrimitiveRootProps, FieldStyles, InputPrimitive, InputPrimitiveBaseProps, InputPrimitiveProps, InputStyles, PopoverCloseProps, PopoverContentProps, PopoverContext, PopoverOverlayProps, PopoverPortalProps, PopoverPrimitive, PopoverRootProps, PopoverTriggerProps, PopoverTriggerRef, Portal, PortalHost, PortalHostProps, PortalProps, SelectContentProps, SelectOptionProps, SelectOverlayProps, SelectPortalProps, SelectPrimitive, SelectRootBaseProps, SelectRootProps, SelectStyles, SelectTriggerProps, SelectValueProps, TextareaPrimitive, TextareaPrimitiveBaseProps, TextareaPrimitiveProps, TextareaStyles, ToastDescriptionProps, ToastPrimitive, ToastRootProps, ToastStyles, ToastTitleProps, usePopover };
@@ -1,4 +1,4 @@
1
- import { a as TextareaPrimitive, c as AvatarPrimitive, d as SelectPrimitive, f as ButtonPrimitive, i as DropdownMenuPrimitive, l as EmptyPrimitive, m as FieldPrimitive, n as PopoverPrimitive, o as BadgePrimitive, p as InputPrimitive, r as usePopover, s as ToastPrimitive, t as CalendarPrimitive, u as CardPrimitive } from "../primitives-1609Y7eP.mjs";
1
+ import { _ as DEFAULT_PORTAL_HOST, a as TextareaPrimitive, c as AvatarPrimitive, d as SelectPrimitive, f as ButtonPrimitive, g as PortalHost, h as Portal, i as DropdownMenuPrimitive, l as EmptyPrimitive, m as FieldPrimitive, n as PopoverPrimitive, o as BadgePrimitive, p as InputPrimitive, r as usePopover, s as ToastPrimitive, t as CalendarPrimitive, u as CardPrimitive } from "../primitives-8eataXpJ.mjs";
2
2
  import "../use-relative-position-BTKEyT1F.mjs";
3
3
 
4
- export { AvatarPrimitive, BadgePrimitive, ButtonPrimitive, CalendarPrimitive, CardPrimitive, DropdownMenuPrimitive, EmptyPrimitive, FieldPrimitive, InputPrimitive, PopoverPrimitive, SelectPrimitive, TextareaPrimitive, ToastPrimitive, usePopover };
4
+ export { AvatarPrimitive, BadgePrimitive, ButtonPrimitive, CalendarPrimitive, CardPrimitive, DEFAULT_PORTAL_HOST, DropdownMenuPrimitive, EmptyPrimitive, FieldPrimitive, InputPrimitive, PopoverPrimitive, Portal, PortalHost, SelectPrimitive, TextareaPrimitive, ToastPrimitive, usePopover };
@@ -1,7 +1,8 @@
1
1
  import { n as DEFAULT_POSITION, r as useRelativePosition, t as DEFAULT_LAYOUT } from "./use-relative-position-BTKEyT1F.mjs";
2
- import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useImperativeHandle, useMemo, useRef, useState, useSyncExternalStore } from "react";
2
+ import React, { createContext, forwardRef, useContext, useEffect, useId, useImperativeHandle, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  import { ActivityIndicator, Image, Platform, Pressable, StyleSheet, Text, TextInput, View } from "react-native";
4
- import { jsx } from "react/jsx-runtime";
4
+ import { Fragment, jsx } from "react/jsx-runtime";
5
+ import { createPortal } from "react-dom";
5
6
 
6
7
  //#region src/primitives/portal/portal.constants.tsx
7
8
  const DEFAULT_PORTAL_HOST = "__KOR_PORTAL_HOST__";
@@ -40,7 +41,7 @@ function removePortal(hostName, name) {
40
41
  store.map = next;
41
42
  emit();
42
43
  }
43
- function PortalHost({ name = DEFAULT_PORTAL_HOST, container }) {
44
+ function NativePortalHost({ name = DEFAULT_PORTAL_HOST, container }) {
44
45
  const portalMap = useSyncExternalStore(subscribe, getSnapshot, getSnapshot).get(name) ?? /* @__PURE__ */ new Map();
45
46
  if (portalMap.size === 0) return null;
46
47
  return /* @__PURE__ */ jsx(Platform.select({
@@ -61,7 +62,14 @@ function PortalHost({ name = DEFAULT_PORTAL_HOST, container }) {
61
62
  android: container?.android
62
63
  }), { children: Array.from(portalMap.values()) });
63
64
  }
64
- function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }) {
65
+ function WebPortalHost() {
66
+ return /* @__PURE__ */ jsx(Fragment, {});
67
+ }
68
+ const PortalHost = Platform.select({
69
+ default: NativePortalHost,
70
+ web: WebPortalHost
71
+ });
72
+ function NativePortal({ name, hostName = DEFAULT_PORTAL_HOST, children }) {
65
73
  useEffect(() => {
66
74
  updatePortal(hostName, name, children);
67
75
  }, [
@@ -74,8 +82,24 @@ function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }) {
74
82
  removePortal(hostName, name);
75
83
  };
76
84
  }, [hostName, name]);
77
- return null;
85
+ return /* @__PURE__ */ jsx(Fragment, {});
86
+ }
87
+ function WebPortal({ name, hostName = DEFAULT_PORTAL_HOST, children }) {
88
+ const [container] = useState(() => {
89
+ let container$1 = document.getElementById(hostName);
90
+ if (!container$1) {
91
+ container$1 = document.createElement("div");
92
+ container$1.id = hostName;
93
+ document.body.appendChild(container$1);
94
+ }
95
+ return container$1;
96
+ });
97
+ return /* @__PURE__ */ jsx(Fragment, { children: createPortal(children, container, name) });
78
98
  }
99
+ const Portal = Platform.select({
100
+ default: NativePortal,
101
+ web: WebPortal
102
+ });
79
103
 
80
104
  //#endregion
81
105
  //#region src/primitives/field/context.ts
@@ -978,7 +1002,7 @@ const PopoverTrigger = forwardRef((props, ref) => {
978
1002
  const popover = usePopover();
979
1003
  const triggerRef = useRef(null);
980
1004
  const onTriggerPress = async () => {
981
- triggerRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
1005
+ triggerRef.current?.measureInWindow((pageX, pageY, width, height) => {
982
1006
  popover.setTriggerPosition({
983
1007
  height,
984
1008
  width,
@@ -1410,4 +1434,4 @@ const CalendarPrimitive = {
1410
1434
  };
1411
1435
 
1412
1436
  //#endregion
1413
- export { TextareaPrimitive as a, AvatarPrimitive as c, SelectPrimitive as d, ButtonPrimitive as f, PortalHost as g, Portal as h, DropdownMenuPrimitive as i, EmptyPrimitive as l, FieldPrimitive as m, PopoverPrimitive as n, BadgePrimitive as o, InputPrimitive as p, usePopover as r, ToastPrimitive as s, CalendarPrimitive as t, CardPrimitive as u };
1437
+ export { DEFAULT_PORTAL_HOST as _, TextareaPrimitive as a, AvatarPrimitive as c, SelectPrimitive as d, ButtonPrimitive as f, PortalHost as g, Portal as h, DropdownMenuPrimitive as i, EmptyPrimitive as l, FieldPrimitive as m, PopoverPrimitive as n, BadgePrimitive as o, InputPrimitive as p, usePopover as r, ToastPrimitive as s, CalendarPrimitive as t, CardPrimitive as u };
@@ -1,4 +1,4 @@
1
- import { h as Portal, s as ToastPrimitive } from "./primitives-1609Y7eP.mjs";
1
+ import { h as Portal, s as ToastPrimitive } from "./primitives-8eataXpJ.mjs";
2
2
  import React, { createContext, useContext, useEffect, useState, useSyncExternalStore } from "react";
3
3
  import { StyleSheet, View, useColorScheme } from "react-native";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -251,19 +251,22 @@ function ToastContainer() {
251
251
  if (!toasts.length) return null;
252
252
  return /* @__PURE__ */ jsx(Portal, {
253
253
  name: TOAST_PORTAL_NAME,
254
- children: toasts.map((toast) => /* @__PURE__ */ jsx(View, {
254
+ children: /* @__PURE__ */ jsx(View, {
255
255
  style: s.wrapper,
256
- children: /* @__PURE__ */ jsx(ToastComponent, {
256
+ children: toasts.map((toast) => /* @__PURE__ */ jsx(ToastComponent, {
257
257
  title: toast.title,
258
258
  description: toast.description,
259
259
  variant: toast.variant
260
- })
261
- }, toast.id))
260
+ }, toast.id))
261
+ })
262
262
  });
263
263
  }
264
264
  const s = StyleSheet.create({ wrapper: {
265
265
  width: "100%",
266
- alignItems: "center"
266
+ alignItems: "center",
267
+ position: "absolute",
268
+ top: 24,
269
+ gap: 8
267
270
  } });
268
271
 
269
272
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korsolutions/ui",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",
@@ -6,6 +6,7 @@ export const usePopoverVariantDefault = (): PopoverStyles => {
6
6
  ({ colors, radius }): PopoverStyles => ({
7
7
  overlay: {
8
8
  backgroundColor: "rgba(0, 0, 0, 0.5)",
9
+ zIndex: 999,
9
10
  },
10
11
  content: {
11
12
  backgroundColor: colors.surface,
@@ -81,11 +81,11 @@ export function ToastContainer() {
81
81
 
82
82
  return (
83
83
  <Portal name={TOAST_PORTAL_NAME}>
84
- {toasts.map((toast) => (
85
- <View key={toast.id} style={s.wrapper}>
86
- <ToastComponent title={toast.title} description={toast.description} variant={toast.variant} />
87
- </View>
88
- ))}
84
+ <View style={s.wrapper}>
85
+ {toasts.map((toast) => (
86
+ <ToastComponent key={toast.id} title={toast.title} description={toast.description} variant={toast.variant} />
87
+ ))}
88
+ </View>
89
89
  </Portal>
90
90
  );
91
91
  }
@@ -94,5 +94,8 @@ const s = StyleSheet.create({
94
94
  wrapper: {
95
95
  width: "100%",
96
96
  alignItems: "center",
97
+ position: "absolute",
98
+ top: 24,
99
+ gap: 8,
97
100
  },
98
101
  });
@@ -10,4 +10,5 @@ export * from "./badge";
10
10
  export * from "./textarea";
11
11
  export * from "./dropdown-menu";
12
12
  export * from "./popover";
13
+ export * from "./portal";
13
14
  export * from "./calendar";
@@ -16,7 +16,7 @@ export const PopoverTrigger = forwardRef<PopoverTriggerRef, PopoverTriggerProps>
16
16
  const triggerRef = useRef<View>(null);
17
17
 
18
18
  const onTriggerPress = async () => {
19
- triggerRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
19
+ triggerRef.current?.measureInWindow((pageX, pageY, width, height) => {
20
20
  popover.setTriggerPosition({
21
21
  height,
22
22
  width,
@@ -1 +1,2 @@
1
1
  export * from "./portal";
2
+ export * from "./portal.constants";
@@ -1,7 +1,7 @@
1
- import * as React from "react";
2
- import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from "react";
3
- import { Platform, View, type ViewStyle } from "react-native";
1
+ import { useEffect, useSyncExternalStore, useState } from "react";
2
+ import { Platform, View } from "react-native";
4
3
  import { DEFAULT_PORTAL_HOST, PortalHostProps, PortalProps } from "./portal.constants";
4
+ import { createPortal } from "react-dom";
5
5
 
6
6
  type PortalMap = Map<string, React.ReactNode>;
7
7
  type PortalHostMap = Map<string, PortalMap>;
@@ -49,7 +49,7 @@ function removePortal(hostName: string, name: string) {
49
49
  emit();
50
50
  }
51
51
 
52
- export function PortalHost({ name = DEFAULT_PORTAL_HOST, container }: PortalHostProps) {
52
+ function NativePortalHost({ name = DEFAULT_PORTAL_HOST, container }: PortalHostProps) {
53
53
  const map = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
54
54
  const portalMap = map.get(name) ?? new Map<string, React.ReactNode>();
55
55
  if (portalMap.size === 0) return null;
@@ -77,7 +77,16 @@ export function PortalHost({ name = DEFAULT_PORTAL_HOST, container }: PortalHost
77
77
  return <Container>{Array.from(portalMap.values())}</Container>;
78
78
  }
79
79
 
80
- export function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }: PortalProps) {
80
+ function WebPortalHost() {
81
+ return <></>;
82
+ }
83
+
84
+ export const PortalHost = Platform.select({
85
+ default: NativePortalHost,
86
+ web: WebPortalHost,
87
+ });
88
+
89
+ function NativePortal({ name, hostName = DEFAULT_PORTAL_HOST, children }: PortalProps) {
81
90
  useEffect(() => {
82
91
  updatePortal(hostName, name, children);
83
92
  }, [hostName, name, children]);
@@ -88,28 +97,25 @@ export function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }: Porta
88
97
  };
89
98
  }, [hostName, name]);
90
99
 
91
- return null;
100
+ return <></>;
92
101
  }
93
102
 
94
- const ROOT: ViewStyle = {
95
- flex: 1,
96
- };
103
+ function WebPortal({ name, hostName = DEFAULT_PORTAL_HOST, children }: PortalProps) {
104
+ const [container] = useState(() => {
105
+ let container = document.getElementById(hostName);
97
106
 
98
- export function useModalPortalRoot() {
99
- const ref = useRef<View>(null);
100
- const [offset, setSideOffSet] = useState(0);
101
-
102
- const onLayout = useCallback(() => {
103
- if (Platform.OS === "web") return;
104
- ref.current?.measure((_x, _y, _width, _height, _pageX, pageY) => {
105
- setSideOffSet(-pageY);
106
- });
107
- }, []);
108
-
109
- return {
110
- ref,
111
- offset,
112
- onLayout,
113
- style: ROOT,
114
- };
107
+ if (!container) {
108
+ container = document.createElement("div");
109
+ container.id = hostName;
110
+ document.body.appendChild(container);
111
+ }
112
+ return container;
113
+ });
114
+
115
+ return <>{createPortal(children, container, name)}</>;
115
116
  }
117
+
118
+ export const Portal = Platform.select({
119
+ default: NativePortal,
120
+ web: WebPortal,
121
+ });
@@ -1,21 +0,0 @@
1
- import { createPortal } from "react-dom";
2
- import { DEFAULT_PORTAL_HOST, PortalHostProps, PortalProps } from "./portal.constants";
3
-
4
- function getPortalContainer(containerId: string) {
5
- let container = document.getElementById(containerId);
6
- if (!container) {
7
- container = document.createElement("div");
8
- container.id = containerId;
9
- document.body.appendChild(container);
10
- }
11
- return container;
12
- }
13
-
14
- export function PortalHost({ name = DEFAULT_PORTAL_HOST }: PortalHostProps) {
15
- return <div id={name} />;
16
- }
17
-
18
- export function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }: PortalProps) {
19
- const container = getPortalContainer(hostName);
20
- return <>{createPortal(children, container, name)}</>;
21
- }