@clayui/tabs 3.156.0 → 3.158.0

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/esm/index.js CHANGED
@@ -1,43 +1,34 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- /**
3
- * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
-
7
- import { useControlledState, useId } from '@clayui/shared';
8
- import React from 'react';
9
- import Content from "./Content.js";
10
- import Item from "./Item.js";
11
- import { List } from "./List.js";
12
- import TabPane from "./TabPane.js";
13
- function Tabs(_ref) {
14
- let {
15
- activation = 'manual',
16
- active: externalActive,
17
- children,
18
- className,
19
- defaultActive = 0,
20
- displayType,
21
- fade = false,
22
- justified,
23
- modern = false,
24
- onActiveChange,
25
- ...otherProps
26
- } = _ref;
1
+ import { useControlledState, useId } from "@clayui/shared";
2
+ import React from "react";
3
+ import Content from "./Content";
4
+ import Item from "./Item";
5
+ import { List } from "./List";
6
+ import TabPane from "./TabPane";
7
+ function Tabs({
8
+ activation = "manual",
9
+ active: externalActive,
10
+ children,
11
+ className,
12
+ defaultActive = 0,
13
+ displayType,
14
+ fade = false,
15
+ justified,
16
+ modern = false,
17
+ onActiveChange,
18
+ ...otherProps
19
+ }) {
27
20
  const [active, setActive, isUncontrolled] = useControlledState({
28
- defaultName: 'defaultActive',
21
+ defaultName: "defaultActive",
29
22
  defaultValue: defaultActive,
30
- handleName: 'onActiveChange',
31
- name: 'active',
23
+ handleName: "onActiveChange",
24
+ name: "active",
32
25
  onChange: onActiveChange,
33
26
  value: externalActive
34
27
  });
35
28
  const [left, right] = React.Children.toArray(children);
36
29
  const tabsId = useId();
37
-
38
- // @ts-ignore
39
- if (left?.type?.displayName === 'ClayTabsList') {
40
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.cloneElement(left, {
30
+ if (left?.type?.displayName === "ClayTabsList") {
31
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, React.cloneElement(left, {
41
32
  activation,
42
33
  active,
43
34
  displayType,
@@ -46,30 +37,34 @@ function Tabs(_ref) {
46
37
  onActiveChange: setActive,
47
38
  shouldUseActive: isUncontrolled,
48
39
  tabsId
49
- }), /*#__PURE__*/React.isValidElement(right) && /*#__PURE__*/React.cloneElement(right, {
40
+ }), React.isValidElement(right) && React.cloneElement(right, {
50
41
  active,
51
42
  fade,
52
43
  tabsId
53
44
  }));
54
45
  }
55
- return /*#__PURE__*/React.createElement(List, _extends({}, otherProps, {
56
- activation: activation,
57
- active: active,
58
- className: className,
59
- displayType: displayType,
60
- justified: justified,
61
- modern: modern,
62
- onActiveChange: setActive
63
- }), children);
46
+ return /* @__PURE__ */ React.createElement(
47
+ List,
48
+ {
49
+ ...otherProps,
50
+ activation,
51
+ active,
52
+ className,
53
+ displayType,
54
+ justified,
55
+ modern,
56
+ onActiveChange: setActive
57
+ },
58
+ children
59
+ );
64
60
  }
65
-
66
- /**
67
- * @deprecated since v3.78.2 - Use new composition with Tabs.List and Tabs.Panels.
68
- */
69
61
  Tabs.Content = Content;
70
62
  Tabs.Panels = Content;
71
63
  Tabs.Item = Item;
72
64
  Tabs.List = List;
73
65
  Tabs.TabPane = TabPane;
74
66
  Tabs.TabPanel = TabPane;
75
- export default Tabs;
67
+ var src_default = Tabs;
68
+ export {
69
+ src_default as default
70
+ };
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * SPDX-FileCopyrightText: (c) 2026 Liferay, Inc. https://liferay.com
3
+ * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
4
4
  */
5
5
  import { InternalDispatch } from '@clayui/shared';
6
6
  import React from 'react';
package/package.json CHANGED
@@ -1,46 +1,45 @@
1
1
  {
2
- "name": "@clayui/tabs",
3
- "version": "3.156.0",
4
- "description": "ClayTabs component",
5
- "license": "BSD-3-Clause",
6
- "repository": "https://github.com/liferay/clay",
7
- "main": "lib/cjs/index.js",
8
- "module": "lib/esm/index.js",
9
- "exports": {
10
- ".": {
11
- "types": "./lib/index.d.ts",
12
- "import": "./lib/esm/index.js",
13
- "require": "./lib/cjs/index.js"
14
- }
2
+ "browserslist": [
3
+ "extends browserslist-config-clay"
4
+ ],
5
+ "dependencies": {
6
+ "@clayui/shared": "^3.158.0",
7
+ "classnames": "2.3.1"
15
8
  },
16
- "types": "lib/index.d.ts",
17
- "ts:main": "src/index.tsx",
9
+ "description": "ClayTabs component",
18
10
  "files": [
19
11
  "lib"
20
12
  ],
21
- "scripts": {
22
- "build": "yarn build:cjs && yarn build:esm",
23
- "build:cjs": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib/cjs --extensions .ts,.tsx",
24
- "build:esm": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib/esm --extensions .ts,.tsx --env-name esm",
25
- "buildTypes": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
26
- "format": "prettier --write \"**/*.{js,ts,tsx,md,mdx,json,scss}\"",
27
- "test": "jest --config ../../jest.config.js"
28
- },
29
13
  "keywords": [
30
14
  "clay",
31
15
  "react"
32
16
  ],
33
- "dependencies": {
34
- "@clayui/shared": "^3.156.0",
35
- "classnames": "^2.2.6"
36
- },
17
+ "license": "BSD-3-Clause",
18
+ "main": "lib/cjs/index.js",
19
+ "name": "@clayui/tabs",
37
20
  "peerDependencies": {
38
- "@clayui/css": "3.x",
21
+ "@clayui/css": "^3.158.0",
39
22
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
40
23
  "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
41
24
  },
42
- "browserslist": [
43
- "extends browserslist-config-clay"
44
- ],
45
- "gitHead": "55d9470c2c3c9253c7ba7f8dd8bd36fdef0ffe49"
25
+ "repository": "https://github.com/liferay/clay",
26
+ "scripts": {
27
+ "build": "yarn build:cjs && yarn build:esm",
28
+ "build:cjs": "cross-env NODE_ENV=production node ../build-package-esbuild.js --format=cjs --outdir=lib/cjs",
29
+ "build:esm": "cross-env NODE_ENV=production node ../build-package-esbuild.js --format=esm --outdir=lib/esm",
30
+ "buildTypes": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
31
+ "format": "prettier --write \"**/*.{js,ts,tsx,md,mdx,json,scss}\"",
32
+ "test": "jest --config ../../jest.config.js"
33
+ },
34
+ "version": "3.158.0",
35
+ "module": "lib/esm/index.js",
36
+ "exports": {
37
+ ".": {
38
+ "types": "./lib/index.d.ts",
39
+ "import": "./lib/esm/index.js",
40
+ "require": "./lib/cjs/index.js"
41
+ }
42
+ },
43
+ "types": "lib/index.d.ts",
44
+ "ts:main": "src/index.tsx"
46
45
  }