@bikdotai/bik-component-library 0.0.840 → 0.0.841-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/avatar/Avatar.js +1 -1
- package/dist/cjs/components/avatar/Avatar.js.map +1 -1
- package/dist/cjs/components/avatar/Avatar.styled.js +12 -4
- package/dist/cjs/components/avatar/Avatar.styled.js.map +1 -1
- package/dist/cjs/components/card-selector/CardSelector.js +1 -1
- package/dist/cjs/components/card-selector/CardSelector.js.map +1 -1
- package/dist/cjs/components/card-selector/CardSelectorGroup.js +1 -1
- package/dist/cjs/components/card-selector/CardSelectorGroup.js.map +1 -1
- package/dist/cjs/components/carousel/carousel.js +2 -2
- package/dist/cjs/components/carousel/carousel.js.map +1 -1
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
- package/dist/cjs/components/code-block/CodeBlock.js +2 -2
- package/dist/cjs/components/code-block/CodeBlock.js.map +1 -1
- package/dist/cjs/components/colourInput/ColourInput.js +1 -1
- package/dist/cjs/components/colourInput/ColourInput.js.map +1 -1
- package/dist/cjs/components/dot-pulse/DotPulse.js +3 -3
- package/dist/cjs/components/dot-pulse/DotPulse.js.map +1 -1
- package/dist/cjs/components/dropShadow/DropShadow.js +1 -1
- package/dist/cjs/components/dropShadow/DropShadow.js.map +1 -1
- package/dist/cjs/components/dropdown/ChipInput.js +1 -1
- package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
- package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/cjs/components/dropdown/DropdownPopover/index.js.map +1 -1
- package/dist/cjs/components/floater/floater.js +1 -1
- package/dist/cjs/components/floater/floater.js.map +1 -1
- package/dist/cjs/components/modals/styledModal.js +2 -2
- package/dist/cjs/components/modals/styledModal.js.map +1 -1
- package/dist/cjs/components/pagination/Pagination.js +1 -1
- package/dist/cjs/components/pagination/Pagination.js.map +1 -1
- package/dist/cjs/components/progress-bar/CircularProgressBar.js +1 -1
- package/dist/cjs/components/progress-bar/CircularProgressBar.js.map +1 -1
- package/dist/cjs/components/progress-bar/ProgressBarComponent.js +2 -2
- package/dist/cjs/components/progress-bar/ProgressBarComponent.js.map +1 -1
- package/dist/cjs/components/progress-bar-v2/ProgressBarV2.js +17 -17
- package/dist/cjs/components/progress-bar-v2/ProgressBarV2.js.map +1 -1
- package/dist/cjs/components/shimmer-image/ShimmerImage.js +1 -1
- package/dist/cjs/components/shimmer-image/ShimmerImage.js.map +1 -1
- package/dist/cjs/components/spinner/Spinner.js +3 -3
- package/dist/cjs/components/spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/states/StateComponent.js +1 -1
- package/dist/cjs/components/states/StateComponent.js.map +1 -1
- package/dist/cjs/components/stepper/Stepper.js +1 -1
- package/dist/cjs/components/stepper/Stepper.js.map +1 -1
- package/dist/cjs/components/testimonial-card/TestimonialCard.js +1 -1
- package/dist/cjs/components/testimonial-card/TestimonialCard.js.map +1 -1
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js.map +1 -1
- package/dist/esm/components/avatar/Avatar.d.ts +2 -1
- package/dist/esm/components/avatar/Avatar.js +34 -24
- package/dist/esm/components/avatar/Avatar.js.map +1 -1
- package/dist/esm/components/avatar/Avatar.styled.d.ts +1 -0
- package/dist/esm/components/avatar/Avatar.styled.js +17 -8
- package/dist/esm/components/avatar/Avatar.styled.js.map +1 -1
- package/dist/esm/components/card-selector/CardSelector.js +11 -9
- package/dist/esm/components/card-selector/CardSelector.js.map +1 -1
- package/dist/esm/components/card-selector/CardSelectorGroup.js +1 -0
- package/dist/esm/components/card-selector/CardSelectorGroup.js.map +1 -1
- package/dist/esm/components/carousel/carousel.js +8 -8
- package/dist/esm/components/carousel/carousel.js.map +1 -1
- package/dist/esm/components/checkBox/CheckBox.js +8 -5
- package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
- package/dist/esm/components/code-block/CodeBlock.js +14 -14
- package/dist/esm/components/code-block/CodeBlock.js.map +1 -1
- package/dist/esm/components/colourInput/ColourInput.js +11 -10
- package/dist/esm/components/colourInput/ColourInput.js.map +1 -1
- package/dist/esm/components/dot-pulse/DotPulse.js +15 -15
- package/dist/esm/components/dot-pulse/DotPulse.js.map +1 -1
- package/dist/esm/components/dropShadow/DropShadow.js +6 -6
- package/dist/esm/components/dropShadow/DropShadow.js.map +1 -1
- package/dist/esm/components/dropdown/ChipInput.js +10 -9
- package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
- package/dist/esm/components/dropdown/DropdownPopover/index.js +26 -25
- package/dist/esm/components/dropdown/DropdownPopover/index.js.map +1 -1
- package/dist/esm/components/floater/floater.js +14 -13
- package/dist/esm/components/floater/floater.js.map +1 -1
- package/dist/esm/components/modals/styledModal.js +6 -5
- package/dist/esm/components/modals/styledModal.js.map +1 -1
- package/dist/esm/components/pagination/Pagination.js +7 -7
- package/dist/esm/components/pagination/Pagination.js.map +1 -1
- package/dist/esm/components/progress-bar/CircularProgressBar.js +61 -50
- package/dist/esm/components/progress-bar/CircularProgressBar.js.map +1 -1
- package/dist/esm/components/progress-bar/ProgressBarComponent.js +14 -13
- package/dist/esm/components/progress-bar/ProgressBarComponent.js.map +1 -1
- package/dist/esm/components/progress-bar-v2/ProgressBarV2.js +57 -39
- package/dist/esm/components/progress-bar-v2/ProgressBarV2.js.map +1 -1
- package/dist/esm/components/shimmer-image/ShimmerImage.js +19 -18
- package/dist/esm/components/shimmer-image/ShimmerImage.js.map +1 -1
- package/dist/esm/components/spinner/Spinner.js +19 -11
- package/dist/esm/components/spinner/Spinner.js.map +1 -1
- package/dist/esm/components/states/StateComponent.js +47 -30
- package/dist/esm/components/states/StateComponent.js.map +1 -1
- package/dist/esm/components/stepper/Stepper.js +24 -16
- package/dist/esm/components/stepper/Stepper.js.map +1 -1
- package/dist/esm/components/testimonial-card/TestimonialCard.js +5 -4
- package/dist/esm/components/testimonial-card/TestimonialCard.js.map +1 -1
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +19 -18
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestimonialCard.js","sources":["../../../../src/components/testimonial-card/TestimonialCard.tsx"],"sourcesContent":["import React from 'react';\nimport {\n\tAvatar,\n\tAVATAR_BACKGROUND,\n\tAVATAR_TYPES,\n\tSIZE,\n} from '@src/components/avatar';\nimport { StarRating } from '@src/components/star-rating';\nimport {\n\tBodyLarge,\n\tBodyPrimary,\n\tTitleLarge,\n\tTitleMedium,\n\tTitleRegular,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport FooterArrowIcon from '../../assets/icons/card_footer_arraw.svg';\nimport {\n\tFooterArrow,\n\tFooterStat,\n\tFooterText,\n\tLogo,\n\tTestimonialCardStyle,\n\tTestimonialProfileCard,\n\tTestimonialProfileFooter,\n\tTestimonialProfileInfo,\n\tTestimonialProfileInfo2,\n} from './TestimonialCard.style';\n\nexport interface TestimonialCardProps {\n\ttestimonial: string;\n\tratingValue: number;\n\treviewerName: string;\n\tavatarUrl: string;\n\treviewerCaption?: string;\n\tratingMaxValue?: number;\n\tavatarSize?: SIZE;\n\tfooterText?: string;\n\tfooterStat?: string;\n\twidth?: string;\n\theight?: string;\n\tversion?: 'v1' | 'v2';\n}\n\nexport const TestimonialCard: React.FC<TestimonialCardProps> = (props) => {\n\tconst version = props.version ?? 'v1';\n\n\tconst getHTMLBody = () => {\n\t\tif (version == 'v2') {\n\t\t\treturn (\n\t\t\t\t<TestimonialProfileInfo2>\n\t\t\t\t\t<Logo src={props.avatarUrl} />\n\t\t\t\t\t<BodyPrimary color={COLORS.content.secondary}>\n\t\t\t\t\t\t{props.reviewerName}\n\t\t\t\t\t</BodyPrimary>\n\t\t\t\t</TestimonialProfileInfo2>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<TestimonialProfileCard>\n\t\t\t\t<Avatar\n\t\t\t\t\ttype={AVATAR_TYPES.IMAGE}\n\t\t\t\t\tsize={props.avatarSize ?? SIZE.MEDIUM}\n\t\t\t\t\tbackground={AVATAR_BACKGROUND.LIGHT}\n\t\t\t\t\tphotoUrl={props.avatarUrl}\n\t\t\t\t/>\n\t\t\t\t<TestimonialProfileInfo>\n\t\t\t\t\t<TitleMedium color={COLORS.content.secondary}>\n\t\t\t\t\t\t{props.reviewerName}\n\t\t\t\t\t</TitleMedium>\n\t\t\t\t\t<BodyPrimary color={COLORS.content.secondary}>\n\t\t\t\t\t\t{props.reviewerCaption}\n\t\t\t\t\t</BodyPrimary>\n\t\t\t\t</TestimonialProfileInfo>\n\t\t\t</TestimonialProfileCard>\n\t\t);\n\t};\n\n\tconst getFooterHTML = () => {\n\t\tif (version === 'v2') {\n\t\t\treturn (\n\t\t\t\t<TestimonialProfileFooter width={props.width}>\n\t\t\t\t\t<FooterText>\n\t\t\t\t\t\t<TitleRegular color={COLORS.text.white}>\n\t\t\t\t\t\t\t{props?.footerText}\n\t\t\t\t\t\t</TitleRegular>\n\t\t\t\t\t</FooterText>\n\n\t\t\t\t\t<FooterStat>\n\t\t\t\t\t\t<TitleLarge color={COLORS.text.white}>\n\t\t\t\t\t\t\t{props?.footerStat}\n\t\t\t\t\t\t</TitleLarge>\n\t\t\t\t\t</FooterStat>\n\n\t\t\t\t\t<FooterArrow>\n\t\t\t\t\t\t<FooterArrowIcon />\n\t\t\t\t\t</FooterArrow>\n\t\t\t\t</TestimonialProfileFooter>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<TestimonialCardStyle\n\t\t\t\twidth={props.width}\n\t\t\t\theight={props.height}\n\t\t\t\tversion={version}\n\t\t\t>\n\t\t\t\t<StarRating\n\t\t\t\t\tstarSize={24}\n\t\t\t\t\tmaxValue={props.ratingMaxValue ?? 5}\n\t\t\t\t\tvalue={props.ratingValue}\n\t\t\t\t\tonChange={(stars) => console.log(stars)}\n\t\t\t\t\tmode={'VIEW'}\n\t\t\t\t\tversion={version}\n\t\t\t\t/>\n\t\t\t\t<BodyLarge color={COLORS.content.secondary}>\n\t\t\t\t\t{props.testimonial}\n\t\t\t\t</BodyLarge>\n\t\t\t\t{getHTMLBody()}\n\t\t\t</TestimonialCardStyle>\n\n\t\t\t{getFooterHTML()}\n\t\t</>\n\t);\n};\n"],"names":["TestimonialCard","props","version","getHTMLBody","TestimonialProfileInfo2","jsx","Logo","BodyPrimary","COLORS","TestimonialProfileCard","Avatar","AVATAR_TYPES","SIZE","AVATAR_BACKGROUND","TestimonialProfileInfo","TitleMedium","getFooterHTML","jsxs","TestimonialProfileFooter","FooterText","TitleRegular","FooterStat","TitleLarge","FooterArrow","FooterArrowIcon","Fragment","TestimonialCardStyle","StarRating","stars","BodyLarge"],"mappings":"iZA4CaA,EAAmDC,GAAU,CACzE,MAAMC,EAAUD,EAAM,SAAW,KAE3BE,EAAc,IACfD,GAAW,YAEZE,0BAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,EAAAA,KAAA,CAAK,IAAKL,EAAM,SAAA,CAAW,QAC3BM,EAAAA,YAAA,CAAY,MAAOC,EAAAA,OAAO,QAAQ,UACjC,WAAM,YAAA,CACR,CAAA,EACD,SAKAC,yBAAA,CACA,SAAA,CAAAJ,EAAAA,IAACK,EAAAA,OAAA,CACA,KAAMC,EAAAA,aAAa,MACnB,KAAMV,EAAM,YAAcW,EAAAA,KAAK,OAC/B,WAAYC,EAAAA,kBAAkB,MAC9B,SAAUZ,EAAM,SAAA,CAAA,SAEhBa,EAAAA,uBAAA,CACA,SAAA,CAAAT,MAACU,EAAAA,aAAY,MAAOP,EAAAA,OAAO,QAAQ,UACjC,WAAM,aACR,QACCD,EAAAA,YAAA,CAAY,MAAOC,EAAAA,OAAO,QAAQ,UACjC,WAAM,eAAA,CACR,CAAA,CAAA,CACD,CAAA,EACD,EAIIQ,EAAgB,IACjBd,IAAY,KAEde,EAAAA,KAACC,EAAAA,yBAAA,CAAyB,MAAOjB,EAAM,MACtC,SAAA,CAAAI,EAAAA,IAACc,EAAAA,WAAA,CACA,eAACC,EAAAA,aAAA,CAAa,MAAOZ,EAAAA,OAAO,KAAK,MAC/B,SAAAP,GAAO,UAAA,CACT,CAAA,CACD,EAEAI,EAAAA,IAACgB,EAAAA,WAAA,CACA,SAAAhB,EAAAA,IAACiB,EAAAA,WAAA,CAAW,MAAOd,EAAAA,OAAO,KAAK,MAC7B,SAAAP,GAAO,UAAA,CACT,CAAA,CACD,EAEAI,EAAAA,IAACkB,EAAAA,YAAA,CACA,SAAAlB,EAAAA,IAACmB,EAAAA,QAAA,CAAA,CAAgB,CAAA,CAClB,CAAA,EACD,EAIK,KAGR,OACCP,EAAAA,KAAAQ,WAAA,CACC,SAAA,CAAAR,EAAAA,KAACS,EAAAA,qBAAA,CACA,MAAOzB,EAAM,MACb,OAAQA,EAAM,OACd,QAAAC,EAEA,SAAA,CAAAG,EAAAA,IAACsB,EAAAA,WAAA,CACA,SAAU,GACV,SAAU1B,EAAM,gBAAkB,EAClC,MAAOA,EAAM,YACb,SAAW2B,GAAU,QAAQ,IAAIA,CAAK,EACtC,KAAM,OACN,QAAA1B,CAAA,CAAA,QAEA2B,EAAAA,UAAA,CAAU,MAAOrB,EAAAA,OAAO,QAAQ,UAC/B,WAAM,YACR,EACCL,EAAA,CAAY,CAAA,CAAA,EAGba,EAAA,CAAc,EAChB,CAEF"}
|
|
1
|
+
{"version":3,"file":"TestimonialCard.js","sources":["../../../../src/components/testimonial-card/TestimonialCard.tsx"],"sourcesContent":["import React from 'react';\nimport {\n\tAvatar,\n\tAVATAR_BACKGROUND,\n\tAVATAR_TYPES,\n\tSIZE,\n} from '@src/components/avatar';\nimport { StarRating } from '@src/components/star-rating';\nimport {\n\tBodyLarge,\n\tBodyPrimary,\n\tTitleLarge,\n\tTitleMedium,\n\tTitleRegular,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport FooterArrowIcon from '../../assets/icons/card_footer_arraw.svg';\nimport {\n\tFooterArrow,\n\tFooterStat,\n\tFooterText,\n\tLogo,\n\tTestimonialCardStyle,\n\tTestimonialProfileCard,\n\tTestimonialProfileFooter,\n\tTestimonialProfileInfo,\n\tTestimonialProfileInfo2,\n} from './TestimonialCard.style';\n\nexport interface TestimonialCardProps {\n\ttestimonial: string;\n\tratingValue: number;\n\treviewerName: string;\n\tavatarUrl: string;\n\treviewerCaption?: string;\n\tratingMaxValue?: number;\n\tavatarSize?: SIZE;\n\tfooterText?: string;\n\tfooterStat?: string;\n\twidth?: string;\n\theight?: string;\n\tversion?: 'v1' | 'v2';\n}\n\nexport const TestimonialCard: React.FC<TestimonialCardProps> = (props) => {\n\tconst version = props.version ?? 'v1';\n\n\tconst getHTMLBody = () => {\n\t\tif (version == 'v2') {\n\t\t\treturn (\n\t\t\t\t<TestimonialProfileInfo2>\n\t\t\t\t\t<Logo src={props.avatarUrl} />\n\t\t\t\t\t<BodyPrimary color={COLORS.content.secondary}>\n\t\t\t\t\t\t{props.reviewerName}\n\t\t\t\t\t</BodyPrimary>\n\t\t\t\t</TestimonialProfileInfo2>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<TestimonialProfileCard>\n\t\t\t\t<Avatar\n\t\t\t\t\ttype={AVATAR_TYPES.IMAGE}\n\t\t\t\t\tsize={props.avatarSize ?? SIZE.MEDIUM}\n\t\t\t\t\tbackground={AVATAR_BACKGROUND.LIGHT}\n\t\t\t\t\tphotoUrl={props.avatarUrl}\n\t\t\t\t/>\n\t\t\t\t<TestimonialProfileInfo>\n\t\t\t\t\t<TitleMedium color={COLORS.content.secondary}>\n\t\t\t\t\t\t{props.reviewerName}\n\t\t\t\t\t</TitleMedium>\n\t\t\t\t\t<BodyPrimary color={COLORS.content.secondary}>\n\t\t\t\t\t\t{props.reviewerCaption}\n\t\t\t\t\t</BodyPrimary>\n\t\t\t\t</TestimonialProfileInfo>\n\t\t\t</TestimonialProfileCard>\n\t\t);\n\t};\n\n\tconst getFooterHTML = () => {\n\t\tif (version === 'v2') {\n\t\t\treturn (\n\t\t\t\t<TestimonialProfileFooter width={props.width}>\n\t\t\t\t\t<FooterText>\n\t\t\t\t\t\t<TitleRegular color={COLORS.text.white}>\n\t\t\t\t\t\t\t{props?.footerText}\n\t\t\t\t\t\t</TitleRegular>\n\t\t\t\t\t</FooterText>\n\n\t\t\t\t\t<FooterStat>\n\t\t\t\t\t\t<TitleLarge color={COLORS.text.white}>\n\t\t\t\t\t\t\t{props?.footerStat}\n\t\t\t\t\t\t</TitleLarge>\n\t\t\t\t\t</FooterStat>\n\n\t\t\t\t\t<FooterArrow>\n\t\t\t\t\t\t<FooterArrowIcon />\n\t\t\t\t\t</FooterArrow>\n\t\t\t\t</TestimonialProfileFooter>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<TestimonialCardStyle\n\t\t\t\tdata-testid=\"testimonial-card\"\n\t\t\t\twidth={props.width}\n\t\t\t\theight={props.height}\n\t\t\t\tversion={version}\n\t\t\t>\n\t\t\t\t<StarRating\n\t\t\t\t\tstarSize={24}\n\t\t\t\t\tmaxValue={props.ratingMaxValue ?? 5}\n\t\t\t\t\tvalue={props.ratingValue}\n\t\t\t\t\tonChange={(stars) => console.log(stars)}\n\t\t\t\t\tmode={'VIEW'}\n\t\t\t\t\tversion={version}\n\t\t\t\t/>\n\t\t\t\t<BodyLarge color={COLORS.content.secondary}>\n\t\t\t\t\t{props.testimonial}\n\t\t\t\t</BodyLarge>\n\t\t\t\t{getHTMLBody()}\n\t\t\t</TestimonialCardStyle>\n\n\t\t\t{getFooterHTML()}\n\t\t</>\n\t);\n};\n"],"names":["TestimonialCard","props","version","getHTMLBody","TestimonialProfileInfo2","jsx","Logo","BodyPrimary","COLORS","TestimonialProfileCard","Avatar","AVATAR_TYPES","SIZE","AVATAR_BACKGROUND","TestimonialProfileInfo","TitleMedium","getFooterHTML","jsxs","TestimonialProfileFooter","FooterText","TitleRegular","FooterStat","TitleLarge","FooterArrow","FooterArrowIcon","Fragment","TestimonialCardStyle","StarRating","stars","BodyLarge"],"mappings":"iZA4CaA,EAAmDC,GAAU,CACzE,MAAMC,EAAUD,EAAM,SAAW,KAE3BE,EAAc,IACfD,GAAW,YAEZE,0BAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,EAAAA,KAAA,CAAK,IAAKL,EAAM,SAAA,CAAW,QAC3BM,EAAAA,YAAA,CAAY,MAAOC,EAAAA,OAAO,QAAQ,UACjC,WAAM,YAAA,CACR,CAAA,EACD,SAKAC,yBAAA,CACA,SAAA,CAAAJ,EAAAA,IAACK,EAAAA,OAAA,CACA,KAAMC,EAAAA,aAAa,MACnB,KAAMV,EAAM,YAAcW,EAAAA,KAAK,OAC/B,WAAYC,EAAAA,kBAAkB,MAC9B,SAAUZ,EAAM,SAAA,CAAA,SAEhBa,EAAAA,uBAAA,CACA,SAAA,CAAAT,MAACU,EAAAA,aAAY,MAAOP,EAAAA,OAAO,QAAQ,UACjC,WAAM,aACR,QACCD,EAAAA,YAAA,CAAY,MAAOC,EAAAA,OAAO,QAAQ,UACjC,WAAM,eAAA,CACR,CAAA,CAAA,CACD,CAAA,EACD,EAIIQ,EAAgB,IACjBd,IAAY,KAEde,EAAAA,KAACC,EAAAA,yBAAA,CAAyB,MAAOjB,EAAM,MACtC,SAAA,CAAAI,EAAAA,IAACc,EAAAA,WAAA,CACA,eAACC,EAAAA,aAAA,CAAa,MAAOZ,EAAAA,OAAO,KAAK,MAC/B,SAAAP,GAAO,UAAA,CACT,CAAA,CACD,EAEAI,EAAAA,IAACgB,EAAAA,WAAA,CACA,SAAAhB,EAAAA,IAACiB,EAAAA,WAAA,CAAW,MAAOd,EAAAA,OAAO,KAAK,MAC7B,SAAAP,GAAO,UAAA,CACT,CAAA,CACD,EAEAI,EAAAA,IAACkB,EAAAA,YAAA,CACA,SAAAlB,EAAAA,IAACmB,EAAAA,QAAA,CAAA,CAAgB,CAAA,CAClB,CAAA,EACD,EAIK,KAGR,OACCP,EAAAA,KAAAQ,WAAA,CACC,SAAA,CAAAR,EAAAA,KAACS,EAAAA,qBAAA,CACA,cAAY,mBACZ,MAAOzB,EAAM,MACb,OAAQA,EAAM,OACd,QAAAC,EAEA,SAAA,CAAAG,EAAAA,IAACsB,EAAAA,WAAA,CACA,SAAU,GACV,SAAU1B,EAAM,gBAAkB,EAClC,MAAOA,EAAM,YACb,SAAW2B,GAAU,QAAQ,IAAIA,CAAK,EACtC,KAAM,OACN,QAAA1B,CAAA,CAAA,QAEA2B,EAAAA,UAAA,CAAU,MAAOrB,EAAAA,OAAO,QAAQ,UAC/B,WAAM,YACR,EACCL,EAAA,CAAY,CAAA,CAAA,EAGba,EAAA,CAAc,EAChB,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("@bikdotai/bik-models/growth/models/bik-store"),T=require("../../assets/icons/cross.svg.js"),U=require("../../assets/icons/info.svg.js"),u=require("date-fns"),o=require("react"),n=require("../../constants/Theme.js"),r=require("../TypographyStyle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("@bikdotai/bik-models/growth/models/bik-store"),T=require("../../assets/icons/cross.svg.js"),U=require("../../assets/icons/info.svg.js"),u=require("date-fns"),o=require("react"),n=require("../../constants/Theme.js"),r=require("../TypographyStyle.js"),b=require("./UnsatisfactoryCountIntentWiseModal.js"),A=require("./UnsatisfactoryResponseList.style.js"),f=require("../states/StateComponent.js"),a=require("../avatar/AvatarHelper.js"),O=require("../avatar/Avatar.js"),q=require("../button/Button.js"),L=h=>{const{storeId:g,appType:i,incorrectMessages:s,onIncorrectMessageBubbleClick:x,setShowIncorrectReplies:c,ChecklistType:I,IntentWiseUnsatisfactoryResponse:S,IntentHeaderTitle:m,redirectToUnsatisfactoryResponse:j,fetchUnsatisfactoryResponseCountIntentWise:R,fetchUnsatisfactoryResponseCount:l}=h,[C,v]=o.useState(""),[d,M]=o.useState(s?.length>0),[w,y]=o.useState(!1);return o.useEffect(()=>{!d&&l&&l().then(t=>{t>0&&M(!0),t===0&&c(!1)})},[]),e.jsx("div",{style:{overflow:"scroll",height:"100%"},children:e.jsxs(A.IncorrectRepliesStyle,{children:[i==p.ApplicationType.MANIFEST&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(r.TitleRegular,{children:"Unsatisfactory responses"}),e.jsx("div",{"data-testid":"manifest-close-button",style:{cursor:"pointer"},onClick:()=>c(!1),children:e.jsx(T.default,{height:16,width:16,color:n.COLORS.content.primary})})]}),e.jsx(r.BodySecondary,{style:{color:n.COLORS.content.secondary},children:"Spot unsatisfactory replies, dive deeper, and enhance with relevant data for improved responses."})]}),!s?.length&&e.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(f.StateComponent,{states:f.StateInterface.WARNING,heading:"No unsatisfactory responses",subline:"As of now, all responses are correct",isButtonEnabled:!1,width:0,size:a.SIZE.SMALL,icon:e.jsx(O.Avatar,{type:a.AVATAR_TYPES.ICON,size:a.SIZE.MEDIUM,background:a.AVATAR_BACKGROUND.LIGHT,icon:()=>e.jsx(U.default,{width:16,height:16,color:n.COLORS.content.warning})})})}),!!s?.length&&e.jsxs(e.Fragment,{children:[i==p.ApplicationType.MANIFEST&&e.jsx("div",{style:{display:"flex",width:"100%",justifyContent:s?.length?"flex-start":"center"},children:e.jsx(q.Button,{buttonText:"Fix all unsatisfactory responses",buttonType:"tertiary",size:"small",onClick:()=>{y(!0)},disabled:!d})}),e.jsx(b.UnsatisfactoryCountIntentWiseModal,{storeId:g,setShowUnsatisfactoryResponseModal:y,showUnsatisfactoryResponseModal:w,ChecklistType:I,UnsatisfactoryResponseIntentList:S,IntentHeaderTitle:m,fetchUnsatisfactoryResponseCountIntentWise:R,viewIntentWiseUnsatisfactoryResponse:j}),s&&s?.length>0&&e.jsx("div",{className:"wrapper",children:s.map((t,N)=>e.jsxs("div",{className:"bubble",onClick:()=>{x(t.messageId),v(t.messageId)},style:C===t.messageId?{backgroundColor:n.COLORS.surface.hovered}:{},children:[e.jsx(r.BodySecondary,{style:{color:n.COLORS.content.primary},children:t.message}),e.jsx("div",{children:e.jsxs(r.Caption,{style:{color:n.COLORS.content.secondary},children:[u.format(new Date(t?.date),"hh:mm a")," |"," ",u.format(new Date(t?.date),"dd/MM/yyyy")]})})]},t.messageId))})]})]})})};exports.UnsatisfactoryResponseList=L;
|
|
2
2
|
//# sourceMappingURL=UnsatisfactoryResponseList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnsatisfactoryResponseList.js","sources":["../../../../src/components/unsatisfactory-response-list/UnsatisfactoryResponseList.tsx"],"sourcesContent":["import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport InfoIcon from '@src/assets/icons/info.svg';\nimport { format } from 'date-fns';\nimport React, { useEffect, useState } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { Avatar, AVATAR_BACKGROUND, AVATAR_TYPES, SIZE } from '../avatar';\nimport { Button } from '../button';\nimport { StateComponent, StateInterface } from '../states';\nimport { BodySecondary, Caption, TitleRegular } from '../TypographyStyle';\nimport { UnsatisfactoryCountIntentWiseModal } from './UnsatisfactoryCountIntentWiseModal';\nimport { IncorrectRepliesStyle } from './UnsatisfactoryResponseList.style';\n\nexport interface UnsatisfactoryResponseListProps {\n\tstoreId?: string;\n\tappType: ApplicationType;\n\tincorrectMessages: any;\n\tonIncorrectMessageBubbleClick: (messageId: string) => void;\n\tsetShowIncorrectReplies: (show: boolean) => void;\n\n\t// ui\n\tChecklistType: Record<string, string>;\n\tIntentHeaderTitle?: Record<string, string>;\n\tIntentWiseUnsatisfactoryResponse?: string[];\n\n\tredirectToUnsatisfactoryResponse?: (intent: string) => void;\n\n\t// data fetch\n\tfetchUnsatisfactoryResponseCountIntentWise?: () => Promise<{\n\t\t[keys in string]?: number;\n\t}>;\n\tfetchUnsatisfactoryResponseCount?: () => Promise<number>;\n}\n\nexport const UnsatisfactoryResponseList: React.FC<\n\tUnsatisfactoryResponseListProps\n> = (props: UnsatisfactoryResponseListProps) => {\n\tconst {\n\t\tstoreId,\n\t\tappType,\n\t\tincorrectMessages,\n\t\tonIncorrectMessageBubbleClick,\n\t\tsetShowIncorrectReplies,\n\t\tChecklistType,\n\t\tIntentWiseUnsatisfactoryResponse,\n\t\tIntentHeaderTitle,\n\t\tredirectToUnsatisfactoryResponse,\n\t\tfetchUnsatisfactoryResponseCountIntentWise,\n\t\tfetchUnsatisfactoryResponseCount,\n\t} = props;\n\tconst [messageId, setMessageId] = useState<string>('');\n\tconst [hasUnsatisfactoryMessage, setHasUnsatisfactoryMessage] =\n\t\tuseState<boolean>(incorrectMessages?.length > 0);\n\tconst [showIncorrectDataModal, setShowIncorrectDataModal] =\n\t\tuseState<boolean>(false);\n\n\tuseEffect(() => {\n\t\tif (!hasUnsatisfactoryMessage && fetchUnsatisfactoryResponseCount) {\n\t\t\tfetchUnsatisfactoryResponseCount().then((response: number) => {\n\t\t\t\tif (response > 0) {\n\t\t\t\t\tsetHasUnsatisfactoryMessage(true);\n\t\t\t\t}\n\t\t\t\tif (response === 0) {\n\t\t\t\t\tsetShowIncorrectReplies(false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, []);\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\toverflow: 'scroll',\n\t\t\t\theight: '100%',\n\t\t\t}}\n\t\t>\n\t\t\t<IncorrectRepliesStyle>\n\t\t\t\t{appType == ApplicationType.MANIFEST && (\n\t\t\t\t\t<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TitleRegular>Unsatisfactory responses</TitleRegular>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\t\tonClick={() => setShowIncorrectReplies(false)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.primary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\tSpot unsatisfactory replies, dive deeper, and enhance with\n\t\t\t\t\t\t\trelevant data for improved responses.\n\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!incorrectMessages?.length && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<StateComponent\n\t\t\t\t\t\t\tstates={StateInterface.WARNING}\n\t\t\t\t\t\t\theading={'No unsatisfactory responses'}\n\t\t\t\t\t\t\tsubline={'As of now, all responses are correct'}\n\t\t\t\t\t\t\tisButtonEnabled={false}\n\t\t\t\t\t\t\twidth={0}\n\t\t\t\t\t\t\tsize={SIZE.SMALL}\n\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\ttype={AVATAR_TYPES.ICON}\n\t\t\t\t\t\t\t\t\tsize={SIZE.MEDIUM}\n\t\t\t\t\t\t\t\t\tbackground={AVATAR_BACKGROUND.LIGHT}\n\t\t\t\t\t\t\t\t\ticon={() => (\n\t\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.warning}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!!incorrectMessages?.length && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{appType == ApplicationType.MANIFEST && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\t\tjustifyContent: incorrectMessages?.length\n\t\t\t\t\t\t\t\t\t\t? 'flex-start'\n\t\t\t\t\t\t\t\t\t\t: 'center',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tbuttonText={'Fix all unsatisfactory responses'}\n\t\t\t\t\t\t\t\t\tbuttonType={'tertiary'}\n\t\t\t\t\t\t\t\t\tsize={'small'}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tsetShowIncorrectDataModal(true);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tdisabled={!hasUnsatisfactoryMessage}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<UnsatisfactoryCountIntentWiseModal\n\t\t\t\t\t\t\tstoreId={storeId}\n\t\t\t\t\t\t\tsetShowUnsatisfactoryResponseModal={setShowIncorrectDataModal}\n\t\t\t\t\t\t\tshowUnsatisfactoryResponseModal={showIncorrectDataModal}\n\t\t\t\t\t\t\tChecklistType={ChecklistType}\n\t\t\t\t\t\t\tUnsatisfactoryResponseIntentList={\n\t\t\t\t\t\t\t\tIntentWiseUnsatisfactoryResponse\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tIntentHeaderTitle={IntentHeaderTitle}\n\t\t\t\t\t\t\tfetchUnsatisfactoryResponseCountIntentWise={\n\t\t\t\t\t\t\t\tfetchUnsatisfactoryResponseCountIntentWise\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tviewIntentWiseUnsatisfactoryResponse={\n\t\t\t\t\t\t\t\tredirectToUnsatisfactoryResponse\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{incorrectMessages && incorrectMessages?.length > 0 && (\n\t\t\t\t\t\t\t<div className={'wrapper'}>\n\t\t\t\t\t\t\t\t{incorrectMessages.map((each, index) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tkey={each.messageId}\n\t\t\t\t\t\t\t\t\t\tclassName={'bubble'}\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\tonIncorrectMessageBubbleClick(each.messageId);\n\t\t\t\t\t\t\t\t\t\t\tsetMessageId(each.messageId);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tmessageId === each.messageId\n\t\t\t\t\t\t\t\t\t\t\t\t? { backgroundColor: COLORS.surface.hovered }\n\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.primary }}>\n\t\t\t\t\t\t\t\t\t\t\t{each.message}\n\t\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<Caption style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\t\t\t\t{format(new Date(each?.date), 'hh:mm a')} |{' '}\n\t\t\t\t\t\t\t\t\t\t\t\t{format(new Date(each?.date), 'dd/MM/yyyy')}\n\t\t\t\t\t\t\t\t\t\t\t</Caption>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</IncorrectRepliesStyle>\n\t\t</div>\n\t);\n};\n"],"names":["UnsatisfactoryResponseList","props","storeId","appType","incorrectMessages","onIncorrectMessageBubbleClick","setShowIncorrectReplies","ChecklistType","IntentWiseUnsatisfactoryResponse","IntentHeaderTitle","redirectToUnsatisfactoryResponse","fetchUnsatisfactoryResponseCountIntentWise","fetchUnsatisfactoryResponseCount","messageId","setMessageId","useState","hasUnsatisfactoryMessage","setHasUnsatisfactoryMessage","showIncorrectDataModal","setShowIncorrectDataModal","useEffect","response","jsx","IncorrectRepliesStyle","ApplicationType","jsxs","TitleRegular","CrossIcon","COLORS","BodySecondary","StateComponent","StateInterface","SIZE","Avatar","AVATAR_TYPES","AVATAR_BACKGROUND","InfoIcon","Fragment","Button","UnsatisfactoryCountIntentWiseModal","each","index","Caption","format"],"mappings":"onBAkCaA,EAERC,GAA2C,CAC/C,KAAM,CACL,QAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,8BAAAC,EACA,wBAAAC,EACA,cAAAC,EACA,iCAAAC,EACA,kBAAAC,EACA,i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SAAO,QAAQ,OAAA,EAClC,CAAA,EAGJ,SAAA,CAAAN,EAAAA,IAACO,EAAAA,cAAA,CAAc,MAAO,CAAE,MAAOD,EAAAA,OAAO,QAAQ,OAAA,EAC5C,SAAAY,EAAK,OAAA,CACP,EACAlB,EAAAA,IAAC,MAAA,CACA,SAAAG,EAAAA,KAACiB,EAAAA,QAAA,CAAQ,MAAO,CAAE,MAAOd,EAAAA,OAAO,QAAQ,SAAA,EACtC,SAAA,CAAAe,EAAAA,OAAO,IAAI,KAAKH,GAAM,IAAI,EAAG,SAAS,EAAE,KAAG,IAC3CG,EAAAA,OAAO,IAAI,KAAKH,GAAM,IAAI,EAAG,YAAY,CAAA,CAAA,CAC3C,CAAA,CACD,CAAA,CAAA,EApBKA,EAAK,SAAA,CAsBX,CAAA,CACF,CAAA,CAAA,CAEF,CAAA,CAAA,CAEF,CAAA,CAAA,CAGH"}
|
|
1
|
+
{"version":3,"file":"UnsatisfactoryResponseList.js","sources":["../../../../src/components/unsatisfactory-response-list/UnsatisfactoryResponseList.tsx"],"sourcesContent":["import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport InfoIcon from '@src/assets/icons/info.svg';\nimport { format } from 'date-fns';\nimport React, { useEffect, useState } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { Avatar, AVATAR_BACKGROUND, AVATAR_TYPES, SIZE } from '../avatar';\nimport { Button } from '../button';\nimport { StateComponent, StateInterface } from '../states';\nimport { BodySecondary, Caption, TitleRegular } from '../TypographyStyle';\nimport { UnsatisfactoryCountIntentWiseModal } from './UnsatisfactoryCountIntentWiseModal';\nimport { IncorrectRepliesStyle } from './UnsatisfactoryResponseList.style';\n\nexport interface UnsatisfactoryResponseListProps {\n\tstoreId?: string;\n\tappType: ApplicationType;\n\tincorrectMessages: any;\n\tonIncorrectMessageBubbleClick: (messageId: string) => void;\n\tsetShowIncorrectReplies: (show: boolean) => void;\n\n\t// ui\n\tChecklistType: Record<string, string>;\n\tIntentHeaderTitle?: Record<string, string>;\n\tIntentWiseUnsatisfactoryResponse?: string[];\n\n\tredirectToUnsatisfactoryResponse?: (intent: string) => void;\n\n\t// data fetch\n\tfetchUnsatisfactoryResponseCountIntentWise?: () => Promise<{\n\t\t[keys in string]?: number;\n\t}>;\n\tfetchUnsatisfactoryResponseCount?: () => Promise<number>;\n}\n\nexport const UnsatisfactoryResponseList: React.FC<\n\tUnsatisfactoryResponseListProps\n> = (props: UnsatisfactoryResponseListProps) => {\n\tconst {\n\t\tstoreId,\n\t\tappType,\n\t\tincorrectMessages,\n\t\tonIncorrectMessageBubbleClick,\n\t\tsetShowIncorrectReplies,\n\t\tChecklistType,\n\t\tIntentWiseUnsatisfactoryResponse,\n\t\tIntentHeaderTitle,\n\t\tredirectToUnsatisfactoryResponse,\n\t\tfetchUnsatisfactoryResponseCountIntentWise,\n\t\tfetchUnsatisfactoryResponseCount,\n\t} = props;\n\tconst [messageId, setMessageId] = useState<string>('');\n\tconst [hasUnsatisfactoryMessage, setHasUnsatisfactoryMessage] =\n\t\tuseState<boolean>(incorrectMessages?.length > 0);\n\tconst [showIncorrectDataModal, setShowIncorrectDataModal] =\n\t\tuseState<boolean>(false);\n\n\tuseEffect(() => {\n\t\tif (!hasUnsatisfactoryMessage && fetchUnsatisfactoryResponseCount) {\n\t\t\tfetchUnsatisfactoryResponseCount().then((response: number) => {\n\t\t\t\tif (response > 0) {\n\t\t\t\t\tsetHasUnsatisfactoryMessage(true);\n\t\t\t\t}\n\t\t\t\tif (response === 0) {\n\t\t\t\t\tsetShowIncorrectReplies(false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, []);\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\toverflow: 'scroll',\n\t\t\t\theight: '100%',\n\t\t\t}}\n\t\t>\n\t\t\t<IncorrectRepliesStyle>\n\t\t\t\t{appType == ApplicationType.MANIFEST && (\n\t\t\t\t\t<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TitleRegular>Unsatisfactory responses</TitleRegular>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tdata-testid=\"manifest-close-button\"\n\t\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\t\tonClick={() => setShowIncorrectReplies(false)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.primary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\tSpot unsatisfactory replies, dive deeper, and enhance with\n\t\t\t\t\t\t\trelevant data for improved responses.\n\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!incorrectMessages?.length && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<StateComponent\n\t\t\t\t\t\t\tstates={StateInterface.WARNING}\n\t\t\t\t\t\t\theading={'No unsatisfactory responses'}\n\t\t\t\t\t\t\tsubline={'As of now, all responses are correct'}\n\t\t\t\t\t\t\tisButtonEnabled={false}\n\t\t\t\t\t\t\twidth={0}\n\t\t\t\t\t\t\tsize={SIZE.SMALL}\n\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\ttype={AVATAR_TYPES.ICON}\n\t\t\t\t\t\t\t\t\tsize={SIZE.MEDIUM}\n\t\t\t\t\t\t\t\t\tbackground={AVATAR_BACKGROUND.LIGHT}\n\t\t\t\t\t\t\t\t\ticon={() => (\n\t\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.warning}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!!incorrectMessages?.length && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{appType == ApplicationType.MANIFEST && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\t\tjustifyContent: incorrectMessages?.length\n\t\t\t\t\t\t\t\t\t\t? 'flex-start'\n\t\t\t\t\t\t\t\t\t\t: 'center',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tbuttonText={'Fix all unsatisfactory responses'}\n\t\t\t\t\t\t\t\t\tbuttonType={'tertiary'}\n\t\t\t\t\t\t\t\t\tsize={'small'}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tsetShowIncorrectDataModal(true);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tdisabled={!hasUnsatisfactoryMessage}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<UnsatisfactoryCountIntentWiseModal\n\t\t\t\t\t\t\tstoreId={storeId}\n\t\t\t\t\t\t\tsetShowUnsatisfactoryResponseModal={setShowIncorrectDataModal}\n\t\t\t\t\t\t\tshowUnsatisfactoryResponseModal={showIncorrectDataModal}\n\t\t\t\t\t\t\tChecklistType={ChecklistType}\n\t\t\t\t\t\t\tUnsatisfactoryResponseIntentList={\n\t\t\t\t\t\t\t\tIntentWiseUnsatisfactoryResponse\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tIntentHeaderTitle={IntentHeaderTitle}\n\t\t\t\t\t\t\tfetchUnsatisfactoryResponseCountIntentWise={\n\t\t\t\t\t\t\t\tfetchUnsatisfactoryResponseCountIntentWise\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tviewIntentWiseUnsatisfactoryResponse={\n\t\t\t\t\t\t\t\tredirectToUnsatisfactoryResponse\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{incorrectMessages && incorrectMessages?.length > 0 && (\n\t\t\t\t\t\t\t<div className={'wrapper'}>\n\t\t\t\t\t\t\t\t{incorrectMessages.map((each, index) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tkey={each.messageId}\n\t\t\t\t\t\t\t\t\t\tclassName={'bubble'}\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\tonIncorrectMessageBubbleClick(each.messageId);\n\t\t\t\t\t\t\t\t\t\t\tsetMessageId(each.messageId);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tmessageId === each.messageId\n\t\t\t\t\t\t\t\t\t\t\t\t? { backgroundColor: COLORS.surface.hovered }\n\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.primary }}>\n\t\t\t\t\t\t\t\t\t\t\t{each.message}\n\t\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<Caption style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\t\t\t\t{format(new Date(each?.date), 'hh:mm a')} |{' '}\n\t\t\t\t\t\t\t\t\t\t\t\t{format(new Date(each?.date), 'dd/MM/yyyy')}\n\t\t\t\t\t\t\t\t\t\t\t</Caption>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</IncorrectRepliesStyle>\n\t\t</div>\n\t);\n};\n"],"names":["UnsatisfactoryResponseList","props","storeId","appType","incorrectMessages","onIncorrectMessageBubbleClick","setShowIncorrectReplies","ChecklistType","IntentWiseUnsatisfactoryResponse","IntentHeaderTitle","redirectToUnsatisfactoryResponse","fetchUnsatisfactoryResponseCountIntentWise","fetchUnsatisfactoryResponseCount","messageId","setMessageId","useState","hasUnsatisfactoryMessage","setHasUnsatisfactoryMessage","showIncorrectDataModal","setShowIncorrectDataModal","useEffect","response","jsx","IncorrectRepliesStyle","ApplicationType","jsxs","TitleRegular","CrossIcon","COLORS","BodySecondary","StateComponent","StateInterface","SIZE","Avatar","AVATAR_TYPES","AVATAR_BACKGROUND","InfoIcon","Fragment","Button","UnsatisfactoryCountIntentWiseModal","each","index","Caption","format"],"mappings":"onBAkCaA,EAERC,GAA2C,CAC/C,KAAM,CACL,QAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,8BAAAC,EACA,wBAAAC,EACA,cAAAC,EACA,iCAAAC,EACA,kBAAA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AChB,CAAE,gBAAiBZ,SAAO,QAAQ,OAAA,EAClC,CAAA,EAGJ,SAAA,CAAAN,EAAAA,IAACO,EAAAA,cAAA,CAAc,MAAO,CAAE,MAAOD,EAAAA,OAAO,QAAQ,OAAA,EAC5C,SAAAY,EAAK,OAAA,CACP,EACAlB,EAAAA,IAAC,MAAA,CACA,SAAAG,EAAAA,KAACiB,EAAAA,QAAA,CAAQ,MAAO,CAAE,MAAOd,EAAAA,OAAO,QAAQ,SAAA,EACtC,SAAA,CAAAe,EAAAA,OAAO,IAAI,KAAKH,GAAM,IAAI,EAAG,SAAS,EAAE,KAAG,IAC3CG,EAAAA,OAAO,IAAI,KAAKH,GAAM,IAAI,EAAG,YAAY,CAAA,CAAA,CAC3C,CAAA,CACD,CAAA,CAAA,EApBKA,EAAK,SAAA,CAsBX,CAAA,CACF,CAAA,CAAA,CAEF,CAAA,CAAA,CAEF,CAAA,CAAA,CAGH"}
|
|
@@ -45,6 +45,7 @@ export declare const enum MESSAGE_CHANNELS {
|
|
|
45
45
|
SMTP = "smtp",
|
|
46
46
|
FACEBOOK_CATALOG = "facebook-catalog",
|
|
47
47
|
TASKS = "tasks",
|
|
48
|
-
BIK_LIVECHAT = "livechat"
|
|
48
|
+
BIK_LIVECHAT = "livechat",
|
|
49
|
+
VOICE = "voice"
|
|
49
50
|
}
|
|
50
51
|
export declare const Avatar: React.FC<AvatarProps>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as R } from "react";
|
|
3
|
-
import { TitleMedium as k, TitleSmall as
|
|
3
|
+
import { TitleMedium as k, TitleSmall as w, SubHeading as A, BodyTiny as O } from "../TypographyStyle.js";
|
|
4
4
|
import { COLORS as i } from "../../constants/Theme.js";
|
|
5
|
-
import
|
|
5
|
+
import x from "../../assets/icons/bik_livechat.svg.js";
|
|
6
6
|
import u from "../../assets/icons/email-channel.svg.js";
|
|
7
7
|
import d from "../../assets/icons/facebook_channel.svg.js";
|
|
8
8
|
import z from "../../assets/icons/gmail.svg.js";
|
|
9
9
|
import C from "../../assets/icons/instagram-channel.svg.js";
|
|
10
|
-
import
|
|
10
|
+
import P from "../../assets/icons/task.svg.js";
|
|
11
11
|
import U from "../../assets/icons/whatsapp_color.svg.js";
|
|
12
|
-
import { AvatarStyle as B } from "./Avatar.styled.js";
|
|
13
|
-
import { SIZE as a, AVATAR_TYPES as r, AVATAR_BACKGROUND as s, AVATAR_SIZE_MAP as
|
|
12
|
+
import { AvatarStyle as B, PhoneIconWrapper as L } from "./Avatar.styled.js";
|
|
13
|
+
import { SIZE as a, AVATAR_TYPES as r, AVATAR_BACKGROUND as s, AVATAR_SIZE_MAP as h } from "./AvatarHelper.js";
|
|
14
|
+
import F from "../../icons/Informational/Communication/Phone.js";
|
|
14
15
|
const n = {
|
|
15
16
|
[a.EXTRA_SMALL]: 10,
|
|
16
17
|
[a.SMALL]: 16,
|
|
@@ -22,32 +23,32 @@ const n = {
|
|
|
22
23
|
[s.DARK]: i.surface.standard,
|
|
23
24
|
[s.BRAND]: i.background.inverseLight
|
|
24
25
|
};
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
const [
|
|
28
|
-
const o = (t.name || "").split(".").join(" ").split(" ").map((
|
|
29
|
-
return t.size === a.LARGE ? /* @__PURE__ */ e(k, { style: { color: c }, children: o }) : t.size === a.MEDIUM ? /* @__PURE__ */ e(
|
|
30
|
-
},
|
|
26
|
+
var V = /* @__PURE__ */ ((t) => (t.INSTAGRAM = "instagram", t.MESSENGER = "messenger", t.WHATSAPP = "whatsapp", t.GMAIL = "gmail", t.LIVECHAT = "livechat", t.GOOGLE_BUSINESS_CHAT = "gbm", t.SHOPIFY = "shopify", t.FACEBOOK = "facebook", t.EMAIL = "email", t.SMTP = "smtp", t.FACEBOOK_CATALOG = "facebook-catalog", t.TASKS = "tasks", t.BIK_LIVECHAT = "livechat", t.VOICE = "voice", t))(V || {});
|
|
27
|
+
const H = (t) => {
|
|
28
|
+
const [l, I] = R(!1), g = () => {
|
|
29
|
+
const o = (t.name || "").split(".").join(" ").split(" ").map((T) => T.charAt(0).toUpperCase()).slice(0, 2).join(""), c = b[t.background];
|
|
30
|
+
return t.size === a.LARGE ? /* @__PURE__ */ e(k, { style: { color: c }, children: o }) : t.size === a.MEDIUM ? /* @__PURE__ */ e(w, { style: { color: c }, children: o }) : t.size === a.SMALL ? /* @__PURE__ */ e(A, { style: { color: c }, children: o }) : /* @__PURE__ */ e(O, { style: { color: c, fontSize: "6.667px", lineHeight: "8px" }, children: o });
|
|
31
|
+
}, f = () => t.useNameFallback && (!t.photoUrl || l) && t.name ? /* @__PURE__ */ e("div", { children: g() }) : t.useNameFallback && t.photoUrl && !l ? /* @__PURE__ */ e(
|
|
31
32
|
"img",
|
|
32
33
|
{
|
|
33
34
|
alt: "",
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
35
|
+
width: h[t.size],
|
|
36
|
+
height: h[t.size],
|
|
36
37
|
style: {
|
|
37
38
|
borderRadius: t?.borderRadius || "50%",
|
|
38
39
|
objectFit: "contain"
|
|
39
40
|
},
|
|
40
41
|
src: t.photoUrl,
|
|
41
42
|
onError: () => {
|
|
42
|
-
|
|
43
|
+
I(!0);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
) : /* @__PURE__ */ e(
|
|
46
47
|
"img",
|
|
47
48
|
{
|
|
48
49
|
alt: "",
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
50
|
+
width: h[t.size],
|
|
51
|
+
height: h[t.size],
|
|
51
52
|
style: {
|
|
52
53
|
borderRadius: t?.borderRadius || "50%",
|
|
53
54
|
objectFit: "contain"
|
|
@@ -73,11 +74,20 @@ const J = (t) => {
|
|
|
73
74
|
case "gmail":
|
|
74
75
|
return /* @__PURE__ */ e(z, { width: 11, height: 11 });
|
|
75
76
|
case "tasks":
|
|
76
|
-
return /* @__PURE__ */ e(
|
|
77
|
+
return /* @__PURE__ */ e(P, { width: 11, height: 11 });
|
|
77
78
|
case "livechat":
|
|
78
|
-
return /* @__PURE__ */ e(
|
|
79
|
+
return /* @__PURE__ */ e(x, { width: 11, height: 11 });
|
|
80
|
+
case "voice":
|
|
81
|
+
return /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
|
|
82
|
+
F,
|
|
83
|
+
{
|
|
84
|
+
width: 8,
|
|
85
|
+
height: 8,
|
|
86
|
+
color: i.content.secondaryInverse
|
|
87
|
+
}
|
|
88
|
+
) });
|
|
79
89
|
}
|
|
80
|
-
},
|
|
90
|
+
}, v = () => t.status ? /* @__PURE__ */ e(
|
|
81
91
|
"div",
|
|
82
92
|
{
|
|
83
93
|
style: {
|
|
@@ -98,11 +108,11 @@ const J = (t) => {
|
|
|
98
108
|
/* @__PURE__ */ m(
|
|
99
109
|
B,
|
|
100
110
|
{
|
|
101
|
-
type: t.type === r.IMAGE && (
|
|
111
|
+
type: t.type === r.IMAGE && (l || !t.photoUrl) && t.useNameFallback && t.name ? r.INITIALS : t.type,
|
|
102
112
|
size: t.size,
|
|
103
113
|
background: t.background,
|
|
104
114
|
children: [
|
|
105
|
-
t.type === r.IMAGE &&
|
|
115
|
+
t.type === r.IMAGE && f(),
|
|
106
116
|
t.type === r.INITIALS && /* @__PURE__ */ e("div", { children: g() }),
|
|
107
117
|
t.type === r.ICON && t.icon && /* @__PURE__ */ e(
|
|
108
118
|
t.icon,
|
|
@@ -150,7 +160,7 @@ const J = (t) => {
|
|
|
150
160
|
backgroundColor: i.surface.standard,
|
|
151
161
|
alignItems: "center"
|
|
152
162
|
},
|
|
153
|
-
children:
|
|
163
|
+
children: v()
|
|
154
164
|
}
|
|
155
165
|
)
|
|
156
166
|
]
|
|
@@ -159,8 +169,8 @@ const J = (t) => {
|
|
|
159
169
|
};
|
|
160
170
|
export {
|
|
161
171
|
n as AVATAR_SIZE_VS_ICON_SIZE_MAP,
|
|
162
|
-
|
|
172
|
+
H as Avatar,
|
|
163
173
|
b as BACKGROUND_VS_TEXT_COLOR_MAP,
|
|
164
|
-
|
|
174
|
+
V as MESSAGE_CHANNELS
|
|
165
175
|
};
|
|
166
176
|
//# sourceMappingURL=Avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/avatar/Avatar.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport {\n\tBodyTiny,\n\tSubHeading,\n\tTitleMedium,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport BikLivechatIcon from '../../assets/icons/bik_livechat.svg';\nimport EmailIcon from '../../assets/icons/email-channel.svg';\nimport FacebookIcon from '../../assets/icons/facebook_channel.svg';\nimport GmailIcon from '../../assets/icons/gmail.svg';\nimport InstagramIcon from '../../assets/icons/instagram-channel.svg';\nimport TaskIcon from '../../assets/icons/task.svg';\nimport WhatsappIcon from '../../assets/icons/whatsapp_color.svg';\nimport { AvatarStyle } from './Avatar.styled';\nimport {\n\tAVATAR_BACKGROUND,\n\tAVATAR_SIZE_MAP,\n\tAVATAR_TYPES,\n\tSIZE,\n} from './AvatarHelper';\n\nexport const AVATAR_SIZE_VS_ICON_SIZE_MAP = {\n\t[SIZE.EXTRA_SMALL]: 10,\n\t[SIZE.SMALL]: 16,\n\t[SIZE.MEDIUM]: 20,\n\t[SIZE.LARGE]: 32,\n};\n\nexport const BACKGROUND_VS_TEXT_COLOR_MAP = {\n\t[AVATAR_BACKGROUND.LIGHT]: COLORS.content.secondary,\n\t[AVATAR_BACKGROUND.WHITE]: COLORS.content.secondary,\n\t[AVATAR_BACKGROUND.DARK]: COLORS.surface.standard,\n\t[AVATAR_BACKGROUND.BRAND]: COLORS.background.inverseLight,\n};\n\nexport type AvatarProps = {\n\ttype: AVATAR_TYPES;\n\tsize: SIZE;\n\tbackground: AVATAR_BACKGROUND;\n\tname?: string;\n\tphotoUrl?: string;\n\ticon?: React.FC<{ width: number; height: number; color: string }>;\n\tuseNameFallback?: boolean;\n\tchannelName?: MESSAGE_CHANNELS;\n\tborderRadius?: string;\n\tinboxSettings?: {\n\t\tisSelected: boolean;\n\t\tisComments: boolean;\n\t};\n\tstatus?: 'ONLINE' | 'OFFLINE' | 'AWAY';\n};\n\nexport const enum MESSAGE_CHANNELS {\n\tINSTAGRAM = 'instagram',\n\tMESSENGER = 'messenger',\n\tWHATSAPP = 'whatsapp',\n\tGMAIL = 'gmail',\n\tLIVECHAT = 'livechat',\n\tGOOGLE_BUSINESS_CHAT = 'gbm',\n\tSHOPIFY = 'shopify',\n\tFACEBOOK = 'facebook',\n\tEMAIL = 'email',\n\tSMTP = 'smtp',\n\tFACEBOOK_CATALOG = 'facebook-catalog',\n\tTASKS = 'tasks',\n\tBIK_LIVECHAT = 'livechat',\n}\n\nexport const Avatar: React.FC<AvatarProps> = (props) => {\n\tconst [imgError, setImgError] = useState<boolean>(false);\n\n\tconst getInitials = () => {\n\t\tconst initials = (props.name || '')\n\t\t\t.split('.')\n\t\t\t.join(' ')\n\t\t\t.split(' ')\n\t\t\t.map((e) => e.charAt(0).toUpperCase())\n\t\t\t.slice(0, 2)\n\t\t\t.join('');\n\n\t\tconst color = BACKGROUND_VS_TEXT_COLOR_MAP[props.background];\n\n\t\tif (props.size === SIZE.LARGE) {\n\t\t\treturn <TitleMedium style={{ color }}>{initials}</TitleMedium>;\n\t\t}\n\t\tif (props.size === SIZE.MEDIUM) {\n\t\t\treturn <TitleSmall style={{ color }}>{initials}</TitleSmall>;\n\t\t}\n\t\tif (props.size === SIZE.SMALL) {\n\t\t\treturn <SubHeading style={{ color }}>{initials}</SubHeading>;\n\t\t}\n\t\t// EXTRA_SMALL: 6.667px / 8px per Figma. BodyTiny's 10px/12px is too large\n\t\t// for the 16px circle (leaves 2px padding instead of the intended 4px).\n\t\treturn (\n\t\t\t<BodyTiny style={{ color, fontSize: '6.667px', lineHeight: '8px' }}>\n\t\t\t\t{initials}\n\t\t\t</BodyTiny>\n\t\t);\n\t};\n\n\tconst getImageBlock = () => {\n\t\tif (props.useNameFallback && (!props.photoUrl || imgError) && props.name) {\n\t\t\treturn <div>{getInitials()}</div>;\n\t\t}\n\t\tif (props.useNameFallback && props.photoUrl && !imgError) {\n\t\t\treturn (\n\t\t\t\t<img\n\t\t\t\t\talt=\"\"\n\t\t\t\t\twidth={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\t\theight={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tborderRadius: props?.borderRadius || '50%',\n\t\t\t\t\t\tobjectFit: 'contain',\n\t\t\t\t\t}}\n\t\t\t\t\tsrc={props.photoUrl}\n\t\t\t\t\tonError={() => {\n\t\t\t\t\t\tsetImgError(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<img\n\t\t\t\talt=\"\"\n\t\t\t\twidth={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\theight={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: props?.borderRadius || '50%',\n\t\t\t\t\tobjectFit: 'contain',\n\t\t\t\t}}\n\t\t\t\tsrc={props.photoUrl}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst getChannelIcon = () => {\n\t\tswitch (props.channelName) {\n\t\t\tcase MESSAGE_CHANNELS.EMAIL:\n\t\t\t\treturn <EmailIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.SMTP:\n\t\t\t\treturn <EmailIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.FACEBOOK:\n\t\t\t\treturn <FacebookIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.FACEBOOK_CATALOG:\n\t\t\t\treturn <FacebookIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.MESSENGER:\n\t\t\t\treturn <FacebookIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.INSTAGRAM:\n\t\t\t\treturn <InstagramIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.WHATSAPP:\n\t\t\t\treturn <WhatsappIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.GMAIL:\n\t\t\t\treturn <GmailIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.TASKS:\n\t\t\t\treturn <TaskIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.BIK_LIVECHAT:\n\t\t\t\treturn <BikLivechatIcon width={11} height={11} />;\n\t\t}\n\t};\n\n\tconst getOnlineStatusIcon = () => {\n\t\treturn props.status ? (\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\tprops.status === 'ONLINE'\n\t\t\t\t\t\t\t? COLORS.special.whatsapp.brand\n\t\t\t\t\t\t\t: COLORS.content.inactive,\n\t\t\t\t\twidth: '8px',\n\t\t\t\t\theight: '8px',\n\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t}}\n\t\t\t></div>\n\t\t) : null;\n\t};\n\n\tconst getPropsType = () => {\n\t\tif (\n\t\t\tprops.type === AVATAR_TYPES.IMAGE &&\n\t\t\t(imgError || !props.photoUrl) &&\n\t\t\tprops.useNameFallback &&\n\t\t\tprops.name\n\t\t) {\n\t\t\treturn AVATAR_TYPES.INITIALS;\n\t\t}\n\n\t\treturn props.type;\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tposition: 'relative',\n\t\t\t}}\n\t\t>\n\t\t\t<AvatarStyle\n\t\t\t\ttype={getPropsType()}\n\t\t\t\tsize={props.size}\n\t\t\t\tbackground={props.background}\n\t\t\t>\n\t\t\t\t{props.type === AVATAR_TYPES.IMAGE && getImageBlock()}\n\t\t\t\t{props.type === AVATAR_TYPES.INITIALS && <div>{getInitials()}</div>}\n\t\t\t\t{props.type === AVATAR_TYPES.ICON && props.icon && (\n\t\t\t\t\t<props.icon\n\t\t\t\t\t\twidth={AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size]}\n\t\t\t\t\t\theight={AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size]}\n\t\t\t\t\t\tcolor={BACKGROUND_VS_TEXT_COLOR_MAP[props.background]}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</AvatarStyle>\n\t\t\t{props.inboxSettings && (\n\t\t\t\t<div\n\t\t\t\t\tdata-test=\"avatar-inbox-badge\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\tleft: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\ttop: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\twidth: 14,\n\t\t\t\t\t\theight: 14,\n\t\t\t\t\t\tborderRadius: props?.borderRadius || '50%',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\tbackgroundColor: props.inboxSettings.isSelected\n\t\t\t\t\t\t\t? props.inboxSettings.isComments\n\t\t\t\t\t\t\t\t? COLORS.content.primary\n\t\t\t\t\t\t\t\t: COLORS.background.brandLight\n\t\t\t\t\t\t\t: props.inboxSettings.isComments\n\t\t\t\t\t\t\t? COLORS.content.primary\n\t\t\t\t\t\t\t: COLORS.surface.standard,\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{getChannelIcon()}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{props.status && (\n\t\t\t\t<div\n\t\t\t\t\tdata-test=\"avatar-status-indicator\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\tleft: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\ttop: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\twidth: 11,\n\t\t\t\t\t\theight: 11,\n\t\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\tbackgroundColor: COLORS.surface.standard,\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{getOnlineStatusIcon()}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["AVATAR_SIZE_VS_ICON_SIZE_MAP","SIZE","BACKGROUND_VS_TEXT_COLOR_MAP","AVATAR_BACKGROUND","COLORS","MESSAGE_CHANNELS","Avatar","props","imgError","setImgError","useState","getInitials","initials","e","color","TitleMedium","TitleSmall","SubHeading","jsx","BodyTiny","getImageBlock","AVATAR_SIZE_MAP","getChannelIcon","EmailIcon","FacebookIcon","InstagramIcon","WhatsappIcon","GmailIcon","TaskIcon","BikLivechatIcon","getOnlineStatusIcon","jsxs","AvatarStyle","AVATAR_TYPES"],"mappings":";;;;;;;;;;;;;AAuBO,MAAMA,IAA+B;AAAA,EAC3C,CAACC,EAAK,WAAW,GAAG;AAAA,EACpB,CAACA,EAAK,KAAK,GAAG;AAAA,EACd,CAACA,EAAK,MAAM,GAAG;AAAA,EACf,CAACA,EAAK,KAAK,GAAG;AACf,GAEaC,IAA+B;AAAA,EAC3C,CAACC,EAAkB,KAAK,GAAGC,EAAO,QAAQ;AAAA,EAC1C,CAACD,EAAkB,KAAK,GAAGC,EAAO,QAAQ;AAAA,EAC1C,CAACD,EAAkB,IAAI,GAAGC,EAAO,QAAQ;AAAA,EACzC,CAACD,EAAkB,KAAK,GAAGC,EAAO,WAAW;AAC9C;AAmBO,IAAWC,sBAAAA,OACjBA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,uBAAuB,OACvBA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA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O;AAAA,cACP,QAAQ;AAAA,cACR,cAAcA,GAAO,gBAAgB;AAAA,cACrC,SAAS;AAAA,cACT,gBAAgB;AAAA,cAChB,iBAAiBA,EAAM,cAAc,aAClCA,EAAM,cAAc,aACnBH,EAAO,QAAQ,UACfA,EAAO,WAAW,aACnBG,EAAM,cAAc,aACpBH,EAAO,QAAQ,UACfA,EAAO,QAAQ;AAAA,cAClB,YAAY;AAAA,YAAA;AAAA,YAGZ,UAAAkB,EAAA;AAAA,UAAe;AAAA,QAAA;AAAA,QAGjBf,EAAM,UACN,gBAAAW;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,aAAU;AAAA,YACV,OAAO;AAAA,cACN,UAAU;AAAA,cACV,MAAMlB,EAA6BO,EAAM,IAAI,IAAI;AAAA,cACjD,KAAKP,EAA6BO,EAAM,IAAI,IAAI;AAAA,cAChD,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,cAAc;AAAA,cACd,SAAS;AAAA,cACT,gBAAgB;AAAA,cAChB,iBAAiBH,EAAO,QAAQ;AAAA,cAChC,YAAY;AAAA,YAAA;AAAA,YAGZ,UAAA0B,EAAA;AAAA,UAAoB;AAAA,QAAA;AAAA,MACtB;AAAA,IAAA;AAAA,EAAA;AAIJ;"}
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../../src/components/avatar/Avatar.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Phone as PhoneIcon } from '@src/icons';\nimport {\n\tBodyTiny,\n\tSubHeading,\n\tTitleMedium,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport BikLivechatIcon from '../../assets/icons/bik_livechat.svg';\nimport EmailIcon from '../../assets/icons/email-channel.svg';\nimport FacebookIcon from '../../assets/icons/facebook_channel.svg';\nimport GmailIcon from '../../assets/icons/gmail.svg';\nimport InstagramIcon from '../../assets/icons/instagram-channel.svg';\nimport TaskIcon from '../../assets/icons/task.svg';\nimport WhatsappIcon from '../../assets/icons/whatsapp_color.svg';\nimport { AvatarStyle, PhoneIconWrapper } from './Avatar.styled';\nimport {\n\tAVATAR_BACKGROUND,\n\tAVATAR_SIZE_MAP,\n\tAVATAR_TYPES,\n\tSIZE,\n} from './AvatarHelper';\n\nexport const AVATAR_SIZE_VS_ICON_SIZE_MAP = {\n\t[SIZE.EXTRA_SMALL]: 10,\n\t[SIZE.SMALL]: 16,\n\t[SIZE.MEDIUM]: 20,\n\t[SIZE.LARGE]: 32,\n};\n\nexport const BACKGROUND_VS_TEXT_COLOR_MAP = {\n\t[AVATAR_BACKGROUND.LIGHT]: COLORS.content.secondary,\n\t[AVATAR_BACKGROUND.WHITE]: COLORS.content.secondary,\n\t[AVATAR_BACKGROUND.DARK]: COLORS.surface.standard,\n\t[AVATAR_BACKGROUND.BRAND]: COLORS.background.inverseLight,\n};\n\nexport type AvatarProps = {\n\ttype: AVATAR_TYPES;\n\tsize: SIZE;\n\tbackground: AVATAR_BACKGROUND;\n\tname?: string;\n\tphotoUrl?: string;\n\ticon?: React.FC<{ width: number; height: number; color: string }>;\n\tuseNameFallback?: boolean;\n\tchannelName?: MESSAGE_CHANNELS;\n\tborderRadius?: string;\n\tinboxSettings?: {\n\t\tisSelected: boolean;\n\t\tisComments: boolean;\n\t};\n\tstatus?: 'ONLINE' | 'OFFLINE' | 'AWAY';\n};\n\nexport const enum MESSAGE_CHANNELS {\n\tINSTAGRAM = 'instagram',\n\tMESSENGER = 'messenger',\n\tWHATSAPP = 'whatsapp',\n\tGMAIL = 'gmail',\n\tLIVECHAT = 'livechat',\n\tGOOGLE_BUSINESS_CHAT = 'gbm',\n\tSHOPIFY = 'shopify',\n\tFACEBOOK = 'facebook',\n\tEMAIL = 'email',\n\tSMTP = 'smtp',\n\tFACEBOOK_CATALOG = 'facebook-catalog',\n\tTASKS = 'tasks',\n\tBIK_LIVECHAT = 'livechat',\n\tVOICE = 'voice',\n}\n\nexport const Avatar: React.FC<AvatarProps> = (props) => {\n\tconst [imgError, setImgError] = useState<boolean>(false);\n\n\tconst getInitials = () => {\n\t\tconst initials = (props.name || '')\n\t\t\t.split('.')\n\t\t\t.join(' ')\n\t\t\t.split(' ')\n\t\t\t.map((e) => e.charAt(0).toUpperCase())\n\t\t\t.slice(0, 2)\n\t\t\t.join('');\n\n\t\tconst color = BACKGROUND_VS_TEXT_COLOR_MAP[props.background];\n\n\t\tif (props.size === SIZE.LARGE) {\n\t\t\treturn <TitleMedium style={{ color }}>{initials}</TitleMedium>;\n\t\t}\n\t\tif (props.size === SIZE.MEDIUM) {\n\t\t\treturn <TitleSmall style={{ color }}>{initials}</TitleSmall>;\n\t\t}\n\t\tif (props.size === SIZE.SMALL) {\n\t\t\treturn <SubHeading style={{ color }}>{initials}</SubHeading>;\n\t\t}\n\t\t// EXTRA_SMALL: 6.667px / 8px per Figma. BodyTiny's 10px/12px is too large\n\t\t// for the 16px circle (leaves 2px padding instead of the intended 4px).\n\t\treturn (\n\t\t\t<BodyTiny style={{ color, fontSize: '6.667px', lineHeight: '8px' }}>\n\t\t\t\t{initials}\n\t\t\t</BodyTiny>\n\t\t);\n\t};\n\n\tconst getImageBlock = () => {\n\t\tif (props.useNameFallback && (!props.photoUrl || imgError) && props.name) {\n\t\t\treturn <div>{getInitials()}</div>;\n\t\t}\n\t\tif (props.useNameFallback && props.photoUrl && !imgError) {\n\t\t\treturn (\n\t\t\t\t<img\n\t\t\t\t\talt=\"\"\n\t\t\t\t\twidth={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\t\theight={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tborderRadius: props?.borderRadius || '50%',\n\t\t\t\t\t\tobjectFit: 'contain',\n\t\t\t\t\t}}\n\t\t\t\t\tsrc={props.photoUrl}\n\t\t\t\t\tonError={() => {\n\t\t\t\t\t\tsetImgError(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<img\n\t\t\t\talt=\"\"\n\t\t\t\twidth={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\theight={AVATAR_SIZE_MAP[props.size]}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: props?.borderRadius || '50%',\n\t\t\t\t\tobjectFit: 'contain',\n\t\t\t\t}}\n\t\t\t\tsrc={props.photoUrl}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst getChannelIcon = () => {\n\t\tswitch (props.channelName) {\n\t\t\tcase MESSAGE_CHANNELS.EMAIL:\n\t\t\t\treturn <EmailIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.SMTP:\n\t\t\t\treturn <EmailIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.FACEBOOK:\n\t\t\t\treturn <FacebookIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.FACEBOOK_CATALOG:\n\t\t\t\treturn <FacebookIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.MESSENGER:\n\t\t\t\treturn <FacebookIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.INSTAGRAM:\n\t\t\t\treturn <InstagramIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.WHATSAPP:\n\t\t\t\treturn <WhatsappIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.GMAIL:\n\t\t\t\treturn <GmailIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.TASKS:\n\t\t\t\treturn <TaskIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.BIK_LIVECHAT:\n\t\t\t\treturn <BikLivechatIcon width={11} height={11} />;\n\t\t\tcase MESSAGE_CHANNELS.VOICE:\n\t\t\t\treturn (\n\t\t\t\t\t<PhoneIconWrapper>\n\t\t\t\t\t\t<PhoneIcon\n\t\t\t\t\t\t\twidth={8}\n\t\t\t\t\t\t\theight={8}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondaryInverse}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PhoneIconWrapper>\n\t\t\t\t);\n\t\t}\n\t};\n\n\tconst getOnlineStatusIcon = () => {\n\t\treturn props.status ? (\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\tprops.status === 'ONLINE'\n\t\t\t\t\t\t\t? COLORS.special.whatsapp.brand\n\t\t\t\t\t\t\t: COLORS.content.inactive,\n\t\t\t\t\twidth: '8px',\n\t\t\t\t\theight: '8px',\n\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t}}\n\t\t\t></div>\n\t\t) : null;\n\t};\n\n\tconst getPropsType = () => {\n\t\tif (\n\t\t\tprops.type === AVATAR_TYPES.IMAGE &&\n\t\t\t(imgError || !props.photoUrl) &&\n\t\t\tprops.useNameFallback &&\n\t\t\tprops.name\n\t\t) {\n\t\t\treturn AVATAR_TYPES.INITIALS;\n\t\t}\n\n\t\treturn props.type;\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tposition: 'relative',\n\t\t\t}}\n\t\t>\n\t\t\t<AvatarStyle\n\t\t\t\ttype={getPropsType()}\n\t\t\t\tsize={props.size}\n\t\t\t\tbackground={props.background}\n\t\t\t>\n\t\t\t\t{props.type === AVATAR_TYPES.IMAGE && getImageBlock()}\n\t\t\t\t{props.type === AVATAR_TYPES.INITIALS && <div>{getInitials()}</div>}\n\t\t\t\t{props.type === AVATAR_TYPES.ICON && props.icon && (\n\t\t\t\t\t<props.icon\n\t\t\t\t\t\twidth={AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size]}\n\t\t\t\t\t\theight={AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size]}\n\t\t\t\t\t\tcolor={BACKGROUND_VS_TEXT_COLOR_MAP[props.background]}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</AvatarStyle>\n\t\t\t{props.inboxSettings && (\n\t\t\t\t<div\n\t\t\t\t\tdata-test=\"avatar-inbox-badge\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\tleft: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\ttop: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\twidth: 14,\n\t\t\t\t\t\theight: 14,\n\t\t\t\t\t\tborderRadius: props?.borderRadius || '50%',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\tbackgroundColor: props.inboxSettings.isSelected\n\t\t\t\t\t\t\t? props.inboxSettings.isComments\n\t\t\t\t\t\t\t\t? COLORS.content.primary\n\t\t\t\t\t\t\t\t: COLORS.background.brandLight\n\t\t\t\t\t\t\t: props.inboxSettings.isComments\n\t\t\t\t\t\t\t? COLORS.content.primary\n\t\t\t\t\t\t\t: COLORS.surface.standard,\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{getChannelIcon()}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{props.status && (\n\t\t\t\t<div\n\t\t\t\t\tdata-test=\"avatar-status-indicator\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\tleft: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\ttop: AVATAR_SIZE_VS_ICON_SIZE_MAP[props.size] + 'px',\n\t\t\t\t\t\twidth: 11,\n\t\t\t\t\t\theight: 11,\n\t\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\tbackgroundColor: COLORS.surface.standard,\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{getOnlineStatusIcon()}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["AVATAR_SIZE_VS_ICON_SIZE_MAP","SIZE","BACKGROUND_VS_TEXT_COLOR_MAP","AVATAR_BACKGROUND","COLORS","MESSAGE_CHANNELS","Avatar","props","imgError","setImgError","useState","getInitials","initials","e","color","TitleMedium","TitleSmall","SubHeading","jsx","BodyTiny","getImageBlock","AVATAR_SIZE_MAP","getChannelIcon","EmailIcon","FacebookIcon","InstagramIcon","WhatsappIcon","GmailIcon","TaskIcon","BikLivechatIcon","PhoneIconWrapper","PhoneIcon","getOnlineStatusIcon","jsxs","AvatarStyle","AVATAR_TYPES"],"mappings":";;;;;;;;;;;;;;AAwBO,MAAMA,IAA+B;AAAA,EAC3C,CAACC,EAAK,WAAW,GAAG;AAAA,EACpB,CAACA,EAAK,KAAK,GAAG;AAAA,EACd,CAACA,EAAK,MAAM,GAAG;AAAA,EACf,CAACA,EAAK,KAAK,GAAG;AACf,GAEaC,IAA+B;AAAA,EAC3C,CAACC,EAAkB,KAAK,GAAGC,EAAO,QAAQ;AAAA,EAC1C,CAACD,EAAkB,KAAK,GAAGC,EAAO,QAAQ;AAAA,EAC1C,CAACD,EAAkB,IAAI,GAAGC,EAAO,QAAQ;AAAA,EACzC,CAACD,EAAkB,KAAK,GAAGC,EAAO,WAAW;AAC9C;AAmBO,IAAWC,sBAAAA,OACjBA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,uBAAuB,OACvBA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,mBAAmB,oBACnBA,EAAA,QAAQ,SACRA,EAAA,eAAe,YACfA,EAAA,QAAQ,SAdSA,IAAAA,KAAA,CAAA,CAAA;AAiBX,MAAMC,IAAgC,CAACC,MAAU;AACvD,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAkB,EAAK,GAEjDC,IAAc,MAAM;AACzB,UAAMC,KA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,gBAAgB;AAAA,cACrC,SAAS;AAAA,cACT,gBAAgB;AAAA,cAChB,iBAAiBA,EAAM,cAAc,aAClCA,EAAM,cAAc,aACnBH,EAAO,QAAQ,UACfA,EAAO,WAAW,aACnBG,EAAM,cAAc,aACpBH,EAAO,QAAQ,UACfA,EAAO,QAAQ;AAAA,cAClB,YAAY;AAAA,YAAA;AAAA,YAGZ,UAAAkB,EAAA;AAAA,UAAe;AAAA,QAAA;AAAA,QAGjBf,EAAM,UACN,gBAAAW;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,aAAU;AAAA,YACV,OAAO;AAAA,cACN,UAAU;AAAA,cACV,MAAMlB,EAA6BO,EAAM,IAAI,IAAI;AAAA,cACjD,KAAKP,EAA6BO,EAAM,IAAI,IAAI;AAAA,cAChD,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,cAAc;AAAA,cACd,SAAS;AAAA,cACT,gBAAgB;AAAA,cAChB,iBAAiBH,EAAO,QAAQ;AAAA,cAChC,YAAY;AAAA,YAAA;AAAA,YAGZ,UAAA4B,EAAA;AAAA,UAAoB;AAAA,QAAA;AAAA,MACtB;AAAA,IAAA;AAAA,EAAA;AAIJ;"}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import o from "styled-components";
|
|
2
|
-
import { AVATAR_SIZE_MAP as
|
|
3
|
-
import { COLORS as
|
|
4
|
-
const
|
|
5
|
-
width: ${(r) =>
|
|
6
|
-
height: ${(r) =>
|
|
2
|
+
import { AVATAR_SIZE_MAP as t, AVATAR_TYPES as d, AVATAR_BACKGROUND as n } from "./AvatarHelper.js";
|
|
3
|
+
import { COLORS as e } from "../../constants/Theme.js";
|
|
4
|
+
const s = o.div`
|
|
5
|
+
width: ${(r) => t[r.size] + "px"};
|
|
6
|
+
height: ${(r) => t[r.size] + "px"};
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
align-items: center;
|
|
10
|
-
background-color: ${(r) => r.type ===
|
|
11
|
-
border: ${(r) => r.background ===
|
|
10
|
+
background-color: ${(r) => r.type === d.IMAGE ? "null" : r.background === n.LIGHT ? e.background.base : r.background === n.WHITE ? e.surface.standard : r.background === n.BRAND ? e.background.brandLight : e.background.inverse};
|
|
11
|
+
border: ${(r) => r.background === n.LIGHT || r.background === n.WHITE ? "1px solid " + e.stroke.primary : 0};
|
|
12
12
|
border-radius: 50%;
|
|
13
|
+
`, u = o.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
width: 11px;
|
|
18
|
+
height: 11px;
|
|
19
|
+
border-radius: 4px;
|
|
20
|
+
background-color: ${e.content.secondary};
|
|
13
21
|
`;
|
|
14
22
|
export {
|
|
15
|
-
|
|
23
|
+
s as AvatarStyle,
|
|
24
|
+
u as PhoneIconWrapper
|
|
16
25
|
};
|
|
17
26
|
//# sourceMappingURL=Avatar.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.styled.js","sources":["../../../../src/components/avatar/Avatar.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport {\n\tAVATAR_BACKGROUND,\n\tAVATAR_SIZE_MAP,\n\tAVATAR_TYPES,\n\tSIZE,\n} from '@src/components/avatar/AvatarHelper';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const AvatarStyle = styled.div<{\n\tsize: SIZE;\n\tbackground: AVATAR_BACKGROUND;\n\ttype: AVATAR_TYPES;\n}>`\n\twidth: ${(props) => AVATAR_SIZE_MAP[props.size] + 'px'};\n\theight: ${(props) => AVATAR_SIZE_MAP[props.size] + 'px'};\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbackground-color: ${(props) =>\n\t\tprops.type === AVATAR_TYPES.IMAGE\n\t\t\t? 'null'\n\t\t\t: props.background === AVATAR_BACKGROUND.LIGHT\n\t\t\t? COLORS.background.base\n\t\t\t: props.background === AVATAR_BACKGROUND.WHITE\n\t\t\t? COLORS.surface.standard\n\t\t\t: props.background === AVATAR_BACKGROUND.BRAND\n\t\t\t? COLORS.background.brandLight\n\t\t\t: COLORS.background.inverse};\n\tborder: ${(props) =>\n\t\tprops.background === AVATAR_BACKGROUND.LIGHT ||\n\t\tprops.background === AVATAR_BACKGROUND.WHITE\n\t\t\t? '1px solid ' + COLORS.stroke.primary\n\t\t\t: 0};\n\tborder-radius: 50%;\n`;\n"],"names":["AvatarStyle","styled","props","AVATAR_SIZE_MAP","AVATAR_TYPES","AVATAR_BACKGROUND","COLORS"],"mappings":";;;AASO,MAAMA,IAAcC,EAAO;AAAA,UAKxB,CAACC,MAAUC,EAAgBD,EAAM,IAAI,IAAI,IAAI;AAAA,WAC5C,CAACA,MAAUC,EAAgBD,EAAM,IAAI,IAAI,IAAI;AAAA;AAAA;AAAA;AAAA,qBAInC,CAACA,MACpBA,EAAM,SAASE,EAAa,QACzB,SACAF,EAAM,eAAeG,EAAkB,QACvCC,EAAO,WAAW,OAClBJ,EAAM,eAAeG,EAAkB,QACvCC,EAAO,QAAQ,WACfJ,EAAM,eAAeG,EAAkB,QACvCC,EAAO,WAAW,aAClBA,EAAO,WAAW,OAAO;AAAA,WACnB,CAACJ,MACVA,EAAM,eAAeG,EAAkB,SACvCH,EAAM,eAAeG,EAAkB,QACpC,eAAeC,EAAO,OAAO,UAC7B,CAAC;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"Avatar.styled.js","sources":["../../../../src/components/avatar/Avatar.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport {\n\tAVATAR_BACKGROUND,\n\tAVATAR_SIZE_MAP,\n\tAVATAR_TYPES,\n\tSIZE,\n} from '@src/components/avatar/AvatarHelper';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const AvatarStyle = styled.div<{\n\tsize: SIZE;\n\tbackground: AVATAR_BACKGROUND;\n\ttype: AVATAR_TYPES;\n}>`\n\twidth: ${(props) => AVATAR_SIZE_MAP[props.size] + 'px'};\n\theight: ${(props) => AVATAR_SIZE_MAP[props.size] + 'px'};\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbackground-color: ${(props) =>\n\t\tprops.type === AVATAR_TYPES.IMAGE\n\t\t\t? 'null'\n\t\t\t: props.background === AVATAR_BACKGROUND.LIGHT\n\t\t\t? COLORS.background.base\n\t\t\t: props.background === AVATAR_BACKGROUND.WHITE\n\t\t\t? COLORS.surface.standard\n\t\t\t: props.background === AVATAR_BACKGROUND.BRAND\n\t\t\t? COLORS.background.brandLight\n\t\t\t: COLORS.background.inverse};\n\tborder: ${(props) =>\n\t\tprops.background === AVATAR_BACKGROUND.LIGHT ||\n\t\tprops.background === AVATAR_BACKGROUND.WHITE\n\t\t\t? '1px solid ' + COLORS.stroke.primary\n\t\t\t: 0};\n\tborder-radius: 50%;\n`;\n\nexport const PhoneIconWrapper = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 11px;\n\theight: 11px;\n\tborder-radius: 4px;\n\tbackground-color: ${COLORS.content.secondary};\n`;\n"],"names":["AvatarStyle","styled","props","AVATAR_SIZE_MAP","AVATAR_TYPES","AVATAR_BACKGROUND","COLORS","PhoneIconWrapper"],"mappings":";;;AASO,MAAMA,IAAcC,EAAO;AAAA,UAKxB,CAACC,MAAUC,EAAgBD,EAAM,IAAI,IAAI,IAAI;AAAA,WAC5C,CAACA,MAAUC,EAAgBD,EAAM,IAAI,IAAI,IAAI;AAAA;AAAA;AAAA;AAAA,qBAInC,CAACA,MACpBA,EAAM,SAASE,EAAa,QACzB,SACAF,EAAM,eAAeG,EAAkB,QACvCC,EAAO,WAAW,OAClBJ,EAAM,eAAeG,EAAkB,QACvCC,EAAO,QAAQ,WACfJ,EAAM,eAAeG,EAAkB,QACvCC,EAAO,WAAW,aAClBA,EAAO,WAAW,OAAO;AAAA,WACnB,CAACJ,MACVA,EAAM,eAAeG,EAAkB,SACvCH,EAAM,eAAeG,EAAkB,QACpC,eAAeC,EAAO,OAAO,UAC7B,CAAC;AAAA;AAAA,GAIOC,IAAmBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOlBK,EAAO,QAAQ,SAAS;AAAA;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as t, Fragment as l, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { COLORS as i } from "../../constants/Theme.js";
|
|
3
|
-
import { Spinner as
|
|
4
|
-
import { TitleSmall as o, BodyCaption as
|
|
5
|
-
import { Container as d, Loader as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
const u = (e) => /* @__PURE__ */ t(l, { children: e.tooltip ? /* @__PURE__ */ t(
|
|
3
|
+
import { Spinner as c } from "../spinner/Spinner.js";
|
|
4
|
+
import { TitleSmall as o, BodyCaption as r } from "../TypographyStyle.js";
|
|
5
|
+
import { Container as d, Loader as h } from "./CardSelector.styled.js";
|
|
6
|
+
import { Tooltip as m } from "../tooltips/Tooltip.js";
|
|
7
|
+
const u = (e) => /* @__PURE__ */ t(l, { children: e.tooltip ? /* @__PURE__ */ t(m, { title: e.tooltip, children: /* @__PURE__ */ t(
|
|
8
8
|
d,
|
|
9
9
|
{
|
|
10
|
+
"data-testid": "card-selector-container",
|
|
10
11
|
style: {
|
|
11
12
|
alignItems: e.title && e.subtitle ? "flex-start" : "center"
|
|
12
13
|
},
|
|
@@ -17,11 +18,12 @@ const u = (e) => /* @__PURE__ */ t(l, { children: e.tooltip ? /* @__PURE__ */ t(
|
|
|
17
18
|
!e.disabled && !e.loading && e.onCardClick(e.id);
|
|
18
19
|
},
|
|
19
20
|
isTooltipPresent: !!e.tooltip,
|
|
20
|
-
children: /* @__PURE__ */ t(
|
|
21
|
+
children: /* @__PURE__ */ t(a, { ...e })
|
|
21
22
|
}
|
|
22
23
|
) }) : /* @__PURE__ */ t(
|
|
23
24
|
d,
|
|
24
25
|
{
|
|
26
|
+
"data-testid": "card-selector-container",
|
|
25
27
|
style: {
|
|
26
28
|
alignItems: e.title && e.subtitle ? "flex-start" : "center"
|
|
27
29
|
},
|
|
@@ -32,9 +34,9 @@ const u = (e) => /* @__PURE__ */ t(l, { children: e.tooltip ? /* @__PURE__ */ t(
|
|
|
32
34
|
!e.disabled && !e.loading && e.onCardClick(e.id);
|
|
33
35
|
},
|
|
34
36
|
isTooltipPresent: !!e.tooltip,
|
|
35
|
-
children: /* @__PURE__ */ t(
|
|
37
|
+
children: /* @__PURE__ */ t(a, { ...e })
|
|
36
38
|
}
|
|
37
|
-
) }),
|
|
39
|
+
) }), a = (e) => /* @__PURE__ */ t(l, { children: e.loading ? /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(c, { size: "large" }) }) : /* @__PURE__ */ n(l, { children: [
|
|
38
40
|
e?.icon && /* @__PURE__ */ t("div", { style: { width: 24, height: 24 }, children: /* @__PURE__ */ t(
|
|
39
41
|
e.icon,
|
|
40
42
|
{
|
|
@@ -53,7 +55,7 @@ const u = (e) => /* @__PURE__ */ t(l, { children: e.tooltip ? /* @__PURE__ */ t(
|
|
|
53
55
|
}
|
|
54
56
|
),
|
|
55
57
|
e.subtitle && /* @__PURE__ */ t(
|
|
56
|
-
|
|
58
|
+
r,
|
|
57
59
|
{
|
|
58
60
|
style: {
|
|
59
61
|
marginTop: e.title ? 4 : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardSelector.js","sources":["../../../../src/components/card-selector/CardSelector.tsx"],"sourcesContent":["import React from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { Spinner } from '../spinner/Spinner';\nimport { Tooltip } from '../tooltips';\nimport { BodyCaption, TitleSmall } from '../TypographyStyle';\nimport { Container, Loader } from './CardSelector.styled';\n\nexport type CardSelectorProps = {\n\tid: number;\n\ticon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\ttitle?: string;\n\tsubtitle?: string;\n\tselected: boolean;\n\tloading?: boolean;\n\tdisabled?: boolean;\n\tdataTestId?: string;\n\ttooltip?: string;\n};\n\ntype CardSelectorInternalProps = CardSelectorProps & {\n\tonCardClick: (id: number) => void;\n};\n\nexport const CardSelector: React.FC<CardSelectorInternalProps> = (props) => {\n\treturn (\n\t\t<>\n\t\t\t{props.tooltip ? (\n\t\t\t\t<Tooltip title={props.tooltip}>\n\t\t\t\t\t<Container\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\talignItems:\n\t\t\t\t\t\t\t\tprops.title && props.subtitle ? 'flex-start' : 'center',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tselected={props.selected}\n\t\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\t\tloading={props.loading ?? false}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tif (!props.disabled && !props.loading) {\n\t\t\t\t\t\t\t\tprops.onCardClick(props.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tisTooltipPresent={!!props.tooltip}\n\t\t\t\t\t>\n\t\t\t\t\t\t<EachSelector {...props} />\n\t\t\t\t\t</Container>\n\t\t\t\t</Tooltip>\n\t\t\t) : (\n\t\t\t\t<Container\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\talignItems: props.title && props.subtitle ? 'flex-start' : 'center',\n\t\t\t\t\t}}\n\t\t\t\t\tselected={props.selected}\n\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\tloading={props.loading ?? false}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tif (!props.disabled && !props.loading) {\n\t\t\t\t\t\t\tprops.onCardClick(props.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tisTooltipPresent={!!props.tooltip}\n\t\t\t\t>\n\t\t\t\t\t<EachSelector {...props} />\n\t\t\t\t</Container>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nconst EachSelector: React.FC<CardSelectorInternalProps> = (props) => {\n\treturn (\n\t\t<>\n\t\t\t{props.loading ? (\n\t\t\t\t<Loader>\n\t\t\t\t\t<Spinner size={'large'} />\n\t\t\t\t</Loader>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{props?.icon && (\n\t\t\t\t\t\t<div style={{ width: 24, height: 24 }}>\n\t\t\t\t\t\t\t<props.icon\n\t\t\t\t\t\t\t\twidth={24}\n\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\tprops.selected\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.brand\n\t\t\t\t\t\t\t\t\t\t: props.disabled\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.placeholder\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div data-test={props?.dataTestId}>\n\t\t\t\t\t\t{props.title && (\n\t\t\t\t\t\t\t<TitleSmall\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tcolor: props.selected\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.brand\n\t\t\t\t\t\t\t\t\t\t: props.disabled\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{props.title}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.subtitle && (\n\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tmarginTop: props.title ? 4 : 0,\n\t\t\t\t\t\t\t\t\tcolor: props.selected\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.brand\n\t\t\t\t\t\t\t\t\t\t: props.disabled\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{props.subtitle}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n};\n"],"names":["CardSelector","props","Tooltip","jsx","Container","EachSelector","Fragment","Loader","Spinner","jsxs","COLORS","TitleSmall","BodyCaption"],"mappings":";;;;;;AAuBO,MAAMA,IAAoD,CAACC,6BAG9D,UAAAA,EAAM,4BACLC,GAAA,EAAQ,OAAOD,EAAM,SACrB,UAAA,gBAAAE;AAAA,EAACC;AAAA,EAAA;AAAA,IACA,OAAO;AAAA,MACN,YACCH,EAAM,SAASA,EAAM,WAAW,eAAe;AAAA,IAAA;AAAA,IAEjD,UAAUA,EAAM;AAAA,IAChB,UAAUA,EAAM,YAAY;AAAA,IAC5B,SAASA,EAAM,WAAW;AAAA,IAC1B,SAAS,MAAM;AACd,MAAI,CAACA,EAAM,YAAY,CAACA,EAAM,WAC7BA,EAAM,YAAYA,EAAM,EAAE;AAAA,IAE5B;AAAA,IACA,kBAAkB,CAAC,CAACA,EAAM;AAAA,IAE1B,UAAA,gBAAAE,EAACE,GAAA,EAAc,GAAGJ,EAAA,CAAO;AAAA,EAAA;AAAA,GAE3B,IAEA,gBAAAE;AAAA,EAACC;AAAA,EAAA;AAAA,IACA,OAAO;AAAA,MACN,YAAYH,EAAM,SAASA,EAAM,WAAW,eAAe;AAAA,IAAA;AAAA,IAE5D,UAAUA,EAAM;AAAA,IAChB,UAAUA,EAAM,YAAY;AAAA,IAC5B,SAASA,EAAM,WAAW;AAAA,IAC1B,SAAS,MAAM;AACd,MAAI,CAACA,EAAM,YAAY,CAACA,EAAM,WAC7BA,EAAM,YAAYA,EAAM,EAAE;AAAA,IAE5B;AAAA,IACA,kBAAkB,CAAC,CAACA,EAAM;AAAA,IAE1B,UAAA,gBAAAE,EAACE,GAAA,EAAc,GAAGJ,EAAA,CAAO;AAAA,EAAA;AAAA,GAG5B,GAIII,IAAoD,CAACJ,MAEzD,gBAAAE,EAAAG,GAAA,EACE,UAAAL,EAAM,UACN,gBAAAE,EAACI,GAAA,EACA,UAAA,gBAAAJ,EAACK,GAAA,EAAQ,MAAM,QAAA,CAAS,EAAA,CACzB,IAEA,gBAAAC,EAAAH,GAAA,EACE,UAAA;AAAA,EAAAL,GAAO,0BACN,OAAA,EAAI,OAAO,EAAE,OAAO,IAAI,QAAQ,GAAA,GAChC,UAAA,gBAAAE;AAAA,IAACF,EAAM;AAAA,IAAN;AAAA,MACA,OAAO;AAAA,MACP,OACCA,EAAM,WACHS,EAAO,QAAQ,QACfT,EAAM,WACNS,EAAO,QAAQ,WACfA,EAAO,QAAQ;AAAA,IAAA;AAAA,EAAA,GAGrB;AAAA,EAED,gBAAAD,EAAC,OAAA,EAAI,aAAWR,GAAO,YACrB,UAAA;AAAA,IAAAA,EAAM,SACN,gBAAAE;AAAA,MAACQ;AAAA,MAAA;AAAA,QACA,OAAO;AAAA,UACN,OAAOV,EAAM,WACVS,EAAO,QAAQ,QACfT,EAAM,WACNS,EAAO,QAAQ,WACfA,EAAO,QAAQ;AAAA,QAAA;AAAA,QAGlB,UAAAT,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,IAGRA,EAAM,YACN,gBAAAE;AAAA,MAACS;AAAA,MAAA;AAAA,QACA,OAAO;AAAA,UACN,WAAWX,EAAM,QAAQ,IAAI;AAAA,UAC7B,OAAOA,EAAM,WACVS,EAAO,QAAQ,QACfT,EAAM,WACNS,EAAO,QAAQ,WACfA,EAAO,QAAQ;AAAA,QAAA;AAAA,QAGlB,UAAAT,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,EAAA,CAEF;AAAA,EAAA,CACD,EAAA,CAEF;"}
|
|
1
|
+
{"version":3,"file":"CardSelector.js","sources":["../../../../src/components/card-selector/CardSelector.tsx"],"sourcesContent":["import React from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { Spinner } from '../spinner/Spinner';\nimport { Tooltip } from '../tooltips';\nimport { BodyCaption, TitleSmall } from '../TypographyStyle';\nimport { Container, Loader } from './CardSelector.styled';\n\nexport type CardSelectorProps = {\n\tid: number;\n\ticon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\ttitle?: string;\n\tsubtitle?: string;\n\tselected: boolean;\n\tloading?: boolean;\n\tdisabled?: boolean;\n\tdataTestId?: string;\n\ttooltip?: string;\n};\n\ntype CardSelectorInternalProps = CardSelectorProps & {\n\tonCardClick: (id: number) => void;\n};\n\nexport const CardSelector: React.FC<CardSelectorInternalProps> = (props) => {\n\treturn (\n\t\t<>\n\t\t\t{props.tooltip ? (\n\t\t\t\t<Tooltip title={props.tooltip}>\n\t\t\t\t\t<Container\n\t\t\t\t\t\tdata-testid=\"card-selector-container\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\talignItems:\n\t\t\t\t\t\t\t\tprops.title && props.subtitle ? 'flex-start' : 'center',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tselected={props.selected}\n\t\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\t\tloading={props.loading ?? false}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tif (!props.disabled && !props.loading) {\n\t\t\t\t\t\t\t\tprops.onCardClick(props.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tisTooltipPresent={!!props.tooltip}\n\t\t\t\t\t>\n\t\t\t\t\t\t<EachSelector {...props} />\n\t\t\t\t\t</Container>\n\t\t\t\t</Tooltip>\n\t\t\t) : (\n\t\t\t\t<Container\n\t\t\t\t\tdata-testid=\"card-selector-container\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\talignItems: props.title && props.subtitle ? 'flex-start' : 'center',\n\t\t\t\t\t}}\n\t\t\t\t\tselected={props.selected}\n\t\t\t\t\tdisabled={props.disabled ?? false}\n\t\t\t\t\tloading={props.loading ?? false}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tif (!props.disabled && !props.loading) {\n\t\t\t\t\t\t\tprops.onCardClick(props.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tisTooltipPresent={!!props.tooltip}\n\t\t\t\t>\n\t\t\t\t\t<EachSelector {...props} />\n\t\t\t\t</Container>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nconst EachSelector: React.FC<CardSelectorInternalProps> = (props) => {\n\treturn (\n\t\t<>\n\t\t\t{props.loading ? (\n\t\t\t\t<Loader>\n\t\t\t\t\t<Spinner size={'large'} />\n\t\t\t\t</Loader>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{props?.icon && (\n\t\t\t\t\t\t<div style={{ width: 24, height: 24 }}>\n\t\t\t\t\t\t\t<props.icon\n\t\t\t\t\t\t\t\twidth={24}\n\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\tprops.selected\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.brand\n\t\t\t\t\t\t\t\t\t\t: props.disabled\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.placeholder\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div data-test={props?.dataTestId}>\n\t\t\t\t\t\t{props.title && (\n\t\t\t\t\t\t\t<TitleSmall\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tcolor: props.selected\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.brand\n\t\t\t\t\t\t\t\t\t\t: props.disabled\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{props.title}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.subtitle && (\n\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tmarginTop: props.title ? 4 : 0,\n\t\t\t\t\t\t\t\t\tcolor: props.selected\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.brand\n\t\t\t\t\t\t\t\t\t\t: props.disabled\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{props.subtitle}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n};\n"],"names":["CardSelector","props","Tooltip","jsx","Container","EachSelector","Fragment","Loader","Spinner","jsxs","COLORS","TitleSmall","BodyCaption"],"mappings":";;;;;;AAuBO,MAAMA,IAAoD,CAACC,6BAG9D,UAAAA,EAAM,4BACLC,GAAA,EAAQ,OAAOD,EAAM,SACrB,UAAA,gBAAAE;AAAA,EAACC;AAAA,EAAA;AAAA,IACA,eAAY;AAAA,IACZ,OAAO;AAAA,MACN,YACCH,EAAM,SAASA,EAAM,WAAW,eAAe;AAAA,IAAA;AAAA,IAEjD,UAAUA,EAAM;AAAA,IAChB,UAAUA,EAAM,YAAY;AAAA,IAC5B,SAASA,EAAM,WAAW;AAAA,IAC1B,SAAS,MAAM;AACd,MAAI,CAACA,EAAM,YAAY,CAACA,EAAM,WAC7BA,EAAM,YAAYA,EAAM,EAAE;AAAA,IAE5B;AAAA,IACA,kBAAkB,CAAC,CAACA,EAAM;AAAA,IAE1B,UAAA,gBAAAE,EAACE,GAAA,EAAc,GAAGJ,EAAA,CAAO;AAAA,EAAA;AAAA,GAE3B,IAEA,gBAAAE;AAAA,EAACC;AAAA,EAAA;AAAA,IACA,eAAY;AAAA,IACZ,OAAO;AAAA,MACN,YAAYH,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AAQ,IAAI;AAAA,UAC7B,OAAOA,EAAM,WACVS,EAAO,QAAQ,QACfT,EAAM,WACNS,EAAO,QAAQ,WACfA,EAAO,QAAQ;AAAA,QAAA;AAAA,QAGlB,UAAAT,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,EAAA,CAEF;AAAA,EAAA,CACD,EAAA,CAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardSelectorGroup.js","sources":["../../../../src/components/card-selector/CardSelectorGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { CardSelector, CardSelectorProps } from './CardSelector';\n\nexport type CardSelectorGroupProps = {\n\tgap?: number;\n\talign?: 'horizontal' | 'vertical';\n\tcards: CardSelectorProps[];\n\tonClick: (id: number) => void;\n\t'data-test': string;\n};\n\nexport const CardSelectorGroup: React.FC<CardSelectorGroupProps> = (props) => {\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: props.align === 'vertical' ? 'column' : 'row',\n\t\t\t\tgap: props.gap || 16,\n\t\t\t}}\n\t\t>\n\t\t\t{props.cards.map((card) => (\n\t\t\t\t<div key={card.id} style={{ display: 'flex', flex: 1 }}>\n\t\t\t\t\t<CardSelector\n\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\tid={card.id}\n\t\t\t\t\t\ticon={card.icon}\n\t\t\t\t\t\ttitle={card.title}\n\t\t\t\t\t\tsubtitle={card.subtitle}\n\t\t\t\t\t\tselected={card.selected}\n\t\t\t\t\t\tonCardClick={props.onClick}\n\t\t\t\t\t\tloading={card.loading}\n\t\t\t\t\t\tdisabled={card.disabled}\n\t\t\t\t\t\tdataTestId={card.dataTestId}\n\t\t\t\t\t\ttooltip={card.tooltip}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n"],"names":["CardSelectorGroup","props","jsx","card","CardSelector"],"mappings":";;AAWO,MAAMA,IAAsD,CAACC,MAElE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,OAAO;AAAA,MACN,SAAS;AAAA,MACT,eAAeD,EAAM,UAAU,aAAa,WAAW;AAAA,MACvD,KAAKA,EAAM,OAAO;AAAA,IAAA;AAAA,IAGlB,UAAAA,EAAM,MAAM,IAAI,CAACE,MACjB,gBAAAD,EAAC,OAAA,EAAkB,OAAO,EAAE,SAAS,QAAQ,MAAM,KAClD,UAAA,gBAAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACA,aAAWH,EAAM,WAAW;AAAA,QAC5B,IAAIE,EAAK;AAAA,QACT,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,UAAUA,EAAK;AAAA,QACf,UAAUA,EAAK;AAAA,QACf,aAAaF,EAAM;AAAA,QACnB,SAASE,EAAK;AAAA,QACd,UAAUA,EAAK;AAAA,QACf,YAAYA,EAAK;AAAA,QACjB,SAASA,EAAK;AAAA,MAAA;AAAA,IAAA,EACf,GAbSA,EAAK,EAcf,CACA;AAAA,EAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"CardSelectorGroup.js","sources":["../../../../src/components/card-selector/CardSelectorGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { CardSelector, CardSelectorProps } from './CardSelector';\n\nexport type CardSelectorGroupProps = {\n\tgap?: number;\n\talign?: 'horizontal' | 'vertical';\n\tcards: CardSelectorProps[];\n\tonClick: (id: number) => void;\n\t'data-test': string;\n};\n\nexport const CardSelectorGroup: React.FC<CardSelectorGroupProps> = (props) => {\n\treturn (\n\t\t<div\n\t\t\tdata-testid=\"card-selector-group\"\n\t\t\tstyle={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: props.align === 'vertical' ? 'column' : 'row',\n\t\t\t\tgap: props.gap || 16,\n\t\t\t}}\n\t\t>\n\t\t\t{props.cards.map((card) => (\n\t\t\t\t<div key={card.id} style={{ display: 'flex', flex: 1 }}>\n\t\t\t\t\t<CardSelector\n\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\tid={card.id}\n\t\t\t\t\t\ticon={card.icon}\n\t\t\t\t\t\ttitle={card.title}\n\t\t\t\t\t\tsubtitle={card.subtitle}\n\t\t\t\t\t\tselected={card.selected}\n\t\t\t\t\t\tonCardClick={props.onClick}\n\t\t\t\t\t\tloading={card.loading}\n\t\t\t\t\t\tdisabled={card.disabled}\n\t\t\t\t\t\tdataTestId={card.dataTestId}\n\t\t\t\t\t\ttooltip={card.tooltip}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n"],"names":["CardSelectorGroup","props","jsx","card","CardSelector"],"mappings":";;AAWO,MAAMA,IAAsD,CAACC,MAElE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,eAAY;AAAA,IACZ,OAAO;AAAA,MACN,SAAS;AAAA,MACT,eAAeD,EAAM,UAAU,aAAa,WAAW;AAAA,MACvD,KAAKA,EAAM,OAAO;AAAA,IAAA;AAAA,IAGlB,UAAAA,EAAM,MAAM,IAAI,CAACE,MACjB,gBAAAD,EAAC,OAAA,EAAkB,OAAO,EAAE,SAAS,QAAQ,MAAM,KAClD,UAAA,gBAAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACA,aAAWH,EAAM,WAAW;AAAA,QAC5B,IAAIE,EAAK;AAAA,QACT,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,UAAUA,EAAK;AAAA,QACf,UAAUA,EAAK;AAAA,QACf,aAAaF,EAAM;AAAA,QACnB,SAASE,EAAK;AAAA,QACd,UAAUA,EAAK;AAAA,QACf,YAAYA,EAAK;AAAA,QACjB,SAASA,EAAK;AAAA,MAAA;AAAA,IAAA,EACf,GAbSA,EAAK,EAcf,CACA;AAAA,EAAA;AAAA;"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
1
|
+
import { jsx as r, Fragment as o } from "react/jsx-runtime";
|
|
2
2
|
import i from "../../assets/icons/chevronLeft.svg.js";
|
|
3
|
-
import
|
|
4
|
-
import { Carousel as
|
|
3
|
+
import a from "../../assets/icons/chevronRight.svg.js";
|
|
4
|
+
import { Carousel as n } from "@trendyol-js/react-carousel";
|
|
5
5
|
import s from "styled-components";
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const l = () => /* @__PURE__ */ r(e, { className: "left", "data-testid": "carousel-left-arrow", children: /* @__PURE__ */ r(i, { width: 16, height: 16, color: "#fff" }) }), h = () => /* @__PURE__ */ r(e, { className: "right", "data-testid": "carousel-right-arrow", children: /* @__PURE__ */ r(a, { width: 16, height: 16, color: "#fff" }) }), u = (t) => /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(
|
|
7
|
+
n,
|
|
8
8
|
{
|
|
9
|
-
leftArrow: /* @__PURE__ */ r(
|
|
9
|
+
leftArrow: /* @__PURE__ */ r(l, {}),
|
|
10
10
|
rightArrow: /* @__PURE__ */ r(h, {}),
|
|
11
11
|
...t,
|
|
12
12
|
children: t.children
|
|
13
13
|
}
|
|
14
|
-
) }),
|
|
14
|
+
) }), e = s.div`
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
margin: 0 8px;
|
|
17
17
|
width: 50px;
|
|
@@ -34,6 +34,6 @@ const a = () => /* @__PURE__ */ r(o, { className: "left", children: /* @__PURE__
|
|
|
34
34
|
}
|
|
35
35
|
`;
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
u as Carousel
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sources":["../../../../src/components/carousel/carousel.tsx"],"sourcesContent":["import ChevronLeft from '@src/assets/icons/chevronLeft.svg';\nimport ChevronRight from '@src/assets/icons/chevronRight.svg';\nimport { Carousel as ReactCarousel } from '@trendyol-js/react-carousel';\nimport { CarouselProps } from '@trendyol-js/react-carousel/dist/types/components/carousel';\nimport styled from 'styled-components';\n\nconst LeftArrow = () => {\n\treturn (\n\t\t<ArrowContainer className=\"left\">\n\t\t\t<ChevronLeft width={16} height={16} color=\"#fff\" />\n\t\t</ArrowContainer>\n\t);\n};\n\nconst RightArrow = () => {\n\treturn (\n\t\t<ArrowContainer className=\"right\">\n\t\t\t<ChevronRight width={16} height={16} color=\"#fff\" />\n\t\t</ArrowContainer>\n\t);\n};\n\nexport const Carousel = (props: CarouselProps) => {\n\treturn (\n\t\t<>\n\t\t\t<ReactCarousel\n\t\t\t\tleftArrow={<LeftArrow />}\n\t\t\t\trightArrow={<RightArrow />}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</ReactCarousel>\n\t\t</>\n\t);\n};\n\nconst ArrowContainer = styled.div`\n\tcursor: pointer;\n\tmargin: 0 8px;\n\twidth: 50px;\n\theight: 50px;\n\tborder-radius: 25px;\n\tdisplay: flex;\n\talign-items: center;\n\tbackground-color: rgba(0, 0, 0, 0.4);\n\tjustify-content: center;\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 50%;\n\t&.left {\n\t\ttransform: translate(0%, -50%);\n\t\tleft: 0;\n\t}\n\t&.right {\n\t\ttransform: translate(0%, -50%);\n\t\tright: 0;\n\t}\n`;\n"],"names":["LeftArrow","jsx","ArrowContainer","ChevronLeft","RightArrow","ChevronRight","Carousel","props","Fragment","ReactCarousel","styled"],"mappings":";;;;;AAMA,MAAMA,IAAY,MAEhB,gBAAAC,EAACC,GAAA,EAAe,WAAU,
|
|
1
|
+
{"version":3,"file":"carousel.js","sources":["../../../../src/components/carousel/carousel.tsx"],"sourcesContent":["import ChevronLeft from '@src/assets/icons/chevronLeft.svg';\nimport ChevronRight from '@src/assets/icons/chevronRight.svg';\nimport { Carousel as ReactCarousel } from '@trendyol-js/react-carousel';\nimport { CarouselProps } from '@trendyol-js/react-carousel/dist/types/components/carousel';\nimport styled from 'styled-components';\n\nconst LeftArrow = () => {\n\treturn (\n\t\t<ArrowContainer className=\"left\" data-testid=\"carousel-left-arrow\">\n\t\t\t<ChevronLeft width={16} height={16} color=\"#fff\" />\n\t\t</ArrowContainer>\n\t);\n};\n\nconst RightArrow = () => {\n\treturn (\n\t\t<ArrowContainer className=\"right\" data-testid=\"carousel-right-arrow\">\n\t\t\t<ChevronRight width={16} height={16} color=\"#fff\" />\n\t\t</ArrowContainer>\n\t);\n};\n\nexport const Carousel = (props: CarouselProps) => {\n\treturn (\n\t\t<>\n\t\t\t<ReactCarousel\n\t\t\t\tleftArrow={<LeftArrow />}\n\t\t\t\trightArrow={<RightArrow />}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</ReactCarousel>\n\t\t</>\n\t);\n};\n\nconst ArrowContainer = styled.div`\n\tcursor: pointer;\n\tmargin: 0 8px;\n\twidth: 50px;\n\theight: 50px;\n\tborder-radius: 25px;\n\tdisplay: flex;\n\talign-items: center;\n\tbackground-color: rgba(0, 0, 0, 0.4);\n\tjustify-content: center;\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 50%;\n\t&.left {\n\t\ttransform: translate(0%, -50%);\n\t\tleft: 0;\n\t}\n\t&.right {\n\t\ttransform: translate(0%, -50%);\n\t\tright: 0;\n\t}\n`;\n"],"names":["LeftArrow","jsx","ArrowContainer","ChevronLeft","RightArrow","ChevronRight","Carousel","props","Fragment","ReactCarousel","styled"],"mappings":";;;;;AAMA,MAAMA,IAAY,MAEhB,gBAAAC,EAACC,GAAA,EAAe,WAAU,QAAO,eAAY,uBAC5C,UAAA,gBAAAD,EAACE,GAAA,EAAY,OAAO,IAAI,QAAQ,IAAI,OAAM,QAAO,GAClD,GAIIC,IAAa,MAEjB,gBAAAH,EAACC,GAAA,EAAe,WAAU,SAAQ,eAAY,wBAC7C,UAAA,gBAAAD,EAACI,GAAA,EAAa,OAAO,IAAI,QAAQ,IAAI,OAAM,QAAO,GACnD,GAIWC,IAAW,CAACC,MAEvB,gBAAAN,EAAAO,GAAA,EACC,UAAA,gBAAAP;AAAA,EAACQ;AAAAA,EAAA;AAAA,IACA,6BAAYT,GAAA,EAAU;AAAA,IACtB,8BAAaI,GAAA,EAAW;AAAA,IACvB,GAAGG;AAAA,IAEH,UAAAA,EAAM;AAAA,EAAA;AAAA,GAET,GAIIL,IAAiBQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as w, jsx as a, Fragment as M } from "react/jsx-runtime";
|
|
2
2
|
import { useState as r, useEffect as o, useMemo as P } from "react";
|
|
3
3
|
import { CheckboxContainer as B, CheckboxIcon as I } from "./CheckBox.styled.js";
|
|
4
|
-
import { TitleSmall as
|
|
4
|
+
import { TitleSmall as C, BodyPrimary as f, BodySecondary as h, BodyCaption as m, TitleRegular as H } from "../TypographyStyle.js";
|
|
5
5
|
import { COLORS as i } from "../../constants/Theme.js";
|
|
6
6
|
const T = (e) => {
|
|
7
7
|
const c = P(
|
|
@@ -23,6 +23,7 @@ const T = (e) => {
|
|
|
23
23
|
return /* @__PURE__ */ w(
|
|
24
24
|
"svg",
|
|
25
25
|
{
|
|
26
|
+
"data-testid": "checkbox-mark",
|
|
26
27
|
width: l.box,
|
|
27
28
|
height: l.box,
|
|
28
29
|
viewBox: `0 0 ${l.box} ${l.box}`,
|
|
@@ -43,6 +44,7 @@ const T = (e) => {
|
|
|
43
44
|
!e.isPartial && /* @__PURE__ */ a(
|
|
44
45
|
"svg",
|
|
45
46
|
{
|
|
47
|
+
"data-testid": "checkmark-icon",
|
|
46
48
|
width: l.check.w,
|
|
47
49
|
height: l.check.h,
|
|
48
50
|
x: l.check.x,
|
|
@@ -64,6 +66,7 @@ const T = (e) => {
|
|
|
64
66
|
e.isPartial && /* @__PURE__ */ a(
|
|
65
67
|
"rect",
|
|
66
68
|
{
|
|
69
|
+
"data-testid": "partial-mark",
|
|
67
70
|
x: l.partial.x,
|
|
68
71
|
y: l.partial.y,
|
|
69
72
|
width: l.partial.w,
|
|
@@ -80,8 +83,8 @@ const T = (e) => {
|
|
|
80
83
|
e.isPartiallyChecked || !1
|
|
81
84
|
), [d, u] = r(e.isDisabled || !1), [v, b] = r(!1), [g, x] = r(!1), y = (t) => {
|
|
82
85
|
if (!e.isDisabled) {
|
|
83
|
-
const
|
|
84
|
-
n ? s(!n) : l(
|
|
86
|
+
const k = !c;
|
|
87
|
+
n ? s(!n) : l(k), e.onValueChange?.(k, e.value, t);
|
|
85
88
|
}
|
|
86
89
|
}, D = (t) => {
|
|
87
90
|
y(t);
|
|
@@ -103,7 +106,7 @@ const T = (e) => {
|
|
|
103
106
|
bodyCaption: m,
|
|
104
107
|
bodySecondary: h,
|
|
105
108
|
bodyPrimary: f,
|
|
106
|
-
titleSmall:
|
|
109
|
+
titleSmall: C
|
|
107
110
|
}[e.labelTypography];
|
|
108
111
|
return /* @__PURE__ */ a(
|
|
109
112
|
t,
|
|
@@ -126,7 +129,7 @@ const T = (e) => {
|
|
|
126
129
|
children: e.label
|
|
127
130
|
}
|
|
128
131
|
) : /* @__PURE__ */ a(
|
|
129
|
-
|
|
132
|
+
C,
|
|
130
133
|
{
|
|
131
134
|
color: e.isDisabled ? i.text.disabled : i.text.primary,
|
|
132
135
|
children: e.label
|