@mmb-digital/ds-lilly 1.0.78 → 1.0.79

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.
Files changed (31) hide show
  1. package/cjs/components/Components/ProductCard/ProductCard.d.ts +30 -7
  2. package/cjs/components/Components/ProductCard/ProductCard.d.ts.map +1 -1
  3. package/cjs/components/Components/ProductCard/ProductCard.js +1 -1
  4. package/cjs/components/Components/ProductCard/ProductCard.js.map +1 -1
  5. package/cjs/components/Components/ProductHeader/ProductHeader.d.ts +29 -14
  6. package/cjs/components/Components/ProductHeader/ProductHeader.d.ts.map +1 -1
  7. package/cjs/components/Components/ProductHeader/ProductHeader.js +1 -1
  8. package/cjs/components/Components/ProductHeader/ProductHeader.js.map +1 -1
  9. package/cjs/ds-lilly.css +60 -106
  10. package/components/Components/ProductCard/ProductCard.d.ts +30 -7
  11. package/components/Components/ProductCard/ProductCard.d.ts.map +1 -1
  12. package/components/Components/ProductCard/ProductCard.js +1 -1
  13. package/components/Components/ProductCard/ProductCard.js.map +1 -1
  14. package/components/Components/ProductHeader/ProductHeader.d.ts +29 -14
  15. package/components/Components/ProductHeader/ProductHeader.d.ts.map +1 -1
  16. package/components/Components/ProductHeader/ProductHeader.js +1 -1
  17. package/components/Components/ProductHeader/ProductHeader.js.map +1 -1
  18. package/ds-lilly.css +60 -106
  19. package/package.json +1 -1
  20. /package/assets/{373b24232dbde5638b3e.eot → 147f4898a5bacb81f81b.eot} +0 -0
  21. /package/assets/{a4eb185de6e9e8518f80.gif → 1f40e1dc500d1c56a79e.gif} +0 -0
  22. /package/assets/{a4d621efb99662215dcf.woff → 2ab0ddeba09a1cb0022d.woff} +0 -0
  23. /package/assets/{9c1e455bb0a59720c6d6.eot → 3274a3154b84281a5ead.eot} +0 -0
  24. /package/assets/{276073f0b5c423037a46.ttf → 586997b905382fe5007d.ttf} +0 -0
  25. /package/assets/{4a3c7db81c0c9b29c962.ttf → 58aceb567f77555a7d1f.ttf} +0 -0
  26. /package/assets/{3ce9b942cd0d8a1f5096.svg → 6da120f8d145cf1398d2.svg} +0 -0
  27. /package/assets/{d4c0e4b5548d0484ee15.gif → 7d584f10dcb4db1b16bc.gif} +0 -0
  28. /package/assets/{cd770d5268141130e5db.eot → 95ebeabd54cb87a45b1c.eot} +0 -0
  29. /package/assets/{e6e6babf129394d31330.woff → d463a68d9280d48bc701.woff} +0 -0
  30. /package/assets/{9054ffa42a3bd14fb067.svg → ebd63907e848d55bdffe.svg} +0 -0
  31. /package/assets/{f71fdd6c77dce2cecece.eot → f4e9b614f43a8d4a7bf2.eot} +0 -0
package/cjs/ds-lilly.css CHANGED
@@ -6845,86 +6845,80 @@ body.dark .c-logo__svg {
6845
6845
  .c-productCard__position.c-card--medium {
6846
6846
  padding-bottom: 24px;
6847
6847
  }
6848
- .c-productCard__clickableHeader {
6849
- cursor: pointer;
6848
+ .c-productCard__headerArea {
6850
6849
  width: 100%;
6851
6850
  }
6852
-
6853
- .c-productHeader {
6854
- padding: 0;
6855
- }
6856
-
6857
- .c-productHeader__grid {
6858
- display: grid;
6859
- grid-template-columns: minmax(0, 1fr) auto;
6860
- grid-template-rows: auto auto;
6861
- column-gap: var(--spaceXXXSmall);
6862
- row-gap: var(--spaceXXXSmall);
6863
- align-items: stretch;
6864
- }
6865
-
6866
- .c-productHeader--withTitleIcon .c-productHeader__grid {
6867
- grid-template-columns: auto minmax(0, 1fr) auto;
6851
+ .c-productCard__headerArea--clickable {
6852
+ cursor: pointer;
6868
6853
  }
6869
-
6870
- .c-productHeader__grid > * {
6871
- min-width: 0;
6854
+ .c-productCard__headerArea--withSharedTitleLink:hover .c-productHeader__titleLink.c-link, .c-productCard__headerArea--withSharedTitleLink:focus-within .c-productHeader__titleLink.c-link {
6855
+ color: var(--colorHoverLink);
6856
+ text-decoration: none;
6872
6857
  }
6873
6858
 
6874
- .c-productHeader__gridIcon {
6875
- grid-column: 1;
6876
- grid-row: 1;
6877
- align-self: end;
6878
- padding-right: var(--spaceXSmall);
6859
+ .c-productHeader {
6860
+ padding: 0;
6879
6861
  }
6880
6862
 
6881
- .c-productHeader__gridTitle {
6882
- grid-column: 1;
6883
- grid-row: 1;
6863
+ .c-productHeader--headerClickable {
6864
+ cursor: pointer;
6884
6865
  }
6885
6866
 
6886
- .c-productHeader__gridSubtitle {
6887
- margin: 0;
6888
- grid-column: 1;
6889
- grid-row: 2;
6867
+ .c-productHeader--headerClickableWithTitleLink:hover .c-productHeader__titleLink.c-link,
6868
+ .c-productHeader--headerClickableWithTitleLink:focus-within .c-productHeader__titleLink.c-link {
6869
+ color: var(--colorHoverLink);
6870
+ text-decoration: none;
6890
6871
  }
6891
6872
 
6892
- .c-productHeader__gridAmount {
6893
- grid-column: 2;
6894
- grid-row: 1;
6895
- justify-self: end;
6873
+ .c-productHeader__layout {
6874
+ display: flex;
6875
+ flex-direction: row;
6876
+ align-items: flex-start;
6877
+ column-gap: var(--spaceXXXSmall);
6896
6878
  }
6897
6879
 
6898
- .c-productHeader__gridSecondary {
6899
- grid-column: 2;
6900
- grid-row: 2;
6901
- justify-self: end;
6880
+ .c-productHeader__colLeft {
6881
+ display: flex;
6882
+ flex-direction: column;
6883
+ gap: var(--spaceXXSmall);
6884
+ flex: 1 1 0;
6885
+ min-width: 0;
6902
6886
  }
6903
6887
 
6904
- .c-productHeader--withTitleIcon .c-productHeader__gridTitle {
6905
- grid-column: 2;
6888
+ .c-productHeader__colRight {
6889
+ display: flex;
6890
+ flex-direction: column;
6891
+ gap: var(--spaceXXSmall);
6892
+ flex: 0 0 auto;
6893
+ align-items: flex-end;
6906
6894
  }
6907
6895
 
6908
- .c-productHeader--withTitleIcon .c-productHeader__gridSubtitle {
6909
- grid-column: 2;
6896
+ .c-productHeader--withTitleIcon .c-productHeader__colLeft {
6897
+ flex-direction: row;
6898
+ align-items: flex-start;
6899
+ flex-wrap: nowrap;
6910
6900
  }
6911
6901
 
6912
- .c-productHeader--withTitleIcon .c-productHeader__gridAmount {
6913
- grid-column: 3;
6902
+ .c-productHeader--withTitleIcon .c-productHeader__colLeftInner {
6903
+ display: flex;
6904
+ flex-direction: column;
6905
+ gap: var(--spaceXXSmall);
6906
+ min-width: 0;
6907
+ flex: 1 1 0;
6914
6908
  }
6915
6909
 
6916
- .c-productHeader--withTitleIcon .c-productHeader__gridSecondary {
6917
- grid-column: 3;
6910
+ .c-productHeader__colIcon {
6911
+ flex: 0 0 auto;
6912
+ align-self: flex-start;
6913
+ padding-right: var(--spaceXSmall);
6918
6914
  }
6919
6915
 
6920
- .c-productHeader__gridTitle,
6921
- .c-productHeader__gridAmount {
6922
- align-self: end;
6916
+ .c-productHeader__colTitle {
6917
+ min-width: 0;
6923
6918
  }
6924
6919
 
6925
- .c-productHeader__gridSubtitle,
6926
- .c-productHeader__gridSecondary {
6927
- align-self: start;
6920
+ .c-productHeader__colSubtitle {
6921
+ margin: 0;
6928
6922
  }
6929
6923
 
6930
6924
  .c-productHeader__subtitle {
@@ -6996,59 +6990,19 @@ body.dark .c-logo__svg {
6996
6990
  /* MOBILE */
6997
6991
  /* ------------------------------------------------------------------------------------------------------------------------------------------------ */
6998
6992
  @media screen and (max-width: 480px) {
6999
- .c-productHeader__grid {
7000
- grid-template-columns: 1fr;
7001
- grid-template-rows: auto auto auto auto;
7002
- row-gap: var(--spaceXXXSmall);
7003
- }
7004
- .c-productHeader--withTitleIcon .c-productHeader__grid {
7005
- grid-template-columns: auto minmax(0, 1fr);
7006
- grid-template-rows: auto auto auto auto;
6993
+ .c-productHeader__layout {
6994
+ flex-direction: column;
7007
6995
  row-gap: var(--spaceXXXSmall);
7008
6996
  }
7009
- .c-productHeader__gridTitle {
7010
- grid-column: 1;
7011
- grid-row: 1;
7012
- align-self: start;
7013
- }
7014
- .c-productHeader__gridSubtitle {
7015
- grid-column: 1;
7016
- grid-row: 2;
7017
- align-self: start;
7018
- }
7019
- .c-productHeader__gridAmount {
7020
- grid-column: 1;
7021
- grid-row: 3;
7022
- justify-self: start;
7023
- align-self: start;
6997
+ .c-productHeader__colLeft {
7024
6998
  width: 100%;
7025
6999
  }
7026
- .c-productHeader__gridSecondary {
7027
- grid-column: 1;
7028
- grid-row: 4;
7029
- justify-self: start;
7030
- align-self: start;
7031
- }
7032
- .c-productHeader--withTitleIcon .c-productHeader__gridIcon {
7033
- grid-column: 1;
7034
- grid-row: 1;
7035
- align-self: end;
7036
- }
7037
- .c-productHeader--withTitleIcon .c-productHeader__gridTitle {
7038
- grid-column: 2;
7039
- grid-row: 1;
7040
- }
7041
- .c-productHeader--withTitleIcon .c-productHeader__gridSubtitle {
7042
- grid-column: 2;
7043
- grid-row: 2;
7044
- }
7045
- .c-productHeader--withTitleIcon .c-productHeader__gridAmount {
7046
- grid-column: 1/-1;
7047
- grid-row: 3;
7000
+ .c-productHeader--withTitleIcon .c-productHeader__colLeft {
7001
+ width: 100%;
7048
7002
  }
7049
- .c-productHeader--withTitleIcon .c-productHeader__gridSecondary {
7050
- grid-column: 1/-1;
7051
- grid-row: 4;
7003
+ .c-productHeader__colRight {
7004
+ align-items: flex-start;
7005
+ width: 100%;
7052
7006
  }
7053
7007
  .c-productHeader__actions {
7054
7008
  padding-top: var(--spaceSmall);
@@ -10524,7 +10478,7 @@ body.dark .u-fg--fgWhiteDefault {
10524
10478
  /* Slider */
10525
10479
  .slick-loading .slick-list
10526
10480
  {
10527
- background: #fff url('assets/a4eb185de6e9e8518f80.gif') center center no-repeat;
10481
+ background: #fff url('assets/1f40e1dc500d1c56a79e.gif') center center no-repeat;
10528
10482
  }
10529
10483
 
10530
10484
  /* Icons */
@@ -10534,8 +10488,8 @@ body.dark .u-fg--fgWhiteDefault {
10534
10488
  font-weight: normal;
10535
10489
  font-style: normal;
10536
10490
 
10537
- src: url('assets/cd770d5268141130e5db.eot');
10538
- src: url('assets/f71fdd6c77dce2cecece.eot') format('embedded-opentype'), url('assets/a4d621efb99662215dcf.woff') format('woff'), url('assets/4a3c7db81c0c9b29c962.ttf') format('truetype'), url('assets/9054ffa42a3bd14fb067.svg') format('svg');
10491
+ src: url('assets/147f4898a5bacb81f81b.eot');
10492
+ src: url('assets/95ebeabd54cb87a45b1c.eot') format('embedded-opentype'), url('assets/2ab0ddeba09a1cb0022d.woff') format('woff'), url('assets/586997b905382fe5007d.ttf') format('truetype'), url('assets/ebd63907e848d55bdffe.svg') format('svg');
10539
10493
  }
10540
10494
  /* Arrows */
10541
10495
  .slick-prev,
@@ -1,6 +1,28 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { CardSize } from '../Card';
3
3
  import { ProductHeaderPropTypes, ProductHeaderSizeProps } from '../ProductHeader';
4
+ type ProductCardClickBehavior = {
5
+ /** Makes the whole header area clickable without using the collapse arrow. */
6
+ isHeaderClickable: true;
7
+ /** Click handler for the header area. */
8
+ onClick?: () => void;
9
+ /** Makes the whole card interactive. */
10
+ isInteractive?: boolean;
11
+ } | {
12
+ /** Makes the whole header area clickable without using the collapse arrow. */
13
+ isHeaderClickable?: false;
14
+ /** Click handler for the interactive card. */
15
+ onClick?: () => void;
16
+ /** Makes the whole card interactive with hover and click styles. */
17
+ isInteractive: true;
18
+ } | {
19
+ /** Makes the whole header area clickable without using the collapse arrow. */
20
+ isHeaderClickable?: false;
21
+ /** Cannot be used without `isInteractive` or `isHeaderClickable`. */
22
+ onClick?: never;
23
+ /** Makes the whole card interactive with hover and click styles. */
24
+ isInteractive?: false;
25
+ };
4
26
  type ProductCardTableRow = {
5
27
  label: ReactNode;
6
28
  perex?: string;
@@ -10,24 +32,24 @@ type ProductCardTableRow = {
10
32
  firstColumnSecondary?: boolean;
11
33
  isBold?: boolean;
12
34
  };
13
- export type ProductCardPropTypes = ProductHeaderPropTypes & {
35
+ export type ProductCardPropTypes = Omit<ProductHeaderPropTypes, 'isHeaderClickable' | 'onHeaderClick'> & ProductCardClickBehavior & {
14
36
  /** Children rendered inside the collapsible content area. */
15
37
  children?: ReactNode | false;
16
38
  /** Defines if card is open or closed on first render. */
17
39
  initialState?: boolean;
18
40
  /** Determines if the card is collapsible. */
19
41
  isCollapsible?: boolean;
20
- /** Makes the card interactive with hover/active styles and a visible collapse arrow. */
21
- isInteractive?: boolean;
22
- /** Makes the entire header clickable without interactive card styles or a collapse arrow. */
23
- isHeaderClickable?: boolean;
24
- /** Click event handler for the card wrapper / header (depending on config). */
25
- onClick?: () => void;
26
42
  /** Optional custom theme for the Card wrapper. */
27
43
  theme?: string;
28
44
  /** Optional testId for Card wrapper. */
29
45
  cardTestId?: string;
46
+ /** Changes size of card paddings. */
30
47
  size?: CardSize;
48
+ /**
49
+ * ProductHeader size variant that sets default sizing for the whole header (title, subtitle, amounts, icon and actions).
50
+ * You can still override any individual size via `titleSize`, `subtitleSize`, `amountSize`, `secondaryAmountSize`,
51
+ * `titleIconSize` or `actionsSize`.
52
+ */
31
53
  headerSize?: ProductHeaderSizeProps;
32
54
  /** Extra content rendered under ProductHeader (still in Card header). */
33
55
  customContent?: ReactNode;
@@ -49,6 +71,7 @@ export type ProductCardPropTypes = ProductHeaderPropTypes & {
49
71
  tableIsBold?: boolean;
50
72
  /** Additional classes applied to the table wrapper. */
51
73
  tableTheme?: string;
74
+ /** Additional classes applied to divider. */
52
75
  dividerTheme?: string;
53
76
  };
54
77
  export declare const ProductCard: ({ cardTestId, children, customContent, dividerTheme, headerSize, initialState, isCollapsible, isHeaderClickable, isInteractive, onClick, size, tableContentAlignment, tableDisableStackingOnMobile, tableFirstColumnSecondary, tableGaps, tableIsBold, tableRows, tableTheme, tableWiderContent, theme, withDivider, ...productHeaderProps }: ProductCardPropTypes) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/ProductCard/ProductCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,SAAS,EAAqB,MAAM,OAAO,CAAA;AAIrE,OAAO,EAA2B,QAAQ,EAAE,MAAM,SAAS,CAAA;AAG3D,OAAO,EAAiB,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,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AE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IACnD,gFAAgF;IAChF,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,iVAuBrB,oBAAoB,sBA0JtB,CAAA"}
1
+ {"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/ProductCard/ProductCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,SAAS,EAAkC,MAAM,OAAO,CAAA;AAKlF,OAAO,EAA2B,QAAQ,EAAE,MAAM,SAAS,CAAA;AAG3D,OAAO,EAAiB,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAEhG,KAAK,wBAAwB,GACzB;IACE,8EAA8E;IAC9E,iBAAiB,EAAE,IAAI,CAAA;IACvB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,wCAAwC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GACD;IACE,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,KAAK,CAAA;IACzB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,oEAAoE;IACpE,aAAa,EAAE,IAAI,CAAA;CACpB,GACD;IACE,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,KAAK,CAAA;IACzB,qEAAqE;IACrE,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,oEAAoE;IACpE,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB,CAAA;AAEL,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,SAAS,CA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,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAEH,eAAO,MAAM,WAAW,iVAuBrB,oBAAoB,sBA8NtB,CAAA"}
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as t}from'./../../../ext/tslib/tslib.es6.js';import i,{useState as r,useMemo as a,Fragment as l}from"react";import"../../../utils/getDisplayName.js";import"../../../utils/getIntegerMask.js";import"../../../utils/isFilled.js";import"../../../utils/isNotFilled.js";import"../../../utils/isNotNilNorEmpty.js";import'./../../../ext/diacritic/diacritics.js';import{cx as o}from"../../../utils/classBinder.js";import'./../../../ext/text-mask-addons/dist/textMaskAddons.js';import{Avatar as n}from"../Avatar/Avatar.js";import{Card as d}from"../Card/Card.js";import{CardCustomTrigger as s}from"../Card/_elements_/CardCustomTrigger.js";import{DataTable as c}from"../DataTable/DataTable.js";import{DataTableItem as m}from"../DataTable/DataTableItem.js";import{Divider as u}from"../Divider/Divider.js";import{ProductHeader as p}from"../ProductHeader/ProductHeader.js";var C=function(C){var b=C.cardTestId,v=C.children,f=C.customContent,g=C.dividerTheme,h=C.headerSize,E=void 0===h?"medium":h,I=C.initialState,_=void 0!==I&&I,k=C.isCollapsible,j=void 0!==k&&k,N=C.isHeaderClickable,D=void 0!==N&&N,S=C.isInteractive,T=void 0!==S&&S,y=C.onClick,w=C.size,z=void 0===w?"large":w,A=C.tableContentAlignment,B=void 0===A?"left":A,x=C.tableDisableStackingOnMobile,H=void 0!==x&&x,M=C.tableFirstColumnSecondary,F=void 0===M||M,O=C.tableGaps,P=void 0===O?"small":O,R=C.tableIsBold,G=void 0!==R&&R,W=C.tableRows,U=C.tableTheme,q=C.tableWiderContent,J=void 0!==q&&q,K=C.theme,L=C.withDivider,Q=void 0!==L&&L,V=e(C,["cardTestId","children","customContent","dividerTheme","headerSize","initialState","isCollapsible","isHeaderClickable","isInteractive","onClick","size","tableContentAlignment","tableDisableStackingOnMobile","tableFirstColumnSecondary","tableGaps","tableIsBold","tableRows","tableTheme","tableWiderContent","theme","withDivider"]),X=r(_),Y=X[0],Z=X[1],$=Array.isArray(W)&&W.length>0,ee=i.Children.count(f)>0,te=$||ee,ie=Boolean(j&&T&&y),re=a((function(){return null!=b?b:V.testId?"productCard-".concat(V.testId):"productCard"}),[b,V.testId]),ae=function(){return Z((function(e){return!e}))},le=function(){j&&ae(),y&&y()},oe=function(e){e.stopPropagation(),ae()},ne=function(){return te?i.createElement("div",{className:"c-productCard__headerExtra"},Q&&i.createElement(u,{theme:o("c-productCard__divider",g)}),$?i.createElement("div",{className:o("c-productCard__table",U)},i.createElement(c,{contentAlignment:B,disableStackingOnMobile:H,firstColumnSecondary:F,gaps:P,isBold:G,widerContent:J},W.map((function(e,t){return i.createElement(m,{key:"productCard-tableRow-".concat(t),firstColumnSecondary:e.firstColumnSecondary,isBold:e.isBold,label:e.label,perex:e.perex,testId:e.testId,theme:e.theme},e.content)})))):null,ee&&i.createElement("div",{className:"c-productCard__customContent"},f)):null};return j?i.createElement(d,{hasCustomTrigger:!0,isCollapsible:!0,header:i.createElement(l,null,i.createElement("div",{onClick:function(e){e.stopPropagation(),ie?null==y||y():le()}},i.createElement(p,t({},V,{size:E})),ne()),!Y&&i.createElement(s,null,i.createElement("div",{className:"c-productCard__collapsible--trigger",id:V.testId?"productCard-".concat(V.testId,"-collapsible-closed"):"productCard-collapsible-closed",onClick:oe},i.createElement(n,{iconName:"arrowDown"})))),isInteractive:T,isOpen:Y,size:z,testId:re,theme:o("c-productCard__position",{"c-card--interactive--open":Y},K),onClick:ie?void 0:le},i.createElement("div",null,v,Y&&i.createElement(s,null,i.createElement("div",{className:"c-productCard__collapsible--trigger",id:V.testId?"productCard-".concat(V.testId,"-collapsible-opened"):"productCard-collapsible-opened",onClick:oe},i.createElement(n,{iconName:"arrowUp"}))))):i.createElement(d,{isInteractive:T,size:z,testId:null!=b?b:V.testId,theme:K,onClick:D?void 0:le},i.createElement("div",{className:o({"c-productCard__clickableHeader":D&&!!y}),onClick:D?y:void 0},i.createElement(p,t({},V,{size:E})),ne()))};export{C as ProductCard};
1
+ import{__rest as e,__assign as t}from'./../../../ext/tslib/tslib.es6.js';import r,{useState as i,useMemo as o,useCallback as a,Fragment as l}from"react";import{useHistory as n}from"react-router-dom";import"../../../utils/getDisplayName.js";import"../../../utils/getIntegerMask.js";import"../../../utils/isFilled.js";import"../../../utils/isNotFilled.js";import"../../../utils/isNotNilNorEmpty.js";import'./../../../ext/diacritic/diacritics.js';import{cx as d}from"../../../utils/classBinder.js";import'./../../../ext/text-mask-addons/dist/textMaskAddons.js';import{Avatar as c}from"../Avatar/Avatar.js";import{Card as s}from"../Card/Card.js";import{CardCustomTrigger as m}from"../Card/_elements_/CardCustomTrigger.js";import{DataTable as u}from"../DataTable/DataTable.js";import{DataTableItem as p}from"../DataTable/DataTableItem.js";import{Divider as C}from"../Divider/Divider.js";import{ProductHeader as b}from"../ProductHeader/ProductHeader.js";var v=function(v){var f=v.cardTestId,h=v.children,k=v.customContent,_=v.dividerTheme,E=v.headerSize,I=void 0===E?"medium":E,g=v.initialState,j=void 0!==g&&g,T=v.isCollapsible,y=void 0!==T&&T,D=v.isHeaderClickable,w=void 0!==D&&D,N=v.isInteractive,S=void 0!==N&&N,A=v.onClick,x=v.size,B=void 0===x?"large":x,z=v.tableContentAlignment,M=void 0===z?"left":z,F=v.tableDisableStackingOnMobile,H=void 0!==F&&F,O=v.tableFirstColumnSecondary,P=void 0===O||O,L=v.tableGaps,R=void 0===L?"small":L,G=v.tableIsBold,W=void 0!==G&&G,K=v.tableRows,U=v.tableTheme,q=v.tableWiderContent,J=void 0!==q&&q,Q=v.theme,V=v.withDivider,X=void 0!==V&&V,Y=e(v,["cardTestId","children","customContent","dividerTheme","headerSize","initialState","isCollapsible","isHeaderClickable","isInteractive","onClick","size","tableContentAlignment","tableDisableStackingOnMobile","tableFirstColumnSecondary","tableGaps","tableIsBold","tableRows","tableTheme","tableWiderContent","theme","withDivider"]),Z=n(),$=i(j),ee=$[0],te=$[1],re=Array.isArray(K)&&K.length>0,ie=r.Children.count(k)>0,oe=re||ie,ae=Boolean(Y.linkTo||Y.externalLink),le=Boolean(A||ae),ne=w&&le,de=Boolean(y&&S&&A&&!ne),ce=o((function(){return null!=f?f:Y.testId?"productCard-".concat(Y.testId):"productCard"}),[f,Y.testId]),se=function(){return te((function(e){return!e}))},me=Y.externalLink,ue=Y.linkTo,pe=a((function(){me?window.open(me,"_blank","noopener,noreferrer"):"function"!=typeof ue?ue&&Z.push(ue):ue()}),[me,Z,ue]),Ce=a((function(){ne&&(A?A():ae&&pe())}),[pe,ae,ne,A]),be=a((function(e){ne&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ce()))}),[Ce,ne]),ve=function(){y&&se(),A&&A()},fe=function(e){e.stopPropagation(),se()},he=function(){return oe?r.createElement("div",{className:"c-productCard__headerExtra"},X&&r.createElement(C,{theme:d("c-productCard__divider",_)}),re?r.createElement("div",{className:d("c-productCard__table",U)},r.createElement(u,{contentAlignment:M,disableStackingOnMobile:H,firstColumnSecondary:P,gaps:R,isBold:W,widerContent:J},K.map((function(e,t){return r.createElement(p,{key:"productCard-tableRow-".concat(t),firstColumnSecondary:e.firstColumnSecondary,isBold:e.isBold,label:e.label,perex:e.perex,testId:e.testId,theme:e.theme},e.content)})))):null,ie&&r.createElement("div",{className:"c-productCard__customContent"},k)):null},ke=function(){var e=ne?{onClick:Ce,onKeyDown:be,role:"button",tabIndex:0}:{};return r.createElement("div",t({},e,{className:d("c-productCard__headerArea",{"c-productCard__headerArea--clickable":ne,"c-productCard__headerArea--withSharedTitleLink":ne&&ae&&!A})}),r.createElement(b,t({},Y,{size:I})),he())};return y?r.createElement(s,{hasCustomTrigger:!0,isCollapsible:!0,header:r.createElement(l,null,ne?ke():r.createElement("div",{onClick:function(e){e.stopPropagation(),de?null==A||A():ve()}},r.createElement(b,t({},Y,{size:I})),he()),!ee&&r.createElement(m,null,r.createElement("div",{className:"c-productCard__collapsible--trigger",id:Y.testId?"productCard-".concat(Y.testId,"-collapsible-closed"):"productCard-collapsible-closed",onClick:fe},r.createElement(c,{iconName:"arrowDown"})))),isInteractive:S,isOpen:ee,size:B,testId:ce,theme:d("c-productCard__position",{"c-card--interactive--open":ee},Q),onClick:ne||de?void 0:ve},r.createElement("div",null,h,ee&&r.createElement(m,null,r.createElement("div",{className:"c-productCard__collapsible--trigger",id:Y.testId?"productCard-".concat(Y.testId,"-collapsible-opened"):"productCard-collapsible-opened",onClick:fe},r.createElement(c,{iconName:"arrowUp"}))))):r.createElement(s,{isInteractive:S,size:B,testId:null!=f?f:Y.testId,theme:Q,onClick:ne?void 0:ve},ke())};export{v as ProductCard};
2
2
  //# sourceMappingURL=ProductCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductCard.js","sources":["../../../../src/components/Components/ProductCard/ProductCard.tsx"],"sourcesContent":[null],"names":["ProductCard","_a","cardTestId","children","customContent","dividerTheme","_b","headerSize","_c","initialState","_d","isCollapsible","_e","isHeaderClickable","_f","isInteractive","onClick","_g","size","_h","tableContentAlignment","_j","tableDisableStackingOnMobile","_k","tableFirstColumnSecondary","_l","tableGaps","_m","tableIsBold","tableRows","tableTheme","_o","tableWiderContent","theme","_p","withDivider","productHeaderProps","__rest","_q","useState","isOpen","setIsOpen","hasTable","Array","isArray","length","hasCustomContent","React","Children","count","hasExtraHeaderContent","separateHeaderAndCollapseClick","Boolean","resolvedCardTestId","useMemo","testId","concat","toggleOpen","prev","handleDefaultClick","handleArrowToggleClick","e","stopPropagation","renderExtraHeaderContent","createElement","className","Divider","cx","DataTable","contentAlignment","disableStackingOnMobile","firstColumnSecondary","gaps","isBold","widerContent","map","row","idx","DataTableItem","key","label","perex","content","Card","hasCustomTrigger","header","Fragment","ProductHeader","__assign","CardCustomTrigger","id","Avatar","iconName","undefined"],"mappings":"04BAiEO,IAAMA,EAAc,SAACC,GAC1B,IAAAC,EAAUD,EAAAC,WACVC,EAAQF,EAAAE,SACRC,EAAaH,EAAAG,cACbC,E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,cAACyB,EAAiB,KAChB1C,EACEiB,cAAA,MAAA,CAAAC,UAAU,sCACVyB,GACEtD,EAAmBmB,OACf,eAAAC,OAAepB,EAAmBmB,OAA2B,uBAC7D,iCAENvC,QAAS4C,IAETb,EAACiB,cAAA2B,EAAO,CAAAC,SAAS,iBAM3B7E,cAAeA,EACfyB,OAAQA,EACRtB,KAAMA,EACNqC,OAAQF,GACRpB,MAAOkC,EAAG,0BAA2B,CAAE,4BAA6B3B,GAAUP,GAC9EjB,QAASmC,QAAiC0C,EAAYlC,IAEtDZ,EAAAiB,cAAA,MAAA,KACG7D,EAEAqC,GACCO,EAAAiB,cAACyB,EAAiB,KAChB1C,EACEiB,cAAA,MAAA,CAAAC,UAAU,sCACVyB,GACEtD,EAAmBmB,OACf,eAAAC,OAAepB,EAAmBmB,OAA2B,uBAC7D,iCAENvC,QAAS4C,IAETb,EAAAiB,cAAC2B,EAAM,CAACC,SAAS,gBAnEzB7C,EAACiB,cAAAmB,EACC,CAAApE,cAAeA,EACfG,KAAMA,EACNqC,OAAQrD,QAAAA,EAAckC,EAAmBmB,OACzCtB,MAAOA,EACPjB,QAAUH,OAAyCgF,EAArBlC,IAE9BZ,EACEiB,cAAA,MAAA,CAAAC,UAAWE,EAAG,CAAE,iCAAkCtD,KAAuBG,IACzEA,QAASH,EAAoBG,OAAU6E,GAEvC9C,EAAAiB,cAACuB,EAAkBC,EAAA,CAAA,EAAApD,GAAoBlB,KAAMX,KAC5CwD,MA8DX"}
1
+ {"version":3,"file":"ProductCard.js","sources":["../../../../src/components/Components/ProductCard/ProductCard.tsx"],"sourcesContent":[null],"names":["ProductCard","_a","cardTestId","children","customContent","dividerTheme","_b","headerSize","_c","initialState","_d","isCollapsible","_e","isHeaderClickable","_f","isInteractive","onClick","_g","size","_h","tableContentAlignment","_j","tableDisableStackingOnMobile","_k","tableFirstColumnSecondary","_l","tableGaps","_m","tableIsBold","tableRows","tableTheme","_o","tableWiderContent","theme","_p","withDivider","productHeaderProps","__rest","history","useHistory","_q","useState","isOpen","setIsOpen","hasTable","Array","isArray","length","hasCustomContent","React","Children","count","hasExtraHeaderContent","hasTitleLink","Boolean","linkTo","externalLink","hasHeaderAction","isWholeHeaderClickable","separateHeaderAndCollapseClick","resolvedCardTestId","useMemo","testId","concat","toggleOpen","prev","executeHeaderNavigation","useCallback","window","open","push","handleWholeHeaderClick","handleWholeHeaderKeyDown","e","key","preventDefault","handleDefaultClick","handleArrowToggleClick","stopPropagation","renderExtraHeaderContent","createElement","className","Divider","cx","DataTable","contentAlignment","disableStackingOnMobile","firstColumnSecondary","gaps","isBold","widerContent","map","row","idx","DataTableItem","label","perex","content","renderHeaderArea","interactiveProps","onKeyDown","role","tabIndex","ProductHeader","__assign","Card","hasCustomTrigger","header","Fragment","CardCustomTrigger","id","Avatar","iconName","undefined"],"mappings":"y8BA2FO,IAAMA,EAAc,SAACC,GAC1B,IAAAC,EAAUD,EAAAC,WACVC,EAAQF,EAAAE,SACRC,EAAaH,EAAAG,cACbC,EAAYJ,EAAAI,aACZC,EAAAL,EAAAM,WAAAA,OAAU,IAAAD,EAAG,SAAQA,EACrBE,EAAAP,EAAAQ,aAAAA,OAAe,IAAAD,GAAKA,EACpBE,EAAqBT,EAAAU,cAArBA,OAAgB,IAAAD,GAAKA,EACrBE,EAAyBX,EAAAY,kBAAzBA,OAAiB,IAAAD,GAAQA,EACzBE,EAAAb,EAAAc,cAAAA,OAAgB,IAAAD,GAAKA,EACrBE,EAAOf,EAAAe,QACPC,EAAAhB,EAAAiB,KAAAA,OAAO,IAAAD,EAAA,QAAOA,EACdE,EAA8BlB,EAAAmB,sBAA9BA,OAAwB,IAAAD,EAAA,OAAMA,EAC9BE,EAAoCpB,EAAAqB,6BAApCA,OAA4B,IAAAD,GAAQA,EACpCE,EAAAtB,EAAAuB,0BAAAA,cAAgCD,EAChCE,EAAAxB,EAAAyB,UAAAA,OAAY,IAAAD,EAAA,QAAOA,EACnBE,EAAmB1B,EAAA2B,YAAnBA,OAAW,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C,kBACA,EAAA/F,eACA,EAAAgG,OACE1D,EAAA+B,cAAC4B,EAAQ,KACNlD,GACCwC,KAEAjD,EAAK+B,cAAA,MAAA,CAAAhE,QA1GoC,SAACyD,GAClDA,EAAEK,kBAEEnB,GACF3C,SAAAA,IAIF4D,IACF,GAkGY3B,EAAA+B,cAACuB,EAAkBC,EAAA,CAAA,EAAApE,GAAoBlB,KAAMX,KAC5CwE,OAIHrC,IACAO,EAAA+B,cAAC6B,EAAiB,KAChB5D,EACE+B,cAAA,MAAA,CAAAC,UAAU,sCACV6B,GACE1E,EAAmB0B,OACf,eAAAC,OAAe3B,EAAmB0B,OAA2B,uBAC7D,iCAEN9C,QAAS6D,IAET5B,EAAC+B,cAAA+B,EAAO,CAAAC,SAAS,iBAM3BjG,cAAeA,EACf2B,OAAQA,GACRxB,KAAMA,EACN4C,OAAQF,GACR3B,MAAOkD,EAAG,0BAA2B,CAAE,4BAA6BzC,IAAUT,GAC9EjB,QAAS0C,IAA0BC,QAAiCsD,EAAYrC,IAEhF3B,EAAA+B,cAAA,MAAA,KACG7E,EAEAuC,IACCO,EAAA+B,cAAC6B,EAAiB,KAChB5D,EACE+B,cAAA,MAAA,CAAAC,UAAU,sCACV6B,GACE1E,EAAmB0B,OACf,eAAAC,OAAe3B,EAAmB0B,OAA2B,uBAC7D,iCAEN9C,QAAS6D,IAET5B,EAAA+B,cAAC+B,EAAM,CAACC,SAAS,gBAjEzB/D,gBAACwD,EAAI,CACH1F,cAAeA,EACfG,KAAMA,EACN4C,OAAQ5D,QAAAA,EAAckC,EAAmB0B,OACzC7B,MAAOA,EACPjB,QAAU0C,QAA8CuD,EAArBrC,IAElCsB,KAiET"}
@@ -5,7 +5,20 @@ import { AvatarSizeType } from '../Avatar';
5
5
  import { ButtonSize } from '../Button';
6
6
  import { CompactButtonsButtonType } from '../CompactButtons';
7
7
  export type ProductHeaderSizeProps = 'small' | 'medium' | 'large' | 'xLarge';
8
- export interface ProductHeaderPropTypes {
8
+ type ProductHeaderClickableProps = {
9
+ /** Makes the whole header area clickable. */
10
+ isHeaderClickable: true;
11
+ /** Click handler for the header area. */
12
+ onHeaderClick?: () => void;
13
+ };
14
+ type ProductHeaderDefaultProps = {
15
+ /** Makes the whole header area clickable. */
16
+ isHeaderClickable?: false;
17
+ /** Cannot be used without `isHeaderClickable`. */
18
+ onHeaderClick?: never;
19
+ };
20
+ type ProductHeaderInteractionProps = ProductHeaderClickableProps | ProductHeaderDefaultProps;
21
+ type ProductHeaderBaseProps = {
9
22
  /**
10
23
  * ProductHeader size variant that sets default sizing for the whole header (title, subtitle, amounts, icon and actions).
11
24
  * You can still override any individual size via `titleSize`, `subtitleSize`, `amountSize`, `secondaryAmountSize`,
@@ -36,9 +49,9 @@ export interface ProductHeaderPropTypes {
36
49
  titleIconSize?: AvatarSizeType;
37
50
  /** Visually hidden prefix rendered before the title (for screen readers). */
38
51
  titleHiddenPrefix?: ReactElement;
39
- /** Link that can be used for title (internal navigation) or a callback function. */
52
+ /** Internal link or callback used by the title. */
40
53
  linkTo?: string | (() => void);
41
- /** External link to open in a new tab on click (title area). */
54
+ /** External link used by the title. */
42
55
  externalLink?: string;
43
56
  /** Secondary text shown under the title in the left column. */
44
57
  subtitle?: string;
@@ -48,9 +61,9 @@ export interface ProductHeaderPropTypes {
48
61
  subtitleSize?: TextSizeType;
49
62
  /** Visually hidden prefix rendered before the subtitle (for screen readers). */
50
63
  subtitleHiddenPrefix?: ReactElement;
51
- /** Main amount value shown in the top-right cell. If amountis not defined,topRightButtons can be rendered instead. */
64
+ /** Main amount value shown in the top-right area. If amount is not defined, topRightButtons can be rendered instead. */
52
65
  amount?: number;
53
- /** Visually hidden prefix rendered before value shown in the top-right cell - usually the main amount (for screen readers). */
66
+ /** Visually hidden prefix rendered before value shown in the top-right area - usually the main amount (for screen readers). */
54
67
  amountHiddenPrefix?: ReactElement;
55
68
  /** Main amount size. */
56
69
  amountSize?: AmountSizeType;
@@ -72,13 +85,13 @@ export interface ProductHeaderPropTypes {
72
85
  amountMaximumFractionDigits?: number;
73
86
  /** Minimum fraction digits for main amount. */
74
87
  amountMinimumFractionDigits?: number;
75
- /** Buttons rendered in the top-right cell (alternative to `amount`). This cell renders either `amount` OR `topRightButtons`, never both. */
88
+ /** Buttons rendered in the top-right area (alternative to `amount`). This area renders either `amount` OR `topRightButtons`, never both. */
76
89
  topRightButtons?: ReactNode | ReactNode[];
77
- /** Content rendered in the top-right cell (alternative to `amount` or `topRightButtons`). This cell renders either `amount` OR `topRightButtons` OR `topRightCustomContent`. */
90
+ /** Content rendered in the top-right area (alternative to `amount` or `topRightButtons`). This area renders either `amount` OR `topRightButtons` OR `topRightCustomContent`. */
78
91
  topRightCustomContent?: ReactNode;
79
- /** Label rendered in the bottom-right cell. Can be rendered alone or before secondary amount. */
92
+ /** Label rendered in the bottom-right area. Can be rendered alone or before secondary amount. */
80
93
  secondaryLabel?: ReactNode;
81
- /** Size of label rendered in the bottom-right cell. Can be rendered alone or before secondary amount. */
94
+ /** Size of label rendered in the bottom-right area. Can be rendered alone or before secondary amount. */
82
95
  secondaryLabelSize?: TextSizeType;
83
96
  /** Secondary amount value rendered next to `secondaryLabel`. */
84
97
  secondaryAmount?: number;
@@ -102,16 +115,18 @@ export interface ProductHeaderPropTypes {
102
115
  secondaryAmountMaximumFractionDigits?: number;
103
116
  /** Minimum fraction digits for secondary amount. */
104
117
  secondaryAmountMinimumFractionDigits?: number;
105
- /** Buttons rendered below the header grid (full width). */
118
+ /** Buttons rendered below the header (full width). */
106
119
  actions?: CompactButtonsButtonType[];
107
- /** Size of buttons rendered below the header grid (full width). */
120
+ /** Size of buttons rendered below the header (full width). */
108
121
  actionsSize?: ButtonSize;
109
- /** Content rendered below the header grid (full width). Can contain any ReactNode, e.g. buttons, additional information, or custom components. */
122
+ /** Content rendered below the header (full width). Can contain any ReactNode, e.g. buttons, additional information, or custom components. */
110
123
  belowHeaderContent?: ReactNode;
111
124
  /** Locale for number formatting (e.g. 'cs-CZ', 'en-US'). Affects both main and secondary amounts. */
112
125
  locale?: string;
113
126
  /** Test ID for testing purposes. */
114
127
  testId?: string;
115
- }
116
- export declare const ProductHeader: ({ actions, actionsSize, amount, amountHiddenPrefix, amountHideIcon, amountIsBold, amountIsInline, amountMaximumFractionDigits, amountMinimumFractionDigits, amountSize, amountType, amountUnitAfter, amountUnitBefore, amountUnitTheme, belowHeaderContent, customSubtitle, customTitle, externalLink, linkTo, locale, secondaryAmount, secondaryAmountHideIcon, secondaryAmountIsBold, secondaryAmountIsInline, secondaryAmountMaximumFractionDigits, secondaryAmountMinimumFractionDigits, secondaryAmountSize, secondaryAmountType, secondaryAmountUnitAfter, secondaryAmountUnitBefore, secondaryAmountUnitTheme, secondaryLabel, secondaryLabelSize, size, subtitle, subtitleHiddenPrefix, subtitleSize, testId, title, titleHiddenPrefix, titleIconBackgroundColor, titleIconBackgroundCustom, titleIconColor, titleIconName, titleIconSize, titleIconText, titleSize, titleVisual, titleWithoutMargin, topRightButtons, topRightCustomContent }: ProductHeaderPropTypes) => React.JSX.Element;
128
+ };
129
+ export type ProductHeaderPropTypes = ProductHeaderBaseProps & ProductHeaderInteractionProps;
130
+ export declare const ProductHeader: ({ actions, actionsSize, amount, amountHiddenPrefix, amountHideIcon, amountIsBold, amountIsInline, amountMaximumFractionDigits, amountMinimumFractionDigits, amountSize, amountType, amountUnitAfter, amountUnitBefore, amountUnitTheme, belowHeaderContent, customSubtitle, customTitle, externalLink, isHeaderClickable, linkTo, locale, onHeaderClick, secondaryAmount, secondaryAmountHideIcon, secondaryAmountIsBold, secondaryAmountIsInline, secondaryAmountMaximumFractionDigits, secondaryAmountMinimumFractionDigits, secondaryAmountSize, secondaryAmountType, secondaryAmountUnitAfter, secondaryAmountUnitBefore, secondaryAmountUnitTheme, secondaryLabel, secondaryLabelSize, size, subtitle, subtitleHiddenPrefix, subtitleSize, testId, title, titleHiddenPrefix, titleIconBackgroundColor, titleIconBackgroundCustom, titleIconColor, titleIconName, titleIconSize, titleIconText, titleSize, titleVisual, titleWithoutMargin, topRightButtons, topRightCustomContent }: ProductHeaderPropTypes) => React.JSX.Element;
131
+ export {};
117
132
  //# sourceMappingURL=ProductHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/ProductHeader/ProductHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAA;AAGnF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAG/D,OAAO,EAAU,cAAc,EAAE,UAAU,EAAQ,YAAY,EAAS,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC3G,OAAO,EAAU,cAAc,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAgB,UAAU,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAkB,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAG5E,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;AAqD5E,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,IAAI,CAAC,EAAE,sBAAsB,CAAA;IAI7B,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,kBAAkB;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,uDAAuD;IACvD,aAAa,CAAC,EAAE,YAAY,CAAA;IAC5B,wDAAwD;IACxD,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,uDAAuD;IACvD,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B,kEAAkE;IAClE,wBAAwB,CAAC,EAAE,SAAS,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AC,EAAE,SAAS,CAAA;IAIjC,iGAAiG;IACjG,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B,yGAAyG;IACzG,kBAAkB,CAAC,EAAE,YAAY,CAAA;IACjC,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6BAA6B;IAC7B,mBAAmB,CAAC,EAAE,cAAc,CAAA;IACpC,6BAA6B;IAC7B,mBAAmB,CAAC,EAAE,UAAU,CAAA;IAChC,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,sCAAsC;IACtC,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,gDAAgD;IAChD,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,0CAA0C;IAC1C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,yCAAyC;IACzC,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,uCAAuC;IACvC,wBAAwB,CAAC,EAAE,KAAK,CAAA;IAChC,oDAAoD;IACpD,oCAAoC,CAAC,EAAE,MAAM,CAAA;IAC7C,oDAAoD;IACpD,oCAAoC,CAAC,EAAE,MAAM,CAAA;IAG7C,2DAA2D;IAC3D,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAA;IACpC,mEAAmE;IACnE,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,kJAAkJ;IAClJ,kBAAkB,CAAC,EAAE,SAAS,CAAA;IAI9B,qGAAqG;IACrG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,aAAa,25BAqDvB,sBAAsB,sBAgOxB,CAAA"}
1
+ {"version":3,"file":"ProductHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/ProductHeader/ProductHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAA;AAGnF,OAAO,EAA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ACzC,gLAAgL;IAChL,qBAAqB,CAAC,EAAE,SAAS,CAAA;IAIjC,iGAAiG;IACjG,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B,yGAAyG;IACzG,kBAAkB,CAAC,EAAE,YAAY,CAAA;IACjC,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6BAA6B;IAC7B,mBAAmB,CAAC,EAAE,cAAc,CAAA;IACpC,6BAA6B;IAC7B,mBAAmB,CAAC,EAAE,UAAU,CAAA;IAChC,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,sCAAsC;IACtC,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,gDAAgD;IAChD,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,0CAA0C;IAC1C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,yCAAyC;IACzC,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,uCAAuC;IACvC,wBAAwB,CAAC,EAAE,KAAK,CAAA;IAChC,oDAAoD;IACpD,oCAAoC,CAAC,EAAE,MAAM,CAAA;IAC7C,oDAAoD;IACpD,oCAAoC,CAAC,EAAE,MAAM,CAAA;IAI7C,sDAAsD;IACtD,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAA;IACpC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,6IAA6I;IAC7I,kBAAkB,CAAC,EAAE,SAAS,CAAA;IAI9B,qGAAqG;IACrG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,GAAG,6BAA6B,CAAA;AAE3F,eAAO,MAAM,aAAa,67BAuDvB,sBAAsB,sBAkTxB,CAAA"}
@@ -1,2 +1,2 @@
1
- import e,{useCallback as t}from"react";import{useHistory as o}from"react-router-dom";import"../../../utils/getDisplayName.js";import"../../../utils/getIntegerMask.js";import"../../../utils/isFilled.js";import"../../../utils/isNotFilled.js";import"../../../utils/isNotNilNorEmpty.js";import'./../../../ext/diacritic/diacritics.js';import{cx as i}from"../../../utils/classBinder.js";import'./../../../ext/text-mask-addons/dist/textMaskAddons.js';import'./../../../ext/tslib/tslib.es6.js';import{Flex as n}from"../../Layout/Flex/Flex.js";import"../Button/Button.js";import{ButtonsGroup as r}from"../Button/ButtonsGroup.js";import"../../../contexts/MobilePanelContext.js";import'./../../../ext/cuid/index.js';import{Amount as a}from"../../Typography/Amount/Amount.js";import{Text as l}from"../../Typography/Text/Text.js";import{Title as s}from"../../Typography/Title/Title.js";import{Avatar as m}from"../Avatar/Avatar.js";import"../ButtonTooltip/ButtonTooltip.js";import"../../../contexts/CardContext.js";import"../../../contexts/FormGroupContext.js";import"../../../contexts/ModalContext.js";import"../../../contexts/Select2Context.js";import"../../../contexts/TabsContext.js";import"react-slick";import"../Collapse/Collapse.js";import{CompactButtons as c}from"../CompactButtons/CompactButtons.js";import"../../../contexts/ContentTableContext.js";import"../ContentTable/ContentTableRow.js";import"../DataTable/DataTable.js";import'./../../../ext/lodash/_baseToString.js';import'./../../../ext/react-text-mask/dist/reactTextMask.js';import"../Dropdown/_elements_/DropdownDivider.js";import"../Dropdown/_elements_/DropdownItem.js";import"../Dropdown/_elements_/DropdownMenu.js";import"../Dropdown/_elements_/DropdownInfoText.js";import"../Dropdown/_elements_/DropdownLoading.js";import{Link as d}from"../Link/Link.js";import"react-dom";import"../SuperModal/SuperModal.context.js";import"../../Form/Autocomplete/Autocomplete.js";import'./../../../ext/react-device-detect/dist/lib.js';import"../../Form/FileUpload/_parts_/MergeImageCards.js";import"../../Form/Select/_elements_/Select2CategorisedOptions.js";import"../../Form/Select/_elements_/Select2Options.js";import"../../Form/Slider/Slider.js";var u=function(u){var p=u.actions,_=u.actionsSize,g=u.amount,y=u.amountHiddenPrefix,x=u.amountHideIcon,S=void 0!==x&&x,j=u.amountIsBold,H=void 0===j||j,z=u.amountIsInline,b=u.amountMaximumFractionDigits,v=void 0===b?2:b,f=u.amountMinimumFractionDigits,h=void 0===f?2:f,I=u.amountSize,C=u.amountType,A=u.amountUnitAfter,E=u.amountUnitBefore,T=u.amountUnitTheme,D=u.belowHeaderContent,L=u.customSubtitle,N=u.customTitle,B=u.externalLink,F=u.linkTo,k=u.locale,w=u.secondaryAmount,M=u.secondaryAmountHideIcon,U=void 0!==M&&M,V=u.secondaryAmountIsBold,P=u.secondaryAmountIsInline,O=u.secondaryAmountMaximumFractionDigits,R=void 0===O?2:O,W=u.secondaryAmountMinimumFractionDigits,G=void 0===W?2:W,q=u.secondaryAmountSize,J=u.secondaryAmountType,K=u.secondaryAmountUnitAfter,Q=u.secondaryAmountUnitBefore,X=u.secondaryAmountUnitTheme,Y=u.secondaryLabel,Z=u.secondaryLabelSize,$=u.size,ee=void 0===$?"medium":$,te=u.subtitle,oe=u.subtitleHiddenPrefix,ie=u.subtitleSize,ne=u.testId,re=u.title,ae=u.titleHiddenPrefix,le=u.titleIconBackgroundColor,se=void 0===le?"bgBrandDefault":le,me=u.titleIconBackgroundCustom,ce=u.titleIconColor,de=u.titleIconName,ue=u.titleIconSize,pe=u.titleIconText,_e=u.titleSize,ge=void 0===_e?"h2":_e,ye=u.titleVisual,xe=u.titleWithoutMargin,Se=void 0===xe||xe,je=u.topRightButtons,He=u.topRightCustomContent,ze=o(),be=t((function(e){"preventDefault"in e&&e.preventDefault(),"function"==typeof F?F():F&&ze.push(F)}),[ze,F]),ve=function(e){switch(e){case"small":return{amountSize:"small",secondaryAmountSize:"xSmall",titleIconSize:"medium",actionsSize:"small"};case"medium":default:return{titleVisual:"h5",subtitleSize:"small",amountSize:"large",secondaryAmountSize:"small",titleIconSize:"medium",actionsSize:"small",secondaryLabelSize:"small"};case"large":return{titleVisual:"h4",subtitleSize:"small",amountSize:"xLarge",secondaryAmountSize:"small",titleIconSize:"large",secondaryLabelSize:"small"};case"xLarge":return{titleVisual:"h3",amountSize:"xLarge",titleIconSize:"xLarge"}}}(ee),fe=null!=ye?ye:ve.titleVisual,he=null!=ie?ie:ve.subtitleSize,Ie=null!=Z?Z:ve.secondaryLabelSize,Ce=null!=I?I:ve.amountSize,Ae=null!=q?q:ve.secondaryAmountSize,Ee=null!=ue?ue:ve.titleIconSize,Te=null!=_?_:ve.actionsSize,De="small"===ee&&!I,Le="small"===ee&&!q,Ne="xLarge"===ee&&!q,Be=N||re,Fe=!!L||"string"==typeof te,ke=!!de||!!pe,we=e.Children.count(He)>0,Me=e.Children.count(je)>0,Ue=we,Ve=!Ue&&Me,Pe=!Ue&&!Ve&&"number"==typeof g,Oe=Ue||Ve||Pe,Re=!!Y||"number"==typeof w,We=!!(null==p?void 0:p.length),Ge=e.Children.count(D)>0,qe=function(){return F||B?e.createElement(d,{ariaLabel:re,"data-testid":ne?"productHeader-link-".concat(ne):void 0,linkUrl:B||("string"==typeof F?F:"#"),target:B?"_blank":void 0,theme:"c-productHeader__titleLink",onClick:B?void 0:be},e.createElement(s,{isWithoutMargin:Se,size:ge,theme:i("c-productHeader__title",{"c-productHeader__title--customVisual":!!ye}),visual:fe},ae&&e.createElement("span",{className:"u-vHide"},ae),Be)):e.createElement(s,{isWithoutMargin:Se,size:ge,theme:i("c-productHeader__title",{"c-productHeader__title--customVisual":!!ye}),visual:fe},ae&&e.createElement("span",{className:"u-vHide"},ae),Be)};return!(ke||Fe||Oe||Re||We||Ge)?e.createElement("div",{className:"c-productHeader c-productHeader--titleOnly","data-testid":ne},qe()):e.createElement("div",{className:i("c-productHeader",{"c-productHeader--withTitleIcon":ke,"c-productHeader--small":"small"===ee,"c-productHeader--xLarge":"xLarge"===ee}),"data-testid":ne},e.createElement("div",{className:"c-productHeader__grid"},ke?e.createElement("div",{className:"c-productHeader__gridIcon"},e.createElement(m,{backgroundColor:se,backgroundCustom:me,color:ce,iconName:de,size:Ee,text:pe})):null,e.createElement("div",{className:"c-productHeader__gridTitle"},qe()),e.createElement("div",{className:"c-productHeader__gridSubtitle"},Fe?L?e.createElement(e.Fragment,null,oe&&e.createElement("span",{className:"u-vHide"},oe),L):e.createElement(l,{size:he,theme:i("c-productHeader__subtitle",{"c-productHeader__subtitle--customSize":!!ie}),type:"secondary"},oe&&e.createElement("span",{className:"u-vHide"},oe),te):null),Oe?e.createElement("div",{className:"c-productHeader__gridAmount"},Ue?He:null,Ve?e.createElement(r,null,je):null,Pe?e.createElement(e.Fragment,null,y&&e.createElement("span",{className:"u-vHide"},y),e.createElement(a,{amount:g,hideIcon:S,isBold:H,isInline:z,locale:k,maximumFractionDigits:v,minimumFractionDigits:h,size:Ce,theme:i("c-productHeader__amount",{"c-productHeader__amount--small":De}),type:C,unitAfter:A,unitBefore:E,unitTheme:T})):null):null,Re?e.createElement("div",{className:"c-productHeader__gridSecondary"},Y?e.createElement(n,{alignItems:"baseline",direction:"row",justifyContent:"end",theme:"c-productHeader__secondary"},e.createElement(l,{component:"span",size:Ie,theme:i("c-productHeader__secondaryLabel",{"c-productHeader__secondaryLabel--customSize":!!Z})},Y),"number"==typeof w?e.createElement(a,{amount:w,hideIcon:U,isBold:V,isInline:P,locale:k,maximumFractionDigits:R,minimumFractionDigits:G,size:Ae,theme:i("c-productHeader__amount",{"c-productHeader__amount--small":Le,"c-productHeader__secondaryAmount--xLarge":Ne}),type:J,unitAfter:K,unitBefore:Q,unitTheme:i(X,{"c-productHeader__secondaryAmount--xLarge":Ne})}):null):null):null),We?e.createElement("div",{className:"c-productHeader__actions"},e.createElement(c,{buttons:p,size:Te})):null,Ge?e.createElement("div",{className:"c-productHeader__below"},D):null)};export{u as ProductHeader};
1
+ import{__assign as e}from'./../../../ext/tslib/tslib.es6.js';import t,{useCallback as o}from"react";import{useHistory as i}from"react-router-dom";import"../../../utils/getDisplayName.js";import"../../../utils/getIntegerMask.js";import"../../../utils/isFilled.js";import"../../../utils/isNotFilled.js";import"../../../utils/isNotNilNorEmpty.js";import'./../../../ext/diacritic/diacritics.js';import{cx as n}from"../../../utils/classBinder.js";import'./../../../ext/text-mask-addons/dist/textMaskAddons.js';import{Flex as a}from"../../Layout/Flex/Flex.js";import"../Button/Button.js";import{ButtonsGroup as r}from"../Button/ButtonsGroup.js";import"../../../contexts/MobilePanelContext.js";import'./../../../ext/cuid/index.js';import{Amount as l}from"../../Typography/Amount/Amount.js";import{Text as c}from"../../Typography/Text/Text.js";import{Title as s}from"../../Typography/Title/Title.js";import{Avatar as m}from"../Avatar/Avatar.js";import"../ButtonTooltip/ButtonTooltip.js";import"../../../contexts/CardContext.js";import"../../../contexts/FormGroupContext.js";import"../../../contexts/ModalContext.js";import"../../../contexts/Select2Context.js";import"../../../contexts/TabsContext.js";import"react-slick";import"../Collapse/Collapse.js";import{CompactButtons as d}from"../CompactButtons/CompactButtons.js";import"../../../contexts/ContentTableContext.js";import"../ContentTable/ContentTableRow.js";import"../DataTable/DataTable.js";import'./../../../ext/lodash/_baseToString.js';import'./../../../ext/react-text-mask/dist/reactTextMask.js';import"../Dropdown/_elements_/DropdownDivider.js";import"../Dropdown/_elements_/DropdownItem.js";import"../Dropdown/_elements_/DropdownMenu.js";import"../Dropdown/_elements_/DropdownInfoText.js";import"../Dropdown/_elements_/DropdownLoading.js";import{Link as u}from"../Link/Link.js";import"react-dom";import"../SuperModal/SuperModal.context.js";import"../../Form/Autocomplete/Autocomplete.js";import'./../../../ext/react-device-detect/dist/lib.js';import"../../Form/FileUpload/_parts_/MergeImageCards.js";import"../../Form/Select/_elements_/Select2CategorisedOptions.js";import"../../Form/Select/_elements_/Select2Options.js";import"../../Form/Slider/Slider.js";var p=function(p){var _=p.actions,y=p.actionsSize,f=p.amount,g=p.amountHiddenPrefix,H=p.amountHideIcon,b=void 0!==H&&H,v=p.amountIsBold,x=void 0===v||v,j=p.amountIsInline,S=p.amountMaximumFractionDigits,h=void 0===S?2:S,z=p.amountMinimumFractionDigits,C=void 0===z?2:z,E=p.amountSize,I=p.amountType,k=p.amountUnitAfter,T=p.amountUnitBefore,A=p.amountUnitTheme,L=p.belowHeaderContent,D=p.customSubtitle,N=p.customTitle,B=p.externalLink,F=p.isHeaderClickable,w=void 0!==F&&F,M=p.linkTo,U=p.locale,V=p.onHeaderClick,P=p.secondaryAmount,W=p.secondaryAmountHideIcon,R=void 0!==W&&W,O=p.secondaryAmountIsBold,G=p.secondaryAmountIsInline,K=p.secondaryAmountMaximumFractionDigits,q=void 0===K?2:K,J=p.secondaryAmountMinimumFractionDigits,Q=void 0===J?2:J,X=p.secondaryAmountSize,Y=p.secondaryAmountType,Z=p.secondaryAmountUnitAfter,$=p.secondaryAmountUnitBefore,ee=p.secondaryAmountUnitTheme,te=p.secondaryLabel,oe=p.secondaryLabelSize,ie=p.size,ne=void 0===ie?"medium":ie,ae=p.subtitle,re=p.subtitleHiddenPrefix,le=p.subtitleSize,ce=p.testId,se=p.title,me=p.titleHiddenPrefix,de=p.titleIconBackgroundColor,ue=void 0===de?"bgBrandDefault":de,pe=p.titleIconBackgroundCustom,_e=p.titleIconColor,ye=p.titleIconName,fe=p.titleIconSize,ge=p.titleIconText,He=p.titleSize,be=void 0===He?"h2":He,ve=p.titleVisual,xe=p.titleWithoutMargin,je=void 0===xe||xe,Se=p.topRightButtons,he=p.topRightCustomContent,ze=i(),Ce=function(e){switch(e){case"small":return{amountSize:"small",secondaryAmountSize:"xSmall",titleIconSize:"medium",actionsSize:"small"};case"medium":default:return{titleVisual:"h5",subtitleSize:"small",amountSize:"large",secondaryAmountSize:"small",titleIconSize:"medium",actionsSize:"small",secondaryLabelSize:"small"};case"large":return{titleVisual:"h4",subtitleSize:"small",amountSize:"xLarge",secondaryAmountSize:"small",titleIconSize:"large",secondaryLabelSize:"small"};case"xLarge":return{titleVisual:"h3",amountSize:"xLarge",titleIconSize:"xLarge"}}}(ne),Ee=null!=ve?ve:Ce.titleVisual,Ie=null!=le?le:Ce.subtitleSize,ke=null!=oe?oe:Ce.secondaryLabelSize,Te=null!=E?E:Ce.amountSize,Ae=null!=X?X:Ce.secondaryAmountSize,Le=null!=fe?fe:Ce.titleIconSize,De=null!=y?y:Ce.actionsSize,Ne="small"===ne&&!E,Be="small"===ne&&!X,Fe="xLarge"===ne&&!X,we=N||se,Me=!!D||"string"==typeof ae,Ue=!!ye||!!ge,Ve=t.Children.count(he)>0,Pe=t.Children.count(Se)>0,We=Ve,Re=!We&&Pe,Oe=!We&&!Re&&"number"==typeof f,Ge=We||Re||Oe,Ke=!!te||"number"==typeof P,qe=!!(null==_?void 0:_.length),Je=t.Children.count(L)>0,Qe=!(Ue||Me||Ge||Ke||qe||Je),Xe=Boolean(M||B),Ye=Boolean(V||Xe),Ze=w&&Ye,$e=o((function(){"function"!=typeof M?M&&ze.push(M):M()}),[ze,M]),et=o((function(){B&&window.open(B,"_blank","noopener,noreferrer")}),[B]),tt=o((function(){B?et():M&&$e()}),[et,$e,B,M]),ot=o((function(e){"preventDefault"in e&&e.preventDefault(),$e()}),[$e]),it=o((function(){Ze&&(V?V():Xe&&tt())}),[tt,Xe,Ze,V]),nt=o((function(e){Ze&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),it()))}),[it,Ze]),at=function(){return M||B?t.createElement(u,{allowEventPropagation:!1,ariaLabel:se,"data-testid":ce?"productHeader-link-".concat(ce):void 0,linkUrl:B||("string"==typeof M?M:"#"),target:B?"_blank":void 0,theme:"c-productHeader__titleLink",onClick:B?void 0:ot},t.createElement(s,{isWithoutMargin:je,size:be,theme:n("c-productHeader__title",{"c-productHeader__title--customVisual":!!ve}),visual:Ee},me&&t.createElement("span",{className:"u-vHide"},me),we)):t.createElement(s,{isWithoutMargin:je,size:be,theme:n("c-productHeader__title",{"c-productHeader__title--customVisual":!!ve}),visual:Ee},me&&t.createElement("span",{className:"u-vHide"},me),we)},rt=Ze?{onClick:it,onKeyDown:nt,role:"button",tabIndex:0}:{};if(Qe)return t.createElement("div",e({},rt,{className:n("c-productHeader c-productHeader--titleOnly",{"c-productHeader--headerClickable":Ze,"c-productHeader--headerClickableWithTitleLink":Ze&&Xe}),"data-testid":ce}),at());var lt=t.createElement(t.Fragment,null,t.createElement("div",{className:"c-productHeader__colTitle"},at()),Me?t.createElement("div",{className:"c-productHeader__colSubtitle"},D?t.createElement(t.Fragment,null,re&&t.createElement("span",{className:"u-vHide"},re),D):t.createElement(c,{size:Ie,theme:n("c-productHeader__subtitle",{"c-productHeader__subtitle--customSize":!!le}),type:"secondary"},re&&t.createElement("span",{className:"u-vHide"},re),ae)):null);return t.createElement("div",e({},rt,{className:n("c-productHeader",{"c-productHeader--withTitleIcon":Ue,"c-productHeader--small":"small"===ne,"c-productHeader--xLarge":"xLarge"===ne,"c-productHeader--headerClickable":Ze,"c-productHeader--headerClickableWithTitleLink":Ze&&Xe}),"data-testid":ce}),t.createElement("div",{className:"c-productHeader__layout"},Ue?t.createElement("div",{className:"c-productHeader__colLeft"},t.createElement("div",{className:"c-productHeader__colIcon"},t.createElement(m,{backgroundColor:ue,backgroundCustom:pe,color:_e,iconName:ye,size:Le,text:ge})),t.createElement("div",{className:"c-productHeader__colLeftInner"},lt)):t.createElement("div",{className:"c-productHeader__colLeft"},lt),Ge||Ke?t.createElement("div",{className:"c-productHeader__colRight"},Ge?t.createElement("div",null,We?he:null,Re?t.createElement(r,null,Se):null,Oe?t.createElement(t.Fragment,null,g&&t.createElement("span",{className:"u-vHide"},g),t.createElement(l,{amount:f,hideIcon:b,isBold:x,isInline:j,locale:U,maximumFractionDigits:h,minimumFractionDigits:C,size:Te,theme:n("c-productHeader__amount",{"c-productHeader__amount--small":Ne}),type:I,unitAfter:k,unitBefore:T,unitTheme:A})):null):null,Ke?t.createElement("div",null,te?t.createElement(a,{alignItems:"baseline",direction:"row",justifyContent:"end",theme:"c-productHeader__secondary"},t.createElement(c,{component:"span",size:ke,theme:n("c-productHeader__secondaryLabel",{"c-productHeader__secondaryLabel--customSize":!!oe})},te),"number"==typeof P?t.createElement(l,{amount:P,hideIcon:R,isBold:O,isInline:G,locale:U,maximumFractionDigits:q,minimumFractionDigits:Q,size:Ae,theme:n("c-productHeader__amount",{"c-productHeader__amount--small":Be,"c-productHeader__secondaryAmount--xLarge":Fe}),type:Y,unitAfter:Z,unitBefore:$,unitTheme:n(ee,{"c-productHeader__secondaryAmount--xLarge":Fe})}):null):null):null):null),qe?t.createElement("div",{className:"c-productHeader__actions"},t.createElement(d,{buttons:_,size:De})):null,Je?t.createElement("div",{className:"c-productHeader__below"},L):null)};export{p as ProductHeader};
2
2
  //# sourceMappingURL=ProductHeader.js.map