@korsolutions/ui 0.0.27 → 0.0.28

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,4 +1,4 @@
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";
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-j_OCsdsx.mjs";
2
2
  import "../use-relative-position-DBzhrBU7.mjs";
3
3
  import "../portal.constants-ClRV24_C.mjs";
4
4
  import { t as NumericMaskFormat } from "../use-numeric-mask-D4zqPOnE.mjs";
@@ -1,4 +1,4 @@
1
- import { i as useThemedStyles, r as ToastComponent, t as ToastAPI } from "../toast-manager-B5sELMqc.mjs";
1
+ import { i as useThemedStyles, r as ToastComponent, t as ToastAPI } from "../toast-manager-q0YV3t3j.mjs";
2
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";
@@ -1,6 +1,6 @@
1
1
  import { r as LayoutPosition } from "./use-relative-position-DBzhrBU7.mjs";
2
2
  import { n as PortalHostProps, r as PortalProps } from "./portal.constants-ClRV24_C.mjs";
3
- import * as react10 from "react";
3
+ import * as react9 from "react";
4
4
  import React$1, { Dispatch, RefAttributes } from "react";
5
5
  import { ImageSource, ImageStyle, LayoutRectangle, PressableProps, StyleProp, TextInput, TextInputProps, TextProps, TextStyle, View, ViewProps, ViewStyle } from "react-native";
6
6
 
@@ -68,7 +68,7 @@ interface InputPrimitiveProps extends InputPrimitiveBaseProps {
68
68
  render?: (props: InputPrimitiveProps) => React.ReactNode;
69
69
  styles?: InputStyles;
70
70
  }
71
- declare const InputPrimitive: react10.ForwardRefExoticComponent<Omit<InputPrimitiveProps, "ref"> & react10.RefAttributes<TextInput>>;
71
+ declare const InputPrimitive: react9.ForwardRefExoticComponent<Omit<InputPrimitiveProps, "ref"> & react9.RefAttributes<TextInput>>;
72
72
  //#endregion
73
73
  //#region src/primitives/button/button-label.d.ts
74
74
  interface ButtonPrimitiveLabelProps {
@@ -154,7 +154,7 @@ interface SelectOptionProps {
154
154
  render?: (props: SelectOptionProps) => React.ReactElement;
155
155
  style?: StyleProp<TextStyle>;
156
156
  }
157
- declare function SelectOption(props: SelectOptionProps): react10.JSX.Element;
157
+ declare function SelectOption(props: SelectOptionProps): react9.JSX.Element;
158
158
  //#endregion
159
159
  //#region src/primitives/select/types.d.ts
160
160
  type SelectState = "default" | "disabled";
@@ -435,7 +435,7 @@ interface TextareaPrimitiveProps extends TextareaPrimitiveBaseProps {
435
435
  render?: (props: TextareaPrimitiveProps) => React.ReactNode;
436
436
  styles?: TextareaStyles;
437
437
  }
438
- declare function TextareaPrimitive(props: TextareaPrimitiveProps): react10.JSX.Element;
438
+ declare function TextareaPrimitive(props: TextareaPrimitiveProps): react9.JSX.Element;
439
439
  //#endregion
440
440
  //#region src/primitives/dropdown-menu/dropdown-menu-trigger.d.ts
441
441
  interface DropdownMenuTriggerProps extends PressableProps {
@@ -506,7 +506,7 @@ declare function DropdownMenuPortal(props: DropdownMenuPortalProps): React$1.JSX
506
506
  //#region src/primitives/dropdown-menu/index.d.ts
507
507
  declare const DropdownMenuPrimitive: {
508
508
  Root: typeof DropdownMenuRoot;
509
- Trigger: react10.ForwardRefExoticComponent<DropdownMenuTriggerProps & react10.RefAttributes<DropdownMenuTriggerRef>>;
509
+ Trigger: react9.ForwardRefExoticComponent<DropdownMenuTriggerProps & react9.RefAttributes<DropdownMenuTriggerRef>>;
510
510
  Portal: typeof DropdownMenuPortal;
511
511
  Overlay: typeof DropdownMenuOverlay;
512
512
  Content: typeof DropdownMenuContent;
@@ -580,13 +580,13 @@ interface PopoverContext {
580
580
  setTriggerPosition: Dispatch<React.SetStateAction<LayoutPosition>>;
581
581
  styles?: PopoverStyles;
582
582
  }
583
- declare const PopoverContext: react10.Context<PopoverContext | undefined>;
583
+ declare const PopoverContext: react9.Context<PopoverContext | undefined>;
584
584
  declare const usePopover: () => PopoverContext;
585
585
  //#endregion
586
586
  //#region src/primitives/popover/index.d.ts
587
587
  declare const PopoverPrimitive: {
588
588
  Root: typeof PopoverRoot;
589
- Trigger: react10.ForwardRefExoticComponent<PopoverTriggerProps & react10.RefAttributes<PopoverTriggerRef>>;
589
+ Trigger: react9.ForwardRefExoticComponent<PopoverTriggerProps & react9.RefAttributes<PopoverTriggerRef>>;
590
590
  Portal: typeof PopoverPortal;
591
591
  Overlay: typeof PopoverOverlay;
592
592
  Content: typeof PopoverContent;
@@ -597,13 +597,13 @@ declare const PopoverPrimitive: {
597
597
  declare function NativePortalHost({
598
598
  name,
599
599
  container
600
- }: PortalHostProps): react10.JSX.Element | null;
600
+ }: PortalHostProps): react9.JSX.Element | null;
601
601
  declare const PortalHost: typeof NativePortalHost;
602
602
  declare function NativePortal({
603
603
  name,
604
604
  hostName,
605
605
  children
606
- }: PortalProps): react10.JSX.Element;
606
+ }: PortalProps): react9.JSX.Element;
607
607
  declare const Portal: typeof NativePortal;
608
608
  //#endregion
609
609
  //#region src/primitives/calendar/calendar-weeks.d.ts
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { n as PortalHostProps } from "./portal.constants-ClRV24_C.mjs";
2
- import * as react7 from "react";
2
+ import * as react4 from "react";
3
+ import { Theme } from "@react-navigation/native";
3
4
 
4
5
  //#region src/themes/types.d.ts
5
6
  type ThemeName = "default";
@@ -25,6 +26,13 @@ type Radius = number;
25
26
  type FontFamily = string;
26
27
  type LetterSpacing = number;
27
28
  type FontSize = number;
29
+ interface ThemeAssets {
30
+ colors: Record<ColorScheme, Colors>;
31
+ radius: Radius;
32
+ fontFamily: FontFamily;
33
+ letterSpacing: LetterSpacing;
34
+ fontSize: FontSize;
35
+ }
28
36
  //#endregion
29
37
  //#region src/themes/provider.d.ts
30
38
  interface ThemeContext {
@@ -38,9 +46,12 @@ interface ThemeContext {
38
46
  setTheme: (themeName: ThemeName) => void;
39
47
  themeName: ThemeName;
40
48
  }
41
- declare const ThemeContext: react7.Context<ThemeContext | null>;
49
+ declare const ThemeContext: react4.Context<ThemeContext | null>;
42
50
  declare const useTheme: () => ThemeContext;
43
51
  //#endregion
52
+ //#region src/themes/adapters/react-navigation.d.ts
53
+ declare function useReactNavigationTheme(): Theme;
54
+ //#endregion
44
55
  //#region src/index.d.ts
45
56
  interface ProviderProps {
46
57
  children: React.ReactNode;
@@ -49,6 +60,6 @@ interface ProviderProps {
49
60
  declare const UniversalUIProvider: ({
50
61
  children,
51
62
  portalContainer
52
- }: ProviderProps) => react7.JSX.Element;
63
+ }: ProviderProps) => react4.JSX.Element;
53
64
  //#endregion
54
- export { ProviderProps, UniversalUIProvider, useTheme };
65
+ export { ColorScheme, Colors, FontFamily, FontSize, LetterSpacing, ProviderProps, Radius, ThemeAssets, ThemeName, UniversalUIProvider, useReactNavigationTheme, useTheme };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ThemeProvider, n as ToastContainer, o as useTheme } from "./toast-manager-B5sELMqc.mjs";
1
+ import { a as useReactNavigationTheme, n as ToastContainer, o as ThemeProvider, s as useTheme } from "./toast-manager-q0YV3t3j.mjs";
2
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";
@@ -13,4 +13,4 @@ const UniversalUIProvider = ({ children, portalContainer }) => {
13
13
  };
14
14
 
15
15
  //#endregion
16
- export { UniversalUIProvider, useTheme };
16
+ export { UniversalUIProvider, useReactNavigationTheme, useTheme };
@@ -1,4 +1,4 @@
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";
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-j_OCsdsx.mjs";
2
2
  import "../use-relative-position-DBzhrBU7.mjs";
3
3
  import { n as PortalHostProps, r as PortalProps, t as DEFAULT_PORTAL_HOST } from "../portal.constants-ClRV24_C.mjs";
4
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,6 +1,6 @@
1
1
  import { h as Portal, s as ToastPrimitive } from "./primitives-8eataXpJ.mjs";
2
2
  import React, { createContext, useContext, useEffect, useState, useSyncExternalStore } from "react";
3
- import { StyleSheet, View, useColorScheme } from "react-native";
3
+ import { Platform, StyleSheet, View, useColorScheme } from "react-native";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/themes/default/colors.ts
@@ -87,6 +87,54 @@ const useTheme = () => {
87
87
  return context;
88
88
  };
89
89
 
90
+ //#endregion
91
+ //#region src/themes/adapters/react-navigation.ts
92
+ function useReactNavigationTheme() {
93
+ const theme = useTheme();
94
+ useEffect(() => {
95
+ if (Platform.OS !== "web") return;
96
+ const styles = document.createElement("style");
97
+ styles.innerHTML = `
98
+ :root {
99
+ --expo-router-modal-border: 1px solid ${theme.colors.border};
100
+ }
101
+ `;
102
+ document.head.appendChild(styles);
103
+ return () => {
104
+ document.head.removeChild(styles);
105
+ };
106
+ }, [theme.colors.border]);
107
+ return {
108
+ dark: theme.colorScheme === "dark",
109
+ colors: {
110
+ background: theme.colors.background,
111
+ border: theme.colors.border,
112
+ primary: theme.colors.primary,
113
+ card: theme.colors.surface,
114
+ text: theme.colors.foreground,
115
+ notification: theme.colors.danger
116
+ },
117
+ fonts: {
118
+ heavy: {
119
+ fontFamily: theme.fontFamily,
120
+ fontWeight: "800"
121
+ },
122
+ bold: {
123
+ fontFamily: theme.fontFamily,
124
+ fontWeight: "700"
125
+ },
126
+ medium: {
127
+ fontFamily: theme.fontFamily,
128
+ fontWeight: "500"
129
+ },
130
+ regular: {
131
+ fontFamily: theme.fontFamily,
132
+ fontWeight: "400"
133
+ }
134
+ }
135
+ };
136
+ }
137
+
90
138
  //#endregion
91
139
  //#region src/utils/use-themed-styles.ts
92
140
  const useThemedStyles = (callback) => {
@@ -270,4 +318,4 @@ const s = StyleSheet.create({ wrapper: {
270
318
  } });
271
319
 
272
320
  //#endregion
273
- export { ThemeProvider as a, useThemedStyles as i, ToastContainer as n, useTheme as o, ToastComponent as r, ToastAPI as t };
321
+ export { useReactNavigationTheme as a, useThemedStyles as i, ToastContainer as n, ThemeProvider as o, ToastComponent as r, useTheme as s, ToastAPI as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korsolutions/ui",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",
package/src/index.tsx CHANGED
@@ -19,4 +19,6 @@ export const UniversalUIProvider = ({ children, portalContainer }: ProviderProps
19
19
  );
20
20
  };
21
21
 
22
- export { useTheme } from "./themes";
22
+ export { useTheme } from "./themes/provider";
23
+ export * from "./themes/adapters";
24
+ export * from "./themes/types";
@@ -0,0 +1 @@
1
+ export * from "./react-navigation";
@@ -0,0 +1,52 @@
1
+ import { useEffect } from "react";
2
+ import { Theme } from "@react-navigation/native";
3
+ import { useTheme } from "../provider";
4
+ import { Platform } from "react-native";
5
+
6
+ export function useReactNavigationTheme(): Theme {
7
+ const theme = useTheme();
8
+
9
+ useEffect(() => {
10
+ if (Platform.OS !== "web") return;
11
+ const styles = document.createElement("style");
12
+ styles.innerHTML = `
13
+ :root {
14
+ --expo-router-modal-border: 1px solid ${theme.colors.border};
15
+ }
16
+ `;
17
+ document.head.appendChild(styles);
18
+ return () => {
19
+ document.head.removeChild(styles);
20
+ };
21
+ }, [theme.colors.border]);
22
+
23
+ return {
24
+ dark: theme.colorScheme === "dark",
25
+ colors: {
26
+ background: theme.colors.background,
27
+ border: theme.colors.border,
28
+ primary: theme.colors.primary,
29
+ card: theme.colors.surface,
30
+ text: theme.colors.foreground,
31
+ notification: theme.colors.danger,
32
+ },
33
+ fonts: {
34
+ heavy: {
35
+ fontFamily: theme.fontFamily,
36
+ fontWeight: "800",
37
+ },
38
+ bold: {
39
+ fontFamily: theme.fontFamily,
40
+ fontWeight: "700",
41
+ },
42
+ medium: {
43
+ fontFamily: theme.fontFamily,
44
+ fontWeight: "500",
45
+ },
46
+ regular: {
47
+ fontFamily: theme.fontFamily,
48
+ fontWeight: "400",
49
+ },
50
+ },
51
+ };
52
+ }
@@ -1,2 +1,3 @@
1
1
  export * from "./provider";
2
2
  export * from "./types";
3
+ export * from "./adapters/react-navigation";