@trackunit/react-components 0.1.126 → 0.1.128
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 +5 -92
- package/index.js +5 -92
- package/package.json +5 -5
package/index.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var tailwindStyledComponents = require('@trackunit/tailwind-styled-components');
|
|
|
8
8
|
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
9
9
|
var uiIcons = require('@trackunit/ui-icons');
|
|
10
10
|
var ReactDOM = require('react-dom');
|
|
11
|
+
var reactRouterDom = require('react-router-dom');
|
|
11
12
|
var uiDesignTokens = require('@trackunit/ui-design-tokens');
|
|
12
13
|
|
|
13
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -13168,7 +13169,7 @@ function getPreviousMonth(startingMonth, options) {
|
|
|
13168
13169
|
* The Navigation context shares details and methods to navigate the months in DayPicker.
|
|
13169
13170
|
* Access this context from the {@link useNavigation} hook.
|
|
13170
13171
|
*/
|
|
13171
|
-
var NavigationContext
|
|
13172
|
+
var NavigationContext = React.createContext(undefined);
|
|
13172
13173
|
/** Provides the values for the {@link NavigationContext}. */
|
|
13173
13174
|
function NavigationProvider(props) {
|
|
13174
13175
|
var dayPicker = useDayPicker();
|
|
@@ -13201,7 +13202,7 @@ function NavigationProvider(props) {
|
|
|
13201
13202
|
nextMonth: nextMonth,
|
|
13202
13203
|
isDateDisplayed: isDateDisplayed
|
|
13203
13204
|
};
|
|
13204
|
-
return (React__default["default"].createElement(NavigationContext
|
|
13205
|
+
return (React__default["default"].createElement(NavigationContext.Provider, { value: value }, props.children));
|
|
13205
13206
|
}
|
|
13206
13207
|
/**
|
|
13207
13208
|
* Hook to access the {@link NavigationContextValue}. Use this hook to navigate
|
|
@@ -13210,7 +13211,7 @@ function NavigationProvider(props) {
|
|
|
13210
13211
|
* This hook is meant to be used inside internal or custom components.
|
|
13211
13212
|
*/
|
|
13212
13213
|
function useNavigation() {
|
|
13213
|
-
var context = React.useContext(NavigationContext
|
|
13214
|
+
var context = React.useContext(NavigationContext);
|
|
13214
13215
|
if (!context) {
|
|
13215
13216
|
throw new Error('useNavigation must be used within a NavigationProvider');
|
|
13216
13217
|
}
|
|
@@ -37237,96 +37238,8 @@ const Pagination = ({ previousPage, nextPage, canPreviousPage, canNextPage, page
|
|
|
37237
37238
|
: page !== undefined && pageCount !== undefined && pageCount !== null && page >= pageCount - 1, "data-testid": "next-page", icon: jsxRuntime.jsx(Icon, { name: "ChevronRightIcon", size: "small" }), size: "small", color: "secondary", variant: "transparent" })] }));
|
|
37238
37239
|
};
|
|
37239
37240
|
|
|
37240
|
-
/**
|
|
37241
|
-
* React Router v6.11.2
|
|
37242
|
-
*
|
|
37243
|
-
* Copyright (c) Remix Software Inc.
|
|
37244
|
-
*
|
|
37245
|
-
* This source code is licensed under the MIT license found in the
|
|
37246
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
37247
|
-
*
|
|
37248
|
-
* @license MIT
|
|
37249
|
-
*/
|
|
37250
|
-
|
|
37251
|
-
const DataRouterContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
37252
|
-
|
|
37253
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37254
|
-
DataRouterContext.displayName = "DataRouter";
|
|
37255
|
-
}
|
|
37256
|
-
|
|
37257
|
-
const DataRouterStateContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
37258
|
-
|
|
37259
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37260
|
-
DataRouterStateContext.displayName = "DataRouterState";
|
|
37261
|
-
}
|
|
37262
|
-
|
|
37263
|
-
const AwaitContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
37264
|
-
|
|
37265
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37266
|
-
AwaitContext.displayName = "Await";
|
|
37267
|
-
}
|
|
37268
|
-
|
|
37269
|
-
const NavigationContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
37270
|
-
|
|
37271
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37272
|
-
NavigationContext.displayName = "Navigation";
|
|
37273
|
-
}
|
|
37274
|
-
|
|
37275
|
-
const LocationContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
37276
|
-
|
|
37277
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37278
|
-
LocationContext.displayName = "Location";
|
|
37279
|
-
}
|
|
37280
|
-
|
|
37281
|
-
const RouteContext = /*#__PURE__*/React__namespace.createContext({
|
|
37282
|
-
outlet: null,
|
|
37283
|
-
matches: [],
|
|
37284
|
-
isDataRoute: false
|
|
37285
|
-
});
|
|
37286
|
-
|
|
37287
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37288
|
-
RouteContext.displayName = "Route";
|
|
37289
|
-
}
|
|
37290
|
-
|
|
37291
|
-
const RouteErrorContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
37292
|
-
|
|
37293
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37294
|
-
RouteErrorContext.displayName = "RouteError";
|
|
37295
|
-
}
|
|
37296
|
-
var DataRouterHook;
|
|
37297
|
-
|
|
37298
|
-
(function (DataRouterHook) {
|
|
37299
|
-
DataRouterHook["UseBlocker"] = "useBlocker";
|
|
37300
|
-
DataRouterHook["UseRevalidator"] = "useRevalidator";
|
|
37301
|
-
DataRouterHook["UseNavigateStable"] = "useNavigate";
|
|
37302
|
-
})(DataRouterHook || (DataRouterHook = {}));
|
|
37303
|
-
|
|
37304
|
-
var DataRouterStateHook;
|
|
37305
|
-
|
|
37306
|
-
(function (DataRouterStateHook) {
|
|
37307
|
-
DataRouterStateHook["UseBlocker"] = "useBlocker";
|
|
37308
|
-
DataRouterStateHook["UseLoaderData"] = "useLoaderData";
|
|
37309
|
-
DataRouterStateHook["UseActionData"] = "useActionData";
|
|
37310
|
-
DataRouterStateHook["UseRouteError"] = "useRouteError";
|
|
37311
|
-
DataRouterStateHook["UseNavigation"] = "useNavigation";
|
|
37312
|
-
DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData";
|
|
37313
|
-
DataRouterStateHook["UseMatches"] = "useMatches";
|
|
37314
|
-
DataRouterStateHook["UseRevalidator"] = "useRevalidator";
|
|
37315
|
-
DataRouterStateHook["UseNavigateStable"] = "useNavigate";
|
|
37316
|
-
DataRouterStateHook["UseRouteId"] = "useRouteId";
|
|
37317
|
-
})(DataRouterStateHook || (DataRouterStateHook = {}));
|
|
37318
|
-
var AwaitRenderStatus;
|
|
37319
|
-
|
|
37320
|
-
(function (AwaitRenderStatus) {
|
|
37321
|
-
AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending";
|
|
37322
|
-
AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success";
|
|
37323
|
-
AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error";
|
|
37324
|
-
})(AwaitRenderStatus || (AwaitRenderStatus = {}));
|
|
37325
|
-
|
|
37326
|
-
new Promise(() => {});
|
|
37327
|
-
|
|
37328
37241
|
function useConfirmExit(confirmExit, when = true) {
|
|
37329
|
-
const { navigator } = React.useContext(
|
|
37242
|
+
const { navigator } = React.useContext(reactRouterDom.UNSAFE_NavigationContext);
|
|
37330
37243
|
React.useEffect(() => {
|
|
37331
37244
|
if (!when) {
|
|
37332
37245
|
return;
|
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
|
6
6
|
import { HeroIconsArray, heroIconLookup, TrackunitSolidIconsArray, TrackunitOutlineIconsArray, trackunitIconLookup } from '@trackunit/ui-icons';
|
|
7
7
|
import * as ReactDOM from 'react-dom';
|
|
8
8
|
import ReactDOM__default, { createPortal } from 'react-dom';
|
|
9
|
+
import { UNSAFE_NavigationContext } from 'react-router-dom';
|
|
9
10
|
import { color } from '@trackunit/ui-design-tokens';
|
|
10
11
|
|
|
11
12
|
const docs = {
|
|
@@ -13141,7 +13142,7 @@ function getPreviousMonth(startingMonth, options) {
|
|
|
13141
13142
|
* The Navigation context shares details and methods to navigate the months in DayPicker.
|
|
13142
13143
|
* Access this context from the {@link useNavigation} hook.
|
|
13143
13144
|
*/
|
|
13144
|
-
var NavigationContext
|
|
13145
|
+
var NavigationContext = createContext(undefined);
|
|
13145
13146
|
/** Provides the values for the {@link NavigationContext}. */
|
|
13146
13147
|
function NavigationProvider(props) {
|
|
13147
13148
|
var dayPicker = useDayPicker();
|
|
@@ -13174,7 +13175,7 @@ function NavigationProvider(props) {
|
|
|
13174
13175
|
nextMonth: nextMonth,
|
|
13175
13176
|
isDateDisplayed: isDateDisplayed
|
|
13176
13177
|
};
|
|
13177
|
-
return (React__default.createElement(NavigationContext
|
|
13178
|
+
return (React__default.createElement(NavigationContext.Provider, { value: value }, props.children));
|
|
13178
13179
|
}
|
|
13179
13180
|
/**
|
|
13180
13181
|
* Hook to access the {@link NavigationContextValue}. Use this hook to navigate
|
|
@@ -13183,7 +13184,7 @@ function NavigationProvider(props) {
|
|
|
13183
13184
|
* This hook is meant to be used inside internal or custom components.
|
|
13184
13185
|
*/
|
|
13185
13186
|
function useNavigation() {
|
|
13186
|
-
var context = useContext(NavigationContext
|
|
13187
|
+
var context = useContext(NavigationContext);
|
|
13187
13188
|
if (!context) {
|
|
13188
13189
|
throw new Error('useNavigation must be used within a NavigationProvider');
|
|
13189
13190
|
}
|
|
@@ -37210,96 +37211,8 @@ const Pagination = ({ previousPage, nextPage, canPreviousPage, canNextPage, page
|
|
|
37210
37211
|
: page !== undefined && pageCount !== undefined && pageCount !== null && page >= pageCount - 1, "data-testid": "next-page", icon: jsx(Icon, { name: "ChevronRightIcon", size: "small" }), size: "small", color: "secondary", variant: "transparent" })] }));
|
|
37211
37212
|
};
|
|
37212
37213
|
|
|
37213
|
-
/**
|
|
37214
|
-
* React Router v6.11.2
|
|
37215
|
-
*
|
|
37216
|
-
* Copyright (c) Remix Software Inc.
|
|
37217
|
-
*
|
|
37218
|
-
* This source code is licensed under the MIT license found in the
|
|
37219
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
37220
|
-
*
|
|
37221
|
-
* @license MIT
|
|
37222
|
-
*/
|
|
37223
|
-
|
|
37224
|
-
const DataRouterContext = /*#__PURE__*/React.createContext(null);
|
|
37225
|
-
|
|
37226
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37227
|
-
DataRouterContext.displayName = "DataRouter";
|
|
37228
|
-
}
|
|
37229
|
-
|
|
37230
|
-
const DataRouterStateContext = /*#__PURE__*/React.createContext(null);
|
|
37231
|
-
|
|
37232
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37233
|
-
DataRouterStateContext.displayName = "DataRouterState";
|
|
37234
|
-
}
|
|
37235
|
-
|
|
37236
|
-
const AwaitContext = /*#__PURE__*/React.createContext(null);
|
|
37237
|
-
|
|
37238
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37239
|
-
AwaitContext.displayName = "Await";
|
|
37240
|
-
}
|
|
37241
|
-
|
|
37242
|
-
const NavigationContext = /*#__PURE__*/React.createContext(null);
|
|
37243
|
-
|
|
37244
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37245
|
-
NavigationContext.displayName = "Navigation";
|
|
37246
|
-
}
|
|
37247
|
-
|
|
37248
|
-
const LocationContext = /*#__PURE__*/React.createContext(null);
|
|
37249
|
-
|
|
37250
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37251
|
-
LocationContext.displayName = "Location";
|
|
37252
|
-
}
|
|
37253
|
-
|
|
37254
|
-
const RouteContext = /*#__PURE__*/React.createContext({
|
|
37255
|
-
outlet: null,
|
|
37256
|
-
matches: [],
|
|
37257
|
-
isDataRoute: false
|
|
37258
|
-
});
|
|
37259
|
-
|
|
37260
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37261
|
-
RouteContext.displayName = "Route";
|
|
37262
|
-
}
|
|
37263
|
-
|
|
37264
|
-
const RouteErrorContext = /*#__PURE__*/React.createContext(null);
|
|
37265
|
-
|
|
37266
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37267
|
-
RouteErrorContext.displayName = "RouteError";
|
|
37268
|
-
}
|
|
37269
|
-
var DataRouterHook;
|
|
37270
|
-
|
|
37271
|
-
(function (DataRouterHook) {
|
|
37272
|
-
DataRouterHook["UseBlocker"] = "useBlocker";
|
|
37273
|
-
DataRouterHook["UseRevalidator"] = "useRevalidator";
|
|
37274
|
-
DataRouterHook["UseNavigateStable"] = "useNavigate";
|
|
37275
|
-
})(DataRouterHook || (DataRouterHook = {}));
|
|
37276
|
-
|
|
37277
|
-
var DataRouterStateHook;
|
|
37278
|
-
|
|
37279
|
-
(function (DataRouterStateHook) {
|
|
37280
|
-
DataRouterStateHook["UseBlocker"] = "useBlocker";
|
|
37281
|
-
DataRouterStateHook["UseLoaderData"] = "useLoaderData";
|
|
37282
|
-
DataRouterStateHook["UseActionData"] = "useActionData";
|
|
37283
|
-
DataRouterStateHook["UseRouteError"] = "useRouteError";
|
|
37284
|
-
DataRouterStateHook["UseNavigation"] = "useNavigation";
|
|
37285
|
-
DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData";
|
|
37286
|
-
DataRouterStateHook["UseMatches"] = "useMatches";
|
|
37287
|
-
DataRouterStateHook["UseRevalidator"] = "useRevalidator";
|
|
37288
|
-
DataRouterStateHook["UseNavigateStable"] = "useNavigate";
|
|
37289
|
-
DataRouterStateHook["UseRouteId"] = "useRouteId";
|
|
37290
|
-
})(DataRouterStateHook || (DataRouterStateHook = {}));
|
|
37291
|
-
var AwaitRenderStatus;
|
|
37292
|
-
|
|
37293
|
-
(function (AwaitRenderStatus) {
|
|
37294
|
-
AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending";
|
|
37295
|
-
AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success";
|
|
37296
|
-
AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error";
|
|
37297
|
-
})(AwaitRenderStatus || (AwaitRenderStatus = {}));
|
|
37298
|
-
|
|
37299
|
-
new Promise(() => {});
|
|
37300
|
-
|
|
37301
37214
|
function useConfirmExit(confirmExit, when = true) {
|
|
37302
|
-
const { navigator } = useContext(
|
|
37215
|
+
const { navigator } = useContext(UNSAFE_NavigationContext);
|
|
37303
37216
|
useEffect(() => {
|
|
37304
37217
|
if (!when) {
|
|
37305
37218
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.128",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@floating-ui/react": "0.22.2",
|
|
11
|
-
"@trackunit/css-class-variance-utilities": "0.0.
|
|
12
|
-
"@trackunit/css-core": "0.0.
|
|
11
|
+
"@trackunit/css-class-variance-utilities": "0.0.8",
|
|
12
|
+
"@trackunit/css-core": "0.0.89",
|
|
13
13
|
"@trackunit/tailwind-styled-components": "0.0.58",
|
|
14
|
-
"@trackunit/ui-design-tokens": "0.0.
|
|
15
|
-
"@trackunit/ui-icons": "0.0.
|
|
14
|
+
"@trackunit/ui-design-tokens": "0.0.73",
|
|
15
|
+
"@trackunit/ui-icons": "0.0.70",
|
|
16
16
|
"date-fns": "2.29.3",
|
|
17
17
|
"lodash": "4.17.21",
|
|
18
18
|
"react": "18.2.0",
|