carbon-react 159.3.1 → 159.4.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/components/dialog/dialog.component.js +1 -1
- package/esm/components/portrait/__internal__/get-properties.d.ts +22 -0
- package/esm/components/portrait/__internal__/get-properties.js +1 -0
- package/esm/components/portrait/portrait.component.d.ts +37 -12
- package/esm/components/portrait/portrait.component.js +1 -1
- package/esm/components/portrait/portrait.config.d.ts +0 -6
- package/esm/components/portrait/portrait.config.js +1 -1
- package/esm/components/portrait/portrait.style.d.ts +4 -3
- package/esm/components/portrait/portrait.style.js +1 -1
- package/esm/components/profile/profile.style.d.ts +1 -1
- package/lib/components/dialog/dialog.component.js +1 -1
- package/lib/components/portrait/__internal__/get-properties.d.ts +22 -0
- package/lib/components/portrait/__internal__/get-properties.js +1 -0
- package/lib/components/portrait/portrait.component.d.ts +37 -12
- package/lib/components/portrait/portrait.component.js +1 -1
- package/lib/components/portrait/portrait.config.d.ts +0 -6
- package/lib/components/portrait/portrait.config.js +1 -1
- package/lib/components/portrait/portrait.style.d.ts +4 -3
- package/lib/components/portrait/portrait.style.js +1 -1
- package/lib/components/profile/profile.style.d.ts +1 -1
- package/package.json +3 -3
- package/esm/components/portrait/__internal__/get-colors.d.ts +0 -8
- package/esm/components/portrait/__internal__/get-colors.js +0 -1
- package/lib/components/portrait/__internal__/get-colors.d.ts +0 -8
- package/lib/components/portrait/__internal__/get-colors.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{Dialog as t}from"./__internal__/__next__/dialog.component.js";import a 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 n=!1,l=!1,
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{Dialog as t}from"./__internal__/__next__/dialog.component.js";import a 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 n=!1,l=!1,s=!1,o=!1,d=!1;const c=r(((r,c)=>{var{disableClose:u,pagesStyling:g,fullscreen:p,highlightVariant:f,disableContentPadding:m,size:b="medium",gradientKeyLine:y}=r,h=function(e,r){if(null==e)return{};var t,a,i=function(e,r){if(null==e)return{};var t,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)t=n[a],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)t=n[a],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(r,["disableClose","pagesStyling","fullscreen","highlightVariant","disableContentPadding","size","gradientKeyLine"]);n||void 0===p||(n=!0,a.deprecate('The fullscreen prop in Dialog is deprecated. Please use size="fullscreen" instead.')),l||void 0===f||(l=!0,a.deprecate("The highlightVariant prop is deprecated. Please use gradientKeyLine instead.")),s||void 0===u||(s=!0,a.deprecate("The disableClose prop in Dialog is deprecated and will soon be removed.")),o||void 0===g||(o=!0,a.deprecate("The pagesStyling prop in Dialog is deprecated and will soon be removed.")),d||"auto"!==b||(d=!0,a.deprecate('The `size="auto"` prop in Dialog is deprecated and has been defaulted to `size="large"`. Please use a specific size value instead.'));const O=((e,r)=>{if(r)return"fullscreen";switch(e){case"extra-small":case"small":return"small";case"medium-small":case"medium":default:return"medium";case"medium-large":case"large":case"extra-large":case"auto":return"large";case"fullscreen":case"maximise":return"fullscreen"}})(b,p),v=((e,r)=>void 0!==r?r:"ai"===e)(f,y);return e(t,function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),a.forEach((function(r){i(e,r,t[r])}))}return e}({ref:c,size:O,gradientKeyLine:v,disableContentPadding:m,pagesStyling:g},h))}));c.displayName="Dialog";export{c as Dialog,c as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PortraitSizes, PortraitShapes, PortraitVariant } from "../portrait.component";
|
|
2
|
+
type GetPortraitColors = {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
color: string;
|
|
5
|
+
};
|
|
6
|
+
type GetPortraitDimensions = {
|
|
7
|
+
height: string;
|
|
8
|
+
width: string;
|
|
9
|
+
};
|
|
10
|
+
declare const getColoursForPortrait: (backgroundColour: string | undefined, darkBackground?: boolean, largeText?: boolean,
|
|
11
|
+
/**
|
|
12
|
+
* Whether to use strict contrast (i.e., WCAG AAA). If this is false, it uses WCAG AA contrast
|
|
13
|
+
* ratios (4.5:1 for normal text, 3:1 for large text). If true, it uses 7:1 for normal text and
|
|
14
|
+
* 4.5:1 for large text.
|
|
15
|
+
*/
|
|
16
|
+
strict?: boolean, foregroundColor?: string | undefined) => string;
|
|
17
|
+
export declare const getPortraitBorderRadius: (shape?: PortraitShapes, size?: PortraitSizes) => string;
|
|
18
|
+
export declare const getPortraitColors: (variant?: PortraitVariant) => GetPortraitColors;
|
|
19
|
+
export declare const getPortraitDimensions: (size: PortraitSizes) => GetPortraitDimensions;
|
|
20
|
+
export declare const getPortraitFontSize: (size: PortraitSizes) => string;
|
|
21
|
+
export declare const getPortraitIconFontSize: (size: PortraitSizes) => string;
|
|
22
|
+
export default getColoursForPortrait;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"../../../style/utils/get-accessible-foreground-color.js";const e=(e,i=!1,o=!1,a=!1,l=void 0)=>{let s="var(--colorsUtilityYin090)",t="var(--colorsUtilityReadOnly400)";return!i||e||l||(t="var(--colorsUtilityYin090)",s="var(--colorsUtilityReadOnly600)"),e&&(t=e,s=r(e,o,a)),l&&(s=l),`background-color: ${t}; color: ${s};`},i=(r,e)=>"square"===r?"XS"===e||"S"===e?"var(--global-radius-container-xs)":"M"===e||"ML"===e||"L"===e?"var(--global-radius-container-m)":"var(--global-radius-container-l)":"var(--global-radius-container-circle)",o=r=>{const e={backgroundColor:"inherit",color:"inherit"};return"black"===r?(e.backgroundColor="var(--profile-bg-def)",e.color="var(--profile-label-default)"):(e.backgroundColor=`var(--profile-swatches-${r}-bg-default)`,e.color=`var(--profile-swatches-${r}-label-default)`),e},a=r=>({height:`var(--profile-size-outside-${r.toLowerCase()})`,width:`var(--profile-size-outside-${r.toLowerCase()})`}),l=r=>`var(--profile-font-initials-${r.toLowerCase()})`,s=r=>{switch(r){case"XS":return"var(--profile-size-inside-xs)";case"S":return"var(--profile-size-inside-s)";case"ML":return"var(--profile-size-inside-ml)";case"L":return"var(--profile-size-inside-l)";case"XL":return"var(--profile-size-inside-xl)";case"XXL":return"var(--profile-size-inside-xxl)";default:return"var(--profile-size-inside-m)"}};export{e as default,i as getPortraitBorderRadius,o as getPortraitColors,a as getPortraitDimensions,l as getPortraitFontSize,s as getPortraitIconFontSize};
|
|
@@ -4,6 +4,7 @@ import { IconType } from "../icon";
|
|
|
4
4
|
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
5
5
|
export type PortraitShapes = "circle" | "square";
|
|
6
6
|
export type PortraitSizes = "XS" | "S" | "M" | "ML" | "L" | "XL" | "XXL";
|
|
7
|
+
export type PortraitVariant = "black" | "blue" | "teal" | "green" | "lime" | "orange" | "red" | "pink" | "purple" | "slate" | "gray";
|
|
7
8
|
export interface PortraitProps extends MarginProps, TagProps {
|
|
8
9
|
/** @private @ignore */
|
|
9
10
|
className?: string;
|
|
@@ -21,30 +22,54 @@ export interface PortraitProps extends MarginProps, TagProps {
|
|
|
21
22
|
iconType?: IconType;
|
|
22
23
|
/** The initials to render in the Portrait. */
|
|
23
24
|
initials?: string;
|
|
24
|
-
/** Use a dark background.
|
|
25
|
+
/** Use a dark background.
|
|
26
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
27
|
+
*/
|
|
25
28
|
darkBackground?: boolean;
|
|
26
29
|
/** Prop for `onClick` events. */
|
|
27
30
|
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
28
|
-
/** [Legacy] The message to be displayed within the tooltip
|
|
31
|
+
/** [Legacy] The message to be displayed within the tooltip
|
|
32
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
33
|
+
*/
|
|
29
34
|
tooltipMessage?: React.ReactNode;
|
|
30
|
-
/** [Legacy] The id attribute to use for the tooltip
|
|
35
|
+
/** [Legacy] The id attribute to use for the tooltip
|
|
36
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
37
|
+
*/
|
|
31
38
|
tooltipId?: string;
|
|
32
|
-
/** [Legacy] Whether to to show the Tooltip
|
|
39
|
+
/** [Legacy] Whether to to show the Tooltip
|
|
40
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
41
|
+
*/
|
|
33
42
|
tooltipIsVisible?: boolean;
|
|
34
|
-
/** [Legacy] Sets position of the tooltip
|
|
43
|
+
/** [Legacy] Sets position of the tooltip
|
|
44
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
45
|
+
*/
|
|
35
46
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
36
|
-
/** [Legacy] Defines the message type
|
|
47
|
+
/** [Legacy] Defines the message type
|
|
48
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
49
|
+
*/
|
|
37
50
|
tooltipType?: string;
|
|
38
|
-
/** [Legacy] Defines the size of the tooltip content
|
|
51
|
+
/** [Legacy] Defines the size of the tooltip content
|
|
52
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
53
|
+
*/
|
|
39
54
|
tooltipSize?: "medium" | "large";
|
|
40
|
-
/** [Legacy] Override background color of the Tooltip, provide any color from palette or any valid css color value.
|
|
55
|
+
/** [Legacy] Override background color of the Tooltip, provide any color from palette or any valid css color value.
|
|
56
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
57
|
+
*/
|
|
41
58
|
tooltipBgColor?: string;
|
|
42
|
-
/** [Legacy] Override font color of the Tooltip, provide any color from palette or any valid css color value.
|
|
59
|
+
/** [Legacy] Override font color of the Tooltip, provide any color from palette or any valid css color value.
|
|
60
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
61
|
+
*/
|
|
43
62
|
tooltipFontColor?: string;
|
|
44
|
-
/** The hex code of the background colour
|
|
63
|
+
/** The hex code of the background colour
|
|
64
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
65
|
+
*/
|
|
45
66
|
backgroundColor?: string;
|
|
46
|
-
/** The hex code of the foreground colour. This will only take effect if use in conjunction with `backgroundColor`
|
|
67
|
+
/** The hex code of the foreground colour. This will only take effect if use in conjunction with `backgroundColor`
|
|
68
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
69
|
+
*/
|
|
47
70
|
foregroundColor?: string;
|
|
71
|
+
/** Color variant*/
|
|
72
|
+
variant?: PortraitVariant;
|
|
48
73
|
}
|
|
49
|
-
export declare const Portrait: ({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, ...rest }: PortraitProps) => React.JSX.Element;
|
|
74
|
+
export declare const Portrait: ({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, variant, ...rest }: PortraitProps) => React.JSX.Element;
|
|
50
75
|
export default Portrait;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as e}from"react";import{Tooltip as r}from"../tooltip/tooltip.component.js";import i from"../../__internal__/utils/helpers/tags/tags.js";import{StyledPortraitInitials as n,StyledPortraitContainer as l,StyledIcon as s,StyledCustomImg as a}from"./portrait.style.js";import"../../style/utils/filter-styled-system-padding-props.js";import p from"../../style/utils/filter-styled-system-margin-props.js";function c(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function u(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),r.forEach((function(o){c(t,o,e[o])}))}return t}function f(t,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):function(t){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);o.push.apply(o,e)}return o}(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})),t}const d=c=>{var{alt:d,backgroundColor:g,foregroundColor:m,className:y,name:b,darkBackground:O=!1,iconType:j="individual",initials:k,shape:C="circle",size:h="M",src:v,onClick:P,tooltipMessage:w,tooltipId:z,tooltipIsVisible:S,tooltipPosition:B,tooltipType:I,tooltipSize:V,tooltipBgColor:x,tooltipFontColor:D,variant:E}=c,N=function(t,o){if(null==t)return{};var e,r,i=function(t,o){if(null==t)return{};var e,r,i={},n=Object.keys(t);for(r=0;r<n.length;r++)e=n[r],o.indexOf(e)>=0||(i[e]=t[e]);return i}(t,o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)e=n[r],o.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e])}return i}(c,["alt","backgroundColor","foregroundColor","className","name","darkBackground","iconType","initials","shape","size","src","onClick","tooltipMessage","tooltipId","tooltipIsVisible","tooltipPosition","tooltipType","tooltipSize","tooltipBgColor","tooltipFontColor","variant"]);const[T,_]=o(!1),M=Boolean(v)&&!T;e((()=>{_(!1)}),[v]);const F=i("portrait",N);return(()=>{let o=t(s,{type:j,size:h,variant:E});return k&&(o=t(n,{size:h,"data-element":"initials",variant:E,children:k.slice(0,3).toUpperCase()})),v&&!T&&(o=t(a,{src:v,alt:d||b||"","data-element":"user-image",onError:()=>_(!0)})),w?t(r,{message:w,id:z,position:B,type:I,size:V,isVisible:S,bgColor:x,fontColor:D,children:t(l,f(u(f(u({},p(N)),{onClick:P,className:y}),F),{hasValidImg:M,darkBackground:O,size:h,shape:C,backgroundColor:g,foregroundColor:m,variant:E,children:o}))}):t(l,f(u(f(u({},p(N)),{onClick:P,className:y}),F),{hasValidImg:M,darkBackground:O,size:h,shape:C,backgroundColor:g,foregroundColor:m,variant:E,children:o}))})()};export{d as Portrait,d as default};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { PortraitShapes, PortraitSizes } from "./portrait.component";
|
|
2
2
|
export declare const PORTRAIT_SHAPES: PortraitShapes[];
|
|
3
3
|
export declare const PORTRAIT_SIZES: PortraitSizes[];
|
|
4
|
-
type PortraitSizeParams = Record<PortraitSizes, {
|
|
5
|
-
dimensions: number;
|
|
6
|
-
iconDimensions: number;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const PORTRAIT_SIZE_PARAMS: PortraitSizeParams;
|
|
9
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const L=["circle","square"],X=["XS","S","M","ML","L","XL","XXL"];export{L as PORTRAIT_SHAPES,X as PORTRAIT_SIZES};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
import { PortraitSizes, PortraitShapes } from "./portrait.component";
|
|
3
|
+
import { PortraitSizes, PortraitShapes, PortraitVariant } from "./portrait.component";
|
|
4
4
|
type StyledPortraitProps = {
|
|
5
5
|
backgroundColor?: string;
|
|
6
6
|
foregroundColor?: string;
|
|
@@ -9,10 +9,11 @@ type StyledPortraitProps = {
|
|
|
9
9
|
shape?: PortraitShapes;
|
|
10
10
|
hasValidImg?: boolean;
|
|
11
11
|
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
+
variant?: PortraitVariant;
|
|
12
13
|
};
|
|
13
|
-
export declare const StyledPortraitInitials: import("styled-components").StyledComponent<"div", any, Pick<StyledPortraitProps, "size">, never>;
|
|
14
|
+
export declare const StyledPortraitInitials: import("styled-components").StyledComponent<"div", any, Pick<StyledPortraitProps, "size" | "variant">, never>;
|
|
14
15
|
export declare const StyledCustomImg: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
15
|
-
export declare const StyledIcon: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../icon").IconProps & React.RefAttributes<HTMLSpanElement>>, any, Pick<StyledPortraitProps, "size">, never>;
|
|
16
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../icon").IconProps & React.RefAttributes<HTMLSpanElement>>, any, Pick<StyledPortraitProps, "size" | "variant">, never>;
|
|
16
17
|
export declare const StyledPortraitContainer: import("styled-components").StyledComponent<"div", any, {
|
|
17
18
|
theme: object;
|
|
18
19
|
} & StyledPortraitProps & MarginProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>, "theme">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react";import
|
|
1
|
+
import"react";import t from"styled-components";import{margin as e}from"styled-system";import i from"../icon/icon.component.js";import o from"../../style/themes/apply-base-theme.js";import r,{getPortraitFontSize as n,getPortraitColors as s,getPortraitDimensions as l,getPortraitIconFontSize as a,getPortraitBorderRadius as d}from"./__internal__/get-properties.js";const m=t.div.withConfig({displayName:"portrait.style__StyledPortraitInitials",componentId:"sc-fbaa2f3e-0"})(["font:",";display:flex;white-space:nowrap;align-items:center;justify-content:center;height:inherit;width:inherit;.mentions-list-item &&{color:var(--input-dropdown-label-default);}.mentions-list-item:hover &&,.mentions-list-item.selected &&{color:var(--popover-label-hover);}"],(({size:t})=>n(t))),c=t.img.withConfig({displayName:"portrait.style__StyledCustomImg",componentId:"sc-fbaa2f3e-1"})(["height:inherit;min-width:inherit;"]),h=t(i).withConfig({displayName:"portrait.style__StyledIcon",componentId:"sc-fbaa2f3e-2"})(["&&{color:",";height:",";min-width:",";::before{font-size:",";}}"],(({variant:t})=>s(t).color),(({size:t})=>l(t).height),(({size:t})=>l(t).width),(({size:t})=>a(t))),p=t.div.attrs(o).withConfig({displayName:"portrait.style__StyledPortraitContainer",componentId:"sc-fbaa2f3e-3"})([""," ",";"," min-width:",";height:",";overflow:hidden;border-radius:",";border:var(--global-borderwidth-xs) solid var(--profile-border-default);display:inline-block;"," "," .mentions-list-item &&{color:currentColor;}.mentions-list-item:hover &&,.mentions-list-item.selected &&{color:currentColor;}"],(({variant:t})=>`\n background-color: ${s(t).backgroundColor};\n color: ${s(t).color};\n `),(({darkBackground:t,backgroundColor:e,size:i,foregroundColor:o,variant:n})=>!n&&r(e,t,!["XS","S"].includes(i),!0,o)),(({hasValidImg:t,size:e})=>t&&`max-width: ${l(e).width};`),(({size:t})=>l(t).width),(({size:t})=>l(t).height),(({shape:t,size:e})=>d(t,e)),(({onClick:t})=>t&&"cursor: pointer"),e);export{c as StyledCustomImg,h as StyledIcon,p as StyledPortraitContainer,m as StyledPortraitInitials};
|
|
@@ -11,5 +11,5 @@ declare const ProfileStyle: import("styled-components").StyledComponent<"div", a
|
|
|
11
11
|
theme: object;
|
|
12
12
|
} & Pick<ProfileSProps, "darkBackground" | "hasSrc">, "theme">;
|
|
13
13
|
declare const ProfileDetailsStyle: import("styled-components").StyledComponent<"div", any, Pick<ProfileSProps, "size" | "hasSrc">, never>;
|
|
14
|
-
declare const ProfileAvatarStyle: import("styled-components").StyledComponent<({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, ...rest }: import("../portrait").PortraitProps) => import("react").JSX.Element, any, {}, never>;
|
|
14
|
+
declare const ProfileAvatarStyle: import("styled-components").StyledComponent<({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, variant, ...rest }: import("../portrait").PortraitProps) => import("react").JSX.Element, any, {}, never>;
|
|
15
15
|
export { ProfileStyle, ProfileNameStyle, ProfileDetailsStyle, ProfileAvatarStyle, ProfileEmailStyle, ProfileTextStyle, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./__internal__/__next__/dialog.component.js"),a=require("../../__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 n=!1,l=!1,s=!1,o=!1,d=!1
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./__internal__/__next__/dialog.component.js"),a=require("../../__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 n=!1,l=!1,s=!1,o=!1,d=!1;const u=r.forwardRef(((r,u)=>{var{disableClose:c,pagesStyling:g,fullscreen:p,highlightVariant:f,disableContentPadding:b,size:m="medium",gradientKeyLine:y}=r,h=function(e,r){if(null==e)return{};var t,a,i=function(e,r){if(null==e)return{};var t,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)t=n[a],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)t=n[a],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(r,["disableClose","pagesStyling","fullscreen","highlightVariant","disableContentPadding","size","gradientKeyLine"]);n||void 0===p||(n=!0,a.default.deprecate('The fullscreen prop in Dialog is deprecated. Please use size="fullscreen" instead.')),l||void 0===f||(l=!0,a.default.deprecate("The highlightVariant prop is deprecated. Please use gradientKeyLine instead.")),s||void 0===c||(s=!0,a.default.deprecate("The disableClose prop in Dialog is deprecated and will soon be removed.")),o||void 0===g||(o=!0,a.default.deprecate("The pagesStyling prop in Dialog is deprecated and will soon be removed.")),d||"auto"!==m||(d=!0,a.default.deprecate('The `size="auto"` prop in Dialog is deprecated and has been defaulted to `size="large"`. Please use a specific size value instead.'));const v=((e,r)=>{if(r)return"fullscreen";switch(e){case"extra-small":case"small":return"small";case"medium-small":case"medium":default:return"medium";case"medium-large":case"large":case"extra-large":case"auto":return"large";case"fullscreen":case"maximise":return"fullscreen"}})(m,p),O=((e,r)=>void 0!==r?r:"ai"===e)(f,y);return e.jsx(t.Dialog,function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),a.forEach((function(r){i(e,r,t[r])}))}return e}({ref:u,size:v,gradientKeyLine:O,disableContentPadding:b,pagesStyling:g},h))}));u.displayName="Dialog",exports.Dialog=u,exports.default=u;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PortraitSizes, PortraitShapes, PortraitVariant } from "../portrait.component";
|
|
2
|
+
type GetPortraitColors = {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
color: string;
|
|
5
|
+
};
|
|
6
|
+
type GetPortraitDimensions = {
|
|
7
|
+
height: string;
|
|
8
|
+
width: string;
|
|
9
|
+
};
|
|
10
|
+
declare const getColoursForPortrait: (backgroundColour: string | undefined, darkBackground?: boolean, largeText?: boolean,
|
|
11
|
+
/**
|
|
12
|
+
* Whether to use strict contrast (i.e., WCAG AAA). If this is false, it uses WCAG AA contrast
|
|
13
|
+
* ratios (4.5:1 for normal text, 3:1 for large text). If true, it uses 7:1 for normal text and
|
|
14
|
+
* 4.5:1 for large text.
|
|
15
|
+
*/
|
|
16
|
+
strict?: boolean, foregroundColor?: string | undefined) => string;
|
|
17
|
+
export declare const getPortraitBorderRadius: (shape?: PortraitShapes, size?: PortraitSizes) => string;
|
|
18
|
+
export declare const getPortraitColors: (variant?: PortraitVariant) => GetPortraitColors;
|
|
19
|
+
export declare const getPortraitDimensions: (size: PortraitSizes) => GetPortraitDimensions;
|
|
20
|
+
export declare const getPortraitFontSize: (size: PortraitSizes) => string;
|
|
21
|
+
export declare const getPortraitIconFontSize: (size: PortraitSizes) => string;
|
|
22
|
+
export default getColoursForPortrait;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../style/utils/get-accessible-foreground-color.js");exports.default=(e,o=!1,i=!1,t=!1,a=void 0)=>{let l="var(--colorsUtilityYin090)",s="var(--colorsUtilityReadOnly400)";return!o||e||a||(s="var(--colorsUtilityYin090)",l="var(--colorsUtilityReadOnly600)"),e&&(s=e,l=r.default(e,i,t)),a&&(l=a),`background-color: ${s}; color: ${l};`},exports.getPortraitBorderRadius=(r,e)=>"square"===r?"XS"===e||"S"===e?"var(--global-radius-container-xs)":"M"===e||"ML"===e||"L"===e?"var(--global-radius-container-m)":"var(--global-radius-container-l)":"var(--global-radius-container-circle)",exports.getPortraitColors=r=>{const e={backgroundColor:"inherit",color:"inherit"};return"black"===r?(e.backgroundColor="var(--profile-bg-def)",e.color="var(--profile-label-default)"):(e.backgroundColor=`var(--profile-swatches-${r}-bg-default)`,e.color=`var(--profile-swatches-${r}-label-default)`),e},exports.getPortraitDimensions=r=>({height:`var(--profile-size-outside-${r.toLowerCase()})`,width:`var(--profile-size-outside-${r.toLowerCase()})`}),exports.getPortraitFontSize=r=>`var(--profile-font-initials-${r.toLowerCase()})`,exports.getPortraitIconFontSize=r=>{switch(r){case"XS":return"var(--profile-size-inside-xs)";case"S":return"var(--profile-size-inside-s)";case"ML":return"var(--profile-size-inside-ml)";case"L":return"var(--profile-size-inside-l)";case"XL":return"var(--profile-size-inside-xl)";case"XXL":return"var(--profile-size-inside-xxl)";default:return"var(--profile-size-inside-m)"}};
|
|
@@ -4,6 +4,7 @@ import { IconType } from "../icon";
|
|
|
4
4
|
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
5
5
|
export type PortraitShapes = "circle" | "square";
|
|
6
6
|
export type PortraitSizes = "XS" | "S" | "M" | "ML" | "L" | "XL" | "XXL";
|
|
7
|
+
export type PortraitVariant = "black" | "blue" | "teal" | "green" | "lime" | "orange" | "red" | "pink" | "purple" | "slate" | "gray";
|
|
7
8
|
export interface PortraitProps extends MarginProps, TagProps {
|
|
8
9
|
/** @private @ignore */
|
|
9
10
|
className?: string;
|
|
@@ -21,30 +22,54 @@ export interface PortraitProps extends MarginProps, TagProps {
|
|
|
21
22
|
iconType?: IconType;
|
|
22
23
|
/** The initials to render in the Portrait. */
|
|
23
24
|
initials?: string;
|
|
24
|
-
/** Use a dark background.
|
|
25
|
+
/** Use a dark background.
|
|
26
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
27
|
+
*/
|
|
25
28
|
darkBackground?: boolean;
|
|
26
29
|
/** Prop for `onClick` events. */
|
|
27
30
|
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
28
|
-
/** [Legacy] The message to be displayed within the tooltip
|
|
31
|
+
/** [Legacy] The message to be displayed within the tooltip
|
|
32
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
33
|
+
*/
|
|
29
34
|
tooltipMessage?: React.ReactNode;
|
|
30
|
-
/** [Legacy] The id attribute to use for the tooltip
|
|
35
|
+
/** [Legacy] The id attribute to use for the tooltip
|
|
36
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
37
|
+
*/
|
|
31
38
|
tooltipId?: string;
|
|
32
|
-
/** [Legacy] Whether to to show the Tooltip
|
|
39
|
+
/** [Legacy] Whether to to show the Tooltip
|
|
40
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
41
|
+
*/
|
|
33
42
|
tooltipIsVisible?: boolean;
|
|
34
|
-
/** [Legacy] Sets position of the tooltip
|
|
43
|
+
/** [Legacy] Sets position of the tooltip
|
|
44
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
45
|
+
*/
|
|
35
46
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
36
|
-
/** [Legacy] Defines the message type
|
|
47
|
+
/** [Legacy] Defines the message type
|
|
48
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
49
|
+
*/
|
|
37
50
|
tooltipType?: string;
|
|
38
|
-
/** [Legacy] Defines the size of the tooltip content
|
|
51
|
+
/** [Legacy] Defines the size of the tooltip content
|
|
52
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
53
|
+
*/
|
|
39
54
|
tooltipSize?: "medium" | "large";
|
|
40
|
-
/** [Legacy] Override background color of the Tooltip, provide any color from palette or any valid css color value.
|
|
55
|
+
/** [Legacy] Override background color of the Tooltip, provide any color from palette or any valid css color value.
|
|
56
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
57
|
+
*/
|
|
41
58
|
tooltipBgColor?: string;
|
|
42
|
-
/** [Legacy] Override font color of the Tooltip, provide any color from palette or any valid css color value.
|
|
59
|
+
/** [Legacy] Override font color of the Tooltip, provide any color from palette or any valid css color value.
|
|
60
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
61
|
+
*/
|
|
43
62
|
tooltipFontColor?: string;
|
|
44
|
-
/** The hex code of the background colour
|
|
63
|
+
/** The hex code of the background colour
|
|
64
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
65
|
+
*/
|
|
45
66
|
backgroundColor?: string;
|
|
46
|
-
/** The hex code of the foreground colour. This will only take effect if use in conjunction with `backgroundColor`
|
|
67
|
+
/** The hex code of the foreground colour. This will only take effect if use in conjunction with `backgroundColor`
|
|
68
|
+
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
69
|
+
*/
|
|
47
70
|
foregroundColor?: string;
|
|
71
|
+
/** Color variant*/
|
|
72
|
+
variant?: PortraitVariant;
|
|
48
73
|
}
|
|
49
|
-
export declare const Portrait: ({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, ...rest }: PortraitProps) => React.JSX.Element;
|
|
74
|
+
export declare const Portrait: ({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, variant, ...rest }: PortraitProps) => React.JSX.Element;
|
|
50
75
|
export default Portrait;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../tooltip/tooltip.component.js"),o=require("../../__internal__/utils/helpers/tags/tags.js"),i=require("./portrait.style.js");require("../../style/utils/filter-styled-system-padding-props.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../tooltip/tooltip.component.js"),o=require("../../__internal__/utils/helpers/tags/tags.js"),i=require("./portrait.style.js");require("../../style/utils/filter-styled-system-padding-props.js");var n=require("../../style/utils/filter-styled-system-margin-props.js");function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){l(e,t,r[t])}))}return e}function a(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}const c=l=>{var{alt:c,backgroundColor:p,foregroundColor:u,className:d,name:y,darkBackground:f=!1,iconType:g="individual",initials:b,shape:j="circle",size:O="M",src:m,onClick:C,tooltipMessage:P,tooltipId:k,tooltipIsVisible:v,tooltipPosition:h,tooltipType:S,tooltipSize:x,tooltipBgColor:w,tooltipFontColor:I,variant:z}=l,q=function(e,t){if(null==e)return{};var r,o,i=function(e,t){if(null==e)return{};var r,o,i={},n=Object.keys(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(l,["alt","backgroundColor","foregroundColor","className","name","darkBackground","iconType","initials","shape","size","src","onClick","tooltipMessage","tooltipId","tooltipIsVisible","tooltipPosition","tooltipType","tooltipSize","tooltipBgColor","tooltipFontColor","variant"]);const[B,_]=t.useState(!1),E=Boolean(m)&&!B;t.useEffect((()=>{_(!1)}),[m]);const T=o.default("portrait",q);return(()=>{let t=e.jsx(i.StyledIcon,{type:g,size:O,variant:z});return b&&(t=e.jsx(i.StyledPortraitInitials,{size:O,"data-element":"initials",variant:z,children:b.slice(0,3).toUpperCase()})),m&&!B&&(t=e.jsx(i.StyledCustomImg,{src:m,alt:c||y||"","data-element":"user-image",onError:()=>_(!0)})),P?e.jsx(r.Tooltip,{message:P,id:k,position:h,type:S,size:x,isVisible:v,bgColor:w,fontColor:I,children:e.jsx(i.StyledPortraitContainer,a(s(a(s({},n.default(q)),{onClick:C,className:d}),T),{hasValidImg:E,darkBackground:f,size:O,shape:j,backgroundColor:p,foregroundColor:u,variant:z,children:t}))}):e.jsx(i.StyledPortraitContainer,a(s(a(s({},n.default(q)),{onClick:C,className:d}),T),{hasValidImg:E,darkBackground:f,size:O,shape:j,backgroundColor:p,foregroundColor:u,variant:z,children:t}))})()};exports.Portrait=c,exports.default=c;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { PortraitShapes, PortraitSizes } from "./portrait.component";
|
|
2
2
|
export declare const PORTRAIT_SHAPES: PortraitShapes[];
|
|
3
3
|
export declare const PORTRAIT_SIZES: PortraitSizes[];
|
|
4
|
-
type PortraitSizeParams = Record<PortraitSizes, {
|
|
5
|
-
dimensions: number;
|
|
6
|
-
iconDimensions: number;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const PORTRAIT_SIZE_PARAMS: PortraitSizeParams;
|
|
9
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.PORTRAIT_SHAPES=["circle","square"],exports.PORTRAIT_SIZES=["XS","S","M","ML","L","XL","XXL"]
|
|
1
|
+
"use strict";exports.PORTRAIT_SHAPES=["circle","square"],exports.PORTRAIT_SIZES=["XS","S","M","ML","L","XL","XXL"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
import { PortraitSizes, PortraitShapes } from "./portrait.component";
|
|
3
|
+
import { PortraitSizes, PortraitShapes, PortraitVariant } from "./portrait.component";
|
|
4
4
|
type StyledPortraitProps = {
|
|
5
5
|
backgroundColor?: string;
|
|
6
6
|
foregroundColor?: string;
|
|
@@ -9,10 +9,11 @@ type StyledPortraitProps = {
|
|
|
9
9
|
shape?: PortraitShapes;
|
|
10
10
|
hasValidImg?: boolean;
|
|
11
11
|
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
+
variant?: PortraitVariant;
|
|
12
13
|
};
|
|
13
|
-
export declare const StyledPortraitInitials: import("styled-components").StyledComponent<"div", any, Pick<StyledPortraitProps, "size">, never>;
|
|
14
|
+
export declare const StyledPortraitInitials: import("styled-components").StyledComponent<"div", any, Pick<StyledPortraitProps, "size" | "variant">, never>;
|
|
14
15
|
export declare const StyledCustomImg: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
15
|
-
export declare const StyledIcon: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../icon").IconProps & React.RefAttributes<HTMLSpanElement>>, any, Pick<StyledPortraitProps, "size">, never>;
|
|
16
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../icon").IconProps & React.RefAttributes<HTMLSpanElement>>, any, Pick<StyledPortraitProps, "size" | "variant">, never>;
|
|
16
17
|
export declare const StyledPortraitContainer: import("styled-components").StyledComponent<"div", any, {
|
|
17
18
|
theme: object;
|
|
18
19
|
} & StyledPortraitProps & MarginProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>, "theme">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("react");var
|
|
1
|
+
"use strict";require("react");var t=require("styled-components"),e=require("styled-system"),i=require("../icon/icon.component.js"),o=require("../../style/themes/apply-base-theme.js"),r=require("./__internal__/get-properties.js");function n(t){return t&&t.__esModule?t:{default:t}}var s=n(t);const a=s.default.div.withConfig({displayName:"portrait.style__StyledPortraitInitials",componentId:"sc-fbaa2f3e-0"})(["font:",";display:flex;white-space:nowrap;align-items:center;justify-content:center;height:inherit;width:inherit;.mentions-list-item &&{color:var(--input-dropdown-label-default);}.mentions-list-item:hover &&,.mentions-list-item.selected &&{color:var(--popover-label-hover);}"],(({size:t})=>r.getPortraitFontSize(t))),l=s.default.img.withConfig({displayName:"portrait.style__StyledCustomImg",componentId:"sc-fbaa2f3e-1"})(["height:inherit;min-width:inherit;"]),d=s.default(i.default).withConfig({displayName:"portrait.style__StyledIcon",componentId:"sc-fbaa2f3e-2"})(["&&{color:",";height:",";min-width:",";::before{font-size:",";}}"],(({variant:t})=>r.getPortraitColors(t).color),(({size:t})=>r.getPortraitDimensions(t).height),(({size:t})=>r.getPortraitDimensions(t).width),(({size:t})=>r.getPortraitIconFontSize(t))),c=s.default.div.attrs(o.default).withConfig({displayName:"portrait.style__StyledPortraitContainer",componentId:"sc-fbaa2f3e-3"})([""," ",";"," min-width:",";height:",";overflow:hidden;border-radius:",";border:var(--global-borderwidth-xs) solid var(--profile-border-default);display:inline-block;"," "," .mentions-list-item &&{color:currentColor;}.mentions-list-item:hover &&,.mentions-list-item.selected &&{color:currentColor;}"],(({variant:t})=>`\n background-color: ${r.getPortraitColors(t).backgroundColor};\n color: ${r.getPortraitColors(t).color};\n `),(({darkBackground:t,backgroundColor:e,size:i,foregroundColor:o,variant:n})=>!n&&r.default(e,t,!["XS","S"].includes(i),!0,o)),(({hasValidImg:t,size:e})=>t&&`max-width: ${r.getPortraitDimensions(e).width};`),(({size:t})=>r.getPortraitDimensions(t).width),(({size:t})=>r.getPortraitDimensions(t).height),(({shape:t,size:e})=>r.getPortraitBorderRadius(t,e)),(({onClick:t})=>t&&"cursor: pointer"),e.margin);exports.StyledCustomImg=l,exports.StyledIcon=d,exports.StyledPortraitContainer=c,exports.StyledPortraitInitials=a;
|
|
@@ -11,5 +11,5 @@ declare const ProfileStyle: import("styled-components").StyledComponent<"div", a
|
|
|
11
11
|
theme: object;
|
|
12
12
|
} & Pick<ProfileSProps, "darkBackground" | "hasSrc">, "theme">;
|
|
13
13
|
declare const ProfileDetailsStyle: import("styled-components").StyledComponent<"div", any, Pick<ProfileSProps, "size" | "hasSrc">, never>;
|
|
14
|
-
declare const ProfileAvatarStyle: import("styled-components").StyledComponent<({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, ...rest }: import("../portrait").PortraitProps) => import("react").JSX.Element, any, {}, never>;
|
|
14
|
+
declare const ProfileAvatarStyle: import("styled-components").StyledComponent<({ alt, backgroundColor, foregroundColor, className, name, darkBackground, iconType, initials, shape, size, src, onClick, tooltipMessage, tooltipId, tooltipIsVisible, tooltipPosition, tooltipType, tooltipSize, tooltipBgColor, tooltipFontColor, variant, ...rest }: import("../portrait").PortraitProps) => import("react").JSX.Element, any, {}, never>;
|
|
15
15
|
export { ProfileStyle, ProfileNameStyle, ProfileDetailsStyle, ProfileAvatarStyle, ProfileEmailStyle, ProfileTextStyle, };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "159.
|
|
3
|
+
"version": "159.4.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
7
7
|
"esm"
|
|
8
8
|
],
|
|
9
9
|
"engines": {
|
|
10
|
-
"npm": ">=11.
|
|
10
|
+
"npm": ">=11.15.0"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"setup": "npm ci && npm run prepare",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"husky": "^8.0.3",
|
|
155
155
|
"inquirer": "^12.10.0",
|
|
156
156
|
"jest": "^29.5.0",
|
|
157
|
-
"jest-canvas-mock": "
|
|
157
|
+
"jest-canvas-mock": "2.5.2",
|
|
158
158
|
"jest-environment-jsdom": "^30.3.0",
|
|
159
159
|
"jest-fail-on-console": "^3.3.1",
|
|
160
160
|
"jest-fetch-mock": "^3.0.3",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const getColoursForPortrait: (backgroundColour: string | undefined, darkBackground?: boolean, largeText?: boolean,
|
|
2
|
-
/**
|
|
3
|
-
* Whether to use strict contrast (i.e., WCAG AAA). If this is false, it uses WCAG AA contrast
|
|
4
|
-
* ratios (4.5:1 for normal text, 3:1 for large text). If true, it uses 7:1 for normal text and
|
|
5
|
-
* 4.5:1 for large text.
|
|
6
|
-
*/
|
|
7
|
-
strict?: boolean, foregroundColor?: string | undefined) => string;
|
|
8
|
-
export default getColoursForPortrait;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import o from"../../../style/utils/get-accessible-foreground-color.js";const r=(r,l=!1,t=!1,i=!1,c=void 0)=>{let e="var(--colorsUtilityYin090)",s="var(--colorsUtilityReadOnly400)";return!l||r||c||(s="var(--colorsUtilityYin090)",e="var(--colorsUtilityReadOnly600)"),r&&(s=r,e=o(r,t,i)),c&&(e=c),`background-color: ${s}; color: ${e};`};export{r as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const getColoursForPortrait: (backgroundColour: string | undefined, darkBackground?: boolean, largeText?: boolean,
|
|
2
|
-
/**
|
|
3
|
-
* Whether to use strict contrast (i.e., WCAG AAA). If this is false, it uses WCAG AA contrast
|
|
4
|
-
* ratios (4.5:1 for normal text, 3:1 for large text). If true, it uses 7:1 for normal text and
|
|
5
|
-
* 4.5:1 for large text.
|
|
6
|
-
*/
|
|
7
|
-
strict?: boolean, foregroundColor?: string | undefined) => string;
|
|
8
|
-
export default getColoursForPortrait;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../style/utils/get-accessible-foreground-color.js");exports.default=(e,o=!1,l=!1,t=!1,i=void 0)=>{let s="var(--colorsUtilityYin090)",a="var(--colorsUtilityReadOnly400)";return!o||e||i||(a="var(--colorsUtilityYin090)",s="var(--colorsUtilityReadOnly600)"),e&&(a=e,s=r.default(e,l,t)),i&&(s=i),`background-color: ${a}; color: ${s};`};
|