@kubit-ui-web/react-components 2.0.0-beta.29 → 2.0.0-beta.30
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/dist/cjs/components/badge/badgeStandAlone.js +1 -1
- package/dist/cjs/components/carousel/carouselStandAlone.js +1 -1
- package/dist/cjs/components/checkbox/checkboxStandAlone.js +1 -1
- package/dist/cjs/components/icon/icon.js +1 -1
- package/dist/cjs/components/stepperNumber/stepperNumberStandAlone.js +1 -1
- package/dist/cjs/components/textArea/components/textCount/textCountStandAlone.js +1 -1
- package/dist/cjs/lib/components/screen-reader-only/screenReaderOnly.js +1 -0
- package/dist/cjs/lib/components/screen-reader-only/screenReaderOnlyStandAlone.js +1 -0
- package/dist/cjs/lib/hooks/useSwipeDown/useSwipeDown.js +1 -1
- package/dist/esm/components/badge/badgeStandAlone.js +4 -4
- package/dist/esm/components/carousel/carouselStandAlone.js +2 -2
- package/dist/esm/components/checkbox/checkboxStandAlone.js +4 -4
- package/dist/esm/components/icon/icon.js +1 -1
- package/dist/esm/components/stepperNumber/stepperNumberStandAlone.js +3 -3
- package/dist/esm/components/textArea/components/textCount/textCountStandAlone.js +5 -5
- package/dist/esm/lib/components/screen-reader-only/screenReaderOnly.js +1 -0
- package/dist/esm/lib/components/screen-reader-only/screenReaderOnlyStandAlone.js +1 -0
- package/dist/esm/lib/hooks/useSwipeDown/useSwipeDown.js +1 -1
- package/dist/types/index.d.ts +6 -3
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),t=require("../text/text2.js"),s=require("../../lib/utils/process/processCommonProp.js"),
|
|
1
|
+
const e=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),t=require("../text/text2.js"),s=require("../../lib/utils/process/processCommonProp.js"),r=require("../dot/dot.js"),a=require("../../lib/components/screen-reader-only/screenReaderOnly.js"),n=require("../../lib/components/elementOrIcon/elementOrIcon.js");let o=require("react"),i=require("react/jsx-runtime");const c=(0,o.forwardRef)(({active:c,ariaLiveText:l,cssSizeClasses:u,cssVariantClasses:d,dot:b,hasDot:m,icon:p,label:x,labelIcon:j,onBadgeBlur:C,onClick:h,role:A,...k},q)=>{const I=(0,o.useRef)(null),g=(0,o.useRef)(null),N={"data-active":!!c},$=e.pickCustomAttributes({...k,customAttributes:N}),f=e.pickCustomAttributes(N),v=$["data-testid"]||"badge";(0,o.useImperativeHandle)(q,()=>g.current,[]);const O=(0,o.useCallback)(e=>{C?.(e)},[C]),R=(0,o.useCallback)(e=>{h?.(e)},[h]);return(0,i.jsx)("div",{ref:g,className:`${d?.badge} ${u?.badge}`,"data-testid":`${v}-container`,...f,children:(0,i.jsxs)("button",{ref:I,className:d?.button,"data-testid":v,role:A,type:"button",onBlur:O,onClick:R,...$,children:[(0,i.jsxs)("span",{className:d?.dotcontainer,children:[!!b&&!!m&&(0,i.jsx)("span",{"aria-hidden":!0,className:d?.dot,children:(0,i.jsx)(r.Dot,{...b})}),(0,i.jsx)(n.ElementOrIcon,{className:`${d?.icon} ${u?.icon}`,...s.processIconProp(p),customAttributes:N})]}),!!x&&(0,i.jsxs)("span",{"aria-hidden":!0,className:d?.labelcontainer,children:[(0,i.jsx)(t.Text,{additionalClasses:{text:`${u?.label} ${d?.label}`},component:"span",...s.processTextProp(x),customAttributes:N}),(0,i.jsx)(n.ElementOrIcon,{className:d?.labelicon,rotate:c?"180deg":"0deg",transitionDuration:"0.2s",...s.processIconProp(j),customAttributes:N})]}),(0,i.jsx)(a.ScreenReaderOnly,{ariaLive:"polite",children:l})]})})});exports.BadgeStandAlone=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require("../../lib/components/screen-reader-only/screenReaderOnly.js");let r=require("react"),t=require("react/jsx-runtime");const a=(0,r.forwardRef)(({allowModifySliceWidth:r,centerMode:a,contentContainer:n,contentContainerRef:i,cssClasses:s,disabled:d,elements:o,rootContainer:c,screenReaderOnly:l,viewerContainer:f,viewerContainerRef:u,...v},m)=>{const w=v["data-testid"]??"carousel";return(0,t.jsxs)("div",{ref:m,"aria-roledescription":"carousel",className:s?.carousel,"data-testid":w,...v,...c,children:[(0,t.jsx)("div",{ref:u,className:s?.viewer,"data-allow-modify-slice-width":r,"data-disabled":d,"data-testid":`${w}-viewer`,...f,children:(0,t.jsx)("div",{ref:i,"aria-live":"polite",className:s?.content,"data-center-mode":a,"data-testid":`${w}-content`,...n,children:o})}),l&&(0,t.jsx)(e.ScreenReaderOnly,{ariaLive:"off",...l,children:l.content})]})});exports.CarouselStandAlone=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),r=require("../../lib/utils/process/processCommonProp.js"),s=require("../checkboxBase/checkboxBaseControlled.js"),
|
|
1
|
+
const e=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),r=require("../../lib/utils/process/processCommonProp.js"),s=require("../../lib/components/screen-reader-only/screenReaderOnly.js"),a=require("../checkboxBase/checkboxBaseControlled.js"),i=require("./components/errorMessage.js"),l=require("./components/label.js"),c=require("./utils/aria.utils.js");let d=require("react"),o=require("react/jsx-runtime");const t=(0,d.forwardRef)(({checkboxBase:t,cssClasses:n,errorMessage:b,id:u,label:x,screenReaderText:h,...p},j)=>{const{"aria-describedby":m,"aria-hidden":k,"aria-label":y,"aria-labelledby":C,...q}=e.pickCustomAttributes(p),g=`checkbox-${(0,d.useId)().replace(/:/g,"")}`,v=u??g,B=`${v}-label`,R=`${v}-error`,A=`${v}-screen-reader`,I=t?.variant,$=c.buildAriaDescribedBy({ariaDescribedBy:p["aria-describedby"],error:p.error&&!!b?.message,errorMessageId:R,screenReader:!!h,screenReaderId:A});return(0,o.jsxs)("div",{ref:j,...q,className:n?.checkbox,children:[(0,o.jsxs)("div",{className:n?.checkboxwithlabelcontainer,children:[!!I&&(0,o.jsx)(a.CheckboxBaseControlled,{...p,"aria-describedby":$,"aria-hidden":p["aria-hidden"],"aria-label":p["aria-label"],"aria-labelledby":p["aria-labelledby"],id:v,variant:I}),(0,o.jsx)(s.ScreenReaderOnly,{id:A,children:h}),(0,o.jsx)(l.Label,{content:r.processTextProp(x).children,cssClasses:n,id:B,inputId:v})]}),!!p.error&&(0,o.jsx)(i.ErrorMessage,{"aria-live":"assertive",cssClasses:n,"data-testid":`${p["data-testid"]}-error-message`,...b,id:R,inputId:v,show:p.error&&!p.disabled})]})});exports.CheckboxStandAlone=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../lib/hooks/useClassName/useClassName.js"),s=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),t=require("../../lib/utils/classNames/classNames.js"),a=require("./iconStandAlone.js");let
|
|
1
|
+
const e=require("../../lib/hooks/useClassName/useClassName.js"),s=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),t=require("../../lib/utils/classNames/classNames.js"),a=require("../../lib/components/screen-reader-only/screenReaderOnly.js"),i=require("./iconStandAlone.js");let l=require("react"),n=require("react/jsx-runtime");const r=(0,l.forwardRef)(({className:l,color:r,height:c,icon:o,id:d,tabIndex:u,title:b,width:m,...h},j)=>{const{altText:x,disabled:C,onClick:N,screenReaderText:I,...k}=h,p=s.pickCustomAttributes(h),q=!(Object.keys(h).includes("color")&&!r||!r),y=e.useClassName({component:"ICON"});return o?N?(0,n.jsxs)("button",{"aria-disabled":C,"aria-label":h["aria-label"]||x,className:t.classNames(y.button,l),"data-testid":"button",disabled:C,id:d,style:{height:c,width:m},tabIndex:u,title:b||"",type:"button",onClick:N,...p,children:[(0,n.jsx)(a.ScreenReaderOnly,{children:I}),(0,n.jsx)(i.IconStandAlone,{icon:o,...k,ref:j,"aria-label":void 0,className:l,cssClasses:y,"data-testid":void 0,height:c,id:void 0,linearIcon:q,width:m})]}):(0,n.jsx)(i.IconStandAlone,{icon:o,...k,ref:j,altText:x,className:l,cssClasses:y,"data-testid":"icon",height:c,linearIcon:q,width:m}):null});exports.IconBasic=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../lib/components/customComponent/customComponent.js"),t=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),s=require("../../lib/utils/classNames/classNames.js"),a=require("../text/text2.js"),n=require("../../lib/components/elementOrIcon/elementOrIcon.js"),
|
|
1
|
+
const e=require("../../lib/components/customComponent/customComponent.js"),t=require("../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),s=require("../../lib/utils/classNames/classNames.js"),a=require("../text/text2.js"),n=require("../../lib/components/screen-reader-only/screenReaderOnly.js"),r=require("../../lib/components/elementOrIcon/elementOrIcon.js"),i=require("../../lib/types/states/states.js"),c=require("./helpers/aria.js"),l=require("./helpers/screnReader.js"),o=require("./helpers/stepState.js");let d=require("react"),p=require("react/jsx-runtime");const m=(0,d.forwardRef)(({completedStepIcon:d,cssOrientationClasses:m,cssVariantClasses:u,currentStep:x=0,horizontalOrientationWidth:j,orientation:h,screenReaderCompletedStep:b,screenReaderTextBuilder:N,screenReaderTitle:C,stepMaxTruncatedLines:S,steps:T,...q},A)=>{const y=o.mapToStepState(T,x),O="vertical"===h,R=Boolean(C),$=q["data-testid"]||"stepper-number";return(0,p.jsxs)("div",{ref:A,"aria-hidden":!O,"data-testid":$,children:[C?.content&&(0,p.jsx)(e.CustomComponent,{className:"kbt-sr-only",component:C.component,children:C?.content}),(0,p.jsx)("ol",{className:s.classNames(m?.stepper_number,u?.stepper_number),"data-testid":`${$}-steps-container`,children:y.map((o,C)=>{const T=C===y.length-1,q={"data-state":o.state},A=t.pickCustomAttributes(q);return(0,p.jsxs)("li",{"aria-current":c.buildAriaCurrent(x,C,h),"data-testid":`${$}-li-${C}`,style:{display:O?"flex":"block",width:!O&&T?"auto":j},children:[R&&(0,p.jsx)(n.ScreenReaderOnly,{children:l.buildScreenReaderText(C,x,y.length,N,o.name,O)}),(0,p.jsxs)("span",{"aria-hidden":!(O&&!R)||void 0,className:s.classNames(m?.stepcontainer,u?.stepcontainer),...A,children:[(0,p.jsxs)("span",{className:u?.stepcirclecontainer,"data-testid":`${$}-step-${C}`,style:{flexDirection:"vertical"===h?"column":"row"},children:[(0,p.jsx)("span",{className:s.classNames(m?.stepcircle,u?.stepcircle),...A,children:o.state===i.STATES.COMPLETED?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.ElementOrIcon,{className:s.classNames(m?.iconselected,u?.iconselected),customAttributes:q,...d}),(0,p.jsx)(n.ScreenReaderOnly,{children:C+1})]}):(0,p.jsx)(a.Text,{additionalClasses:{text:s.classNames(m?.stepindex,u?.stepindex)},component:"span",customAttributes:q,children:C+1})}),!T&&(0,p.jsx)("span",{className:s.classNames(m?.stepbar,u?.stepbar),...t.pickCustomAttributes({"data-state":y[C+1].state})})]}),O&&(0,p.jsxs)("span",{"aria-hidden":!!R||void 0,className:s.classNames(m?.stepnamecontainer,u?.stepnamecontainer),"data-islast":T,"data-testid":`${$}-step-description-${C}`,...A,children:[(0,p.jsx)(a.Text,{additionalClasses:{text:s.classNames(m?.stepname,u?.stepname)},component:"span",customAttributes:q,maxTruncatedLines:S,children:o.name}),!R&&o.state===i.STATES.COMPLETED&&b?.content&&(0,p.jsxs)(e.CustomComponent,{className:"kbt-sr-only",component:b.component,"data-testid":b["data-testid"],children:[" ",b.content]})]})]})]},`stepContainer-${C.toString()}`)})})]})});exports.StepperNumberStandAlone=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=require("../../../../lib/utils/pickCustomAttributes/pickCustomAttributes.js"),t=require("../../../text/text2.js"),r=require("../../../../lib/components/screen-reader-only/screenReaderOnly.js");let i=require("react"),s=require("react/jsx-runtime");const n=(0,i.forwardRef)(({cssClasses:i,currentCharacters:n,id:a,leftColor:o,leftWeight:l,marginTop:c,maxLength:d,rightColor:x,rightWeight:u,screenReaderText:h,textVariant:p,...m},g)=>{const C=e.pickCustomAttributes(m);return(0,s.jsxs)("div",{ref:g,"aria-live":(()=>{if(0===n||n>=d)return"polite"})(),className:i?.text_count,"data-testid":"text-count",style:{marginTop:c},...C,children:[(0,s.jsx)(r.ScreenReaderOnly,{children:h},n),(0,s.jsx)(t.Text,{additionalClasses:{text:i?.letftext},"aria-hidden":!0,color:o,component:"span",variant:p,weight:l,children:n}),(0,s.jsx)(t.Text,{additionalClasses:{text:i?.righttext},"aria-hidden":!0,color:x,component:"span",variant:p,weight:u,children:` / ${d}`})]})});exports.TextCountStandAlone=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./screenReaderOnlyStandAlone.js");let r=require("react"),n=require("react/jsx-runtime");const a=(0,r.forwardRef)((r,a)=>(0,n.jsx)(e.ScreenReaderOnlyStandAlone,{ref:a,...r}));a.displayName="ScreenReaderOnly",exports.ScreenReaderOnly=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../utils/pickCustomAttributes/pickCustomAttributes.js"),r=require("../../utils/classNames/classNames.js");let s=require("react"),a=require("react/jsx-runtime");const i=(0,s.forwardRef)(({ariaAtomic:s,ariaLive:i,children:t,className:c,id:l,role:n,...o},d)=>{const u=e.pickCustomAttributes(o),m=r.classNames("kbt-screen-reader-only",c),p={};return void 0!==i&&(p["aria-live"]=i),void 0!==s&&(p["aria-atomic"]=s),void 0!==n&&(p.role=n),(0,a.jsx)("span",{ref:d,className:m,id:l,...p,...u,children:t})});i.displayName="ScreenReaderOnlyStandAlone",exports.ScreenReaderOnlyStandAlone=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=require("react");exports.useSwipeDown=({handleClose:t})=>{const n=(0,e.useRef)(null),r=(0,e.useRef)(null),u=(0,e.useRef)(!1),s=(0,e.useRef)(""),o=(0,e.useRef)(0),c=(0,e.useRef)(null)
|
|
1
|
+
let e=require("react");exports.useSwipeDown=({handleClose:t})=>{const n=(0,e.useRef)(null),r=(0,e.useRef)(null),u=(0,e.useRef)(!1),s=(0,e.useRef)(""),o=(0,e.useRef)(0),c=(0,e.useRef)(null),v=(0,e.useCallback)(e=>{n.current=e},[]);return{setDragIconRef:(0,e.useCallback)(e=>{if(c.current&&(c.current(),c.current=null),r.current=e,e){const r=e=>"touches"in e?(e.touches[0]||e.changedTouches[0])?.clientY||0:e.clientY,v=e=>{u.current&&n.current&&(u.current=!1,r(e)-o.current>30?t?.():n.current.style.bottom=s.current)},d=e=>{if(!u.current||!n.current)return;e.preventDefault();const t=r(e)-o.current;t>0&&(n.current.style.bottom=`-${t}px`)},m=e=>{!u.current&&n.current&&(e.preventDefault(),u.current=!0,o.current=r(e),s.current=window.getComputedStyle(n.current).bottom,document.addEventListener("mousemove",d,{passive:!1}),document.addEventListener("mouseup",v,{passive:!1}),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",v,{passive:!1}))};e.addEventListener("mousedown",m,{passive:!1}),e.addEventListener("touchstart",m,{passive:!1}),c.current=()=>{e.removeEventListener("mousedown",m),e.removeEventListener("touchstart",m),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",v),u.current=!1}}},[t]),setPopoverRef:v}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pickCustomAttributes as t}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{Text as e}from"../text/text2.js";import{processIconProp as s,processTextProp as o}from"../../lib/utils/process/processCommonProp.js";import{Dot as a}from"../dot/dot.js";import{
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
1
|
+
import{pickCustomAttributes as t}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{Text as e}from"../text/text2.js";import{processIconProp as s,processTextProp as o}from"../../lib/utils/process/processCommonProp.js";import{Dot as a}from"../dot/dot.js";import{ScreenReaderOnly as r}from"../../lib/components/screen-reader-only/screenReaderOnly.js";import{ElementOrIcon as i}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{forwardRef as n,useCallback as l,useImperativeHandle as c,useRef as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";const p=n(({active:n,ariaLiveText:p,cssSizeClasses:b,cssVariantClasses:f,dot:h,hasDot:C,icon:j,label:N,labelIcon:$,onBadgeBlur:g,onClick:x,role:A,...v},k)=>{const y=m(null),B=m(null),I={"data-active":!!n},O=t({...v,customAttributes:I}),D=t(I),L=O["data-testid"]||"badge";c(k,()=>B.current,[]);const z=l(t=>{g?.(t)},[g]),P=l(t=>{x?.(t)},[x]);/* @__PURE__ */
|
|
2
|
+
return d("div",{ref:B,className:`${f?.badge} ${b?.badge}`,"data-testid":`${L}-container`,...D,children:/* @__PURE__ */u("button",{ref:y,className:f?.button,"data-testid":L,role:A,type:"button",onBlur:z,onClick:P,...O,children:[
|
|
3
|
+
/* @__PURE__ */u("span",{className:f?.dotcontainer,children:[!!h&&!!C&&/* @__PURE__ */d("span",{"aria-hidden":!0,className:f?.dot,children:/* @__PURE__ */d(a,{...h})}),/* @__PURE__ */d(i,{className:`${f?.icon} ${b?.icon}`,...s(j),customAttributes:I})]}),!!N&&/* @__PURE__ */u("span",{"aria-hidden":!0,className:f?.labelcontainer,children:[/* @__PURE__ */d(e,{additionalClasses:{text:`${b?.label} ${f?.label}`},component:"span",...o(N),customAttributes:I}),/* @__PURE__ */d(i,{className:f?.labelicon,rotate:n?"180deg":"0deg",transitionDuration:"0.2s",...s($),customAttributes:I})]}),
|
|
4
|
+
/* @__PURE__ */d(r,{ariaLive:"polite",children:p})]})})});export{p as BadgeStandAlone};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return a("div",{ref:w,"aria-roledescription":"carousel",className:
|
|
1
|
+
import{ScreenReaderOnly as e}from"../../lib/components/screen-reader-only/screenReaderOnly.js";import{forwardRef as t}from"react";import{jsx as r,jsxs as a}from"react/jsx-runtime";const i=t(({allowModifySliceWidth:t,centerMode:i,contentContainer:n,contentContainerRef:o,cssClasses:d,disabled:s,elements:c,rootContainer:l,screenReaderOnly:m,viewerContainer:f,viewerContainerRef:v,...p},w)=>{const h=p["data-testid"]??"carousel";/* @__PURE__ */
|
|
2
|
+
return a("div",{ref:w,"aria-roledescription":"carousel",className:d?.carousel,"data-testid":h,...p,...l,children:[/* @__PURE__ */r("div",{ref:v,className:d?.viewer,"data-allow-modify-slice-width":t,"data-disabled":s,"data-testid":`${h}-viewer`,...f,children:/* @__PURE__ */r("div",{ref:o,"aria-live":"polite",className:d?.content,"data-center-mode":i,"data-testid":`${h}-content`,...n,children:c})}),m&&/* @__PURE__ */r(e,{ariaLive:"off",...m,children:m.content})]})});export{i as CarouselStandAlone};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pickCustomAttributes as e}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processTextProp as r}from"../../lib/utils/process/processCommonProp.js";import{
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
1
|
+
import{pickCustomAttributes as e}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processTextProp as r}from"../../lib/utils/process/processCommonProp.js";import{ScreenReaderOnly as a}from"../../lib/components/screen-reader-only/screenReaderOnly.js";import{CheckboxBaseControlled as s}from"../checkboxBase/checkboxBaseControlled.js";import{ErrorMessage as i}from"./components/errorMessage.js";import{Label as o}from"./components/label.js";import{buildAriaDescribedBy as t}from"./utils/aria.utils.js";import{forwardRef as l,useId as c}from"react";import{jsx as d,jsxs as n}from"react/jsx-runtime";const b=l(({checkboxBase:l,cssClasses:b,errorMessage:m,id:p,label:h,screenReaderText:u,...f},x)=>{const{"aria-describedby":y,"aria-hidden":j,"aria-label":k,"aria-labelledby":C,...g}=e(f),v=`checkbox-${c().replace(/:/g,"")}`,$=p??v,B=`${$}-label`,I=`${$}-error`,R=`${$}-screen-reader`,M=l?.variant,w=t({ariaDescribedBy:f["aria-describedby"],error:f.error&&!!m?.message,errorMessageId:I,screenReader:!!u,screenReaderId:R});/* @__PURE__ */
|
|
2
|
+
return n("div",{ref:x,...g,className:b?.checkbox,children:[/* @__PURE__ */n("div",{className:b?.checkboxwithlabelcontainer,children:[!!M&&/* @__PURE__ */d(s,{...f,"aria-describedby":w,"aria-hidden":f["aria-hidden"],"aria-label":f["aria-label"],"aria-labelledby":f["aria-labelledby"],id:$,variant:M}),
|
|
3
|
+
/* @__PURE__ */d(a,{id:R,children:u}),
|
|
4
|
+
/* @__PURE__ */d(o,{content:r(h).children,cssClasses:b,id:B,inputId:$})]}),!!f.error&&/* @__PURE__ */d(i,{"aria-live":"assertive",cssClasses:b,"data-testid":`${f["data-testid"]}-error-message`,...m,id:I,inputId:$,show:f.error&&!f.disabled})]})});export{b as CheckboxStandAlone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useClassName as t}from"../../lib/hooks/useClassName/useClassName.js";import{pickCustomAttributes as e}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{classNames as s}from"../../lib/utils/classNames/classNames.js";import{
|
|
1
|
+
import{useClassName as t}from"../../lib/hooks/useClassName/useClassName.js";import{pickCustomAttributes as e}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{classNames as s}from"../../lib/utils/classNames/classNames.js";import{ScreenReaderOnly as i}from"../../lib/components/screen-reader-only/screenReaderOnly.js";import{IconStandAlone as a}from"./iconStandAlone.js";import{forwardRef as o}from"react";import{jsx as l,jsxs as r}from"react/jsx-runtime";const n=o(({className:o,color:n,height:c,icon:d,id:m,tabIndex:b,title:u,width:h,...p},f)=>{const{altText:C,disabled:N,onClick:j,screenReaderText:x,...k}=p,y=e(p),I=!(Object.keys(p).includes("color")&&!n||!n),g=t({component:"ICON"});return d?j?/* @__PURE__ */r("button",{"aria-disabled":N,"aria-label":p["aria-label"]||C,className:s(g.button,o),"data-testid":"button",disabled:N,id:m,style:{height:c,width:h},tabIndex:b,title:u||"",type:"button",onClick:j,...y,children:[/* @__PURE__ */l(i,{children:x}),/* @__PURE__ */l(a,{icon:d,...k,ref:f,"aria-label":void 0,className:o,cssClasses:g,"data-testid":void 0,height:c,id:void 0,linearIcon:I,width:h})]}):/* @__PURE__ */l(a,{icon:d,...k,ref:f,altText:C,className:o,cssClasses:g,"data-testid":"icon",height:c,linearIcon:I,width:h}):null});export{n as IconBasic};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{CustomComponent as e}from"../../lib/components/customComponent/customComponent.js";import{pickCustomAttributes as t}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{classNames as s}from"../../lib/utils/classNames/classNames.js";import{Text as n}from"../text/text2.js";import{
|
|
2
|
-
return
|
|
3
|
-
return
|
|
1
|
+
import{CustomComponent as e}from"../../lib/components/customComponent/customComponent.js";import{pickCustomAttributes as t}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{classNames as s}from"../../lib/utils/classNames/classNames.js";import{Text as n}from"../text/text2.js";import{ScreenReaderOnly as a}from"../../lib/components/screen-reader-only/screenReaderOnly.js";import{ElementOrIcon as r}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{STATES as i}from"../../lib/types/states/states.js";import{buildAriaCurrent as o}from"./helpers/aria.js";import{buildScreenReaderText as c}from"./helpers/screnReader.js";import{mapToStepState as l}from"./helpers/stepState.js";import{forwardRef as m}from"react";import{Fragment as p,jsx as d,jsxs as u}from"react/jsx-runtime";const h=m(({completedStepIcon:m,cssOrientationClasses:h,cssVariantClasses:b,currentStep:f=0,horizontalOrientationWidth:x,orientation:C,screenReaderCompletedStep:j,screenReaderTextBuilder:N,screenReaderTitle:y,stepMaxTruncatedLines:$,steps:O,...T},k)=>{const v=l(O,f),A="vertical"===C,R=Boolean(y),S=T["data-testid"]||"stepper-number";/* @__PURE__ */
|
|
2
|
+
return u("div",{ref:k,"aria-hidden":!A,"data-testid":S,children:[y?.content&&/* @__PURE__ */d(e,{className:"kbt-sr-only",component:y.component,children:y?.content}),/* @__PURE__ */d("ol",{className:s(h?.stepper_number,b?.stepper_number),"data-testid":`${S}-steps-container`,children:v.map((l,y)=>{const O=y===v.length-1,T={"data-state":l.state},k=t(T);/* @__PURE__ */
|
|
3
|
+
return u("li",{"aria-current":o(f,y,C),"data-testid":`${S}-li-${y}`,style:{display:A?"flex":"block",width:!A&&O?"auto":x},children:[R&&/* @__PURE__ */d(a,{children:c(y,f,v.length,N,l.name,A)}),/* @__PURE__ */u("span",{"aria-hidden":!(A&&!R)||void 0,className:s(h?.stepcontainer,b?.stepcontainer),...k,children:[/* @__PURE__ */u("span",{className:b?.stepcirclecontainer,"data-testid":`${S}-step-${y}`,style:{flexDirection:"vertical"===C?"column":"row"},children:[/* @__PURE__ */d("span",{className:s(h?.stepcircle,b?.stepcircle),...k,children:l.state===i.COMPLETED?/* @__PURE__ */u(p,{children:[/* @__PURE__ */d(r,{className:s(h?.iconselected,b?.iconselected),customAttributes:T,...m}),/* @__PURE__ */d(a,{children:y+1})]}):/* @__PURE__ */d(n,{additionalClasses:{text:s(h?.stepindex,b?.stepindex)},component:"span",customAttributes:T,children:y+1})}),!O&&/* @__PURE__ */d("span",{className:s(h?.stepbar,b?.stepbar),...t({"data-state":v[y+1].state})})]}),A&&/* @__PURE__ */u("span",{"aria-hidden":!!R||void 0,className:s(h?.stepnamecontainer,b?.stepnamecontainer),"data-islast":O,"data-testid":`${S}-step-description-${y}`,...k,children:[/* @__PURE__ */d(n,{additionalClasses:{text:s(h?.stepname,b?.stepname)},component:"span",customAttributes:T,maxTruncatedLines:$,children:l.name}),!R&&l.state===i.COMPLETED&&j?.content&&/* @__PURE__ */u(e,{className:"kbt-sr-only",component:j.component,"data-testid":j["data-testid"],children:[" ",j.content]})]})]})]},`stepContainer-${y.toString()}`)})})]})});export{h as StepperNumberStandAlone};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{pickCustomAttributes as t}from"../../../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{Text as e}from"../../../text/text2.js";import{
|
|
2
|
-
return a("div",{ref:g,"aria-live":(()=>{if(0===
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
1
|
+
import{pickCustomAttributes as t}from"../../../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{Text as e}from"../../../text/text2.js";import{ScreenReaderOnly as r}from"../../../../lib/components/screen-reader-only/screenReaderOnly.js";import{forwardRef as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";const n=i(({cssClasses:i,currentCharacters:n,id:s,leftColor:l,leftWeight:c,marginTop:m,maxLength:d,rightColor:p,rightWeight:h,screenReaderText:x,textVariant:u,...f},g)=>{const C=t(f);/* @__PURE__ */
|
|
2
|
+
return a("div",{ref:g,"aria-live":(()=>{if(0===n||n>=d)return"polite"})(),className:i?.text_count,"data-testid":"text-count",style:{marginTop:m},...C,children:[
|
|
3
|
+
/* @__PURE__ */o(r,{children:x},n),
|
|
4
|
+
/* @__PURE__ */o(e,{additionalClasses:{text:i?.letftext},"aria-hidden":!0,color:l,component:"span",variant:u,weight:c,children:n}),
|
|
5
|
+
/* @__PURE__ */o(e,{additionalClasses:{text:i?.righttext},"aria-hidden":!0,color:p,component:"span",variant:u,weight:h,children:` / ${d}`})]})});export{n as TextCountStandAlone};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ScreenReaderOnlyStandAlone as e}from"./screenReaderOnlyStandAlone.js";import{forwardRef as r}from"react";import{jsx as o}from"react/jsx-runtime";const t=r((r,t)=>/* @__PURE__ */o(e,{ref:t,...r}));t.displayName="ScreenReaderOnly";export{t as ScreenReaderOnly};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pickCustomAttributes as r}from"../../utils/pickCustomAttributes/pickCustomAttributes.js";import{classNames as e}from"../../utils/classNames/classNames.js";import{forwardRef as i}from"react";import{jsx as a}from"react/jsx-runtime";const t=i(({ariaAtomic:i,ariaLive:t,children:s,className:o,id:m,role:c,...l},n)=>{const d=r(l),p=e("kbt-screen-reader-only",o),u={};return void 0!==t&&(u["aria-live"]=t),void 0!==i&&(u["aria-atomic"]=i),void 0!==c&&(u.role=c),/* @__PURE__ */a("span",{ref:n,className:p,id:m,...u,...d,children:s})});t.displayName="ScreenReaderOnlyStandAlone";export{t as ScreenReaderOnlyStandAlone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e,useRef as t}from"react";const n=({handleClose:n})=>{const r=t(null),u=t(null),o=t(!1),c=t(""),s=t(0),v=t(null)
|
|
1
|
+
import{useCallback as e,useRef as t}from"react";const n=({handleClose:n})=>{const r=t(null),u=t(null),o=t(!1),c=t(""),s=t(0),v=t(null),m=e(e=>{r.current=e},[]);return{setDragIconRef:e(e=>{if(v.current&&(v.current(),v.current=null),u.current=e,e){const t=e=>"touches"in e?(e.touches[0]||e.changedTouches[0])?.clientY||0:e.clientY,u=e=>{o.current&&r.current&&(o.current=!1,t(e)-s.current>30?n?.():r.current.style.bottom=c.current)},m=e=>{if(!o.current||!r.current)return;e.preventDefault();const n=t(e)-s.current;n>0&&(r.current.style.bottom=`-${n}px`)},d=e=>{!o.current&&r.current&&(e.preventDefault(),o.current=!0,s.current=t(e),c.current=window.getComputedStyle(r.current).bottom,document.addEventListener("mousemove",m,{passive:!1}),document.addEventListener("mouseup",u,{passive:!1}),document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",u,{passive:!1}))};e.addEventListener("mousedown",d,{passive:!1}),e.addEventListener("touchstart",d,{passive:!1}),v.current=()=>{e.removeEventListener("mousedown",d),e.removeEventListener("touchstart",d),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",u),o.current=!1}}},[n]),setPopoverRef:m}};export{n as useSwipeDown};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4878,11 +4878,14 @@ declare type RecoverComponentStyles = <T extends ComponentsTypesAvailableCompone
|
|
|
4878
4878
|
additionalClassNames?: Partial<ComponentSelected_2<ComponentsTypesComponents[T]>>;
|
|
4879
4879
|
}) => ComponentSelected_2<ComponentsTypesComponents[T]>;
|
|
4880
4880
|
|
|
4881
|
-
declare
|
|
4881
|
+
declare type ScreenReaderOnlyProps = ScreenReaderOnlyStandAloneProps;
|
|
4882
|
+
|
|
4883
|
+
declare interface ScreenReaderOnlyStandAloneProps extends DataAttributes {
|
|
4884
|
+
ariaAtomic?: AriaAttributes['aria-atomic'];
|
|
4885
|
+
ariaLive?: AriaAttributes['aria-live'];
|
|
4882
4886
|
children?: React.ReactNode;
|
|
4887
|
+
className?: string;
|
|
4883
4888
|
id?: string;
|
|
4884
|
-
show?: boolean;
|
|
4885
|
-
ariaLive?: AriaAttributes['aria-live'];
|
|
4886
4889
|
role?: React.AriaRole;
|
|
4887
4890
|
}
|
|
4888
4891
|
|
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.30",
|
|
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",
|
|
@@ -135,14 +135,14 @@
|
|
|
135
135
|
"@testing-library/react": "^16.3.1",
|
|
136
136
|
"@testing-library/user-event": "^14.6.1",
|
|
137
137
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
138
|
-
"@types/node": "^25.0.
|
|
138
|
+
"@types/node": "^25.0.8",
|
|
139
139
|
"@types/react": "^18.3.12",
|
|
140
140
|
"@types/react-dom": "^18.3.1",
|
|
141
141
|
"@types/testing-library__jest-dom": "^6.0.0",
|
|
142
142
|
"@vitejs/plugin-react": "^5.1.2",
|
|
143
143
|
"@vitest/coverage-v8": "^4.0.17",
|
|
144
144
|
"@vitest/ui": "^4.0.17",
|
|
145
|
-
"bernova": "1.0
|
|
145
|
+
"bernova": "1.1.0",
|
|
146
146
|
"cssnano": "^7.1.2",
|
|
147
147
|
"eslint": "^9.39.2",
|
|
148
148
|
"eslint-config-kubit": "1.2.0",
|