@rio-cloud/rio-uikit 0.16.4-beta.6 → 0.16.4-beta.7

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/.DS_Store CHANGED
Binary file
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ export type DataTabHeaderProps = {
3
+ isActive?: boolean;
4
+ tabKey: string;
5
+ title: React.ReactNode;
6
+ onSelectTab?: (event: React.MouseEvent<HTMLLIElement>) => void;
7
+ isFirstTab?: boolean;
8
+ isLastTab?: boolean;
9
+ tabFirstChildClassName?: string;
10
+ tabLastChildClassName?: string;
11
+ tabClassName?: string;
12
+ tabHoverClassName?: string;
13
+ tabActiveClassName?: string;
14
+ arrowClassName?: string;
15
+ className?: string;
16
+ };
17
+ declare const DataTabHeader: (props: DataTabHeaderProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default DataTabHeader;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import classNames from 'classnames';
4
+ const DataTabHeader = (props) => {
5
+ const { tabKey, title, isActive, isFirstTab, isLastTab, onSelectTab, tabFirstChildClassName, tabLastChildClassName, tabClassName, tabHoverClassName, tabActiveClassName, arrowClassName, className, } = props;
6
+ const [isHovering, setIsHovering] = useState(false);
7
+ const tabClassNames = classNames('DataTab', 'tab', isFirstTab && tabFirstChildClassName, isLastTab && tabLastChildClassName, !isHovering && !isActive && tabClassName, isHovering && !isActive && tabHoverClassName, isActive && `active ${tabActiveClassName}`, !isActive && 'cursor-pointer', className && className);
8
+ return (_jsxs("li", Object.assign({ className: tabClassNames, onClick: onSelectTab, "data-tabkey": tabKey, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false) }, { children: [title, _jsx("div", { className: `arrow ${arrowClassName} ${isActive ? 'in' : ''}` })] }), tabKey));
9
+ };
10
+ export default DataTabHeader;
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React, { useState } from 'react';
4
4
  import classNames from 'classnames';
5
5
  import { AnimatePresence } from 'framer-motion';
6
+ import DataTabHeader from './DataTabHeader';
6
7
  const getFirstTabKey = (children) => {
7
8
  const [firstItem] = children;
8
9
  return firstItem === null || firstItem === void 0 ? void 0 : firstItem.props.tabKey;
@@ -41,14 +42,11 @@ const DataTabs = (props) => {
41
42
  _jsx(AnimatePresence, Object.assign({ initial: false, exitBeforeEnter: true }, { children: enhancedChildren })));
42
43
  };
43
44
  return (_jsxs("div", Object.assign({}, remainingProps, { className: wrapperClassNames }, { children: [_jsx("div", Object.assign({ className: `DataTabsWrapper ${tabsWrapperClassName}` }, { children: _jsx("ul", Object.assign({ className: 'DataTabs', role: 'tabList' }, { children: React.Children.map(children, (child, index) => {
44
- const [isHovering, setIsHovering] = useState(false);
45
45
  if (!child) {
46
46
  return null;
47
47
  }
48
48
  const { tabKey, title, className } = child.props;
49
- const isActive = tabKey === internalActiveKey;
50
- const tabClassNames = classNames('DataTab', 'tab', index === 0 && tabFirstChildClassName, index === (children === null || children === void 0 ? void 0 : children.length) - 1 && tabLastChildClassName, !isHovering && !isActive && tabClassName, isHovering && !isActive && tabHoverClassName, isActive && `active ${tabActiveClassName}`, !isActive && 'cursor-pointer', className && className);
51
- return (_jsxs("li", Object.assign({ className: tabClassNames, onClick: handleSelectTab, "data-tabkey": tabKey, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false) }, { children: [title, _jsx("div", { className: `arrow ${arrowClassName} ${isActive ? 'in' : ''}` })] }), tabKey));
49
+ return (_jsx(DataTabHeader, { isActive: tabKey === internalActiveKey, tabKey: tabKey, title: title, onSelectTab: handleSelectTab, isFirstTab: index === 0, isLastTab: !!((children === null || children === void 0 ? void 0 : children.length) - 1), tabFirstChildClassName: tabFirstChildClassName, tabLastChildClassName: tabLastChildClassName, tabActiveClassName: tabActiveClassName, tabClassName: tabClassName, tabHoverClassName: tabHoverClassName, arrowClassName: arrowClassName, className: className }));
52
50
  }) })) })), _jsx("div", Object.assign({ className: `tab-content ${tabContentClassName}`, role: 'tabpanel' }, { children: commonTabContent ? commonTabContent : enrichChildren() }))] })));
53
51
  };
54
52
  export default DataTabs;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ export type DataTabHeaderProps = {
3
+ isActive?: boolean;
4
+ tabKey: string;
5
+ title: React.ReactNode;
6
+ onSelectTab?: (event: React.MouseEvent<HTMLLIElement>) => void;
7
+ isFirstTab?: boolean;
8
+ isLastTab?: boolean;
9
+ tabFirstChildClassName?: string;
10
+ tabLastChildClassName?: string;
11
+ tabClassName?: string;
12
+ tabHoverClassName?: string;
13
+ tabActiveClassName?: string;
14
+ arrowClassName?: string;
15
+ className?: string;
16
+ };
17
+ declare const DataTabHeader: (props: DataTabHeaderProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default DataTabHeader;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
7
+ const DataTabHeader = (props) => {
8
+ const { tabKey, title, isActive, isFirstTab, isLastTab, onSelectTab, tabFirstChildClassName, tabLastChildClassName, tabClassName, tabHoverClassName, tabActiveClassName, arrowClassName, className, } = props;
9
+ const [isHovering, setIsHovering] = (0, react_1.useState)(false);
10
+ const tabClassNames = (0, classnames_1.default)('DataTab', 'tab', isFirstTab && tabFirstChildClassName, isLastTab && tabLastChildClassName, !isHovering && !isActive && tabClassName, isHovering && !isActive && tabHoverClassName, isActive && `active ${tabActiveClassName}`, !isActive && 'cursor-pointer', className && className);
11
+ return ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: tabClassNames, onClick: onSelectTab, "data-tabkey": tabKey, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false) }, { children: [title, (0, jsx_runtime_1.jsx)("div", { className: `arrow ${arrowClassName} ${isActive ? 'in' : ''}` })] }), tabKey));
12
+ };
13
+ exports.default = DataTabHeader;
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
7
7
  const framer_motion_1 = require("framer-motion");
8
+ const DataTabHeader_1 = tslib_1.__importDefault(require("./DataTabHeader"));
8
9
  const getFirstTabKey = (children) => {
9
10
  const [firstItem] = children;
10
11
  return firstItem === null || firstItem === void 0 ? void 0 : firstItem.props.tabKey;
@@ -43,14 +44,11 @@ const DataTabs = (props) => {
43
44
  (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, Object.assign({ initial: false, exitBeforeEnter: true }, { children: enhancedChildren })));
44
45
  };
45
46
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: wrapperClassNames }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: `DataTabsWrapper ${tabsWrapperClassName}` }, { children: (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: 'DataTabs', role: 'tabList' }, { children: react_1.default.Children.map(children, (child, index) => {
46
- const [isHovering, setIsHovering] = (0, react_1.useState)(false);
47
47
  if (!child) {
48
48
  return null;
49
49
  }
50
50
  const { tabKey, title, className } = child.props;
51
- const isActive = tabKey === internalActiveKey;
52
- const tabClassNames = (0, classnames_1.default)('DataTab', 'tab', index === 0 && tabFirstChildClassName, index === (children === null || children === void 0 ? void 0 : children.length) - 1 && tabLastChildClassName, !isHovering && !isActive && tabClassName, isHovering && !isActive && tabHoverClassName, isActive && `active ${tabActiveClassName}`, !isActive && 'cursor-pointer', className && className);
53
- return ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: tabClassNames, onClick: handleSelectTab, "data-tabkey": tabKey, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false) }, { children: [title, (0, jsx_runtime_1.jsx)("div", { className: `arrow ${arrowClassName} ${isActive ? 'in' : ''}` })] }), tabKey));
51
+ return ((0, jsx_runtime_1.jsx)(DataTabHeader_1.default, { isActive: tabKey === internalActiveKey, tabKey: tabKey, title: title, onSelectTab: handleSelectTab, isFirstTab: index === 0, isLastTab: !!((children === null || children === void 0 ? void 0 : children.length) - 1), tabFirstChildClassName: tabFirstChildClassName, tabLastChildClassName: tabLastChildClassName, tabActiveClassName: tabActiveClassName, tabClassName: tabClassName, tabHoverClassName: tabHoverClassName, arrowClassName: arrowClassName, className: className }));
54
52
  }) })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `tab-content ${tabContentClassName}`, role: 'tabpanel' }, { children: commonTabContent ? commonTabContent : enrichChildren() }))] })));
55
53
  };
56
54
  exports.default = DataTabs;
@@ -68,6 +68,10 @@ const checkMatchingUkitVersions = () => {
68
68
  });
69
69
  };
70
70
  const experimentalLoadUikitCSS = () => {
71
+ var _a;
72
+ if ((_a = document.title) === null || _a === void 0 ? void 0 : _a.includes('UIKIT Demo')) {
73
+ return;
74
+ }
71
75
  // check for existing uikit CSS in document head
72
76
  debug('Check for UIKIT CSS in document head');
73
77
  const hasUikitCssLink = !!document.head.querySelector('link[href*="rio-uikit"]');
@@ -86,7 +90,6 @@ const experimentalLoadUikitCSS = () => {
86
90
  link.onload = () => console.debug(`Loaded CSS link ${link.href}`);
87
91
  link.onerror = () => console.error(`Failed to load ${link.href}`);
88
92
  document.head.appendChild(link);
89
- // TODO: Cleanup for uikit demo page
90
93
  };
91
94
  const initDocumentBootstrapping = (document) => {
92
95
  if (!document || !document.documentElement) {
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.16.4-beta.6"
2
+ "version": "0.16.4-beta.7"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rio-cloud/rio-uikit",
3
- "version": "0.16.4-beta.6",
3
+ "version": "0.16.4-beta.7",
4
4
  "description": "The RIO UIKIT component library",
5
5
  "repository": "https://collaboration.msi.audi.com/stash/projects/RIOFRONT/repos/uikit-web/browse",
6
6
  "scripts": {
@@ -83,8 +83,8 @@
83
83
  "enzyme": "3.11.0",
84
84
  "enzyme-adapter-react-16": "1.15.7",
85
85
  "eslint": "8.46.0",
86
- "eslint-config-prettier": "8.9.0",
87
- "eslint-plugin-compat": "3.5.1",
86
+ "eslint-config-prettier": "8.10.0",
87
+ "eslint-plugin-compat": "3.13.0",
88
88
  "eslint-plugin-getsentry": "2.0.0",
89
89
  "eslint-plugin-import": "2.28.0",
90
90
  "eslint-plugin-prefer-arrow": "1.2.3",
@@ -96,11 +96,11 @@
96
96
  "less": "4.1.3",
97
97
  "license-checker": "25.0.1",
98
98
  "postcss": "8.4.27",
99
- "postcss-preset-env": "8.3.1",
99
+ "postcss-preset-env": "8.5.1",
100
100
  "postcss-short": "5.0.0",
101
101
  "postcss-variable-compress": "2.1.0",
102
102
  "pre-commit": "1.2.2",
103
- "prettier": "3.0.0",
103
+ "prettier": "3.0.1",
104
104
  "react": "17.0.2",
105
105
  "react-dom": "17.0.2",
106
106
  "react-intl": "6.4.4",
@@ -110,7 +110,7 @@
110
110
  "typescript": "4.9.5",
111
111
  "vite": "4.4.8",
112
112
  "vite-plugin-zip-pack": "1.0.6",
113
- "vitest": "0.33.0",
113
+ "vitest": "0.34.1",
114
114
  "webfonts-generator": "github:rio-cloud/webfonts-generator#f666e60803da9155175a7f1775e09671d47a383b"
115
115
  },
116
116
  "peerDependencies": {
package/utils/init.js CHANGED
@@ -65,6 +65,10 @@ const checkMatchingUkitVersions = () => {
65
65
  });
66
66
  };
67
67
  const experimentalLoadUikitCSS = () => {
68
+ var _a;
69
+ if ((_a = document.title) === null || _a === void 0 ? void 0 : _a.includes('UIKIT Demo')) {
70
+ return;
71
+ }
68
72
  // check for existing uikit CSS in document head
69
73
  debug('Check for UIKIT CSS in document head');
70
74
  const hasUikitCssLink = !!document.head.querySelector('link[href*="rio-uikit"]');
@@ -83,7 +87,6 @@ const experimentalLoadUikitCSS = () => {
83
87
  link.onload = () => console.debug(`Loaded CSS link ${link.href}`);
84
88
  link.onerror = () => console.error(`Failed to load ${link.href}`);
85
89
  document.head.appendChild(link);
86
- // TODO: Cleanup for uikit demo page
87
90
  };
88
91
  export const initDocumentBootstrapping = (document) => {
89
92
  if (!document || !document.documentElement) {
package/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.16.4-beta.6"
2
+ "version": "0.16.4-beta.7"
3
3
  }