@trackunit/react-components 0.4.10 → 0.4.11
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/index.cjs.js +4 -5
- package/index.esm.js +5 -6
- package/package.json +2 -3
package/index.cjs.js
CHANGED
|
@@ -10,7 +10,6 @@ var IconSpriteMini = require('@trackunit/ui-icons/icons-sprite-mini.svg');
|
|
|
10
10
|
var IconSpriteOutline = require('@trackunit/ui-icons/icons-sprite-outline.svg');
|
|
11
11
|
var IconSpriteSolid = require('@trackunit/ui-icons/icons-sprite-solid.svg');
|
|
12
12
|
var stringTs = require('string-ts');
|
|
13
|
-
var uuid = require('uuid');
|
|
14
13
|
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
15
14
|
var reactSlot = require('@radix-ui/react-slot');
|
|
16
15
|
var isEqual = require('lodash/isEqual');
|
|
@@ -168,7 +167,7 @@ const isSafari = () => {
|
|
|
168
167
|
*/
|
|
169
168
|
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, type, style, forwardedRef, ariaLabel, fontSize, ariaLabelledBy, ariaDescribedBy, }) => {
|
|
170
169
|
const useTagRef = React.useRef(null);
|
|
171
|
-
const ICON_CONTAINER_ID =
|
|
170
|
+
const ICON_CONTAINER_ID = sharedUtils.uuidv4();
|
|
172
171
|
const correctIconType = React.useMemo(() => {
|
|
173
172
|
if (size === "small") {
|
|
174
173
|
return "micro";
|
|
@@ -1459,7 +1458,7 @@ const BreadcrumbForMediumScreen = ({ dataTestId, breadcrumbItems }) => {
|
|
|
1459
1458
|
return reducedArrayElements;
|
|
1460
1459
|
}, [breadcrumbItems, dataTestId]);
|
|
1461
1460
|
const reducedArray = getReducedArray();
|
|
1462
|
-
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbForMediumScreen({ expanded }), "data-testid": dataTestId, children: (!expanded && reducedArray.length !== 0 ? reducedArray : breadcrumbItems).map(item => (jsxRuntime.jsx(BreadcrumbItem, { dataTestId: `breadcrumbItem-${dataTestId}`, item: item }, `${item.props.label}-${
|
|
1461
|
+
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbForMediumScreen({ expanded }), "data-testid": dataTestId, children: (!expanded && reducedArray.length !== 0 ? reducedArray : breadcrumbItems).map(item => (jsxRuntime.jsx(BreadcrumbItem, { dataTestId: `breadcrumbItem-${dataTestId}`, item: item }, `${item.props.label}-${sharedUtils.uuidv4()}`))) }));
|
|
1463
1462
|
};
|
|
1464
1463
|
|
|
1465
1464
|
/**
|
|
@@ -1522,7 +1521,7 @@ const BreadcrumbContainer = ({ dataTestId, breadcrumbItems }) => {
|
|
|
1522
1521
|
* BreadcrumbItem is a helper component that renders the individual breadcrumb item.
|
|
1523
1522
|
*/
|
|
1524
1523
|
const BreadcrumbItem = ({ item, dataTestId }) => {
|
|
1525
|
-
const id =
|
|
1524
|
+
const id = sharedUtils.uuidv4();
|
|
1526
1525
|
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbItem(), "data-testid": dataTestId, id: `${item.props.label}-${id}`, children: item }));
|
|
1527
1526
|
};
|
|
1528
1527
|
|
|
@@ -1792,7 +1791,7 @@ const cvaChevronIcon = cssClassVarianceUtilities.cvaMerge(["transition-transform
|
|
|
1792
1791
|
* @returns {JSX.Element} Collapse component
|
|
1793
1792
|
*/
|
|
1794
1793
|
const Collapse = ({ id, initialExpanded = false, onToggle, label, children, className, headerClassName, headerAddon, dataTestId, }) => {
|
|
1795
|
-
const LABEL_ID =
|
|
1794
|
+
const LABEL_ID = sharedUtils.uuidv4();
|
|
1796
1795
|
const [expanded, setExpanded] = React__namespace.useState(initialExpanded);
|
|
1797
1796
|
const handleClick = React__namespace.useCallback((e) => {
|
|
1798
1797
|
if (onToggle) {
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useRef, useMemo, useEffect, useState, useReducer, useCallback, memo, forwardRef, createContext, useContext, isValidElement, cloneElement, Children } from 'react';
|
|
4
|
-
import { objectKeys, objectEntries, objectValues } from '@trackunit/shared-utils';
|
|
4
|
+
import { objectKeys, uuidv4, objectEntries, objectValues } from '@trackunit/shared-utils';
|
|
5
5
|
import { rentalStatusPalette, intentPalette, generalPalette, criticalityPalette, activityPalette, utilizationPalette, sitesPalette, themeScreenSizeAsNumber, color } from '@trackunit/ui-design-tokens';
|
|
6
6
|
import { iconNames } from '@trackunit/ui-icons';
|
|
7
7
|
import IconSpriteMicro from '@trackunit/ui-icons/icons-sprite-micro.svg';
|
|
@@ -9,7 +9,6 @@ import IconSpriteMini from '@trackunit/ui-icons/icons-sprite-mini.svg';
|
|
|
9
9
|
import IconSpriteOutline from '@trackunit/ui-icons/icons-sprite-outline.svg';
|
|
10
10
|
import IconSpriteSolid from '@trackunit/ui-icons/icons-sprite-solid.svg';
|
|
11
11
|
import { snakeCase, titleCase } from 'string-ts';
|
|
12
|
-
import { v4 } from 'uuid';
|
|
13
12
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
14
13
|
import { Slottable, Slot } from '@radix-ui/react-slot';
|
|
15
14
|
import isEqual from 'lodash/isEqual';
|
|
@@ -148,7 +147,7 @@ const isSafari = () => {
|
|
|
148
147
|
*/
|
|
149
148
|
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, type, style, forwardedRef, ariaLabel, fontSize, ariaLabelledBy, ariaDescribedBy, }) => {
|
|
150
149
|
const useTagRef = useRef(null);
|
|
151
|
-
const ICON_CONTAINER_ID =
|
|
150
|
+
const ICON_CONTAINER_ID = uuidv4();
|
|
152
151
|
const correctIconType = useMemo(() => {
|
|
153
152
|
if (size === "small") {
|
|
154
153
|
return "micro";
|
|
@@ -1439,7 +1438,7 @@ const BreadcrumbForMediumScreen = ({ dataTestId, breadcrumbItems }) => {
|
|
|
1439
1438
|
return reducedArrayElements;
|
|
1440
1439
|
}, [breadcrumbItems, dataTestId]);
|
|
1441
1440
|
const reducedArray = getReducedArray();
|
|
1442
|
-
return (jsx("div", { className: cvaBreadcrumbForMediumScreen({ expanded }), "data-testid": dataTestId, children: (!expanded && reducedArray.length !== 0 ? reducedArray : breadcrumbItems).map(item => (jsx(BreadcrumbItem, { dataTestId: `breadcrumbItem-${dataTestId}`, item: item }, `${item.props.label}-${
|
|
1441
|
+
return (jsx("div", { className: cvaBreadcrumbForMediumScreen({ expanded }), "data-testid": dataTestId, children: (!expanded && reducedArray.length !== 0 ? reducedArray : breadcrumbItems).map(item => (jsx(BreadcrumbItem, { dataTestId: `breadcrumbItem-${dataTestId}`, item: item }, `${item.props.label}-${uuidv4()}`))) }));
|
|
1443
1442
|
};
|
|
1444
1443
|
|
|
1445
1444
|
/**
|
|
@@ -1502,7 +1501,7 @@ const BreadcrumbContainer = ({ dataTestId, breadcrumbItems }) => {
|
|
|
1502
1501
|
* BreadcrumbItem is a helper component that renders the individual breadcrumb item.
|
|
1503
1502
|
*/
|
|
1504
1503
|
const BreadcrumbItem = ({ item, dataTestId }) => {
|
|
1505
|
-
const id =
|
|
1504
|
+
const id = uuidv4();
|
|
1506
1505
|
return (jsx("div", { className: cvaBreadcrumbItem(), "data-testid": dataTestId, id: `${item.props.label}-${id}`, children: item }));
|
|
1507
1506
|
};
|
|
1508
1507
|
|
|
@@ -1772,7 +1771,7 @@ const cvaChevronIcon = cvaMerge(["transition-transform"], {
|
|
|
1772
1771
|
* @returns {JSX.Element} Collapse component
|
|
1773
1772
|
*/
|
|
1774
1773
|
const Collapse = ({ id, initialExpanded = false, onToggle, label, children, className, headerClassName, headerAddon, dataTestId, }) => {
|
|
1775
|
-
const LABEL_ID =
|
|
1774
|
+
const LABEL_ID = uuidv4();
|
|
1776
1775
|
const [expanded, setExpanded] = React.useState(initialExpanded);
|
|
1777
1776
|
const handleClick = React.useCallback((e) => {
|
|
1778
1777
|
if (onToggle) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
"react-swipeable": "^7.0.1",
|
|
27
27
|
"string-ts": "^2.0.0",
|
|
28
28
|
"tailwind-merge": "^2.0.0",
|
|
29
|
-
"@trackunit/react-table-pagination": "*"
|
|
30
|
-
"uuid": "^9.0.1"
|
|
29
|
+
"@trackunit/react-table-pagination": "*"
|
|
31
30
|
},
|
|
32
31
|
"module": "./index.esm.js",
|
|
33
32
|
"main": "./index.cjs.js",
|