@korsolutions/ui 0.0.58 → 0.0.59

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.
Files changed (92) hide show
  1. package/dist/module/components/icon/icon.js +3 -3
  2. package/dist/module/components/icon/icon.js.map +1 -1
  3. package/dist/module/components/menu/components/menu-checkbox-item.js +51 -0
  4. package/dist/module/components/menu/components/menu-checkbox-item.js.map +1 -0
  5. package/dist/module/components/menu/components/menu-content.js +1 -1
  6. package/dist/module/components/menu/components/menu-content.js.map +1 -1
  7. package/dist/module/components/menu/components/menu-group.js +18 -0
  8. package/dist/module/components/menu/components/menu-group.js.map +1 -0
  9. package/dist/module/components/menu/components/menu-item.js +14 -6
  10. package/dist/module/components/menu/components/menu-item.js.map +1 -1
  11. package/dist/module/components/menu/components/menu-label.js +17 -0
  12. package/dist/module/components/menu/components/menu-label.js.map +1 -0
  13. package/dist/module/components/menu/components/menu-overlay.js +1 -1
  14. package/dist/module/components/menu/components/menu-overlay.js.map +1 -1
  15. package/dist/module/components/menu/components/menu-radio-group.js +24 -0
  16. package/dist/module/components/menu/components/menu-radio-group.js.map +1 -0
  17. package/dist/module/components/menu/components/menu-radio-item.js +54 -0
  18. package/dist/module/components/menu/components/menu-radio-item.js.map +1 -0
  19. package/dist/module/components/menu/components/menu-separator.js +17 -0
  20. package/dist/module/components/menu/components/menu-separator.js.map +1 -0
  21. package/dist/module/components/menu/components/menu-shortcut.js +17 -0
  22. package/dist/module/components/menu/components/menu-shortcut.js.map +1 -0
  23. package/dist/module/components/menu/context.js +8 -0
  24. package/dist/module/components/menu/context.js.map +1 -1
  25. package/dist/module/components/menu/index.js +15 -1
  26. package/dist/module/components/menu/index.js.map +1 -1
  27. package/dist/module/components/menu/use-organized-children.js +39 -0
  28. package/dist/module/components/menu/use-organized-children.js.map +1 -0
  29. package/dist/module/components/menu/variants/default.js +82 -6
  30. package/dist/module/components/menu/variants/default.js.map +1 -1
  31. package/dist/module/components/portal/portal.js.map +1 -1
  32. package/dist/module/themes/provider.js.map +1 -1
  33. package/dist/module/utils/element-utils.js +11 -0
  34. package/dist/module/utils/element-utils.js.map +1 -0
  35. package/dist/typescript/src/components/icon/icon.d.ts +2 -2
  36. package/dist/typescript/src/components/icon/icon.d.ts.map +1 -1
  37. package/dist/typescript/src/components/menu/components/menu-checkbox-item.d.ts +13 -0
  38. package/dist/typescript/src/components/menu/components/menu-checkbox-item.d.ts.map +1 -0
  39. package/dist/typescript/src/components/menu/components/menu-content.d.ts.map +1 -1
  40. package/dist/typescript/src/components/menu/components/menu-group.d.ts +9 -0
  41. package/dist/typescript/src/components/menu/components/menu-group.d.ts.map +1 -0
  42. package/dist/typescript/src/components/menu/components/menu-item.d.ts +3 -3
  43. package/dist/typescript/src/components/menu/components/menu-item.d.ts.map +1 -1
  44. package/dist/typescript/src/components/menu/components/menu-label.d.ts +9 -0
  45. package/dist/typescript/src/components/menu/components/menu-label.d.ts.map +1 -0
  46. package/dist/typescript/src/components/menu/components/menu-overlay.d.ts.map +1 -1
  47. package/dist/typescript/src/components/menu/components/menu-radio-group.d.ts +10 -0
  48. package/dist/typescript/src/components/menu/components/menu-radio-group.d.ts.map +1 -0
  49. package/dist/typescript/src/components/menu/components/menu-radio-item.d.ts +12 -0
  50. package/dist/typescript/src/components/menu/components/menu-radio-item.d.ts.map +1 -0
  51. package/dist/typescript/src/components/menu/components/menu-separator.d.ts +8 -0
  52. package/dist/typescript/src/components/menu/components/menu-separator.d.ts.map +1 -0
  53. package/dist/typescript/src/components/menu/components/menu-shortcut.d.ts +9 -0
  54. package/dist/typescript/src/components/menu/components/menu-shortcut.d.ts.map +1 -0
  55. package/dist/typescript/src/components/menu/context.d.ts +7 -1
  56. package/dist/typescript/src/components/menu/context.d.ts.map +1 -1
  57. package/dist/typescript/src/components/menu/index.d.ts +21 -0
  58. package/dist/typescript/src/components/menu/index.d.ts.map +1 -1
  59. package/dist/typescript/src/components/menu/types.d.ts +17 -2
  60. package/dist/typescript/src/components/menu/types.d.ts.map +1 -1
  61. package/dist/typescript/src/components/menu/use-organized-children.d.ts +3 -0
  62. package/dist/typescript/src/components/menu/use-organized-children.d.ts.map +1 -0
  63. package/dist/typescript/src/components/menu/variants/default.d.ts.map +1 -1
  64. package/dist/typescript/src/components/portal/portal.d.ts +2 -2
  65. package/dist/typescript/src/components/portal/portal.d.ts.map +1 -1
  66. package/dist/typescript/src/themes/provider.d.ts +2 -2
  67. package/dist/typescript/src/themes/provider.d.ts.map +1 -1
  68. package/dist/typescript/src/types/element.types.d.ts +2 -0
  69. package/dist/typescript/src/types/element.types.d.ts.map +1 -1
  70. package/dist/typescript/src/utils/element-utils.d.ts +3 -0
  71. package/dist/typescript/src/utils/element-utils.d.ts.map +1 -0
  72. package/package.json +1 -1
  73. package/src/components/icon/icon.tsx +9 -3
  74. package/src/components/menu/components/menu-checkbox-item.tsx +74 -0
  75. package/src/components/menu/components/menu-content.tsx +2 -1
  76. package/src/components/menu/components/menu-group.tsx +25 -0
  77. package/src/components/menu/components/menu-item.tsx +25 -9
  78. package/src/components/menu/components/menu-label.tsx +21 -0
  79. package/src/components/menu/components/menu-overlay.tsx +11 -2
  80. package/src/components/menu/components/menu-radio-group.tsx +35 -0
  81. package/src/components/menu/components/menu-radio-item.tsx +80 -0
  82. package/src/components/menu/components/menu-separator.tsx +22 -0
  83. package/src/components/menu/components/menu-shortcut.tsx +21 -0
  84. package/src/components/menu/context.ts +18 -1
  85. package/src/components/menu/index.ts +21 -0
  86. package/src/components/menu/types.ts +25 -2
  87. package/src/components/menu/use-organized-children.tsx +38 -0
  88. package/src/components/menu/variants/default.tsx +82 -6
  89. package/src/components/portal/portal.tsx +23 -5
  90. package/src/themes/provider.tsx +2 -4
  91. package/src/types/element.types.ts +10 -1
  92. package/src/utils/element-utils.ts +12 -0
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContext","useEffect","useState","useColorScheme","defaultThemeAssets","mergeThemeAssets","jsx","_jsx","ThemeContext","ThemeProvider","props","children","theme","components","systemColorScheme","colorScheme","setColorScheme","themeAssets","colors","Provider","value","radius","fontFamily","letterSpacing","fontSize","useTheme","context","Error","useComponentsConfig"],"sourceRoot":"../../../src","sources":["themes/provider.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,cAAc;AAI7C,SAASC,kBAAkB,QAAQ,oBAAW;AAU9C,SAASC,gBAAgB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAqB3C,MAAMC,YAAY,gBAAGT,aAAa,CAAsB,IAAI,CAAC;AAO7D,OAAO,MAAMU,aAAa,GAAIC,KAAyB,IAAK;EAC1D,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGH,KAAK;EAE7C,MAAMI,iBAAiB,GAAGX,cAAc,CAAC,CAAC;EAC1C,MAAM,CAACY,WAAW,EAAEC,cAAc,CAAC,GAAGd,QAAQ,CAC5CY,iBAAiB,KAAK,MAAM,GAAG,MAAM,GAAG,OAC1C,CAAC;EAED,MAAMG,WAAW,GAAGL,KAAK,GACrBP,gBAAgB,CAACD,kBAAkB,EAAEQ,KAAK,CAAC,GAC3CR,kBAAkB;EAEtB,MAAMc,MAAM,GAAGD,WAAW,CAACC,MAAM,CAACH,WAAW,CAAC;EAE9Cd,SAAS,CAAC,MAAM;IACd,IAAIa,iBAAiB,EAAE;MACrBE,cAAc,CAACF,iBAAiB,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjE;EACF,CAAC,EAAE,CAACA,iBAAiB,CAAC,CAAC;EAEvB,oBACEP,IAAA,CAACC,YAAY,CAACW,QAAQ;IACpBC,KAAK,EAAE;MACLL,WAAW;MACXC,cAAc;MACdE,MAAM;MACNG,MAAM,EAAEJ,WAAW,CAACI,MAAM;MAC1BC,UAAU,EAAEL,WAAW,CAACK,UAAU;MAClCC,aAAa,EAAEN,WAAW,CAACM,aAAa;MACxCC,QAAQ,EAAEP,WAAW,CAACO,QAAQ;MAC9BX;IACF,CAAE;IAAAF,QAAA,EAEDA;EAAQ,CACY,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMc,QAAQ,GAAGA,CAAA,KAAM;EAC5B,MAAMC,OAAO,GAAG1B,UAAU,CAACQ,YAAY,CAAC;EACxC,IAAI,CAACkB,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EACA,OAAOD,OAAO;AAChB,CAAC;AAED,OAAO,MAAME,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMF,OAAO,GAAG1B,UAAU,CAACQ,YAAY,CAAC;EACxC,IAAI,CAACkB,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EACA,OAAOD,OAAO,CAACb,UAAU;AAC3B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useContext","useEffect","useState","useColorScheme","defaultThemeAssets","mergeThemeAssets","jsx","_jsx","ThemeContext","ThemeProvider","props","children","theme","components","systemColorScheme","colorScheme","setColorScheme","themeAssets","colors","Provider","value","radius","fontFamily","letterSpacing","fontSize","useTheme","context","Error","useComponentsConfig"],"sourceRoot":"../../../src","sources":["themes/provider.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,cAAc;AAI7C,SAASC,kBAAkB,QAAQ,oBAAW;AAU9C,SAASC,gBAAgB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAmB3C,MAAMC,YAAY,gBAAGT,aAAa,CAAsB,IAAI,CAAC;AAO7D,OAAO,MAAMU,aAAa,GAAIC,KAAyB,IAAK;EAC1D,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGH,KAAK;EAE7C,MAAMI,iBAAiB,GAAGX,cAAc,CAA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oreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ export const getElementProp = (element, propName) => {
5
+ if (! /*#__PURE__*/React.isValidElement(element)) return undefined;
6
+ if (!element.props) return undefined;
7
+ if (typeof element.props !== "object") return undefined;
8
+ if (!(propName in element.props)) return undefined;
9
+ return element.props[propName];
10
+ };
11
+ //# sourceMappingURL=element-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","getElementProp","element","propName","isValidElement","undefined","props"],"sourceRoot":"../../../src","sources":["utils/element-utils.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAO,MAAMC,cAAc,GAAGA,CAC5BC,OAAwB,EACxBC,QAAgB,KACgC;EAChD,IAAI,eAACH,KAAK,CAACI,cAAc,CAACF,OAAO,CAAC,EAAE,OAAOG,SAAS;EACpD,IAAI,CAACH,OAAO,CAACI,KAAK,EAAE,OAAOD,SAAS;EACpC,IAAI,OAAOH,OAAO,CAACI,KAAK,KAAK,QAAQ,EAAE,OAAOD,SAAS;EACvD,IAAI,EAAEF,QAAQ,IAAID,OAAO,CAACI,KAAK,CAAC,EAAE,OAAOD,SAAS;EAClD,OAAQH,OAAO,CAACI,KAAK,CAASH,QAAQ,CAAC;AACzC,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import type { PropsWithRequiredRender, SvgProps } from "../../types/props.types";
2
1
  import React from "react";
2
+ import type { PropsWithRequiredRender, SvgProps } from "../../types/props.types";
3
3
  import { IconVariants } from "./variants";
4
4
  export type IconProps = SvgProps & {
5
5
  variant?: keyof typeof IconVariants;
6
6
  };
7
- export declare function Icon({ render: Component, ...props }: PropsWithRequiredRender<IconProps>): React.JSX.Element;
7
+ export declare const Icon: React.FC<PropsWithRequiredRender<IconProps>>;
8
8
  //# sourceMappingURL=icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG;IACjC,OAAO,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;CACrC,CAAC;AAEF,wBAAgB,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,CAAC,SAAS,CAAC,qBAUvF"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,uBAAuB,EACvB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG;IACjC,OAAO,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAa7D,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { type StyleProp, type ViewStyle } from "react-native";
3
+ export interface MenuCheckboxItemProps {
4
+ children: React.ReactNode;
5
+ checked: boolean;
6
+ onCheckedChange: (checked: boolean) => void;
7
+ disabled?: boolean;
8
+ closeOnPress?: boolean;
9
+ render?: (props: MenuCheckboxItemProps) => React.ReactNode;
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+ export declare function MenuCheckboxItem(props: MenuCheckboxItemProps): React.JSX.Element;
13
+ //# sourceMappingURL=menu-checkbox-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-checkbox-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-checkbox-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAWD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAgD5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-content.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC;IAEtD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAwBlD"}
1
+ {"version":3,"file":"menu-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-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,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC;IAEtD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAyBlD"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { type StyleProp, type ViewStyle } from "react-native";
3
+ export interface MenuGroupProps {
4
+ children?: React.ReactNode;
5
+ render?: (props: MenuGroupProps) => React.ReactNode;
6
+ style?: StyleProp<ViewStyle>;
7
+ }
8
+ export declare function MenuGroup(props: MenuGroupProps): React.JSX.Element;
9
+ //# sourceMappingURL=menu-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-group.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IACpD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAc9C"}
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- import { type StyleProp, type TextStyle } from "react-native";
2
+ import { type StyleProp, type ViewStyle } from "react-native";
3
3
  export interface MenuItemProps {
4
- children: string;
4
+ children: React.ReactNode;
5
5
  onPress?: () => void;
6
6
  render?: (props: MenuItemProps) => React.ReactNode;
7
- style?: StyleProp<TextStyle>;
7
+ style?: StyleProp<ViewStyle>;
8
8
  }
9
9
  export declare function MenuItem(props: MenuItemProps): React.JSX.Element;
10
10
  //# sourceMappingURL=menu-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,CAAC;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AASD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAuB5C"}
1
+ {"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,CAAC;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AASD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAsC5C"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { type StyleProp, type TextStyle } from "react-native";
3
+ export interface MenuLabelProps {
4
+ children: string;
5
+ render?: (props: MenuLabelProps) => React.ReactNode;
6
+ style?: StyleProp<TextStyle>;
7
+ }
8
+ export declare function MenuLabel(props: MenuLabelProps): React.JSX.Element;
9
+ //# sourceMappingURL=menu-label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-label.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IACpD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAU9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-overlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,KAAK,SAAS,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,YAAY,CAAC;IAEzD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAgBlD"}
1
+ {"version":3,"file":"menu-overlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,YAAY,CAAC;IAEzD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAoBlD"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { type StyleProp, type ViewStyle } from "react-native";
3
+ export interface MenuRadioGroupProps {
4
+ children?: React.ReactNode;
5
+ value: string;
6
+ onValueChange: (value: string) => void;
7
+ style?: StyleProp<ViewStyle>;
8
+ }
9
+ export declare function MenuRadioGroup(props: MenuRadioGroupProps): React.JSX.Element;
10
+ //# sourceMappingURL=menu-radio-group.d.ts.map
@@ -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,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK/E,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,qBAqDtD"}
@@ -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,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAiB,KAAK,QAAQ,EAAc,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,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"}
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,2BA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IAAI;;;;;;;;;;;;;;CAchB,CAAC;AAEF,YAAY,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,10 +1,25 @@
1
+ import type { StyleProp, TextStyle, ViewStyle } from "react-native";
2
+ 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";
8
+ export type MenuRadioIndicatorState = "default" | "selected";
5
9
  export interface MenuStyles {
6
10
  content?: MenuContentProps["style"];
7
- item?: Partial<Record<MenuButtonState, MenuItemProps["style"]>>;
11
+ item?: Partial<Record<MenuButtonState, StyleProp<ViewStyle>>>;
12
+ itemText?: StyleProp<TextStyle>;
13
+ itemIcon?: SvgProps;
8
14
  overlay?: MenuOverlayProps["style"];
15
+ group?: StyleProp<ViewStyle>;
16
+ label?: StyleProp<TextStyle>;
17
+ separator?: StyleProp<ViewStyle>;
18
+ checkboxItem?: Partial<Record<MenuCheckboxItemState, StyleProp<ViewStyle>>>;
19
+ checkboxIndicator?: StyleProp<TextStyle>;
20
+ radioGroup?: StyleProp<ViewStyle>;
21
+ radioItem?: Partial<Record<MenuRadioItemState, StyleProp<ViewStyle>>>;
22
+ radioIndicator?: Partial<Record<MenuRadioIndicatorState, StyleProp<ViewStyle>>>;
23
+ shortcut?: StyleProp<TextStyle>;
9
24
  }
10
25
  //# 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,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACrC"}
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,EAAE,QAAQ,EAAE,MAAM,yB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E,OAAO,CACtB,MAAM,CAAC,uBAAuB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CACtD,CAAC;IACF,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACjC"}
@@ -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,UAgCxC,CAAC"}
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,UA4GxC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { type PortalHostProps, type PortalProps } from "./portal.constants";
2
- export declare function PortalHost({ name, container }: PortalHostProps): import("react").JSX.Element | null;
3
- export declare function Portal({ name, hostName, children }: PortalProps): import("react").JSX.Element;
2
+ export declare function PortalHost({ name, container, }: PortalHostProps): import("react").JSX.Element | null;
3
+ export declare function Portal({ name, hostName, children, }: PortalProps): import("react").JSX.Element;
4
4
  //# sourceMappingURL=portal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAgDjG,wBAAgB,UAAU,CAAC,EAAE,IAA0B,EAAE,SAAS,EAAE,EAAE,eAAe,sCAyBpF;AAED,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,QAA8B,EAAE,QAAQ,EAAE,EAAE,WAAW,+BAYrF"}
1
+ {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAuD5B,wBAAgB,UAAU,CAAC,EACzB,IAA0B,EAC1B,SAAS,GACV,EAAE,eAAe,sCAyBjB;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAA8B,EAC9B,QAAQ,GACT,EAAE,WAAW,+BAYb"}
@@ -1,6 +1,6 @@
1
1
  import { type PropsWithChildren } from "react";
2
2
  import type { ToastVariants } from "../components/toast/variants";
3
- import type { SvgProps } from "../types/props.types";
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,7 @@ interface ThemeContext {
15
15
  }
16
16
  export interface ComponentsConfig {
17
17
  toast?: {
18
- icons?: Partial<Record<keyof typeof ToastVariants, (props: SvgProps) => React.ReactNode>>;
18
+ icons?: Partial<Record<keyof typeof ToastVariants, IconComponent>>;
19
19
  };
20
20
  }
21
21
  declare const ThemeContext: import("react").Context<ThemeContext | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"prov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-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;AAEjD,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,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAAC;AACnF,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,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,3 @@
1
+ import React from "react";
2
+ export declare const getElementProp: <T extends React.ElementType>(element: React.ReactNode, propName: string) => React.ComponentProps<T>[string] | undefined;
3
+ //# sourceMappingURL=element-utils.d.ts.map
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@korsolutions/ui",
3
- "version": "0.0.58",
3
+ "version": "0.0.59",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 function Icon({ render: Component, ...props }: PropsWithRequiredRender<IconProps>) {
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,74 @@
1
+ import React, { useState } from "react";
2
+ import { Pressable, Text, 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
+
7
+ export interface MenuCheckboxItemProps {
8
+ children: React.ReactNode;
9
+ checked: boolean;
10
+ onCheckedChange: (checked: boolean) => void;
11
+ disabled?: boolean;
12
+ closeOnPress?: boolean;
13
+ render?: (props: MenuCheckboxItemProps) => React.ReactNode;
14
+ style?: StyleProp<ViewStyle>;
15
+ }
16
+
17
+ const calculateState = (
18
+ isHovered: boolean,
19
+ disabled?: boolean,
20
+ ): MenuCheckboxItemState => {
21
+ if (disabled) return "disabled";
22
+ if (isHovered) return "hovered";
23
+ return "default";
24
+ };
25
+
26
+ export function MenuCheckboxItem(props: MenuCheckboxItemProps) {
27
+ const menu = useMenu();
28
+ const [isHovered, setIsHovered] = useState(false);
29
+ const state = calculateState(isHovered, props.disabled);
30
+
31
+ const composedStyle = [
32
+ menu.styles?.checkboxItem?.default,
33
+ menu.styles?.checkboxItem?.[state],
34
+ props.style,
35
+ ];
36
+
37
+ const handlePress = () => {
38
+ if (props.disabled) return;
39
+ props.onCheckedChange(!props.checked);
40
+ if (props.closeOnPress) {
41
+ menu.setIsOpen(false);
42
+ }
43
+ };
44
+
45
+ const organizedChildren = useOrganizedChildren(props.children);
46
+
47
+ if (props.render) {
48
+ return (
49
+ <>
50
+ {props.render({
51
+ ...props,
52
+ children: organizedChildren,
53
+ })}
54
+ </>
55
+ );
56
+ }
57
+
58
+ return (
59
+ <Pressable
60
+ onPress={handlePress}
61
+ onPointerEnter={() => setIsHovered(true)}
62
+ onPointerLeave={() => setIsHovered(false)}
63
+ disabled={props.disabled}
64
+ accessibilityRole="checkbox"
65
+ accessibilityState={{ checked: props.checked, disabled: props.disabled }}
66
+ style={composedStyle}
67
+ >
68
+ {organizedChildren}
69
+ <Text style={menu.styles?.checkboxIndicator}>
70
+ {props.checked ? "✓" : " "}
71
+ </Text>
72
+ </Pressable>
73
+ );
74
+ }
@@ -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 {
@@ -26,6 +26,7 @@ export function MenuContent(props: MenuContentProps) {
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, Text, type TextStyle } from "react-native";
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: string;
8
+ children: React.ReactNode;
8
9
  onPress?: () => void;
9
10
 
10
11
  render?: (props: MenuItemProps) => React.ReactNode;
11
- style?: StyleProp<TextStyle>;
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 = [menu.styles?.item?.default, menu.styles?.item?.[state], props.style];
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 Component = props.render ?? Text;
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
- <Component
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
- {props.children}
42
- </Component>
57
+ {organizedChildren}
58
+ </Pressable>
43
59
  );
44
60
  }