@kubit-ui-web/react-components 2.0.0-beta.51 → 2.0.0-beta.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @kubit-ui-web/react-components
2
2
 
3
+ ## 2.0.0-beta.53
4
+
5
+ ### Major Changes
6
+
7
+ - Include borderRadius prop to skeleton (#62)
8
+
9
+ ## 2.0.0-beta.52
10
+
11
+ ### Major Changes
12
+
13
+ - Create isOnlyDesktop (#61)
14
+
3
15
  ## 2.0.0-beta.51
4
16
 
5
17
  ### Major Changes
@@ -1 +1 @@
1
- const e=require(`../../../lib/types/breakpoints/breakpoints.js`);exports.onlyDesktopSize=(t,n)=>e.DeviceBreakpointsTypeUtils.isDesktopOrLargeDesktop(t)?n:void 0;
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(`../../lib/hooks/useClassName/useClassName.js`),t=require(`./skeletonStandAlone.js`);let n=require(`react`),r=require(`react/jsx-runtime`);const i=(0,n.forwardRef)(({additionalClasses:n,additionalShapeClasses:i,shapeVariant:a,variant:o,...s},c)=>{let l=e.useClassName({component:`SKELETON`,variant:o}),u=e.useClassName({component:`SKELETON`,variant:a});return(0,r.jsx)(t.SkeletonStandAlone,{...s,ref:c,cssClasses:l,cssShapeClasses:u,shapeVariant:o})});exports.Skeleton=i;
1
+ const e=require(`../../lib/hooks/useClassName/useClassName.js`),t=require(`./skeletonStandAlone.js`);let n=require(`react`),r=require(`react/jsx-runtime`);const i=(0,n.forwardRef)(({additionalClasses:n,additionalShapeClasses:i,shapeVariant:a,variant:o,...s},c)=>{let l=e.useClassName({additionalClassNames:n,component:`SKELETON`,variant:o}),u=e.useClassName({additionalClassNames:i,component:`SKELETON`,variant:a});return(0,r.jsx)(t.SkeletonStandAlone,{...s,ref:c,cssClasses:l,cssShapeClasses:u,shapeVariant:o})});exports.Skeleton=i;
@@ -1 +1 @@
1
- const e=require(`../../lib/utils/pickCustomAttributes/pickCustomAttributes.js`),t=require(`../../lib/utils/classNames/classNames.js`);;/* empty css */let n=require(`react`),r=require(`react/jsx-runtime`);const i=(0,n.forwardRef)(({cssClasses:n,cssShapeClasses:i,duration:a=`1.2s`,height:o,width:s,...c},l)=>{let u=e.pickCustomAttributes(c);return(0,r.jsx)(`div`,{ref:l,className:t.classNames(`kbt-skeleton`,n?.skeleton,i?.skeleton),"data-testid":`skeleton`,style:{"--skeleton-duration":a,"--skeleton-height":o,"--skeleton-width":s},...u})});exports.SkeletonStandAlone=i;
1
+ const e=require(`../../lib/utils/pickCustomAttributes/pickCustomAttributes.js`),t=require(`../../lib/utils/classNames/classNames.js`);;/* empty css */let n=require(`react`),r=require(`react/jsx-runtime`);const i=(0,n.forwardRef)(({borderRadius:i=``,cssClasses:a,cssShapeClasses:o,duration:s=`1.2s`,height:c=`20px`,width:l=`100%`,...u},d)=>{let f=e.pickCustomAttributes(u),p=(0,n.useMemo)(()=>a?.dynamic_values({$skeletonBorderRadius:i,$skeletonDuration:s,$skeletonHeight:c,$skeletonWidth:l}).object,[c,l,i,s]);return(0,r.jsx)(`div`,{ref:d,className:t.classNames(`kbt-skeleton`,a?.skeleton,o?.skeleton),"data-testid":`skeleton`,style:p,...f})});exports.SkeletonStandAlone=i;
@@ -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),isDesktopOrLargeDesktop:e.DeviceBreakpointsTypeUtils.isDesktopOrLargeDesktop(n),isLargeDesktop:e.DeviceBreakpointsTypeUtils.isLargeDesktop(n),isMobile:e.DeviceBreakpointsTypeUtils.isMobile(n),isMobileOrTablet:e.DeviceBreakpointsTypeUtils.isMobileOrTablet(n),isTablet:e.DeviceBreakpointsTypeUtils.isTablet(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:t=>t===e.DESKTOP,isDesktopOrLargeDesktop:e=>t.isDesktop(e)||t.isLargeDesktop(e),isLargeDesktop:t=>t===e.LARGE_DESKTOP,isMobile:t=>t===e.MOBILE,isMobileOrTablet:e=>t.isMobile(e)||t.isTablet(e),isTablet:t=>t===e.TABLET};exports.DEVICE_BREAKPOINTS=e,exports.DeviceBreakpointsTypeUtils=t;
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.isDesktopOrLargeDesktop(e) ? t : void 0;
2
+ const onlyDesktopSize = (e, t) => DeviceBreakpointsTypeUtils.isDesktop(e) ? t : void 0;
3
3
  export { onlyDesktopSize };
@@ -4,9 +4,11 @@ import { forwardRef } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  const Skeleton = forwardRef(({ additionalClasses: e, additionalShapeClasses: t, shapeVariant: n, variant: r, ...i }, a) => {
6
6
  let o = useClassName({
7
+ additionalClassNames: e,
7
8
  component: "SKELETON",
8
9
  variant: r
9
10
  }), s = useClassName({
11
+ additionalClassNames: t,
10
12
  component: "SKELETON",
11
13
  variant: n
12
14
  });
@@ -1,20 +1,26 @@
1
1
  import { pickCustomAttributes } from "../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";
2
2
  import { classNames } from "../../lib/utils/classNames/classNames.js";
3
3
  /* empty css */
4
- import { forwardRef } from "react";
4
+ import { forwardRef, useMemo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
- const SkeletonStandAlone = forwardRef(({ cssClasses: e, cssShapeClasses: t, duration: n = "1.2s", height: r, width: i, ...a }, o) => {
7
- let s = pickCustomAttributes(a);
6
+ const SkeletonStandAlone = forwardRef(({ borderRadius: e = "", cssClasses: t, cssShapeClasses: n, duration: r = "1.2s", height: i = "20px", width: a = "100%", ...o }, s) => {
7
+ let c = pickCustomAttributes(o), l = useMemo(() => t?.dynamic_values({
8
+ $skeletonBorderRadius: e,
9
+ $skeletonDuration: r,
10
+ $skeletonHeight: i,
11
+ $skeletonWidth: a
12
+ }).object, [
13
+ i,
14
+ a,
15
+ e,
16
+ r
17
+ ]);
8
18
  return /* @__PURE__ */ jsx("div", {
9
- ref: o,
10
- className: classNames("kbt-skeleton", e?.skeleton, t?.skeleton),
19
+ ref: s,
20
+ className: classNames("kbt-skeleton", t?.skeleton, n?.skeleton),
11
21
  "data-testid": "skeleton",
12
- style: {
13
- "--skeleton-duration": n,
14
- "--skeleton-height": r,
15
- "--skeleton-width": i
16
- },
17
- ...s
22
+ style: l,
23
+ ...c
18
24
  });
19
25
  });
20
26
  export { SkeletonStandAlone };
@@ -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: (t) => t === DEVICE_BREAKPOINTS.DESKTOP,
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 };
@@ -1841,6 +1841,15 @@ declare type ComponentsTypesComponents = {
1841
1841
  $_default: {
1842
1842
  skeleton: string;
1843
1843
  };
1844
+ dynamic_values: (styles: {
1845
+ $skeletonWidth: string;
1846
+ $skeletonHeight: string;
1847
+ $skeletonBorderRadius: string;
1848
+ $skeletonDuration: string;
1849
+ }) => {
1850
+ string: string;
1851
+ object: object;
1852
+ };
1844
1853
  };
1845
1854
  SLIDER: {
1846
1855
  slider: string;
@@ -3196,10 +3205,6 @@ export declare const DeviceBreakpointsTypeUtils: {
3196
3205
  * Returns true if the device is a desktop device.
3197
3206
  */
3198
3207
  isDesktop: (device: DeviceBreakpointsType) => boolean;
3199
- /**
3200
- * Returns true if the device is either desktop or large desktop.
3201
- */
3202
- isDesktopOrLargeDesktop: (device: DeviceBreakpointsType) => boolean;
3203
3208
  /**
3204
3209
  * Returns true if the device is a large desktop device.
3205
3210
  */
@@ -3212,6 +3217,10 @@ export declare const DeviceBreakpointsTypeUtils: {
3212
3217
  * Returns true if the device is either mobile or tablet.
3213
3218
  */
3214
3219
  isMobileOrTablet: (device: DeviceBreakpointsType) => boolean;
3220
+ /**
3221
+ * Returns true if the device is either desktop or large desktop.
3222
+ */
3223
+ isOnlyDesktop: (device: DeviceBreakpointsType) => boolean;
3215
3224
  /**
3216
3225
  * Returns true if the device is a tablet device.
3217
3226
  */
@@ -5528,8 +5537,8 @@ declare type SkeletonCssClasses = ComponentSelected<ComponentsTypesComponents['S
5528
5537
  */
5529
5538
  export declare interface SkeletonProps<Variant = undefined extends string ? unknown : string> extends SkeletonStandAloneProps {
5530
5539
  variant?: Variant;
5531
- additionalClasses?: string;
5532
- additionalShapeClasses?: string;
5540
+ additionalClasses?: Partial<SkeletonCssClasses>;
5541
+ additionalShapeClasses?: Partial<SkeletonCssClasses>;
5533
5542
  }
5534
5543
 
5535
5544
  export declare type SkeletonShapeStyles<Shape extends string> = CssLibPropsType & {
@@ -5543,6 +5552,7 @@ export declare type SkeletonShapeStyles<Shape extends string> = CssLibPropsType
5543
5552
  export declare interface SkeletonStandAloneProps extends SkeletonAriaProps, DataAttributes {
5544
5553
  width?: string;
5545
5554
  height?: string;
5555
+ borderRadius?: string;
5546
5556
  duration?: string;
5547
5557
  cssClasses?: SkeletonCssClasses;
5548
5558
  shapeVariant?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubit-ui-web/react-components",
3
- "version": "2.0.0-beta.51",
3
+ "version": "2.0.0-beta.53",
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.8"
174
+ "@kubit-ui-web/design-system": "2.0.0-beta.12"
175
175
  },
176
176
  "publishConfig": {
177
177
  "access": "public",