@kubit-ui-web/react-components 2.0.0-beta.11 ā 2.0.0-beta.12
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/README.md +2 -2
- package/dist/cjs/.storybook/bundle-sizes.json +13 -0
- package/dist/cjs/assets/banner_kubit_readme.png +0 -0
- package/dist/cjs/components/avatar/fragments/drawContent.js +1 -1
- package/dist/cjs/components/badge/badgeStandAlone.js +1 -1
- package/dist/cjs/components/button/button.js +1 -1
- package/dist/cjs/components/button/buttonStandAlone.js +1 -1
- package/dist/cjs/components/cardImage/cardImageStandAlone.js +1 -1
- package/dist/cjs/components/carousel/hooks/useCarousel.js +1 -1
- package/dist/cjs/components/carousel/hooks/useCarouselKeyNavigation.js +1 -1
- package/dist/cjs/components/checkboxBase/checkboxBaseStandAlone.js +1 -1
- package/dist/cjs/components/chip/chipStandAlone.js +1 -1
- package/dist/cjs/components/container/containerStandAlone.js +1 -1
- package/dist/cjs/components/dataTable/hooks/useDataTableHasScroll.js +1 -1
- package/dist/cjs/components/dataTable/hooks/useDataTableShadow.js +1 -1
- package/dist/cjs/components/dataTable/hooks/useDataTableStickyDividers.js +1 -1
- package/dist/cjs/components/dataTable/hooks/useDataTableStickyLeftColumns.js +1 -1
- package/dist/cjs/components/dataTable/hooks/useDataTableStickyRightColumns.js +1 -1
- package/dist/cjs/components/dropdownSelected/dropdownSelectedControlled.js +1 -1
- package/dist/cjs/components/dropdownSelected/dropdownSelectedStandAlone.js +1 -1
- package/dist/cjs/components/input/input.js +1 -1
- package/dist/cjs/components/inputSignature/inputSignatureStandAlone.js +1 -1
- package/dist/cjs/components/listOptions/listOptionsStandAlone.js +1 -1
- package/dist/cjs/components/message/messageStandAlone.js +1 -1
- package/dist/cjs/components/modal/fragments/modalHeader.js +1 -1
- package/dist/cjs/components/modal/modalControlled.js +1 -1
- package/dist/cjs/components/modal/modalStandAlone.js +1 -1
- package/dist/cjs/components/modal/modalUnControlled.js +1 -1
- package/dist/cjs/components/option/optionStandAlone.js +1 -1
- package/dist/cjs/components/popover/hooks/usePopoverInteractions.js +1 -1
- package/dist/cjs/components/popover/hooks/usePopoverLifecycle.js +1 -1
- package/dist/cjs/components/radioButton/radioButtonStandAlone.js +1 -1
- package/dist/cjs/components/selectorBoxFile/components/selectorBoxFileContainerBox.js +1 -1
- package/dist/cjs/components/selectorBoxFile/components/selectorBoxFileErrorMessage.js +1 -1
- package/dist/cjs/components/selectorBoxFile/components/selectorBoxFileHeader.js +1 -1
- package/dist/cjs/components/slider/sliderStandAlone.js +1 -1
- package/dist/cjs/components/table/hooks/useTableHasScroll.js +1 -1
- package/dist/cjs/components/table/hooks/useTableShadow.js +1 -1
- package/dist/cjs/components/table/hooks/useTableStickyLeftColumns.js +1 -1
- package/dist/cjs/components/table/hooks/useTableStickyRightColumns.js +1 -1
- package/dist/cjs/components/tabs/tabsStandAlone.js +1 -1
- package/dist/cjs/components/tag/tagStandAlone.js +1 -1
- package/dist/cjs/components/textArea/components/errorStandAlone.js +1 -1
- package/dist/cjs/components/textArea/components/helpMessageStandAlone.js +1 -1
- package/dist/cjs/components/textArea/components/titleStandAlone.js +1 -1
- package/dist/cjs/components/textArea/textAreaStandAlone.js +1 -1
- package/dist/cjs/components/toggle/toggleStandAlone.js +1 -1
- package/dist/cjs/components/tooltip/tooltipStandAlone.js +1 -1
- package/dist/cjs/components/tooltip/tooltipUnControlled.js +1 -1
- package/dist/cjs/lib/components/errorMessage/errorMessageStandAlone.js +1 -1
- package/dist/cjs/lib/hooks/useContentVisibility/useContentVisibility.js +1 -1
- package/dist/cjs/lib/hooks/useScrollDetection/useScrollDetection.js +1 -1
- package/dist/cjs/lib/utils/keyboard/keyboard.js +1 -1
- package/dist/cjs/lib/utils/process/processCommonProp.js +1 -0
- package/dist/cjs/scripts/generate-bundle-sizes.mjs +236 -0
- package/dist/cjs/scripts/new-component-web-ui.js +2092 -0
- package/dist/esm/.storybook/bundle-sizes.json +13 -0
- package/dist/esm/assets/banner_kubit_readme.png +0 -0
- package/dist/esm/components/avatar/fragments/drawContent.js +1 -1
- package/dist/esm/components/badge/badgeStandAlone.js +6 -6
- package/dist/esm/components/button/button.js +1 -1
- package/dist/esm/components/button/buttonStandAlone.js +3 -3
- package/dist/esm/components/cardImage/cardImageStandAlone.js +7 -7
- package/dist/esm/components/carousel/hooks/useCarousel.js +1 -1
- package/dist/esm/components/carousel/hooks/useCarouselKeyNavigation.js +1 -1
- package/dist/esm/components/checkboxBase/checkboxBaseStandAlone.js +4 -4
- package/dist/esm/components/chip/chipStandAlone.js +7 -7
- package/dist/esm/components/container/containerStandAlone.js +4 -4
- package/dist/esm/components/dataTable/hooks/useDataTableHasScroll.js +1 -1
- package/dist/esm/components/dataTable/hooks/useDataTableShadow.js +1 -1
- package/dist/esm/components/dataTable/hooks/useDataTableStickyDividers.js +1 -1
- package/dist/esm/components/dataTable/hooks/useDataTableStickyLeftColumns.js +1 -1
- package/dist/esm/components/dataTable/hooks/useDataTableStickyRightColumns.js +1 -1
- package/dist/esm/components/dropdownSelected/dropdownSelectedControlled.js +1 -1
- package/dist/esm/components/dropdownSelected/dropdownSelectedStandAlone.js +5 -5
- package/dist/esm/components/input/input.js +2 -2
- package/dist/esm/components/inputSignature/inputSignatureStandAlone.js +3 -3
- package/dist/esm/components/listOptions/listOptionsStandAlone.js +2 -2
- package/dist/esm/components/message/messageStandAlone.js +5 -5
- package/dist/esm/components/modal/fragments/modalHeader.js +1 -1
- package/dist/esm/components/modal/modalControlled.js +1 -1
- package/dist/esm/components/modal/modalStandAlone.js +3 -3
- package/dist/esm/components/modal/modalUnControlled.js +2 -2
- package/dist/esm/components/option/optionStandAlone.js +9 -9
- package/dist/esm/components/popover/hooks/usePopoverInteractions.js +1 -1
- package/dist/esm/components/popover/hooks/usePopoverLifecycle.js +1 -1
- package/dist/esm/components/radioButton/radioButtonStandAlone.js +4 -4
- package/dist/esm/components/selectorBoxFile/components/selectorBoxFileContainerBox.js +4 -4
- package/dist/esm/components/selectorBoxFile/components/selectorBoxFileErrorMessage.js +2 -2
- package/dist/esm/components/selectorBoxFile/components/selectorBoxFileHeader.js +5 -5
- package/dist/esm/components/slider/sliderStandAlone.js +14 -14
- package/dist/esm/components/table/hooks/useTableHasScroll.js +1 -1
- package/dist/esm/components/table/hooks/useTableShadow.js +1 -1
- package/dist/esm/components/table/hooks/useTableStickyLeftColumns.js +1 -1
- package/dist/esm/components/table/hooks/useTableStickyRightColumns.js +1 -1
- package/dist/esm/components/tabs/tabsStandAlone.js +4 -4
- package/dist/esm/components/tag/tagStandAlone.js +4 -4
- package/dist/esm/components/textArea/components/errorStandAlone.js +3 -3
- package/dist/esm/components/textArea/components/helpMessageStandAlone.js +1 -1
- package/dist/esm/components/textArea/components/titleStandAlone.js +1 -1
- package/dist/esm/components/textArea/textAreaStandAlone.js +11 -11
- package/dist/esm/components/toggle/toggleStandAlone.js +4 -4
- package/dist/esm/components/tooltip/tooltipStandAlone.js +7 -7
- package/dist/esm/components/tooltip/tooltipUnControlled.js +1 -1
- package/dist/esm/lib/components/errorMessage/errorMessageStandAlone.js +4 -4
- package/dist/esm/lib/hooks/useContentVisibility/useContentVisibility.js +1 -1
- package/dist/esm/lib/hooks/useScrollDetection/useScrollDetection.js +1 -1
- package/dist/esm/lib/utils/keyboard/keyboard.js +1 -1
- package/dist/esm/lib/utils/process/processCommonProp.js +1 -0
- package/dist/esm/scripts/generate-bundle-sizes.mjs +236 -0
- package/dist/esm/scripts/new-component-web-ui.js +2092 -0
- package/package.json +2 -2
- package/dist/cjs/lib/hooks/useInputFocus/useInputFocus.js +0 -1
- package/dist/cjs/lib/utils/process/processIcon/processIcon.js +0 -1
- package/dist/cjs/lib/utils/process/processText/processText.js +0 -1
- package/dist/cjs/lib/utils/resizeObserver/resizeObserver.js +0 -1
- package/dist/esm/lib/hooks/useInputFocus/useInputFocus.js +0 -1
- package/dist/esm/lib/utils/process/processIcon/processIcon.js +0 -1
- package/dist/esm/lib/utils/process/processText/processText.js +0 -1
- package/dist/esm/lib/utils/resizeObserver/resizeObserver.js +0 -1
- /package/dist/cjs/lib/{hooks/syncRefs ā utils/refs}/syncRefs.js +0 -0
- /package/dist/esm/lib/{hooks/syncRefs ā utils/refs}/syncRefs.js +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as t,useId as s}from"react";import{classNames as a}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as r}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{
|
|
2
|
-
return e.jsxs("div",{ref:U,className:v?.slider,"data-disabled":j,"data-hover"
|
|
3
|
-
/* @__PURE__ */e.jsx("div",{className:v?.labelcontainer,...Z,children:/* @__PURE__ */e.jsx(
|
|
4
|
-
/* @__PURE__ */e.jsx(d,{cssClasses:v,customAttributes:X,scaleOffsets:
|
|
1
|
+
import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as t,useId as s}from"react";import{classNames as a}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as r}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processTextProp as i}from"../../lib/utils/process/processCommonProp.js";import{Text as o}from"../text/text.js";import{SliderButtonStandAlone as l}from"./components/sliderButtonStandAlone.js";import{SliderHelperTextStandAlone as c}from"./components/sliderHelperTextStandAlone.js";import{SliderScaleStandAlone as d}from"./components/sliderScaleStandAlone.js";import{SliderThumbStandAlone as n}from"./components/sliderThumbStandAlone.js";import{buildAriaDescribedBy as u}from"./utils/accessibility.utils.js";import{getState as m}from"./utils/state.utils.js";import{isActive as h}from"./utils/ui.utils.js";const p=t(({activePointer:t,ariaLabel:p,ariaLabelBy:b,containerRef:x,cssClasses:v,decrementButton:f,disabled:j,hover:$,incrementButton:T,label:g,leftHelperText:y,max:k,min:A,offset:C,offsetLeft:L,offsetRight:N,onChange:w,onKeyPress:B,onMouseDown:I,onTouchStart:S,pressed:H,range:M,rightAriaLabel:D,rightAriaLabelBy:O,rightHelperText:F,rightThumbIcon:K,rightTooltip:P,scaleOffsets:R,setHover:_,showScale:q,step:z,thumbIcon:E,tooltip:G,value:J,...Q},U)=>{const V=`slider-${s().replace(/:/g,"")}`,W=m({disabled:j,hover:$,pressed:H}),X={"data-state":W},Y=Q["data-testid"]??"slider",Z=r(X),ee=i(g).children&&!M?`${V}Label`:void 0,te=`${V}LeftHelperText`,se=`${V}RightHelperText`,ae=b??ee;/* @__PURE__ */
|
|
2
|
+
return e.jsxs("div",{ref:U,className:v?.slider,"data-disabled":j,"data-hover":$,"data-pressed":H,...Z,children:[
|
|
3
|
+
/* @__PURE__ */e.jsx("div",{className:v?.labelcontainer,...Z,children:/* @__PURE__ */e.jsx(o,{additionalClasses:{text:v?.label},component:"label",customAttributes:X,id:ee,...i(g)})}),
|
|
4
|
+
/* @__PURE__ */e.jsx(d,{cssClasses:v,customAttributes:X,scaleOffsets:R,showScale:q}),
|
|
5
5
|
/* @__PURE__ */e.jsxs("div",{className:v?.buttonstrackscontainer,children:[
|
|
6
|
-
/* @__PURE__ */e.jsx(
|
|
6
|
+
/* @__PURE__ */e.jsx(l,{...f,cssClasses:v,customAttributes:X}),
|
|
7
7
|
/* @__PURE__ */e.jsx("div",{className:v?.tracksthumbscontainer,children:/* @__PURE__ */e.jsxs("div",{ref:x,className:v?.tracksthumbsinnercontainer,"data-testid":`${Y}-container`,role:"button",tabIndex:0,onMouseDown:I,onTouchMove:w,onTouchStart:S,children:[M&&/* @__PURE__ */e.jsxs(e.Fragment,{children:[
|
|
8
|
-
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!1,[`${v?.inactivetrack}`]:!0}),...Z,"data-disabled":j,"data-hover"
|
|
9
|
-
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!0,[`${v?.inactivetrack}`]:!1}),"data-disabled":j,"data-hover"
|
|
10
|
-
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!1,[`${v?.inactivetrack}`]:!0}),"data-disabled":j,"data-hover"
|
|
11
|
-
/* @__PURE__ */e.jsx(n,{ariaDescribedBy:u([{helperText:y,helperTextId:te},{helperText:F,helperTextId:se}]),ariaLabel:p,ariaLabelBy:ae,cssClasses:v,customAttributes:X,"data-testid":`${Y}-left-thumb`,disabled:j,hover:h(
|
|
12
|
-
/* @__PURE__ */e.jsx(n,{ariaDescribedBy:u([{helperText:y,helperTextId:te},{helperText:F,helperTextId:se}]),ariaLabel:D,ariaLabelBy:O,cssClasses:v,customAttributes:X,"data-testid":`${Y}-right-thumb`,disabled:j,hover:h(
|
|
13
|
-
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!0,[`${v?.inactivetrack}`]:!1}),"data-disabled":j,"data-hover"
|
|
14
|
-
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!1,[`${v?.inactivetrack}`]:!0}),"data-disabled":j,"data-hover"
|
|
15
|
-
/* @__PURE__ */e.jsx(n,{ariaDescribedBy:u([{helperText:y,helperTextId:te},{helperText:F,helperTextId:se}]),ariaLabel:p,ariaLabelBy:ae,cssClasses:v,customAttributes:X,"data-testid":`${Y}-thumb`,disabled:j,hover
|
|
16
|
-
/* @__PURE__ */e.jsx(
|
|
8
|
+
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!1,[`${v?.inactivetrack}`]:!0}),...Z,"data-disabled":j,"data-hover":$,"data-pressed":H,"data-testid":`${Y}-inactive-left-track`,style:{left:0,width:`${L}%`}}),
|
|
9
|
+
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!0,[`${v?.inactivetrack}`]:!1}),"data-disabled":j,"data-hover":$,"data-pressed":H,"data-testid":`${Y}-active-track`,style:{left:`${L}%`,right:`${N}%`},...Z}),
|
|
10
|
+
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!1,[`${v?.inactivetrack}`]:!0}),"data-disabled":j,"data-hover":$,"data-pressed":H,"data-testid":`${Y}-inactive-right-track`,style:{right:0,width:`${N}%`},...Z}),
|
|
11
|
+
/* @__PURE__ */e.jsx(n,{ariaDescribedBy:u([{helperText:y,helperTextId:te},{helperText:F,helperTextId:se}]),ariaLabel:p,ariaLabelBy:ae,cssClasses:v,customAttributes:X,"data-testid":`${Y}-left-thumb`,disabled:j,hover:h($,t.current,"left"),icon:E,max:J[1]-z,min:A,pressed:h(H,t.current,"left"),state:W,style:{left:`${L}%`},tooltip:G,value:J[0],onFocus:()=>t.current="left",onKeyDown:B,onMouseOut:()=>_(!1),onMouseOver:()=>{_(!0),t.current="left"},onTouchStart:()=>{t.current="left"}}),
|
|
12
|
+
/* @__PURE__ */e.jsx(n,{ariaDescribedBy:u([{helperText:y,helperTextId:te},{helperText:F,helperTextId:se}]),ariaLabel:D,ariaLabelBy:O,cssClasses:v,customAttributes:X,"data-testid":`${Y}-right-thumb`,disabled:j,hover:h($,t.current,"right"),icon:K,max:k,min:J[0]+z,pressed:h(H,t.current,"right"),rightThumb:!0,state:W,style:{right:`${N}%`},tooltip:P,value:J[1],onFocus:()=>t.current="right",onKeyDown:B,onMouseOut:()=>_(!1),onMouseOver:()=>{_(!0),t.current="right"},onTouchStart:()=>{t.current="right"}})]}),!M&&/* @__PURE__ */e.jsxs(e.Fragment,{children:[
|
|
13
|
+
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!0,[`${v?.inactivetrack}`]:!1}),"data-disabled":j,"data-hover":$,"data-pressed":H,"data-testid":`${Y}-active-track`,style:{width:`${C}%`},...Z}),
|
|
14
|
+
/* @__PURE__ */e.jsx("div",{className:a({[`${v?.activetrack}`]:!1,[`${v?.inactivetrack}`]:!0}),"data-disabled":j,"data-hover":$,"data-pressed":H,"data-testid":`${Y}-inactive-track`,style:{right:0,width:`calc(${100-C}%)`},...Z}),
|
|
15
|
+
/* @__PURE__ */e.jsx(n,{ariaDescribedBy:u([{helperText:y,helperTextId:te},{helperText:F,helperTextId:se}]),ariaLabel:p,ariaLabelBy:ae,cssClasses:v,customAttributes:X,"data-testid":`${Y}-thumb`,disabled:j,hover:$,icon:E,max:k,min:A,pressed:H,state:W,style:{left:`${C}%`},tooltip:G,value:J,onKeyDown:B,onMouseOut:()=>_(!1),onMouseOver:()=>_(!0)})]})]})}),
|
|
16
|
+
/* @__PURE__ */e.jsx(l,{...T,cssClasses:v,customAttributes:X})]}),
|
|
17
17
|
/* @__PURE__ */e.jsx(c,{cssClasses:v,customAttributes:X,leftHelperText:y,leftHelperTextId:te,rightHelperText:F,rightHelperTextId:se})]})});export{p as SliderStandAlone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as e,useEffect as r}from"react";import{
|
|
1
|
+
import{useState as e,useEffect as r}from"react";import{hasScroll as t}from"../../../lib/utils/scroll/hasScroll.js";const o=({disabled:o=!1,ref:l})=>{const[s,c]=e(!1);return r(()=>{const e=l.current?.querySelector?.("[data-table-scrollable-container]");let r;if(e instanceof HTMLElement&&!o){const o=e=>{c(t(e))};o(e),r=new ResizeObserver(()=>{o(e)}),r.observe(e)}return o&&c(!1),()=>{r?.disconnect()}},[o]),{hasScroll:s}};export{o as useTableHasScroll};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as e}from"react";
|
|
1
|
+
import{useEffect as e}from"react";const t=({disabled:t=!1,headBoxShadow:s,leftBoxShadow:a,ref:o,rightBoxShadow:r})=>(e(()=>{const e=o.current,l=e?.querySelector("[data-table-scrollable-container]");let c;const n=()=>{if(!l)return;const t=l.querySelector("[data-table-head]");if(t instanceof HTMLElement&&t.hasAttribute("data-sticky")&&s&&(l.scrollTop?t.classList.add(s):t.classList.remove(s)),a){const t=e?.querySelector("[data-table-left-shadow]");t instanceof HTMLElement&&(l.scrollLeft?t.classList.add(a):t.classList.remove(a))}if(r){const t=e?.querySelector("[data-table-right-shadow]");t instanceof HTMLElement&&(l.scrollLeft+l.clientWidth<l.scrollWidth?t.classList.add(r):t.classList.remove(r))}};return l instanceof HTMLElement&&!t&&(n(),l?.addEventListener("scroll",n),c=new ResizeObserver(()=>{n()}),c.observe(l)),()=>{l?.removeEventListener("scroll",n),c?.disconnect()}},[t]),{});export{t as useTableShadow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as e}from"react";import{
|
|
1
|
+
import{useEffect as e}from"react";import{hasHorizontalScroll as t}from"../../../lib/utils/scroll/hasScroll.js";const r=({disabled:r=!1,ref:l})=>(e(()=>{const e=l.current?.querySelector("[data-table-scrollable-container]"),o=l.current?.querySelector("[data-table-left-shadow]");let a;if(e instanceof HTMLElement&&!r){const r=e=>{const r=t(e),l=e.querySelectorAll("[data-table-row]");let a=0;l.forEach(e=>{const t=Array.from(e.querySelectorAll('[data-sticky="left"]'));let l=0;t.forEach(e=>{e instanceof HTMLElement&&(e.style.left=r?`${l}px`:"auto",l+=e.offsetWidth)}),a=Math.max(a,l)}),o instanceof HTMLElement&&(o.style.left=`${a}px`)};r(e),a=new ResizeObserver(()=>{r(e)}),a.observe(e)}return()=>{a?.disconnect()}},[r]),{});export{r as useTableStickyLeftColumns};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{useEffect as t}from"react";import{hasHorizontalScroll as e,hasVerticalScroll as r}from"../../../lib/utils/scroll/hasScroll.js";const o=({disabled:o=!1,ref:l})=>(t(()=>{const t=l.current?.querySelector("[data-table-scrollable-container]"),a=l.current?.querySelector("[data-table-right-shadow]");let c;if(t instanceof HTMLElement&&!o){const o=t=>{const o=e(t),l=t.querySelectorAll("[data-table-row]");let c=0;if(l.forEach(t=>{const e=Array.from(t.querySelectorAll('[data-sticky="true"], [data-sticky="right"]')).reverse();let r=0;e.forEach(t=>{t instanceof HTMLElement&&(t.style.right=o?`${r}px`:"auto",r+=t.offsetWidth)}),c=Math.max(c,r)}),a instanceof HTMLElement){if(r(t)){const e=t.offsetWidth-t.clientWidth;c+=e}a.style.right=`${c}px`}};o(t),c=new ResizeObserver(()=>{o(t)}),c.observe(t)}return()=>{c?.disconnect()}},[o]),{});export{o as useTableStickyRightColumns};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as t}from"../../_virtual/jsx-runtime.js";import{forwardRef as e,useId as a}from"react";import{Text as s}from"../text/text.js";import{ElementOrIcon as i}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{ItemRove as o}from"../../lib/components/itemRove/itemRove.js";import{useActiveBreakpoints as l}from"../../lib/hooks/useMediaDevice/useActiveBreakpoints.js";import{STATES as n}from"../../lib/types/states/states.js";import{classNames as r}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as c}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{
|
|
2
|
-
return t.jsxs("div",{ref:S,className:p?.tabs,"data-testid":
|
|
1
|
+
import{j as t}from"../../_virtual/jsx-runtime.js";import{forwardRef as e,useId as a}from"react";import{Text as s}from"../text/text.js";import{ElementOrIcon as i}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{ItemRove as o}from"../../lib/components/itemRove/itemRove.js";import{useActiveBreakpoints as l}from"../../lib/hooks/useMediaDevice/useActiveBreakpoints.js";import{STATES as n}from"../../lib/types/states/states.js";import{classNames as r}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as c}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processTextProp as b}from"../../lib/utils/process/processCommonProp.js";import{useTabs as d}from"./hooks/useTabs/useTabs.js";const m=e(({allowFocusTabPanel:e=!0,autoWidth:m=!1,content:u,cssClasses:p,device:h,hideLabelForSingleTab:$,leftControlAriaLabel:j,leftIcon:f,maxTabsInView:x=3,onSelectTab:v,rightControlAriaLabel:C,rightIcon:N,selectedTab:T,tabs:g,unMountContent:I=!0,...k},S)=>{const{isMobile:y}=l(),A=`tabs-${a().replace(/:/g,"")}`,E=`${A}-tab-list`,L=`${A}-tab-panel`,w=g?.length??0,D=Math.min(w,x),{focus:F,handleClickIcon:M,handleClickTab:O,listEl:P,position:R}=d({numTabsInView:D,selectedTab:T,tabsLength:w}),V=0===R,W=R>=w-D,B=k["data-testid"]||"tabs",U=c(k),_=e=>{const a="left"===e,s=a?V:W;return w>D?/* @__PURE__ */t.jsx("button",{"aria-label":a?j:C,className:p?.arrowiconcontainer,"data-position":a?"left":"right","data-testid":`${B}-icon-${e}`,disabled:s,tabIndex:0,type:"button",onClick:()=>{s||M(!a)},children:/* @__PURE__ */t.jsx(i,{className:p?.icon,customAttributes:{"data-disabled":s},"data-position":a?"left":"right",...a?f:N})}):null};/* @__PURE__ */
|
|
2
|
+
return t.jsxs("div",{ref:S,className:p?.tabs,"data-testid":B,...U,children:[
|
|
3
3
|
/* @__PURE__ */t.jsxs("div",{className:p?.container,children:[_("left"),
|
|
4
|
-
/* @__PURE__ */t.jsx("div",{ref:
|
|
5
|
-
return t.jsx("div",{className:p?.tabcontainer,"data-testid":`${
|
|
4
|
+
/* @__PURE__ */t.jsx("div",{ref:P,className:p?.tabbuttonscontainer,id:E,role:"tablist",children:g?.map((e,a)=>{const i=T===a,l=i?n.SELECTED:n.UNSELECTED,d=a>=R&&a<R+D,u={"data-state":l};/* @__PURE__ */
|
|
5
|
+
return t.jsx("div",{className:p?.tabcontainer,"data-testid":`${B}-tab-${a}`,...c(u),style:{minWidth:y?`calc(100% / ${D})`:"auto",width:m?"auto":`calc(100% / ${w})`},children:w>1?/* @__PURE__ */t.jsx(o,{ariaDisabled:y&&!d||e.disabled,ariaSelected:i,asElement:"button",checkIsFirstTime:!0,classNames:r(p?.tabbutton,{[`${p?.firsttabbutton}`]:0===a,[`${p?.lasttabbutton}`]:a===w-1}),customAttributes:u,disabled:y&&!d||e.disabled,focus:F===a,id:`${A}-tab-${a}`,index:a,preventScrollOnFocus:!0,role:"tab",type:"button",onSelectItem:()=>{v?.(a),O(a)},children:/* @__PURE__ */t.jsx(s,{additionalClasses:{text:p?.label},component:"span",customAttributes:u,"data-hidden":!!$,...b(e)})}):/* @__PURE__ */t.jsx("div",{className:r(p?.onetabcontainer,{[`${p?.tabbutton}`]:!!$}),id:`${A}-tab-${a}`,role:"tab",children:/* @__PURE__ */t.jsx(s,{additionalClasses:{text:p?.label},"data-hidden":!!$,...b(e),children:b(e).children})})},`${B}-tab-${a.toString()}`)})}),_("right")]}),(()=>{const a={role:"tabpanel",tabIndex:e?0:-1};return I?null!=T&&/* @__PURE__ */t.jsx("div",{"aria-labelledby":`${A}-tab-${T}`,className:p?.contentcontainer,...a,children:u?.[T]}):u?.map((e,s)=>/* @__PURE__ */t.jsx("div",{"aria-labelledby":`${A}-tab-${s}`,className:p?.contentcontainer,id:`${L}-${s}`,style:{display:T===s?"block":"none"},...a,children:e},`${A}-${s.toString()}-tab`))})()]})});export{m as TabsStandAlone};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
1
|
+
import{j as t}from"../../_virtual/jsx-runtime.js";import{forwardRef as o}from"react";import{Text as s}from"../text/text.js";import{CustomComponent as e}from"../../lib/components/customComponent/customComponent.js";import{ElementOrIcon as m}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{pickCustomAttributes as r}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processIconProp as n,processTextProp as i}from"../../lib/utils/process/processCommonProp.js";const c=o(({component:o="div",cssClasses:c,icon:p,label:l,...a},j)=>{const u=r(a);/* @__PURE__ */
|
|
2
|
+
return t.jsx(e,{ref:j,className:c?.tag,component:o,"data-testid":"tag",...u,children:/* @__PURE__ */t.jsxs(t.Fragment,{children:[
|
|
3
|
+
/* @__PURE__ */t.jsx(m,{className:c?.icon,...n(p)}),
|
|
4
|
+
/* @__PURE__ */t.jsx(s,{additionalClasses:{text:c?.label},component:"span",...i(l)})]})})});export{c as TagStandAlone};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as
|
|
2
|
-
/* @__PURE__ */
|
|
3
|
-
/* @__PURE__ */
|
|
1
|
+
import{j as r}from"../../../_virtual/jsx-runtime.js";import{Text as s}from"../../text/text.js";import{ElementOrIcon as e}from"../../../lib/components/elementOrIcon/elementOrIcon.js";import{STATES as t}from"../../../lib/types/states/states.js";import{processTextProp as o}from"../../../lib/utils/process/processCommonProp.js";const i=({cssClasses:i,customAttributtes:m,errorAriaLiveType:n,errorIcon:c,errorMessage:a,id:l,state:p})=>/* @__PURE__ */r.jsx("div",{"aria-live":n,className:i?.errorcontainer,id:l,...m,children:!!o(a).children&&p===t.ERROR&&/* @__PURE__ */r.jsxs(r.Fragment,{children:[
|
|
2
|
+
/* @__PURE__ */r.jsx(e,{className:i?.erroricon,customAttributes:m,...c}),
|
|
3
|
+
/* @__PURE__ */r.jsx(s,{additionalClasses:{text:i?.errormessage},component:"p",customAttributes:m,...o(a),children:o(a).children})]})});export{i as ErrorStandAlone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"../../../_virtual/jsx-runtime.js";import{Text as t}from"../../text/text.js";import{
|
|
1
|
+
import{j as s}from"../../../_virtual/jsx-runtime.js";import{Text as t}from"../../text/text.js";import{processTextProp as e}from"../../../lib/utils/process/processCommonProp.js";const o=({cssClasses:o,customAttributtes:m,helpMessage:r,id:i})=>/* @__PURE__ */s.jsx(t,{additionalClasses:{text:o?.helpmessage},component:"small",customAttributes:m,id:i,...e(r)});export{o as HelpMessageStandAlone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"../../../_virtual/jsx-runtime.js";import{Text as s}from"../../text/text.js";import{
|
|
1
|
+
import{j as t}from"../../../_virtual/jsx-runtime.js";import{Text as s}from"../../text/text.js";import{processTextProp as e}from"../../../lib/utils/process/processCommonProp.js";const o=({cssClasses:o,customAttributtes:i,title:r})=>r?/* @__PURE__ */t.jsx("div",{className:o?.titlecontainer,...i,children:/* @__PURE__ */t.jsx(s,{additionalClasses:{text:o?.title},customAttributes:i,...e(r),component:e(r).component??"p",children:e(r).children})}):null;export{o as TitleStandAlone};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as t,useId as s}from"react";import{LabelStandAlone as r}from"../label/labelStandAlone.js";import{STATES as a}from"../../lib/types/states/states.js";import{pickCustomAttributes as o}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{
|
|
2
|
-
return e.jsxs("div",{ref:_,className:
|
|
3
|
-
/* @__PURE__ */e.jsx(d,{cssClasses:
|
|
4
|
-
/* @__PURE__ */e.jsxs("div",{className:
|
|
5
|
-
/* @__PURE__ */e.jsxs("div",{className:
|
|
6
|
-
/* @__PURE__ */e.jsx(r,{asteriskCssClasses:
|
|
7
|
-
/* @__PURE__ */e.jsx("textarea",{"aria-describedby":m({errorMessage:i(j).children,helpMessage:i(g).children,state:B,textAreaErrorId:H,textAreaHelpTextId:F}),className:
|
|
8
|
-
/* @__PURE__ */e.jsxs("div",{className:
|
|
9
|
-
/* @__PURE__ */e.jsxs("div",{className:
|
|
10
|
-
/* @__PURE__ */e.jsx(l,{cssClasses:
|
|
11
|
-
/* @__PURE__ */e.jsx(n,{cssClasses:
|
|
1
|
+
import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as t,useId as s}from"react";import{LabelStandAlone as r}from"../label/labelStandAlone.js";import{STATES as a}from"../../lib/types/states/states.js";import{pickCustomAttributes as o}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processTextProp as i}from"../../lib/utils/process/processCommonProp.js";import{ErrorStandAlone as l}from"./components/errorStandAlone.js";import{HelpMessageStandAlone as n}from"./components/helpMessageStandAlone.js";import{TextCount as c}from"./components/textCount/textCount.js";import{TitleStandAlone as d}from"./components/titleStandAlone.js";import{buildAriaDescribedBy as m}from"./utils/aria.utils.js";const u=t(({additionalInfo:t,counterVariant:u,cssClasses:p,errorAriaLiveType:x="assertive",errorIcon:h,errorMessage:j,height:b,helpMessage:g,id:C,label:f,labelInsideTextArea:A,maxLength:v,onBlur:I,onChange:y,onFocus:E,placeholder:L,required:T,screenReaderTextCount:M,spellCheck:k,state:B,title:D,value:N,...S},_)=>{const q=`textarea-${s().replace(/:/g,"")}`,$=C??q,F=`${$}HelpText`,H=`${$}Error`,P=`${$}TextCount`,R=o({"data-state":B}),w=[a.DISABLED_EMPTY,a.DISABLED_FILLED].includes(B);/* @__PURE__ */
|
|
2
|
+
return e.jsxs("div",{ref:_,className:p?.text_area,"data-testid":"text-area",...R,...o(S),children:[
|
|
3
|
+
/* @__PURE__ */e.jsx(d,{cssClasses:p,customAttributtes:R,title:D}),
|
|
4
|
+
/* @__PURE__ */e.jsxs("div",{className:p?.labeltextareacontainer,role:"button",style:{height:A?b:void 0},tabIndex:0,onClick:()=>document.getElementById($)?.focus(),onKeyDown:e=>{"Enter"===e.key&&document.getElementById($)?.focus()},children:[
|
|
5
|
+
/* @__PURE__ */e.jsxs("div",{className:p?.labelandadditionalinfocontainer,children:[
|
|
6
|
+
/* @__PURE__ */e.jsx(r,{asteriskCssClasses:p?.required,customAttributes:R,inputId:$,required:T,textCssClasses:p?.label,...i(f),children:i(f).children}),t]}),
|
|
7
|
+
/* @__PURE__ */e.jsx("textarea",{"aria-describedby":m({errorMessage:i(j).children,helpMessage:i(g).children,state:B,textAreaErrorId:H,textAreaHelpTextId:F}),className:p?.textarea,disabled:w,id:$,maxLength:v,placeholder:L,required:T,spellCheck:k,style:{height:b||void 0},value:N,onBlur:I,onChange:y,onFocus:E,...R,children:N})]}),
|
|
8
|
+
/* @__PURE__ */e.jsxs("div",{className:p?.bottomcontainer,...R,children:[
|
|
9
|
+
/* @__PURE__ */e.jsxs("div",{className:p?.helpmessageerrorcontainer,...R,children:[
|
|
10
|
+
/* @__PURE__ */e.jsx(l,{cssClasses:p,customAttributtes:R,errorAriaLiveType:x,errorIcon:h,errorMessage:j,id:H,state:B}),
|
|
11
|
+
/* @__PURE__ */e.jsx(n,{cssClasses:p,customAttributtes:R,helpMessage:g,id:F})]}),!!u&&/* @__PURE__ */e.jsx(c,{additionalClasses:{letftext:p?.counterleft,righttext:p?.counterright,text_count:p?.counter},currentCharacters:N?.length??0,id:P,maxLength:v,screenReaderText:M,variant:u})]})]})});export{u as TextAreaStandAlone};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as o,useRef as t,useImperativeHandle as
|
|
2
|
-
return e.jsx(
|
|
3
|
-
/* @__PURE__ */e.jsx("div",{className:m?.iconwrapper,"data-testid":`${u}-right-icon`,style:{opacity:A?1:0},children:/* @__PURE__ */e.jsx(
|
|
4
|
-
/* @__PURE__ */e.jsx("div",{className:m?.iconwrapper,"data-testid":`${u}-left-icon`,style:{opacity:T?1:0},children:/* @__PURE__ */e.jsx(
|
|
1
|
+
import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as o,useRef as t,useImperativeHandle as a}from"react";import{CustomComponent as s}from"../../lib/components/customComponent/customComponent.js";import{ElementOrIcon as i}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{pickCustomAttributes as n}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processIconProp as r}from"../../lib/utils/process/processCommonProp.js";import{buildComponentProps as l}from"./utils/buildComponentProps.js";import{useToggleTransform as c}from"./utils/thumbTransformCalculations.js";const d=({checked:o=!1,component:d="button",cssClasses:m,dataTestId:u="toggle",disabled:b=!1,id:p,leftIcon:f,name:j,onBlur:h,onClick:v,onFocus:y,onKeyDown:k,onMouseEnter:x,onMouseLeave:C,rightIcon:I,tabIndex:N,value:g,...w},M)=>{const A=o&&!!I,T=!o&&!!f,B="button"!==d,D=t(null),E=t(null),{transform:F}=c({checked:o,thumbRef:E,trackRef:D});a(M,()=>D.current,[]);const K=n(w),L=l({"aria-describedby":w["aria-describedby"],"aria-label":w["aria-label"],"aria-labelledby":w["aria-labelledby"],checked:o,decorative:B,disabled:b,id:p,name:j,onBlur:h,onClick:v,onFocus:y,onKeyDown:k,onMouseEnter:x,onMouseLeave:C,tabIndex:N,value:g});/* @__PURE__ */
|
|
2
|
+
return e.jsx(s,{...K,...L,ref:D,className:m?.track,component:d,"data-checked":!!o||void 0,"data-disabled":!!b||void 0,"data-testid":u,children:/* @__PURE__ */e.jsxs("span",{ref:E,className:m?.thumb,"data-checked":!!o||void 0,"data-disabled":!!b||void 0,style:{transform:F},children:[
|
|
3
|
+
/* @__PURE__ */e.jsx("div",{className:m?.iconwrapper,"data-testid":`${u}-right-icon`,style:{opacity:A?1:0},children:/* @__PURE__ */e.jsx(i,{className:m?.icon,"data-disabled":!!b||void 0,...r(I)})}),
|
|
4
|
+
/* @__PURE__ */e.jsx("div",{className:m?.iconwrapper,"data-testid":`${u}-left-icon`,style:{opacity:T?1:0},children:/* @__PURE__ */e.jsx(i,{className:m?.icon,"data-disabled":!!b||void 0,...r(f)})})]})})};d.displayName="ToggleStandAlone";const m=o(d);export{m as ToggleStandalone};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as o}from"../../_virtual/jsx-runtime.js";/* empty css */import{useId as e}from"react";import{Text as t}from"../text/text.js";import{ElementOrIcon as i}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{useActiveBreakpoints as s}from"../../lib/hooks/useMediaDevice/useActiveBreakpoints.js";import{POSITIONS as l}from"../../lib/types/positions/positions.js";import{classNames as r}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as n}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{
|
|
2
|
-
return o.jsx("div",{className:"kbt-tooltip","data-testid":L,children:/* @__PURE__ */o.jsx(m,{childrenAsButton:j,disabled:!0,children:h})});const to=b({contentId:Q,hasContent:!!
|
|
3
|
-
/* @__PURE__ */o.jsxs("div",{className:y?.tooltipinternalcontainer,children:[(Z||oo)&&!!N&&/* @__PURE__ */o.jsx("div",{ref:
|
|
4
|
-
/* @__PURE__ */o.jsxs("div",{className:r(y?.title,y?.headercontainer),style:(ro=!!W.children,no=!!u?.icon,ro&&no?{justifyContent:"space-between"}:ro?{justifyContent:"flex-end"}:no?{justifyContent:"flex-start"}:{display:"none"}),children:[
|
|
5
|
-
/* @__PURE__ */o.jsx("div",{ref:f,"aria-label":
|
|
1
|
+
import{j as o}from"../../_virtual/jsx-runtime.js";/* empty css */import{useId as e}from"react";import{Text as t}from"../text/text.js";import{ElementOrIcon as i}from"../../lib/components/elementOrIcon/elementOrIcon.js";import{useActiveBreakpoints as s}from"../../lib/hooks/useMediaDevice/useActiveBreakpoints.js";import{POSITIONS as l}from"../../lib/types/positions/positions.js";import{classNames as r}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as n}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{processTextProp as a,processIconProp as c}from"../../lib/utils/process/processCommonProp.js";import{IconHost as d}from"../icon/iconHost.js";import{Popover as p}from"../popover/popover.js";import{TooltipTrigger as m}from"./components/tooltipTrigger.js";import{getAriaDescriptorsBy as b}from"./utils/tooltip.utils.js";const v=({align:v,children:h,childrenAsButton:j=!0,closeIcon:u,content:g,contentHasScroll:x,contentRef:f,contentScrollArias:C,cssClasses:y,disabled:k,dragIcon:N,dragIconRef:A,labelRef:T,mediaDevice:w,onCloseIconClick:I,onPopoverCloseInternally:D,onTooltipFocus:_,onTooltipKeyDown:B,onTriggerClick:M,onTriggerKeyDown:$,onTriggerMouseDown:F,onTriggerMouseUp:O,popover:K,popoverOpen:R,title:P,tooltipAriaLabel:H,tooltipAsModal:S,tooltipRef:U,triggerAsButton:z,...E})=>{const L=E["data-testid"]||"tooltip",q=n(E),G=`tooltip-${e().replace(/:/g,"")}`,J=`${G}-title`,Q=`${G}-content`,V=a(g),W=a(P),X="string"==typeof V.children,{isDesktop:Y,isMobile:Z,isTablet:oo}=s(),eo=Y||oo;if(k)/* @__PURE__ */
|
|
2
|
+
return o.jsx("div",{className:"kbt-tooltip","data-testid":L,children:/* @__PURE__ */o.jsx(m,{childrenAsButton:j,disabled:!0,children:h})});const to=b({contentId:Q,hasContent:!!g,hasTitle:!!W.children,titleId:J}),io={"data-align":v||l.TOP},so=n(io),lo=/* @__PURE__ */o.jsxs("div",{ref:U,"aria-label":eo?H:void 0,"aria-labelledby":eo?b({hasTitle:!!W.children,titleId:J}):void 0,"aria-modal":!(!eo||!S)||void 0,className:r("kbt-tooltip__external-container",y?.tooltipexternalcontainer),"data-testid":`${L}-content`,id:G,role:eo?S?"dialog":"tooltip":void 0,...eo&&{onFocus:_,onKeyDown:B},...q,children:[
|
|
3
|
+
/* @__PURE__ */o.jsxs("div",{className:y?.tooltipinternalcontainer,children:[(Z||oo)&&!!N&&/* @__PURE__ */o.jsx("div",{ref:A,className:y?.dragiconcontainer,"data-testid":`${L}-drag`,children:/* @__PURE__ */o.jsx(i,{className:y?.dragicon,...N})}),
|
|
4
|
+
/* @__PURE__ */o.jsxs("div",{className:r(y?.title,y?.headercontainer),style:(ro=!!W.children,no=!!u?.icon,ro&&no?{justifyContent:"space-between"}:ro?{justifyContent:"flex-end"}:no?{justifyContent:"flex-start"}:{display:"none"}),children:[c(u).icon&&/* @__PURE__ */o.jsx("div",{className:y?.closebuttoncontainer,children:/* @__PURE__ */o.jsx(d,{...c(u),className:y?.closebuttonicon,icon:c(u).icon,onClick:I})}),!!W.children&&/* @__PURE__ */o.jsx("div",{className:"kbt-tooltip__title",id:J,children:/* @__PURE__ */o.jsx(t,{additionalClasses:{text:y?.title},component:"h2",...W,children:W.children})})]}),
|
|
5
|
+
/* @__PURE__ */o.jsx("div",{ref:f,"aria-label":x?C?.["aria-label"]:void 0,"aria-labelledby":x?C?.["aria-labelledby"]:void 0,className:"kbt-tooltip__inner-content",role:x?"region":void 0,...x&&{tabIndex:0},children:!!g&&/* @__PURE__ */o.jsx("div",{className:r("kbt-tooltip__paragraph",y?.paragraphcontainer,{[`${y?.divider}`]:!!W.children}),id:Q,children:X?/* @__PURE__ */o.jsx(t,{additionalClasses:{text:y?.paragraph},...V}):V.children})})]}),
|
|
6
6
|
/* @__PURE__ */o.jsx("div",{...so,className:r("kbt-tooltip__arrow",y?.arrowsize,y?.tooltipalignstyles,y?.arrowcontainer),children:/* @__PURE__ */o.jsx("div",{className:y?.arrow})})]});var ro,no;/* @__PURE__ */
|
|
7
|
-
return o.jsxs("div",{ref:
|
|
8
|
-
/* @__PURE__ */o.jsx(m,{ariaDescribedBy:S||!eo&&!R?void 0:to,childrenAsButton:j,triggerAsButton:z,onClick:M,onKeyDown:$,onMouseDown:F,onMouseUp:O,children:h}),eo?lo:/* @__PURE__ */o.jsx(p,{additionalClasses:y?.popover?{arrow:"",popover:y.popover.popover||""}:void 0,"aria-label":K?.["aria-label"]||
|
|
7
|
+
return o.jsxs("div",{ref:T,className:"kbt-tooltip","data-testid":L,children:[
|
|
8
|
+
/* @__PURE__ */o.jsx(m,{ariaDescribedBy:S||!eo&&!R?void 0:to,childrenAsButton:j,triggerAsButton:z,onClick:M,onKeyDown:$,onMouseDown:F,onMouseUp:O,children:h}),eo?lo:/* @__PURE__ */o.jsx(p,{additionalClasses:y?.popover?{arrow:"",popover:y.popover.popover||""}:void 0,"aria-label":K?.["aria-label"]||H,"aria-labelledby":b({hasTitle:!!W.children,titleId:J}),"aria-modal":S||void 0,component:"div",disableAutoFocusFirstDescendantAfterClose:!0,disableTrapFocus:!1,open:R,preventCloseOnClickElements:[T?.current],role:S?"dialog":"tooltip",strategy:"absolute",onClose:D,...K,children:lo})]})};export{v as TooltipStandAlone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"../../_virtual/jsx-runtime.js";import{forwardRef as e,useRef as t,useImperativeHandle as r}from"react";import{
|
|
1
|
+
import{j as o}from"../../_virtual/jsx-runtime.js";import{forwardRef as e,useRef as t,useImperativeHandle as r}from"react";import{ENTER as s}from"../../lib/constants/keyboardKeys/keyboardKeys.js";import{useClassName as l}from"../../lib/hooks/useClassName/useClassName.js";import{useActiveBreakpoints as i}from"../../lib/hooks/useMediaDevice/useActiveBreakpoints.js";import{useScrollDetection as n}from"../../lib/hooks/useScrollDetection/useScrollDetection.js";import{useSwipeDown as a}from"../../lib/hooks/useSwipeDown/useSwipeDown.js";import{useTrapFocus as p}from"../../lib/hooks/useTrapFocus/useTrapFocus.js";import{isKeyPressed as c}from"../../lib/utils/keyboard/keyboard.js";import{useTooltip as u}from"./hooks/useTooltip.js";import{useTooltipAsModal as m}from"./hooks/useTooltipAsModal.js";import{TooltipStandAlone as f}from"./tooltipStandAlone.js";const d=e(function({additionalClasses:e,align:d,closeIcon:T,onOpenClose:v,popover:g,tooltipAriaLabel:k,tooltipAsModal:b,variant:C,...j},D){const M=l({additionalClassNames:e,component:"TOOLTIP",variant:C}),{device:h,isDesktop:y,isMobile:A,isTablet:R}=i(),w=y||R,S=t(null),F=t(null),I=m({propTooltipAsModal:b,styleTooltipAsModal:b});r(D,()=>S.current);const{allowFocusOpenTooltip:O,hideTooltip:L,open:P,placement:W,showTooltip:x}=u({additionalClasses:e,align:d||"top",labelRef:S,onOpenClose:v,tooltipAsModal:I,tooltipRef:F,variant:C}),{handleScrollDetection:K,hasScroll:N}=n({autoFocus:!0}),B=t(!1),{setDragIconRef:E,setPopoverRef:H}=a({onClose:L});return p({ref:F,trapFocus:P&&I}),/* @__PURE__ */o.jsx(f,{...j,align:W,contentHasScroll:N,contentRef:K,cssClasses:M,dragIconRef:E,labelRef:S,mediaDevice:h,popover:{...g,popoverContainerRef:H},popoverOpen:P,tooltipAriaLabel:k,tooltipAsModal:I,tooltipRef:F,onCloseIconClick:o=>{T?.onClick?.(o),L()},onPopoverCloseInternally:()=>{g?.onClose?.(),L()},onTooltipFocus:o=>{I||(o.preventDefault(),o.stopPropagation())},onTriggerClick:o=>{if(w){if(!I)return;return P?void(F.current?.contains(o.target)||L()):void x()}P?F.current?.contains(o.target)||L():x()},onTriggerKeyDown:o=>{c(o.key,s.key)&&!P&&(x(),o.preventDefault())},onTriggerMouseDown:()=>{B.current=!0},onTriggerMouseUp:()=>{B.current=!1},onWrapperBlur:o=>{I||o.currentTarget.contains(o.relatedTarget)||L()},onWrapperFocus:()=>{B.current||I||!O.current||A||x()},onWrapperMouseEnter:()=>{!I&&w&&x()},onWrapperMouseLeave:()=>{!I&&w&&L()}})});export{d as Tooltip,d as TooltipUnControlled};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"../../../_virtual/jsx-runtime.js";import{forwardRef as r}from"react";import{Text as t}from"../../../components/text/text.js";import{ElementOrIcon as e}from"../elementOrIcon/elementOrIcon.js";import{classNames as o}from"../../utils/classNames/classNames.js";import{pickCustomAttributes as m}from"../../utils/pickCustomAttributes/pickCustomAttributes.js";import{
|
|
2
|
-
return s.jsx("div",{ref:
|
|
3
|
-
/* @__PURE__ */s.jsx(e,{className:r?.icon,...i(
|
|
4
|
-
/* @__PURE__ */s.jsx(t,{additionalClasses:{text:r?.typography},...c
|
|
1
|
+
import{j as s}from"../../../_virtual/jsx-runtime.js";import{forwardRef as r}from"react";import{Text as t}from"../../../components/text/text.js";import{ElementOrIcon as e}from"../elementOrIcon/elementOrIcon.js";import{classNames as o}from"../../utils/classNames/classNames.js";import{pickCustomAttributes as m}from"../../utils/pickCustomAttributes/pickCustomAttributes.js";import{processIconProp as i,processTextProp as n}from"../../utils/process/processCommonProp.js";const a=r(({cssClasses:r,icon:a,message:c,...l},p)=>{if(!c)return null;const j=m(l);/* @__PURE__ */
|
|
2
|
+
return s.jsx("div",{ref:p,...j,className:o("kbt-error-message__container",r?.error_message,{"kbt-sr-only":!l.show}),id:l.id,children:l.show&&/* @__PURE__ */s.jsxs(s.Fragment,{children:[
|
|
3
|
+
/* @__PURE__ */s.jsx(e,{className:r?.icon,...i(a)}),
|
|
4
|
+
/* @__PURE__ */s.jsx(t,{additionalClasses:{text:r?.typography},...n(c)})]})})});export{a as ErrorMessageStandAlone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as e,useCallback as
|
|
1
|
+
import{useRef as e,useCallback as n}from"react";import{isContentVisibleEnough as t}from"./utils/contentVisibility.js";const r=({minVisibleHeight:r=100,onContentInvisible:o,onContentVisible:i})=>{const c=e(null),s=e(null),l=e(),u=e(),b=e(void 0),v=n(()=>{const e=c.current,n=s.current;e&&n&&(i?i():(e.style.overflowY="",n.style.overflowY=""))},[i]),f=n(()=>{const e=c.current,n=s.current;e&&n&&(o?o():(e.style.overflowY="auto",n.style.overflowY="visible"))},[o]);return{handleContentVisibility:n(({container:e,content:n})=>{if(c.current=e,s.current=n,e&&n){const o=()=>{const o=t({container:e,content:n,minVisibleHeight:r});o!==b.current&&(o?v():f()),b.current=o};o(),l.current=new ResizeObserver(()=>{o()}),u.current=new ResizeObserver(()=>{o()}),l.current.observe(n),l.current.observe(e)}else l.current?.disconnect(),u.current?.disconnect()},[r,v,f])}};export{r as useContentVisibility};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as r,useRef as e,useCallback as
|
|
1
|
+
import{useState as r,useRef as e,useCallback as c}from"react";import{hasScroll as o}from"../../utils/scroll/hasScroll.js";const t=({autoFocus:t=!1}={})=>{const[s,n]=r(!1),l=e(),u=e(!1);return{handleScrollDetection:c(r=>{if(r){const e=r=>{const e=o(r);n(e),t&&e&&!u.current&&(r.focus(),u.current=!0)};e(r),l.current=new ResizeObserver(()=>{e(r)}),l.current.observe(r)}else l.current?.disconnect()},[t]),hasScroll:s}};export{t as useScrollDetection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const r=(r,...s)=>s.some(s=>Array.isArray(s)?s.includes(r):r===s);export{r as isKeyPressed};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isValidElement as t}from"react";const e=(e,n={})=>{const{allowReactElements:r=!0,extractContent:l=!0,maxLength:c,propertyName:o="children"}=n;if(null==e)return"children"===o?{children:null}:{};if("string"==typeof e){const t=c&&e.length>c?e.substring(0,c):e;return{[o]:t}}if(r&&t(e))return{children:e};if("object"==typeof e&&null!==e){if(l&&"content"in e){const t=e.content,n=c&&"string"==typeof t?t.substring(0,c):t;return{...e,children:n}}return e}return"children"===o?{children:null}:{}},n=t=>e(t,{allowReactElements:!1,extractContent:!1,propertyName:"icon"}),r=(t,n)=>e(t,{allowReactElements:!0,extractContent:!0,maxLength:n,propertyName:"children"});export{e as processCommonProp,n as processIconProp,r as processTextProp};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generate bundle size information for each component
|
|
5
|
+
* This script analyzes the dist folder and generates a JSON file with size information
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
import { gzipSync } from 'zlib';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const rootDir = path.resolve(__dirname, '..');
|
|
15
|
+
|
|
16
|
+
// Paths
|
|
17
|
+
const distEsmDir = path.join(rootDir, 'dist/esm/components');
|
|
18
|
+
const outputFile = path.join(rootDir, '.storybook/bundle-sizes.json');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get file size in bytes
|
|
22
|
+
*/
|
|
23
|
+
function getFileSize(filePath) {
|
|
24
|
+
try {
|
|
25
|
+
const stats = fs.statSync(filePath);
|
|
26
|
+
return stats.size;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get gzipped size of file
|
|
34
|
+
*/
|
|
35
|
+
function getGzipSize(filePath) {
|
|
36
|
+
try {
|
|
37
|
+
const content = fs.readFileSync(filePath);
|
|
38
|
+
const gzipped = gzipSync(content);
|
|
39
|
+
return gzipped.length;
|
|
40
|
+
} catch (error) {
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Format bytes to human readable
|
|
47
|
+
*/
|
|
48
|
+
function formatBytes(bytes) {
|
|
49
|
+
if (bytes === 0) return '0 B';
|
|
50
|
+
const k = 1024;
|
|
51
|
+
const sizes = ['B', 'KB', 'MB'];
|
|
52
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
53
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Get component files
|
|
58
|
+
*/
|
|
59
|
+
function getComponentFiles(componentPath) {
|
|
60
|
+
const files = {
|
|
61
|
+
css: [],
|
|
62
|
+
js: [],
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const entries = fs.readdirSync(componentPath, { withFileTypes: true });
|
|
67
|
+
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
const fullPath = path.join(componentPath, entry.name);
|
|
70
|
+
|
|
71
|
+
if (entry.isDirectory()) {
|
|
72
|
+
// Recursively search subdirectories
|
|
73
|
+
const subFiles = getComponentFiles(fullPath);
|
|
74
|
+
files.css.push(...subFiles.css);
|
|
75
|
+
files.js.push(...subFiles.js);
|
|
76
|
+
} else if (entry.isFile()) {
|
|
77
|
+
if (entry.name.endsWith('.css')) {
|
|
78
|
+
files.css.push(fullPath);
|
|
79
|
+
} else if (entry.name.endsWith('.js')) {
|
|
80
|
+
files.js.push(fullPath);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
} catch (error) {
|
|
85
|
+
// Directory doesn't exist
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return files;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Calculate sizes for a component
|
|
93
|
+
*/
|
|
94
|
+
function calculateComponentSizes(componentName, componentPath) {
|
|
95
|
+
const files = getComponentFiles(componentPath);
|
|
96
|
+
|
|
97
|
+
let jsSize = 0;
|
|
98
|
+
let jsGzipSize = 0;
|
|
99
|
+
let cssSize = 0;
|
|
100
|
+
let cssGzipSize = 0;
|
|
101
|
+
|
|
102
|
+
// Sum JS files
|
|
103
|
+
for (const file of files.js) {
|
|
104
|
+
jsSize += getFileSize(file);
|
|
105
|
+
jsGzipSize += getGzipSize(file);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Sum CSS files
|
|
109
|
+
for (const file of files.css) {
|
|
110
|
+
cssSize += getFileSize(file);
|
|
111
|
+
cssGzipSize += getGzipSize(file);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const totalSize = jsSize + cssSize;
|
|
115
|
+
const totalGzipSize = jsGzipSize + cssGzipSize;
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
component: componentName,
|
|
119
|
+
sizes: {
|
|
120
|
+
js: {
|
|
121
|
+
raw: jsSize,
|
|
122
|
+
gzip: jsGzipSize,
|
|
123
|
+
formatted: formatBytes(jsSize),
|
|
124
|
+
gzipFormatted: formatBytes(jsGzipSize),
|
|
125
|
+
},
|
|
126
|
+
css: {
|
|
127
|
+
raw: cssSize,
|
|
128
|
+
gzip: cssGzipSize,
|
|
129
|
+
formatted: formatBytes(cssSize),
|
|
130
|
+
gzipFormatted: formatBytes(cssGzipSize),
|
|
131
|
+
},
|
|
132
|
+
total: {
|
|
133
|
+
raw: totalSize,
|
|
134
|
+
gzip: totalGzipSize,
|
|
135
|
+
formatted: formatBytes(totalSize),
|
|
136
|
+
gzipFormatted: formatBytes(totalGzipSize),
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
treeshakeable: true, // All ESM exports are treeshakeable
|
|
140
|
+
timestamp: new Date().toISOString(),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Main function
|
|
146
|
+
*/
|
|
147
|
+
function main() {
|
|
148
|
+
console.log('š¦ Generating bundle size information...\n');
|
|
149
|
+
|
|
150
|
+
if (!fs.existsSync(distEsmDir)) {
|
|
151
|
+
console.warn('ā ļø Warning: dist/esm/components directory not found.');
|
|
152
|
+
console.warn(
|
|
153
|
+
' Creating empty bundle-sizes.json. Run `yarn dist` to populate.\n',
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
// Create empty bundle sizes file
|
|
157
|
+
const emptyOutput = {
|
|
158
|
+
metadata: {
|
|
159
|
+
generated: new Date().toISOString(),
|
|
160
|
+
totalComponents: 0,
|
|
161
|
+
totalSize: {
|
|
162
|
+
raw: 0,
|
|
163
|
+
gzip: 0,
|
|
164
|
+
formatted: '0 B',
|
|
165
|
+
gzipFormatted: '0 B',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
components: {},
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const storybookDir = path.dirname(outputFile);
|
|
172
|
+
if (!fs.existsSync(storybookDir)) {
|
|
173
|
+
fs.mkdirSync(storybookDir, { recursive: true });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
fs.writeFileSync(outputFile, JSON.stringify(emptyOutput, null, 2));
|
|
177
|
+
console.log('š Created empty bundle-sizes.json\n');
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const components = fs
|
|
182
|
+
.readdirSync(distEsmDir, { withFileTypes: true })
|
|
183
|
+
.filter((dirent) => dirent.isDirectory())
|
|
184
|
+
.map((dirent) => dirent.name);
|
|
185
|
+
|
|
186
|
+
const bundleSizes = {};
|
|
187
|
+
let totalComponents = 0;
|
|
188
|
+
let totalSize = 0;
|
|
189
|
+
let totalGzipSize = 0;
|
|
190
|
+
|
|
191
|
+
for (const component of components) {
|
|
192
|
+
const componentPath = path.join(distEsmDir, component);
|
|
193
|
+
const sizeInfo = calculateComponentSizes(component, componentPath);
|
|
194
|
+
|
|
195
|
+
bundleSizes[component] = sizeInfo;
|
|
196
|
+
totalComponents++;
|
|
197
|
+
totalSize += sizeInfo.sizes.total.raw;
|
|
198
|
+
totalGzipSize += sizeInfo.sizes.total.gzip;
|
|
199
|
+
|
|
200
|
+
console.log(
|
|
201
|
+
`ā ${component.padEnd(20)} ${sizeInfo.sizes.total.gzipFormatted} (gzip)`,
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Add metadata
|
|
206
|
+
const output = {
|
|
207
|
+
metadata: {
|
|
208
|
+
generated: new Date().toISOString(),
|
|
209
|
+
totalComponents,
|
|
210
|
+
totalSize: {
|
|
211
|
+
raw: totalSize,
|
|
212
|
+
gzip: totalGzipSize,
|
|
213
|
+
formatted: formatBytes(totalSize),
|
|
214
|
+
gzipFormatted: formatBytes(totalGzipSize),
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
components: bundleSizes,
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// Write to file
|
|
221
|
+
const storybookDir = path.dirname(outputFile);
|
|
222
|
+
if (!fs.existsSync(storybookDir)) {
|
|
223
|
+
fs.mkdirSync(storybookDir, { recursive: true });
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
fs.writeFileSync(outputFile, JSON.stringify(output, null, 2));
|
|
227
|
+
|
|
228
|
+
console.log(`\n⨠Bundle sizes generated successfully!`);
|
|
229
|
+
console.log(`š Total components: ${totalComponents}`);
|
|
230
|
+
console.log(
|
|
231
|
+
`š¦ Total size: ${formatBytes(totalSize)} (raw) / ${formatBytes(totalGzipSize)} (gzip)`,
|
|
232
|
+
);
|
|
233
|
+
console.log(`š Output: ${path.relative(rootDir, outputFile)}\n`);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
main();
|