@kubit-ui-web/react-components 2.0.0-beta.51 → 2.0.0-beta.52
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/CHANGELOG.md +6 -0
- package/dist/cjs/components/modal/utils/onlyDesktopSize.js +1 -1
- package/dist/cjs/lib/hooks/useMediaDevice/useActiveBreakpoints.js +1 -1
- package/dist/cjs/lib/types/breakpoints/breakpoints.js +1 -1
- package/dist/esm/components/modal/utils/onlyDesktopSize.js +1 -1
- package/dist/esm/lib/hooks/useMediaDevice/useActiveBreakpoints.js +1 -1
- package/dist/esm/lib/types/breakpoints/breakpoints.js +2 -2
- package/dist/types/index.d.ts +4 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../lib/types/breakpoints/breakpoints.js`);exports.onlyDesktopSize=(t,n)=>e.DeviceBreakpointsTypeUtils.
|
|
1
|
+
const e=require(`../../../lib/types/breakpoints/breakpoints.js`);exports.onlyDesktopSize=(t,n)=>e.DeviceBreakpointsTypeUtils.isDesktop(t)?n:void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../types/breakpoints/breakpoints.js`),t=require(`./useMediaDevice.js`);exports.useActiveBreakpoints=()=>{let n=t.useMediaDevice();return{device:n,isDesktop:e.DeviceBreakpointsTypeUtils.isDesktop(n),
|
|
1
|
+
const e=require(`../../types/breakpoints/breakpoints.js`),t=require(`./useMediaDevice.js`);exports.useActiveBreakpoints=()=>{let n=t.useMediaDevice();return{device:n,isDesktop:e.DeviceBreakpointsTypeUtils.isDesktop(n),isLargeDesktop:e.DeviceBreakpointsTypeUtils.isLargeDesktop(n),isMobile:e.DeviceBreakpointsTypeUtils.isMobile(n),isMobileOrTablet:e.DeviceBreakpointsTypeUtils.isMobileOrTablet(n),isOnlyDesktop:e.DeviceBreakpointsTypeUtils.isOnlyDesktop(n),isTablet:e.DeviceBreakpointsTypeUtils.isTablet(n)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={DESKTOP:`desktop`,LARGE_DESKTOP:`large_desktop`,MOBILE:`mobile`,TABLET:`tablet`},t={isDesktop:
|
|
1
|
+
const e={DESKTOP:`desktop`,LARGE_DESKTOP:`large_desktop`,MOBILE:`mobile`,TABLET:`tablet`},t={isDesktop:n=>n===e.DESKTOP||t.isLargeDesktop(n),isLargeDesktop:t=>t===e.LARGE_DESKTOP,isMobile:t=>t===e.MOBILE,isMobileOrTablet:e=>t.isMobile(e)||t.isTablet(e),isOnlyDesktop:t=>t===e.DESKTOP,isTablet:t=>t===e.TABLET};exports.DEVICE_BREAKPOINTS=e,exports.DeviceBreakpointsTypeUtils=t;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DeviceBreakpointsTypeUtils } from "../../../lib/types/breakpoints/breakpoints.js";
|
|
2
|
-
const onlyDesktopSize = (e, t) => DeviceBreakpointsTypeUtils.
|
|
2
|
+
const onlyDesktopSize = (e, t) => DeviceBreakpointsTypeUtils.isDesktop(e) ? t : void 0;
|
|
3
3
|
export { onlyDesktopSize };
|
|
@@ -5,10 +5,10 @@ const useActiveBreakpoints = () => {
|
|
|
5
5
|
return {
|
|
6
6
|
device: e,
|
|
7
7
|
isDesktop: DeviceBreakpointsTypeUtils.isDesktop(e),
|
|
8
|
-
isDesktopOrLargeDesktop: DeviceBreakpointsTypeUtils.isDesktopOrLargeDesktop(e),
|
|
9
8
|
isLargeDesktop: DeviceBreakpointsTypeUtils.isLargeDesktop(e),
|
|
10
9
|
isMobile: DeviceBreakpointsTypeUtils.isMobile(e),
|
|
11
10
|
isMobileOrTablet: DeviceBreakpointsTypeUtils.isMobileOrTablet(e),
|
|
11
|
+
isOnlyDesktop: DeviceBreakpointsTypeUtils.isOnlyDesktop(e),
|
|
12
12
|
isTablet: DeviceBreakpointsTypeUtils.isTablet(e)
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -4,11 +4,11 @@ const DEVICE_BREAKPOINTS = {
|
|
|
4
4
|
MOBILE: "mobile",
|
|
5
5
|
TABLET: "tablet"
|
|
6
6
|
}, DeviceBreakpointsTypeUtils = {
|
|
7
|
-
isDesktop: (
|
|
8
|
-
isDesktopOrLargeDesktop: (e) => DeviceBreakpointsTypeUtils.isDesktop(e) || DeviceBreakpointsTypeUtils.isLargeDesktop(e),
|
|
7
|
+
isDesktop: (n) => n === DEVICE_BREAKPOINTS.DESKTOP || DeviceBreakpointsTypeUtils.isLargeDesktop(n),
|
|
9
8
|
isLargeDesktop: (t) => t === DEVICE_BREAKPOINTS.LARGE_DESKTOP,
|
|
10
9
|
isMobile: (t) => t === DEVICE_BREAKPOINTS.MOBILE,
|
|
11
10
|
isMobileOrTablet: (e) => DeviceBreakpointsTypeUtils.isMobile(e) || DeviceBreakpointsTypeUtils.isTablet(e),
|
|
11
|
+
isOnlyDesktop: (t) => t === DEVICE_BREAKPOINTS.DESKTOP,
|
|
12
12
|
isTablet: (t) => t === DEVICE_BREAKPOINTS.TABLET
|
|
13
13
|
};
|
|
14
14
|
export { DEVICE_BREAKPOINTS, DeviceBreakpointsTypeUtils };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3196,10 +3196,6 @@ export declare const DeviceBreakpointsTypeUtils: {
|
|
|
3196
3196
|
* Returns true if the device is a desktop device.
|
|
3197
3197
|
*/
|
|
3198
3198
|
isDesktop: (device: DeviceBreakpointsType) => boolean;
|
|
3199
|
-
/**
|
|
3200
|
-
* Returns true if the device is either desktop or large desktop.
|
|
3201
|
-
*/
|
|
3202
|
-
isDesktopOrLargeDesktop: (device: DeviceBreakpointsType) => boolean;
|
|
3203
3199
|
/**
|
|
3204
3200
|
* Returns true if the device is a large desktop device.
|
|
3205
3201
|
*/
|
|
@@ -3212,6 +3208,10 @@ export declare const DeviceBreakpointsTypeUtils: {
|
|
|
3212
3208
|
* Returns true if the device is either mobile or tablet.
|
|
3213
3209
|
*/
|
|
3214
3210
|
isMobileOrTablet: (device: DeviceBreakpointsType) => boolean;
|
|
3211
|
+
/**
|
|
3212
|
+
* Returns true if the device is either desktop or large desktop.
|
|
3213
|
+
*/
|
|
3214
|
+
isOnlyDesktop: (device: DeviceBreakpointsType) => boolean;
|
|
3215
3215
|
/**
|
|
3216
3216
|
* Returns true if the device is a tablet device.
|
|
3217
3217
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubit-ui-web/react-components",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.52",
|
|
4
4
|
"description": "Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kubit",
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"vite-plugin-dts": "^4.5.4",
|
|
172
172
|
"vitest": "^4.0.18",
|
|
173
173
|
"vitest-axe": "^0.1.0",
|
|
174
|
-
"@kubit-ui-web/design-system": "2.0.0-beta.
|
|
174
|
+
"@kubit-ui-web/design-system": "2.0.0-beta.11"
|
|
175
175
|
},
|
|
176
176
|
"publishConfig": {
|
|
177
177
|
"access": "public",
|