@korsolutions/ui 0.0.22 → 0.0.24

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 { 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, rt as CardStyles, ut as SelectRootBaseProps, wt as InputPrimitiveBaseProps, x as PopoverTriggerRef, xt as ButtonStyles, yt as ButtonPrimitiveRootProps } from "../index-vgnXBa4Z.mjs";
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-CCYJiglk.mjs";
2
2
  import "../use-relative-position-DBzhrBU7.mjs";
3
3
  import { t as NumericMaskFormat } from "../use-numeric-mask-B9WZG25o.mjs";
4
4
  import React from "react";
@@ -279,6 +279,7 @@ declare function DropdownMenu(props: DropdownMenuProps): React.JSX.Element;
279
279
  //#region src/components/popover/variants/index.d.ts
280
280
  declare const PopoverVariants: {
281
281
  default: () => PopoverStyles;
282
+ unstyled: () => PopoverStyles;
282
283
  };
283
284
  //#endregion
284
285
  //#region src/components/popover/popover.d.ts
@@ -300,13 +301,13 @@ declare const CalendarVariants: {
300
301
  //#endregion
301
302
  //#region src/components/calendar/calendar.d.ts
302
303
  interface CalendarProps {
303
- value?: Date;
304
- onChange?: (date: Date | undefined) => void;
305
- defaultMonth?: Date;
306
- minDate?: Date;
307
- maxDate?: Date;
308
- variant?: keyof typeof CalendarVariants;
304
+ value?: CalendarRootProps["value"];
305
+ onChange?: CalendarRootProps["onChange"];
306
+ defaultMonth?: CalendarRootProps["defaultMonth"];
307
+ minDate?: CalendarRootProps["minDate"];
308
+ maxDate?: CalendarRootProps["maxDate"];
309
309
  weekDays?: string[];
310
+ variant?: keyof typeof CalendarVariants;
310
311
  }
311
312
  declare function Calendar(props: CalendarProps): React.JSX.Element;
312
313
  //#endregion
@@ -783,9 +783,6 @@ const usePopoverVariantDefault = () => {
783
783
  borderRadius: radius,
784
784
  borderWidth: 1,
785
785
  borderColor: colors.border,
786
- padding: 16,
787
- minWidth: 280,
788
- maxWidth: 320,
789
786
  shadowColor: "#000",
790
787
  shadowOffset: {
791
788
  width: 0,
@@ -798,9 +795,21 @@ const usePopoverVariantDefault = () => {
798
795
  }));
799
796
  };
800
797
 
798
+ //#endregion
799
+ //#region src/components/popover/variants/unstyled.tsx
800
+ const usePopoverVariantUnstyled = () => {
801
+ return useThemedStyles(() => ({
802
+ overlay: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
803
+ content: {}
804
+ }));
805
+ };
806
+
801
807
  //#endregion
802
808
  //#region src/components/popover/variants/index.ts
803
- const PopoverVariants = { default: usePopoverVariantDefault };
809
+ const PopoverVariants = {
810
+ default: usePopoverVariantDefault,
811
+ unstyled: usePopoverVariantUnstyled
812
+ };
804
813
 
805
814
  //#endregion
806
815
  //#region src/components/popover/popover.tsx
@@ -1,5 +1,5 @@
1
1
  import { r as LayoutPosition } from "./use-relative-position-DBzhrBU7.mjs";
2
- import * as react7 from "react";
2
+ import * as react8 from "react";
3
3
  import React$1, { Dispatch, RefAttributes } from "react";
4
4
  import { ImageSource, ImageStyle, LayoutRectangle, PressableProps, StyleProp, TextInputProps, TextProps, TextStyle, View, ViewProps, ViewStyle } from "react-native";
5
5
 
@@ -66,7 +66,7 @@ interface InputPrimitiveProps extends InputPrimitiveBaseProps {
66
66
  render?: (props: InputPrimitiveProps) => React.ReactNode;
67
67
  styles?: InputStyles;
68
68
  }
69
- declare function InputPrimitive(props: InputPrimitiveProps): react7.JSX.Element;
69
+ declare function InputPrimitive(props: InputPrimitiveProps): react8.JSX.Element;
70
70
  //#endregion
71
71
  //#region src/primitives/button/button-label.d.ts
72
72
  interface ButtonPrimitiveLabelProps {
@@ -152,7 +152,7 @@ interface SelectOptionProps {
152
152
  render?: (props: SelectOptionProps) => React.ReactElement;
153
153
  style?: StyleProp<TextStyle>;
154
154
  }
155
- declare function SelectOption(props: SelectOptionProps): react7.JSX.Element;
155
+ declare function SelectOption(props: SelectOptionProps): react8.JSX.Element;
156
156
  //#endregion
157
157
  //#region src/primitives/select/types.d.ts
158
158
  type SelectState = "default" | "disabled";
@@ -433,7 +433,7 @@ interface TextareaPrimitiveProps extends TextareaPrimitiveBaseProps {
433
433
  render?: (props: TextareaPrimitiveProps) => React.ReactNode;
434
434
  styles?: TextareaStyles;
435
435
  }
436
- declare function TextareaPrimitive(props: TextareaPrimitiveProps): react7.JSX.Element;
436
+ declare function TextareaPrimitive(props: TextareaPrimitiveProps): react8.JSX.Element;
437
437
  //#endregion
438
438
  //#region src/primitives/dropdown-menu/dropdown-menu-trigger.d.ts
439
439
  interface DropdownMenuTriggerProps extends PressableProps {
@@ -504,7 +504,7 @@ declare function DropdownMenuPortal(props: DropdownMenuPortalProps): React$1.JSX
504
504
  //#region src/primitives/dropdown-menu/index.d.ts
505
505
  declare const DropdownMenuPrimitive: {
506
506
  Root: typeof DropdownMenuRoot;
507
- Trigger: react7.ForwardRefExoticComponent<DropdownMenuTriggerProps & react7.RefAttributes<DropdownMenuTriggerRef>>;
507
+ Trigger: react8.ForwardRefExoticComponent<DropdownMenuTriggerProps & react8.RefAttributes<DropdownMenuTriggerRef>>;
508
508
  Portal: typeof DropdownMenuPortal;
509
509
  Overlay: typeof DropdownMenuOverlay;
510
510
  Content: typeof DropdownMenuContent;
@@ -578,13 +578,13 @@ interface PopoverContext {
578
578
  setTriggerPosition: Dispatch<React.SetStateAction<LayoutPosition>>;
579
579
  styles?: PopoverStyles;
580
580
  }
581
- declare const PopoverContext: react7.Context<PopoverContext | undefined>;
581
+ declare const PopoverContext: react8.Context<PopoverContext | undefined>;
582
582
  declare const usePopover: () => PopoverContext;
583
583
  //#endregion
584
584
  //#region src/primitives/popover/index.d.ts
585
585
  declare const PopoverPrimitive: {
586
586
  Root: typeof PopoverRoot;
587
- Trigger: react7.ForwardRefExoticComponent<PopoverTriggerProps & react7.RefAttributes<PopoverTriggerRef>>;
587
+ Trigger: react8.ForwardRefExoticComponent<PopoverTriggerProps & react8.RefAttributes<PopoverTriggerRef>>;
588
588
  Portal: typeof PopoverPortal;
589
589
  Overlay: typeof PopoverOverlay;
590
590
  Content: typeof PopoverContent;
@@ -656,8 +656,8 @@ interface CalendarStyles {
656
656
  //#region src/primitives/calendar/calendar-root.d.ts
657
657
  interface CalendarRootProps {
658
658
  children?: React$1.ReactNode;
659
- value?: Date;
660
- onChange?: (date: Date | undefined) => void;
659
+ value?: Date | null;
660
+ onChange?: (date: Date | null) => void;
661
661
  defaultMonth?: Date;
662
662
  minDate?: Date;
663
663
  maxDate?: Date;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react5 from "react";
1
+ import * as react4 from "react";
2
2
 
3
3
  //#region src/themes/types.d.ts
4
4
  type ThemeName = "default";
@@ -37,7 +37,7 @@ interface ThemeContext {
37
37
  setTheme: (themeName: ThemeName) => void;
38
38
  themeName: ThemeName;
39
39
  }
40
- declare const ThemeContext: react5.Context<ThemeContext | null>;
40
+ declare const ThemeContext: react4.Context<ThemeContext | null>;
41
41
  declare const useTheme: () => ThemeContext;
42
42
  //#endregion
43
43
  //#region src/index.d.ts
@@ -45,6 +45,6 @@ declare const UniversalUIProvider: ({
45
45
  children
46
46
  }: {
47
47
  children: React.ReactNode;
48
- }) => react5.JSX.Element;
48
+ }) => react4.JSX.Element;
49
49
  //#endregion
50
50
  export { UniversalUIProvider, useTheme };
@@ -1,3 +1,3 @@
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-vgnXBa4Z.mjs";
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-CCYJiglk.mjs";
2
2
  import "../use-relative-position-DBzhrBU7.mjs";
3
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korsolutions/ui",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",
@@ -1,15 +1,16 @@
1
1
  import React from "react";
2
- import { CalendarPrimitive } from "@/primitives";
2
+ import { CalendarPrimitive, CalendarRootProps } from "@/primitives";
3
3
  import { CalendarVariants } from "./variants";
4
4
 
5
5
  export interface CalendarProps {
6
- value?: Date;
7
- onChange?: (date: Date | undefined) => void;
8
- defaultMonth?: Date;
9
- minDate?: Date;
10
- maxDate?: Date;
11
- variant?: keyof typeof CalendarVariants;
6
+ value?: CalendarRootProps["value"];
7
+ onChange?: CalendarRootProps["onChange"];
8
+ defaultMonth?: CalendarRootProps["defaultMonth"];
9
+ minDate?: CalendarRootProps["minDate"];
10
+ maxDate?: CalendarRootProps["maxDate"];
12
11
  weekDays?: string[];
12
+
13
+ variant?: keyof typeof CalendarVariants;
13
14
  }
14
15
 
15
16
  export function Calendar(props: CalendarProps) {
@@ -12,9 +12,6 @@ export const usePopoverVariantDefault = (): PopoverStyles => {
12
12
  borderRadius: radius,
13
13
  borderWidth: 1,
14
14
  borderColor: colors.border,
15
- padding: 16,
16
- minWidth: 280,
17
- maxWidth: 320,
18
15
  shadowColor: "#000",
19
16
  shadowOffset: { width: 0, height: 4 },
20
17
  shadowOpacity: 0.15,
@@ -1,5 +1,7 @@
1
1
  import { usePopoverVariantDefault } from "./default";
2
+ import { usePopoverVariantUnstyled } from "./unstyled";
2
3
 
3
4
  export const PopoverVariants = {
4
5
  default: usePopoverVariantDefault,
6
+ unstyled: usePopoverVariantUnstyled,
5
7
  };
@@ -0,0 +1,13 @@
1
+ import { PopoverStyles } from "@/primitives/popover/types";
2
+ import { useThemedStyles } from "@/utils/use-themed-styles";
3
+
4
+ export const usePopoverVariantUnstyled = (): PopoverStyles => {
5
+ return useThemedStyles(
6
+ (): PopoverStyles => ({
7
+ overlay: {
8
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
9
+ },
10
+ content: {},
11
+ })
12
+ );
13
+ };
@@ -14,7 +14,7 @@ export interface CalendarDayProps {
14
14
 
15
15
  const calculateState = (
16
16
  date: Date,
17
- selected: Date | undefined,
17
+ selected: Date | null | undefined,
18
18
  isCurrentMonth: boolean,
19
19
  isDisabled: boolean,
20
20
  isHovered: boolean
@@ -5,8 +5,8 @@ import { CalendarContext } from "./context";
5
5
 
6
6
  export interface CalendarRootProps {
7
7
  children?: React.ReactNode;
8
- value?: Date;
9
- onChange?: (date: Date | undefined) => void;
8
+ value?: Date | null;
9
+ onChange?: (date: Date | null) => void;
10
10
  defaultMonth?: Date;
11
11
  minDate?: Date;
12
12
  maxDate?: Date;
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import { CalendarStyles } from "./types";
3
3
 
4
4
  export interface CalendarContextValue {
5
- value?: Date;
6
- onChange?: (date: Date | undefined) => void;
5
+ value?: Date | null;
6
+ onChange?: (date: Date | null) => void;
7
7
  currentMonth: Date;
8
8
  setCurrentMonth: (month: Date) => void;
9
9
  minDate?: Date;