@useloops/design-system 1.4.556 → 1.4.558
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/Platform/MiniResultCard.d.ts +2 -0
- package/dist/Platform/MiniResultCard.js +1 -0
- package/dist/Platform.d.ts +2 -0
- package/dist/Platform.js +1 -1
- package/dist/esm/Platform/MiniResultCard.js +1 -0
- package/dist/esm/Platform.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/systems/Platform/AIInsight/AIInsight.js +1 -1
- package/dist/esm/systems/Platform/GraphBar/GraphBar.js +1 -1
- package/dist/esm/systems/Platform/LikertGraph/LikertGraph.js +1 -1
- package/dist/esm/systems/Platform/LikertGraph/_partials/LikertGraphBar/LikertGraphBar.js +1 -1
- package/dist/esm/systems/Platform/LinkExpired/LinkExpired.js +1 -1
- package/dist/esm/systems/Platform/MFACodeVerify/MFACodeVerify.js +1 -1
- package/dist/esm/systems/Platform/MiniResultCard/MiniResultCard.js +1 -0
- package/dist/esm/systems/Platform/MiniResultCard/graphVariants.js +1 -0
- package/dist/esm/systems/Platform/QuestionLabel/QuestionLabel.js +1 -1
- package/dist/esm/systems/Platform/SliderGraph/SliderGraph.js +1 -1
- package/dist/esm/systems/Platform/SliderGraph/_partials/SliderGraphBar/SliderGraphBar.js +1 -1
- package/dist/esm/systems/Platform/SliderGraph/_partials/SliderGraphYAxis/SliderGraphYAxis.js +1 -1
- package/dist/esm/systems/Platform/SliderGraph/_partials/StyledComponents.js +1 -1
- package/dist/esm/systems/Platform/SliderGraph/utils/heightBasedOnPercentage.js +1 -1
- package/dist/esm/systems/Platform/SliderGraph/utils/mockData.js +1 -1
- package/dist/esm/systems/Platform/SliderGraph/utils/useSliderGraphProps.js +1 -1
- package/dist/esm/systems/WebCore/Typography/Typography.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/systems/Platform/AIInsight/AIInsight.js +1 -1
- package/dist/systems/Platform/GraphBar/GraphBar.d.ts +2 -2
- package/dist/systems/Platform/GraphBar/GraphBar.js +1 -1
- package/dist/systems/Platform/LikertGraph/LikertGraph.js +1 -1
- package/dist/systems/Platform/LikertGraph/_partials/LikertGraphBar/LikertGraphBar.js +1 -1
- package/dist/systems/Platform/LinkExpired/LinkExpired.js +1 -1
- package/dist/systems/Platform/MFACodeVerify/MFACodeVerify.js +1 -1
- package/dist/systems/Platform/MiniResultCard/MiniResultCard.d.ts +15 -0
- package/dist/systems/Platform/MiniResultCard/MiniResultCard.js +1 -0
- package/dist/systems/Platform/MiniResultCard/graphVariants.d.ts +25 -0
- package/dist/systems/Platform/MiniResultCard/graphVariants.js +1 -0
- package/dist/systems/Platform/QuestionLabel/QuestionLabel.d.ts +4 -0
- package/dist/systems/Platform/QuestionLabel/QuestionLabel.js +1 -1
- package/dist/systems/Platform/SliderGraph/SliderGraph.js +1 -1
- package/dist/systems/Platform/SliderGraph/_partials/SliderGraphBar/SliderGraphBar.js +1 -1
- package/dist/systems/Platform/SliderGraph/_partials/SliderGraphYAxis/SliderGraphYAxis.js +1 -1
- package/dist/systems/Platform/SliderGraph/_partials/StyledComponents.d.ts +24 -3
- package/dist/systems/Platform/SliderGraph/_partials/StyledComponents.js +1 -1
- package/dist/systems/Platform/SliderGraph/types.d.ts +7 -0
- package/dist/systems/Platform/SliderGraph/utils/heightBasedOnPercentage.js +1 -1
- package/dist/systems/Platform/SliderGraph/utils/mockData.js +1 -1
- package/dist/systems/Platform/SliderGraph/utils/useSliderGraphProps.d.ts +2 -2
- package/dist/systems/Platform/SliderGraph/utils/useSliderGraphProps.js +1 -1
- package/dist/systems/WebCore/Typography/Typography.d.ts +2 -0
- package/dist/systems/WebCore/Typography/Typography.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material"),t=require("merge-sx"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material"),t=require("merge-sx"),i=require("react");require("../../../../../utils/formValidation/misc.js"),require("../../../../BrandCore/Icon/Icon.js"),require("../../../../BrandCore/primitiveVariables.js"),require("../../../../WebCore/utils/typography.util.js"),require("../../../../WebCore/AnnualController/AnnualController.js"),require("../../../../WebCore/Accordion/Accordion.js");var o=require("../../../../WebCore/Typography/Typography.js");require("../../../../WebCore/Badge/Badge.js"),require("../../../../WebCore/Breadcrumb/Breadcrumb.js"),require("../../../../WebCore/Button/Button.js"),require("../../../../WebCore/ButtonBase/ButtonBase.js");var a=require("../../../../WebCore/Checkbox/Checkbox.js");require("../../../../WebCore/Checkbox/StyledCheckbox.js"),require("../../../../WebCore/InputFieldBase/InputFieldBase.js"),require("../../../../WebCore/CreatableAutocomplete/CreatableAutocomplete.js"),require("@mui/icons-material"),require("../../../../WebCore/InputLabelBase/StyledInputLabelBase.js"),require("../../../../WebCore/Differential/DifferentialContainer.js"),require("../../../../WebCore/Differential/DifferentialRadio.js"),require("../../../../WebCore/DropdownMenu/StyledMenu.js"),require("../../../../WebCore/FormGenerator/FormGenerator.js"),require("../../../../WebCore/GridOverlay/GridOverlay.js"),require("html-react-parser"),require("../../../../WebCore/IconButton/IconButton.js"),require("../../../../WebCore/IconButtonBase/IconButtonBase.js"),require("../../../../WebCore/IconButtonGroup/IconButtonGroup.js"),require("../../../../WebCore/Image/Image.js"),require("../../../../WebCore/Label/Label.js"),require("../../../../WebCore/Likert/LikertContainer.js"),require("../../../../WebCore/Likert/LikertLabel.js"),require("../../../../WebCore/Likert/LikertRadio.js"),require("../../../../WebCore/Link/StyledLink.js"),require("@lottiefiles/dotlottie-react"),require("../../../../WebCore/LoopsAiButton/LoopsAiButton.js"),require("markdown-to-jsx"),require("material-ui-popup-state/hooks"),require("../../../../WebCore/Surface/Surface.js"),require("../../../../WebCore/Menu/MenuItem.js"),require("../../../../WebCore/ModalLayout/_partials/ModalActionsWrapper.js"),require("../../../../WebCore/ModalLayout/_partials/ModalContentWrapper.js"),require("../../../../WebCore/NavigationButton/NavigationButton.js"),require("../../../../WebCore/Nudge/NudgeButton.js"),require("../../../../WebCore/NumberField/NumberField.js"),require("../../../../BrandCore/colorRamps.js"),require("../../../../BrandCore/semanticColor.js"),require("../../../../BrandCore/types.js"),require("../../../../BrandCore/typography.js");var s=require("../../../../WebCore/Tooltip/Tooltip.js");require("../../../../WebCore/Pill/StyledPill.js"),require("../../../../WebCore/Progress/Progress.js"),require("../../../../WebCore/ProgressBar/ProgressBar.js"),require("../../../../WebCore/Radio/StyledRadio.js"),require("../../../../WebCore/utils/autocomplete.styles.js"),require("../../../../WebCore/Select/AutocompleteListbox.js"),require("../../../../WebCore/Select/StyledAutocomplete.js"),require("../../../../WebCore/Select/SelectItem.js"),require("../../../../WebCore/Select/StyledSelect.js"),require("../../../../WebCore/RankItem/RankItemContainer.js"),require("../../../../WebCore/RankItem/RankItemLabel.js"),require("../../../../WebCore/SortableList/SortableList.js"),require("../../../../WebCore/SortableList/components/SortableItem/SortableItem.js"),require("../../../../WebCore/SortableList/components/SortableOverlay/SortableOverlay.js"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-underline"),require("@tiptap/starter-kit"),require("mui-tiptap"),require("../../../../WebCore/RichTextField/StyledRichTextEditor.js");var l=require("../../../../WebCore/Skeleton/Skeleton.js");require("../../../../WebCore/Slider/StyledSlider.js"),require("../../../../WebCore/StarRating/StarRating.js"),require("../../../../WebCore/Switch/StyledSwitch.js"),require("../../../../WebCore/Textarea/Textarea.js"),require("../../../../WebCore/TrialCard/TrialCardContainers.js"),require("../../../../WebCore/TrialCard/TrialPill.js"),require("../../../../WebCore/UserMenu/UserMenuButton.js"),require("../../../../WebCore/VideoModal/VideoModal.js");var u=require("../../utils/heightBasedOnPercentage.js"),n=require("../StyledComponents.js");module.exports=({percentage:b,label:d,checked:c,toolTipContent:C,hideValue:j,hideLabel:q,hideCheckbox:p,disableTooltip:m,animateBar:h,slotProps:W,tickInterval:x,onChange:B,maxDataValue:g,disabled:S,loading:k,value:y,id:L,className:v,graphMaxHeight:I,responsive:f})=>{r.useTheme();const[R,A]=i.useState(0),M=i.useRef(null);i.useEffect(()=>{const e=u.heightBasedOnPercentage(b,x,g,I,{hideLabel:q,hideCheckbox:p,hideValue:j}),r=h?R:e,t=performance.now(),i=o=>{const a=o-t,s=Math.min(a/250,1);A(r+(e-r)*(s*(2-s))),s<1&&requestAnimationFrame(i)},o=requestAnimationFrame(i);return()=>cancelAnimationFrame(o)},[y]);const T=i.useCallback(()=>{!S&&B&&B(L,!c)},[S,B,c]);return e.jsx(s,{message:C||null,disableHoverListener:m||!C,followCursor:!0,placement:"bottom-start",slotProps:{wrapper:{sx:{height:"fill-available",width:1,...W?.tooltip?.slotProps?.wrapper?.sx}}},children:e.jsxs(n.VeticalBarWrapper,{maxHeight:I,disabled:S,...W?.barWrapper,id:L,className:v,onClick:T,responsive:f,children:[!j&&e.jsx(n.VerticalBarValue,{...W?.value,children:k?e.jsx(l,{width:20,height:18}):e.jsx(o,{variation:"xs",component:"p",monospaced:!0,sx:{color:e=>S||!c?e.custom.palette.text.disabled:e.custom.palette.text.secondary},children:Math.round(b)})}),k?e.jsx(l,{width:"fill-available",height:R}):e.jsx(n.VerticalBar,{checked:c,value:R,maxHeight:I,disabled:S,...W?.bar}),e.jsxs(n.VerticalBarActions,{children:[!q&&e.jsx(n.VerticalBarLabel,{...W?.label,children:k?e.jsx(l,{width:20,height:20}):e.jsx(o,{variation:"xs",component:"p",weight:"bold",sx:{color:e=>S||!c?e.custom.palette.text.disabled:e.custom.palette.text.primary},children:d})}),!p&&e.jsx(e.Fragment,{children:k?e.jsx(l,{width:24,height:24,sx:{borderRadius:.5}}):e.jsx(a,{id:`${L}-checkbox`,variant:"secondary",checked:!S&&c,disabled:S,checkboxLabel:void 0,inputRef:M,onChange:T,...W?.checkbox,sx:t.mergeSx({mr:0,mt:1},W?.checkbox?.sx)})})]})]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material"),i=require("react");require("../../../../../utils/formValidation/misc.js"),require("../../../../BrandCore/Icon/Icon.js"),require("../../../../BrandCore/primitiveVariables.js"),require("../../../../WebCore/utils/typography.util.js"),require("../../../../WebCore/AnnualController/AnnualController.js"),require("../../../../WebCore/Accordion/Accordion.js");var
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material"),i=require("react");require("../../../../../utils/formValidation/misc.js"),require("../../../../BrandCore/Icon/Icon.js"),require("../../../../BrandCore/primitiveVariables.js"),require("../../../../WebCore/utils/typography.util.js"),require("../../../../WebCore/AnnualController/AnnualController.js"),require("../../../../WebCore/Accordion/Accordion.js");var t=require("../../../../WebCore/Typography/Typography.js");require("merge-sx"),require("../../../../WebCore/Badge/Badge.js"),require("../../../../WebCore/Breadcrumb/Breadcrumb.js"),require("../../../../WebCore/Button/Button.js"),require("../../../../WebCore/ButtonBase/ButtonBase.js"),require("../../../../WebCore/Checkbox/StyledCheckbox.js"),require("../../../../WebCore/InputFieldBase/InputFieldBase.js"),require("../../../../WebCore/CreatableAutocomplete/CreatableAutocomplete.js"),require("@mui/icons-material"),require("../../../../WebCore/InputLabelBase/StyledInputLabelBase.js"),require("../../../../WebCore/Differential/DifferentialContainer.js"),require("../../../../WebCore/Differential/DifferentialRadio.js"),require("../../../../WebCore/DropdownMenu/StyledMenu.js"),require("../../../../WebCore/FormGenerator/FormGenerator.js"),require("../../../../WebCore/GridOverlay/GridOverlay.js"),require("html-react-parser"),require("../../../../WebCore/IconButton/IconButton.js"),require("../../../../WebCore/IconButtonBase/IconButtonBase.js"),require("../../../../WebCore/IconButtonGroup/IconButtonGroup.js"),require("../../../../WebCore/Image/Image.js"),require("../../../../WebCore/Label/Label.js"),require("../../../../WebCore/Likert/LikertContainer.js"),require("../../../../WebCore/Likert/LikertLabel.js"),require("../../../../WebCore/Likert/LikertRadio.js"),require("../../../../WebCore/Link/StyledLink.js"),require("@lottiefiles/dotlottie-react"),require("../../../../WebCore/LoopsAiButton/LoopsAiButton.js"),require("markdown-to-jsx"),require("material-ui-popup-state/hooks"),require("../../../../WebCore/Surface/Surface.js"),require("../../../../WebCore/Menu/MenuItem.js"),require("../../../../WebCore/ModalLayout/_partials/ModalActionsWrapper.js"),require("../../../../WebCore/ModalLayout/_partials/ModalContentWrapper.js"),require("../../../../WebCore/NavigationButton/NavigationButton.js"),require("../../../../WebCore/Nudge/NudgeButton.js"),require("../../../../WebCore/NumberField/NumberField.js"),require("../../../../BrandCore/colorRamps.js"),require("../../../../BrandCore/semanticColor.js"),require("../../../../BrandCore/types.js"),require("../../../../BrandCore/typography.js"),require("../../../../WebCore/Pill/StyledPill.js"),require("../../../../WebCore/Progress/Progress.js"),require("../../../../WebCore/ProgressBar/ProgressBar.js"),require("../../../../WebCore/Radio/StyledRadio.js"),require("../../../../WebCore/utils/autocomplete.styles.js"),require("../../../../WebCore/Select/AutocompleteListbox.js"),require("../../../../WebCore/Select/StyledAutocomplete.js"),require("../../../../WebCore/Select/SelectItem.js"),require("../../../../WebCore/Select/StyledSelect.js"),require("../../../../WebCore/RankItem/RankItemContainer.js"),require("../../../../WebCore/RankItem/RankItemLabel.js"),require("../../../../WebCore/SortableList/SortableList.js"),require("../../../../WebCore/SortableList/components/SortableItem/SortableItem.js"),require("../../../../WebCore/SortableList/components/SortableOverlay/SortableOverlay.js"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-underline"),require("@tiptap/starter-kit"),require("mui-tiptap"),require("../../../../WebCore/RichTextField/StyledRichTextEditor.js");var o=require("../../../../WebCore/Skeleton/Skeleton.js");require("../../../../WebCore/Slider/StyledSlider.js"),require("../../../../WebCore/StarRating/StarRating.js"),require("../../../../WebCore/Switch/StyledSwitch.js"),require("../../../../WebCore/Textarea/Textarea.js"),require("../../../../WebCore/TrialCard/TrialCardContainers.js"),require("../../../../WebCore/TrialCard/TrialPill.js"),require("../../../../WebCore/UserMenu/UserMenuButton.js"),require("../../../../WebCore/VideoModal/VideoModal.js");var s=require("../../utils/createYAxisIntervalTicks.js"),a=require("../StyledComponents.js");var u=i.memo(({yAxisMax:u,rounding:n,tickInterval:l,loading:b,yAxisTickData:d,hideLabel:c,showGraphLines:C,hideCheckbox:j,disabled:q,slotProps:p,graphMaxHeight:W,responsive:m})=>{const x=r.useTheme(),S=i.useRef(null),[h,B]=i.useState(void 0);i.useEffect(()=>{if(m&&S.current){const e=()=>{const e=S.current?.parentElement?.offsetWidth;e&&B(e-50)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}},[m]);const y=i.useMemo(()=>n?Math.ceil(u/n)*n:u,[u,n]),g=d||s.createYAxisIntervalTicks(l,y).reverse(),{onChange:L,...I}=p?.root||{};return e.jsxs(a.Axis,{maxHeight:W,ref:S,children:[e.jsxs(r.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[c&&e.jsx(a.Spacer,{}),j&&e.jsx(a.Spacer,{})]}),e.jsx(a.AxisSegmentWrapper,{...I,hideLabel:c,hideCheckbox:j,maxHeight:W,children:g.map((r,i)=>e.jsx(a.AxisSegment,{showGraphLines:C,graphWidth:h,children:b?e.jsx(o,{width:20,height:20}):e.jsx(t,{component:"p",variation:"xs",monospaced:!0,sx:{color:q?x.custom.palette.text.disabled:x.custom.palette.text.primary},children:r})},i))}),e.jsxs(r.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[!c&&e.jsx(a.Spacer,{}),!j&&e.jsx(a.Spacer,{})]})]})});module.exports=u;
|
|
@@ -5,9 +5,27 @@ import * as _mui_system from '@mui/system';
|
|
|
5
5
|
import * as _mui_material from '@mui/material';
|
|
6
6
|
import { SliderGraphBarProps, CommonComponentProps } from '../types.js';
|
|
7
7
|
|
|
8
|
-
declare const SliderGraphWrapper: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & _mui_system.MUIStyledCommonProps<_mui_material.Theme>,
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
declare const SliderGraphWrapper: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
|
|
9
|
+
component?: React.ElementType;
|
|
10
|
+
} & {
|
|
11
|
+
maxHeight: number;
|
|
12
|
+
} & {
|
|
13
|
+
responsive?: boolean;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
declare const VeticalBarWrapper: _emotion_styled.StyledComponent<_mui_material.ListItemButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "alignItems" | "className" | "style" | "classes" | "children" | "sx" | "autoFocus" | "tabIndex" | "disableGutters" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "dense" | "divider" | "selected"> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & {
|
|
16
|
+
component?: React.ElementType;
|
|
17
|
+
} & {
|
|
18
|
+
maxHeight: number;
|
|
19
|
+
} & {
|
|
20
|
+
responsive?: boolean;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
declare const SliderGraphBarWrapper: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
|
|
23
|
+
component?: React.ElementType;
|
|
24
|
+
} & {
|
|
25
|
+
maxHeight: number;
|
|
26
|
+
} & {
|
|
27
|
+
responsive?: boolean;
|
|
28
|
+
}, {}, {}>;
|
|
11
29
|
declare const VerticalBarValue: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
|
|
12
30
|
component?: React.ElementType;
|
|
13
31
|
}, {}, {}>;
|
|
@@ -25,11 +43,14 @@ declare const VerticalBarLabel: _emotion_styled.StyledComponent<_mui_system.BoxO
|
|
|
25
43
|
}, {}, {}>;
|
|
26
44
|
declare const AxisSegmentWrapper: _emotion_styled.StyledComponent<_mui_material.StackOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & {
|
|
27
45
|
component?: React.ElementType;
|
|
46
|
+
} & {
|
|
47
|
+
maxHeight: number;
|
|
28
48
|
} & Partial<SliderGraphBarProps>, {}, {}>;
|
|
29
49
|
declare const AxisSegment: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material.Theme> & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_system.BoxOwnProps<_mui_material.Theme>> & {
|
|
30
50
|
component?: React.ElementType;
|
|
31
51
|
} & {
|
|
32
52
|
showGraphLines?: boolean;
|
|
53
|
+
graphWidth?: number;
|
|
33
54
|
}, {}, {}>;
|
|
34
55
|
|
|
35
56
|
export { AxisSegment, AxisSegmentWrapper, SliderGraphBarWrapper, SliderGraphWrapper, VerticalBar, VerticalBarActions, VerticalBarLabel, VerticalBarValue, VeticalBarWrapper };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@mui/material");const t=
|
|
1
|
+
"use strict";var e=require("@mui/material");const t=e.styled(e.Box)(({theme:e})=>({height:24,width:24,margin:e.spacing(.5)})),i=e.styled(e.Box,{shouldForwardProp:e=>!["maxHeight","responsive"].includes(e)})(({theme:e,maxHeight:t,responsive:i})=>({display:"flex",flexDirection:"row",alignItems:"flex-end",gap:e.spacing(.5),width:"100%",minWidth:i?"auto":450,minHeight:t+32,padding:"0 16px",boxSizing:"border-box",overflow:"hidden"})),o=e.styled(e.ListItemButton,{shouldForwardProp:e=>!["maxHeight","responsive"].includes(e)})(({theme:t,maxHeight:i,responsive:o})=>({padding:o?t.spacing(.25):t.spacing(.5),paddingBottom:t.spacing(1),borderRadius:t.spacing(t.custom.radius.md),backgroundColor:t.custom.palette.interaction.none,display:"flex",minWidth:o?"auto":33,flex:o?1:"none",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:i,"&:hover":{backgroundColor:t.custom.palette.interaction.hover,[`& .${e.formControlLabelClasses.root}`]:{[`& .${e.checkboxClasses.root}`]:{backgroundColor:t.custom.palette.blue[0]}}},"&:active":{backgroundColor:t.custom.palette.interaction.press},"&.Mui-selected":{backgroundColor:t.custom.palette.interaction.press},"&.Mui-disabled":{opacity:1}})),r=e.styled(e.Box,{shouldForwardProp:e=>!["maxHeight","responsive"].includes(e)})(({theme:e,maxHeight:t,responsive:i})=>({display:"flex",alignItems:"center",gap:i?0:e.spacing(.5),height:t,width:"100%"})),a=e.styled(e.Box)(()=>({height:22,display:"flex",alignItems:"center"})),s=e.styled(e.Box)(({theme:e,value:t,disabled:i,checked:o})=>({transition:"background 200ms ease",width:"100%",height:t,backgroundColor:i||!o?e.custom.palette.neutral[100]:e.custom.palette.purple[500],borderRadius:e.spacing(e.custom.radius.sm)})),n=e.styled(e.Stack)(()=>({alignItems:"center",display:"flex",justifyContent:"flex-end"})),l=e.styled(e.Box)(({theme:e})=>({height:24,marginTop:e.spacing(1),display:"flex",alignItems:"center"})),d=e.styled(e.Stack,{shouldForwardProp:e=>!["maxHeight"].includes(e)})(({maxHeight:e})=>({height:e,boxSizing:"border-box"})),p=e.styled(e.Stack,{shouldForwardProp:e=>!["maxHeight","hideLabel","hideCheckbox"].includes(e)})(({theme:e,hideLabel:t,hideCheckbox:i,maxHeight:o})=>({height:o,display:"flex",justifyContent:"space-between",paddingRight:e.spacing(e.custom.margin.sm),paddingTop:t||i?e.spacing(.5):e.spacing(2),boxSizing:"border-box"})),c=e.styled(e.Box,{shouldForwardProp:e=>!["showGraphLines","graphWidth"].includes(e)})(({showGraphLines:e,theme:t,graphWidth:i})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",height:18,width:32,textAlign:"right",position:"relative","&:after":{content:'""',position:"absolute",left:`calc(100% + ${t.spacing(2)})`,bottom:8,width:e?i?i-50:400:0,height:1,backgroundColor:"currentColor",opacity:.1}}));exports.Axis=d,exports.AxisSegment=c,exports.AxisSegmentWrapper=p,exports.GRAPH_PADDING=16,exports.GRAPH_WIDTH=450,exports.SliderGraphBarWrapper=r,exports.SliderGraphWrapper=i,exports.Spacer=t,exports.VerticalBar=s,exports.VerticalBarActions=n,exports.VerticalBarLabel=l,exports.VerticalBarValue=a,exports.VeticalBarWrapper=o;
|
|
@@ -18,10 +18,12 @@ interface SliderGraphYAxisProps extends CommonComponentProps {
|
|
|
18
18
|
rounding: number | null;
|
|
19
19
|
tickInterval: TickInterval | null;
|
|
20
20
|
yAxisMax: number;
|
|
21
|
+
graphMaxHeight: number;
|
|
21
22
|
hideLabel?: boolean;
|
|
22
23
|
hideCheckbox?: boolean;
|
|
23
24
|
showGraphLines?: boolean;
|
|
24
25
|
yAxisTickData?: number[];
|
|
26
|
+
responsive?: boolean;
|
|
25
27
|
slotProps?: {
|
|
26
28
|
root?: StackProps;
|
|
27
29
|
};
|
|
@@ -38,6 +40,7 @@ interface SliderGraphProps extends CommonComponentProps {
|
|
|
38
40
|
root?: BoxProps;
|
|
39
41
|
yAxis?: StackProps;
|
|
40
42
|
barsWrapper?: BoxProps;
|
|
43
|
+
bar?: Partial<SliderGraphBarProps>;
|
|
41
44
|
};
|
|
42
45
|
hideYAxis?: boolean;
|
|
43
46
|
hideCheckboxes?: boolean;
|
|
@@ -45,6 +48,8 @@ interface SliderGraphProps extends CommonComponentProps {
|
|
|
45
48
|
hideValues?: boolean;
|
|
46
49
|
showGraphLines?: boolean;
|
|
47
50
|
disableTooltips?: boolean;
|
|
51
|
+
maxHeight?: number;
|
|
52
|
+
responsive?: boolean;
|
|
48
53
|
}
|
|
49
54
|
interface SliderGraphBarProps extends CommonComponentProps {
|
|
50
55
|
id: string;
|
|
@@ -64,6 +69,8 @@ interface SliderGraphBarProps extends CommonComponentProps {
|
|
|
64
69
|
hideCheckbox?: boolean;
|
|
65
70
|
animateBar?: boolean;
|
|
66
71
|
onChange?: (id: string, checked: boolean) => void;
|
|
72
|
+
graphMaxHeight: number;
|
|
73
|
+
responsive?: boolean;
|
|
67
74
|
percentageSymbol?: boolean;
|
|
68
75
|
slotProps?: {
|
|
69
76
|
barWrapper?: ListItemButtonProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";exports.heightBasedOnPercentage=(e,t,h,a,i={})=>{if(e<=0)return 1;let r=12;i.hideValue||(r+=22),i.hideLabel||(r+=32),i.hideCheckbox||(r+=24);const c=a-r,n=Math.ceil(h/t)*t;return Math.max(1,e/n*c)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../../../node_modules/@faker-js/faker/dist/chunk-KZPPZA2C.js");function t(t){const n=e.a.number.int({min:1,max:10}),a=e.a.number.float({min:0,max:100,fractionDigits:1}),r=Math.min(e.a.number.float({min:0,max:125,fractionDigits:0}),100);return{amount:n,percentage:a,name:t.toString(),relativePercentage:r}}exports.generateSliderGraphDataItem=t,exports.generateSliderGraphMockData=function(){const n=e.a.number.int({min:
|
|
1
|
+
"use strict";var e=require("../../../../node_modules/@faker-js/faker/dist/chunk-KZPPZA2C.js");function t(t){const n=e.a.number.int({min:1,max:10}),a=e.a.number.float({min:0,max:100,fractionDigits:1}),r=Math.min(e.a.number.float({min:0,max:125,fractionDigits:0}),100);return{amount:n,percentage:a,name:t.toString(),relativePercentage:r}}exports.generateSliderGraphDataItem=t,exports.generateSliderGraphMockData=function(){const n=e.a.number.int({min:3,max:11});return[...new Array(n)].map((e,n)=>t(n))},exports.generateZeroDataItem=function(e){return{amount:0,name:e.toString(),percentage:0,relativePercentage:0}};
|
|
@@ -4,9 +4,9 @@ import { SliderGraphDataItem, SliderGraphBarProps } from '../types.js';
|
|
|
4
4
|
interface UseSliderGraphPropsReturn {
|
|
5
5
|
storedData: SliderGraphBarProps[];
|
|
6
6
|
setStoredData: react__default.Dispatch<react__default.SetStateAction<SliderGraphBarProps[]>>;
|
|
7
|
-
createInitialData: (data: SliderGraphDataItem[]) => SliderGraphBarProps[];
|
|
7
|
+
createInitialData: (data: SliderGraphDataItem[], graphMaxHeight?: number) => SliderGraphBarProps[];
|
|
8
8
|
}
|
|
9
|
-
declare const useSliderGraphProps: (data: SliderGraphDataItem[]) => UseSliderGraphPropsReturn;
|
|
9
|
+
declare const useSliderGraphProps: (data: SliderGraphDataItem[], graphMaxHeight?: number) => UseSliderGraphPropsReturn;
|
|
10
10
|
|
|
11
11
|
export { useSliderGraphProps as default };
|
|
12
12
|
export type { UseSliderGraphPropsReturn };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("../../../../node_modules/uuid/dist/esm-browser/v4.js");function t(e){return e&&e.__esModule?e:{default:e}}var r=t(e);const n=e=>{const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("../../../../node_modules/uuid/dist/esm-browser/v4.js");function t(e){return e&&e.__esModule?e:{default:e}}var r=t(e);const n=(e,t=465)=>{const r=Math.max(...e.map(e=>e.percentage));return e.map(e=>({percentage:e.percentage,amount:e.amount,label:e.name,relativePercentage:e.relativePercentage,id:a(),checked:!0,tickInterval:10,disableTooltip:!1,hideCheckbox:!1,hideLabel:!1,hideValue:!1,animateBar:!0,disabled:!1,loading:!1,onChange:(a,t)=>console.warn(e,t),value:e.percentage,toolTipContent:`${e.percentage}%`,maxDataValue:r,graphMaxHeight:t}))};exports.createInitialData=n,exports.default=(e,a=465)=>{const[t,o]=r.default.useState(()=>n(e,a));return{storedData:t,setStoredData:o,createInitialData:n}};
|
|
@@ -9,6 +9,8 @@ interface TypographyProps extends Omit<TypographyProps$1, 'ref'> {
|
|
|
9
9
|
weight?: 'default' | 'bold';
|
|
10
10
|
monospaced?: boolean;
|
|
11
11
|
sx?: SxProps<Theme>;
|
|
12
|
+
secondary?: boolean;
|
|
13
|
+
textColor?: string;
|
|
12
14
|
}
|
|
13
15
|
declare const Typography: react.ForwardRefExoticComponent<TypographyProps & react.RefAttributes<HTMLHeadingElement | HTMLParagraphElement>>;
|
|
14
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("merge-sx"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("merge-sx"),o=require("react"),i=require("../../BrandCore/types.js");const a=e=>"bold"===e?i.FontWeight.BOLD:i.FontWeight.DEFAULT,n=o.forwardRef(({component:o,weight:i="default",variation:n,clamp:s=0,type:u="default",monospaced:l,secondary:c,textColor:m,...d},p)=>{const x=t.useTheme();return e.jsx(t.Typography,{ref:p,variant:n,fontWeight:a(i),component:o,...d,sx:r.mergeSx(d.sx,!!s&&{display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:s},"button"===u&&{lineHeight:1.2},l&&{fontVariantNumeric:"tabular-nums"},c&&{color:x.custom.palette.text.secondary},Boolean(m)&&{color:m})})});module.exports=n;
|