UNPKG

@useloops/design-system

Version:

The official React based Loops design system

2 lines (1 loc) 6.05 kB
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{useTheme as r,Box as i,Stack as a}from"@mui/material";import{mergeSx as p}from"merge-sx";import{forwardRef as m}from"react";import"../../../utils/formValidation/misc.js";import"../../BrandCore/Icon/Icon.js";import"../../BrandCore/primitiveVariables.js";import"../../WebCore/utils/typography.util.js";import"../../WebCore/AnnualController/AnnualController.js";import"../../WebCore/SelectItem/SelectItem.js";import"../../WebCore/Accordion/Accordion.js";import"../../WebCore/Animations/FadeIn.js";import l from"../../WebCore/Typography/Typography.js";import"@mui/icons-material";import"../../WebCore/AutocompleteBaseField/_partials/AutocompleteListbox.js";import"../../WebCore/AutocompleteBaseField/_partials/StyledPopper.js";import"../../WebCore/AutocompleteBaseField/_partials/StyledAutocompleteField.js";import"../../WebCore/AutocompleteBaseField/_partials/AutocompleteChip.js";import"../../WebCore/AutocompleteBaseField/_partials/StyledAutocompleteInput.js";import"../../WebCore/Badge/Badge.js";import"../../WebCore/Breadcrumb/Breadcrumb.js";import"../../WebCore/Button/Button.js";import"../../WebCore/ButtonBase/ButtonBase.js";import"../../WebCore/ButtonTabGroup/_partials/ActiveIndicator.js";import"../../WebCore/ButtonTabGroup/_partials/ButtonTabsWrapper.js";import"../../WebCore/ButtonTabGroup/_partials/TabButton.js";import"../../WebCore/Checkbox/StyledCheckbox.js";import"../../WebCore/InputFieldBase/InputFieldBase.js";import"../../WebCore/CreatableAutocomplete/CreatableAutocomplete.js";import"../../WebCore/InputLabelBase/StyledInputLabelBase.js";import"../../WebCore/Differential/DifferentialContainer.js";import"../../WebCore/Differential/DifferentialRadio.js";import"../../WebCore/DropdownMenu/StyledMenu.js";import"../../WebCore/ExpandableTypographyClamp/ExpandableTypographyClamp.js";import"../../WebCore/FormGenerator/FormGenerator.js";import"../../WebCore/GridOverlay/GridOverlay.js";import"html-react-parser";import"../../WebCore/IconButton/IconButton.js";import"../../WebCore/IconButtonBase/IconButtonBase.js";import"../../WebCore/IconButtonGroup/IconButtonGroup.js";import"../../WebCore/Image/Image.js";import"../../WebCore/KbdGroup/Kbd.js";import"../../WebCore/KbdGroup/KbdGroup.js";import"../../WebCore/KeyValueLabel/KeyValueLabel.js";import"../../WebCore/Label/Label.js";import"../../WebCore/Likert/LikertContainer.js";import"../../WebCore/Likert/LikertLabel.js";import"../../WebCore/Likert/LikertRadio.js";import"../../WebCore/Link/StyledLink.js";import"@lottiefiles/dotlottie-react";import"../../WebCore/LoopsAiButton/LoopsAiButton.js";import"markdown-to-jsx";import"material-ui-popup-state/hooks";import s from"../../WebCore/Surface/Surface.js";import"../../WebCore/Menu/MenuItem.js";import"../../WebCore/ModalLayout/_partials/ModalActionsWrapper.js";import"../../WebCore/ModalLayout/_partials/ModalContentWrapper.js";import"../../WebCore/NavigationButton/NavigationButton.js";import"../../WebCore/Nudge/NudgeButton.js";import"../../WebCore/NumberField/NumberField.js";import"../../BrandCore/colorRamps.js";import"../../BrandCore/semanticColor.js";import"../../BrandCore/types.js";import"../../BrandCore/typography.js";import"../../WebCore/Progress/Progress.js";import"../../WebCore/Pill/StyledPill.js";import"../../WebCore/ProgressBar/ProgressBar.js";import"../../WebCore/Radio/StyledRadio.js";import"../../WebCore/Select/StyledSelect.js";import"../../WebCore/RankItem/RankItemContainer.js";import"../../WebCore/RankItem/RankItemLabel.js";import"../../WebCore/SortableList/SortableList.js";import"../../WebCore/SortableList/components/SortableItem/SortableItem.js";import"../../WebCore/SortableList/components/SortableOverlay/SortableOverlay.js";import"@tiptap/extension-placeholder";import"@tiptap/starter-kit";import"mui-tiptap";import"../../WebCore/RichTextField/StyledRichTextEditor.js";import"../../WebCore/Skeleton/Skeleton.js";import"../../WebCore/Slider/StyledSlider.js";import"../../WebCore/StarRating/StarRating.js";import"../../WebCore/Switch/StyledSwitch.js";import"../../WebCore/Textarea/Textarea.js";import"../../WebCore/TrialCard/TrialCardContainers.js";import"../../WebCore/TrialCard/TrialPill.js";import"../../WebCore/UserMenu/UserMenuButton.js";import"../../WebCore/VideoModal/VideoModal.js";import n from"../KpiIndicator/KpiIndicator.js";import d from"./_partials/DataSourceItem.js";import c from"./_partials/EmptyStateMessage.js";import b from"./_partials/StatValue.js";const u=m(({title:m,indicatorColor:u,subTitle:C,averageValue:j,minValue:W,maxValue:B,dataSources:y,dataSourcesTitle:g,dataSourcesLoading:S,emptyStateBody:h,emptyStateTitle:x,emptyState:I,sx:f},L)=>{const v=r();return e(s,{borderradius:"sm",variation:"overlay",children:e(i,{ref:L,sx:p({overflowY:"auto",p:v.custom.padding.md,width:256,maxHeight:350},f),children:o(a,{direction:"column",gap:v.custom.margin.md,children:[o(a,{direction:"row",gap:v.custom.margin.sm,sx:{width:"100%"},children:[u&&e(i,{sx:{height:"22px",display:"flex",placeItems:"center"},children:e(n,{colorScheme:u})}),o(a,{children:[e(l,{component:"p",variation:"sm",weight:"bold",children:m}),C&&e(l,{component:"p",variation:"xs",sx:{color:v.custom.palette.text.secondary},children:C})]})]}),I?e(c,{title:x,body:h}):o(a,{direction:"row",gap:v.custom.margin.sm,children:[e(b,{value:j?.value,keyText:"avg.",color:j?.color}),e(b,{value:W?.value,keyText:"min.",color:W?.color}),e(b,{value:B?.value,keyText:"max.",color:B?.color})]}),y&&!I&&e(a,{direction:"row",gap:v.custom.margin.sm,children:o(a,{gap:v.custom.margin.xs,sx:{width:1},children:[e(l,{component:"p",variation:"xs",sx:{color:v.custom.palette.text.secondary},weight:"bold",children:g}),e(a,{sx:{gap:v.custom.margin.xs},children:S?o(t,{children:[e(d,{loading:!0,content:null,cta:void 0}),e(d,{loading:!0,content:null,cta:void 0}),e(d,{loading:!0,content:null,cta:void 0})]}):y.map(({id:o,content:t,cta:r,iconName:i,iconButtonDisabled:a},p)=>e(d,{id:o,content:t,cta:r,iconName:i,iconButtonDisabled:a},p))})]})})]})})})});export{u as default};