@clayui/tabs 3.55.0 → 3.65.1

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/lib/Content.d.ts CHANGED
@@ -1,8 +1,21 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
1
5
  import React from 'react';
2
- interface IProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ export interface IProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ /**
8
+ * Receives a number that indicates the `tabkey` to be rendered.
9
+ */
3
10
  activeIndex: number;
11
+ /**
12
+ * Children elements received from ClayTabs.Content component.
13
+ */
4
14
  children: Array<React.ReactElement>;
15
+ /**
16
+ * Flag to indicate if `fade` classname that applies an fading animation should be applied.
17
+ */
5
18
  fade?: boolean;
6
19
  }
7
- declare const Content: React.FunctionComponent<IProps>;
20
+ declare const Content: ({ activeIndex, children, className, fade, ...otherProps }: IProps) => JSX.Element;
8
21
  export default Content;
package/lib/Item.d.ts CHANGED
@@ -1,9 +1,28 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
1
5
  import React from 'react';
2
- interface IProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {
6
+ export interface IProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {
7
+ /**
8
+ * Flag to indicate if the component is active or not.
9
+ */
3
10
  active?: boolean;
11
+ /**
12
+ * Flag to indicate if the TabPane is disabled.
13
+ */
4
14
  disabled?: boolean;
15
+ /**
16
+ * This value is used to be the target of the link.
17
+ */
5
18
  href?: string;
19
+ /**
20
+ * Props to be added to the item element that can be an anchor or a button.
21
+ */
6
22
  innerProps?: React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>;
23
+ /**
24
+ * Callback to be used when clicking to a Tab Item.
25
+ */
7
26
  onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
8
27
  }
9
28
  declare const Item: React.ForwardRefExoticComponent<IProps & React.RefAttributes<any>>;
package/lib/TabPane.d.ts CHANGED
@@ -1,7 +1,17 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
1
5
  import React from 'react';
2
- interface ITabPaneProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ export interface ITabPaneProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ /**
8
+ * Flag to indicate if `active` classname should be applied
9
+ */
3
10
  active?: boolean;
11
+ /**
12
+ * Flag to indicate if `fade` classname that applies a fading animation should be applied.
13
+ */
4
14
  fade?: boolean;
5
15
  }
6
- declare const TabPane: React.FunctionComponent<ITabPaneProps>;
16
+ declare const TabPane: ({ active, children, className, fade, ...otherProps }: ITabPaneProps) => JSX.Element;
7
17
  export default TabPane;
package/lib/index.d.ts CHANGED
@@ -1,17 +1,36 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
1
5
  import React from 'react';
2
6
  import Content from './Content';
3
7
  import Item from './Item';
4
8
  import TabPane from './TabPane';
5
9
  export declare type DisplayType = null | 'basic' | 'underline';
6
- interface IProps extends React.HTMLAttributes<HTMLUListElement> {
10
+ export interface IProps extends React.HTMLAttributes<HTMLUListElement> {
11
+ /**
12
+ * Determines how tab is displayed.
13
+ */
7
14
  displayType?: DisplayType;
15
+ /**
16
+ * Justify the nav items according the tab content.
17
+ */
8
18
  justified?: boolean;
19
+ /**
20
+ * Applies a modern style to the tab.
21
+ */
9
22
  modern?: boolean;
10
23
  }
11
- declare const ClayTabs: React.FunctionComponent<IProps> & {
24
+ declare function ClayTabs(props: IProps): JSX.Element & {
12
25
  Content: typeof Content;
13
26
  TabPane: typeof TabPane;
14
27
  TabPanel: typeof TabPane;
15
28
  Item: typeof Item;
16
29
  };
30
+ declare namespace ClayTabs {
31
+ var Content: ({ activeIndex, children, className, fade, ...otherProps }: import("./Content").IProps) => JSX.Element;
32
+ var TabPane: ({ active, children, className, fade, ...otherProps }: import("./TabPane").ITabPaneProps) => JSX.Element;
33
+ var TabPanel: ({ active, children, className, fade, ...otherProps }: import("./TabPane").ITabPaneProps) => JSX.Element;
34
+ var Item: React.ForwardRefExoticComponent<import("./Item").IProps & React.RefAttributes<any>>;
35
+ }
17
36
  export default ClayTabs;
package/lib/index.js CHANGED
@@ -25,7 +25,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
25
25
 
26
26
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
27
27
 
28
- var ClayTabs = function ClayTabs(_ref) {
28
+ function ClayTabs(_ref) {
29
29
  var children = _ref.children,
30
30
  className = _ref.className,
31
31
  displayType = _ref.displayType,
@@ -46,7 +46,7 @@ var ClayTabs = function ClayTabs(_ref) {
46
46
  }, className),
47
47
  role: "tablist"
48
48
  }, otherProps), children);
49
- };
49
+ }
50
50
 
51
51
  ClayTabs.Content = _Content.default;
52
52
  ClayTabs.TabPane = _TabPane.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clayui/tabs",
3
- "version": "3.55.0",
3
+ "version": "3.65.1",
4
4
  "description": "ClayTabs component",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": "https://github.com/liferay/clay",
@@ -17,8 +17,8 @@
17
17
  ],
18
18
  "scripts": {
19
19
  "build": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib --extensions .ts,.tsx",
20
- "build:types": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
21
- "prepublishOnly": "yarn build && yarn build:types",
20
+ "buildTypes": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
21
+ "prepublishOnly": "yarn build && yarn buildTypes",
22
22
  "test": "jest --config ../../jest.config.js"
23
23
  },
24
24
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  "react"
27
27
  ],
28
28
  "dependencies": {
29
- "@clayui/shared": "^3.55.0",
29
+ "@clayui/shared": "^3.65.0",
30
30
  "classnames": "^2.2.6"
31
31
  },
32
32
  "peerDependencies": {
@@ -37,5 +37,5 @@
37
37
  "browserslist": [
38
38
  "extends browserslist-config-clay"
39
39
  ],
40
- "gitHead": "5310f4650d453a3659b0bc73a5f098732168c9c1"
40
+ "gitHead": "603f05c8d617d98e29f0456b5d6618f9a95ce740"
41
41
  }
package/src/Content.tsx CHANGED
@@ -6,7 +6,7 @@
6
6
  import classNames from 'classnames';
7
7
  import React from 'react';
8
8
 
9
- interface IProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ export interface IProps extends React.HTMLAttributes<HTMLDivElement> {
10
10
  /**
11
11
  * Receives a number that indicates the `tabkey` to be rendered.
12
12
  */
@@ -23,7 +23,7 @@ interface IProps extends React.HTMLAttributes<HTMLDivElement> {
23
23
  fade?: boolean;
24
24
  }
25
25
 
26
- const Content: React.FunctionComponent<IProps> = ({
26
+ const Content = ({
27
27
  activeIndex = 0,
28
28
  children,
29
29
  className,
package/src/Item.tsx CHANGED
@@ -7,7 +7,8 @@ import {LinkOrButton} from '@clayui/shared';
7
7
  import classNames from 'classnames';
8
8
  import React from 'react';
9
9
 
10
- interface IProps extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {
10
+ export interface IProps
11
+ extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {
11
12
  /**
12
13
  * Flag to indicate if the component is active or not.
13
14
  */
package/src/TabPane.tsx CHANGED
@@ -6,7 +6,7 @@
6
6
  import classNames from 'classnames';
7
7
  import React from 'react';
8
8
 
9
- interface ITabPaneProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ export interface ITabPaneProps extends React.HTMLAttributes<HTMLDivElement> {
10
10
  /**
11
11
  * Flag to indicate if `active` classname should be applied
12
12
  */
@@ -23,7 +23,7 @@ const delay = (fn: Function, val: number = 150) =>
23
23
  fn();
24
24
  }, val);
25
25
 
26
- const TabPane: React.FunctionComponent<ITabPaneProps> = ({
26
+ const TabPane = ({
27
27
  active = false,
28
28
  children,
29
29
  className,
package/src/index.tsx CHANGED
@@ -12,7 +12,7 @@ import TabPane from './TabPane';
12
12
 
13
13
  export type DisplayType = null | 'basic' | 'underline';
14
14
 
15
- interface IProps extends React.HTMLAttributes<HTMLUListElement> {
15
+ export interface IProps extends React.HTMLAttributes<HTMLUListElement> {
16
16
  /**
17
17
  * Determines how tab is displayed.
18
18
  */
@@ -29,19 +29,21 @@ interface IProps extends React.HTMLAttributes<HTMLUListElement> {
29
29
  modern?: boolean;
30
30
  }
31
31
 
32
- const ClayTabs: React.FunctionComponent<IProps> & {
32
+ function ClayTabs(props: IProps): JSX.Element & {
33
33
  Content: typeof Content;
34
34
  TabPane: typeof TabPane;
35
35
  TabPanel: typeof TabPane;
36
36
  Item: typeof Item;
37
- } = ({
37
+ };
38
+
39
+ function ClayTabs({
38
40
  children,
39
41
  className,
40
42
  displayType,
41
43
  justified,
42
44
  modern = true,
43
45
  ...otherProps
44
- }: IProps) => {
46
+ }: IProps) {
45
47
  return (
46
48
  <ul
47
49
  className={classNames(
@@ -65,7 +67,7 @@ const ClayTabs: React.FunctionComponent<IProps> & {
65
67
  {children}
66
68
  </ul>
67
69
  );
68
- };
70
+ }
69
71
 
70
72
  ClayTabs.Content = Content;
71
73
  ClayTabs.TabPane = TabPane;