carbon-react 158.29.0 → 158.30.0
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/esm/__internal__/form-field/form-field.component.js +1 -1
- package/esm/components/tabs/__next__/tabs.component.d.ts +1 -1
- package/esm/components/tabs/__next__/tabs.component.js +1 -1
- package/esm/components/tabs/__next__/tabs.context.js +1 -1
- package/esm/components/tabs/__next__/tabs.style.d.ts +11 -8
- package/esm/components/tabs/__next__/tabs.style.js +1 -1
- package/esm/components/tabs/__next__/tabs.types.d.ts +12 -0
- package/esm/components/tabs/index.d.ts +2 -1
- package/esm/components/tabs/tab/tab.component.d.ts +62 -17
- package/esm/components/tabs/tab/tab.component.js +1 -1
- package/esm/components/tabs/tabs.component.d.ts +16 -11
- package/esm/components/tabs/tabs.component.js +1 -1
- package/esm/index.js +1 -1
- package/esm/locales/en-gb.js +1 -1
- package/esm/locales/locale.d.ts +2 -0
- package/lib/__internal__/form-field/form-field.component.js +1 -1
- package/lib/components/tabs/__next__/tabs.component.d.ts +1 -1
- package/lib/components/tabs/__next__/tabs.component.js +1 -1
- package/lib/components/tabs/__next__/tabs.context.js +1 -1
- package/lib/components/tabs/__next__/tabs.style.d.ts +11 -8
- package/lib/components/tabs/__next__/tabs.style.js +1 -1
- package/lib/components/tabs/__next__/tabs.types.d.ts +12 -0
- package/lib/components/tabs/index.d.ts +2 -1
- package/lib/components/tabs/tab/tab.component.d.ts +62 -17
- package/lib/components/tabs/tab/tab.component.js +1 -1
- package/lib/components/tabs/tabs.component.d.ts +16 -11
- package/lib/components/tabs/tabs.component.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locales/en-gb.js +1 -1
- package/lib/locales/locale.d.ts +2 -0
- package/package.json +1 -1
- package/esm/components/tabs/__internal__/tab-title/index.d.ts +0 -2
- package/esm/components/tabs/__internal__/tab-title/index.js +0 -1
- package/esm/components/tabs/__internal__/tab-title/tab-title.component.d.ts +0 -34
- package/esm/components/tabs/__internal__/tab-title/tab-title.component.js +0 -1
- package/esm/components/tabs/__internal__/tab-title/tab-title.context.d.ts +0 -6
- package/esm/components/tabs/__internal__/tab-title/tab-title.context.js +0 -1
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.d.ts +0 -27
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.js +0 -1
- package/esm/components/tabs/__internal__/tabs-header/index.d.ts +0 -2
- package/esm/components/tabs/__internal__/tabs-header/index.js +0 -1
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.component.d.ts +0 -13
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.component.js +0 -1
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +0 -30
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.js +0 -1
- package/esm/components/tabs/tab/__internal__/tab.context.d.ts +0 -8
- package/esm/components/tabs/tab/__internal__/tab.context.js +0 -1
- package/esm/components/tabs/tab/tab.style.d.ts +0 -11
- package/esm/components/tabs/tab/tab.style.js +0 -1
- package/esm/components/tabs/tabs.style.d.ts +0 -8
- package/esm/components/tabs/tabs.style.js +0 -1
- package/lib/components/tabs/__internal__/tab-title/index.d.ts +0 -2
- package/lib/components/tabs/__internal__/tab-title/index.js +0 -1
- package/lib/components/tabs/__internal__/tab-title/package.json +0 -6
- package/lib/components/tabs/__internal__/tab-title/tab-title.component.d.ts +0 -34
- package/lib/components/tabs/__internal__/tab-title/tab-title.component.js +0 -1
- package/lib/components/tabs/__internal__/tab-title/tab-title.context.d.ts +0 -6
- package/lib/components/tabs/__internal__/tab-title/tab-title.context.js +0 -1
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.d.ts +0 -27
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +0 -1
- package/lib/components/tabs/__internal__/tabs-header/index.d.ts +0 -2
- package/lib/components/tabs/__internal__/tabs-header/index.js +0 -1
- package/lib/components/tabs/__internal__/tabs-header/package.json +0 -6
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.component.d.ts +0 -13
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.component.js +0 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +0 -30
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.js +0 -1
- package/lib/components/tabs/tab/__internal__/tab.context.d.ts +0 -8
- package/lib/components/tabs/tab/__internal__/tab.context.js +0 -1
- package/lib/components/tabs/tab/tab.style.d.ts +0 -11
- package/lib/components/tabs/tab/tab.style.js +0 -1
- package/lib/components/tabs/tabs.style.d.ts +0 -8
- package/lib/components/tabs/tabs.style.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as n,useContext as r,useRef as i,useLayoutEffect as l,useEffect as o}from"react";import a from"invariant";import s,{FieldLineStyle as d}from"./form-field.style.js";import p from"../label/label.component.js";import{FieldHelp as c}from"../field-help/field-help.component.js";import b from"../utils/helpers/tags/tags.js";import f from"../../hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js";import"../../style/utils/filter-styled-system-padding-props.js";import
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as n,useContext as r,useRef as i,useLayoutEffect as l,useEffect as o}from"react";import a from"invariant";import s,{FieldLineStyle as d}from"./form-field.style.js";import p from"../label/label.component.js";import{FieldHelp as c}from"../field-help/field-help.component.js";import b from"../utils/helpers/tags/tags.js";import f from"../../hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js";import"../../style/utils/filter-styled-system-padding-props.js";import u from"../../style/utils/filter-styled-system-margin-props.js";import{TabsContext as m}from"../../components/tabs/__next__/tabs.context.js";import{TabContext as y}from"../../components/tabs/__next__/tab.context.js";function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g=g=>{var{maxWidth:I,children:j,"data-component":h,disabled:v,loading:w,fieldHelp:P,fieldHelpInline:_,error:x,warning:H,info:k,tooltipId:S,fieldHelpId:W,label:A,labelId:R,labelAlign:q,labelHelp:B,labelHelpIcon:D,labelInline:E,labelSpacing:F=2,labelWidth:V,labelAs:L,id:N,reverse:U,useValidationIcon:$,adaptiveLabelBreakpoint:z,isRequired:C,validationIconId:G,validationRedesignOptIn:J}=g,K=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(g,["maxWidth","children","data-component","disabled","loading","fieldHelp","fieldHelpInline","error","warning","info","tooltipId","fieldHelpId","label","labelId","labelAlign","labelHelp","labelHelpIcon","labelInline","labelSpacing","labelWidth","labelAs","id","reverse","useValidationIcon","adaptiveLabelBreakpoint","isRequired","validationIconId","validationRedesignOptIn"]);const M=n((()=>{const e={error:!!x,warning:!!H,info:!!k};if(v&&!w)return Object.keys(e).find((t=>e[t]))}),[x,H,k,v,w]);a(void 0===M,`Prop \`${M}\` cannot be used in conjunction with \`disabled\`. Use \`readOnly\` if you require users to see validations with a non-interactive field`);const Q=f(z);let T=E;z&&(T=Q);const{setErrors:X,setWarnings:Y,setInfos:Z}=r(m),{tabId:ee}=r(y),te=u(K),ne=i(!1);l((()=>(ne.current=!0,()=>{ne.current=!1})),[]),o((()=>(X&&X(N,ee||"",x||!1),Y&&Y(N,ee||"",H||!1),Z&&Z(N,ee||"",k||!1),()=>{ne.current||(X&&X(N,ee||"",!1),Y&&Y(N,ee||"",!1),Z&&Z(N,ee||"",!1))})),[N,X,Y,x,H,k,ee,Z]);const re=P?t(c,{labelInline:T,labelWidth:V,id:W,children:P}):null;return e(s,(ie=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){O(e,t,n[t])}))}return e}({},b(h,K),te),le=null!=(le={children:[e(d,{"data-role":"field-line",inline:T,maxWidth:I,children:[U&&j,A&&t(p,{labelId:R,align:q,disabled:v,error:!J&&x,warning:!J&&H,info:!J&&k,help:B,tooltipId:S,htmlFor:N,helpIcon:D,inline:T,width:V,useValidationIcon:$,pr:U?void 0:F,pl:U?F:void 0,isRequired:C,validationIconId:G,as:L,children:A}),_&&re,!U&&j]}),!_&&re]})?le:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(le)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(le)).forEach((function(e){Object.defineProperty(ie,e,Object.getOwnPropertyDescriptor(le,e))})),ie));var ie,le};g.displayName="FormField";export{g as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TabsHandle, TabListProps, TabPanelProps, TabProps, TabsProps } from "./tabs.types";
|
|
3
3
|
export declare const TabPanel: ({ children, id, tabId, ...rest }: TabPanelProps) => React.JSX.Element;
|
|
4
|
-
export declare const Tab: ({ controls, error, id, label, leftSlot, rightSlot, warning, info, ...rest }: TabProps) => React.JSX.Element;
|
|
4
|
+
export declare const Tab: ({ controls, error, id, label, leftSlot, rightSlot, warning, info, hasCustomLayout, headerWidth, href, ...rest }: TabProps) => React.JSX.Element;
|
|
5
5
|
export declare const TabList: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<TabsHandle>>;
|
|
6
6
|
export declare const Tabs: ({ children, labelledBy, orientation, selectedTabId, size, ...rest }: TabsProps) => React.JSX.Element;
|
|
7
7
|
export default Tabs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{forwardRef as n,useRef as o,useImperativeHandle as i,useCallback as a,useEffect as l,useState as c}from"react";import{TabsProvider as s,useTabs as b}from"./tabs.context.js";import{StyledTabs as d,StyledTabListWrapper as u,StyledTabList as f,StyledTabPanel as h,StyledScrollButton as p,StyledScrollButtonPlaceholder as g,StyledTab as y,Spacer as v}from"./tabs.style.js";import m from"../../../__internal__/utils/logger/index.js";import O from"../../../hooks/__internal__/useResizeObserver/useResizeObserver.js";import j from"../../../hooks/__internal__/useLocale/useLocale.js";import _ from"../../icon/icon.component.js";import{TabProvider as w}from"./tab.context.js";import x from"../../../hooks/__internal__/usePrevious/index.js";import k from"../../../__internal__/utils/helpers/guid/index.js";import I from"../../../__internal__/utils/helpers/tags/tags.js";import S from"../../../__internal__/utils/helpers/extract-text/index.js";function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T(e,t,r[t])}))}return e}function $(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function P(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}const z=t=>{var{children:r,id:n,tabId:o}=t,i=P(t,["children","id","tabId"]);const{activeTab:a}=b();return e(w,{tabId:o,visible:o===a,children:e(h,$(L({id:n,role:"tabpanel","aria-labelledby":o},I("tab-panel",i)),{children:r}))})};let A=!1;const C=t=>{var{controls:n,error:o=!1,id:i,label:a,leftSlot:s,rightSlot:d,warning:u=!1,info:f=!1,hasCustomLayout:h,headerWidth:p,href:g}=t,v=P(t,["controls","error","id","label","leftSlot","rightSlot","warning","info","hasCustomLayout","headerWidth","href"]);const O=j(),[x,k]=c(o),[T,z]=c(u),[C,W]=c(f),{activeTab:D,focusIndex:E,orientation:N,setActiveTab:R,setCurrentTabId:B,setFocusIndex:q,size:F,errors:U,warnings:G,infos:H}=b(),K=D===i;l((()=>{K&&B(i)}),[i,K,B]),!s&&!d||"string"==typeof a||A||(m.warn("[WARNING] Using `leftSlot` and/or `rightSlot` is not supported when `label` is not a string. Please use `leftSlot` and/or `rightSlot` alongside a string `label`, or use the `label` prop exclusively."),A=!0),l((()=>{if(E===i){const e=document.getElementById(i);null==e||e.focus()}}),[E,i,B]),l((()=>{let e=U[i],t=G[i],r=H[i];if(o&&!e&&(e={static:o}),u&&!t&&(t={static:u}),f&&!r&&(r={static:f}),!e)return void k(!1);const n=Object.keys(e).map((t=>e[t])).filter((e=>!1!==e)),a=o||!!n.length;if(k(a),!t)return void z(!1);const l=Object.keys(t).map((e=>t[e])).filter((e=>!1!==e)),c=u||!!l.length;if(z(c),!r)return void W(!1);const s=Object.keys(r).map((e=>r[e])).filter((e=>!1!==e)),b=f||!!s.length;W(b)}),[o,i,U,G,u,H,f]);const J=()=>{const t=S(a);if(x||T||C){if(x)return e(_,{"data-role":"icon-error",type:"error",ariaLabel:O.tabs.error(t),color:"#db004e"});if(T)return e(_,{"data-role":"icon-warning",type:"warning",ariaLabel:O.tabs.warning(t),color:"#d64309"});if(C)return e(_,{"data-role":"icon-info",type:"info",ariaLabel:O.tabs.info(t),color:"#0060a7ff"})}return null};return e(w,{tabId:i,visible:!0,children:e(y,$(L($(L({activeTab:D===i,className:D===i?"active-tab":"","aria-controls":n,"aria-selected":K?"true":"false",error:x,warning:T,info:C,id:i,onClick:()=>{R(i),q(i)},$orientation:N,role:"tab",$size:F,type:g?void 0:"button",tabIndex:D===i?0:-1,$hasCustomLayout:h,$headerWidth:p},I("tab",v)),{"data-tabid":i,as:g?"a":void 0}),g&&{href:g,target:"_blank",style:{textDecoration:"none",display:"block",boxSizing:"border-box"}}),{children:r("span","string"==typeof a?{className:"tab-title-content-wrapper",children:[s,a,d,J()]}:{className:"tab-title-content-wrapper",children:[a,J()]})}))})},W=n(((n,s)=>{var{ariaLabel:d,children:h,onTabChange:y,headerWidth:m}=n,w=P(n,["ariaLabel","children","onTabChange","headerWidth"]);const S=o(null),{activeTab:T,focusIndex:z,orientation:A,selectedTabId:C,setFocusIndex:W,setActiveTab:D,size:E}=b(),N=o(k()),R=o(k()),B=o(k()),q=j();i(s,(()=>({focusTab:e=>{var t;const r=null===(t=S.current)||void 0===t?void 0:t.querySelector(`#${e}`);null==r||r.focus(),W(e),D(e)}})));const F=a((()=>{var e;const t=(null===(e=S.current)||void 0===e?void 0:e.querySelectorAll("[role='tab']"))||[];return Array.from(t).map((e=>e.id)).filter((e=>e))}),[]);l((()=>{if(C)D(C);else if(!T){const e=F()[0];D(e)}}),[T,F,C,D]);const U=x(T);l((()=>{U&&U!==T&&(null==y||y(T))}),[T,y,U]);const G=a((e=>{const t=F(),r=t.indexOf(z||T),n=t.length-1;if(-1===r)return;let o=r;switch(e.key){case"Home":o=0;break;case"End":o=n;break;case"ArrowRight":o=(r+1)%t.length;break;case"ArrowLeft":o=(r-1+t.length)%t.length;break;case"ArrowUp":"vertical"===A&&(o=(r-1+t.length)%t.length);break;case"ArrowDown":"vertical"===A&&(o=(r+1)%t.length);break;case"Enter":case" ":return void D(T);case"Tab":return void W(T);default:return}W(t[o])}),[T,z,F,A,D,W]),[H,K]=c(!1),[J,M]=c(!1),[Q,V]=c(!1),X=a((()=>{if(S.current){const e=S.current.scrollWidth-S.current.clientWidth-20;K(e>0),M(S.current.scrollLeft>=20),V(S.current.scrollLeft<=e)}}),[]);O(S,(()=>{X()})),l((()=>{S.current&&X()}),[X]);const Y=e=>{S.current&&("left"===e?S.current.scrollLeft-=200:S.current.scrollLeft+=200,X())};return e(t,{children:r(u,{$headerWidth:m,"data-role":"tab-list-wrapper",children:["vertical"!==A&&H?J?e(p,{"data-role":"tab-navigation-button-left",id:`tab-navigation-button-left-${N.current}`,onClick:()=>Y("left"),$size:E,tabIndex:-1,title:null===(Z=(ee=q.tabs).scrollLeftText)||void 0===Z?void 0:Z.call(ee),type:"button",children:e(_,{type:"chevron_left"})}):e(g,{$size:E}):null,r(f,$(L({"aria-label":d,id:`tablist-${B.current}`,onKeyDown:G,$orientation:A,ref:S,role:"tablist",tabIndex:-1},I("tab-list",w)),{children:[h,e(v,{})]})),(()=>{var t,r;return"vertical"!==A&&H?Q?e(p,{"data-role":"tab-navigation-button-right",id:`tab-navigation-button-right-${R.current}`,onClick:()=>Y("right"),$size:E,tabIndex:-1,title:null===(t=(r=q.tabs).scrollRightText)||void 0===t?void 0:t.call(r),type:"button",children:e(_,{type:"chevron_right"})}):e(g,{$size:E}):null})()]})});var Z,ee})),D=t=>{var{children:r,labelledBy:n="",orientation:i="horizontal",selectedTabId:a,size:l="medium"}=t,c=P(t,["children","labelledBy","orientation","selectedTabId","size"]);const b=o(k());return e(s,{labelledBy:n,orientation:i,selectedTabId:a,size:l,children:e(d,$(L({id:`tabs-container-${b.current}`,$orientation:i},I("tabs",c)),{children:r}))})};export{C as Tab,W as TabList,z as TabPanel,D as Tabs,D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useContext as r,createContext as t,useState as n,useCallback as o}from"react";function
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useContext as r,createContext as t,useState as n,useCallback as o,useEffect as s}from"react";import i from"../../../hooks/__internal__/usePrevious/index.js";function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){a(e,r,t[r])}))}return e}const b=t({activeTab:"",currentTabId:"",focusIndex:"",isInTab:!1,labelledBy:"",orientation:"horizontal",selectedTabId:"",setActiveTab:()=>{},setFocusIndex:()=>{},setCurrentTabId:()=>{},setErrors:()=>{},setWarnings:()=>{},size:"medium",errors:{},warnings:{},infos:{},setInfos:()=>{}}),l=()=>r(b),u=({children:r,isInTab:t=!0,labelledBy:a,orientation:l,selectedTabId:u="",size:d})=>{const[f,I]=n(u),[m,T]=n(u),[y,p]=n(""),[v,g]=n({}),[O,j]=n({}),[x,h]=n({}),w=o(((e,r,t)=>{const n={[r]:{[e]:t}};g((o=>(o[r]||(o[r]={}),o[r][e]!==t?c({},o,n):o)))}),[]),P=o(((e,r,t)=>{const n={[r]:{[e]:t}};j((o=>(o[r]||(o[r]={}),o[r][e]!==t?c({},o,n):o)))}),[]),z=o(((e,r,t)=>{const n={[r]:{[e]:t}};h((o=>(o[r]||(o[r]={}),o[r][e]!==t?c({},o,n):o)))}),[]),_=i(u);return s((()=>{u&&u!==_&&(I(u),T(u))}),[u,_]),e(b.Provider,{value:{activeTab:f,currentTabId:m,focusIndex:y,isInTab:t,labelledBy:a,orientation:l,setActiveTab:I,setCurrentTabId:T,setFocusIndex:p,setErrors:w,setWarnings:P,size:d,errors:v,warnings:O,infos:x,setInfos:z},children:r})};export{b as TabsContext,u as TabsProvider,l as useTabs};
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import { TabProps } from "./tabs.types";
|
|
2
2
|
interface StyledTabListProps {
|
|
3
|
-
orientation: "horizontal" | "vertical";
|
|
4
|
-
size: "medium" | "large";
|
|
3
|
+
$orientation: "horizontal" | "vertical";
|
|
5
4
|
}
|
|
6
5
|
export declare const StyledTabPanel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
6
|
export declare const StyledTabList: import("styled-components").StyledComponent<"div", any, StyledTabListProps, never>;
|
|
8
|
-
export declare const StyledTabListWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
7
|
+
export declare const StyledTabListWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
$headerWidth?: string;
|
|
9
|
+
}, never>;
|
|
9
10
|
export declare const Spacer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
11
|
export declare const StyledScrollButton: import("styled-components").StyledComponent<"button", any, {
|
|
11
|
-
size: "medium" | "large";
|
|
12
|
+
$size: "medium" | "large";
|
|
12
13
|
}, never>;
|
|
13
14
|
export declare const StyledScrollButtonPlaceholder: import("styled-components").StyledComponent<"div", any, {
|
|
14
|
-
size: "medium" | "large";
|
|
15
|
+
$size: "medium" | "large";
|
|
15
16
|
}, never>;
|
|
16
17
|
interface StyledTabProps extends Omit<TabProps, "controls" | "index" | "label"> {
|
|
17
18
|
activeTab: boolean;
|
|
18
19
|
error?: string | boolean;
|
|
19
20
|
warning?: string | boolean;
|
|
20
|
-
orientation: "horizontal" | "vertical";
|
|
21
|
-
size: "medium" | "large";
|
|
21
|
+
$orientation: "horizontal" | "vertical";
|
|
22
|
+
$size: "medium" | "large";
|
|
23
|
+
$hasCustomLayout?: boolean;
|
|
24
|
+
$headerWidth?: string;
|
|
22
25
|
}
|
|
23
26
|
export declare const StyledTab: import("styled-components").StyledComponent<"button", any, StyledTabProps, never>;
|
|
24
27
|
export declare const StyledTabs: import("styled-components").StyledComponent<"div", any, {
|
|
25
|
-
orientation?: "horizontal" | "vertical";
|
|
28
|
+
$orientation?: "horizontal" | "vertical";
|
|
26
29
|
}, never>;
|
|
27
30
|
export declare const StyledTabProvider: import("styled-components").StyledComponent<"div", any, {
|
|
28
31
|
visible: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o,{css as
|
|
1
|
+
import o,{css as t}from"styled-components";import i from"../../../style/utils/add-focus-styling.js";const e={medium:{fontSize:14,iconMinWidth:84,height:40,paddingX:16,paddingY:8,width:56},large:{fontSize:16,iconMinWidth:104,height:48,paddingX:24,paddingY:0,width:76}},d=o.div.withConfig({displayName:"tabs.style__StyledTabPanel",componentId:"sc-75b008c3-0"})(["padding:0 6px;"]),r=o.div.withConfig({displayName:"tabs.style__StyledTabList",componentId:"sc-75b008c3-1"})(["display:flex;"," width:100%;padding:6px;overflow-x:hidden;"],(({$orientation:o})=>t([""," ",""],"horizontal"===o&&t(["margin-bottom:8px;"]),"vertical"===o&&t(["flex-direction:column;flex-wrap:wrap;margin-right:8px;"])))),a=o.div.withConfig({displayName:"tabs.style__StyledTabListWrapper",componentId:"sc-75b008c3-2"})(["display:flex;z-index:6;",";"],(({$headerWidth:o})=>o&&t(["width:",";"],o))),n=o.div.withConfig({displayName:"tabs.style__Spacer",componentId:"sc-75b008c3-3"})(["align-self:flex-end;background:#8b8b8bff;flex-grow:1;height:2px;"]),p=o.button.withConfig({displayName:"tabs.style__StyledScrollButton",componentId:"sc-75b008c3-4"})(["height:",";width:",";border-radius:0px;border-top-right-radius:8px;border-top-left-radius:8px;border-color:#8b8b8bff;background:white;border:none;border-bottom:2px solid #8b8b8bff;top:6px;position:relative;"],(({$size:o})=>"medium"===o?"40px":"48px"),(({$size:o})=>"medium"===o?"40px":"48px")),b=o.div.withConfig({displayName:"tabs.style__StyledScrollButtonPlaceholder",componentId:"sc-75b008c3-5"})(["height:",";width:",";border-radius:0;border-color:#8b8b8bff;border:none;border-bottom:2px solid #8b8b8bff;top:4px;position:relative;"],(({$size:o})=>"medium"===o?"40px":"48px"),(({$size:o})=>"medium"===o?"40px":"48px")),l=o.button.withConfig({displayName:"tabs.style__StyledTab",componentId:"sc-75b008c3-6"})(["background-color:transparent;border:none;border-bottom:2px solid #8b8b8bff;border-bottom-left-radius:0px;border-bottom-right-radius:0px;border-top-left-radius:8px;border-top-right-radius:8px;white-space:nowrap;height:fit-content;color:var(--colorsYin090);font-weight:var(--fontWeights500);line-height:var(--lineHeights500);position:relative;.tab-title-content-wrapper{"," ","}:hover{background-color:#00000010;cursor:pointer;}",";",";"," :focus{"," z-index:1;","}"],(({$hasCustomLayout:o})=>!o&&t(["align-items:center;display:flex;gap:8px;"])),(({activeTab:o,$orientation:i,$size:e,error:d,warning:r,info:a,$hasCustomLayout:n})=>o&&t([""," "," ",""],"horizontal"===i&&(d||r||a)&&t(["position:relative;top:1px;"]),"large"===e&&t(["margin-top:-4px;"]),n&&"horizontal"===i&&t(["position:relative;top:-2px;left:1px;"]))),(({$size:o,$hasCustomLayout:i})=>t(["font-size:","px;height:","px;",""],e[o].fontSize,e[o].height,i?t(["padding:0;"]):t(["padding:","px ","px;"],e[o].paddingY,e[o].paddingX))),(({activeTab:o,error:i,info:d,$orientation:r,$size:a,warning:n,$hasCustomLayout:p})=>o&&"horizontal"===r&&t(["background-color:white;border:2px solid #8b8b8bff;border-bottom:none;",' :hover{background-color:white;}::after{content:"";position:absolute;bottom:0;left:20%;width:60%;height:4px;background-color:',";border-radius:2px;min-width:24px;}"],!p&&t(["padding-top:","px;padding-right:","px;padding-bottom:","px;padding-left:","px;"],e[a].paddingY-4,e[a].paddingX-2,e[a].paddingY,e[a].paddingX-2),(()=>i?"#db004e":n?"#d64309":d?"#0060a7ff":"black"))),(({activeTab:o,error:i,info:d,$orientation:r,$size:a,warning:n,$hasCustomLayout:p,$headerWidth:b})=>"vertical"===r&&t(["border:none;border-right:2px solid #8b8b8bff;border-bottom-left-radius:8px;border-bottom-right-radius:0px;border-top-left-radius:8px;border-top-right-radius:0px;max-width:",";width:",";"," ",""],null!=b?b:"200px",null!=b?b:"200px",b&&t(["white-space:normal;height:auto;"]),o&&t(["background-color:white;border:2px solid #8b8b8bff;border-right:none;"," :hover{background-color:white;}.tab-title-content-wrapper{"," ",' ::after{content:"";position:absolute;right:0;width:4px;'," height:60%;background-color:",";border-radius:2px;min-height:24px;}}"],!p&&t(["padding-top:","px;padding-right:var(--global-space-none);padding-bottom:","px;padding-left:","px;"],"medium"===a?e.medium.paddingY-2:4,"medium"===a?e.medium.paddingY-2:e.large.paddingY,e[a].paddingX-2),b&&!p&&t(["padding-right:18px;"]),p&&t(["width:100%;> *{position:relative;left:-2px;top:-2px;}"]),p&&t(["top:20%;right:0px;"]),(()=>i?"#db004e":n?"#d64309":d?"#0060a7ff":"black")))),i(),(({$orientation:o})=>t(["border-top-left-radius:8px;border-top-right-radius:",";border-bottom-left-radius:",";border-bottom-right-radius:0px;"],"horizontal"===o?"8px":"0","horizontal"===o?"0px":"8px"))),s=o.div.withConfig({displayName:"tabs.style__StyledTabs",componentId:"sc-75b008c3-7"})(["display:flex;",""],(({$orientation:o})=>t(["flex-direction:",";"],"horizontal"===o?"column":"row"))),h=o.div.withConfig({displayName:"tabs.style__StyledTabProvider",componentId:"sc-75b008c3-8"})(["",""],(({visible:o})=>t(["display:",";"],o?"block":"none")));export{n as Spacer,p as StyledScrollButton,b as StyledScrollButtonPlaceholder,l as StyledTab,r as StyledTabList,a as StyledTabListWrapper,d as StyledTabPanel,h as StyledTabProvider,s as StyledTabs};
|
|
@@ -46,6 +46,10 @@ export interface TabListProps extends TagProps {
|
|
|
46
46
|
children?: React.ReactNode;
|
|
47
47
|
/** A callback for when the active tab is changed */
|
|
48
48
|
onTabChange?: (tabId: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* @private @ignore @internal
|
|
51
|
+
*/
|
|
52
|
+
headerWidth?: string;
|
|
49
53
|
}
|
|
50
54
|
export interface TabProps extends TagProps {
|
|
51
55
|
/** The tab panel that this tab controls */
|
|
@@ -67,6 +71,14 @@ export interface TabProps extends TagProps {
|
|
|
67
71
|
* @deprecated to be removed when legacy `Tabs` and `Tab` are removed
|
|
68
72
|
* */
|
|
69
73
|
info?: boolean | string;
|
|
74
|
+
/**
|
|
75
|
+
* @internal @private @ignore
|
|
76
|
+
*/
|
|
77
|
+
hasCustomLayout?: boolean;
|
|
78
|
+
/** @private @ignore @internal */
|
|
79
|
+
headerWidth?: string;
|
|
80
|
+
/** @private @ignore @internal */
|
|
81
|
+
href?: string;
|
|
70
82
|
}
|
|
71
83
|
export interface TabsProps extends TagProps {
|
|
72
84
|
/** The tab list to be rendered within this set of tabs */
|
|
@@ -1,32 +1,72 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PaddingProps } from "styled-system";
|
|
3
3
|
import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
|
|
4
|
-
|
|
4
|
+
import type { TabProps as NextTabProps } from "../__next__";
|
|
5
|
+
export type TabsHandle = {
|
|
6
|
+
/** Programmatically focus on a specific tab.
|
|
7
|
+
* @param tabId - The ID of the tab to focus. Must match the `tabId` prop of the target `Tab` component.
|
|
8
|
+
*/
|
|
9
|
+
focusTab: (tabId: string) => void;
|
|
10
|
+
} | null;
|
|
11
|
+
export interface TabProps extends PaddingProps, TagProps, Partial<NextTabProps> {
|
|
12
|
+
/**
|
|
13
|
+
* The title of the Tab.
|
|
14
|
+
* @deprecated Support will be removed in a future release, it is recommended to use `label` prop instead.
|
|
15
|
+
*/
|
|
5
16
|
title?: string;
|
|
6
|
-
/**
|
|
7
|
-
|
|
17
|
+
/**
|
|
18
|
+
* A unique ID to identify this specific tab.
|
|
19
|
+
* @deprecated Support will be removed in a future release, it is recommended to use `id` instead.
|
|
20
|
+
* */
|
|
21
|
+
tabId?: string;
|
|
8
22
|
/** The child elements of Tab component. */
|
|
9
23
|
children?: React.ReactNode;
|
|
10
24
|
/** @ignore @private Boolean indicating selected state of Tab. */
|
|
11
25
|
isTabSelected?: boolean;
|
|
12
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The position of the Tab.
|
|
28
|
+
* @deprecated Support will be removed in a future release.
|
|
29
|
+
* */
|
|
13
30
|
position?: "top" | "left";
|
|
14
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated
|
|
33
|
+
* Message displayed when Tab has error
|
|
34
|
+
* The legacy validation pattern is being removed in a future release.
|
|
35
|
+
* */
|
|
15
36
|
errorMessage?: string;
|
|
16
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated
|
|
39
|
+
* Message displayed when Tab has warning
|
|
40
|
+
* The legacy validation pattern is being removed in a future release.
|
|
41
|
+
* */
|
|
17
42
|
warningMessage?: string;
|
|
18
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated
|
|
45
|
+
* Message displayed when Tab has info
|
|
46
|
+
* The legacy validation pattern is being removed in a future release.
|
|
47
|
+
* */
|
|
19
48
|
infoMessage?: string;
|
|
20
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Additional content to display with title
|
|
51
|
+
* @deprecated Support for siblings will be removed in a future release.
|
|
52
|
+
* It is recommended to use `label` prop to compose what you want.
|
|
53
|
+
* */
|
|
21
54
|
siblings?: React.ReactNode;
|
|
22
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Position title before or after siblings
|
|
57
|
+
* @deprecated Support for titlePosition will be removed in a future release.
|
|
58
|
+
* It is recommended to use `label` prop to compose what you want.
|
|
59
|
+
* */
|
|
23
60
|
titlePosition?: "before" | "after";
|
|
24
61
|
/**
|
|
25
62
|
* Allows Tab to be a link
|
|
26
63
|
* @deprecated Using tabs as links is inaccessible; this prop will be deprecated in a future release.
|
|
27
64
|
* */
|
|
28
65
|
href?: string;
|
|
29
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Overrides default layout with a one defined in this prop
|
|
68
|
+
* @deprecated Support for customLayout will be removed in a future release, it is recommended to use the `label` prop instead.
|
|
69
|
+
* */
|
|
30
70
|
customLayout?: React.ReactNode;
|
|
31
71
|
/** Additional props to be passed to the Tab's corresponding title. */
|
|
32
72
|
titleProps?: {
|
|
@@ -37,12 +77,17 @@ export interface TabProps extends PaddingProps, TagProps {
|
|
|
37
77
|
role?: string;
|
|
38
78
|
/** @private @ignore */
|
|
39
79
|
ariaLabelledby?: string;
|
|
40
|
-
/** @private @ignore */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
80
|
+
/** @private @ignore @internal */
|
|
81
|
+
validationStatusOverride?: {
|
|
82
|
+
error?: boolean;
|
|
83
|
+
warning?: boolean;
|
|
84
|
+
info?: boolean;
|
|
85
|
+
};
|
|
86
|
+
/** @private @ignore @internal */
|
|
87
|
+
headerWidth?: string;
|
|
46
88
|
}
|
|
47
|
-
export declare const Tab:
|
|
89
|
+
export declare const Tab: {
|
|
90
|
+
({ tabId, title, customLayout, siblings, titlePosition, validationStatusOverride, errorMessage, warningMessage, infoMessage, titleProps, controls, id, label, error, warning, info, ...rest }: TabProps): React.JSX.Element | null;
|
|
91
|
+
displayName: string;
|
|
92
|
+
};
|
|
48
93
|
export default Tab;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import"react";import{Tab as n}from"../__next__/tabs.component.js";import o from"../../../__internal__/utils/logger/index.js";function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}let a=!1;const l=l=>{var{tabId:s,title:u,customLayout:c,siblings:f,titlePosition:b,validationStatusOverride:g,errorMessage:d,warningMessage:p,infoMessage:m,titleProps:y,controls:O,id:v,label:w,error:h,warning:j,info:P}=l,_=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(l,["tabId","title","customLayout","siblings","titlePosition","validationStatusOverride","errorMessage","warningMessage","infoMessage","titleProps","controls","id","label","error","warning","info"]);a||(o.warn("Warning: This version of the `Tab` component is intended to help migration to the `next` version and will be removed in a future release."),a=!0);let x="";if(w)x=w;else if(c)x=c;else if(x=u,f){const n=e("span",{children:w||u});x=r(t,"after"===b?{children:[f,n]}:{children:[n,f]})}const{error:M,warning:S,info:T}=g||{},I=v||s;return I?e(n,function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){i(e,r,t[r])}))}return e}({id:I,controls:O||`${I}-panel`,label:x,error:h||M,warning:j||S,info:P||T,hasCustomLayout:!!c,"data-role":null==y?void 0:y["data-role"]},_)):null};l.displayName="Tab";export{l as Tab,l as default};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
import Tab from "./tab";
|
|
4
3
|
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
5
4
|
export type TabsHandle = {
|
|
6
|
-
/**
|
|
7
|
-
* Programmatically focus on a specific tab.
|
|
5
|
+
/** Programmatically focus on a specific tab.
|
|
8
6
|
* @param tabId - The ID of the tab to focus. Must match the `tabId` prop of the target `Tab` component.
|
|
9
7
|
*/
|
|
10
8
|
focusTab: (tabId: string) => void;
|
|
11
9
|
} | null;
|
|
12
10
|
export interface TabsProps extends MarginProps, TagProps {
|
|
13
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Prevent rendering of hidden tabs, by default this is set to true and therefore all tabs will be rendered
|
|
13
|
+
* @deprecated Support for this prop will be removed in a future release. All tabs will be rendered by default.
|
|
14
|
+
* */
|
|
14
15
|
renderHiddenTabs?: boolean;
|
|
15
16
|
/** Allows manual control over the currently selected tab. */
|
|
16
17
|
selectedTabId?: string;
|
|
@@ -18,7 +19,7 @@ export interface TabsProps extends MarginProps, TagProps {
|
|
|
18
19
|
children: React.ReactNode;
|
|
19
20
|
/**
|
|
20
21
|
* Sets the alignment of the tab titles. Possible values include.
|
|
21
|
-
* @deprecated
|
|
22
|
+
* @deprecated Support for right-aligned tab content has been removed.
|
|
22
23
|
*/
|
|
23
24
|
align?: "left" | "right";
|
|
24
25
|
/** A callback for when a tab is changed. You can use this to manually control
|
|
@@ -33,18 +34,22 @@ export interface TabsProps extends MarginProps, TagProps {
|
|
|
33
34
|
size?: "default" | "large";
|
|
34
35
|
/**
|
|
35
36
|
* Sets the divider of the tab titles header to extend the full width of the parent.
|
|
36
|
-
* @deprecated
|
|
37
|
+
* @deprecated Support for extended lines in tab headers has been removed.
|
|
37
38
|
* */
|
|
38
39
|
extendedLine?: boolean;
|
|
39
40
|
/**
|
|
40
41
|
* Adds a combination of borders to the tab titles.
|
|
41
|
-
* @deprecated
|
|
42
|
+
* @deprecated Support for configurable borders on tab titles has been removed.
|
|
42
43
|
* */
|
|
43
44
|
borders?: "off" | "on" | "no left side" | "no right side" | "no sides";
|
|
44
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Adds an alternate styling variant to the tab titles.
|
|
47
|
+
* @deprecated Support for alternate styling variants on tab titles has been removed.
|
|
48
|
+
*/
|
|
45
49
|
variant?: "default" | "alternate";
|
|
46
50
|
/** sets width to the tab headers. Can be any valid CSS string.
|
|
47
51
|
* The headerWidth prop works only for `position="left"`
|
|
52
|
+
* @deprecated Support will be removed in a future release.
|
|
48
53
|
*/
|
|
49
54
|
headerWidth?: string;
|
|
50
55
|
/** An object to support overriding validation statuses, when the Tabs have custom targets for example.
|
|
@@ -60,9 +65,9 @@ export interface TabsProps extends MarginProps, TagProps {
|
|
|
60
65
|
/**
|
|
61
66
|
* When this prop is set any string validation failures in the children of each Tab
|
|
62
67
|
* will be summarised in the Tooltip next to the Tab title
|
|
63
|
-
* @deprecated
|
|
68
|
+
* @deprecated Support for validation summaries has been removed.
|
|
64
69
|
*/
|
|
65
70
|
showValidationsSummary?: boolean;
|
|
66
71
|
}
|
|
67
|
-
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsHandle>>;
|
|
68
|
-
export
|
|
72
|
+
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsHandle>>;
|
|
73
|
+
export default Tabs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import t,{forwardRef as n,useMemo as o,useState as i,useEffect as a,createElement as l}from"react";import{Tabs as s,TabList as d,TabPanel as p}from"./__next__/tabs.component.js";import{Tab as c}from"./tab/tab.component.js";import b from"../../__internal__/utils/logger/index.js";import u from"../drawer/__internal__/drawer-sidebar.context.js";import f from"../../hooks/__internal__/usePrevious/index.js";function m(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){m(e,r,t[r])}))}return e}function O(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}let y=!1;const g=n(((n,m)=>{var g,v,{children:j,selectedTabId:w,onTabChange:T,position:P="top",size:_="default",validationStatusOverride:I,align:x,headerWidth:S,renderHiddenTabs:W=!0}=n,E=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(n,["children","selectedTabId","onTabChange","position","size","validationStatusOverride","align","headerWidth","renderHiddenTabs"]);y||(b.warn("Warning: This version of the `Tabs` component is intended to help migration to the `next` version and will be removed in a future release."),y=!0);const k=o((()=>{const e=[];return t.Children.forEach(j,(r=>{t.isValidElement(r)&&e.push({props:r.props})})),e}),[j]),[C,z]=i(w||(null===(g=k[0])||void 0===g?void 0:g.props.id)||(null===(v=k[0])||void 0===v?void 0:v.props.tabId)),D="default"===_?"medium":"large",{isInSidebar:H}=t.useContext(u),$=H||"left"===P?"vertical":"horizontal",q=W?k:k.filter((({props:e})=>e.isTabSelected||e.tabId===C)),L=f(w);return a((()=>{w!==L&&w!==C&&z(w)}),[w,L,C]),e(s,O(h({orientation:$,selectedTabId:C,size:D},E),{children:[r(d,{ref:m,ariaLabel:"Tabs",onTabChange:e=>{z(e),null==T||T(e)},headerWidth:H?"100%":void 0,children:k.map((({props:e})=>{const r=e.id||e.tabId;return r?l(c,O(h({headerWidth:H?"100%":S},e),{key:r})):(b.warn("Warning: Tab component is missing a unique identifier. Please provide an `id` prop to ensure proper functionality."),null)}))}),!H&&q.map((({props:e})=>{const t=e.id||e.tabId;return t?r(p,{id:`${t}-panel`,tabId:t,children:e.children},`${t}-panel`):(b.warn("Warning: Each `Tab` component must have an `id` or `tabId` prop to associate it with a TabPanel."),null)}))]}))}));g.displayName="Tabs";export{g as Tabs,g as default};
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Accordion}from"./components/accordion/accordion.component.js";export{AccordionGroup}from"./components/accordion/accordion-group/accordion-group.component.js";export{ActionPopover}from"./components/action-popover/action-popover.component.js";export{default as ActionPopoverMenu}from"./components/action-popover/action-popover-menu/action-popover-menu.component.js";export{ActionPopoverItem}from"./components/action-popover/action-popover-item/action-popover-item.component.js";export{ActionPopoverMenuButton}from"./components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js";import"./components/action-popover/action-popover-divider/action-popover-divider.component.js";export{AdaptiveSidebar}from"./components/adaptive-sidebar/adaptive-sidebar.component.js";export{AdvancedColorPicker}from"./components/advanced-color-picker/advanced-color-picker.component.js";export{Alert}from"./components/alert/alert.component.js";export{default as AnchorNavigation}from"./components/anchor-navigation/anchor-navigation.component.js";export{default as AnchorNavigationItem}from"./components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.component.js";export{default as AnchorSectionDivider}from"./components/anchor-navigation/anchor-section-divider.component.js";export{Badge}from"./components/badge/badge.component.js";export{BatchSelection}from"./components/batch-selection/batch-selection.component.js";export{Box}from"./components/box/box.component.js";export{Breadcrumbs}from"./components/breadcrumbs/breadcrumbs.component.js";export{default as Crumb}from"./components/breadcrumbs/crumb/crumb.component.js";export{ButtonBar}from"./components/button-bar/button-bar.component.js";export{ButtonMinor}from"./components/button-minor/button-minor.component.js";export{ButtonToggle}from"./components/button-toggle/button-toggle.component.js";export{default as ButtonToggleGroup}from"./components/button-toggle/button-toggle-group/button-toggle-group.component.js";export{default as Button}from"./components/button/button.component.js";export{CarbonProvider}from"./components/carbon-provider/carbon-provider.component.js";export{default as Card}from"./components/card/card.component.js";export{default as CardColumn}from"./components/card/card-column/card-column.component.js";export{default as CardFooter}from"./components/card/card-footer/card-footer.component.js";export{default as CardRow}from"./components/card/card-row/card-row.component.js";export{CheckboxGroup}from"./components/checkbox/checkbox-group/checkbox-group.component.js";export{Checkbox}from"./components/checkbox/checkbox.component.js";export{Confirm}from"./components/confirm/confirm.component.js";export{Content}from"./components/content/content.component.js";export{DateRange}from"./components/date-range/date-range.component.js";export{DateInput}from"./components/date/date.component.js";export{Decimal}from"./components/decimal/decimal.component.js";export{default as Dl}from"./components/definition-list/dl.component.js";export{default as Dt}from"./components/definition-list/dt/dt.component.js";export{default as Dd}from"./components/definition-list/dd/dd.component.js";export{Detail}from"./components/detail/detail.component.js";export{Dialog}from"./components/dialog/dialog.component.js";export{DismissibleBox}from"./components/dismissible-box/dismissible-box.component.js";export{default as DraggableContainer}from"./components/draggable/draggable-container.component.js";export{default as DraggableItem}from"./components/draggable/draggable-item/draggable-item.component.js";export{Drawer}from"./components/drawer/drawer.component.js";export{DuellingPicklist}from"./components/duelling-picklist/duelling-picklist.component.js";export{default as PicklistDivider}from"./components/duelling-picklist/picklist-divider/picklist-divider.component.js";export{PicklistItem}from"./components/duelling-picklist/picklist-item/picklist-item.component.js";export{Picklist}from"./components/duelling-picklist/picklist/picklist.component.js";export{PicklistPlaceholder}from"./components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js";export{PicklistGroup}from"./components/duelling-picklist/picklist-group/picklist-group.component.js";export{Fieldset}from"./components/fieldset/fieldset.component.js";export{FileInput}from"./components/file-input/file-input.component.js";export{FlatTable}from"./components/flat-table/flat-table.component.js";export{FlatTableHead}from"./components/flat-table/flat-table-head/flat-table-head.component.js";export{FlatTableHeader}from"./components/flat-table/flat-table-header/flat-table-header.component.js";export{FlatTableBody}from"./components/flat-table/flat-table-body/flat-table-body.component.js";export{FlatTableRow}from"./components/flat-table/flat-table-row/flat-table-row.component.js";export{FlatTableRowHeader}from"./components/flat-table/flat-table-row-header/flat-table-row-header.component.js";export{FlatTableCell}from"./components/flat-table/flat-table-cell/flat-table-cell.component.js";export{FlatTableCheckbox}from"./components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js";export{FlatTableBodyDraggable}from"./components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js";export{Sort}from"./components/flat-table/sort/sort.component.js";export{Form}from"./components/form/form.component.js";export{default as RequiredFieldsIndicator}from"./components/form/required-fields-indicator/required-fields-indicator.component.js";export{default as GlobalHeader}from"./components/global-header/global-header.component.js";export{GridContainer}from"./components/grid/grid-container/grid-container.component.js";export{GridItem}from"./components/grid/grid-item/grid-item.component.js";export{GroupedCharacter}from"./components/grouped-character/grouped-character.component.js";export{Heading}from"./components/heading/heading.component.js";export{Help}from"./components/help/help.component.js";export{Hr}from"./components/hr/hr.component.js";export{I18nProvider}from"./components/i18n-provider/i18n-provider.component.js";export{default as IconButton}from"./components/icon-button/icon-button.component.js";export{default as Icon}from"./components/icon/icon.component.js";export{Image}from"./components/image/image.component.js";export{default as InlineInputs}from"./components/inline-inputs/inline-inputs.component.js";export{LinkPreview}from"./components/link-preview/link-preview.component.js";export{Link}from"./components/link/link.component.js";export{Loader}from"./components/loader/loader.component.js";export{LoaderBar}from"./components/loader-bar/loader-bar.component.js";export{LoaderSpinner}from"./components/loader-spinner/loader-spinner.component.js";export{default as LoaderStar}from"./components/loader-star/loader-star.component.js";export{Loader as NextLoader}from"./components/loader/__next__/loader.component.js";export{Menu}from"./components/menu/menu.component.js";export{MenuItem}from"./components/menu/menu-item/menu-item.component.js";export{default as MenuDivider}from"./components/menu/menu-divider/menu-divider.component.js";export{default as MenuSegmentTitle}from"./components/menu/menu-segment-title/menu-segment-title.component.js";export{MenuFullscreen}from"./components/menu/menu-full-screen/menu-full-screen.component.js";export{ScrollableBlock}from"./components/menu/scrollable-block/scrollable-block.component.js";export{Message}from"./components/message/message.component.js";export{default as Modal}from"./components/modal/index.js";export{MultiActionButton}from"./components/multi-action-button/multi-action-button.component.js";export{NavigationBar}from"./components/navigation-bar/navigation-bar.component.js";export{Note}from"./components/note/note.component.js";export{Number}from"./components/number/number.component.js";export{NumeralDate}from"./components/numeral-date/numeral-date.component.js";export{Pager}from"./components/pager/pager.component.js";export{default as Pages}from"./components/pages/pages.component.js";export{default as Page}from"./components/pages/page/page.component.js";export{Password}from"./components/password/password.component.js";export{Pill}from"./components/pill/pill.component.js";export{default as Pod}from"./components/pod/pod.component.js";export{PopoverContainer}from"./components/popover-container/popover-container.component.js";export{default as Portal}from"./components/portal/portal.js";export{Portrait}from"./components/portrait/portrait.component.js";export{Preview}from"./components/preview/preview.component.js";export{Profile}from"./components/profile/profile.component.js";export{default as ProgressTracker}from"./components/progress-tracker/progress-tracker.component.js";export{default as RadioButton}from"./components/radio-button/radio-button.component.js";export{RadioButtonGroup}from"./components/radio-button/radio-button-group/radio-button-group.component.js";export{Search}from"./components/search/search.component.js";export{default as Option}from"./components/select/option/option.component.js";export{default as OptionRow}from"./components/select/option-row/option-row.component.js";export{default as OptionGroupHeader}from"./components/select/option-group-header/option-group-header.component.js";export{SimpleSelect as Select}from"./components/select/simple-select/simple-select.component.js";export{FilterableSelect}from"./components/select/filterable-select/filterable-select.component.js";export{MultiSelect}from"./components/select/multi-select/multi-select.component.js";export{default as setupSelectMocks}from"./components/select/setup-select-mocks.js";export{SettingsRow}from"./components/settings-row/settings-row.component.js";export{Sidebar}from"./components/sidebar/sidebar.component.js";export{SimpleColorPicker}from"./components/simple-color-picker/simple-color-picker.component.js";export{SimpleColor}from"./components/simple-color-picker/simple-color/simple-color.component.js";export{SplitButton}from"./components/split-button/split-button.component.js";export{StepFlowTitle}from"./components/step-flow/step-flow-title/step-flow-title.component.js";export{StepFlow}from"./components/step-flow/step-flow.component.js";export{StepSequence}from"./components/step-sequence/step-sequence.component.js";export{StepSequenceItem}from"./components/step-sequence/step-sequence-item/step-sequence-item.component.js";export{Switch}from"./components/switch/switch.component.js";export{Tabs}from"./components/tabs/tabs.component.js";export{TextEditor}from"./components/text-editor/text-editor.component.js";export{createEmpty,createFromHTML}from"./components/text-editor/__internal__/__utils__/helpers.js";import"react/jsx-runtime";import"@lexical/react/LexicalComposerContext";import"@lexical/react/LexicalTypeaheadMenuPlugin";import"lexical";import"react";import"react-dom";import"./components/text-editor/__internal__/__ui__/Mentions/constants.js";import"./components/text-editor/__internal__/__ui__/Mentions/mentions.style.js";import"./__internal__/i18n-context/index.js";export{Textarea}from"./components/textarea/textarea.component.js";export{Textbox}from"./components/textbox/textbox.component.js";export{default as TileSelect}from"./components/tile-select/tile-select.component.js";export{TileSelectGroup}from"./components/tile-select/tile-select-group/tile-select-group.component.js";export{Tile}from"./components/tile/tile.component.js";export{default as TileContent}from"./components/tile/tile-content/tile-content.component.js";export{TileFooter}from"./components/tile/tile-footer/tile-footer.component.js";export{TileHeader}from"./components/tile/tile-header/tile-header.component.js";export{FlexTileContainer}from"./components/tile/flex-tile-container/flex-tile-container.component.js";export{FlexTileCell}from"./components/tile/flex-tile-cell/flex-tile-cell.component.js";export{FlexTileDivider}from"./components/tile/flex-tile-divider/flex-tile-divider.component.js";export{default as Time}from"./components/time/time.component.js";export{Toast}from"./components/toast/toast.component.js";export{Tooltip}from"./components/tooltip/tooltip.component.js";export{Typography}from"./components/typography/typography.component.js";export{List,ListItem}from"./components/typography/list.component.js";export{VerticalDivider}from"./components/vertical-divider/vertical-divider.component.js";export{VerticalMenu}from"./components/vertical-menu/vertical-menu.component.js";export{VerticalMenuItem}from"./components/vertical-menu/vertical-menu-item/vertical-menu-item.component.js";export{VerticalMenuFullScreen}from"./components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.js";export{VerticalMenuTrigger}from"./components/vertical-menu/vertical-menu-trigger/vertical-menu-trigger.component.js";import"./components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js";import"react-transition-group";import"./hooks/__internal__/useScrollBlock/useScrollBlock.js";import"./__internal__/modal/modal-manager.js";import"./__internal__/modal/modal.style.js";import"./__internal__/modal/modal.context.js";export{default as useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";import"./components/carbon-provider/__internal__/top-modal.context.js";import"./components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js";import"./style/utils/filter-styled-system-padding-props.js";import"./components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js";export{default as useCharacterCount}from"./hooks/useCharacterCount/useCharacterCount.js";export{default as GlobalStyle}from"./style/global-style.js";export{MenuItemDivider as ActionPopoverDivider}from"./components/action-popover/action-popover.style.js";export{Tab}from"./components/tabs/tab/tab.component.js";
|
|
1
|
+
export{Accordion}from"./components/accordion/accordion.component.js";export{AccordionGroup}from"./components/accordion/accordion-group/accordion-group.component.js";export{ActionPopover}from"./components/action-popover/action-popover.component.js";export{default as ActionPopoverMenu}from"./components/action-popover/action-popover-menu/action-popover-menu.component.js";export{ActionPopoverItem}from"./components/action-popover/action-popover-item/action-popover-item.component.js";export{ActionPopoverMenuButton}from"./components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js";import"./components/action-popover/action-popover-divider/action-popover-divider.component.js";export{AdaptiveSidebar}from"./components/adaptive-sidebar/adaptive-sidebar.component.js";export{AdvancedColorPicker}from"./components/advanced-color-picker/advanced-color-picker.component.js";export{Alert}from"./components/alert/alert.component.js";export{default as AnchorNavigation}from"./components/anchor-navigation/anchor-navigation.component.js";export{default as AnchorNavigationItem}from"./components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.component.js";export{default as AnchorSectionDivider}from"./components/anchor-navigation/anchor-section-divider.component.js";export{Badge}from"./components/badge/badge.component.js";export{BatchSelection}from"./components/batch-selection/batch-selection.component.js";export{Box}from"./components/box/box.component.js";export{Breadcrumbs}from"./components/breadcrumbs/breadcrumbs.component.js";export{default as Crumb}from"./components/breadcrumbs/crumb/crumb.component.js";export{ButtonBar}from"./components/button-bar/button-bar.component.js";export{ButtonMinor}from"./components/button-minor/button-minor.component.js";export{ButtonToggle}from"./components/button-toggle/button-toggle.component.js";export{default as ButtonToggleGroup}from"./components/button-toggle/button-toggle-group/button-toggle-group.component.js";export{default as Button}from"./components/button/button.component.js";export{CarbonProvider}from"./components/carbon-provider/carbon-provider.component.js";export{default as Card}from"./components/card/card.component.js";export{default as CardColumn}from"./components/card/card-column/card-column.component.js";export{default as CardFooter}from"./components/card/card-footer/card-footer.component.js";export{default as CardRow}from"./components/card/card-row/card-row.component.js";export{CheckboxGroup}from"./components/checkbox/checkbox-group/checkbox-group.component.js";export{Checkbox}from"./components/checkbox/checkbox.component.js";export{Confirm}from"./components/confirm/confirm.component.js";export{Content}from"./components/content/content.component.js";export{DateRange}from"./components/date-range/date-range.component.js";export{DateInput}from"./components/date/date.component.js";export{Decimal}from"./components/decimal/decimal.component.js";export{default as Dl}from"./components/definition-list/dl.component.js";export{default as Dt}from"./components/definition-list/dt/dt.component.js";export{default as Dd}from"./components/definition-list/dd/dd.component.js";export{Detail}from"./components/detail/detail.component.js";export{Dialog}from"./components/dialog/dialog.component.js";export{DismissibleBox}from"./components/dismissible-box/dismissible-box.component.js";export{default as DraggableContainer}from"./components/draggable/draggable-container.component.js";export{default as DraggableItem}from"./components/draggable/draggable-item/draggable-item.component.js";export{Drawer}from"./components/drawer/drawer.component.js";export{DuellingPicklist}from"./components/duelling-picklist/duelling-picklist.component.js";export{default as PicklistDivider}from"./components/duelling-picklist/picklist-divider/picklist-divider.component.js";export{PicklistItem}from"./components/duelling-picklist/picklist-item/picklist-item.component.js";export{Picklist}from"./components/duelling-picklist/picklist/picklist.component.js";export{PicklistPlaceholder}from"./components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.js";export{PicklistGroup}from"./components/duelling-picklist/picklist-group/picklist-group.component.js";export{Fieldset}from"./components/fieldset/fieldset.component.js";export{FileInput}from"./components/file-input/file-input.component.js";export{FlatTable}from"./components/flat-table/flat-table.component.js";export{FlatTableHead}from"./components/flat-table/flat-table-head/flat-table-head.component.js";export{FlatTableHeader}from"./components/flat-table/flat-table-header/flat-table-header.component.js";export{FlatTableBody}from"./components/flat-table/flat-table-body/flat-table-body.component.js";export{FlatTableRow}from"./components/flat-table/flat-table-row/flat-table-row.component.js";export{FlatTableRowHeader}from"./components/flat-table/flat-table-row-header/flat-table-row-header.component.js";export{FlatTableCell}from"./components/flat-table/flat-table-cell/flat-table-cell.component.js";export{FlatTableCheckbox}from"./components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js";export{FlatTableBodyDraggable}from"./components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js";export{Sort}from"./components/flat-table/sort/sort.component.js";export{Form}from"./components/form/form.component.js";export{default as RequiredFieldsIndicator}from"./components/form/required-fields-indicator/required-fields-indicator.component.js";export{default as GlobalHeader}from"./components/global-header/global-header.component.js";export{GridContainer}from"./components/grid/grid-container/grid-container.component.js";export{GridItem}from"./components/grid/grid-item/grid-item.component.js";export{GroupedCharacter}from"./components/grouped-character/grouped-character.component.js";export{Heading}from"./components/heading/heading.component.js";export{Help}from"./components/help/help.component.js";export{Hr}from"./components/hr/hr.component.js";export{I18nProvider}from"./components/i18n-provider/i18n-provider.component.js";export{default as IconButton}from"./components/icon-button/icon-button.component.js";export{default as Icon}from"./components/icon/icon.component.js";export{Image}from"./components/image/image.component.js";export{default as InlineInputs}from"./components/inline-inputs/inline-inputs.component.js";export{LinkPreview}from"./components/link-preview/link-preview.component.js";export{Link}from"./components/link/link.component.js";export{Loader}from"./components/loader/loader.component.js";export{LoaderBar}from"./components/loader-bar/loader-bar.component.js";export{LoaderSpinner}from"./components/loader-spinner/loader-spinner.component.js";export{default as LoaderStar}from"./components/loader-star/loader-star.component.js";export{Loader as NextLoader}from"./components/loader/__next__/loader.component.js";export{Menu}from"./components/menu/menu.component.js";export{MenuItem}from"./components/menu/menu-item/menu-item.component.js";export{default as MenuDivider}from"./components/menu/menu-divider/menu-divider.component.js";export{default as MenuSegmentTitle}from"./components/menu/menu-segment-title/menu-segment-title.component.js";export{MenuFullscreen}from"./components/menu/menu-full-screen/menu-full-screen.component.js";export{ScrollableBlock}from"./components/menu/scrollable-block/scrollable-block.component.js";export{Message}from"./components/message/message.component.js";export{default as Modal}from"./components/modal/index.js";export{MultiActionButton}from"./components/multi-action-button/multi-action-button.component.js";export{NavigationBar}from"./components/navigation-bar/navigation-bar.component.js";export{Note}from"./components/note/note.component.js";export{Number}from"./components/number/number.component.js";export{NumeralDate}from"./components/numeral-date/numeral-date.component.js";export{Pager}from"./components/pager/pager.component.js";export{default as Pages}from"./components/pages/pages.component.js";export{default as Page}from"./components/pages/page/page.component.js";export{Password}from"./components/password/password.component.js";export{Pill}from"./components/pill/pill.component.js";export{default as Pod}from"./components/pod/pod.component.js";export{PopoverContainer}from"./components/popover-container/popover-container.component.js";export{default as Portal}from"./components/portal/portal.js";export{Portrait}from"./components/portrait/portrait.component.js";export{Preview}from"./components/preview/preview.component.js";export{Profile}from"./components/profile/profile.component.js";export{default as ProgressTracker}from"./components/progress-tracker/progress-tracker.component.js";export{default as RadioButton}from"./components/radio-button/radio-button.component.js";export{RadioButtonGroup}from"./components/radio-button/radio-button-group/radio-button-group.component.js";export{Search}from"./components/search/search.component.js";export{default as Option}from"./components/select/option/option.component.js";export{default as OptionRow}from"./components/select/option-row/option-row.component.js";export{default as OptionGroupHeader}from"./components/select/option-group-header/option-group-header.component.js";export{SimpleSelect as Select}from"./components/select/simple-select/simple-select.component.js";export{FilterableSelect}from"./components/select/filterable-select/filterable-select.component.js";export{MultiSelect}from"./components/select/multi-select/multi-select.component.js";export{default as setupSelectMocks}from"./components/select/setup-select-mocks.js";export{SettingsRow}from"./components/settings-row/settings-row.component.js";export{Sidebar}from"./components/sidebar/sidebar.component.js";export{SimpleColorPicker}from"./components/simple-color-picker/simple-color-picker.component.js";export{SimpleColor}from"./components/simple-color-picker/simple-color/simple-color.component.js";export{SplitButton}from"./components/split-button/split-button.component.js";export{StepFlowTitle}from"./components/step-flow/step-flow-title/step-flow-title.component.js";export{StepFlow}from"./components/step-flow/step-flow.component.js";export{StepSequence}from"./components/step-sequence/step-sequence.component.js";export{StepSequenceItem}from"./components/step-sequence/step-sequence-item/step-sequence-item.component.js";export{Switch}from"./components/switch/switch.component.js";export{Tabs}from"./components/tabs/tabs.component.js";export{Tab}from"./components/tabs/tab/tab.component.js";export{TextEditor}from"./components/text-editor/text-editor.component.js";export{createEmpty,createFromHTML}from"./components/text-editor/__internal__/__utils__/helpers.js";import"react/jsx-runtime";import"@lexical/react/LexicalComposerContext";import"@lexical/react/LexicalTypeaheadMenuPlugin";import"lexical";import"react";import"react-dom";import"./components/text-editor/__internal__/__ui__/Mentions/constants.js";import"./components/text-editor/__internal__/__ui__/Mentions/mentions.style.js";import"./__internal__/i18n-context/index.js";export{Textarea}from"./components/textarea/textarea.component.js";export{Textbox}from"./components/textbox/textbox.component.js";export{default as TileSelect}from"./components/tile-select/tile-select.component.js";export{TileSelectGroup}from"./components/tile-select/tile-select-group/tile-select-group.component.js";export{Tile}from"./components/tile/tile.component.js";export{default as TileContent}from"./components/tile/tile-content/tile-content.component.js";export{TileFooter}from"./components/tile/tile-footer/tile-footer.component.js";export{TileHeader}from"./components/tile/tile-header/tile-header.component.js";export{FlexTileContainer}from"./components/tile/flex-tile-container/flex-tile-container.component.js";export{FlexTileCell}from"./components/tile/flex-tile-cell/flex-tile-cell.component.js";export{FlexTileDivider}from"./components/tile/flex-tile-divider/flex-tile-divider.component.js";export{default as Time}from"./components/time/time.component.js";export{Toast}from"./components/toast/toast.component.js";export{Tooltip}from"./components/tooltip/tooltip.component.js";export{Typography}from"./components/typography/typography.component.js";export{List,ListItem}from"./components/typography/list.component.js";export{VerticalDivider}from"./components/vertical-divider/vertical-divider.component.js";export{VerticalMenu}from"./components/vertical-menu/vertical-menu.component.js";export{VerticalMenuItem}from"./components/vertical-menu/vertical-menu-item/vertical-menu-item.component.js";export{VerticalMenuFullScreen}from"./components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.js";export{VerticalMenuTrigger}from"./components/vertical-menu/vertical-menu-trigger/vertical-menu-trigger.component.js";import"./components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js";import"react-transition-group";import"./hooks/__internal__/useScrollBlock/useScrollBlock.js";import"./__internal__/modal/modal-manager.js";import"./__internal__/modal/modal.style.js";import"./__internal__/modal/modal.context.js";export{default as useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";import"./components/carbon-provider/__internal__/top-modal.context.js";import"./components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js";import"./style/utils/filter-styled-system-padding-props.js";import"./components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js";export{default as useCharacterCount}from"./hooks/useCharacterCount/useCharacterCount.js";export{default as GlobalStyle}from"./style/global-style.js";export{MenuItemDivider as ActionPopoverDivider}from"./components/action-popover/action-popover.style.js";
|
package/esm/locales/en-gb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{enGB as e}from"date-fns/locale/en-GB";const a=e=>1===("string"==typeof e?parseInt(e):e),r={locale:()=>"en-GB",actions:{edit:()=>"Edit",delete:()=>"Delete"},actionPopover:{ariaLabel:()=>"actions"},advancedColorPicker:{ariaLabel:()=>"Change colour",currentColorDescriptionTerm:()=>"Current colour assigned: ",currentColorAssigned:e=>e},batchSelection:{selected:e=>`${e} selected`},breadcrumbs:{ariaLabel:()=>"breadcrumbs"},confirm:{no:()=>"No",yes:()=>"Yes"},characterCount:{tooManyCharacters:(e,a)=>1===e?`${a} character too many`:`${a} characters too many`,charactersLeft:(e,a)=>1===e?`${a} character left`:`${a} characters left`,visuallyHiddenHint:e=>`You can enter up to ${e} characters`},date:{dateFnsLocale:()=>e,ariaLabels:{previousMonthButton:()=>"Previous month",nextMonthButton:()=>"Next month"},dateFormatOverride:void 0},dialog:{ariaLabels:{close:()=>"Close"}},dismissibleBox:{ariaLabels:{close:()=>"Close"}},errors:{messages:{formSummary:(e,r,t)=>{const o=a(e)?"error":"errors",n=a(r)?"warning":"warnings",i=a(e)?"is":"are",s=a(r)?"is":"are";return e&&r&&"warning"===t?["and",`${r} ${n}`]:e?[`There ${i}`,`${e} ${o}`]:r?[`There ${s}`,`${r} ${n}`]:null}}},fileInput:{dragAndDrop:()=>"or drag and drop your file",selectFile:()=>"Select file",fileUploadStatus:()=>"File upload status",actions:{cancel:()=>"Cancel upload",clear:()=>"Clear",delete:()=>"Delete file"}},heading:{backLinkAriaLabel:()=>"Back"},link:{skipLinkLabel:()=>"Skip to main content"},loader:{loading:()=>"Loading..."},loaderSpinner:{loading:()=>"Loading..."},loaderStar:{loading:()=>"Loading..."},menuFullscreen:{ariaLabels:{closeButton:()=>"Close"}},message:{closeButtonAriaLabel:()=>"Close",error:()=>"Error",info:()=>"Information",success:()=>"Success",warning:()=>"Warning",neutral:()=>"Information",ai:()=>"AI Information",callout:()=>"Callout"},numeralDate:{validation:{day:(e,a)=>e&&a?`Day in ${e} should be a number within 1-${a}.`:"Day should be a number within a 1-31 range.",month:()=>"Month should be a number within a 1-12 range.",year:()=>"Year should be a number within a 1800-2200 range."},labels:{day:()=>"Day",month:()=>"Month",year:()=>"Year"}},pager:{show:()=>"Show",records:(e,r=!0)=>{const t=a(e)?"item":"items";return r?`${e} ${t}`:t},first:()=>"First",last:()=>"Last",next:()=>"Next",previous:()=>"Previous",pageX:()=>"Page",ofY:e=>`of ${e}`},password:{buttonLabelHide:()=>"Hide",buttonLabelShow:()=>"Show",ariaLabelHide:()=>"Hide password",ariaLabelShow:()=>"Show password",ariaLiveShownMessage:()=>"Your password has been shown. Focus on the password input to have it read to you, if it is safe to do so.",ariaLiveHiddenMessage:()=>"Your password is currently hidden."},pill:{remove:e=>`Remove ${e} pill`},progressTracker:{of:()=>"of"},pod:{undo:()=>"Undo"},tabs:{error:e=>`The ${e} tab contains errors`,info:e=>`The ${e} tab contains information`,warning:e=>`The ${e} tab contains warnings
|
|
1
|
+
import{enGB as e}from"date-fns/locale/en-GB";const a=e=>1===("string"==typeof e?parseInt(e):e),r={locale:()=>"en-GB",actions:{edit:()=>"Edit",delete:()=>"Delete"},actionPopover:{ariaLabel:()=>"actions"},advancedColorPicker:{ariaLabel:()=>"Change colour",currentColorDescriptionTerm:()=>"Current colour assigned: ",currentColorAssigned:e=>e},batchSelection:{selected:e=>`${e} selected`},breadcrumbs:{ariaLabel:()=>"breadcrumbs"},confirm:{no:()=>"No",yes:()=>"Yes"},characterCount:{tooManyCharacters:(e,a)=>1===e?`${a} character too many`:`${a} characters too many`,charactersLeft:(e,a)=>1===e?`${a} character left`:`${a} characters left`,visuallyHiddenHint:e=>`You can enter up to ${e} characters`},date:{dateFnsLocale:()=>e,ariaLabels:{previousMonthButton:()=>"Previous month",nextMonthButton:()=>"Next month"},dateFormatOverride:void 0},dialog:{ariaLabels:{close:()=>"Close"}},dismissibleBox:{ariaLabels:{close:()=>"Close"}},errors:{messages:{formSummary:(e,r,t)=>{const o=a(e)?"error":"errors",n=a(r)?"warning":"warnings",i=a(e)?"is":"are",s=a(r)?"is":"are";return e&&r&&"warning"===t?["and",`${r} ${n}`]:e?[`There ${i}`,`${e} ${o}`]:r?[`There ${s}`,`${r} ${n}`]:null}}},fileInput:{dragAndDrop:()=>"or drag and drop your file",selectFile:()=>"Select file",fileUploadStatus:()=>"File upload status",actions:{cancel:()=>"Cancel upload",clear:()=>"Clear",delete:()=>"Delete file"}},heading:{backLinkAriaLabel:()=>"Back"},link:{skipLinkLabel:()=>"Skip to main content"},loader:{loading:()=>"Loading..."},loaderSpinner:{loading:()=>"Loading..."},loaderStar:{loading:()=>"Loading..."},menuFullscreen:{ariaLabels:{closeButton:()=>"Close"}},message:{closeButtonAriaLabel:()=>"Close",error:()=>"Error",info:()=>"Information",success:()=>"Success",warning:()=>"Warning",neutral:()=>"Information",ai:()=>"AI Information",callout:()=>"Callout"},numeralDate:{validation:{day:(e,a)=>e&&a?`Day in ${e} should be a number within 1-${a}.`:"Day should be a number within a 1-31 range.",month:()=>"Month should be a number within a 1-12 range.",year:()=>"Year should be a number within a 1800-2200 range."},labels:{day:()=>"Day",month:()=>"Month",year:()=>"Year"}},pager:{show:()=>"Show",records:(e,r=!0)=>{const t=a(e)?"item":"items";return r?`${e} ${t}`:t},first:()=>"First",last:()=>"Last",next:()=>"Next",previous:()=>"Previous",pageX:()=>"Page",ofY:e=>`of ${e}`},password:{buttonLabelHide:()=>"Hide",buttonLabelShow:()=>"Show",ariaLabelHide:()=>"Hide password",ariaLabelShow:()=>"Show password",ariaLiveShownMessage:()=>"Your password has been shown. Focus on the password input to have it read to you, if it is safe to do so.",ariaLiveHiddenMessage:()=>"Your password is currently hidden."},pill:{remove:e=>`Remove ${e} pill`},progressTracker:{of:()=>"of"},pod:{undo:()=>"Undo"},tabs:{error:e=>`The ${e} tab contains errors`,info:e=>`The ${e} tab contains information`,warning:e=>`The ${e} tab contains warnings`,scrollLeftText:()=>"Scroll Tabs Left",scrollRightText:()=>"Scroll Tabs Right"},textEditor:{boldAria:()=>"Bold",cancelButton:()=>"Cancel",cancelButtonAria:()=>"Cancel",characterCounter:e=>`${"number"==typeof e?e.toString():e} characters remaining`,characterLimit:e=>`You are ${e} character(s) over the character limit`,contentEditorAria:()=>"Rich text content editor",hyperlink:{buttonAria:()=>"Hyperlink",cancelButton:()=>"Cancel",cancelButtonAria:()=>"Cancel",dialogTitle:()=>"Add link",linkFieldLabel:()=>"Link",saveButton:()=>"Save",saveButtonAria:()=>"Save",textFieldLabel:()=>"Text"},typography:{selectAria:()=>"Heading type",paragraph:()=>"Paragraph",title:()=>"Title",subtitle:()=>"Subtitle",sectionHeader:()=>"Section header",sectionSubheader:()=>"Section subheader"},italicAria:()=>"Italic",orderedListAria:()=>"Ordered list",saveButton:()=>"Save",saveButtonAria:()=>"Save",toolbarAriaLabel:()=>"Formatting",underlineAria:()=>"Underline",unorderedListAria:()=>"Unordered list",mentions:{listAriaLabel:()=>"List of mentionable people"}},search:{searchButtonText:()=>"Search"},select:{actionButtonText:()=>"Add New Item",placeholder:()=>"Please Select...",noResultsForTerm:e=>`No results for "${e}"`},sidebar:{ariaLabels:{close:()=>"Close"}},sort:{accessibleName:(e,a)=>`Sort all ${e||"contents"}${a?` in an ${a} order.`:" in an ascending or descending order."}`},splitButton:{ariaLabel:()=>"Show more"},stepFlow:{stepLabel:(e,a)=>`Step ${e} of ${a}`,screenReaderOnlyTitle:(e,a,r,t)=>`${t?`${t}.`:""} ${e}. Step ${a} of ${r}.`,closeIconAriaLabel:()=>"Close"},switch:{on:()=>"ON",off:()=>"OFF"},tileSelect:{deselect:()=>"Deselect"},time:{amText:()=>"AM",pmText:()=>"PM",hoursLabelText:()=>"Hrs.",minutesLabelText:()=>"Mins.",hoursAriaLabelText:()=>"Hours",minutesAriaLabelText:()=>"Minutes"},toast:{ariaLabels:{close:()=>"Close"},error:()=>"Error",info:()=>"Information",success:()=>"Success",warning:()=>"Warning",neutral:()=>"Information",notification:()=>"Notification"},verticalMenu:{ariaLabels:{responsiveMenuLauncher:()=>"Product menu launcher",responsiveMenuCloseButton:()=>"Close product menu",responsiveMenuAria:()=>"Product menu"}},verticalMenuFullScreen:{ariaLabels:{close:()=>"Close"}}};export{r as default};
|
package/esm/locales/locale.d.ts
CHANGED
|
@@ -134,6 +134,8 @@ interface Locale {
|
|
|
134
134
|
error: (tabTitle?: string) => string;
|
|
135
135
|
warning: (tabTitle?: string) => string;
|
|
136
136
|
info: (tabTitle?: string) => string;
|
|
137
|
+
scrollLeftText?: () => string;
|
|
138
|
+
scrollRightText?: () => string;
|
|
137
139
|
};
|
|
138
140
|
textEditor: {
|
|
139
141
|
boldAria: () => string;
|