@korsolutions/ui 0.0.58 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/components/icon/icon.js +3 -3
- package/dist/module/components/icon/icon.js.map +1 -1
- package/dist/module/components/menu/components/menu-checkbox-item.js +51 -0
- package/dist/module/components/menu/components/menu-checkbox-item.js.map +1 -0
- package/dist/module/components/menu/components/menu-content.js +2 -2
- package/dist/module/components/menu/components/menu-content.js.map +1 -1
- package/dist/module/components/menu/components/menu-group.js +18 -0
- package/dist/module/components/menu/components/menu-group.js.map +1 -0
- package/dist/module/components/menu/components/menu-item.js +14 -6
- package/dist/module/components/menu/components/menu-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-label.js +17 -0
- package/dist/module/components/menu/components/menu-label.js.map +1 -0
- package/dist/module/components/menu/components/menu-overlay.js +1 -1
- package/dist/module/components/menu/components/menu-overlay.js.map +1 -1
- package/dist/module/components/menu/components/menu-radio-group.js +24 -0
- package/dist/module/components/menu/components/menu-radio-group.js.map +1 -0
- package/dist/module/components/menu/components/menu-radio-item.js +54 -0
- package/dist/module/components/menu/components/menu-radio-item.js.map +1 -0
- package/dist/module/components/menu/components/menu-selection-indicator.js +29 -0
- package/dist/module/components/menu/components/menu-selection-indicator.js.map +1 -0
- package/dist/module/components/menu/components/menu-separator.js +17 -0
- package/dist/module/components/menu/components/menu-separator.js.map +1 -0
- package/dist/module/components/menu/components/menu-shortcut.js +17 -0
- package/dist/module/components/menu/components/menu-shortcut.js.map +1 -0
- package/dist/module/components/menu/context.js +8 -0
- package/dist/module/components/menu/context.js.map +1 -1
- package/dist/module/components/menu/index.js +15 -1
- package/dist/module/components/menu/index.js.map +1 -1
- package/dist/module/components/menu/use-organized-children.js +39 -0
- package/dist/module/components/menu/use-organized-children.js.map +1 -0
- package/dist/module/components/menu/variants/default.js +73 -6
- package/dist/module/components/menu/variants/default.js.map +1 -1
- package/dist/module/components/phone-input/components/country-picker.js +1 -1
- package/dist/module/components/popover/components/popover-content.js +2 -5
- package/dist/module/components/popover/components/popover-content.js.map +1 -1
- package/dist/module/components/portal/index.js +1 -0
- package/dist/module/components/portal/index.js.map +1 -1
- package/dist/module/components/portal/portal-offset.js +32 -0
- package/dist/module/components/portal/portal-offset.js.map +1 -0
- package/dist/module/components/portal/portal.js +39 -17
- package/dist/module/components/portal/portal.js.map +1 -1
- package/dist/module/components/select/components/select-content.js +3 -3
- package/dist/module/components/select/components/select-content.js.map +1 -1
- package/dist/module/components/textarea/variants/default.js +7 -0
- package/dist/module/components/textarea/variants/default.js.map +1 -1
- package/dist/module/hooks/use-relative-position.js +37 -28
- package/dist/module/hooks/use-relative-position.js.map +1 -1
- package/dist/module/themes/provider.js.map +1 -1
- package/dist/module/utils/element-utils.js +11 -0
- package/dist/module/utils/element-utils.js.map +1 -0
- package/dist/typescript/src/components/icon/icon.d.ts +2 -2
- package/dist/typescript/src/components/icon/icon.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-checkbox-item.d.ts +13 -0
- package/dist/typescript/src/components/menu/components/menu-checkbox-item.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/components/menu-content.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-group.d.ts +9 -0
- package/dist/typescript/src/components/menu/components/menu-group.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/components/menu-item.d.ts +3 -3
- package/dist/typescript/src/components/menu/components/menu-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-label.d.ts +9 -0
- package/dist/typescript/src/components/menu/components/menu-label.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/components/menu-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-radio-group.d.ts +10 -0
- package/dist/typescript/src/components/menu/components/menu-radio-group.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/components/menu-radio-item.d.ts +12 -0
- package/dist/typescript/src/components/menu/components/menu-radio-item.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/components/menu-selection-indicator.d.ts +7 -0
- package/dist/typescript/src/components/menu/components/menu-selection-indicator.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/components/menu-separator.d.ts +8 -0
- package/dist/typescript/src/components/menu/components/menu-separator.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/components/menu-shortcut.d.ts +9 -0
- package/dist/typescript/src/components/menu/components/menu-shortcut.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/context.d.ts +7 -1
- package/dist/typescript/src/components/menu/context.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/index.d.ts +21 -0
- package/dist/typescript/src/components/menu/index.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/types.d.ts +15 -2
- package/dist/typescript/src/components/menu/types.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/use-organized-children.d.ts +3 -0
- package/dist/typescript/src/components/menu/use-organized-children.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/components/popover-content.d.ts.map +1 -1
- package/dist/typescript/src/components/portal/index.d.ts +1 -0
- package/dist/typescript/src/components/portal/index.d.ts.map +1 -1
- package/dist/typescript/src/components/portal/portal-offset.d.ts +13 -0
- package/dist/typescript/src/components/portal/portal-offset.d.ts.map +1 -0
- package/dist/typescript/src/components/portal/portal.d.ts +3 -2
- package/dist/typescript/src/components/portal/portal.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-content.d.ts.map +1 -1
- package/dist/typescript/src/components/textarea/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-relative-position.d.ts +4 -7
- package/dist/typescript/src/hooks/use-relative-position.d.ts.map +1 -1
- package/dist/typescript/src/themes/provider.d.ts +5 -2
- package/dist/typescript/src/themes/provider.d.ts.map +1 -1
- package/dist/typescript/src/types/element.types.d.ts +2 -0
- package/dist/typescript/src/types/element.types.d.ts.map +1 -1
- package/dist/typescript/src/utils/element-utils.d.ts +3 -0
- package/dist/typescript/src/utils/element-utils.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/icon/icon.tsx +9 -3
- package/src/components/menu/components/menu-checkbox-item.tsx +73 -0
- package/src/components/menu/components/menu-content.tsx +3 -2
- package/src/components/menu/components/menu-group.tsx +25 -0
- package/src/components/menu/components/menu-item.tsx +25 -9
- package/src/components/menu/components/menu-label.tsx +21 -0
- package/src/components/menu/components/menu-overlay.tsx +11 -2
- package/src/components/menu/components/menu-radio-group.tsx +35 -0
- package/src/components/menu/components/menu-radio-item.tsx +76 -0
- package/src/components/menu/components/menu-selection-indicator.tsx +26 -0
- package/src/components/menu/components/menu-separator.tsx +22 -0
- package/src/components/menu/components/menu-shortcut.tsx +21 -0
- package/src/components/menu/context.ts +18 -1
- package/src/components/menu/index.ts +21 -0
- package/src/components/menu/types.ts +20 -2
- package/src/components/menu/use-organized-children.tsx +38 -0
- package/src/components/menu/variants/default.tsx +73 -6
- package/src/components/phone-input/components/country-picker.tsx +1 -1
- package/src/components/popover/components/popover-content.tsx +1 -4
- package/src/components/portal/index.ts +1 -0
- package/src/components/portal/portal-offset.ts +28 -0
- package/src/components/portal/portal.tsx +77 -27
- package/src/components/select/components/select-content.tsx +14 -5
- package/src/components/textarea/variants/default.tsx +7 -0
- package/src/hooks/use-relative-position.ts +53 -41
- package/src/themes/provider.tsx +5 -4
- package/src/types/element.types.ts +10 -1
- package/src/utils/element-utils.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-radio-group.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAuBxD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
export interface MenuRadioItemProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
value: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
closeOnPress?: boolean;
|
|
8
|
+
render?: (props: MenuRadioItemProps) => React.ReactNode;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
}
|
|
11
|
+
export declare function MenuRadioItem(props: MenuRadioItemProps): React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=menu-radio-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-radio-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-radio-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,SAAS,CAAC;IACxD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAaD,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAgDtD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface MenuSelectionIndicatorProps {
|
|
3
|
+
isSelected: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function MenuSelectionIndicator({ isSelected, }: MenuSelectionIndicatorProps): React.JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=menu-selection-indicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-selection-indicator.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-selection-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,2BAA2B;IACnC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,GACX,EAAE,2BAA2B,qBAc7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
export interface MenuSeparatorProps {
|
|
4
|
+
render?: (props: MenuSeparatorProps) => React.ReactNode;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
}
|
|
7
|
+
export declare function MenuSeparator(props: MenuSeparatorProps): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=menu-separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-separator.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,SAAS,CAAC;IACxD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAYtD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, type TextStyle } from "react-native";
|
|
3
|
+
export interface MenuShortcutProps {
|
|
4
|
+
children: string;
|
|
5
|
+
render?: (props: MenuShortcutProps) => React.ReactNode;
|
|
6
|
+
style?: StyleProp<TextStyle>;
|
|
7
|
+
}
|
|
8
|
+
export declare function MenuShortcut(props: MenuShortcutProps): React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=menu-shortcut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-shortcut.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-shortcut.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,KAAK,CAAC,SAAS,CAAC;IACvD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAUpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LayoutPosition } from "../../hooks/use-relative-position";
|
|
2
1
|
import { type Dispatch } from "react";
|
|
3
2
|
import type { LayoutRectangle } from "react-native";
|
|
3
|
+
import type { LayoutPosition } from "../../hooks/use-relative-position";
|
|
4
4
|
import type { MenuStyles } from "./types";
|
|
5
5
|
export interface MenuContext {
|
|
6
6
|
isOpen: boolean;
|
|
@@ -13,4 +13,10 @@ export interface MenuContext {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const MenuContext: import("react").Context<MenuContext | undefined>;
|
|
15
15
|
export declare const useMenu: () => MenuContext;
|
|
16
|
+
export interface MenuRadioGroupContextValue {
|
|
17
|
+
value: string;
|
|
18
|
+
onValueChange: (value: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const MenuRadioGroupContext: import("react").Context<MenuRadioGroupContextValue | undefined>;
|
|
21
|
+
export declare const useMenuRadioGroup: () => MenuRadioGroupContextValue;
|
|
16
22
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,QAAQ,EAAc,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,eAAe,EAAE,cAAc,CAAC;IAChC,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;IACnE,aAAa,EAAE,eAAe,CAAC;IAC/B,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAElE,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,kDAAoD,CAAC;AAE7E,eAAO,MAAM,OAAO,mBAMnB,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,qBAAqB,iEAEtB,CAAC;AAEb,eAAO,MAAM,iBAAiB,kCAM7B,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import { MenuCheckboxItem } from "./components/menu-checkbox-item";
|
|
1
2
|
import { MenuContent } from "./components/menu-content";
|
|
3
|
+
import { MenuGroup } from "./components/menu-group";
|
|
2
4
|
import { MenuItem } from "./components/menu-item";
|
|
5
|
+
import { MenuLabel } from "./components/menu-label";
|
|
3
6
|
import { MenuOverlay } from "./components/menu-overlay";
|
|
4
7
|
import { MenuPortal } from "./components/menu-portal";
|
|
8
|
+
import { MenuRadioGroup } from "./components/menu-radio-group";
|
|
9
|
+
import { MenuRadioItem } from "./components/menu-radio-item";
|
|
5
10
|
import { MenuRoot } from "./components/menu-root";
|
|
11
|
+
import { MenuSeparator } from "./components/menu-separator";
|
|
12
|
+
import { MenuShortcut } from "./components/menu-shortcut";
|
|
6
13
|
export declare const Menu: {
|
|
7
14
|
Root: typeof MenuRoot;
|
|
8
15
|
Trigger: import("react").ForwardRefExoticComponent<import(".").MenuTriggerProps & import("react").RefAttributes<import("./components/menu-trigger").MenuTriggerRef>>;
|
|
@@ -10,12 +17,26 @@ export declare const Menu: {
|
|
|
10
17
|
Overlay: typeof MenuOverlay;
|
|
11
18
|
Content: typeof MenuContent;
|
|
12
19
|
Item: typeof MenuItem;
|
|
20
|
+
Group: typeof MenuGroup;
|
|
21
|
+
Label: typeof MenuLabel;
|
|
22
|
+
Separator: typeof MenuSeparator;
|
|
23
|
+
CheckboxItem: typeof MenuCheckboxItem;
|
|
24
|
+
RadioGroup: typeof MenuRadioGroup;
|
|
25
|
+
RadioItem: typeof MenuRadioItem;
|
|
26
|
+
Shortcut: typeof MenuShortcut;
|
|
13
27
|
};
|
|
28
|
+
export type { MenuCheckboxItemProps } from "./components/menu-checkbox-item";
|
|
14
29
|
export type { MenuContentProps } from "./components/menu-content";
|
|
30
|
+
export type { MenuGroupProps } from "./components/menu-group";
|
|
15
31
|
export type { MenuItemProps } from "./components/menu-item";
|
|
32
|
+
export type { MenuLabelProps } from "./components/menu-label";
|
|
16
33
|
export type { MenuOverlayProps } from "./components/menu-overlay";
|
|
17
34
|
export type { MenuPortalProps } from "./components/menu-portal";
|
|
35
|
+
export type { MenuRadioGroupProps } from "./components/menu-radio-group";
|
|
36
|
+
export type { MenuRadioItemProps } from "./components/menu-radio-item";
|
|
18
37
|
export type { MenuRootProps } from "./components/menu-root";
|
|
38
|
+
export type { MenuSeparatorProps } from "./components/menu-separator";
|
|
39
|
+
export type { MenuShortcutProps } from "./components/menu-shortcut";
|
|
19
40
|
export type { MenuTriggerProps } from "./components/menu-trigger";
|
|
20
41
|
export type { MenuStyles } from "./types";
|
|
21
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAy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
|
+
import type { SvgProps } from "../../types/props.types";
|
|
1
3
|
import type { MenuContentProps } from "./components/menu-content";
|
|
2
|
-
import type { MenuItemProps } from "./components/menu-item";
|
|
3
4
|
import type { MenuOverlayProps } from "./components/menu-overlay";
|
|
4
5
|
export type MenuButtonState = "default" | "hovered";
|
|
6
|
+
export type MenuCheckboxItemState = "default" | "hovered" | "disabled";
|
|
7
|
+
export type MenuRadioItemState = "default" | "hovered" | "selected" | "disabled";
|
|
5
8
|
export interface MenuStyles {
|
|
6
9
|
content?: MenuContentProps["style"];
|
|
7
|
-
item?: Partial<Record<MenuButtonState,
|
|
10
|
+
item?: Partial<Record<MenuButtonState, StyleProp<ViewStyle>>>;
|
|
11
|
+
itemText?: StyleProp<TextStyle>;
|
|
12
|
+
itemIcon?: SvgProps;
|
|
8
13
|
overlay?: MenuOverlayProps["style"];
|
|
14
|
+
group?: StyleProp<ViewStyle>;
|
|
15
|
+
label?: StyleProp<TextStyle>;
|
|
16
|
+
separator?: StyleProp<ViewStyle>;
|
|
17
|
+
checkboxItem?: Partial<Record<MenuCheckboxItemState, StyleProp<ViewStyle>>>;
|
|
18
|
+
selectionIndicator?: TextStyle & SvgProps;
|
|
19
|
+
radioGroup?: StyleProp<ViewStyle>;
|
|
20
|
+
radioItem?: Partial<Record<MenuRadioItemState, StyleProp<ViewStyle>>>;
|
|
21
|
+
shortcut?: StyleProp<TextStyle>;
|
|
9
22
|
}
|
|
10
23
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAA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C"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function useOrganizedChildren(children: React.ReactNode): number | bigint | boolean | any[] | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
3
|
+
//# sourceMappingURL=use-organized-children.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-organized-children.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/use-organized-children.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,kSA+B7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/variants/default.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,eAAO,MAAM,qBAAqB,QAAO,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/variants/default.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,eAAO,MAAM,qBAAqB,QAAO,UAmGxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/popover/components/popover-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/popover/components/popover-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,KAAK,CAAC,SAAS,CAAC;IAEzD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAyBxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PortalOffset {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
export type PortalOffsetValue = PortalOffset | null | undefined;
|
|
6
|
+
export declare const PortalOffsetContext: import("react").Context<PortalOffsetValue>;
|
|
7
|
+
type UsePortalOffsetReturn = {
|
|
8
|
+
value: PortalOffset;
|
|
9
|
+
isLoaded: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function usePortalOffset(): UsePortalOffsetReturn;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=portal-offset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-offset.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal-offset.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;AAIhE,eAAO,MAAM,mBAAmB,4CAA8C,CAAC;AAE/E,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,IAAI,qBAAqB,CASvD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { type PortalHostProps, type PortalProps } from "./portal.constants";
|
|
2
|
-
export declare function PortalHost({ name, container }: PortalHostProps):
|
|
3
|
-
export declare function Portal({ name, hostName, children }: PortalProps):
|
|
3
|
+
export declare function PortalHost({ name, container, }: PortalHostProps): React.JSX.Element | null;
|
|
4
|
+
export declare function Portal({ name, hostName, children, }: PortalProps): React.JSX.Element;
|
|
4
5
|
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AA0F5B,wBAAgB,UAAU,CAAC,EACzB,IAA0B,EAC1B,SAAS,GACV,EAAE,eAAe,4BAcjB;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAA8B,EAC9B,QAAQ,GACT,EAAE,WAAW,qBAYb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,YAAY,CAAC;IAE3D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAkCtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/textarea/variants/default.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/textarea/variants/default.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,yBAAyB,IAAI,cAAc,CAwC1D"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type DisplayMetrics, type LayoutRectangle, type ViewStyle } from "react-native";
|
|
2
|
-
import type
|
|
3
|
-
type UseRelativePositionArgs = Omit<GetContentStyleArgs, "
|
|
4
|
-
|
|
5
|
-
contentLayout: LayoutRectangle | null;
|
|
6
|
-
};
|
|
7
|
-
export declare function useRelativePosition({ align, triggerPosition, contentLayout, alignOffset, insets, sideOffset, preferredSide, }: UseRelativePositionArgs): ViewStyle;
|
|
2
|
+
import { type SafeAreaInsets } from "../safe-area";
|
|
3
|
+
type UseRelativePositionArgs = Omit<GetContentStyleArgs, "dimensions" | "insets">;
|
|
4
|
+
export declare function useRelativePosition({ align, triggerPosition, contentLayout, alignOffset, sideOffset, preferredSide, }: UseRelativePositionArgs): ViewStyle;
|
|
8
5
|
export interface LayoutPosition {
|
|
9
6
|
pageY: number;
|
|
10
7
|
pageX: number;
|
|
@@ -15,7 +12,7 @@ interface GetPositionArgs {
|
|
|
15
12
|
dimensions: DisplayMetrics;
|
|
16
13
|
triggerPosition: LayoutPosition;
|
|
17
14
|
contentLayout: LayoutRectangle;
|
|
18
|
-
insets
|
|
15
|
+
insets: SafeAreaInsets;
|
|
19
16
|
}
|
|
20
17
|
interface GetSidePositionArgs extends GetPositionArgs {
|
|
21
18
|
preferredSide: "top" | "bottom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-relative-position.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-relative-position.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"use-relative-position.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-relative-position.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEtE,KAAK,uBAAuB,GAAG,IAAI,CACjC,mBAAmB,EACnB,YAAY,GAAG,QAAQ,CACxB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,eAAe,EACf,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,GACd,EAAE,uBAAuB,GAAG,SAAS,CAyDrC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,cAAc,CAAC;IAC3B,eAAe,EAAE,cAAc,CAAC;IAChC,aAAa,EAAE,eAAe,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,UAAU,mBAAoB,SAAQ,eAAe;IACnD,aAAa,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,eAK5B,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,cAK9B,CAAC;AAgFF,UAAU,oBAAqB,SAAQ,eAAe;IACpD,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB;AA0ED,KAAK,mBAAmB,GAAG,eAAe,GACxC,mBAAmB,GACnB,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropsWithChildren } from "react";
|
|
2
2
|
import type { ToastVariants } from "../components/toast/variants";
|
|
3
|
-
import type {
|
|
3
|
+
import type { IconComponent } from "../types/element.types";
|
|
4
4
|
import type { DeepPartial } from "../types/util.types";
|
|
5
5
|
import type { Colors, ColorScheme, FontFamily, FontSize, LetterSpacing, Radius, ThemeAssets } from "./types";
|
|
6
6
|
interface ThemeContext {
|
|
@@ -15,7 +15,10 @@ interface ThemeContext {
|
|
|
15
15
|
}
|
|
16
16
|
export interface ComponentsConfig {
|
|
17
17
|
toast?: {
|
|
18
|
-
icons?: Partial<Record<keyof typeof ToastVariants,
|
|
18
|
+
icons?: Partial<Record<keyof typeof ToastVariants, IconComponent>>;
|
|
19
|
+
};
|
|
20
|
+
menu?: {
|
|
21
|
+
selectionIcon?: IconComponent;
|
|
19
22
|
};
|
|
20
23
|
}
|
|
21
24
|
declare const ThemeContext: import("react").Context<ThemeContext | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/themes/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CA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CtD,CAAC;AAEF,eAAO,MAAM,QAAQ,oBAMpB,CAAC;AAEF,eAAO,MAAM,mBAAmB,oCAM/B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HostInstance } from "react-native";
|
|
2
|
+
import type { SvgProps } from "./props.types";
|
|
2
3
|
export type ViewRef = HostInstance;
|
|
3
4
|
export type TextInputRef = HostInstance & {
|
|
4
5
|
focus: () => void;
|
|
@@ -10,4 +11,5 @@ export type TextInputRef = HostInstance & {
|
|
|
10
11
|
};
|
|
11
12
|
export type TextChildren = string | number | boolean | null | undefined | string[];
|
|
12
13
|
export type ElementChildren = React.ReactElement | React.ReactElement[];
|
|
14
|
+
export type IconComponent = (props: SvgProps) => React.ReactElement;
|
|
13
15
|
//# sourceMappingURL=element.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.types.d.ts","sourceRoot":"","sources":["../../../../src/types/element.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"element.types.d.ts","sourceRoot":"","sources":["../../../../src/types/element.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG,YAAY,CAAC;AACnC,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IACxC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,YAAY,CAAC;IACjC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,MAAM,EAAE,CAAC;AACb,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/element-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,KAAK,CAAC,WAAW,EACxD,SAAS,KAAK,CAAC,SAAS,EACxB,UAAU,MAAM,KACf,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAMpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { PropsWithRequiredRender, SvgProps } from "../../types/props.types";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import type {
|
|
3
|
+
PropsWithRequiredRender,
|
|
4
|
+
SvgProps,
|
|
5
|
+
} from "../../types/props.types";
|
|
3
6
|
import { IconVariants } from "./variants";
|
|
4
7
|
|
|
5
8
|
export type IconProps = SvgProps & {
|
|
6
9
|
variant?: keyof typeof IconVariants;
|
|
7
10
|
};
|
|
8
11
|
|
|
9
|
-
export
|
|
12
|
+
export const Icon: React.FC<PropsWithRequiredRender<IconProps>> = ({
|
|
13
|
+
render: Component,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
10
16
|
const variantProps = IconVariants[props.variant ?? "default"]();
|
|
11
17
|
const composedProps: SvgProps = {
|
|
12
18
|
...variantProps,
|
|
@@ -16,4 +22,4 @@ export function Icon({ render: Component, ...props }: PropsWithRequiredRender<Ic
|
|
|
16
22
|
};
|
|
17
23
|
|
|
18
24
|
return <Component {...composedProps} />;
|
|
19
|
-
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Pressable, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { useMenu } from "../context";
|
|
4
|
+
import type { MenuCheckboxItemState } from "../types";
|
|
5
|
+
import { useOrganizedChildren } from "../use-organized-children";
|
|
6
|
+
import { MenuSelectionIndicator } from "./menu-selection-indicator";
|
|
7
|
+
|
|
8
|
+
export interface MenuCheckboxItemProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
checked: boolean;
|
|
11
|
+
onCheckedChange: (checked: boolean) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
closeOnPress?: boolean;
|
|
14
|
+
render?: (props: MenuCheckboxItemProps) => React.ReactNode;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const calculateState = (
|
|
19
|
+
isHovered: boolean,
|
|
20
|
+
disabled?: boolean,
|
|
21
|
+
): MenuCheckboxItemState => {
|
|
22
|
+
if (disabled) return "disabled";
|
|
23
|
+
if (isHovered) return "hovered";
|
|
24
|
+
return "default";
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export function MenuCheckboxItem(props: MenuCheckboxItemProps) {
|
|
28
|
+
const menu = useMenu();
|
|
29
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
30
|
+
const state = calculateState(isHovered, props.disabled);
|
|
31
|
+
|
|
32
|
+
const composedStyle = [
|
|
33
|
+
menu.styles?.checkboxItem?.default,
|
|
34
|
+
menu.styles?.checkboxItem?.[state],
|
|
35
|
+
props.style,
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const handlePress = () => {
|
|
39
|
+
if (props.disabled) return;
|
|
40
|
+
props.onCheckedChange(!props.checked);
|
|
41
|
+
if (props.closeOnPress) {
|
|
42
|
+
menu.setIsOpen(false);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const organizedChildren = useOrganizedChildren(props.children);
|
|
47
|
+
|
|
48
|
+
if (props.render) {
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
{props.render({
|
|
52
|
+
...props,
|
|
53
|
+
children: organizedChildren,
|
|
54
|
+
})}
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Pressable
|
|
61
|
+
onPress={handlePress}
|
|
62
|
+
onPointerEnter={() => setIsHovered(true)}
|
|
63
|
+
onPointerLeave={() => setIsHovered(false)}
|
|
64
|
+
disabled={props.disabled}
|
|
65
|
+
accessibilityRole="checkbox"
|
|
66
|
+
accessibilityState={{ checked: props.checked, disabled: props.disabled }}
|
|
67
|
+
style={composedStyle}
|
|
68
|
+
>
|
|
69
|
+
{organizedChildren}
|
|
70
|
+
<MenuSelectionIndicator isSelected={props.checked} />
|
|
71
|
+
</Pressable>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useRelativePosition } from "../../../hooks/use-relative-position";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import { useRelativePosition } from "../../../hooks/use-relative-position";
|
|
4
4
|
import { useMenu } from "../context";
|
|
5
5
|
|
|
6
6
|
export interface MenuContentProps {
|
|
@@ -20,12 +20,13 @@ export function MenuContent(props: MenuContentProps) {
|
|
|
20
20
|
contentLayout: menu.contentLayout,
|
|
21
21
|
alignOffset: 0,
|
|
22
22
|
preferredSide: "bottom",
|
|
23
|
-
sideOffset:
|
|
23
|
+
sideOffset: 2,
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const composedStyle = [positionStyle, menu.styles?.content, props.style];
|
|
27
27
|
|
|
28
28
|
const Component = props.render ?? View;
|
|
29
|
+
|
|
29
30
|
return (
|
|
30
31
|
<Component
|
|
31
32
|
{...props}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { useMenu } from "../context";
|
|
4
|
+
|
|
5
|
+
export interface MenuGroupProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
render?: (props: MenuGroupProps) => React.ReactNode;
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function MenuGroup(props: MenuGroupProps) {
|
|
12
|
+
const menu = useMenu();
|
|
13
|
+
const composedStyle = [menu.styles?.group, props.style];
|
|
14
|
+
|
|
15
|
+
const Component = props.render ?? View;
|
|
16
|
+
return (
|
|
17
|
+
<Component
|
|
18
|
+
{...props}
|
|
19
|
+
role="group"
|
|
20
|
+
style={composedStyle}
|
|
21
|
+
>
|
|
22
|
+
{props.children}
|
|
23
|
+
</Component>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { type StyleProp,
|
|
2
|
+
import { Pressable, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
import { useMenu } from "../context";
|
|
4
4
|
import type { MenuButtonState } from "../types";
|
|
5
|
+
import { useOrganizedChildren } from "../use-organized-children";
|
|
5
6
|
|
|
6
7
|
export interface MenuItemProps {
|
|
7
|
-
children:
|
|
8
|
+
children: React.ReactNode;
|
|
8
9
|
onPress?: () => void;
|
|
9
10
|
|
|
10
11
|
render?: (props: MenuItemProps) => React.ReactNode;
|
|
11
|
-
style?: StyleProp<
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const calculateState = (isHovered: boolean): MenuButtonState => {
|
|
@@ -22,23 +23,38 @@ export function MenuItem(props: MenuItemProps) {
|
|
|
22
23
|
const menu = useMenu();
|
|
23
24
|
const [isHovered, setIsHovered] = useState(false);
|
|
24
25
|
const state = calculateState(isHovered);
|
|
25
|
-
const composedStyle = [
|
|
26
|
+
const composedStyle = [
|
|
27
|
+
menu.styles?.item?.default,
|
|
28
|
+
menu.styles?.item?.[state],
|
|
29
|
+
props.style,
|
|
30
|
+
];
|
|
26
31
|
|
|
27
32
|
const handlePress = () => {
|
|
28
33
|
props.onPress?.();
|
|
29
34
|
menu.setIsOpen((prev) => !prev);
|
|
30
35
|
};
|
|
31
36
|
|
|
32
|
-
const
|
|
37
|
+
const organizedChildren = useOrganizedChildren(props.children);
|
|
38
|
+
|
|
39
|
+
if (props.render) {
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{props.render({
|
|
43
|
+
...props,
|
|
44
|
+
children: organizedChildren,
|
|
45
|
+
})}
|
|
46
|
+
</>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
33
50
|
return (
|
|
34
|
-
<
|
|
35
|
-
{...props}
|
|
51
|
+
<Pressable
|
|
36
52
|
onPress={handlePress}
|
|
37
53
|
onPointerEnter={() => setIsHovered(true)}
|
|
38
54
|
onPointerLeave={() => setIsHovered(false)}
|
|
39
55
|
style={composedStyle}
|
|
40
56
|
>
|
|
41
|
-
{
|
|
42
|
-
</
|
|
57
|
+
{organizedChildren}
|
|
58
|
+
</Pressable>
|
|
43
59
|
);
|
|
44
60
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text, type StyleProp, type TextStyle } from "react-native";
|
|
3
|
+
import { useMenu } from "../context";
|
|
4
|
+
|
|
5
|
+
export interface MenuLabelProps {
|
|
6
|
+
children: string;
|
|
7
|
+
render?: (props: MenuLabelProps) => React.ReactNode;
|
|
8
|
+
style?: StyleProp<TextStyle>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function MenuLabel(props: MenuLabelProps) {
|
|
12
|
+
const menu = useMenu();
|
|
13
|
+
const composedStyle = [menu.styles?.label, props.style];
|
|
14
|
+
|
|
15
|
+
const Component = props.render ?? Text;
|
|
16
|
+
return (
|
|
17
|
+
<Component {...props} style={composedStyle}>
|
|
18
|
+
{props.children}
|
|
19
|
+
</Component>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type StyleProp,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
type ViewStyle,
|
|
7
|
+
} from "react-native";
|
|
3
8
|
import { useMenu } from "../context";
|
|
4
9
|
|
|
5
10
|
export interface MenuOverlayProps {
|
|
@@ -13,7 +18,11 @@ export interface MenuOverlayProps {
|
|
|
13
18
|
export function MenuOverlay(props: MenuOverlayProps) {
|
|
14
19
|
const menu = useMenu();
|
|
15
20
|
|
|
16
|
-
const composedStyle =
|
|
21
|
+
const composedStyle = StyleSheet.flatten([
|
|
22
|
+
StyleSheet.absoluteFill,
|
|
23
|
+
menu.styles?.overlay,
|
|
24
|
+
props.style,
|
|
25
|
+
]);
|
|
17
26
|
|
|
18
27
|
const Component = props.render ?? Pressable;
|
|
19
28
|
return (
|