@trackunit/react-components 0.1.51 → 0.1.53
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.js +11 -11
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -298,12 +298,12 @@ const ActionButton = ({ type, value, dataTestId, iconSize }) => {
|
|
|
298
298
|
const getIconName = () => {
|
|
299
299
|
switch (type) {
|
|
300
300
|
case "PHONE_NUMBER":
|
|
301
|
-
return "
|
|
301
|
+
return "PhoneArrowUpRightIcon";
|
|
302
302
|
case "WEB_ADDRESS":
|
|
303
|
-
return "
|
|
303
|
+
return "ArrowTopRightOnSquareIcon";
|
|
304
304
|
case "EMAIL":
|
|
305
305
|
default:
|
|
306
|
-
return "
|
|
306
|
+
return "EnvelopeIcon";
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
309
|
const ButtonAction = () => {
|
|
@@ -416,7 +416,7 @@ const Alert = ({ color = "info", title, className, children, primaryAction, seco
|
|
|
416
416
|
const getIconFromColor = () => {
|
|
417
417
|
switch (color) {
|
|
418
418
|
case "danger":
|
|
419
|
-
return jsx(Icon, { name: "
|
|
419
|
+
return jsx(Icon, { name: "ExclamationTriangleIcon", color: "danger" });
|
|
420
420
|
case "warning":
|
|
421
421
|
return jsx(Icon, { name: "ExclamationCircleIcon", color: "warning" });
|
|
422
422
|
case "success":
|
|
@@ -441,7 +441,7 @@ const Alert = ({ color = "info", title, className, children, primaryAction, seco
|
|
|
441
441
|
ref && ref.current && ref.current.scrollIntoView && ref.current.scrollIntoView();
|
|
442
442
|
}
|
|
443
443
|
}, [ref, autoScroll]);
|
|
444
|
-
return (jsxs(Container$8, Object.assign({ "$color": color, className: className, "data-testid": dataTestId, "$inline": inline, ref: ref, role: "alert" }, { children: [jsx(IconContainer$1, Object.assign({ "$inline": inline }, { children: getIconFromColor() })), jsxs(Content$1, Object.assign({ "$inline": inline }, { children: [jsxs(ContentDetails, { children: [jsx(ContentBody, { children: body }), onClose && !inline ? (jsx(CloseButtonContainer, Object.assign({ "$inline": inline }, { children: jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "
|
|
444
|
+
return (jsxs(Container$8, Object.assign({ "$color": color, className: className, "data-testid": dataTestId, "$inline": inline, ref: ref, role: "alert" }, { children: [jsx(IconContainer$1, Object.assign({ "$inline": inline }, { children: getIconFromColor() })), jsxs(Content$1, Object.assign({ "$inline": inline }, { children: [jsxs(ContentDetails, { children: [jsx(ContentBody, { children: body }), onClose && !inline ? (jsx(CloseButtonContainer, Object.assign({ "$inline": inline }, { children: jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMarkIcon", size: "small" }), title: "Close Alert", circular: true }) }))) : null] }), (primaryAction || secondaryAction || onClose) && (jsxs(RightAligned, Object.assign({ "$inline": inline }, { children: [secondaryAction && (jsx(Button, Object.assign({ size: "small", variant: "transparent", color: getButtonColor(), onClick: secondaryAction.onClick, loading: secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.loading }, { children: secondaryAction.label }))), primaryAction && (jsx(Button, Object.assign({ size: "small", color: getButtonColor(), onClick: primaryAction.onClick, loading: primaryAction === null || primaryAction === void 0 ? void 0 : primaryAction.loading }, { children: primaryAction.label }))), onClose && inline ? (jsx(CloseButtonContainer, Object.assign({ "$inline": inline }, { children: jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMarkIcon", size: "small" }), title: "Close Alert", circular: true }) }))) : null] })))] }))] })));
|
|
445
445
|
};
|
|
446
446
|
const CloseButtonContainer = tw.div `
|
|
447
447
|
${p => (p.$inline ? tws `tu-alert__close-button-container--inline` : tws `tu-alert__close-button-container`)}
|
|
@@ -705,7 +705,7 @@ const StyledHeading = tw.div `
|
|
|
705
705
|
* @returns {JSX.Element} CardHeader component
|
|
706
706
|
*/
|
|
707
707
|
const CardHeader = ({ heading, headingVariant = "primary", subHeading, onClose, dataTestId, className, children, accessories, density, extraClassName, hideSeparator = false, }) => {
|
|
708
|
-
return (jsx(Root$8, Object.assign({ dataTestId: dataTestId, className: className, "$hideSeparator": hideSeparator, density: density }, { children: jsxs(Container$6, { children: [jsxs("div", Object.assign({ className: extraClassName }, { children: [jsxs(HeadingContainer$1, { children: [jsx(Heading$1, Object.assign({ className: "self-center", variant: headingVariant }, { children: heading })), accessories] }), subHeading && (jsx(Heading$1, Object.assign({ subtle: true, variant: "subtitle" }, { children: subHeading }))), children] })), onClose && (jsx(IconButton, { dataTestId: "card-header-close-button", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "
|
|
708
|
+
return (jsx(Root$8, Object.assign({ dataTestId: dataTestId, className: className, "$hideSeparator": hideSeparator, density: density }, { children: jsxs(Container$6, { children: [jsxs("div", Object.assign({ className: extraClassName }, { children: [jsxs(HeadingContainer$1, { children: [jsx(Heading$1, Object.assign({ className: "self-center", variant: headingVariant }, { children: heading })), accessories] }), subHeading && (jsx(Heading$1, Object.assign({ subtle: true, variant: "subtitle" }, { children: subHeading }))), children] })), onClose && (jsx(IconButton, { dataTestId: "card-header-close-button", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMarkIcon", size: "small" }), className: "!h-min" }))] }) })));
|
|
709
709
|
};
|
|
710
710
|
const Root$8 = twx(DensityContainer) `
|
|
711
711
|
tu-card__header-density-container
|
|
@@ -1477,7 +1477,7 @@ const MoreMenu = ({ className, dataTestId, dotsDirection = "horizontal", menuPla
|
|
|
1477
1477
|
color: "tertiary",
|
|
1478
1478
|
}, children, }) => {
|
|
1479
1479
|
const [actionMenuIsOpen, setActionMenuIsOpen] = useState(false);
|
|
1480
|
-
const dotsName = dotsDirection === "horizontal" ? "
|
|
1480
|
+
const dotsName = dotsDirection === "horizontal" ? "EllipsisHorizontalIcon" : "EllipsisVerticalIcon";
|
|
1481
1481
|
const actionMenuRef = useRef(null);
|
|
1482
1482
|
useClickOutside(actionMenuRef, () => {
|
|
1483
1483
|
setActionMenuIsOpen(false);
|
|
@@ -1970,9 +1970,9 @@ const TextInput = forwardRef((props, ref) => (jsx(BaseInput, Object.assign({ ref
|
|
|
1970
1970
|
*/
|
|
1971
1971
|
const Search = (_a) => {
|
|
1972
1972
|
var { className, placeholder = "Search", value, widenInputOnFocus, showBorderWhenNotInFocus = false, disabled, onKeyUp, onChange, onFocus, onBlur, name, onClear, dataTestId, autoComplete = "on", ref } = _a, rest = __rest(_a, ["className", "placeholder", "value", "widenInputOnFocus", "showBorderWhenNotInFocus", "disabled", "onKeyUp", "onChange", "onFocus", "onBlur", "name", "onClear", "dataTestId", "autoComplete", "ref"]);
|
|
1973
|
-
return (jsx(StyledTextInput, Object.assign({}, rest, { ref: ref, dataTestId: dataTestId, name: name, className: className, "$widenOnFocus": widenInputOnFocus, "$showBorderWhenNotInFocus": showBorderWhenNotInFocus, placeholder: placeholder, prefix: jsx(Icon, { name: "
|
|
1973
|
+
return (jsx(StyledTextInput, Object.assign({}, rest, { ref: ref, dataTestId: dataTestId, name: name, className: className, "$widenOnFocus": widenInputOnFocus, "$showBorderWhenNotInFocus": showBorderWhenNotInFocus, placeholder: placeholder, prefix: jsx(Icon, { name: "MagnifyingGlassIcon", size: "medium" }), suffix: onClear ? (jsx("button", Object.assign({ "data-testid": dataTestId && `${dataTestId}_suffix_component`, onClick: () => {
|
|
1974
1974
|
onClear();
|
|
1975
|
-
} }, { children: jsx(Icon, { name: "
|
|
1975
|
+
} }, { children: jsx(Icon, { name: "XMarkIcon", size: "small" }) }))) : undefined, value: value, disabled: disabled, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, autoComplete: autoComplete })));
|
|
1976
1976
|
};
|
|
1977
1977
|
const StyledTextInput = twx(TextInput) `
|
|
1978
1978
|
tu-search
|
|
@@ -2258,7 +2258,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
|
|
|
2258
2258
|
if (disabled) {
|
|
2259
2259
|
return null;
|
|
2260
2260
|
}
|
|
2261
|
-
return (jsx(components.ClearIndicator, Object.assign({}, props, { children: jsx(
|
|
2261
|
+
return (jsx(components.ClearIndicator, Object.assign({}, props, { children: jsx(XMarkIcon, Object.assign({ onClick: props.clearValue, "data-testid": dataTestId && `${dataTestId}-XMarkIcon` }, { children: jsx(Icon, { name: "XCircleIcon", size: "medium" }) })) })));
|
|
2262
2262
|
}, Control: props => {
|
|
2263
2263
|
return (jsx(components.Control, Object.assign({}, props, { className: props.isDisabled ? tws `tu-select__control--disabled` : "" })));
|
|
2264
2264
|
}, SingleValue: props => {
|
|
@@ -2283,7 +2283,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsOpen, refMenuIsEna
|
|
|
2283
2283
|
const StyledIcon = tw.div `
|
|
2284
2284
|
tu-select--icon
|
|
2285
2285
|
`;
|
|
2286
|
-
const
|
|
2286
|
+
const XMarkIcon = tw.div `
|
|
2287
2287
|
tu-select--icon
|
|
2288
2288
|
tu-select__x-icon
|
|
2289
2289
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@trackunit/tailwind-styled-components": "0.0.53",
|
|
9
9
|
"react": "18.2.0",
|
|
10
10
|
"@trackunit/ui-design-tokens": "0.0.58",
|
|
11
|
-
"@trackunit/react-core-contexts-test": "0.1.
|
|
11
|
+
"@trackunit/react-core-contexts-test": "0.1.27",
|
|
12
12
|
"echarts": "5.4.0",
|
|
13
13
|
"echarts-for-react": "3.0.2",
|
|
14
14
|
"uuid": "8.3.2",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"date-fns": "2.29.3",
|
|
17
17
|
"react-day-picker": "8.3.7",
|
|
18
18
|
"@floating-ui/react": "0.15.1",
|
|
19
|
-
"@trackunit/ui-icons": "0.0.
|
|
19
|
+
"@trackunit/ui-icons": "0.0.59",
|
|
20
20
|
"react-browser-hooks": "2.2.4",
|
|
21
21
|
"react-useportal": "1.0.17",
|
|
22
22
|
"react-router-dom": "6.4.5",
|