@trackunit/react-components 0.1.269 → 0.1.271
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 -3
- package/index.esm.js +4 -3
- package/package.json +3 -2
- package/src/components/Icon/Icon.d.ts +6 -6
package/index.cjs.js
CHANGED
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var sharedUtils = require('@trackunit/shared-utils');
|
|
7
8
|
var uiDesignTokens = require('@trackunit/ui-design-tokens');
|
|
8
9
|
var uiIcons = require('@trackunit/ui-icons');
|
|
9
10
|
var IconSpriteMini = require('@trackunit/ui-icons/icons-sprite-mini.svg');
|
|
10
11
|
var IconSpriteOutline = require('@trackunit/ui-icons/icons-sprite-outline.svg');
|
|
11
12
|
var IconSpriteSolid = require('@trackunit/ui-icons/icons-sprite-solid.svg');
|
|
13
|
+
var stringTs = require('string-ts');
|
|
12
14
|
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
13
15
|
var reactUse = require('react-use');
|
|
14
16
|
var reactDayPicker = require('react-day-picker');
|
|
@@ -162,8 +164,7 @@ cssClassVarianceUtilities.cvaMerge([
|
|
|
162
164
|
]);
|
|
163
165
|
|
|
164
166
|
const iconPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, uiDesignTokens.intentPalette), uiDesignTokens.generalPalette), uiDesignTokens.criticalityPalette), uiDesignTokens.activityPalette), uiDesignTokens.utilizationPalette), uiDesignTokens.sitesPalette), uiDesignTokens.rentalStatusPalette);
|
|
165
|
-
|
|
166
|
-
const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); // This users the object in the Object.keys() to infer the type of the keys.
|
|
167
|
+
const iconColorNames = sharedUtils.objectKeys(iconPalette).map(key => stringTs.snakeCase(key));
|
|
167
168
|
const isSafari = () => {
|
|
168
169
|
const ua = navigator.userAgent.toLowerCase();
|
|
169
170
|
return ua.includes("safari") && !ua.includes("chrome");
|
|
@@ -2247,7 +2248,7 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
|
|
|
2247
2248
|
childUniqueIdentifierAttribute: "id",
|
|
2248
2249
|
threshold: overflowThreshold !== null && overflowThreshold !== void 0 ? overflowThreshold : 0.8,
|
|
2249
2250
|
});
|
|
2250
|
-
const overflowItemCount =
|
|
2251
|
+
const overflowItemCount = sharedUtils.objectValues(itemOverflowMap).filter(isOverflowing => isOverflowing).length;
|
|
2251
2252
|
const itemVisibilityClassName = (id) => {
|
|
2252
2253
|
if (itemOverflowMap[id]) {
|
|
2253
2254
|
return "invisible";
|
package/index.esm.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
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, useCallback, memo, createContext, useContext, forwardRef, isValidElement, cloneElement, Children, useReducer } from 'react';
|
|
4
|
+
import { objectKeys, objectValues } from '@trackunit/shared-utils';
|
|
4
5
|
import { rentalStatusPalette, intentPalette, generalPalette, criticalityPalette, activityPalette, utilizationPalette, sitesPalette, color } from '@trackunit/ui-design-tokens';
|
|
5
6
|
import { iconNames } from '@trackunit/ui-icons';
|
|
6
7
|
import IconSpriteMini from '@trackunit/ui-icons/icons-sprite-mini.svg';
|
|
7
8
|
import IconSpriteOutline from '@trackunit/ui-icons/icons-sprite-outline.svg';
|
|
8
9
|
import IconSpriteSolid from '@trackunit/ui-icons/icons-sprite-solid.svg';
|
|
10
|
+
import { snakeCase } from 'string-ts';
|
|
9
11
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
10
12
|
import { useMeasure, useCopyToClipboard, usePrevious } from 'react-use';
|
|
11
13
|
import { DayPicker as DayPicker$1 } from 'react-day-picker';
|
|
@@ -131,8 +133,7 @@ cvaMerge([
|
|
|
131
133
|
]);
|
|
132
134
|
|
|
133
135
|
const iconPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, intentPalette), generalPalette), criticalityPalette), activityPalette), utilizationPalette), sitesPalette), rentalStatusPalette);
|
|
134
|
-
|
|
135
|
-
const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); // This users the object in the Object.keys() to infer the type of the keys.
|
|
136
|
+
const iconColorNames = objectKeys(iconPalette).map(key => snakeCase(key));
|
|
136
137
|
const isSafari = () => {
|
|
137
138
|
const ua = navigator.userAgent.toLowerCase();
|
|
138
139
|
return ua.includes("safari") && !ua.includes("chrome");
|
|
@@ -2216,7 +2217,7 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
|
|
|
2216
2217
|
childUniqueIdentifierAttribute: "id",
|
|
2217
2218
|
threshold: overflowThreshold !== null && overflowThreshold !== void 0 ? overflowThreshold : 0.8,
|
|
2218
2219
|
});
|
|
2219
|
-
const overflowItemCount =
|
|
2220
|
+
const overflowItemCount = objectValues(itemOverflowMap).filter(isOverflowing => isOverflowing).length;
|
|
2220
2221
|
const itemVisibilityClassName = (id) => {
|
|
2221
2222
|
if (itemOverflowMap[id]) {
|
|
2222
2223
|
return "invisible";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.271",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"lodash": "4.17.21",
|
|
24
24
|
"jest-fetch-mock": "^3.0.3",
|
|
25
25
|
"@testing-library/react": "14.0.0",
|
|
26
|
-
"@floating-ui/react": "^0.26.6"
|
|
26
|
+
"@floating-ui/react": "^0.26.6",
|
|
27
|
+
"string-ts": "^2.0.0"
|
|
27
28
|
},
|
|
28
29
|
"module": "./index.esm.js",
|
|
29
30
|
"main": "./index.cjs.js"
|
|
@@ -205,11 +205,7 @@ export declare const iconPalette: {
|
|
|
205
205
|
readonly 50: "239 246 255";
|
|
206
206
|
readonly 100: "219 234 254";
|
|
207
207
|
readonly 200: "191 219 254";
|
|
208
|
-
readonly 300: "147 197 253";
|
|
209
|
-
* Select if the icon should be rendered as solid or outline.
|
|
210
|
-
* Default value depends on the Size prop, mini == solid, medium == solid, large == outline.
|
|
211
|
-
* Trackunit icons might not support both outline and Solid.
|
|
212
|
-
*/
|
|
208
|
+
readonly 300: "147 197 253";
|
|
213
209
|
readonly 400: "96 165 250";
|
|
214
210
|
readonly 500: "59 130 246";
|
|
215
211
|
readonly 600: "37 99 235";
|
|
@@ -221,7 +217,11 @@ export declare const iconPalette: {
|
|
|
221
217
|
readonly 50: "240 253 244";
|
|
222
218
|
readonly 100: "220 252 231";
|
|
223
219
|
readonly 200: "187 247 208";
|
|
224
|
-
readonly 300: "134 239 172";
|
|
220
|
+
readonly 300: "134 239 172"; /**
|
|
221
|
+
* Custom styles object used to override existing styles or add some extra styling
|
|
222
|
+
*
|
|
223
|
+
* @memberof IconProps
|
|
224
|
+
*/
|
|
225
225
|
readonly 400: "74 222 128";
|
|
226
226
|
readonly 500: "34 197 94";
|
|
227
227
|
readonly 600: "22 163 74";
|