carbon-react 158.46.2 → 158.46.4
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/components/loader/__next__/internal/ring-loader.component.js +1 -1
- package/esm/components/loader/__next__/loader.component.d.ts +1 -1
- package/esm/components/loader/__next__/loader.style.d.ts +1 -0
- package/esm/components/loader/__next__/loader.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.component.js +1 -1
- package/lib/components/loader/__next__/internal/ring-loader.component.js +1 -1
- package/lib/components/loader/__next__/loader.component.d.ts +1 -1
- package/lib/components/loader/__next__/loader.style.d.ts +1 -0
- package/lib/components/loader/__next__/loader.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.component.js +1 -1
- package/package.json +4 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import"react";import{StyledRingLoaderWrapper as a,StyledRingCircleSvg as r,StyledGradientFill as n,StyledLoaderLabel as l}from"../loader.style.js";import t from"../../../../hooks/__internal__/useLocale/useLocale.js";const o=e=>e||.8,s=({inverse:s,size:d,variant:c,hasMotion:m,isTracked:h,animationTime:u,loaderLabel:g,showLabel:k,isSuccess:f,isError:p})=>{const v=t(),b="ai-stacked"===c||"ai-inline"===c,x="inline"===c||"ai-inline"===c?"inline":"stacked",T=d&&["extra-small","small","large"].includes(d)?d:"medium";return e(a,{loaderVariant:x,"data-role":"ring-loader-container",children:[e(r,{inverse:s,role:"presentation",size:T,variant:x,hasMotion:m,isTracked:h,animationTime:o(u),viewBox:"0 0 24 24",isSuccess:f,isError:p,isGradientVariant:b,children:[b&&i("defs",{children:e("mask",{id:"ai-ring-mask",children:[i("rect",{width:"24",height:"24",fill:"black"}),i("circle",{"data-role":"gradient-mask-arc"})]})}),i("circle",{"data-role":"outer-arc"}),b?i("foreignObject",{x:"0",y:"0",width:"24",height:"24",mask:"url(#ai-ring-mask)",children:i(n,{"data-role":"gradient-fill"})}):i("circle",{"data-role":"inner-arc"})]}),k&&i(l,{inverse:s,"data-role":"loader-label",variant:"span",loaderVariant:x,loaderType:"ring",$size:T,children:g||(null==v?void 0:v.loader.loading())})]})};export{s as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
3
|
import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
|
|
4
|
-
type LOADER_VARIANTS = "typical" | "ai" | "stacked" | "inline";
|
|
4
|
+
type LOADER_VARIANTS = "typical" | "ai" | "stacked" | "inline" | "ai-stacked" | "ai-inline";
|
|
5
5
|
type LOADER_SIZES = "extra-small" | "small" | "medium" | "large";
|
|
6
6
|
type LOADER_TYPES = "standalone" | "ring" | "star";
|
|
7
7
|
type CommonLoaderProps = {
|
|
@@ -26,6 +26,7 @@ interface RingSvgProps {
|
|
|
26
26
|
isError?: boolean;
|
|
27
27
|
}
|
|
28
28
|
export declare const StyledRingCircleSvg: import("styled-components").StyledComponent<"svg", any, RingSvgProps, never>;
|
|
29
|
+
export declare const StyledGradientFill: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
29
30
|
export declare const StyledStars: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
30
31
|
type LabelProps = {
|
|
31
32
|
$size?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{keyframes as t,css as
|
|
1
|
+
import e,{keyframes as t,css as a}from"styled-components";import{margin as i}from"styled-system";import r from"../../../style/themes/apply-base-theme.js";import{Typography as o}from"../../typography/typography.component.js";import"react/jsx-runtime";import"react";import n from"../../button/button.style.js";import{StyledButton as s}from"../../button/__next__/button.style.js";const l={"extra-small":20,small:32,medium:64,large:80},d={"extra-small":2.7,small:2.7,medium:2.7,large:2.7},c={small:"4px",medium:"8px",large:"16px"},m={"extra-small":"8px",small:"8px",medium:"12px",large:"16px"},p=t(["0%{left:0%;animation-timing-function:linear;}30%{left:10px;animation-timing-function:cubic-bezier(0.5,0.6,0.4,1);}100%{left:calc(100% - 15px);}"]),g=t(["0%{width:15px;animation-timing-function:cubic-bezier(0.7,0,0.8,1);}50%{width:35%;}100%{width:15px;}"]),f=t(["from{stroke-dasharray:100;stroke-dashoffset:100;}to{stroke-dasharray:100;stroke-dashoffset:20;}"]),x=t(["0%{transform:rotate(-90deg);stroke-dashoffset:95;}50%{transform:rotate(90deg);stroke-dashoffset:80;}100%{transform:rotate(270deg);stroke-dashoffset:95;}"]),h=(e,t)=>{const a=t?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)";return"ai"===e?{outerBarBackground:a,innerBarBackground:t?"linear-gradient(90deg, var(--mode-color-ai-alt-stop-1, #00D639) 0%, var(--mode-color-ai-alt-stop-2, #00D6DE) 40%, var(--mode-color-ai-alt-stop-3, #9D60FF) 90%)":"linear-gradient(90deg, var(--mode-color-ai-stop-1, #13A038) 0%, var(--mode-color-ai-stop-2, #149197) 40%, var(--mode-color-ai-stop-3, #A87CFB) 90%)"}:{outerBarBackground:a,innerBarBackground:t?"#FFFFFF":"#000000"}},u=a(["display:flex;justify-content:center;text-align:center;"]),y=e.div.withConfig({displayName:"loader.style__StyledLoaderPlaceholder",componentId:"sc-c561a0b8-0"})(["display:inline-block;min-width:var(--sizing800);"]),b=e.div.attrs(r).withConfig({displayName:"loader.style__StyledLoader",componentId:"sc-c561a0b8-1"})([""," text-align:center;white-space:nowrap;"],i),v=e.div.withConfig({displayName:"loader.style__OuterBar",componentId:"sc-c561a0b8-2"})(["",""],(({size:e,variant:t,inverse:i})=>a(["border-radius:var(--borderRadius400);height:",";width:100%;background:",";overflow:hidden;position:relative;"],c[e],h(t,i).outerBarBackground))),w=e.div.withConfig({displayName:"loader.style__InnerBar",componentId:"sc-c561a0b8-3"})(["",""],(({size:e,variant:t,inverse:i,animationTime:r,hasMotion:o})=>a(["position:absolute;background:",";width:15px;height:",";border-radius:var(--borderRadius400);animation-name:",",",";"," animation-iteration-count:",";"],h(t,i).innerBarBackground,c[e],p,g,o&&`animation-duration: ${r}s, ${r}s;`,o?"infinite, infinite":"none, none"))),k=e.svg.withConfig({displayName:"loader.style__StyledRingCircleSvg",componentId:"sc-c561a0b8-4"})(["",""],(({inverse:e,size:t,hasMotion:i,isTracked:r,isError:o,isSuccess:c,isGradientVariant:m,animationTime:p})=>{const g=`${l[t]}px`,h=d[t];return a(["height:",";min-height:",';circle[data-role="outer-arc"]{fill:transparent;stroke-width:',"px;stroke:",';cx:12px;cy:12px;r:10px;}circle[data-role="inner-arc"]{fill:transparent;stroke-width:',"px;stroke:",";stroke-linecap:round;stroke-dasharray:100px;stroke-dashoffset:95px;transform-origin:12px 12px 0px;cx:12px;cy:12px;r:10px;transform:rotate(-90deg);animation-name:",";"," animation-timing-function:cubic-bezier(0,0,1,1);animation-iteration-count:",";}"," ",""],g,g,h,e?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)",h,m?"none":(({inverse:e,isSuccess:t,isError:a})=>a?"#DB004E;":t?"#00811F;":e?"#FFF;":"#000000")({inverse:e,isSuccess:c,isError:o}),r?f:x,i&&`animation-duration: ${p}s;`,i?"infinite":"none",m&&a(['circle[data-role="gradient-mask-arc"]{fill:none;stroke:white;stroke-width:',"px;stroke-linecap:round;stroke-dasharray:100px;stroke-dashoffset:95px;transform-origin:12px 12px 0px;cx:12px;cy:12px;r:10px;transform:rotate(-90deg);animation-name:",";"," animation-timing-function:cubic-bezier(0,0,1,1);animation-iteration-count:",";}"],h,x,i&&`animation-duration: ${p}s;`,i?"infinite":"none"),!m&&a(["",' & circle[data-role="inner-arc"],',' & circle[data-role="inner-arc"]{stroke:currentColor;}'],s,n))})),_=e.div.withConfig({displayName:"loader.style__StyledGradientFill",componentId:"sc-c561a0b8-5"})(["width:100%;height:100%;background:radial-gradient( 1514.52% 80.26% at 56.89% 94.74%,var(--mode-color-ai-alt-stop-1) 0%,var(--mode-color-ai-alt-stop-2) 51.22%,var(--mode-color-ai-stop-3) 100% );"]),B="40px",C=e.div.withConfig({displayName:"loader.style__StyledStars",componentId:"sc-c561a0b8-6"})(["position:relative;width:",";height:",";"],B,B),S={standalone:{small:"4px",medium:"8px",large:"12px"},ring:{"extra-small":"4px",small:"8px",medium:"8px",large:"12px"}},F=e.div.withConfig({displayName:"loader.style__StyledStarLoaderWrapper",componentId:"sc-c561a0b8-7"})(["position:relative;display:flex;align-items:center;justify-content:center;"]),z=e(o).withConfig({displayName:"loader.style__StyledLoaderLabel",componentId:"sc-c561a0b8-8"})([""," line-height:150%;color:",";"," &,"," &{color:currentColor;}",""],u,(({inverse:e})=>e?"rgba(255, 255, 255, 0.55)":"rgba(0, 0, 0, 0.65)"),s,n,(({$size:e="medium",loaderType:t,loaderVariant:i})=>{const r=e;return"star"===t?a(["font-size:16px;font-weight:400;margin-left:12px;width:min-content;"]):"standalone"===t?a(["font-size:",";font-weight:500;width:100%;margin-top:",";"],"large"===r?"16px":"14px",S[t][r]):a(["font-size:",";font-weight:500;width:",";",";"],"large"===r?"16px":"extra-small"===r?"13px":"14px","inline"===i?"auto":"100%","inline"===i?`margin-left: ${m[r]}`:`margin-top: ${S[t][r]}`)})),I=e.div.withConfig({displayName:"loader.style__StyledRingLoaderWrapper",componentId:"sc-c561a0b8-9"})(["",""],(({loaderVariant:e})=>a(["display:flex;flex-direction:",";align-items:center;justify-content:center;width:",";"],"inline"===e?"row":"column","inline"===e?"auto":"100%"))),N=e.span.withConfig({displayName:"loader.style__StyledLabel",componentId:"sc-c561a0b8-10"})(["",";"],(({inverse:e})=>a(["color:",";"," &,"," &{color:currentColor;}"],e?"rgba(255, 255, 255, 0.90)":"rgba(0, 0, 0, 0.90)",s,n)));export{w as InnerBar,v as OuterBar,_ as StyledGradientFill,N as StyledLabel,b as StyledLoader,z as StyledLoaderLabel,y as StyledLoaderPlaceholder,k as StyledRingCircleSvg,I as StyledRingLoaderWrapper,F as StyledStarLoaderWrapper,C as StyledStars};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as a,useCallback as n,useMemo as
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as a,useCallback as n,useMemo as i}from"react";import{useLexicalComposerContext as c}from"@lexical/react/LexicalComposerContext";import{$getRoot as l}from"lexical";import{StyledCharacterCounter as m,VisuallyHiddenCharacterCounter as s}from"./character-counter.style.js";import d from"../../../../../hooks/__internal__/useDebounce/useDebounce.js";import u from"../../../../../hooks/__internal__/useLocale/useLocale.js";const h=({isFocused:h,maxChars:p,namespace:f,marginTop:x})=>{const[_,g]=o(""),[C]=c();a((()=>{C.registerUpdateListener((({editorState:e})=>{e.read((()=>{const e=l().getChildren().map((e=>e.getTextContent())).join("\n\n");g(e)}))}))}),[C]);const j=u(),v=n((e=>new Intl.NumberFormat(j.locale()).format(e)),[j]),[L,b]=o(p),T=i((()=>{const e=p-(_?_.length:0);return e>=0?e:0}),[_,p]),$=d((e=>{b(e||0)}),2e3);return a((()=>{$(T)}),[T,$]),e(r,{children:[t(m,{"data-role":`${f}-character-limit`,marginTop:null!=x?x:"var(--spacing050)","aria-hidden":"true",children:j.textEditor.characterCounter(v(T))}),t(s,{"data-role":`${f}-hidden-live-character-counter`,id:`${f}-hidden-live-character-counter`,"aria-live":h?"polite":"off",children:j.textEditor.characterCounter(v(L))})]})};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("../loader.style.js"),a=require("../../../../hooks/__internal__/useLocale/useLocale.js");const i=e=>e||.8;exports.default=({inverse:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("../loader.style.js"),a=require("../../../../hooks/__internal__/useLocale/useLocale.js");const i=e=>e||.8;exports.default=({inverse:l,size:s,variant:n,hasMotion:t,isTracked:d,animationTime:o,loaderLabel:c,showLabel:u,isSuccess:x,isError:h})=>{const j=a.default(),g="ai-stacked"===n||"ai-inline"===n,m="inline"===n||"ai-inline"===n?"inline":"stacked",v=s&&["extra-small","small","large"].includes(s)?s:"medium";return e.jsxs(r.StyledRingLoaderWrapper,{loaderVariant:m,"data-role":"ring-loader-container",children:[e.jsxs(r.StyledRingCircleSvg,{inverse:l,role:"presentation",size:v,variant:m,hasMotion:t,isTracked:d,animationTime:i(o),viewBox:"0 0 24 24",isSuccess:x,isError:h,isGradientVariant:g,children:[g&&e.jsx("defs",{children:e.jsxs("mask",{id:"ai-ring-mask",children:[e.jsx("rect",{width:"24",height:"24",fill:"black"}),e.jsx("circle",{"data-role":"gradient-mask-arc"})]})}),e.jsx("circle",{"data-role":"outer-arc"}),g?e.jsx("foreignObject",{x:"0",y:"0",width:"24",height:"24",mask:"url(#ai-ring-mask)",children:e.jsx(r.StyledGradientFill,{"data-role":"gradient-fill"})}):e.jsx("circle",{"data-role":"inner-arc"})]}),u&&e.jsx(r.StyledLoaderLabel,{inverse:l,"data-role":"loader-label",variant:"span",loaderVariant:m,loaderType:"ring",$size:v,children:c||(null==j?void 0:j.loader.loading())})]})};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
3
|
import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
|
|
4
|
-
type LOADER_VARIANTS = "typical" | "ai" | "stacked" | "inline";
|
|
4
|
+
type LOADER_VARIANTS = "typical" | "ai" | "stacked" | "inline" | "ai-stacked" | "ai-inline";
|
|
5
5
|
type LOADER_SIZES = "extra-small" | "small" | "medium" | "large";
|
|
6
6
|
type LOADER_TYPES = "standalone" | "ring" | "star";
|
|
7
7
|
type CommonLoaderProps = {
|
|
@@ -26,6 +26,7 @@ interface RingSvgProps {
|
|
|
26
26
|
isError?: boolean;
|
|
27
27
|
}
|
|
28
28
|
export declare const StyledRingCircleSvg: import("styled-components").StyledComponent<"svg", any, RingSvgProps, never>;
|
|
29
|
+
export declare const StyledGradientFill: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
29
30
|
export declare const StyledStars: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
30
31
|
type LabelProps = {
|
|
31
32
|
$size?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("styled-system"),
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("styled-system"),a=require("../../../style/themes/apply-base-theme.js"),r=require("../../typography/typography.component.js");require("react/jsx-runtime"),require("react");var i=require("../../button/button.style.js"),o=require("../../button/__next__/button.style.js");function n(e){return e&&e.__esModule?e:{default:e}}var s=n(e);const l={"extra-small":20,small:32,medium:64,large:80},d={"extra-small":2.7,small:2.7,medium:2.7,large:2.7},c={small:"4px",medium:"8px",large:"16px"},p={"extra-small":"8px",small:"8px",medium:"12px",large:"16px"},m=e.keyframes(["0%{left:0%;animation-timing-function:linear;}30%{left:10px;animation-timing-function:cubic-bezier(0.5,0.6,0.4,1);}100%{left:calc(100% - 15px);}"]),u=e.keyframes(["0%{width:15px;animation-timing-function:cubic-bezier(0.7,0,0.8,1);}50%{width:35%;}100%{width:15px;}"]),f=e.keyframes(["from{stroke-dasharray:100;stroke-dashoffset:100;}to{stroke-dasharray:100;stroke-dashoffset:20;}"]),g=e.keyframes(["0%{transform:rotate(-90deg);stroke-dashoffset:95;}50%{transform:rotate(90deg);stroke-dashoffset:80;}100%{transform:rotate(270deg);stroke-dashoffset:95;}"]),x=(e,t)=>{const a=t?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)";return"ai"===e?{outerBarBackground:a,innerBarBackground:t?"linear-gradient(90deg, var(--mode-color-ai-alt-stop-1, #00D639) 0%, var(--mode-color-ai-alt-stop-2, #00D6DE) 40%, var(--mode-color-ai-alt-stop-3, #9D60FF) 90%)":"linear-gradient(90deg, var(--mode-color-ai-stop-1, #13A038) 0%, var(--mode-color-ai-stop-2, #149197) 40%, var(--mode-color-ai-stop-3, #A87CFB) 90%)"}:{outerBarBackground:a,innerBarBackground:t?"#FFFFFF":"#000000"}},y=e.css(["display:flex;justify-content:center;text-align:center;"]),h=s.default.div.withConfig({displayName:"loader.style__StyledLoaderPlaceholder",componentId:"sc-c561a0b8-0"})(["display:inline-block;min-width:var(--sizing800);"]),b=s.default.div.attrs(a.default).withConfig({displayName:"loader.style__StyledLoader",componentId:"sc-c561a0b8-1"})([""," text-align:center;white-space:nowrap;"],t.margin),v=s.default.div.withConfig({displayName:"loader.style__OuterBar",componentId:"sc-c561a0b8-2"})(["",""],(({size:t,variant:a,inverse:r})=>e.css(["border-radius:var(--borderRadius400);height:",";width:100%;background:",";overflow:hidden;position:relative;"],c[t],x(a,r).outerBarBackground))),k=s.default.div.withConfig({displayName:"loader.style__InnerBar",componentId:"sc-c561a0b8-3"})(["",""],(({size:t,variant:a,inverse:r,animationTime:i,hasMotion:o})=>e.css(["position:absolute;background:",";width:15px;height:",";border-radius:var(--borderRadius400);animation-name:",",",";"," animation-iteration-count:",";"],x(a,r).innerBarBackground,c[t],m,u,o&&`animation-duration: ${i}s, ${i}s;`,o?"infinite, infinite":"none, none"))),w=s.default.svg.withConfig({displayName:"loader.style__StyledRingCircleSvg",componentId:"sc-c561a0b8-4"})(["",""],(({inverse:t,size:a,hasMotion:r,isTracked:n,isError:s,isSuccess:c,isGradientVariant:p,animationTime:m})=>{const u=`${l[a]}px`,x=d[a];return e.css(["height:",";min-height:",';circle[data-role="outer-arc"]{fill:transparent;stroke-width:',"px;stroke:",';cx:12px;cy:12px;r:10px;}circle[data-role="inner-arc"]{fill:transparent;stroke-width:',"px;stroke:",";stroke-linecap:round;stroke-dasharray:100px;stroke-dashoffset:95px;transform-origin:12px 12px 0px;cx:12px;cy:12px;r:10px;transform:rotate(-90deg);animation-name:",";"," animation-timing-function:cubic-bezier(0,0,1,1);animation-iteration-count:",";}"," ",""],u,u,x,t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)",x,p?"none":(({inverse:e,isSuccess:t,isError:a})=>a?"#DB004E;":t?"#00811F;":e?"#FFF;":"#000000")({inverse:t,isSuccess:c,isError:s}),n?f:g,r&&`animation-duration: ${m}s;`,r?"infinite":"none",p&&e.css(['circle[data-role="gradient-mask-arc"]{fill:none;stroke:white;stroke-width:',"px;stroke-linecap:round;stroke-dasharray:100px;stroke-dashoffset:95px;transform-origin:12px 12px 0px;cx:12px;cy:12px;r:10px;transform:rotate(-90deg);animation-name:",";"," animation-timing-function:cubic-bezier(0,0,1,1);animation-iteration-count:",";}"],x,g,r&&`animation-duration: ${m}s;`,r?"infinite":"none"),!p&&e.css(["",' & circle[data-role="inner-arc"],',' & circle[data-role="inner-arc"]{stroke:currentColor;}'],o.StyledButton,i.default))})),S=s.default.div.withConfig({displayName:"loader.style__StyledGradientFill",componentId:"sc-c561a0b8-5"})(["width:100%;height:100%;background:radial-gradient( 1514.52% 80.26% at 56.89% 94.74%,var(--mode-color-ai-alt-stop-1) 0%,var(--mode-color-ai-alt-stop-2) 51.22%,var(--mode-color-ai-stop-3) 100% );"]),_="40px",B=s.default.div.withConfig({displayName:"loader.style__StyledStars",componentId:"sc-c561a0b8-6"})(["position:relative;width:",";height:",";"],_,_),C={standalone:{small:"4px",medium:"8px",large:"12px"},ring:{"extra-small":"4px",small:"8px",medium:"8px",large:"12px"}},F=s.default.div.withConfig({displayName:"loader.style__StyledStarLoaderWrapper",componentId:"sc-c561a0b8-7"})(["position:relative;display:flex;align-items:center;justify-content:center;"]),L=s.default(r.Typography).withConfig({displayName:"loader.style__StyledLoaderLabel",componentId:"sc-c561a0b8-8"})([""," line-height:150%;color:",";"," &,"," &{color:currentColor;}",""],y,(({inverse:e})=>e?"rgba(255, 255, 255, 0.55)":"rgba(0, 0, 0, 0.65)"),o.StyledButton,i.default,(({$size:t="medium",loaderType:a,loaderVariant:r})=>{const i=t;return"star"===a?e.css(["font-size:16px;font-weight:400;margin-left:12px;width:min-content;"]):"standalone"===a?e.css(["font-size:",";font-weight:500;width:100%;margin-top:",";"],"large"===i?"16px":"14px",C[a][i]):e.css(["font-size:",";font-weight:500;width:",";",";"],"large"===i?"16px":"extra-small"===i?"13px":"14px","inline"===r?"auto":"100%","inline"===r?`margin-left: ${p[i]}`:`margin-top: ${C[a][i]}`)})),I=s.default.div.withConfig({displayName:"loader.style__StyledRingLoaderWrapper",componentId:"sc-c561a0b8-9"})(["",""],(({loaderVariant:t})=>e.css(["display:flex;flex-direction:",";align-items:center;justify-content:center;width:",";"],"inline"===t?"row":"column","inline"===t?"auto":"100%"))),z=s.default.span.withConfig({displayName:"loader.style__StyledLabel",componentId:"sc-c561a0b8-10"})(["",";"],(({inverse:t})=>e.css(["color:",";"," &,"," &{color:currentColor;}"],t?"rgba(255, 255, 255, 0.90)":"rgba(0, 0, 0, 0.90)",o.StyledButton,i.default)));exports.InnerBar=k,exports.OuterBar=v,exports.StyledGradientFill=S,exports.StyledLabel=z,exports.StyledLoader=b,exports.StyledLoaderLabel=L,exports.StyledLoaderPlaceholder=h,exports.StyledRingCircleSvg=w,exports.StyledRingLoaderWrapper=I,exports.StyledStarLoaderWrapper=F,exports.StyledStars=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@lexical/react/LexicalComposerContext"),a=require("lexical"),o=require("./character-counter.style.js"),n=require("../../../../../hooks/__internal__/useDebounce/useDebounce.js"),c=require("../../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({isFocused:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@lexical/react/LexicalComposerContext"),a=require("lexical"),o=require("./character-counter.style.js"),n=require("../../../../../hooks/__internal__/useDebounce/useDebounce.js"),c=require("../../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({isFocused:i,maxChars:s,namespace:u,marginTop:l})=>{const[d,h]=r.useState(""),[x]=t.useLexicalComposerContext();r.useEffect((()=>{x.registerUpdateListener((({editorState:e})=>{e.read((()=>{const e=a.$getRoot().getChildren().map((e=>e.getTextContent())).join("\n\n");h(e)}))}))}),[x]);const m=c.default(),C=r.useCallback((e=>new Intl.NumberFormat(m.locale()).format(e)),[m]),[p,f]=r.useState(s),_=r.useMemo((()=>{const e=s-(d?d.length:0);return e>=0?e:0}),[d,s]),g=n.default((e=>{f(e||0)}),2e3);return r.useEffect((()=>{g(_)}),[_,g]),e.jsxs(e.Fragment,{children:[e.jsx(o.StyledCharacterCounter,{"data-role":`${u}-character-limit`,marginTop:null!=l?l:"var(--spacing050)","aria-hidden":"true",children:m.textEditor.characterCounter(C(_))}),e.jsx(o.VisuallyHiddenCharacterCounter,{"data-role":`${u}-hidden-live-character-counter`,id:`${u}-hidden-live-character-counter`,"aria-live":i?"polite":"off",children:m.textEditor.characterCounter(C(p))})]})};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "158.46.
|
|
3
|
+
"version": "158.46.4",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -109,7 +109,6 @@
|
|
|
109
109
|
"@testing-library/jest-dom": "^6.6.3",
|
|
110
110
|
"@testing-library/react": "^16.3.0",
|
|
111
111
|
"@testing-library/user-event": "^14.5.2",
|
|
112
|
-
"@types/crypto-js": "^4.2.1",
|
|
113
112
|
"@types/glob": "^8.1.0",
|
|
114
113
|
"@types/invariant": "^2.2.37",
|
|
115
114
|
"@types/jest": "^29.5.0",
|
|
@@ -188,7 +187,7 @@
|
|
|
188
187
|
"ts-morph": "^27.0.2",
|
|
189
188
|
"typescript": "^5.8.3",
|
|
190
189
|
"url-loader": "^4.1.1",
|
|
191
|
-
"uuid": "^
|
|
190
|
+
"uuid": "^14.0.0",
|
|
192
191
|
"vite": "^6.3.4",
|
|
193
192
|
"vite-plugin-static-copy": "^3.1.2"
|
|
194
193
|
},
|
|
@@ -205,7 +204,6 @@
|
|
|
205
204
|
"@tanstack/react-virtual": "^3.13.12",
|
|
206
205
|
"@types/styled-system": "^5.1.22",
|
|
207
206
|
"chalk": "^4.1.2",
|
|
208
|
-
"crypto-js": "^4.2.0",
|
|
209
207
|
"date-fns": "^4.1.0",
|
|
210
208
|
"invariant": "^2.2.4",
|
|
211
209
|
"lexical": "0.38.2",
|
|
@@ -221,7 +219,8 @@
|
|
|
221
219
|
},
|
|
222
220
|
"overrides": {
|
|
223
221
|
"playwright-core": "$@playwright/experimental-ct-react",
|
|
224
|
-
"jsdom": "$jsdom"
|
|
222
|
+
"jsdom": "$jsdom",
|
|
223
|
+
"uuid": "^14.0.0"
|
|
225
224
|
},
|
|
226
225
|
"lint-staged": {
|
|
227
226
|
"./**/*.{js,jsx,ts,tsx}": [
|