@korsolutions/ui 0.0.19 → 0.0.20
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/components/index.d.mts +42 -4
- package/dist/components/index.mjs +119 -8
- package/dist/{index-BLsiF42Z.d.mts → index-CGY0mO6z.d.mts} +172 -9
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/primitives/index.d.mts +2 -2
- package/dist/primitives/index.mjs +2 -2
- package/dist/{primitives-CyDqzNcp.mjs → primitives-P_8clvQr.mjs} +433 -13
- package/dist/{toast-manager-BOORCQn8.mjs → toast-manager-DSo9oN8w.mjs} +1 -1
- package/package.json +1 -1
- package/src/components/button/button.tsx +7 -4
- package/src/components/dropdown-menu/dropdown-menu.tsx +49 -0
- package/src/components/dropdown-menu/variants/default.tsx +40 -0
- package/src/components/dropdown-menu/variants/index.ts +5 -0
- package/src/components/index.ts +2 -0
- package/src/components/popover/popover.tsx +51 -0
- package/src/components/popover/variants/default.tsx +26 -0
- package/src/components/popover/variants/index.ts +5 -0
- package/src/hooks/useRelativePosition.ts +188 -0
- package/src/primitives/button/button-root.tsx +2 -4
- package/src/primitives/dropdown-menu/context.ts +25 -0
- package/src/primitives/dropdown-menu/dropdown-menu-button.tsx +47 -0
- package/src/primitives/dropdown-menu/dropdown-menu-content.tsx +39 -0
- package/src/primitives/dropdown-menu/dropdown-menu-divider.tsx +18 -0
- package/src/primitives/dropdown-menu/dropdown-menu-overlay.tsx +29 -0
- package/src/primitives/dropdown-menu/dropdown-menu-portal.tsx +21 -0
- package/src/primitives/dropdown-menu/dropdown-menu-root.tsx +35 -0
- package/src/primitives/dropdown-menu/dropdown-menu-trigger.tsx +47 -0
- package/src/primitives/dropdown-menu/index.ts +26 -0
- package/src/primitives/dropdown-menu/types.ts +13 -0
- package/src/primitives/index.ts +2 -0
- package/src/primitives/popover/context.ts +25 -0
- package/src/primitives/popover/index.ts +24 -0
- package/src/primitives/popover/popover-close.tsx +29 -0
- package/src/primitives/popover/popover-content.tsx +39 -0
- package/src/primitives/popover/popover-overlay.tsx +37 -0
- package/src/primitives/popover/popover-portal.tsx +21 -0
- package/src/primitives/popover/popover-root.tsx +35 -0
- package/src/primitives/popover/popover-trigger.tsx +47 -0
- package/src/primitives/popover/types.ts +7 -0
- package/src/utils/get-ref-layout.ts +16 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as BadgeStyles, I as AvatarStyles, S as TextareaPrimitiveBaseProps, V as EmptyStyles, d as PopoverTriggerRef, dt as ButtonStyles, et as SelectRootBaseProps, gt as InputStyles, h as DropdownMenuStyles, j as ToastStyles, lt as ButtonPrimitiveRootProps, mt as InputPrimitiveBaseProps, nt as SelectStyles, q as CardStyles, s as PopoverStyles, w as TextareaStyles, yt as FieldStyles } from "../index-CGY0mO6z.mjs";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { ImageSource, TextProps, TextStyle } from "react-native";
|
|
3
|
+
import { ImageSource, PressableProps, TextProps, TextStyle } from "react-native";
|
|
4
4
|
|
|
5
5
|
//#region src/components/button/variants/index.d.ts
|
|
6
6
|
declare const ButtonVariants: {
|
|
@@ -10,8 +10,9 @@ declare const ButtonVariants: {
|
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/components/button/button.d.ts
|
|
12
12
|
interface ButtonProps {
|
|
13
|
-
onPress?: () => void;
|
|
14
13
|
children?: string;
|
|
14
|
+
onPress?: ButtonPrimitiveRootProps["onPress"];
|
|
15
|
+
onLayout?: ButtonPrimitiveRootProps["onLayout"];
|
|
15
16
|
isDisabled?: boolean;
|
|
16
17
|
isLoading?: boolean;
|
|
17
18
|
variant?: keyof typeof ButtonVariants;
|
|
@@ -224,4 +225,41 @@ interface TextareaProps extends TextareaPrimitiveBaseProps {
|
|
|
224
225
|
}
|
|
225
226
|
declare function Textarea(props: TextareaProps): React.JSX.Element;
|
|
226
227
|
//#endregion
|
|
227
|
-
|
|
228
|
+
//#region src/components/dropdown-menu/variants/index.d.ts
|
|
229
|
+
declare const DropdownMenuVariants: {
|
|
230
|
+
default: () => DropdownMenuStyles;
|
|
231
|
+
};
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/components/dropdown-menu/dropdown-menu.d.ts
|
|
234
|
+
type DropdownMenuOption = {
|
|
235
|
+
type: "button";
|
|
236
|
+
label: string;
|
|
237
|
+
onPress: () => void;
|
|
238
|
+
} | {
|
|
239
|
+
type: "divider";
|
|
240
|
+
};
|
|
241
|
+
interface DropdownMenuProps {
|
|
242
|
+
trigger: React.ReactElement<PressableProps>;
|
|
243
|
+
options: DropdownMenuOption[];
|
|
244
|
+
variant?: keyof typeof DropdownMenuVariants;
|
|
245
|
+
}
|
|
246
|
+
declare function DropdownMenu(props: DropdownMenuProps): React.JSX.Element;
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/components/popover/variants/index.d.ts
|
|
249
|
+
declare const PopoverVariants: {
|
|
250
|
+
default: () => PopoverStyles;
|
|
251
|
+
};
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/components/popover/popover.d.ts
|
|
254
|
+
interface PopoverChildrenProps {
|
|
255
|
+
close: () => void;
|
|
256
|
+
}
|
|
257
|
+
interface PopoverProps {
|
|
258
|
+
children: ((props: PopoverChildrenProps) => React.ReactNode) | React.ReactNode;
|
|
259
|
+
trigger: React.ReactElement<PressableProps>;
|
|
260
|
+
closeOnOverlayPress?: boolean;
|
|
261
|
+
variant?: keyof typeof PopoverVariants;
|
|
262
|
+
}
|
|
263
|
+
declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<PopoverTriggerRef>>;
|
|
264
|
+
//#endregion
|
|
265
|
+
export { Avatar, AvatarProps, Badge, Button, Card, DropdownMenu, Empty, EmptyProps, Field, FieldProps, Input, Link, LinkProps, Popover, PopoverProps, Select, SelectOption, SelectProps, Textarea, Toast, Typography, TypographyProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as useThemedStyles, r as ToastComponent, t as ToastAPI } from "../toast-manager-
|
|
2
|
-
import { a as
|
|
3
|
-
import React, { useState } from "react";
|
|
1
|
+
import { i as useThemedStyles, r as ToastComponent, t as ToastAPI } from "../toast-manager-DSo9oN8w.mjs";
|
|
2
|
+
import { a as BadgePrimitive, c as EmptyPrimitive, d as ButtonPrimitive, f as InputPrimitive, i as TextareaPrimitive, l as CardPrimitive, n as usePopover, p as FieldPrimitive, r as DropdownMenuPrimitive, s as AvatarPrimitive, t as PopoverPrimitive, u as SelectPrimitive } from "../primitives-P_8clvQr.mjs";
|
|
3
|
+
import React, { forwardRef, useState } from "react";
|
|
4
4
|
import { Linking, Text } from "react-native";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
|
|
@@ -110,11 +110,11 @@ const ButtonVariants = {
|
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/components/button/button.tsx
|
|
112
112
|
function Button(props) {
|
|
113
|
-
const
|
|
113
|
+
const { children, variant = "default", ...rootProps } = props;
|
|
114
|
+
const useVariantStyles = ButtonVariants[variant];
|
|
115
|
+
const variantStyles = useVariantStyles();
|
|
114
116
|
return /* @__PURE__ */ jsxs(ButtonPrimitive.Root, {
|
|
115
|
-
|
|
116
|
-
isDisabled: props.isDisabled,
|
|
117
|
-
isLoading: props.isLoading,
|
|
117
|
+
...rootProps,
|
|
118
118
|
styles: variantStyles,
|
|
119
119
|
children: [props.isLoading && /* @__PURE__ */ jsx(ButtonPrimitive.Spinner, {}), /* @__PURE__ */ jsx(ButtonPrimitive.Label, { children: props.children })]
|
|
120
120
|
});
|
|
@@ -679,4 +679,115 @@ function Textarea(props) {
|
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
//#endregion
|
|
682
|
-
|
|
682
|
+
//#region src/components/dropdown-menu/variants/default.tsx
|
|
683
|
+
const useDropdownMenuVariantDefault = () => {
|
|
684
|
+
return useThemedStyles(({ colors, radius, fontFamily, fontSize }) => ({
|
|
685
|
+
overlay: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
686
|
+
content: {
|
|
687
|
+
overflow: "hidden",
|
|
688
|
+
backgroundColor: colors.surface,
|
|
689
|
+
borderRadius: radius,
|
|
690
|
+
borderWidth: 1,
|
|
691
|
+
borderColor: colors.border,
|
|
692
|
+
shadowColor: "#000",
|
|
693
|
+
shadowOffset: {
|
|
694
|
+
width: 0,
|
|
695
|
+
height: 4
|
|
696
|
+
},
|
|
697
|
+
shadowOpacity: .15,
|
|
698
|
+
shadowRadius: 12,
|
|
699
|
+
elevation: 8
|
|
700
|
+
},
|
|
701
|
+
button: {
|
|
702
|
+
default: {
|
|
703
|
+
paddingVertical: 12,
|
|
704
|
+
paddingHorizontal: 16,
|
|
705
|
+
fontFamily,
|
|
706
|
+
fontSize,
|
|
707
|
+
color: colors.foreground
|
|
708
|
+
},
|
|
709
|
+
hovered: { backgroundColor: colors.muted }
|
|
710
|
+
},
|
|
711
|
+
divider: {
|
|
712
|
+
height: 1,
|
|
713
|
+
backgroundColor: colors.border
|
|
714
|
+
}
|
|
715
|
+
}));
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region src/components/dropdown-menu/variants/index.ts
|
|
720
|
+
const DropdownMenuVariants = { default: useDropdownMenuVariantDefault };
|
|
721
|
+
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region src/components/dropdown-menu/dropdown-menu.tsx
|
|
724
|
+
function DropdownMenu(props) {
|
|
725
|
+
const useVariantStyles = DropdownMenuVariants[props.variant || "default"];
|
|
726
|
+
const styles = useVariantStyles();
|
|
727
|
+
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.Root, {
|
|
728
|
+
styles,
|
|
729
|
+
children: [/* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { children: props.trigger }), /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Overlay, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, { children: props.options.map((option) => {
|
|
730
|
+
if (option.type === "button") return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Button, {
|
|
731
|
+
onPress: option.onPress,
|
|
732
|
+
children: option.label
|
|
733
|
+
}, option.label);
|
|
734
|
+
else if (option.type === "divider") return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Divider, {}, Math.random().toString());
|
|
735
|
+
}) }) }) })]
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/components/popover/variants/default.tsx
|
|
741
|
+
const usePopoverVariantDefault = () => {
|
|
742
|
+
return useThemedStyles(({ colors, radius }) => ({
|
|
743
|
+
overlay: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
744
|
+
content: {
|
|
745
|
+
backgroundColor: colors.surface,
|
|
746
|
+
borderRadius: radius,
|
|
747
|
+
borderWidth: 1,
|
|
748
|
+
borderColor: colors.border,
|
|
749
|
+
padding: 16,
|
|
750
|
+
minWidth: 280,
|
|
751
|
+
maxWidth: 320,
|
|
752
|
+
shadowColor: "#000",
|
|
753
|
+
shadowOffset: {
|
|
754
|
+
width: 0,
|
|
755
|
+
height: 4
|
|
756
|
+
},
|
|
757
|
+
shadowOpacity: .15,
|
|
758
|
+
shadowRadius: 12,
|
|
759
|
+
elevation: 8
|
|
760
|
+
}
|
|
761
|
+
}));
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region src/components/popover/variants/index.ts
|
|
766
|
+
const PopoverVariants = { default: usePopoverVariantDefault };
|
|
767
|
+
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region src/components/popover/popover.tsx
|
|
770
|
+
const PopoverContentComponent = (props) => {
|
|
771
|
+
const popover = usePopover();
|
|
772
|
+
if (typeof props.children === "function") return /* @__PURE__ */ jsx(PopoverPrimitive.Content, { children: props.children({ close: () => popover.setIsOpen(false) }) });
|
|
773
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Content, { children: props.children });
|
|
774
|
+
};
|
|
775
|
+
const PopoverComponent = forwardRef((props, ref) => {
|
|
776
|
+
const useVariantStyles = PopoverVariants[props.variant || "default"];
|
|
777
|
+
const styles = useVariantStyles();
|
|
778
|
+
return /* @__PURE__ */ jsxs(PopoverPrimitive.Root, {
|
|
779
|
+
styles,
|
|
780
|
+
children: [/* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
781
|
+
ref,
|
|
782
|
+
children: props.trigger
|
|
783
|
+
}), /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Overlay, {
|
|
784
|
+
closeOnPress: props.closeOnOverlayPress,
|
|
785
|
+
children: /* @__PURE__ */ jsx(PopoverContentComponent, { children: props.children })
|
|
786
|
+
}) })]
|
|
787
|
+
});
|
|
788
|
+
});
|
|
789
|
+
PopoverComponent.displayName = "Popover";
|
|
790
|
+
const Popover = PopoverComponent;
|
|
791
|
+
|
|
792
|
+
//#endregion
|
|
793
|
+
export { Avatar, Badge, Button, Card, DropdownMenu, Empty, Field, Input, Link, Popover, Select, Textarea, Toast, Typography };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import React$1 from "react";
|
|
3
|
-
import { ImageSource, ImageStyle, StyleProp, TextInputProps, TextProps, TextStyle, ViewStyle } from "react-native";
|
|
1
|
+
import * as react7 from "react";
|
|
2
|
+
import React$1, { Dispatch, RefAttributes } from "react";
|
|
3
|
+
import { ImageSource, ImageStyle, LayoutRectangle, PressableProps, StyleProp, TextInputProps, TextProps, TextStyle, View, ViewStyle } from "react-native";
|
|
4
4
|
|
|
5
5
|
//#region src/primitives/field/field-label.d.ts
|
|
6
6
|
interface FieldLabelProps {
|
|
@@ -65,7 +65,7 @@ interface InputPrimitiveProps extends InputPrimitiveBaseProps {
|
|
|
65
65
|
render?: (props: InputPrimitiveProps) => React.ReactNode;
|
|
66
66
|
styles?: InputStyles;
|
|
67
67
|
}
|
|
68
|
-
declare function InputPrimitive(props: InputPrimitiveProps):
|
|
68
|
+
declare function InputPrimitive(props: InputPrimitiveProps): react7.JSX.Element;
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/primitives/button/button-label.d.ts
|
|
71
71
|
interface ButtonPrimitiveLabelProps {
|
|
@@ -84,9 +84,8 @@ interface ButtonStyles {
|
|
|
84
84
|
}
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region src/primitives/button/button-root.d.ts
|
|
87
|
-
interface ButtonPrimitiveRootProps {
|
|
87
|
+
interface ButtonPrimitiveRootProps extends PressableProps {
|
|
88
88
|
children?: React$1.ReactNode;
|
|
89
|
-
onPress?: () => void;
|
|
90
89
|
isDisabled?: boolean;
|
|
91
90
|
isLoading?: boolean;
|
|
92
91
|
style?: StyleProp<ViewStyle>;
|
|
@@ -152,7 +151,7 @@ interface SelectOptionProps {
|
|
|
152
151
|
render?: (props: SelectOptionProps) => React.ReactElement;
|
|
153
152
|
style?: StyleProp<TextStyle>;
|
|
154
153
|
}
|
|
155
|
-
declare function SelectOption(props: SelectOptionProps):
|
|
154
|
+
declare function SelectOption(props: SelectOptionProps): react7.JSX.Element;
|
|
156
155
|
//#endregion
|
|
157
156
|
//#region src/primitives/select/types.d.ts
|
|
158
157
|
type SelectState = "default" | "disabled";
|
|
@@ -433,6 +432,170 @@ interface TextareaPrimitiveProps extends TextareaPrimitiveBaseProps {
|
|
|
433
432
|
render?: (props: TextareaPrimitiveProps) => React.ReactNode;
|
|
434
433
|
styles?: TextareaStyles;
|
|
435
434
|
}
|
|
436
|
-
declare function TextareaPrimitive(props: TextareaPrimitiveProps):
|
|
435
|
+
declare function TextareaPrimitive(props: TextareaPrimitiveProps): react7.JSX.Element;
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/primitives/dropdown-menu/dropdown-menu-trigger.d.ts
|
|
438
|
+
interface DropdownMenuTriggerProps extends PressableProps {
|
|
439
|
+
children: React$1.ReactElement<RefAttributes<View> & PressableProps>;
|
|
440
|
+
}
|
|
441
|
+
interface DropdownMenuTriggerRef {
|
|
442
|
+
open: () => void;
|
|
443
|
+
close: () => void;
|
|
444
|
+
}
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/primitives/dropdown-menu/dropdown-menu-content.d.ts
|
|
447
|
+
interface DropdownMenuContentProps {
|
|
448
|
+
children?: React$1.ReactNode;
|
|
449
|
+
render?: (props: DropdownMenuContentProps) => React$1.ReactNode;
|
|
450
|
+
style?: StyleProp<ViewStyle>;
|
|
451
|
+
}
|
|
452
|
+
declare function DropdownMenuContent(props: DropdownMenuContentProps): React$1.JSX.Element;
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/primitives/dropdown-menu/dropdown-menu-button.d.ts
|
|
455
|
+
interface DropdownMenuButtonProps {
|
|
456
|
+
children?: string;
|
|
457
|
+
onPress?: () => void;
|
|
458
|
+
onMouseEnter?: () => void;
|
|
459
|
+
onMouseLeave?: () => void;
|
|
460
|
+
render?: (props: DropdownMenuButtonProps) => React$1.ReactElement;
|
|
461
|
+
style?: StyleProp<TextStyle>;
|
|
462
|
+
}
|
|
463
|
+
declare function DropdownMenuButton(props: DropdownMenuButtonProps): React$1.JSX.Element;
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/primitives/dropdown-menu/dropdown-menu-divider.d.ts
|
|
466
|
+
interface DropdownMenuDividerProps {
|
|
467
|
+
render?: (props: DropdownMenuDividerProps) => React$1.ReactNode;
|
|
468
|
+
style?: StyleProp<ViewStyle>;
|
|
469
|
+
}
|
|
470
|
+
declare function DropdownMenuDivider(props: DropdownMenuDividerProps): React$1.JSX.Element;
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/primitives/dropdown-menu/dropdown-menu-overlay.d.ts
|
|
473
|
+
interface DropdownMenuOverlayProps {
|
|
474
|
+
children?: React$1.ReactNode;
|
|
475
|
+
render?: (props: DropdownMenuOverlayProps) => React$1.ReactElement;
|
|
476
|
+
style?: StyleProp<ViewStyle>;
|
|
477
|
+
}
|
|
478
|
+
declare function DropdownMenuOverlay(props: DropdownMenuOverlayProps): React$1.JSX.Element;
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region src/primitives/dropdown-menu/types.d.ts
|
|
481
|
+
type DropdownMenuButtonState = "default" | "hovered";
|
|
482
|
+
interface DropdownMenuStyles {
|
|
483
|
+
content?: DropdownMenuContentProps["style"];
|
|
484
|
+
button?: Partial<Record<DropdownMenuButtonState, DropdownMenuButtonProps["style"]>>;
|
|
485
|
+
divider?: DropdownMenuDividerProps["style"];
|
|
486
|
+
overlay?: DropdownMenuOverlayProps["style"];
|
|
487
|
+
}
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/primitives/dropdown-menu/dropdown-menu-root.d.ts
|
|
490
|
+
interface DropdownMenuRootProps {
|
|
491
|
+
children?: React$1.ReactNode;
|
|
492
|
+
render?: (props: DropdownMenuRootProps) => React$1.ReactNode;
|
|
493
|
+
styles?: DropdownMenuStyles;
|
|
494
|
+
}
|
|
495
|
+
declare function DropdownMenuRoot(props: DropdownMenuRootProps): React$1.JSX.Element;
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/primitives/dropdown-menu/dropdown-menu-portal.d.ts
|
|
498
|
+
interface DropdownMenuPortalProps {
|
|
499
|
+
children?: React$1.ReactNode;
|
|
500
|
+
}
|
|
501
|
+
declare function DropdownMenuPortal(props: DropdownMenuPortalProps): React$1.JSX.Element | null;
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/primitives/dropdown-menu/index.d.ts
|
|
504
|
+
declare const DropdownMenuPrimitive: {
|
|
505
|
+
Root: typeof DropdownMenuRoot;
|
|
506
|
+
Trigger: react7.ForwardRefExoticComponent<DropdownMenuTriggerProps & react7.RefAttributes<DropdownMenuTriggerRef>>;
|
|
507
|
+
Portal: typeof DropdownMenuPortal;
|
|
508
|
+
Overlay: typeof DropdownMenuOverlay;
|
|
509
|
+
Content: typeof DropdownMenuContent;
|
|
510
|
+
Button: typeof DropdownMenuButton;
|
|
511
|
+
Divider: typeof DropdownMenuDivider;
|
|
512
|
+
};
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region src/primitives/popover/popover-trigger.d.ts
|
|
515
|
+
interface PopoverTriggerProps extends PressableProps {
|
|
516
|
+
children: React$1.ReactElement<RefAttributes<View> & PressableProps>;
|
|
517
|
+
}
|
|
518
|
+
interface PopoverTriggerRef {
|
|
519
|
+
open: () => void;
|
|
520
|
+
close: () => void;
|
|
521
|
+
}
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/primitives/popover/popover-content.d.ts
|
|
524
|
+
interface PopoverContentProps {
|
|
525
|
+
children?: React$1.ReactNode;
|
|
526
|
+
render?: (props: PopoverContentProps) => React$1.ReactNode;
|
|
527
|
+
style?: StyleProp<ViewStyle>;
|
|
528
|
+
}
|
|
529
|
+
declare function PopoverContent(props: PopoverContentProps): React$1.JSX.Element;
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region src/primitives/popover/popover-overlay.d.ts
|
|
532
|
+
interface PopoverOverlayProps extends Omit<PressableProps, "onPress"> {
|
|
533
|
+
children?: React$1.ReactNode;
|
|
534
|
+
onPress?: () => void;
|
|
535
|
+
closeOnPress?: boolean;
|
|
536
|
+
render?: (props: PopoverOverlayProps) => React$1.ReactElement;
|
|
537
|
+
style?: StyleProp<ViewStyle>;
|
|
538
|
+
}
|
|
539
|
+
declare function PopoverOverlay(props: PopoverOverlayProps): React$1.JSX.Element;
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/primitives/popover/types.d.ts
|
|
542
|
+
interface PopoverStyles {
|
|
543
|
+
overlay?: PopoverOverlayProps["style"];
|
|
544
|
+
content?: PopoverContentProps["style"];
|
|
545
|
+
}
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region src/primitives/popover/popover-root.d.ts
|
|
548
|
+
interface PopoverRootProps {
|
|
549
|
+
children?: React$1.ReactNode;
|
|
550
|
+
render?: (props: PopoverRootProps) => React$1.ReactNode;
|
|
551
|
+
styles?: PopoverStyles;
|
|
552
|
+
}
|
|
553
|
+
declare function PopoverRoot(props: PopoverRootProps): React$1.JSX.Element;
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region src/primitives/popover/popover-portal.d.ts
|
|
556
|
+
interface PopoverPortalProps {
|
|
557
|
+
children?: React$1.ReactNode;
|
|
558
|
+
}
|
|
559
|
+
declare function PopoverPortal(props: PopoverPortalProps): React$1.JSX.Element | null;
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/primitives/popover/popover-close.d.ts
|
|
562
|
+
interface PopoverCloseProps extends Omit<PressableProps, "onPress"> {
|
|
563
|
+
children?: React$1.ReactNode;
|
|
564
|
+
onPress?: () => void;
|
|
565
|
+
render?: (props: PopoverCloseProps) => React$1.ReactNode;
|
|
566
|
+
style?: StyleProp<ViewStyle>;
|
|
567
|
+
}
|
|
568
|
+
declare function PopoverClose(props: PopoverCloseProps): React$1.JSX.Element;
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region src/hooks/useRelativePosition.d.ts
|
|
571
|
+
interface LayoutPosition {
|
|
572
|
+
pageY: number;
|
|
573
|
+
pageX: number;
|
|
574
|
+
width: number;
|
|
575
|
+
height: number;
|
|
576
|
+
}
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/primitives/popover/context.d.ts
|
|
579
|
+
interface PopoverContext {
|
|
580
|
+
isOpen: boolean;
|
|
581
|
+
setIsOpen: Dispatch<React.SetStateAction<boolean>>;
|
|
582
|
+
contentLayout: LayoutRectangle;
|
|
583
|
+
setContentLayout: Dispatch<React.SetStateAction<LayoutRectangle>>;
|
|
584
|
+
triggerPosition: LayoutPosition;
|
|
585
|
+
setTriggerPosition: Dispatch<React.SetStateAction<LayoutPosition>>;
|
|
586
|
+
styles?: PopoverStyles;
|
|
587
|
+
}
|
|
588
|
+
declare const PopoverContext: react7.Context<PopoverContext | undefined>;
|
|
589
|
+
declare const usePopover: () => PopoverContext;
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region src/primitives/popover/index.d.ts
|
|
592
|
+
declare const PopoverPrimitive: {
|
|
593
|
+
Root: typeof PopoverRoot;
|
|
594
|
+
Trigger: react7.ForwardRefExoticComponent<PopoverTriggerProps & react7.RefAttributes<PopoverTriggerRef>>;
|
|
595
|
+
Portal: typeof PopoverPortal;
|
|
596
|
+
Overlay: typeof PopoverOverlay;
|
|
597
|
+
Content: typeof PopoverContent;
|
|
598
|
+
Close: typeof PopoverClose;
|
|
599
|
+
};
|
|
437
600
|
//#endregion
|
|
438
|
-
export {
|
|
601
|
+
export { SelectPortalProps as $, ToastRootProps as A, EmptyRootProps as B, TextareaPrimitiveProps as C, BadgeStyles as D, BadgeRootProps as E, AvatarRootProps as F, CardPrimitive as G, EmptyTitleProps as H, AvatarStyles as I, CardFooterProps as J, CardRootProps as K, AvatarImageProps as L, ToastDescriptionProps as M, ToastTitleProps as N, BadgeLabelProps as O, AvatarPrimitive as P, SelectPrimitive as Q, AvatarFallbackProps as R, TextareaPrimitiveBaseProps as S, FieldLabelProps as St, BadgePrimitive as T, EmptyMediaProps as U, EmptyStyles as V, EmptyDescriptionProps as W, CardTitleProps as X, CardBodyProps as Y, CardHeaderProps as Z, DropdownMenuDividerProps as _, FieldPrimitive as _t, PopoverPortalProps as a, SelectOverlayProps as at, DropdownMenuTriggerProps as b, FieldErrorProps as bt, PopoverOverlayProps as c, ButtonPrimitive as ct, PopoverTriggerRef as d, ButtonStyles as dt, SelectRootBaseProps as et, DropdownMenuPrimitive as f, ButtonPrimitiveLabelProps as ft, DropdownMenuOverlayProps as g, InputStyles as gt, DropdownMenuStyles as h, InputPrimitiveProps as ht, PopoverCloseProps as i, SelectContentProps as it, ToastStyles as j, ToastPrimitive as k, PopoverContentProps as l, ButtonPrimitiveRootProps as lt, DropdownMenuRootProps as m, InputPrimitiveBaseProps as mt, PopoverContext as n, SelectStyles as nt, PopoverRootProps as o, SelectValueProps as ot, DropdownMenuPortalProps as p, InputPrimitive as pt, CardStyles as q, usePopover as r, SelectOptionProps as rt, PopoverStyles as s, SelectTriggerProps as st, PopoverPrimitive as t, SelectRootProps as tt, PopoverTriggerProps as u, ButtonState as ut, DropdownMenuButtonProps as v, FieldPrimitiveRootProps as vt, TextareaStyles as w, TextareaPrimitive as x, FieldDescriptionProps as xt, DropdownMenuContentProps as y, FieldStyles as yt, EmptyPrimitive as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
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:
|
|
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
|
-
}) =>
|
|
48
|
+
}) => react4.JSX.Element;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { 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-
|
|
2
|
-
import {
|
|
1
|
+
import { a as ThemeProvider, n as ToastContainer, o as useTheme } from "./toast-manager-DSo9oN8w.mjs";
|
|
2
|
+
import { m as PortalHost } from "./primitives-P_8clvQr.mjs";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/index.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AvatarFallbackProps, AvatarImageProps, AvatarPrimitive, AvatarRootProps, AvatarStyles, BadgeLabelProps, BadgePrimitive, BadgeRootProps, BadgeStyles, ButtonPrimitive, ButtonPrimitiveLabelProps, ButtonPrimitiveRootProps, ButtonState, ButtonStyles, CardBodyProps, CardFooterProps, CardHeaderProps, CardPrimitive, CardRootProps, CardStyles, CardTitleProps, EmptyDescriptionProps, EmptyMediaProps, EmptyPrimitive, EmptyRootProps, EmptyStyles, EmptyTitleProps, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FieldPrimitive, FieldPrimitiveRootProps, FieldStyles, InputPrimitive, InputPrimitiveBaseProps, InputPrimitiveProps, InputStyles, SelectContentProps, SelectOptionProps, SelectOverlayProps, SelectPortalProps, SelectPrimitive, SelectRootBaseProps, SelectRootProps, SelectStyles, SelectTriggerProps, SelectValueProps, TextareaPrimitive, TextareaPrimitiveBaseProps, TextareaPrimitiveProps, TextareaStyles, ToastDescriptionProps, ToastPrimitive, ToastRootProps, ToastStyles, ToastTitleProps };
|
|
1
|
+
import { $ as SelectPortalProps, A as ToastRootProps, B as EmptyRootProps, C as TextareaPrimitiveProps, D as BadgeStyles, E as BadgeRootProps, F as AvatarRootProps, G as CardPrimitive, H as EmptyTitleProps, I as AvatarStyles, J as CardFooterProps, K as CardRootProps, L as AvatarImageProps, M as ToastDescriptionProps, N as ToastTitleProps, O as BadgeLabelProps, P as AvatarPrimitive, Q as SelectPrimitive, R as AvatarFallbackProps, S as TextareaPrimitiveBaseProps, St as FieldLabelProps, T as BadgePrimitive, U as EmptyMediaProps, V as EmptyStyles, W as EmptyDescriptionProps, X as CardTitleProps, Y as CardBodyProps, Z as CardHeaderProps, _ as DropdownMenuDividerProps, _t as FieldPrimitive, a as PopoverPortalProps, at as SelectOverlayProps, b as DropdownMenuTriggerProps, bt as FieldErrorProps, c as PopoverOverlayProps, ct as ButtonPrimitive, d as PopoverTriggerRef, dt as ButtonStyles, et as SelectRootBaseProps, f as DropdownMenuPrimitive, ft as ButtonPrimitiveLabelProps, g as DropdownMenuOverlayProps, gt as InputStyles, h as DropdownMenuStyles, ht as InputPrimitiveProps, i as PopoverCloseProps, it as SelectContentProps, j as ToastStyles, k as ToastPrimitive, l as PopoverContentProps, lt as ButtonPrimitiveRootProps, m as DropdownMenuRootProps, mt as InputPrimitiveBaseProps, n as PopoverContext, nt as SelectStyles, o as PopoverRootProps, ot as SelectValueProps, p as DropdownMenuPortalProps, pt as InputPrimitive, q as CardStyles, r as usePopover, rt as SelectOptionProps, st as SelectTriggerProps, t as PopoverPrimitive, tt as SelectRootProps, u as PopoverTriggerProps, ut as ButtonState, v as DropdownMenuButtonProps, vt as FieldPrimitiveRootProps, w as TextareaStyles, x as TextareaPrimitive, xt as FieldDescriptionProps, y as DropdownMenuContentProps, yt as FieldStyles, z as EmptyPrimitive } from "../index-CGY0mO6z.mjs";
|
|
2
|
+
export { AvatarFallbackProps, AvatarImageProps, AvatarPrimitive, AvatarRootProps, AvatarStyles, BadgeLabelProps, BadgePrimitive, BadgeRootProps, BadgeStyles, ButtonPrimitive, ButtonPrimitiveLabelProps, ButtonPrimitiveRootProps, ButtonState, ButtonStyles, 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 };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as BadgePrimitive, c as EmptyPrimitive, d as ButtonPrimitive, f as InputPrimitive, i as TextareaPrimitive, l as CardPrimitive, n as usePopover, o as ToastPrimitive, p as FieldPrimitive, r as DropdownMenuPrimitive, s as AvatarPrimitive, t as PopoverPrimitive, u as SelectPrimitive } from "../primitives-P_8clvQr.mjs";
|
|
2
2
|
|
|
3
|
-
export { AvatarPrimitive, BadgePrimitive, ButtonPrimitive, CardPrimitive, EmptyPrimitive, FieldPrimitive, InputPrimitive, SelectPrimitive, TextareaPrimitive, ToastPrimitive };
|
|
3
|
+
export { AvatarPrimitive, BadgePrimitive, ButtonPrimitive, CardPrimitive, DropdownMenuPrimitive, EmptyPrimitive, FieldPrimitive, InputPrimitive, PopoverPrimitive, SelectPrimitive, TextareaPrimitive, ToastPrimitive, usePopover };
|