carbon-react 158.13.2 → 158.14.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.
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import"react";import{Link as o}from"../../../link/link.component.js";import{ButtonMinor as n}from"../../../button-minor/button-minor.component.js";import i from"../../../typography/typography.style.js";import{StyledProgressBar as c,InnerBar as l}from"../../../progress-tracker/progress-tracker.style.js";import{LoaderBar as a}from"../../../loader-bar/loader-bar.component.js";import s from"../../../icon/icon.component.js";import{StyledFileUploadStatus as p,StyledFileUploadStatusRow as u,StyledFileLinkContainer as f}from"./file-upload-status.style.js";import m from"../../../../hooks/__internal__/useLocale/useLocale.js";function b(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function y(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){b(e,r,t[r])}))}return e}function d(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}const g=b=>{var{status:g,filename:O,message:j,onAction:h,iconType:P="file_generic"}=b,v=function(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(b,["status","filename","message","onAction","iconType"]);const w=m(),k=j||w.fileInput.fileUploadStatus();let S,I,_=null;switch(g){case"uploading":S=w.fileInput.actions.cancel(),_=void 0===v.progress?e(a,{}):e(c,{"data-element":"progress-tracker-bar","data-role":"progress-tracker-bar",progress:v.progress,"aria-hidden":"true",children:e(l,{"data-element":"inner-bar","data-role":"inner-bar",size:"medium",progress:v.progress,error:!1})});break;case"previously":case"completed":S=w.fileInput.actions.delete(),I=d(y({},v),{icon:P});break;case"error":S=w.fileInput.actions.clear()}const x=e(n,{onClick:h,buttonType:"tertiary",children:S}),D=I?e(o,d(y({},I),{children:O})):r(t,{children:[e(s,{type:P}),e("span",{children:O})]});return r(p,{"data-role":"file-upload-status",hasError:"error"===g,children:[r(u,"previously"!==g?{children:[e(i,{as:"p",mb:0,"aria-live":"polite",children:k}),x]}:{onlyRow:!0,children:[e(f,{children:D}),x]}),"previously"!==g?e(u,{upperPadding:!0,lowerPadding:!0,children:e(f,{children:D})}):null,_]})};export{g as FileUploadStatus,g as default};
1
+ import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import"react";import{Link as o}from"../../../link/link.component.js";import{ButtonMinor as n}from"../../../button-minor/button-minor.component.js";import i from"../../../typography/typography.style.js";import{StyledProgressBar as l,InnerBar as c}from"../../../progress-tracker/progress-tracker.style.js";import{LoaderBar as a}from"../../../loader-bar/loader-bar.component.js";import s from"../../../icon/icon.component.js";import{StyledFileUploadStatus as p,StyledFileUploadStatusRow as u,StyledFileLinkContainer as f}from"./file-upload-status.style.js";import m from"../../../../hooks/__internal__/useLocale/useLocale.js";function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){d(e,r,t[r])}))}return e}function y(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}const g=d=>{var{status:g,filename:O,message:j,onAction:h,iconType:w="file_generic"}=d,P=function(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(d,["status","filename","message","onAction","iconType"]);const v=m(),k=j||v.fileInput.fileUploadStatus();let S,I,_=null;switch(g){case"uploading":S=v.fileInput.actions.cancel(),_=void 0===P.progress?e(a,{}):e(l,{"data-element":"progress-tracker-bar","data-role":"progress-tracker-bar",progress:P.progress,"aria-hidden":"true",children:e(c,{"data-element":"inner-bar","data-role":"inner-bar",size:"medium",progress:P.progress,error:!1})});break;case"previously":case"completed":S=v.fileInput.actions.delete(),I=y(b({},P),{icon:w});break;case"error":S=v.fileInput.actions.clear()}const x=e(n,{onClick:h,buttonType:"tertiary",children:S}),D=I?e(o,y(b({download:Boolean("completed"===g)},I),{children:O})):r(t,{children:[e(s,{type:w}),e("span",{children:O})]});return r(p,{"data-role":"file-upload-status",hasError:"error"===g,children:[r(u,"previously"!==g?{children:[e(i,{as:"p",mb:0,"aria-live":"polite",children:k}),x]}:{onlyRow:!0,children:[e(f,{children:D}),x]}),"previously"!==g?e(u,{upperPadding:!0,lowerPadding:!0,children:e(f,{children:D})}):null,_]})};export{g as FileUploadStatus,g as default};
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { IconType } from "../icon";
3
3
  import { StyledLinkProps } from "./link.style";
4
4
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
5
- export interface LinkProps extends StyledLinkProps, React.AriaAttributes, TagProps {
5
+ export interface LinkProps extends StyledLinkProps, React.AriaAttributes, Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download">, TagProps {
6
6
  /** An href for an anchor tag. */
7
7
  href?: string;
8
8
  /** An icon to display next to the link. */
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useContext as i,useRef as l,useCallback as a,useMemo as s,useEffect as c}from"react";import p from"../icon/icon.component.js";import u from"../menu/__internal__/menu.context.js";import{StyledLink as d,StyledContent as b}from"./link.style.js";import f from"../../__internal__/utils/helpers/tags/tags.js";import m from"../../hooks/__internal__/useLocale/useLocale.js";import y from"../batch-selection/__internal__/batch-selection.context.js";import k from"../../__internal__/utils/logger/index.js";function v(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){v(e,n,t[n])}))}return e}function g(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n.push.apply(n,t)}return n}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e}let h=!1,j=!1,w=!1,_=!1;const P={default:!1,neutral:!1},L={default:"typical",neutral:"subtle"},D=r.forwardRef(((v,D)=>{var{children:S,onKeyDown:M,href:x,onClick:A,onMouseDown:B,icon:T,iconAlign:C="left",isSkipLink:E,disabled:I=!1,underline:N="always",ariaLabel:z,rel:K,tooltipMessage:F,tooltipPosition:$,target:R,variant:W="typical",isDarkBackground:q,inverse:G,removeAriaLabelOnIcon:H,className:J,linkSize:Q="medium"}=v,U=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(v,["children","onKeyDown","href","onClick","onMouseDown","icon","iconAlign","isSkipLink","disabled","underline","ariaLabel","rel","tooltipMessage","tooltipPosition","target","variant","isDarkBackground","inverse","removeAriaLabelOnIcon","className","linkSize"]);const[V,X]=o(!1),Y=m(),{inMenu:Z}=i(u),{batchSelectionDisabled:ee}=i(y),ne=I||ee,te=l(null);!h&&I&&(h=!0,k.deprecate("The 'disabled' prop in Link is deprecated and will soon be removed.")),!w&&F&&(w=!0,k.deprecate("The 'tooltipMessage' prop in Link is deprecated and will soon be removed.")),!j&&$&&(j=!0,k.deprecate("The 'tooltipPosition' prop in Link is deprecated and will soon be removed.")),!_&&q&&(_=!0,k.deprecate("The 'isDarkBackground' prop in Link is deprecated and will soon be removed. Please use 'inverse' prop instead.")),!P[W]&&L[W]&&(P[W]=!0,k.deprecate(`The value '${W}' for the variant prop is deprecated and will soon be removed. Please use value '${L[W]}' instead.`));const re=null!=G?G:q;var oe;const ie=null!==(oe=L[W])&&void 0!==oe?oe:W,le=a((e=>{te.current=e,D&&("function"!=typeof D?"object"!=typeof D||(D.current=e):D(e))}),[D]),ae=a((e=>{var n,t;null===(t=te.current)||void 0===t||null===(n=t.focus)||void 0===n||n.call(t,{preventScroll:!0}),null==A||A(e)}),[A]),se=(n="left")=>T&&C===n?e(p,{type:T,disabled:ne,ariaLabel:H?void 0:z,tooltipMessage:F,tooltipPosition:$}):null,ce=s((()=>{const e=U;return Object.keys(e).filter((e=>e.startsWith("aria"))).reduce(((n,t)=>(n[t]=e[t],n)),{})}),[U]),pe=g(O({onKeyDown:M,onMouseDown:B,onClick:ae,disabled:ne,target:R,ref:le,href:x,rel:K,"aria-label":z},ce),{onFocus:()=>X(!0),onBlur:()=>X(!1)}),ue={type:"button"};return c((()=>{(I||!x&&!A)&&X(!1)}),[I,x,A]),e(d,g(O({isSkipLink:E,disabled:ne,underline:N,iconAlign:C,className:J,hasContent:Boolean(S),variant:ie,inverse:re,isMenuItem:Z},f("link",U),E&&{"data-element":"skip-link"}),{hasFocus:V,linkSize:Q,children:(()=>{let o="a";return A&&!x&&(o="button"),r.createElement(o,"button"===o?O({},pe,ue):g(O({},pe),{"data-role":"link-anchor"}),n(t,{children:[se(),e(b,{children:E?Y.link.skipLinkLabel():S}),se("right")]}))})()}))}));D.displayName="Link";export{D as Link,D as default};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useContext as i,useRef as l,useCallback as a,useMemo as s,useEffect as c}from"react";import p from"../icon/icon.component.js";import u from"../menu/__internal__/menu.context.js";import{StyledLink as d,StyledContent as b}from"./link.style.js";import f from"../../__internal__/utils/helpers/tags/tags.js";import m from"../../hooks/__internal__/useLocale/useLocale.js";import y from"../batch-selection/__internal__/batch-selection.context.js";import k from"../../__internal__/utils/logger/index.js";function v(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){v(e,n,t[n])}))}return e}function g(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n.push.apply(n,t)}return n}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e}let h=!1,j=!1,w=!1,_=!1;const P={default:!1,neutral:!1},L={default:"typical",neutral:"subtle"},D=r.forwardRef(((v,D)=>{var{children:S,onKeyDown:M,href:x,onClick:A,onMouseDown:B,icon:T,iconAlign:C="left",isSkipLink:E,disabled:I=!1,underline:N="always",ariaLabel:z,rel:K,tooltipMessage:F,tooltipPosition:$,target:R,variant:W="typical",isDarkBackground:q,inverse:G,removeAriaLabelOnIcon:H,className:J,linkSize:Q="medium",download:U}=v,V=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(v,["children","onKeyDown","href","onClick","onMouseDown","icon","iconAlign","isSkipLink","disabled","underline","ariaLabel","rel","tooltipMessage","tooltipPosition","target","variant","isDarkBackground","inverse","removeAriaLabelOnIcon","className","linkSize","download"]);const[X,Y]=o(!1),Z=m(),{inMenu:ee}=i(u),{batchSelectionDisabled:ne}=i(y),te=I||ne,re=l(null);!h&&I&&(h=!0,k.deprecate("The 'disabled' prop in Link is deprecated and will soon be removed.")),!w&&F&&(w=!0,k.deprecate("The 'tooltipMessage' prop in Link is deprecated and will soon be removed.")),!j&&$&&(j=!0,k.deprecate("The 'tooltipPosition' prop in Link is deprecated and will soon be removed.")),!_&&q&&(_=!0,k.deprecate("The 'isDarkBackground' prop in Link is deprecated and will soon be removed. Please use 'inverse' prop instead.")),!P[W]&&L[W]&&(P[W]=!0,k.deprecate(`The value '${W}' for the variant prop is deprecated and will soon be removed. Please use value '${L[W]}' instead.`));const oe=null!=G?G:q;var ie;const le=null!==(ie=L[W])&&void 0!==ie?ie:W,ae=a((e=>{re.current=e,D&&("function"!=typeof D?"object"!=typeof D||(D.current=e):D(e))}),[D]),se=a((e=>{var n,t;null===(t=re.current)||void 0===t||null===(n=t.focus)||void 0===n||n.call(t,{preventScroll:!0}),null==A||A(e)}),[A]),ce=(n="left")=>T&&C===n?e(p,{type:T,disabled:te,ariaLabel:H?void 0:z,tooltipMessage:F,tooltipPosition:$}):null,pe=s((()=>{const e=V;return Object.keys(e).filter((e=>e.startsWith("aria"))).reduce(((n,t)=>(n[t]=e[t],n)),{})}),[V]),ue=g(O({onKeyDown:M,onMouseDown:B,onClick:se,disabled:te,target:R,ref:ae,href:x,rel:K,"aria-label":z},pe),{onFocus:()=>Y(!0),onBlur:()=>Y(!1)}),de={type:"button"};return c((()=>{(I||!x&&!A)&&Y(!1)}),[I,x,A]),e(d,g(O({isSkipLink:E,disabled:te,underline:N,iconAlign:C,className:J,hasContent:Boolean(S),variant:le,inverse:oe,isMenuItem:ee},f("link",V),E&&{"data-element":"skip-link"}),{hasFocus:X,linkSize:Q,children:(()=>{let o="a";return A&&!x&&(o="button"),r.createElement(o,"button"===o?O({},ue,de):g(O({},ue),{download:U,"data-role":"link-anchor"}),n(t,{children:[ce(),e(b,{children:E?Z.link.skipLinkLabel():S}),ce("right")]}))})()}))}));D.displayName="Link";export{D as Link,D as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("../../../link/link.component.js"),t=require("../../../button-minor/button-minor.component.js"),n=require("../../../typography/typography.style.js"),o=require("../../../progress-tracker/progress-tracker.style.js"),s=require("../../../loader-bar/loader-bar.component.js"),i=require("../../../icon/icon.component.js"),l=require("./file-upload-status.style.js"),a=require("../../../../hooks/__internal__/useLocale/useLocale.js");function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(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){c(e,r,t[r])}))}return e}function p(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}const d=c=>{var{status:d,filename:y,message:j,onAction:b,iconType:f="file_generic"}=c,g=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)t=s[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)t=s[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(c,["status","filename","message","onAction","iconType"]);const O=a.default(),m=j||O.fileInput.fileUploadStatus();let h,x,S=null;switch(d){case"uploading":h=O.fileInput.actions.cancel(),S=void 0===g.progress?e.jsx(s.LoaderBar,{}):e.jsx(o.StyledProgressBar,{"data-element":"progress-tracker-bar","data-role":"progress-tracker-bar",progress:g.progress,"aria-hidden":"true",children:e.jsx(o.InnerBar,{"data-element":"inner-bar","data-role":"inner-bar",size:"medium",progress:g.progress,error:!1})});break;case"previously":case"completed":h=O.fileInput.actions.delete(),x=p(u({},g),{icon:f});break;case"error":h=O.fileInput.actions.clear()}const v=e.jsx(t.ButtonMinor,{onClick:b,buttonType:"tertiary",children:h}),w=x?e.jsx(r.Link,p(u({},x),{children:y})):e.jsxs(e.Fragment,{children:[e.jsx(i.default,{type:f}),e.jsx("span",{children:y})]}),P="previously"!==d?e.jsxs(l.StyledFileUploadStatusRow,{children:[e.jsx(n.default,{as:"p",mb:0,"aria-live":"polite",children:m}),v]}):e.jsxs(l.StyledFileUploadStatusRow,{onlyRow:!0,children:[e.jsx(l.StyledFileLinkContainer,{children:w}),v]}),k="previously"!==d?e.jsx(l.StyledFileUploadStatusRow,{upperPadding:!0,lowerPadding:!0,children:e.jsx(l.StyledFileLinkContainer,{children:w})}):null;return e.jsxs(l.StyledFileUploadStatus,{"data-role":"file-upload-status",hasError:"error"===d,children:[P,k,S]})};exports.FileUploadStatus=d,exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("../../../link/link.component.js"),t=require("../../../button-minor/button-minor.component.js"),n=require("../../../typography/typography.style.js"),o=require("../../../progress-tracker/progress-tracker.style.js"),s=require("../../../loader-bar/loader-bar.component.js"),l=require("../../../icon/icon.component.js"),i=require("./file-upload-status.style.js"),a=require("../../../../hooks/__internal__/useLocale/useLocale.js");function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(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){c(e,r,t[r])}))}return e}function p(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}const d=c=>{var{status:d,filename:y,message:j,onAction:b,iconType:f="file_generic"}=c,g=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)t=s[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)t=s[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(c,["status","filename","message","onAction","iconType"]);const O=a.default(),m=j||O.fileInput.fileUploadStatus();let h,x,S=null;switch(d){case"uploading":h=O.fileInput.actions.cancel(),S=void 0===g.progress?e.jsx(s.LoaderBar,{}):e.jsx(o.StyledProgressBar,{"data-element":"progress-tracker-bar","data-role":"progress-tracker-bar",progress:g.progress,"aria-hidden":"true",children:e.jsx(o.InnerBar,{"data-element":"inner-bar","data-role":"inner-bar",size:"medium",progress:g.progress,error:!1})});break;case"previously":case"completed":h=O.fileInput.actions.delete(),x=p(u({},g),{icon:f});break;case"error":h=O.fileInput.actions.clear()}const w=e.jsx(t.ButtonMinor,{onClick:b,buttonType:"tertiary",children:h}),v=x?e.jsx(r.Link,p(u({download:Boolean("completed"===d)},x),{children:y})):e.jsxs(e.Fragment,{children:[e.jsx(l.default,{type:f}),e.jsx("span",{children:y})]}),P="previously"!==d?e.jsxs(i.StyledFileUploadStatusRow,{children:[e.jsx(n.default,{as:"p",mb:0,"aria-live":"polite",children:m}),w]}):e.jsxs(i.StyledFileUploadStatusRow,{onlyRow:!0,children:[e.jsx(i.StyledFileLinkContainer,{children:v}),w]}),k="previously"!==d?e.jsx(i.StyledFileUploadStatusRow,{upperPadding:!0,lowerPadding:!0,children:e.jsx(i.StyledFileLinkContainer,{children:v})}):null;return e.jsxs(i.StyledFileUploadStatus,{"data-role":"file-upload-status",hasError:"error"===d,children:[P,k,S]})};exports.FileUploadStatus=d,exports.default=d;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { IconType } from "../icon";
3
3
  import { StyledLinkProps } from "./link.style";
4
4
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
5
- export interface LinkProps extends StyledLinkProps, React.AriaAttributes, TagProps {
5
+ export interface LinkProps extends StyledLinkProps, React.AriaAttributes, Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download">, TagProps {
6
6
  /** An href for an anchor tag. */
7
7
  href?: string;
8
8
  /** An icon to display next to the link. */
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../icon/icon.component.js"),r=require("../menu/__internal__/menu.context.js"),i=require("./link.style.js"),o=require("../../__internal__/utils/helpers/tags/tags.js"),l=require("../../hooks/__internal__/useLocale/useLocale.js"),a=require("../batch-selection/__internal__/batch-selection.context.js"),s=require("../../__internal__/utils/logger/index.js");function u(e){return e&&e.__esModule?e:{default:e}}var c=u(t);function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(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){d(e,t,n[t])}))}return e}function f(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 n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}let b=!1,y=!1,k=!1,v=!1;const O={default:!1,neutral:!1},g={default:"typical",neutral:"subtle"},j=c.default.forwardRef(((u,d)=>{var{children:j,onKeyDown:m,href:h,onClick:w,onMouseDown:_,icon:P,iconAlign:L="left",isSkipLink:S,disabled:x=!1,underline:D="always",ariaLabel:M,rel:q,tooltipMessage:C,tooltipPosition:A,target:B,variant:E="typical",isDarkBackground:T,inverse:I,removeAriaLabelOnIcon:N,className:z,linkSize:F="medium"}=u,K=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(u,["children","onKeyDown","href","onClick","onMouseDown","icon","iconAlign","isSkipLink","disabled","underline","ariaLabel","rel","tooltipMessage","tooltipPosition","target","variant","isDarkBackground","inverse","removeAriaLabelOnIcon","className","linkSize"]);const[R,$]=t.useState(!1),W=l.default(),{inMenu:G}=t.useContext(r.default),{batchSelectionDisabled:H}=t.useContext(a.default),J=x||H,Q=t.useRef(null);!b&&x&&(b=!0,s.default.deprecate("The 'disabled' prop in Link is deprecated and will soon be removed.")),!k&&C&&(k=!0,s.default.deprecate("The 'tooltipMessage' prop in Link is deprecated and will soon be removed.")),!y&&A&&(y=!0,s.default.deprecate("The 'tooltipPosition' prop in Link is deprecated and will soon be removed.")),!v&&T&&(v=!0,s.default.deprecate("The 'isDarkBackground' prop in Link is deprecated and will soon be removed. Please use 'inverse' prop instead.")),!O[E]&&g[E]&&(O[E]=!0,s.default.deprecate(`The value '${E}' for the variant prop is deprecated and will soon be removed. Please use value '${g[E]}' instead.`));const U=null!=I?I:T;var V;const X=null!==(V=g[E])&&void 0!==V?V:E,Y=t.useCallback((e=>{Q.current=e,d&&("function"!=typeof d?"object"!=typeof d||(d.current=e):d(e))}),[d]),Z=t.useCallback((e=>{var t,n;null===(n=Q.current)||void 0===n||null===(t=n.focus)||void 0===t||t.call(n,{preventScroll:!0}),null==w||w(e)}),[w]),ee=(t="left")=>P&&L===t?e.jsx(n.default,{type:P,disabled:J,ariaLabel:N?void 0:M,tooltipMessage:C,tooltipPosition:A}):null,te=t.useMemo((()=>{const e=K;return Object.keys(e).filter((e=>e.startsWith("aria"))).reduce(((t,n)=>(t[n]=e[n],t)),{})}),[K]),ne=f(p({onKeyDown:m,onMouseDown:_,onClick:Z,disabled:J,target:B,ref:Y,href:h,rel:q,"aria-label":M},te),{onFocus:()=>$(!0),onBlur:()=>$(!1)}),re={type:"button"};return t.useEffect((()=>{(x||!h&&!w)&&$(!1)}),[x,h,w]),e.jsx(i.StyledLink,f(p({isSkipLink:S,disabled:J,underline:D,iconAlign:L,className:z,hasContent:Boolean(j),variant:X,inverse:U,isMenuItem:G},o.default("link",K),S&&{"data-element":"skip-link"}),{hasFocus:R,linkSize:F,children:(()=>{let t="a";return w&&!h&&(t="button"),c.default.createElement(t,"button"===t?p({},ne,re):f(p({},ne),{"data-role":"link-anchor"}),e.jsxs(e.Fragment,{children:[ee(),e.jsx(i.StyledContent,{children:S?W.link.skipLinkLabel():j}),ee("right")]}))})()}))}));j.displayName="Link",exports.Link=j,exports.default=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../icon/icon.component.js"),r=require("../menu/__internal__/menu.context.js"),o=require("./link.style.js"),i=require("../../__internal__/utils/helpers/tags/tags.js"),l=require("../../hooks/__internal__/useLocale/useLocale.js"),a=require("../batch-selection/__internal__/batch-selection.context.js"),s=require("../../__internal__/utils/logger/index.js");function u(e){return e&&e.__esModule?e:{default:e}}var c=u(t);function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(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){d(e,t,n[t])}))}return e}function f(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 n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}let b=!1,y=!1,k=!1,v=!1;const O={default:!1,neutral:!1},g={default:"typical",neutral:"subtle"},j=c.default.forwardRef(((u,d)=>{var{children:j,onKeyDown:m,href:h,onClick:w,onMouseDown:_,icon:P,iconAlign:L="left",isSkipLink:S,disabled:x=!1,underline:D="always",ariaLabel:M,rel:q,tooltipMessage:C,tooltipPosition:A,target:B,variant:E="typical",isDarkBackground:T,inverse:I,removeAriaLabelOnIcon:N,className:z,linkSize:F="medium",download:K}=u,R=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(u,["children","onKeyDown","href","onClick","onMouseDown","icon","iconAlign","isSkipLink","disabled","underline","ariaLabel","rel","tooltipMessage","tooltipPosition","target","variant","isDarkBackground","inverse","removeAriaLabelOnIcon","className","linkSize","download"]);const[$,W]=t.useState(!1),G=l.default(),{inMenu:H}=t.useContext(r.default),{batchSelectionDisabled:J}=t.useContext(a.default),Q=x||J,U=t.useRef(null);!b&&x&&(b=!0,s.default.deprecate("The 'disabled' prop in Link is deprecated and will soon be removed.")),!k&&C&&(k=!0,s.default.deprecate("The 'tooltipMessage' prop in Link is deprecated and will soon be removed.")),!y&&A&&(y=!0,s.default.deprecate("The 'tooltipPosition' prop in Link is deprecated and will soon be removed.")),!v&&T&&(v=!0,s.default.deprecate("The 'isDarkBackground' prop in Link is deprecated and will soon be removed. Please use 'inverse' prop instead.")),!O[E]&&g[E]&&(O[E]=!0,s.default.deprecate(`The value '${E}' for the variant prop is deprecated and will soon be removed. Please use value '${g[E]}' instead.`));const V=null!=I?I:T;var X;const Y=null!==(X=g[E])&&void 0!==X?X:E,Z=t.useCallback((e=>{U.current=e,d&&("function"!=typeof d?"object"!=typeof d||(d.current=e):d(e))}),[d]),ee=t.useCallback((e=>{var t,n;null===(n=U.current)||void 0===n||null===(t=n.focus)||void 0===t||t.call(n,{preventScroll:!0}),null==w||w(e)}),[w]),te=(t="left")=>P&&L===t?e.jsx(n.default,{type:P,disabled:Q,ariaLabel:N?void 0:M,tooltipMessage:C,tooltipPosition:A}):null,ne=t.useMemo((()=>{const e=R;return Object.keys(e).filter((e=>e.startsWith("aria"))).reduce(((t,n)=>(t[n]=e[n],t)),{})}),[R]),re=f(p({onKeyDown:m,onMouseDown:_,onClick:ee,disabled:Q,target:B,ref:Z,href:h,rel:q,"aria-label":M},ne),{onFocus:()=>W(!0),onBlur:()=>W(!1)}),oe={type:"button"};return t.useEffect((()=>{(x||!h&&!w)&&W(!1)}),[x,h,w]),e.jsx(o.StyledLink,f(p({isSkipLink:S,disabled:Q,underline:D,iconAlign:L,className:z,hasContent:Boolean(j),variant:Y,inverse:V,isMenuItem:H},i.default("link",R),S&&{"data-element":"skip-link"}),{hasFocus:$,linkSize:F,children:(()=>{let t="a";return w&&!h&&(t="button"),c.default.createElement(t,"button"===t?p({},re,oe):f(p({},re),{download:K,"data-role":"link-anchor"}),e.jsxs(e.Fragment,{children:[te(),e.jsx(o.StyledContent,{children:S?G.link.skipLinkLabel():j}),te("right")]}))})()}))}));j.displayName="Link",exports.Link=j,exports.default=j;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "158.13.2",
3
+ "version": "158.14.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",