@trackunit/react-components 0.1.178 → 0.1.180
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 +18 -1
- package/index.esm.js +18 -2
- package/package.json +4 -4
- package/src/hooks/index.d.ts +1 -0
- package/src/hooks/useIsFullScreen.d.ts +4 -0
package/index.cjs.js
CHANGED
|
@@ -14912,7 +14912,7 @@ const localeLookup = {
|
|
|
14912
14912
|
* @returns {Locale} The corresponding Locale object
|
|
14913
14913
|
*/
|
|
14914
14914
|
const useLocale = (language) => {
|
|
14915
|
-
return localeLookup[language] || localeLookup.en;
|
|
14915
|
+
return localeLookup[language] || localeLookup.en || enGB;
|
|
14916
14916
|
};
|
|
14917
14917
|
|
|
14918
14918
|
/**
|
|
@@ -39194,6 +39194,22 @@ const useIsFirstRender = () => {
|
|
|
39194
39194
|
return renderRef.current;
|
|
39195
39195
|
};
|
|
39196
39196
|
|
|
39197
|
+
/**
|
|
39198
|
+
* Custom hook for checking if the browser is in fullscreen mode.
|
|
39199
|
+
*/
|
|
39200
|
+
const useIsFullscreen = () => {
|
|
39201
|
+
const [isFullScreen, setIsFullScreen] = React.useState(false);
|
|
39202
|
+
document.addEventListener("fullscreenchange", () => {
|
|
39203
|
+
if (document.fullscreenElement) {
|
|
39204
|
+
setIsFullScreen(true);
|
|
39205
|
+
}
|
|
39206
|
+
else {
|
|
39207
|
+
setIsFullScreen(false);
|
|
39208
|
+
}
|
|
39209
|
+
});
|
|
39210
|
+
return isFullScreen;
|
|
39211
|
+
};
|
|
39212
|
+
|
|
39197
39213
|
/**
|
|
39198
39214
|
* Check if text is cut off.
|
|
39199
39215
|
*
|
|
@@ -39338,6 +39354,7 @@ exports.useDebounce = useDebounce;
|
|
|
39338
39354
|
exports.useDevicePixelRatio = useDevicePixelRatio;
|
|
39339
39355
|
exports.useHover = useHover;
|
|
39340
39356
|
exports.useIsFirstRender = useIsFirstRender;
|
|
39357
|
+
exports.useIsFullscreen = useIsFullscreen;
|
|
39341
39358
|
exports.useIsTextCutOff = useIsTextCutOff;
|
|
39342
39359
|
exports.useLocalStorage = useLocalStorage;
|
|
39343
39360
|
exports.useLocalStorageReducer = useLocalStorageReducer;
|
package/index.esm.js
CHANGED
|
@@ -14883,7 +14883,7 @@ const localeLookup = {
|
|
|
14883
14883
|
* @returns {Locale} The corresponding Locale object
|
|
14884
14884
|
*/
|
|
14885
14885
|
const useLocale = (language) => {
|
|
14886
|
-
return localeLookup[language] || localeLookup.en;
|
|
14886
|
+
return localeLookup[language] || localeLookup.en || enGB;
|
|
14887
14887
|
};
|
|
14888
14888
|
|
|
14889
14889
|
/**
|
|
@@ -39165,6 +39165,22 @@ const useIsFirstRender = () => {
|
|
|
39165
39165
|
return renderRef.current;
|
|
39166
39166
|
};
|
|
39167
39167
|
|
|
39168
|
+
/**
|
|
39169
|
+
* Custom hook for checking if the browser is in fullscreen mode.
|
|
39170
|
+
*/
|
|
39171
|
+
const useIsFullscreen = () => {
|
|
39172
|
+
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
39173
|
+
document.addEventListener("fullscreenchange", () => {
|
|
39174
|
+
if (document.fullscreenElement) {
|
|
39175
|
+
setIsFullScreen(true);
|
|
39176
|
+
}
|
|
39177
|
+
else {
|
|
39178
|
+
setIsFullScreen(false);
|
|
39179
|
+
}
|
|
39180
|
+
});
|
|
39181
|
+
return isFullScreen;
|
|
39182
|
+
};
|
|
39183
|
+
|
|
39168
39184
|
/**
|
|
39169
39185
|
* Check if text is cut off.
|
|
39170
39186
|
*
|
|
@@ -39236,4 +39252,4 @@ const useVisibilityChange = ({ onChange, targetState }) => {
|
|
|
39236
39252
|
}, [onChange, targetState]);
|
|
39237
39253
|
};
|
|
39238
39254
|
|
|
39239
|
-
export { Alert, Badge, Button$1 as Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, PackageNameStoryComponent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text, Timeline, TimelineElement, Tip, Tooltip, ValueBar, WidgetBody, cvaButton, cvaButtonSpinner, cvaClickable, cvaIconButtonContainer, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useHover, useIsFirstRender, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, usePopoverContext, usePrompt, useResize, useTimeout, useVisibilityChange };
|
|
39255
|
+
export { Alert, Badge, Button$1 as Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, PackageNameStoryComponent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text, Timeline, TimelineElement, Tip, Tooltip, ValueBar, WidgetBody, cvaButton, cvaButtonSpinner, cvaClickable, cvaIconButtonContainer, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useHover, useIsFirstRender, useIsFullscreen, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, usePopoverContext, usePrompt, useResize, useTimeout, useVisibilityChange };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.180",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@floating-ui/react": "0.25.4",
|
|
11
11
|
"@trackunit/css-class-variance-utilities": "0.0.14",
|
|
12
|
-
"@trackunit/css-core": "0.0.
|
|
13
|
-
"@trackunit/shared-utils": "0.0.
|
|
14
|
-
"@trackunit/ui-design-tokens": "0.0.
|
|
12
|
+
"@trackunit/css-core": "0.0.98",
|
|
13
|
+
"@trackunit/shared-utils": "0.0.12",
|
|
14
|
+
"@trackunit/ui-design-tokens": "0.0.79",
|
|
15
15
|
"@trackunit/ui-icons": "0.0.78",
|
|
16
16
|
"date-fns": "2.29.3",
|
|
17
17
|
"lodash": "4.17.21",
|
package/src/hooks/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./useDebounce";
|
|
|
7
7
|
export * from "./useDevicePixelRatio";
|
|
8
8
|
export * from "./useHover";
|
|
9
9
|
export * from "./useIsFirstRender";
|
|
10
|
+
export * from "./useIsFullScreen";
|
|
10
11
|
export * from "./useIsTextCutOff";
|
|
11
12
|
export * from "./useResize";
|
|
12
13
|
export * from "./useTimeout";
|