@trackunit/react-modal 1.25.11 → 1.25.15
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 +7 -2
- package/index.esm.js +8 -3
- package/package.json +6 -6
package/index.cjs.js
CHANGED
|
@@ -9,7 +9,7 @@ var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities
|
|
|
9
9
|
var reactCoreContextsApi = require('@trackunit/react-core-contexts-api');
|
|
10
10
|
|
|
11
11
|
var defaultTranslations = {
|
|
12
|
-
|
|
12
|
+
"modalHeader.close": "Close"
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/** The translation namespace for this library */
|
|
@@ -43,6 +43,10 @@ const translations = {
|
|
|
43
43
|
th: () => Promise.resolve().then(function () { return require('./translation.cjs17.js'); }),
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Local useTranslation for this specific library
|
|
48
|
+
*/
|
|
49
|
+
const useTranslation = () => i18nLibraryTranslation.useNamespaceTranslation(namespace);
|
|
46
50
|
/**
|
|
47
51
|
* Registers the translations for this library
|
|
48
52
|
*/
|
|
@@ -571,9 +575,10 @@ const cvaIconContainer = cssClassVarianceUtilities.cvaMerge(["flex", "place-item
|
|
|
571
575
|
* @returns The modal header element.
|
|
572
576
|
*/
|
|
573
577
|
const ModalHeader = react.forwardRef(({ heading, subHeading, onClickClose, "data-testid": dataTestId, className, style, id, children, accessories, }, ref) => {
|
|
578
|
+
const [t] = useTranslation();
|
|
574
579
|
return (jsxRuntime.jsxs("div", { className: cvaContainer({
|
|
575
580
|
className,
|
|
576
|
-
}), "data-testid": dataTestId, id: id, ref: ref, style: style, children: [jsxRuntime.jsxs("div", { className: cvaHeadingContainer(), children: [jsxRuntime.jsxs("div", { className: cvaTitleContainer(), children: [jsxRuntime.jsx(reactComponents.Heading, { variant: "tertiary", children: heading }), accessories] }), Boolean(subHeading) ? (jsxRuntime.jsx(reactComponents.Text, { size: "small", subtle: true, children: subHeading })) : null, children] }), jsxRuntime.jsx("div", { className: cvaIconContainer(), children: jsxRuntime.jsx(reactComponents.IconButton, { className: "!h-min", "data-testid": dataTestId ? `${dataTestId}-close-button` : "modal-close-button", icon: jsxRuntime.jsx(reactComponents.Icon, { name: "XMark", size: "small" }), onClick: onClickClose, size: "small", variant: "ghost-neutral" }) })] }));
|
|
581
|
+
}), "data-testid": dataTestId, id: id, ref: ref, style: style, children: [jsxRuntime.jsxs("div", { className: cvaHeadingContainer(), children: [jsxRuntime.jsxs("div", { className: cvaTitleContainer(), children: [jsxRuntime.jsx(reactComponents.Heading, { variant: "tertiary", children: heading }), accessories] }), Boolean(subHeading) ? (jsxRuntime.jsx(reactComponents.Text, { size: "small", subtle: true, children: subHeading })) : null, children] }), jsxRuntime.jsx("div", { className: cvaIconContainer(), children: jsxRuntime.jsx(reactComponents.IconButton, { className: "!h-min", "data-testid": dataTestId ? `${dataTestId}-close-button` : "modal-close-button", icon: jsxRuntime.jsx(reactComponents.Icon, { name: "XMark", size: "small" }), onClick: onClickClose, size: "small", title: t("modalHeader.close"), variant: "ghost-neutral" }) })] }));
|
|
577
582
|
});
|
|
578
583
|
|
|
579
584
|
/**
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { registerTranslations } from '@trackunit/i18n-library-translation';
|
|
2
|
+
import { useNamespaceTranslation, registerTranslations } from '@trackunit/i18n-library-translation';
|
|
3
3
|
import { useMergeRefs, FloatingFocusManager, FloatingOverlay, useFloating, shift, autoUpdate, useDismiss, useInteractions } from '@floating-ui/react';
|
|
4
4
|
import { useOverflowBorder, useSheetSnap, useWatch, Card, Portal, Sheet, Button, Heading, Text, IconButton, Icon, useContainerBreakpoints, useViewportBreakpoints, useTimeout, SHEET_TRANSITION_DURATION_MS } from '@trackunit/react-components';
|
|
5
5
|
import { useRef, useCallback, useState, useReducer, useMemo, forwardRef, useId, useSyncExternalStore, useLayoutEffect, useContext, useEffect } from 'react';
|
|
@@ -7,7 +7,7 @@ import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
|
7
7
|
import { ModalDialogContext, ErrorHandlingContext } from '@trackunit/react-core-contexts-api';
|
|
8
8
|
|
|
9
9
|
var defaultTranslations = {
|
|
10
|
-
|
|
10
|
+
"modalHeader.close": "Close"
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/** The translation namespace for this library */
|
|
@@ -41,6 +41,10 @@ const translations = {
|
|
|
41
41
|
th: () => import('./translation.esm17.js'),
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Local useTranslation for this specific library
|
|
46
|
+
*/
|
|
47
|
+
const useTranslation = () => useNamespaceTranslation(namespace);
|
|
44
48
|
/**
|
|
45
49
|
* Registers the translations for this library
|
|
46
50
|
*/
|
|
@@ -569,9 +573,10 @@ const cvaIconContainer = cvaMerge(["flex", "place-items-center"]);
|
|
|
569
573
|
* @returns The modal header element.
|
|
570
574
|
*/
|
|
571
575
|
const ModalHeader = forwardRef(({ heading, subHeading, onClickClose, "data-testid": dataTestId, className, style, id, children, accessories, }, ref) => {
|
|
576
|
+
const [t] = useTranslation();
|
|
572
577
|
return (jsxs("div", { className: cvaContainer({
|
|
573
578
|
className,
|
|
574
|
-
}), "data-testid": dataTestId, id: id, ref: ref, style: style, children: [jsxs("div", { className: cvaHeadingContainer(), children: [jsxs("div", { className: cvaTitleContainer(), children: [jsx(Heading, { variant: "tertiary", children: heading }), accessories] }), Boolean(subHeading) ? (jsx(Text, { size: "small", subtle: true, children: subHeading })) : null, children] }), jsx("div", { className: cvaIconContainer(), children: jsx(IconButton, { className: "!h-min", "data-testid": dataTestId ? `${dataTestId}-close-button` : "modal-close-button", icon: jsx(Icon, { name: "XMark", size: "small" }), onClick: onClickClose, size: "small", variant: "ghost-neutral" }) })] }));
|
|
579
|
+
}), "data-testid": dataTestId, id: id, ref: ref, style: style, children: [jsxs("div", { className: cvaHeadingContainer(), children: [jsxs("div", { className: cvaTitleContainer(), children: [jsx(Heading, { variant: "tertiary", children: heading }), accessories] }), Boolean(subHeading) ? (jsx(Text, { size: "small", subtle: true, children: subHeading })) : null, children] }), jsx("div", { className: cvaIconContainer(), children: jsx(IconButton, { className: "!h-min", "data-testid": dataTestId ? `${dataTestId}-close-button` : "modal-close-button", icon: jsx(Icon, { name: "XMark", size: "small" }), onClick: onClickClose, size: "small", title: t("modalHeader.close"), variant: "ghost-neutral" }) })] }));
|
|
575
580
|
});
|
|
576
581
|
|
|
577
582
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-modal",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.15",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@floating-ui/react": "^0.26.25",
|
|
11
|
-
"@trackunit/react-components": "1.24.
|
|
12
|
-
"@trackunit/css-class-variance-utilities": "1.13.
|
|
13
|
-
"@trackunit/shared-utils": "1.15.
|
|
11
|
+
"@trackunit/react-components": "1.24.10",
|
|
12
|
+
"@trackunit/css-class-variance-utilities": "1.13.5",
|
|
13
|
+
"@trackunit/shared-utils": "1.15.5",
|
|
14
14
|
"@floating-ui/react-dom": "2.1.2",
|
|
15
|
-
"@trackunit/react-core-contexts-api": "1.17.
|
|
16
|
-
"@trackunit/i18n-library-translation": "1.21.
|
|
15
|
+
"@trackunit/react-core-contexts-api": "1.17.5",
|
|
16
|
+
"@trackunit/i18n-library-translation": "1.21.10"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@tanstack/react-router": "^1.114.29",
|