@chayns-components/core 5.0.21 → 5.0.25

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 (42) hide show
  1. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +5 -1
  2. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  3. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js +37 -0
  4. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  5. package/lib/cjs/components/grouped-image/GroupedImage.styles.js +18 -20
  6. package/lib/cjs/components/grouped-image/GroupedImage.styles.js.map +1 -1
  7. package/lib/cjs/components/list/List.js +97 -37
  8. package/lib/cjs/components/list/List.js.map +1 -1
  9. package/lib/cjs/components/list/list-item/ListItem.js +0 -9
  10. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  11. package/lib/cjs/components/number-input/NumberInput.js +213 -132
  12. package/lib/cjs/components/number-input/NumberInput.js.map +1 -1
  13. package/lib/cjs/components/progress-bar/ProgressBar.js +181 -66
  14. package/lib/cjs/components/progress-bar/ProgressBar.js.map +1 -1
  15. package/lib/cjs/components/progress-bar/ProgressBar.styles.js +36 -1
  16. package/lib/cjs/components/progress-bar/ProgressBar.styles.js.map +1 -1
  17. package/lib/cjs/utils/numberInput.js +1 -0
  18. package/lib/cjs/utils/numberInput.js.map +1 -1
  19. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +6 -2
  20. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  21. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js +38 -1
  22. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.styles.js.map +1 -1
  23. package/lib/esm/components/grouped-image/GroupedImage.styles.js +18 -20
  24. package/lib/esm/components/grouped-image/GroupedImage.styles.js.map +1 -1
  25. package/lib/esm/components/list/List.js +97 -37
  26. package/lib/esm/components/list/List.js.map +1 -1
  27. package/lib/esm/components/list/list-item/ListItem.js +0 -9
  28. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  29. package/lib/esm/components/number-input/NumberInput.js +213 -132
  30. package/lib/esm/components/number-input/NumberInput.js.map +1 -1
  31. package/lib/esm/components/progress-bar/ProgressBar.js +173 -68
  32. package/lib/esm/components/progress-bar/ProgressBar.js.map +1 -1
  33. package/lib/esm/components/progress-bar/ProgressBar.styles.js +36 -1
  34. package/lib/esm/components/progress-bar/ProgressBar.styles.js.map +1 -1
  35. package/lib/esm/utils/numberInput.js +1 -0
  36. package/lib/esm/utils/numberInput.js.map +1 -1
  37. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.styles.d.ts +7 -3
  38. package/lib/types/components/grouped-image/GroupedImage.styles.d.ts +3 -1
  39. package/lib/types/components/list/List.d.ts +0 -1
  40. package/lib/types/components/progress-bar/ProgressBar.d.ts +9 -1
  41. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +7 -0
  42. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ColorSchemeProvider.styles.js","names":["getAvailableColorList","styled","StyledColorSchemeProvider","div","theme","map","colorName","colorNameRgb","primary"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.styles.ts"],"sourcesContent":["import { getAvailableColorList } from '@chayns/colors';\nimport { styled } from 'styled-components';\nimport type { WithTheme } from './ColorSchemeProvider';\n\ntype ColorSchemeProviderProps = WithTheme<unknown>;\n\n// noinspection CssUnresolvedCustomProperty\nexport const StyledColorSchemeProvider = styled.div<ColorSchemeProviderProps>`\n color: var(--chayns-color--text);\n\n ${({ theme }: ColorSchemeProviderProps) =>\n getAvailableColorList().map((colorName: string) => {\n const colorNameRgb = `${colorName}-rgb`;\n return [\n `--chayns-color--${colorName}: ${theme[colorName]};`,\n `--chayns-color-rgb--${colorName}: ${theme[colorNameRgb]};`,\n ];\n })}\n\n ${({ theme }: ColorSchemeProviderProps) =>\n `\n --chayns-color--header-bar: ${theme['header-bar'] ?? theme.primary};\n `}\n\n // ToDo: Remove .h1...\n .color-scheme-provider :is(h1,.h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6):first-child {\n margin-top: 0;\n }\n`;\n"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,MAAM,QAAQ,mBAAmB;AAK1C;AACA,OAAO,MAAMC,yBAAyB,GAAGD,MAAM,CAACE,GAA6B;AAC7E;AACA;AACA,MAAM,CAAC;EAAEC;AAAgC,CAAC,KAClCJ,qBAAqB,CAAC,CAAC,CAACK,GAAG,CAAEC,SAAiB,IAAK;EAC/C,MAAMC,YAAY,GAAG,GAAGD,SAAS,MAAM;EACvC,OAAO,CACH,mBAAmBA,SAAS,KAAKF,KAAK,CAACE,SAAS,CAAC,GAAG,EACpD,uBAAuBA,SAAS,KAAKF,KAAK,CAACG,YAAY,CAAC,GAAG,CAC9D;AACL,CAAC,CAAC;AACV;AACA,MAAM,CAAC;EAAEH;AAAgC,CAAC,KAClC;AACR,sCAAsCA,KAAK,CAAC,YAAY,CAAC,IAAIA,KAAK,CAACI,OAAO;AAC1E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ColorSchemeProvider.styles.js","names":["getAvailableColorList","css","styled","StyledColorSchemeProvider","div","theme","map","colorName","colorNameRgb","primary","$browser"],"sources":["../../../../src/components/color-scheme-provider/ColorSchemeProvider.styles.ts"],"sourcesContent":["import { getAvailableColorList } from '@chayns/colors';\nimport { css, styled } from 'styled-components';\nimport type { WithTheme } from './ColorSchemeProvider';\nimport { BrowserName } from '../../types/chayns';\n\ntype ColorSchemeProviderProps = WithTheme<{ $browser: BrowserName }>;\n\n// noinspection CssUnresolvedCustomProperty\nexport const StyledColorSchemeProvider = styled.div<ColorSchemeProviderProps>`\n color: var(--chayns-color--text);\n\n ${({ theme }: ColorSchemeProviderProps) =>\n getAvailableColorList().map((colorName: string) => {\n const colorNameRgb = `${colorName}-rgb`;\n return [\n `--chayns-color--${colorName}: ${theme[colorName]};`,\n `--chayns-color-rgb--${colorName}: ${theme[colorNameRgb]};`,\n ];\n })}\n\n ${({ theme }: ColorSchemeProviderProps) =>\n `\n --chayns-color--header-bar: ${theme['header-bar'] ?? theme.primary};\n `}\n\n // ToDo: Remove .h1...\n .color-scheme-provider :is(h1,.h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6):first-child {\n margin-top: 0;\n }\n\n // Styles for custom scrollbar\n .chayns-scrollbar {\n ${({ $browser, theme }: ColorSchemeProviderProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 10px;\n height: 10px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n width: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n background-clip: padding-box;\n border: solid 3px transparent;\n }\n\n &::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n `}\n }\n`;\n"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,GAAG,EAAEC,MAAM,QAAQ,mBAAmB;AAM/C;AACA,OAAO,MAAMC,yBAAyB,GAAGD,MAAM,CAACE,GAA6B;AAC7E;AACA;AACA,MAAM,CAAC;EAAEC;AAAgC,CAAC,KAClCL,qBAAqB,CAAC,CAAC,CAACM,GAAG,CAAEC,SAAiB,IAAK;EAC/C,MAAMC,YAAY,GAAG,GAAGD,SAAS,MAAM;EACvC,OAAO,CACH,mBAAmBA,SAAS,KAAKF,KAAK,CAACE,SAAS,CAAC,GAAG,EACpD,uBAAuBA,SAAS,KAAKF,KAAK,CAACG,YAAY,CAAC,GAAG,CAC9D;AACL,CAAC,CAAC;AACV;AACA,MAAM,CAAC;EAAEH;AAAgC,CAAC,KAClC;AACR,sCAAsCA,KAAK,CAAC,YAAY,CAAC,IAAIA,KAAK,CAACI,OAAO;AAC1E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,CAAC;EAAEC,QAAQ;EAAEL;AAAgC,CAAC,KAC5CK,QAAQ,KAAK,SAAS,GAChBT,GAAG;AACrB,8CAA8CI,KAAK,CAAC,UAAU,CAAC;AAC/D;AACA,mBAAmB,GACDJ,GAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmDI,KAAK,CAAC,UAAU,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,CAAC","ignoreList":[]}
@@ -9,7 +9,24 @@ export const StyledGroupedImage = styled.div`
9
9
  $height
10
10
  }) => $height}px;
11
11
  `;
12
- export const StyledGroupImageElement = styled.div`
12
+ export const StyledGroupImageElement = styled.div.attrs(({
13
+ $isSecondImage,
14
+ $hasMultipleImages,
15
+ $hasCornerImage,
16
+ $uuid
17
+ }) => {
18
+ let clipPath;
19
+ if ($isSecondImage && $hasCornerImage || !$isSecondImage && !$hasMultipleImages && $hasCornerImage) {
20
+ clipPath = `url(#care-of-mask--${$uuid})`;
21
+ } else if (!$isSecondImage && $hasMultipleImages) {
22
+ clipPath = `url(#second-image-mask--${$uuid})`;
23
+ }
24
+ return {
25
+ style: {
26
+ clipPath
27
+ }
28
+ };
29
+ })`
13
30
  aspect-ratio: 1;
14
31
  border-radius: ${({
15
32
  $shouldShowRoundImage
@@ -46,25 +63,6 @@ export const StyledGroupImageElement = styled.div`
46
63
  left: 0;
47
64
  `}
48
65
 
49
- ${({
50
- $isSecondImage,
51
- $hasMultipleImages,
52
- $hasCornerImage,
53
- $uuid
54
- }) => {
55
- if ($isSecondImage && $hasCornerImage || !$isSecondImage && !$hasMultipleImages && $hasCornerImage) {
56
- return css`
57
- clip-path: url(${`#care-of-mask--${$uuid}`});
58
- `;
59
- }
60
- if (!$isSecondImage && $hasMultipleImages) {
61
- return css`
62
- clip-path: url(${`#second-image-mask--${$uuid}`});
63
- `;
64
- }
65
- return '';
66
- }}
67
-
68
66
  ${({
69
67
  $background,
70
68
  $shouldPreventBackground,
@@ -1 +1 @@
1
- {"version":3,"file":"GroupedImage.styles.js","names":["styled","css","StyledGroupedImage","div","$height","StyledGroupImageElement","$shouldShowRoundImage","$hasMultipleImages","$isSecondImage","$hasCornerImage","$uuid","$background","$shouldPreventBackground","theme","StyledCornerImage","img","StyledCornerElement","span"],"sources":["../../../../src/components/grouped-image/GroupedImage.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { CSSProperties } from 'react';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGroupedImageProps = WithTheme<{\n $height: CSSProperties['height'];\n}>;\n\nexport const StyledGroupedImage = styled.div<StyledGroupedImageProps>`\n flex: 0 0 auto;\n height: ${({ $height }) => $height}px;\n position: relative;\n width: ${({ $height }) => $height}px;\n`;\n\ntype StyledImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $isSecondImage?: boolean;\n $shouldPreventBackground?: boolean;\n $shouldShowRoundImage?: boolean;\n $hasCornerImage: boolean;\n $hasMultipleImages: boolean;\n $uuid: string;\n}>;\n\nexport const StyledGroupImageElement = styled.div<StyledImageProps>`\n aspect-ratio: 1;\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : '0')};\n position: absolute;\n overflow: hidden;\n\n ${({ $hasMultipleImages, $isSecondImage }) => {\n if (!$hasMultipleImages) {\n return css`\n height: 100%;\n `;\n }\n\n if ($isSecondImage) {\n return css`\n height: 80%;\n `;\n }\n\n return css`\n height: 76%;\n `;\n }}\n\n ${({ $isSecondImage }) =>\n $isSecondImage\n ? css`\n bottom: 0;\n right: 0;\n `\n : css`\n top: 0;\n left: 0;\n `}\n\n ${({ $isSecondImage, $hasMultipleImages, $hasCornerImage, $uuid }) => {\n if (\n ($isSecondImage && $hasCornerImage) ||\n (!$isSecondImage && !$hasMultipleImages && $hasCornerImage)\n ) {\n return css`\n clip-path: url(${`#care-of-mask--${$uuid}`});\n `;\n }\n\n if (!$isSecondImage && $hasMultipleImages) {\n return css`\n clip-path: url(${`#second-image-mask--${$uuid}`});\n `;\n }\n\n return '';\n }}\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n \n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n`;\n\ntype StyledCornerImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldPreventBackground?: boolean;\n $hasMultipleImages: boolean;\n}>;\n\nexport const StyledCornerImage = styled.img<StyledCornerImageProps>`\n aspect-ratio: 1;\n bottom: 0;\n height: ${({ $hasMultipleImages }) => ($hasMultipleImages ? '28%' : '38%')};\n position: absolute;\n right: 0;\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n`;\n\nexport const StyledCornerElement = styled.span`\n height: 18px;\n width: 18px;\n position: absolute;\n bottom: 0;\n right: -5px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n max-height: 100%;\n max-width: 100%;\n display: block;\n }\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAQ/C,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,GAA4B;AACrE;AACA,cAAc,CAAC;EAAEC;AAAQ,CAAC,KAAKA,OAAO;AACtC;AACA,aAAa,CAAC;EAAEA;A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D,OAAO,MAAMC,iBAAiB,GAAGd,MAAM,CAACe,GAA2B;AACnE;AACA;AACA,cAAc,CAAC;EAAER;AAAmB,CAAC,KAAMA,kBAAkB,GAAG,KAAK,GAAG,KAAM;AAC9E;AACA;AACA;AACA,MAAM,CAAC;EAAEI,WAAW;EAAEC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzBX,GAAG;AACX,0BAA0BU,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,mBAAmB,GAAGhB,MAAM,CAACiB,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"GroupedImage.styles.js","names":["styled","css","StyledGroupedImage","div","$height","StyledGroupImageElement","attrs","$isSecondImage","$hasMultipleImages","$hasCornerImage","$uuid","clipPath","style","$shouldShowRoundImage","$background","$shouldPreventBackground","theme","StyledCornerImage","img","StyledCornerElement","span"],"sources":["../../../../src/components/grouped-image/GroupedImage.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { CSSProperties } from 'react';\nimport { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledGroupedImageProps = WithTheme<{\n $height: CSSProperties['height'];\n}>;\n\nexport const StyledGroupedImage = styled.div<StyledGroupedImageProps>`\n flex: 0 0 auto;\n height: ${({ $height }) => $height}px;\n position: relative;\n width: ${({ $height }) => $height}px;\n`;\n\ntype StyledImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $isSecondImage?: boolean;\n $shouldPreventBackground?: boolean;\n $shouldShowRoundImage?: boolean;\n $hasCornerImage: boolean;\n $hasMultipleImages: boolean;\n $uuid: string;\n}>;\n\nexport const StyledGroupImageElement = styled.div.attrs<StyledImageProps>(\n ({ $isSecondImage, $hasMultipleImages, $hasCornerImage, $uuid }) => {\n let clipPath: string | undefined;\n if (\n ($isSecondImage && $hasCornerImage) ||\n (!$isSecondImage && !$hasMultipleImages && $hasCornerImage)\n ) {\n clipPath = `url(#care-of-mask--${$uuid})`;\n } else if (!$isSecondImage && $hasMultipleImages) {\n clipPath = `url(#second-image-mask--${$uuid})`;\n }\n\n return {\n style: {\n clipPath,\n },\n };\n },\n)`\n aspect-ratio: 1;\n border-radius: ${({ $shouldShowRoundImage }) => ($shouldShowRoundImage ? '50%' : '0')};\n position: absolute;\n overflow: hidden;\n\n ${({ $hasMultipleImages, $isSecondImage }) => {\n if (!$hasMultipleImages) {\n return css`\n height: 100%;\n `;\n }\n\n if ($isSecondImage) {\n return css`\n height: 80%;\n `;\n }\n\n return css`\n height: 76%;\n `;\n }}\n\n ${({ $isSecondImage }) =>\n $isSecondImage\n ? css`\n bottom: 0;\n right: 0;\n `\n : css`\n top: 0;\n left: 0;\n `}\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n \n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n`;\n\ntype StyledCornerImageProps = WithTheme<{\n $background?: CSSProperties['background'];\n $shouldPreventBackground?: boolean;\n $hasMultipleImages: boolean;\n}>;\n\nexport const StyledCornerImage = styled.img<StyledCornerImageProps>`\n aspect-ratio: 1;\n bottom: 0;\n height: ${({ $hasMultipleImages }) => ($hasMultipleImages ? '28%' : '38%')};\n position: absolute;\n right: 0;\n\n ${({ $background, $shouldPreventBackground, theme }) =>\n !$shouldPreventBackground &&\n css`\n background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`};\n box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset;\n `}\n`;\n\nexport const StyledCornerElement = styled.span`\n height: 18px;\n width: 18px;\n position: absolute;\n bottom: 0;\n right: -5px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n max-height: 100%;\n max-width: 100%;\n display: block;\n }\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAQ/C,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,GAA4B;AACrE;AACA,cAAc,CAAC;EAAEC;AAAQ,CAAC,KAAKA,OAAO;AACtC;AACA,aAAa,CAAC;EAAEA;AAAQ,CAAC,KAAKA,OAAO;AACrC,CAAC;AAYD,OAAO,MAAMC,uBAAuB,GAAGL,MAAM,CAACG,GAAG,CAACG,KAAK,CACnD,CAAC;EAAEC,cAAc;EAAEC,kBAAkB;EAAEC,eAAe;EAAEC;AAAM,CAAC,KAAK;EAChE,IAAIC,QAA4B;EAChC,IACKJ,cAAc,IAAIE,eAAe,IACjC,CAACF,cAAc,IAAI,CAACC,kBAAkB,IAAIC,eAAgB,EAC7D;IACEE,QAAQ,GAAG,sBAAsBD,KAAK,GAAG;EAC7C,CAAC,MAAM,IAAI,CAACH,cAAc,IAAIC,kBAAkB,EAAE;IAC9CG,QAAQ,GAAG,2BAA2BD,KAAK,GAAG;EAClD;EAEA,OAAO;IACHE,KAAK,EAAE;MACHD;IACJ;EACJ,CAAC;AACL,CACJ,CAAC;AACD;AACA,qBAAqB,CAAC;EAAEE;AAAsB,CAAC,KAAMA,qBAAqB,GAAG,KAAK,GAAG,GAAI;AACzF;AACA;AACA;AACA,MAAM,CAAC;EAAEL,kBAAkB;EAAED;AAAe,CAAC,KAAK;EAC1C,IAAI,CAACC,kBAAkB,EAAE;IACrB,OAAOP,GAAG;AACtB;AACA,aAAa;EACL;EAEA,IAAIM,cAAc,EAAE;IAChB,OAAON,GAAG;AACtB;AACA,aAAa;EACL;EAEA,OAAOA,GAAG;AAClB;AACA,SAAS;AACL,CAAC;AACL;AACA,MAAM,CAAC;EAAEM;AAAe,CAAC,KACjBA,cAAc,GACRN,GAAG;AACjB;AACA;AACA,eAAe,GACDA,GAAG;AACjB;AACA;AACA,eAAe;AACf;AACA,MAAM,CAAC;EAAEa,WAAW;EAAEC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzBd,GAAG;AACX,0BAA0Ba,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAQD,OAAO,MAAMC,iBAAiB,GAAGjB,MAAM,CAACkB,GAA2B;AACnE;AACA;AACA,cAAc,CAAC;EAAEV;AAAmB,CAAC,KAAMA,kBAAkB,GAAG,KAAK,GAAG,KAAM;AAC9E;AACA;AACA;AACA,MAAM,CAAC;EAAEM,WAAW;EAAEC,wBAAwB;EAAEC;AAAM,CAAC,KAC/C,CAACD,wBAAwB,IACzBd,GAAG;AACX,0BAA0Ba,WAAW,IAAI,QAAQE,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,QAAQ;AACrF,yCAAyCA,KAAK,CAAC,SAAS,CAAC;AACzD,SAAS;AACT,CAAC;AAED,OAAO,MAAMG,mBAAmB,GAAGnB,MAAM,CAACoB,IAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,52 +1,112 @@
1
+ import { c as _c } from "react-compiler-runtime";
1
2
  import { AnimatePresence, MotionConfig } from 'motion/react';
2
3
  import React, { useCallback, useMemo, useState } from 'react';
3
4
  export const ListContext = /*#__PURE__*/React.createContext({
4
- incrementExpandableItemCount: () => () => {},
5
5
  isAnyItemExpandable: false,
6
6
  isWrapped: false,
7
7
  openItemUuid: undefined,
8
8
  updateOpenItemUuid: () => {}
9
9
  });
10
10
  ListContext.displayName = 'ListContext';
11
- const List = ({
12
- children,
13
- isWrapped = false
14
- }) => {
11
+ const List = t0 => {
12
+ "use memo";
13
+
14
+ const $ = _c(13);
15
+ const {
16
+ children,
17
+ isWrapped: t1
18
+ } = t0;
19
+ const isWrapped = t1 === undefined ? false : t1;
15
20
  const [openItemUuid, setOpenItemUuid] = useState(undefined);
16
- const [expandableItemCount, setExpandableItemCount] = useState(0);
17
- const updateOpenItemUuid = useCallback((uuid, {
18
- shouldOnlyOpen
19
- } = {}) => {
20
- setOpenItemUuid(currentOpenItemUuid => {
21
- if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {
22
- return undefined;
23
- }
24
- return uuid;
25
- });
26
- }, [setOpenItemUuid]);
27
- const incrementExpandableItemCount = useCallback(() => {
28
- setExpandableItemCount(count => count + 1);
29
- return () => {
30
- setExpandableItemCount(count => count - 1);
21
+ let t2;
22
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23
+ t2 = (uuid, t3) => {
24
+ const {
25
+ shouldOnlyOpen
26
+ } = t3 === undefined ? {} : t3;
27
+ setOpenItemUuid(currentOpenItemUuid => {
28
+ if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {
29
+ return;
30
+ }
31
+ return uuid;
32
+ });
31
33
  };
32
- }, [setExpandableItemCount]);
33
- const providerValue = useMemo(() => ({
34
- incrementExpandableItemCount,
35
- isAnyItemExpandable: expandableItemCount > 0,
36
- isWrapped,
37
- openItemUuid,
38
- updateOpenItemUuid
39
- }), [expandableItemCount, incrementExpandableItemCount, isWrapped, openItemUuid, updateOpenItemUuid]);
40
- return /*#__PURE__*/React.createElement(ListContext.Provider, {
41
- value: providerValue
42
- }, /*#__PURE__*/React.createElement(MotionConfig, {
43
- transition: {
44
- type: 'tween'
45
- }
46
- }, /*#__PURE__*/React.createElement(AnimatePresence, {
47
- initial: false
48
- }, children)));
34
+ $[0] = t2;
35
+ } else {
36
+ t2 = $[0];
37
+ }
38
+ const updateOpenItemUuid = t2;
39
+ const hasExpandableChildren = _temp;
40
+ let t3;
41
+ if ($[1] !== children) {
42
+ t3 = hasExpandableChildren(children);
43
+ $[1] = children;
44
+ $[2] = t3;
45
+ } else {
46
+ t3 = $[2];
47
+ }
48
+ let t4;
49
+ if ($[3] !== isWrapped || $[4] !== openItemUuid || $[5] !== t3) {
50
+ t4 = {
51
+ isAnyItemExpandable: t3,
52
+ isWrapped,
53
+ openItemUuid,
54
+ updateOpenItemUuid
55
+ };
56
+ $[3] = isWrapped;
57
+ $[4] = openItemUuid;
58
+ $[5] = t3;
59
+ $[6] = t4;
60
+ } else {
61
+ t4 = $[6];
62
+ }
63
+ const providerValue = t4;
64
+ let t5;
65
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
66
+ t5 = {
67
+ type: "tween"
68
+ };
69
+ $[7] = t5;
70
+ } else {
71
+ t5 = $[7];
72
+ }
73
+ let t6;
74
+ if ($[8] !== children) {
75
+ t6 = /*#__PURE__*/React.createElement(MotionConfig, {
76
+ transition: t5
77
+ }, /*#__PURE__*/React.createElement(AnimatePresence, {
78
+ initial: false
79
+ }, children));
80
+ $[8] = children;
81
+ $[9] = t6;
82
+ } else {
83
+ t6 = $[9];
84
+ }
85
+ let t7;
86
+ if ($[10] !== providerValue || $[11] !== t6) {
87
+ t7 = /*#__PURE__*/React.createElement(ListContext.Provider, {
88
+ value: providerValue
89
+ }, t6);
90
+ $[10] = providerValue;
91
+ $[11] = t6;
92
+ $[12] = t7;
93
+ } else {
94
+ t7 = $[12];
95
+ }
96
+ return t7;
49
97
  };
50
98
  List.displayName = 'List';
51
99
  export default List;
100
+ function _temp(node) {
101
+ let found = false;
102
+ React.Children.forEach(node, child => {
103
+ if (found) {
104
+ return;
105
+ }
106
+ if (/*#__PURE__*/React.isValidElement(child) && child.props.children !== undefined) {
107
+ found = true;
108
+ }
109
+ });
110
+ return found;
111
+ }
52
112
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","names":["AnimatePresence","MotionConfig","React","useCallback","useMemo","useState","ListContext","createContext","incrementExpandableItemCount","isAnyItemExpandable","isWrapped","openItemUuid","undefined","updateOpenItemUuid","displayName","List","children","setOpenItemUuid","expandableItemCount","setExpandableItemCount","uuid","shouldOnlyOpen","currentOpenItemUuid","count","providerValue","createElement","Provider","value","transition","type","initial"],"sources":["../../../../src/components/list/List.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'motion/react';\nimport React, { FC, ReactNode, useCallback, useMemo, useState } from 'react';\n\ninterface IListContext {\n incrementExpandableItemCount: () => () => void;\n isAnyItemExpandable: boolean;\n isWrapped: boolean;\n openItemUuid: string | undefined;\n updateOpenItemUuid: (uuid: string, options?: { shouldOnlyOpen?: boolean }) => void;\n}\n\nexport const ListContext = React.createContext<IListContext>({\n incrementExpandableItemCount: () => () => {},\n isAnyItemExpandable: false,\n isWrapped: false,\n openItemUuid: undefined,\n updateOpenItemUuid: () => {},\n});\n\nListContext.displayName = 'ListContext';\n\ntype ListProps = {\n /**\n * The items of the list\n */\n children: ReactNode;\n /**\n * This value must be set for nested AccordionGroup components. This adjusts the style of\n * the head and the padding of the content accordions.\n */\n isWrapped?: boolean;\n};\n\nconst List: FC<ListProps> = ({ children, isWrapped = false }) => {\n const [openItemUuid, setOpenItemUuid] = useState<IListContext['openItemUuid']>(undefined);\n const [expandableItemCount, setExpandableItemCount] = useState<number>(0);\n\n const updateOpenItemUuid = useCallback<IListContext['updateOpenItemUuid']>(\n (uuid, { shouldOnlyOpen } = {}) => {\n setOpenItemUuid((currentOpenItemUuid) => {\n if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {\n return undefined;\n }\n\n return uuid;\n });\n },\n [setOpenItemUuid],\n );\n\n const incrementExpandableItemCount = useCallback(() => {\n setExpandableItemCount((count) => count + 1);\n\n return () => {\n setExpandableItemCount((count) => count - 1);\n };\n }, [setExpandableItemCount]);\n\n const providerValue = useMemo<IListContext>(\n () => ({\n incrementExpandableItemCount,\n isAnyItemExpandable: expandableItemCount > 0,\n isWrapped,\n openItemUuid,\n updateOpenItemUuid,\n }),\n [\n expandableItemCount,\n incrementExpandableItemCount,\n isWrapped,\n openItemUuid,\n updateOpenItemUuid,\n ],\n );\n\n return (\n <ListContext.Provider value={providerValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AnimatePresence initial={false}>{children}</AnimatePresence>\n </MotionConfig>\n </ListContext.Provider>\n );\n};\n\nList.displayName = 'List';\n\nexport default List;\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAC5D,OAAOC,KAAK,IAAmBC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAU5E,OAAO,MAAMC,WAAW,gBAAGJ,KAAK,CAACK,aAAa,CAAe;EACzDC,4BAA4B,EAAEA,CAAA,KAAM,MAAM,CAAC,CAAC;EAC5CC,mBAAmB,EAAE,KAAK;EAC1BC,SAAS,EAAE,KAAK;EAChBC,YAAY,EAAEC,SAAS;EACvBC,kBAAkB,EAAEA,CAAA,KAAM,CAAC;AAC/B,CAAC,CAAC;AAEFP,WAAW,CAACQ,WAAW,GAAG,aAAa;AAcvC,MAAMC,IAAmB,GAAGA,CAAC;EAAEC,QAAQ;EAAEN,SAAS,GAAG;AAAM,CAAC,KAAK;EAC7D,MAAM,CAACC,YAAY,EAAEM,eAAe,CAAC,GAAGZ,QAAQ,CAA+BO,SAAS,CAAC;EACzF,MAAM,CAACM,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGd,QAAQ,CAAS,CAAC,CAAC;EAEzE,MAAMQ,kBAAkB,GAAGV,WAAW,CAClC,CAACiB,IAAI,EAAE;IAAEC;EAAe,CAAC,GAAG,CAAC,CAAC,KAAK;IAC/BJ,eAAe,CAAEK,mBAAmB,IAAK;MACrC,IAAIA,mBAAmB,KAAKF,IAAI,IAAIC,cAAc,KAAK,IAAI,EAAE;QACzD,OAAOT,SAAS;MACpB;MAEA,OAAOQ,IAAI;IACf,CAAC,CAAC;EACN,CAAC,EACD,CAACH,eAAe,CACpB,CAAC;EAED,MAAMT,4BAA4B,GAAGL,WAAW,CAAC,MAAM;IACnDgB,sBAAsB,CAAEI,KAAK,IAAKA,KAAK,GAAG,CAAC,CAAC;IAE5C,OAAO,MAAM;MACTJ,sBAAsB,CAAEI,KAAK,IAAKA,KAAK,GAAG,CAAC,CAAC;IAChD,CAAC;EACL,CAAC,EAAE,CAACJ,sBAAsB,CAAC,CAAC;EAE5B,MAAMK,aAAa,GAAGpB,OAAO,CACzB,OAAO;IACHI,4BAA4B;IAC5BC,mBAAmB,EAAES,mBAAmB,GAAG,CAAC;IAC5CR,SAAS;IACTC,YAAY;IACZE;EACJ,CAAC,CAAC,EACF,CACIK,mBAAmB,EACnBV,4BAA4B,EAC5BE,SAAS,EACTC,YAAY,EACZE,kBAAkB,CAE1B,CAAC;EAED,oBACIX,KAAA,CAAAuB,aAAA,CAACnB,WAAW,CAACoB,QAAQ;IAACC,KAAK,EAAEH;EAAc,gBACvCtB,KAAA,CAAAuB,aAAA,CAACxB,YAAY;IAAC2B,UAAU,EAAE;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBACxC3B,KAAA,CAAAuB,aAAA,CAACzB,eAAe;IAAC8B,OAAO,EAAE;EAAM,GAAEd,QAA0B,CAClD,CACI,CAAC;AAE/B,CAAC;AAEDD,IAAI,CAACD,WAAW,GAAG,MAAM;AAEzB,eAAeC,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"List.js","names":["AnimatePresence","MotionConfig","React","useCallback","useMemo","useState","ListContext","createContext","isAnyItemExpandable","isWrapped","openItemUuid","undefined","updateOpenItemUuid","displayName","List","t0","$","_c","children","t1","setOpenItemUuid","t2","Symbol","for","uuid","t3","shouldOnlyOpen","currentOpenItemUuid","hasExpandableChildren","_temp","t4","providerValue","t5","type","t6","createElement","transition","initial","t7","Provider","node","found","Children","forEach","child","isValidElement","props"],"sources":["../../../../src/components/list/List.tsx"],"sourcesContent":["import { AnimatePresence, MotionConfig } from 'motion/react';\nimport React, { FC, ReactNode, useCallback, useMemo, useState } from 'react';\n\ninterface IListContext {\n isAnyItemExpandable: boolean;\n isWrapped: boolean;\n openItemUuid: string | undefined;\n updateOpenItemUuid: (uuid: string, options?: { shouldOnlyOpen?: boolean }) => void;\n}\n\nexport const ListContext = React.createContext<IListContext>({\n isAnyItemExpandable: false,\n isWrapped: false,\n openItemUuid: undefined,\n updateOpenItemUuid: () => {},\n});\n\nListContext.displayName = 'ListContext';\n\ntype ListProps = {\n /**\n * The items of the list\n */\n children: ReactNode;\n /**\n * This value must be set for nested AccordionGroup components. This adjusts the style of\n * the head and the padding of the content accordions.\n */\n isWrapped?: boolean;\n};\n\nconst List: FC<ListProps> = ({ children, isWrapped = false }) => {\n 'use memo';\n\n const [openItemUuid, setOpenItemUuid] = useState<IListContext['openItemUuid']>(undefined);\n\n const updateOpenItemUuid = useCallback<IListContext['updateOpenItemUuid']>(\n (uuid, { shouldOnlyOpen } = {}) => {\n setOpenItemUuid((currentOpenItemUuid) => {\n if (currentOpenItemUuid === uuid && shouldOnlyOpen !== true) {\n return undefined;\n }\n\n return uuid;\n });\n },\n [setOpenItemUuid],\n );\n\n const hasExpandableChildren = (node: ReactNode): boolean => {\n let found = false;\n React.Children.forEach(node, (child) => {\n if (found) return;\n if (\n React.isValidElement<{\n children?: ReactNode;\n }>(child) &&\n child.props.children !== undefined\n ) {\n found = true;\n }\n });\n return found;\n };\n\n const providerValue = useMemo<IListContext>(\n () => ({\n isAnyItemExpandable: hasExpandableChildren(children),\n isWrapped,\n openItemUuid,\n updateOpenItemUuid,\n }),\n [children, isWrapped, openItemUuid, updateOpenItemUuid],\n );\n\n return (\n <ListContext.Provider value={providerValue}>\n <MotionConfig transition={{ type: 'tween' }}>\n <AnimatePresence initial={false}>{children}</AnimatePresence>\n </MotionConfig>\n </ListContext.Provider>\n );\n};\n\nList.displayName = 'List';\n\nexport default List;\n"],"mappings":";AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAC5D,OAAOC,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AAtB,CAAA;EAAA;EAAA,OAJvBsB,EAIuB;AAAA,CAE9B;AAEDxB,IAAI,CAACD,WAAW,GAAG,MAAM;AAEzB,eAAeC,IAAI;AAvDS,SAAAe,MAAAW,IAAA;EAmBpB,IAAAC,KAAA,GAAY,KAAK;EACjBvC,KAAK,CAAAwC,QAAS,CAAAC,OAAQ,CAACH,IAAI,EAAEI,KAAA;IACzB,IAAIH,KAAK;MAAA;IAAA;IACT,IACI,aAAAvC,KAAK,CAAA2C,cAAe,CAEjBD,KAC8B,CAAC,IAAlCA,KAAK,CAAAE,KAAM,CAAA5B,QAAS,KAAKP,SAAS;MAElC8B,KAAA,CAAAA,CAAA,CAAQA,IAAI;IAAP;EACR,CACJ,CAAC;EAAA,OACKA,KAAK;AAAA","ignoreList":[]}
@@ -48,7 +48,6 @@ const ListItem = /*#__PURE__*/forwardRef(({
48
48
  cornerElement
49
49
  }, ref) => {
50
50
  const {
51
- incrementExpandableItemCount,
52
51
  isAnyItemExpandable,
53
52
  isWrapped,
54
53
  openItemUuid,
@@ -91,14 +90,6 @@ const ListItem = /*#__PURE__*/forwardRef(({
91
90
  onClick(event);
92
91
  }
93
92
  }, [isExpandable, onClick, updateOpenItemUuid, uuid]);
94
- useEffect(() => {
95
- if (isExpandable && !shouldHideIndicator) {
96
- // The incrementExpandableItemCount function returns a cleanup
97
- // function to decrement expandableItemCount if component unmounts
98
- return incrementExpandableItemCount();
99
- }
100
- return undefined;
101
- }, [incrementExpandableItemCount, isExpandable, shouldHideIndicator]);
102
93
  useEffect(() => {
103
94
  if (isDefaultOpen) {
104
95
  updateOpenItemUuid(uuid, {
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.js","names":["AnimatePresence","motion","React","forwardRef","useCallback","useContext","useEffect","useImperativeHandle","useRef","useState","useUuid","AccordionContext","AreaContextProvider","AreaContext","ListContext","ListItemBody","ListItemHead","StyledListItem","StyledListItemTooltip","Tooltip","LIST_ITEM_HTML_TAG","ListItem","backgroundColor","careOfLocationId","children","cornerImage","hoverItem","icons","imageBackground","images","isDefaultOpen","isOpen","isTitleGreyed","leftElements","onClick","onClose","onLongPress","onOpen","rightElements","shouldShowTooltipOnTitleOverflow","shouldForceBackground","shouldForceBottomLine","shouldForceHover","shouldHideBottomLine","shouldOpenImageOnClick","shouldHideImageOrIconBackground","shouldHideIndicator","shouldPreventLayoutAnimation","shouldRenderClosed","shouldShowRoundImageOrIcon","shouldShowSeparatorBelow","subtitle","title","onImageError","onSizeChange","titleElement","shouldDisableAnimation","cornerElement","ref","incrementExpandableItemCount","isAnyItemExpandable","isWrapped","openItemUuid","updateOpenItemUuid","isParentAccordionWrapped","areaProvider","isInitialRenderRef","listItemRef","uuid","isExpandable","undefined","isItemOpen","onCloseRef","onOpenRef","shouldEnableTooltip","setShouldEnableTooltip","titleWidth","setTitleWidth","titleMaxWidth","setTitleMaxWidth","current","handleHeadClick","event","shouldOnlyOpen","isClickable","handleTitleWidthChange","width","maxWidth","createElement","as","animate","height","opacity","className","exit","initial","key","layout","$backgroundColor","$isClickable","$isInAccordion","shouldDisableListItemPadding","$isOpen","$isWrapped","$shouldChangeColor","shouldChangeColor","$shouldForceBackground","$shouldForceBottomLine","$shouldHideBottomLine","$shouldHideIndicator","$shouldShowSeparatorBelow","shouldUseFullWidth","isDisabled","item","style","cursor","onTitleWidthChange","id","shouldHideBody","displayName"],"sources":["../../../../../src/components/list/list-item/ListItem.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport React, {\n CSSProperties,\n forwardRef,\n MouseEventHandler,\n ReactNode,\n SyntheticEvent,\n TouchEventHandler,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IListItemRightElements } from '../../../types/list';\nimport { AccordionContext } from '../../accordion/Accordion';\nimport AreaContextProvider, { AreaContext } from '../../area-provider/AreaContextProvider';\nimport { ListContext } from '../List';\nimport ListItemBody from './list-item-body/ListItemBody';\nimport ListItemHead from './list-item-head/ListItemHead';\nimport { StyledListItem, StyledListItemTooltip } from './ListItem.styles';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { LIST_ITEM_HTML_TAG } from '../../../constants/list';\n\nexport type ListItemElements = [ReactNode, ...ReactNode[]];\n\nexport interface ListItemSize {\n titleWidth: number;\n titleMaxWidth: number;\n}\n\nexport type ListItemProps = {\n /**\n * The background color of the `ListItem`.\n */\n backgroundColor?: CSSProperties['backgroundColor'];\n /**\n * DEPRECATED: Use `cornerImage` instead.\n */\n careOfLocationId?: number;\n /**\n * The content of the `ListItem` body. When the `ListItem` has children,\n * it can be opened and also gets an icon as an indicator automatically.\n */\n children?: ReactNode;\n /**\n * The image that is displayed in the bottom right corner of the grouped image of list item.\n */\n cornerImage?: string;\n /**\n * Element that is displayed when hovering over the `ListItem` on the right\n * side. On mobile devices, this element is not displayed.\n */\n hoverItem?: ReactNode;\n /**\n * The FontAwesome or tobit icons to render like an image on the left side\n * of the header. Multiple icons are stacked. See the `Icon` component\n * documentation for more information.\n */\n icons?: string[];\n /**\n * The background of the image. This is only used if images are passed.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * A list of image URLs that are displayed on the left side of the header.\n * If multiple URLs are passed, the image is assembled from the first three\n * image URLs as a puzzle.\n */\n images?: string[];\n /**\n * This can be used to automatically expand the `ListItem` during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This overrides the internal opening state of the item and makes it controlled.\n */\n isOpen?: boolean;\n /**\n * Whether the ListItem locks disabled but has full functionality.\n */\n isTitleGreyed?: boolean;\n /**\n * Elements that are displayed on the left side of the header. If multiple\n * elements are specified, they are displayed one aside the other.\n */\n leftElements?: ListItemElements;\n /**\n * Function to be executed when the header of the `ListItem` was clicked\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is closed.\n */\n onClose?: VoidFunction;\n /**\n * Function to be executed when the header of the `ListItem` is pressed for\n * 400 milliseconds.\n */\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is opened.\n */\n onOpen?: VoidFunction;\n /**\n * Elements that are displayed on the right side of the header. If multiple\n * elements are specified, they are displayed one below the other.\n */\n rightElements?: IListItemRightElements;\n /**\n * This will force the background color of the ListItem to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * Whether the line should be forced, e.g., so that it is also displayed if the item is the last element in the list.\n */\n shouldForceBottomLine?: boolean;\n /**\n * Whether the hover item should be forced.\n */\n shouldForceHover?: boolean;\n /**\n * Whether the bottom line should be hidden.\n */\n shouldHideBottomLine?: boolean;\n /**\n * Whether the background and border of the shape on which the image or icon of the element is displayed should be\n * hidden.\n */\n shouldHideImageOrIconBackground?: boolean;\n /**\n * If the `ListItem` is expandable, the indicator is displayed on the left\n * side of the header. If this property is set to true, the indicator is\n * hidden.\n */\n shouldHideIndicator?: boolean;\n /**\n * Whether the image should be opened on click.\n */\n shouldOpenImageOnClick?: boolean;\n /**\n * Whether the layout animation should be prevented. This is useful when the\n * `ListItem` is used in a list with a lot of items and the layout animation\n * is not desired.\n */\n shouldPreventLayoutAnimation?: boolean;\n /**\n * This will render the ListItem closed on the first render.\n */\n shouldRenderClosed?: boolean;\n /**\n * Whether the image or icon should be displayed in a round shape. This should always be used for images of persons.\n */\n shouldShowRoundImageOrIcon?: boolean;\n /**\n * Whether a separator should be displayed below this item. In this case, the border is displayed thicker than normal.\n */\n shouldShowSeparatorBelow?: boolean;\n /**\n * Whether a Tooltip should be displayed on hover if the title is cut.\n */\n shouldShowTooltipOnTitleOverflow?: boolean;\n /**\n * Subtitle of the `ListItem` displayed in the head below the title\n */\n subtitle?: ReactNode;\n /**\n * Title of the `ListItem` displayed in the head\n */\n title: ReactNode;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * Whether the ListItem Animation should be disabled.\n */\n shouldDisableAnimation?: boolean;\n /**\n * Optional Element to display in the right corner of the image\n */\n cornerElement?: ReactNode;\n /**\n * Optional handler for image load errors.\n */\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n /**\n * Function to be executed if the size are changed.\n */\n onSizeChange?: (sizes: ListItemSize) => void;\n};\n\nexport type ListItemRef = ListItemSize;\n\nconst ListItem = forwardRef<ListItemRef, ListItemProps>(\n (\n {\n backgroundColor,\n careOfLocationId,\n children,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isDefaultOpen,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onClose,\n onLongPress,\n onOpen,\n rightElements,\n shouldShowTooltipOnTitleOverflow = false,\n shouldForceBackground = false,\n shouldForceBottomLine = false,\n shouldForceHover = false,\n shouldHideBottomLine = false,\n shouldOpenImageOnClick = false,\n shouldHideImageOrIconBackground,\n shouldHideIndicator = false,\n shouldPreventLayoutAnimation = false,\n shouldRenderClosed = false,\n shouldShowRoundImageOrIcon,\n shouldShowSeparatorBelow = false,\n subtitle,\n title,\n onImageError,\n onSizeChange,\n titleElement,\n shouldDisableAnimation = false,\n cornerElement,\n },\n ref,\n ) => {\n const {\n incrementExpandableItemCount,\n isAnyItemExpandable,\n isWrapped,\n openItemUuid,\n updateOpenItemUuid,\n } = useContext(ListContext);\n\n const { isWrapped: isParentAccordionWrapped } = useContext(AccordionContext);\n\n const areaProvider = useContext(AreaContext);\n\n const isInitialRenderRef = useRef(true);\n\n const listItemRef = useRef<HTMLDivElement>(null);\n\n const uuid = useUuid();\n\n const isExpandable = children !== undefined;\n const isItemOpen = isOpen ?? openItemUuid === uuid;\n\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n\n const [shouldEnableTooltip, setShouldEnableTooltip] = useState(false);\n const [titleWidth, setTitleWidth] = useState(0);\n const [titleMaxWidth, setTitleMaxWidth] = useState(0);\n\n useEffect(() => {\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [isOpen, onClose, onOpen]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isItemOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isItemOpen]);\n\n const handleHeadClick = useCallback<MouseEventHandler<HTMLDivElement>>(\n (event) => {\n if (isExpandable) {\n updateOpenItemUuid(uuid);\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n },\n [isExpandable, onClick, updateOpenItemUuid, uuid],\n );\n\n useEffect(() => {\n if (isExpandable && !shouldHideIndicator) {\n // The incrementExpandableItemCount function returns a cleanup\n // function to decrement expandableItemCount if component unmounts\n return incrementExpandableItemCount();\n }\n\n return undefined;\n }, [incrementExpandableItemCount, isExpandable, shouldHideIndicator]);\n\n useEffect(() => {\n if (isDefaultOpen) {\n updateOpenItemUuid(uuid, { shouldOnlyOpen: true });\n }\n }, [isDefaultOpen, updateOpenItemUuid, uuid]);\n\n const isClickable = typeof onClick === 'function' || isExpandable;\n\n useEffect(() => {\n if (typeof onSizeChange === 'function') {\n onSizeChange({\n titleWidth,\n titleMaxWidth,\n });\n }\n }, [onSizeChange, titleMaxWidth, titleWidth]);\n\n useImperativeHandle(\n ref,\n () => ({\n titleWidth,\n titleMaxWidth,\n }),\n [titleMaxWidth, titleWidth],\n );\n\n const handleTitleWidthChange = useCallback((width: number, maxWidth: number) => {\n setTitleWidth(width);\n setTitleMaxWidth(maxWidth);\n }, []);\n\n return (\n <StyledListItem\n as={shouldDisableAnimation ? undefined : motion[LIST_ITEM_HTML_TAG]}\n animate={shouldDisableAnimation ? undefined : { height: 'auto', opacity: 1 }}\n className=\"beta-chayns-list-item\"\n exit={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n initial={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n key={`list-item-${uuid}`}\n ref={listItemRef}\n layout={\n shouldPreventLayoutAnimation || shouldDisableAnimation ? undefined : 'position'\n }\n $backgroundColor={backgroundColor}\n $isClickable={isClickable}\n $isInAccordion={\n typeof isParentAccordionWrapped === 'boolean' &&\n !areaProvider.shouldDisableListItemPadding\n }\n $isOpen={isItemOpen}\n $isWrapped={isWrapped}\n $shouldChangeColor={areaProvider.shouldChangeColor}\n $shouldForceBackground={shouldForceBackground}\n $shouldForceBottomLine={shouldForceBottomLine}\n $shouldHideBottomLine={shouldHideBottomLine}\n $shouldHideIndicator={shouldHideIndicator}\n $shouldShowSeparatorBelow={shouldShowSeparatorBelow}\n >\n <Tooltip\n shouldUseFullWidth\n isDisabled={!shouldShowTooltipOnTitleOverflow || !shouldEnableTooltip}\n item={\n <StyledListItemTooltip\n style={{ cursor: 'default' }}\n key={`list-item-tooltip-${uuid}`}\n >\n {title}\n </StyledListItemTooltip>\n }\n >\n <ListItemHead\n hoverItem={hoverItem}\n careOfLocationId={careOfLocationId}\n cornerElement={cornerElement}\n cornerImage={cornerImage}\n icons={icons}\n imageBackground={imageBackground}\n images={images}\n isAnyItemExpandable={isAnyItemExpandable}\n isExpandable={isExpandable}\n isOpen={isItemOpen}\n isTitleGreyed={isTitleGreyed}\n leftElements={leftElements}\n onClick={isClickable ? handleHeadClick : undefined}\n onLongPress={onLongPress}\n shouldForceHover={shouldForceHover}\n rightElements={rightElements}\n shouldHideImageOrIconBackground={shouldHideImageOrIconBackground}\n shouldHideIndicator={shouldHideIndicator}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldShowRoundImageOrIcon={shouldShowRoundImageOrIcon}\n subtitle={subtitle}\n title={title}\n onTitleWidthChange={handleTitleWidthChange}\n titleElement={titleElement}\n setShouldEnableTooltip={setShouldEnableTooltip}\n shouldDisableAnimation={shouldDisableAnimation}\n onImageError={onImageError}\n />\n </Tooltip>\n <AnimatePresence initial={false}>\n {isExpandable && (isItemOpen || shouldRenderClosed) && (\n <ListItemBody\n id={uuid}\n key={`listItemBody-${uuid}`}\n shouldHideBody={shouldRenderClosed && !isItemOpen}\n >\n <AreaContextProvider>{children}</AreaContextProvider>\n </ListItemBody>\n )}\n </AnimatePresence>\n </StyledListItem>\n );\n },\n);\n\nListItem.displayName = 'ListItem';\n\nexport default ListItem;\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,MAAM,QAAQ,cAAc;AACtD,OAAOC,KAAK,IAERC,UAAU,EAKVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SAASC,OAAO,QAAQ,qBAAqB;AAE7C,SAASC,gBAAgB,QAAQ,2BAA2B;AAC5D,OAAOC,mBAAmB,IAAIC,WAAW,QAAQ,yCAAyC;AAC1F,SAASC,WAAW,QAAQ,SAAS;AACrC,OAAOC,YAAY,MAAM,+BAA+B;AACxD,OAAOC,YAAY,MAAM,+BAA+B;AACxD,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,mBAAmB;AACzE,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,SAASC,kBAAkB,QAAQ,yBAAyB;AA4K5D,MAAMC,QAAQ,gBAAGlB,UAAU,CACvB,CACI;EACImB,eAAe;EACfC,gBAAgB;EAChBC,QAAQ;EACRC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,eAAe;EACfC,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,aAAa;EACbC,YAAY;EACZC,OAAO;EACPC,OAAO;EACPC,WAAW;EACXC,MAAM;EACNC,aAAa;EACbC,gCAAgC,GAAG,KAAK;EACxCC,qBAAqB,GAAG,KAAK;EAC7BC,qBAAqB,GAAG,KAAK;EAC7BC,gBAAgB,GAAG,KAAK;EACxBC,oBAAoB,GAAG,KAAK;EAC5BC,sBAAsB,GAAG,KAAK;EAC9BC,+BAA+B;EAC/BC,mBAAmB,GAAG,KAAK;EAC3BC,4BAA4B,GAAG,KAAK;EACpCC,kBAAkB,GAAG,KAAK;EAC1BC,0BAA0B;EAC1BC,wBAAwB,GAAG,KAAK;EAChCC,QAAQ;EACRC,KAAK;EACLC,YAAY;EACZC,YAAY;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BAAuB;IAC/CnB,sBAAsB,EAAEA,sBAAuB;IAC/CH,YAAY,EAAEA;EAAa,CAC9B,CACI,CAAC,eACVnD,KAAA,CAAAsF,aAAA,CAACxF,eAAe;IAAC+F,OAAO,EAAE;EAAM,GAC3B1B,YAAY,KAAKE,UAAU,IAAIvB,kBAAkB,CAAC,iBAC/C9C,KAAA,CAAAsF,aAAA,CAACzE,YAAY;IACTsG,EAAE,EAAEjD,IAAK;IACT4B,GAAG,EAAE,gBAAgB5B,IAAI,EAAG;IAC5BkD,cAAc,EAAEtE,kBAAkB,IAAI,CAACuB;EAAW,gBAElDrE,KAAA,CAAAsF,aAAA,CAAC5E,mBAAmB,QAAEY,QAA8B,CAC1C,CAEL,CACL,CAAC;AAEzB,CACJ,CAAC;AAEDH,QAAQ,CAACkG,WAAW,GAAG,UAAU;AAEjC,eAAelG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"ListItem.js","names":["AnimatePresence","motion","React","forwardRef","useCallback","useContext","useEffect","useImperativeHandle","useRef","useState","useUuid","AccordionContext","AreaContextProvider","AreaContext","ListContext","ListItemBody","ListItemHead","StyledListItem","StyledListItemTooltip","Tooltip","LIST_ITEM_HTML_TAG","ListItem","backgroundColor","careOfLocationId","children","cornerImage","hoverItem","icons","imageBackground","images","isDefaultOpen","isOpen","isTitleGreyed","leftElements","onClick","onClose","onLongPress","onOpen","rightElements","shouldShowTooltipOnTitleOverflow","shouldForceBackground","shouldForceBottomLine","shouldForceHover","shouldHideBottomLine","shouldOpenImageOnClick","shouldHideImageOrIconBackground","shouldHideIndicator","shouldPreventLayoutAnimation","shouldRenderClosed","shouldShowRoundImageOrIcon","shouldShowSeparatorBelow","subtitle","title","onImageError","onSizeChange","titleElement","shouldDisableAnimation","cornerElement","ref","isAnyItemExpandable","isWrapped","openItemUuid","updateOpenItemUuid","isParentAccordionWrapped","areaProvider","isInitialRenderRef","listItemRef","uuid","isExpandable","undefined","isItemOpen","onCloseRef","onOpenRef","shouldEnableTooltip","setShouldEnableTooltip","titleWidth","setTitleWidth","titleMaxWidth","setTitleMaxWidth","current","handleHeadClick","event","shouldOnlyOpen","isClickable","handleTitleWidthChange","width","maxWidth","createElement","as","animate","height","opacity","className","exit","initial","key","layout","$backgroundColor","$isClickable","$isInAccordion","shouldDisableListItemPadding","$isOpen","$isWrapped","$shouldChangeColor","shouldChangeColor","$shouldForceBackground","$shouldForceBottomLine","$shouldHideBottomLine","$shouldHideIndicator","$shouldShowSeparatorBelow","shouldUseFullWidth","isDisabled","item","style","cursor","onTitleWidthChange","id","shouldHideBody","displayName"],"sources":["../../../../../src/components/list/list-item/ListItem.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport React, {\n CSSProperties,\n forwardRef,\n MouseEventHandler,\n ReactNode,\n SyntheticEvent,\n TouchEventHandler,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { useUuid } from '../../../hooks/uuid';\nimport type { IListItemRightElements } from '../../../types/list';\nimport { AccordionContext } from '../../accordion/Accordion';\nimport AreaContextProvider, { AreaContext } from '../../area-provider/AreaContextProvider';\nimport { ListContext } from '../List';\nimport ListItemBody from './list-item-body/ListItemBody';\nimport ListItemHead from './list-item-head/ListItemHead';\nimport { StyledListItem, StyledListItemTooltip } from './ListItem.styles';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { LIST_ITEM_HTML_TAG } from '../../../constants/list';\n\nexport type ListItemElements = [ReactNode, ...ReactNode[]];\n\nexport interface ListItemSize {\n titleWidth: number;\n titleMaxWidth: number;\n}\n\nexport type ListItemProps = {\n /**\n * The background color of the `ListItem`.\n */\n backgroundColor?: CSSProperties['backgroundColor'];\n /**\n * DEPRECATED: Use `cornerImage` instead.\n */\n careOfLocationId?: number;\n /**\n * The content of the `ListItem` body. When the `ListItem` has children,\n * it can be opened and also gets an icon as an indicator automatically.\n */\n children?: ReactNode;\n /**\n * The image that is displayed in the bottom right corner of the grouped image of list item.\n */\n cornerImage?: string;\n /**\n * Element that is displayed when hovering over the `ListItem` on the right\n * side. On mobile devices, this element is not displayed.\n */\n hoverItem?: ReactNode;\n /**\n * The FontAwesome or tobit icons to render like an image on the left side\n * of the header. Multiple icons are stacked. See the `Icon` component\n * documentation for more information.\n */\n icons?: string[];\n /**\n * The background of the image. This is only used if images are passed.\n */\n imageBackground?: CSSProperties['background'];\n /**\n * A list of image URLs that are displayed on the left side of the header.\n * If multiple URLs are passed, the image is assembled from the first three\n * image URLs as a puzzle.\n */\n images?: string[];\n /**\n * This can be used to automatically expand the `ListItem` during the first render.\n */\n isDefaultOpen?: boolean;\n /**\n * This overrides the internal opening state of the item and makes it controlled.\n */\n isOpen?: boolean;\n /**\n * Whether the ListItem locks disabled but has full functionality.\n */\n isTitleGreyed?: boolean;\n /**\n * Elements that are displayed on the left side of the header. If multiple\n * elements are specified, they are displayed one aside the other.\n */\n leftElements?: ListItemElements;\n /**\n * Function to be executed when the header of the `ListItem` was clicked\n */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is closed.\n */\n onClose?: VoidFunction;\n /**\n * Function to be executed when the header of the `ListItem` is pressed for\n * 400 milliseconds.\n */\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n /**\n * Function to be executed when the ListItem is opened.\n */\n onOpen?: VoidFunction;\n /**\n * Elements that are displayed on the right side of the header. If multiple\n * elements are specified, they are displayed one below the other.\n */\n rightElements?: IListItemRightElements;\n /**\n * This will force the background color of the ListItem to be used even if it is closed and not hovered.\n */\n shouldForceBackground?: boolean;\n /**\n * Whether the line should be forced, e.g., so that it is also displayed if the item is the last element in the list.\n */\n shouldForceBottomLine?: boolean;\n /**\n * Whether the hover item should be forced.\n */\n shouldForceHover?: boolean;\n /**\n * Whether the bottom line should be hidden.\n */\n shouldHideBottomLine?: boolean;\n /**\n * Whether the background and border of the shape on which the image or icon of the element is displayed should be\n * hidden.\n */\n shouldHideImageOrIconBackground?: boolean;\n /**\n * If the `ListItem` is expandable, the indicator is displayed on the left\n * side of the header. If this property is set to true, the indicator is\n * hidden.\n */\n shouldHideIndicator?: boolean;\n /**\n * Whether the image should be opened on click.\n */\n shouldOpenImageOnClick?: boolean;\n /**\n * Whether the layout animation should be prevented. This is useful when the\n * `ListItem` is used in a list with a lot of items and the layout animation\n * is not desired.\n */\n shouldPreventLayoutAnimation?: boolean;\n /**\n * This will render the ListItem closed on the first render.\n */\n shouldRenderClosed?: boolean;\n /**\n * Whether the image or icon should be displayed in a round shape. This should always be used for images of persons.\n */\n shouldShowRoundImageOrIcon?: boolean;\n /**\n * Whether a separator should be displayed below this item. In this case, the border is displayed thicker than normal.\n */\n shouldShowSeparatorBelow?: boolean;\n /**\n * Whether a Tooltip should be displayed on hover if the title is cut.\n */\n shouldShowTooltipOnTitleOverflow?: boolean;\n /**\n * Subtitle of the `ListItem` displayed in the head below the title\n */\n subtitle?: ReactNode;\n /**\n * Title of the `ListItem` displayed in the head\n */\n title: ReactNode;\n /**\n * Additional elements to be displayed in the header next to the title.\n */\n titleElement?: ReactNode;\n /**\n * Whether the ListItem Animation should be disabled.\n */\n shouldDisableAnimation?: boolean;\n /**\n * Optional Element to display in the right corner of the image\n */\n cornerElement?: ReactNode;\n /**\n * Optional handler for image load errors.\n */\n onImageError?: (event: SyntheticEvent<HTMLImageElement, Event>, index: number) => void;\n /**\n * Function to be executed if the size are changed.\n */\n onSizeChange?: (sizes: ListItemSize) => void;\n};\n\nexport type ListItemRef = ListItemSize;\n\nconst ListItem = forwardRef<ListItemRef, ListItemProps>(\n (\n {\n backgroundColor,\n careOfLocationId,\n children,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isDefaultOpen,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onClose,\n onLongPress,\n onOpen,\n rightElements,\n shouldShowTooltipOnTitleOverflow = false,\n shouldForceBackground = false,\n shouldForceBottomLine = false,\n shouldForceHover = false,\n shouldHideBottomLine = false,\n shouldOpenImageOnClick = false,\n shouldHideImageOrIconBackground,\n shouldHideIndicator = false,\n shouldPreventLayoutAnimation = false,\n shouldRenderClosed = false,\n shouldShowRoundImageOrIcon,\n shouldShowSeparatorBelow = false,\n subtitle,\n title,\n onImageError,\n onSizeChange,\n titleElement,\n shouldDisableAnimation = false,\n cornerElement,\n },\n ref,\n ) => {\n const { isAnyItemExpandable, isWrapped, openItemUuid, updateOpenItemUuid } =\n useContext(ListContext);\n\n const { isWrapped: isParentAccordionWrapped } = useContext(AccordionContext);\n\n const areaProvider = useContext(AreaContext);\n\n const isInitialRenderRef = useRef(true);\n\n const listItemRef = useRef<HTMLDivElement>(null);\n\n const uuid = useUuid();\n\n const isExpandable = children !== undefined;\n const isItemOpen = isOpen ?? openItemUuid === uuid;\n\n const onCloseRef = useRef(onClose);\n const onOpenRef = useRef(onOpen);\n\n const [shouldEnableTooltip, setShouldEnableTooltip] = useState(false);\n const [titleWidth, setTitleWidth] = useState(0);\n const [titleMaxWidth, setTitleMaxWidth] = useState(0);\n\n useEffect(() => {\n onCloseRef.current = onClose;\n onOpenRef.current = onOpen;\n }, [isOpen, onClose, onOpen]);\n\n useEffect(() => {\n if (isInitialRenderRef.current) {\n isInitialRenderRef.current = false;\n } else if (isItemOpen) {\n if (typeof onOpenRef.current === 'function') {\n onOpenRef.current();\n }\n } else if (typeof onCloseRef.current === 'function') {\n onCloseRef.current();\n }\n }, [isItemOpen]);\n\n const handleHeadClick = useCallback<MouseEventHandler<HTMLDivElement>>(\n (event) => {\n if (isExpandable) {\n updateOpenItemUuid(uuid);\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n },\n [isExpandable, onClick, updateOpenItemUuid, uuid],\n );\n\n useEffect(() => {\n if (isDefaultOpen) {\n updateOpenItemUuid(uuid, { shouldOnlyOpen: true });\n }\n }, [isDefaultOpen, updateOpenItemUuid, uuid]);\n\n const isClickable = typeof onClick === 'function' || isExpandable;\n\n useEffect(() => {\n if (typeof onSizeChange === 'function') {\n onSizeChange({\n titleWidth,\n titleMaxWidth,\n });\n }\n }, [onSizeChange, titleMaxWidth, titleWidth]);\n\n useImperativeHandle(\n ref,\n () => ({\n titleWidth,\n titleMaxWidth,\n }),\n [titleMaxWidth, titleWidth],\n );\n\n const handleTitleWidthChange = useCallback((width: number, maxWidth: number) => {\n setTitleWidth(width);\n setTitleMaxWidth(maxWidth);\n }, []);\n\n return (\n <StyledListItem\n as={shouldDisableAnimation ? undefined : motion[LIST_ITEM_HTML_TAG]}\n animate={shouldDisableAnimation ? undefined : { height: 'auto', opacity: 1 }}\n className=\"beta-chayns-list-item\"\n exit={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n initial={shouldDisableAnimation ? undefined : { height: 0, opacity: 0 }}\n key={`list-item-${uuid}`}\n ref={listItemRef}\n layout={\n shouldPreventLayoutAnimation || shouldDisableAnimation ? undefined : 'position'\n }\n $backgroundColor={backgroundColor}\n $isClickable={isClickable}\n $isInAccordion={\n typeof isParentAccordionWrapped === 'boolean' &&\n !areaProvider.shouldDisableListItemPadding\n }\n $isOpen={isItemOpen}\n $isWrapped={isWrapped}\n $shouldChangeColor={areaProvider.shouldChangeColor}\n $shouldForceBackground={shouldForceBackground}\n $shouldForceBottomLine={shouldForceBottomLine}\n $shouldHideBottomLine={shouldHideBottomLine}\n $shouldHideIndicator={shouldHideIndicator}\n $shouldShowSeparatorBelow={shouldShowSeparatorBelow}\n >\n <Tooltip\n shouldUseFullWidth\n isDisabled={!shouldShowTooltipOnTitleOverflow || !shouldEnableTooltip}\n item={\n <StyledListItemTooltip\n style={{ cursor: 'default' }}\n key={`list-item-tooltip-${uuid}`}\n >\n {title}\n </StyledListItemTooltip>\n }\n >\n <ListItemHead\n hoverItem={hoverItem}\n careOfLocationId={careOfLocationId}\n cornerElement={cornerElement}\n cornerImage={cornerImage}\n icons={icons}\n imageBackground={imageBackground}\n images={images}\n isAnyItemExpandable={isAnyItemExpandable}\n isExpandable={isExpandable}\n isOpen={isItemOpen}\n isTitleGreyed={isTitleGreyed}\n leftElements={leftElements}\n onClick={isClickable ? handleHeadClick : undefined}\n onLongPress={onLongPress}\n shouldForceHover={shouldForceHover}\n rightElements={rightElements}\n shouldHideImageOrIconBackground={shouldHideImageOrIconBackground}\n shouldHideIndicator={shouldHideIndicator}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldShowRoundImageOrIcon={shouldShowRoundImageOrIcon}\n subtitle={subtitle}\n title={title}\n onTitleWidthChange={handleTitleWidthChange}\n titleElement={titleElement}\n setShouldEnableTooltip={setShouldEnableTooltip}\n shouldDisableAnimation={shouldDisableAnimation}\n onImageError={onImageError}\n />\n </Tooltip>\n <AnimatePresence initial={false}>\n {isExpandable && (isItemOpen || shouldRenderClosed) && (\n <ListItemBody\n id={uuid}\n key={`listItemBody-${uuid}`}\n shouldHideBody={shouldRenderClosed && !isItemOpen}\n >\n <AreaContextProvider>{children}</AreaContextProvider>\n </ListItemBody>\n )}\n </AnimatePresence>\n </StyledListItem>\n );\n },\n);\n\nListItem.displayName = 'ListItem';\n\nexport default ListItem;\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,MAAM,QAAQ,cAAc;AACtD,OAAOC,KAAK,IAERC,UAAU,EAKVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,SAASC,OAAO,QAAQ,qBAAqB;AAE7C,SAASC,gBAAgB,QAAQ,2BAA2B;AAC5D,OAAOC,mBAAmB,IAAIC,WAAW,QAAQ,yCAAyC;AAC1F,SAASC,WAAW,QAAQ,SAAS;AACrC,OAAOC,YAAY,MAAM,+BAA+B;AACxD,OAAOC,YAAY,MAAM,+BAA+B;AACxD,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,mBAAmB;AACzE,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,SAASC,kBAAkB,QAAQ,yBAAyB;AA4K5D,MAAMC,QAAQ,gBAAGlB,UAAU,CACvB,CACI;EACImB,eAAe;EACfC,gBAA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