@arcblock/ux 2.10.65 → 2.10.66

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. package/lib/ActionButton/index.d.ts +1 -1
  2. package/lib/Alert/index.d.ts +1 -1
  3. package/lib/AnimationWaiter/index.d.ts +27 -15
  4. package/lib/AnimationWaiter/index.js +15 -14
  5. package/lib/Async/index.d.ts +50 -17
  6. package/lib/Badge/index.d.ts +1 -1
  7. package/lib/Badge/index.js +7 -1
  8. package/lib/BlockletContext/index.d.ts +12 -28
  9. package/lib/BlockletContext/index.js +3 -21
  10. package/lib/Button/wrap.d.ts +5 -3
  11. package/lib/Button/wrap.js +2 -1
  12. package/lib/ButtonGroup/index.d.ts +12 -2
  13. package/lib/ButtonGroup/index.js +13 -3
  14. package/lib/CardSelector/index.d.ts +11 -33
  15. package/lib/CardSelector/index.js +16 -32
  16. package/lib/Center/index.d.ts +6 -21
  17. package/lib/Center/index.js +2 -17
  18. package/lib/ClickToCopy/copy-button.d.ts +9 -26
  19. package/lib/ClickToCopy/copy-button.js +5 -17
  20. package/lib/ClickToCopy/hook.d.ts +11 -5
  21. package/lib/ClickToCopy/hook.js +3 -3
  22. package/lib/ClickToCopy/index.d.ts +18 -29
  23. package/lib/ClickToCopy/index.js +0 -13
  24. package/lib/CodeBlock/LightBox.d.ts +1 -1
  25. package/lib/CodeBlock/index.d.ts +7 -26
  26. package/lib/CodeBlock/index.js +4 -17
  27. package/lib/Colors/index.d.ts +2 -2
  28. package/lib/Colors/themes/default.d.ts +54 -61
  29. package/lib/Colors/themes/temp.d.ts +35 -35
  30. package/lib/ContactForm/index.d.ts +26 -30
  31. package/lib/ContactForm/index.js +7 -17
  32. package/lib/Dialog/confirm.d.ts +3 -3
  33. package/lib/Dialog/confirm.js +2 -2
  34. package/lib/Earth/index.d.ts +10 -1
  35. package/lib/Header/auto-hidden.d.ts +6 -11
  36. package/lib/Header/auto-hidden.js +0 -5
  37. package/lib/Header/header.d.ts +20 -51
  38. package/lib/Header/header.js +10 -42
  39. package/lib/Header/index.d.ts +2 -2
  40. package/lib/Header/responsive-header.d.ts +10 -22
  41. package/lib/Header/responsive-header.js +1 -13
  42. package/lib/Icon/image.d.ts +8 -36
  43. package/lib/Icon/image.js +6 -24
  44. package/lib/Icon/index.d.ts +9 -1
  45. package/lib/Icon/index.js +6 -25
  46. package/lib/NavMenu/index.d.ts +1 -1
  47. package/lib/NavMenu/nav-menu.d.ts +37 -51
  48. package/lib/NavMenu/nav-menu.js +47 -102
  49. package/lib/NavMenu/style.d.ts +8 -2
  50. package/lib/NavMenu/style.js +3 -1
  51. package/lib/PageScroller/index.d.ts +13 -1
  52. package/lib/Passport/passport.js +1 -1
  53. package/lib/PricingTable/index.d.ts +3 -1
  54. package/lib/RelativeTime/index.d.ts +1 -1
  55. package/lib/Screenshot/BaseScreenshot/index.js +1 -1
  56. package/lib/SplitButton/index.d.ts +0 -19
  57. package/lib/SplitButton/index.js +7 -27
  58. package/lib/TextCollapse/index.d.ts +10 -1
  59. package/lib/Theme/index.d.ts +5 -13
  60. package/lib/Theme/index.js +4 -11
  61. package/lib/Theme/theme-provider.d.ts +16 -18
  62. package/lib/Theme/theme.d.ts +37 -11
  63. package/lib/Theme/theme.js +13 -22
  64. package/lib/Util/constant.d.ts +31 -31
  65. package/lib/Util/deprecate.d.ts +7 -5
  66. package/lib/Util/federated.d.ts +21 -21
  67. package/lib/Util/federated.js +1 -1
  68. package/lib/Util/index.d.ts +59 -60
  69. package/lib/Util/index.js +16 -43
  70. package/lib/Util/passport.d.ts +6 -6
  71. package/lib/Util/wallet.d.ts +15 -3
  72. package/lib/WebWalletSWKeeper/index.js +1 -1
  73. package/lib/global.d.ts +13 -0
  74. package/lib/index.d.ts +4 -2
  75. package/lib/index.js +2 -2
  76. package/lib/type.d.ts +31 -1
  77. package/package.json +5 -5
  78. package/src/AnimationWaiter/index.jsx +15 -14
  79. package/src/Async/{index.jsx → index.tsx} +13 -4
  80. package/src/Badge/index.jsx +8 -1
  81. package/src/BlockletContext/{index.jsx → index.tsx} +17 -22
  82. package/src/Button/wrap.jsx +2 -1
  83. package/src/ButtonGroup/index.js +13 -3
  84. package/src/CardSelector/{index.jsx → index.tsx} +32 -33
  85. package/src/Center/index.tsx +33 -0
  86. package/src/ClickToCopy/{copy-button.jsx → copy-button.tsx} +15 -16
  87. package/src/ClickToCopy/{hook.js → hook.ts} +5 -5
  88. package/src/ClickToCopy/{index.jsx → index.tsx} +12 -17
  89. package/src/CodeBlock/{index.jsx → index.tsx} +15 -17
  90. package/src/ContactForm/{index.jsx → index.tsx} +47 -29
  91. package/src/Dialog/confirm.jsx +2 -2
  92. package/src/Header/{auto-hidden.jsx → auto-hidden.tsx} +6 -7
  93. package/src/Header/{header.jsx → header.tsx} +32 -46
  94. package/src/Header/{responsive-header.jsx → responsive-header.tsx} +9 -15
  95. package/src/Icon/{image.jsx → image.tsx} +19 -22
  96. package/src/Icon/{index.jsx → index.tsx} +22 -24
  97. package/src/NavMenu/{nav-menu.jsx → nav-menu.tsx} +161 -144
  98. package/src/NavMenu/{style.js → style.ts} +9 -1
  99. package/src/Passport/passport.jsx +1 -1
  100. package/src/Screenshot/BaseScreenshot/index.jsx +1 -1
  101. package/src/SplitButton/index.tsx +10 -23
  102. package/src/Theme/{index.js → index.ts} +6 -12
  103. package/src/Theme/{theme-provider.jsx → theme-provider.tsx} +10 -2
  104. package/src/Theme/{theme.js → theme.ts} +54 -23
  105. package/src/Util/{deprecate.jsx → deprecate.tsx} +8 -4
  106. package/src/Util/{federated.js → federated.ts} +3 -3
  107. package/src/Util/{index.js → index.ts} +85 -59
  108. package/src/Util/{passport.js → passport.ts} +2 -2
  109. package/src/Util/{wallet.js → wallet.ts} +1 -1
  110. package/src/WebWalletSWKeeper/index.jsx +1 -1
  111. package/src/global.d.ts +13 -0
  112. package/src/{index.js → index.ts} +2 -2
  113. package/src/type.d.ts +31 -1
  114. package/src/Center/index.jsx +0 -41
  115. /package/src/CodeBlock/{LightBox.jsx → LightBox.tsx} +0 -0
  116. /package/src/Colors/{index.js → index.ts} +0 -0
  117. /package/src/Colors/themes/{default.js → default.ts} +0 -0
  118. /package/src/Colors/themes/{temp.js → temp.ts} +0 -0
  119. /package/src/Header/{index.js → index.ts} +0 -0
  120. /package/src/NavMenu/{index.js → index.ts} +0 -0
  121. /package/src/Util/{constant.js → constant.ts} +0 -0
@@ -1,55 +1,24 @@
1
- export default Header;
1
+ import { type Breakpoint } from '@mui/material';
2
+ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** logo img/svg, 可以包裹一个 a 标签 */
4
+ logo?: React.ReactNode;
5
+ /** 相当于 Title, 可以包裹一个 a 标签 */
6
+ brand?: React.ReactNode;
7
+ /** brand 右侧的内容区域, 可显示一个 badge 或 tag */
8
+ brandAddon?: React.ReactNode;
9
+ /** brand 下方的描述 */
10
+ description?: React.ReactNode;
11
+ /** 右侧区域, 可以放置 icons/actions/login 等 */
12
+ addons?: React.ReactNode;
13
+ /** logo 左侧内容 */
14
+ prepend?: React.ReactNode;
15
+ align?: 'left' | 'right';
16
+ maxWidth?: Breakpoint | false;
17
+ homeLink?: string | ((brandContent: React.ReactNode) => React.ReactNode);
18
+ }
2
19
  /**
3
20
  * Header 组件
4
21
  * TODO: Layout/dashboard 可以复用此处的 header
5
22
  */
6
- declare function Header({ logo, brand, brandAddon, description, children, addons, prepend, align, maxWidth, homeLink, ...rest }: {
7
- [x: string]: any;
8
- logo: any;
9
- brand: any;
10
- brandAddon: any;
11
- description: any;
12
- children: any;
13
- addons: any;
14
- prepend: any;
15
- align: any;
16
- maxWidth: any;
17
- homeLink: any;
18
- }): import("react/jsx-runtime").JSX.Element;
19
- declare namespace Header {
20
- namespace propTypes {
21
- let logo: PropTypes.Requireable<PropTypes.ReactNodeLike>;
22
- let brand: PropTypes.Requireable<PropTypes.ReactNodeLike>;
23
- let brandAddon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
24
- let description: PropTypes.Requireable<PropTypes.ReactNodeLike>;
25
- let children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
26
- let addons: PropTypes.Requireable<PropTypes.ReactNodeLike>;
27
- let prepend: PropTypes.Requireable<PropTypes.ReactNodeLike>;
28
- let align: PropTypes.Requireable<string>;
29
- let maxWidth: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
30
- let homeLink: PropTypes.Requireable<NonNullable<string | ((...args: any[]) => any) | null | undefined>>;
31
- }
32
- namespace defaultProps {
33
- let logo_1: null;
34
- export { logo_1 as logo };
35
- let brand_1: null;
36
- export { brand_1 as brand };
37
- let brandAddon_1: null;
38
- export { brandAddon_1 as brandAddon };
39
- let description_1: null;
40
- export { description_1 as description };
41
- let children_1: null;
42
- export { children_1 as children };
43
- let addons_1: null;
44
- export { addons_1 as addons };
45
- let prepend_1: null;
46
- export { prepend_1 as prepend };
47
- let align_1: string;
48
- export { align_1 as align };
49
- let maxWidth_1: undefined;
50
- export { maxWidth_1 as maxWidth };
51
- let homeLink_1: string;
52
- export { homeLink_1 as homeLink };
53
- }
54
- }
55
- import PropTypes from 'prop-types';
23
+ declare function Header({ logo, brand, brandAddon, description, children, addons, prepend, align, maxWidth, homeLink, ...rest }: HeaderProps): import("react/jsx-runtime").JSX.Element;
24
+ export default Header;
@@ -1,28 +1,26 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import { Box, Container } from '@mui/material';
4
3
  import { useRef, useState, useEffect } from 'react';
5
4
  import AutoHidden from './auto-hidden';
6
5
  import { styled } from '../Theme';
7
-
8
6
  /**
9
7
  * Header 组件
10
8
  * TODO: Layout/dashboard 可以复用此处的 header
11
9
  */
12
10
  function Header({
13
- logo,
14
- brand,
15
- brandAddon,
16
- description,
17
- children,
18
- addons,
19
- prepend,
20
- align,
11
+ logo = null,
12
+ brand = null,
13
+ brandAddon = null,
14
+ description = null,
15
+ children = null,
16
+ addons = null,
17
+ prepend = null,
18
+ align = 'left',
21
19
  maxWidth,
22
- homeLink,
20
+ homeLink = '/',
23
21
  ...rest
24
22
  }) {
25
- const logoRef = useRef();
23
+ const logoRef = useRef(null);
26
24
  const [brandWrapperMinWidth, setBrandWrapperMinWidth] = useState('0px');
27
25
  const style = {
28
26
  minWidth: brandWrapperMinWidth
@@ -98,36 +96,6 @@ function Header({
98
96
  })
99
97
  });
100
98
  }
101
- Header.propTypes = {
102
- // logo img/svg, 可以包裹一个 a 标签
103
- logo: PropTypes.node,
104
- // 相当于 Title, 可以包裹一个 a 标签
105
- brand: PropTypes.node,
106
- // brand 右侧的内容区域, 可显示一个 badge 或 tag
107
- brandAddon: PropTypes.node,
108
- // brand 下方的描述
109
- description: PropTypes.node,
110
- children: PropTypes.node,
111
- // 右侧区域, 可以放置 icons/actions/login 等
112
- addons: PropTypes.node,
113
- // logo 左侧内容
114
- prepend: PropTypes.node,
115
- align: PropTypes.oneOf(['left', 'right']),
116
- maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false])]),
117
- homeLink: PropTypes.oneOfType([PropTypes.string, PropTypes.func])
118
- };
119
- Header.defaultProps = {
120
- logo: null,
121
- brand: null,
122
- brandAddon: null,
123
- description: null,
124
- children: null,
125
- addons: null,
126
- prepend: null,
127
- align: 'left',
128
- maxWidth: undefined,
129
- homeLink: '/'
130
- };
131
99
  const Root = styled(Box)`
132
100
  position: relative;
133
101
  z-index: ${props => props.theme.zIndex.appBar};
@@ -1,2 +1,2 @@
1
- export { default as Header } from "./header";
2
- export { default as ResponsiveHeader } from "./responsive-header";
1
+ export { default as Header } from './header';
2
+ export { default as ResponsiveHeader } from './responsive-header';
@@ -1,4 +1,11 @@
1
- export default ResponsiveHeader;
1
+ import { type HeaderProps } from './header';
2
+ export interface ResponsiveHeaderProps extends Omit<HeaderProps, 'children'> {
3
+ menu?: React.ReactNode;
4
+ children?: React.ReactNode | ((props: {
5
+ isMobile: boolean;
6
+ closeMenu: () => void;
7
+ }) => React.ReactNode);
8
+ }
2
9
  /**
3
10
  * ResponsiveHeader
4
11
  * - 窄屏下显示 burge menu
@@ -6,24 +13,5 @@ export default ResponsiveHeader;
6
13
  *
7
14
  * 注意: 暂时不要通过 display: none 隐藏 logo, https://blog.patw.me/archives/1820/inline-svg-same-id-and-display-none-issue/
8
15
  */
9
- declare function ResponsiveHeader({ menu, prepend, children, ...rest }: {
10
- [x: string]: any;
11
- menu: any;
12
- prepend: any;
13
- children: any;
14
- }): import("react/jsx-runtime").JSX.Element;
15
- declare namespace ResponsiveHeader {
16
- let propTypes: any;
17
- let defaultProps: {
18
- logo: null;
19
- brand: null;
20
- brandAddon: null;
21
- description: null;
22
- children: null;
23
- addons: null;
24
- prepend: null;
25
- align: string;
26
- maxWidth: undefined;
27
- homeLink: string;
28
- };
29
- }
16
+ declare function ResponsiveHeader({ menu, prepend, children, ...rest }: ResponsiveHeaderProps): import("react/jsx-runtime").JSX.Element;
17
+ export default ResponsiveHeader;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { useCreation, useReactive } from 'ahooks';
5
4
  import MenuIcon from '@mui/icons-material/Menu';
6
5
  import CloseIcon from '@mui/icons-material/Close';
@@ -10,7 +9,6 @@ import useMediaQuery from '@mui/material/useMediaQuery';
10
9
  import Drawer from '@mui/material/Drawer';
11
10
  import Header from './header';
12
11
  import { styled, useTheme } from '../Theme';
13
-
14
12
  /**
15
13
  * ResponsiveHeader
16
14
  * - 窄屏下显示 burge menu
@@ -90,7 +88,7 @@ function ResponsiveHeader({
90
88
  ModalProps: {
91
89
  disablePortal: false,
92
90
  keepMounted: true,
93
- BackdropComponent: null
91
+ BackdropComponent: undefined
94
92
  },
95
93
  anchor: "top",
96
94
  sx: {
@@ -110,16 +108,6 @@ function ResponsiveHeader({
110
108
  })]
111
109
  });
112
110
  }
113
- ResponsiveHeader.propTypes = {
114
- ...Header.PropTypes,
115
- // 如果是 function, 则
116
- // - 会传入一个 isMobile 参数, isMobile 为 true 时, 表示 children 会显示在 menu 中, 可以根据 isMobile 参数调整要渲染的内容, 比如如果 isMobile 为 true 则使用 inline 模式的 NavMenu (适用于移动端)
117
- // - 会传入一个 closeMenu 参数, 可以关闭 menu
118
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
119
- };
120
- ResponsiveHeader.defaultProps = {
121
- ...Header.defaultProps
122
- };
123
111
  const Root = styled(Header)`
124
112
  .header-menu {
125
113
  display: none;
@@ -1,37 +1,9 @@
1
- declare function ImageIcon({ name, size, alt, color, style, prefix, showBadge, ...rest }: {
2
- [x: string]: any;
3
- name: any;
4
- size: any;
5
- alt: any;
6
- color: any;
7
- style: any;
8
- prefix: any;
9
- showBadge: any;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- declare namespace ImageIcon {
12
- namespace propTypes {
13
- let name: PropTypes.Validator<string>;
14
- let size: PropTypes.Requireable<number>;
15
- let color: PropTypes.Requireable<string>;
16
- let alt: PropTypes.Requireable<string>;
17
- let style: PropTypes.Requireable<object>;
18
- let prefix: PropTypes.Requireable<string>;
19
- let showBadge: PropTypes.Requireable<boolean>;
20
- }
21
- namespace defaultProps {
22
- let size_1: number;
23
- export { size_1 as size };
24
- let color_1: string;
25
- export { color_1 as color };
26
- let alt_1: string;
27
- export { alt_1 as alt };
28
- let style_1: {};
29
- export { style_1 as style };
30
- let prefix_1: string;
31
- export { prefix_1 as prefix };
32
- let showBadge_1: boolean;
33
- export { showBadge_1 as showBadge };
34
- }
1
+ export interface ImageIconProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ name: string;
3
+ size?: number;
4
+ color?: string;
5
+ alt?: string;
6
+ prefix?: string;
7
+ showBadge?: boolean;
35
8
  }
36
- export default ImageIcon;
37
- import PropTypes from 'prop-types';
9
+ export default function ImageIcon({ name, size, alt, color, prefix, showBadge, style, ...rest }: ImageIconProps): import("react/jsx-runtime").JSX.Element;
package/lib/Icon/image.js CHANGED
@@ -1,15 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import PropTypes from 'prop-types';
3
2
  import Img from '../Img';
4
3
  import { styled } from '../Theme';
5
4
  export default function ImageIcon({
6
5
  name,
7
- size,
8
- alt,
9
- color,
10
- style,
11
- prefix,
12
- showBadge,
6
+ size = 36,
7
+ alt = '',
8
+ color = '#000000',
9
+ prefix = '/images',
10
+ showBadge = false,
11
+ style = {},
13
12
  ...rest
14
13
  }) {
15
14
  const src = `${prefix}/${name}-${color.replace(/^#/, '')}.png`;
@@ -32,23 +31,6 @@ export default function ImageIcon({
32
31
  })]
33
32
  });
34
33
  }
35
- ImageIcon.propTypes = {
36
- name: PropTypes.string.isRequired,
37
- size: PropTypes.number,
38
- color: PropTypes.string,
39
- alt: PropTypes.string,
40
- style: PropTypes.object,
41
- prefix: PropTypes.string,
42
- showBadge: PropTypes.bool
43
- };
44
- ImageIcon.defaultProps = {
45
- size: 36,
46
- color: '#000000',
47
- alt: '',
48
- style: {},
49
- prefix: '/images',
50
- showBadge: false
51
- };
52
34
  const Div = styled('div')`
53
35
  position: relative;
54
36
  .badge-point {
@@ -1,2 +1,10 @@
1
- declare const _default: (props: any) => import("react/jsx-runtime").JSX.Element;
1
+ export interface IconProps extends React.HTMLAttributes<HTMLElement> {
2
+ name: string;
3
+ color?: string;
4
+ size?: number;
5
+ variant?: 'light' | 'regular' | 'solid';
6
+ rounded?: boolean;
7
+ forwardedRef?: React.ForwardedRef<HTMLElement>;
8
+ }
9
+ declare const _default: (props: IconProps & import("react").RefAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
2
10
  export default _default;
package/lib/Icon/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import colors from '../Colors';
5
4
  import { styled } from '../Theme';
6
5
  import { withDeprecated } from '../Util/deprecate';
@@ -9,16 +8,15 @@ const variants = {
9
8
  regular: 'far',
10
9
  solid: 'fas'
11
10
  };
12
-
13
11
  // eslint-disable-next-line react/prop-types
14
12
  function Icon({
15
13
  name,
16
- color,
17
- size,
18
- variant,
19
- rounded,
20
- style,
21
- className,
14
+ color = colors.grey[900],
15
+ size = 24,
16
+ variant = 'light',
17
+ rounded = false,
18
+ style = {},
19
+ className = '',
22
20
  forwardedRef,
23
21
  ...rest
24
22
  }) {
@@ -42,23 +40,6 @@ function Icon({
42
40
  }
43
41
  return content;
44
42
  }
45
- Icon.propTypes = {
46
- name: PropTypes.string.isRequired,
47
- className: PropTypes.string,
48
- color: PropTypes.string,
49
- rounded: PropTypes.bool,
50
- variant: PropTypes.string,
51
- size: PropTypes.number,
52
- style: PropTypes.object
53
- };
54
- Icon.defaultProps = {
55
- rounded: false,
56
- variant: 'light',
57
- color: colors.grey[900],
58
- className: '',
59
- size: 24,
60
- style: {}
61
- };
62
43
  const Span = styled('span')`
63
44
  width: ${props => props.size * 2}px;
64
45
  height: ${props => props.size * 2}px;
@@ -1 +1 @@
1
- export { default } from "./nav-menu";
1
+ export { default } from './nav-menu';
@@ -1,56 +1,42 @@
1
- export default NavMenu;
1
+ export type ItemOptions = {
2
+ id?: string;
3
+ icon?: React.ReactNode;
4
+ label?: React.ReactNode;
5
+ active?: boolean;
6
+ children?: ItemOptions[];
7
+ };
8
+ export interface NavMenuProps extends React.HTMLAttributes<HTMLElement> {
9
+ items?: ItemOptions[];
10
+ mode?: 'horizontal' | 'vertical' | 'inline';
11
+ children?: React.ReactNode;
12
+ activeId?: string | null;
13
+ textColor?: string;
14
+ activeTextColor?: string;
15
+ bgColor?: string;
16
+ onSelected?: (id: string) => void;
17
+ }
2
18
  /**
3
19
  * NavMenu, 导航组件, 可用于 header/footer/sidebar
4
20
  */
5
- declare function NavMenu({ items, mode, children, activeId, textColor, activeTextColor, bgColor, onSelected, ...rest }: {
6
- [x: string]: any;
7
- items: any;
8
- mode: any;
9
- children: any;
10
- activeId: any;
11
- textColor: any;
12
- activeTextColor: any;
13
- bgColor: any;
14
- onSelected: any;
15
- }): import("react/jsx-runtime").JSX.Element;
21
+ declare function NavMenu({ items, mode, children: _childs, activeId, textColor, activeTextColor, bgColor, onSelected, ...rest }: NavMenuProps): import("react/jsx-runtime").JSX.Element;
16
22
  declare namespace NavMenu {
17
- export namespace propTypes {
18
- let items: PropTypes.Requireable<any[]>;
19
- let mode: PropTypes.Requireable<string>;
20
- let children: PropTypes.Requireable<any[]>;
21
- let activeId: PropTypes.Requireable<string>;
22
- let textColor: PropTypes.Requireable<string>;
23
- let activeTextColor: PropTypes.Requireable<string>;
24
- let bgColor: PropTypes.Requireable<string>;
25
- let onSelected: PropTypes.Requireable<(...args: any[]) => any>;
26
- }
27
- export namespace defaultProps {
28
- let items_1: null;
29
- export { items_1 as items };
30
- let mode_1: string;
31
- export { mode_1 as mode };
32
- let children_1: null;
33
- export { children_1 as children };
34
- let activeId_1: null;
35
- export { activeId_1 as activeId };
36
- let textColor_1: string;
37
- export { textColor_1 as textColor };
38
- let activeTextColor_1: string;
39
- export { activeTextColor_1 as activeTextColor };
40
- let bgColor_1: string;
41
- export { bgColor_1 as bgColor };
42
- let onSelected_1: null;
43
- export { onSelected_1 as onSelected };
44
- }
45
- export { Item };
46
- export { Sub };
23
+ var Item: import("react").ForwardRefExoticComponent<ItemProps & import("react").RefAttributes<HTMLLIElement>>;
24
+ var Sub: import("react").ForwardRefExoticComponent<SubProps & import("react").RefAttributes<HTMLLIElement>>;
47
25
  }
48
- import PropTypes from 'prop-types';
49
- /**
50
- * Item
51
- */
52
- declare const Item: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
53
- /**
54
- * Sub
55
- */
56
- declare const Sub: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
26
+ export interface ItemProps extends React.HTMLAttributes<HTMLLIElement> {
27
+ id?: string;
28
+ icon?: React.ReactNode;
29
+ label?: React.ReactNode;
30
+ active?: boolean;
31
+ onClick?: () => void;
32
+ }
33
+ export interface SubProps extends React.HTMLAttributes<HTMLLIElement> {
34
+ id?: string;
35
+ icon?: React.ReactNode;
36
+ label?: React.ReactNode;
37
+ children?: Array<React.ReactElement>;
38
+ expandIcon?: React.ReactNode | ((props: {
39
+ isOpen: boolean;
40
+ }) => React.ReactNode);
41
+ }
42
+ export default NavMenu;