@bikdotai/bik-component-library 0.0.773-beta.3 → 0.0.773-beta.4
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/ProgressChecklist/ProgressChecklist.d.ts +2 -0
- package/dist/cjs/components/ProgressChecklist/ProgressChecklist.js +1 -1
- package/dist/cjs/components/alerts/Alert.styled.js +0 -1
- package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.d.ts +0 -4
- package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuItem.d.ts +0 -3
- package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuList.d.ts +0 -4
- package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/type.d.ts +0 -3
- package/dist/cjs/components/radioButton/RadioButton.d.ts +0 -1
- package/dist/cjs/components/radioButton/RadioButton.js +1 -1
- package/dist/esm/components/ProgressChecklist/ProgressChecklist.d.ts +2 -0
- package/dist/esm/components/ProgressChecklist/ProgressChecklist.js +1 -1
- package/dist/esm/components/alerts/Alert.styled.js +8 -9
- package/dist/esm/components/multi-level-dropdown/GroupedMenuList.d.ts +0 -4
- package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +1 -1
- package/dist/esm/components/multi-level-dropdown/MenuItem.d.ts +0 -3
- package/dist/esm/components/multi-level-dropdown/MenuItem.js +1 -1
- package/dist/esm/components/multi-level-dropdown/MenuList.d.ts +0 -4
- package/dist/esm/components/multi-level-dropdown/MenuList.js +1 -1
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
- package/dist/esm/components/multi-level-dropdown/type.d.ts +0 -3
- package/dist/esm/components/radioButton/RadioButton.d.ts +0 -1
- package/dist/esm/components/radioButton/RadioButton.js +1 -1
- package/package.json +1 -1
|
@@ -32,6 +32,8 @@ export interface SingleChecklistItemType {
|
|
|
32
32
|
buttonDisabled?: boolean;
|
|
33
33
|
hideRedirectButton?: boolean;
|
|
34
34
|
hideSetupButton?: boolean;
|
|
35
|
+
/** Custom node to render in place of the default setup button. */
|
|
36
|
+
customSetupButton?: React.ReactNode;
|
|
35
37
|
}
|
|
36
38
|
export interface MultiChecklistItemType {
|
|
37
39
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/ActiveChecklistIcon.js"),s=require("../../assets/icons/CompletedChecklistIcon.js"),i=require("../../assets/icons/InactiveChecklistIcon.js");require("../../_virtual/_tslib.js");var r=require("../../assets/icons/chevronRight.svg.js"),l=require("../../assets/icons/info.svg.js"),n=require("react"),o=require("../../constants/Theme.js"),c=require("../alerts/Alert.js"),a=require("../alerts/AlertHelper.js"),d=require("../button/Button.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/ActiveChecklistIcon.js"),s=require("../../assets/icons/CompletedChecklistIcon.js"),i=require("../../assets/icons/InactiveChecklistIcon.js");require("../../_virtual/_tslib.js");var r=require("../../assets/icons/chevronRight.svg.js"),l=require("../../assets/icons/info.svg.js"),n=require("react"),o=require("../../constants/Theme.js"),c=require("../alerts/Alert.js"),a=require("../alerts/AlertHelper.js"),d=require("../button/Button.js"),u=require("../progress-bar-v2/ProgressBarV2.js"),p=require("../tag/Tag.js"),g=require("../tooltips/Tooltip.js"),j=require("../TypographyStyle.js"),h=require("./MultiChecklistItem.js"),x=require("./ProgressChecklist.style.js"),C=require("./ProgressStepper.js");exports.default=v=>{let{header:y,subheader:b,items:m=[],progressBarColor:T,headerAction:S,showProgressBar:f=!0,noBorder:O=!1}=v;const[k,A]=n.useState(m);n.useEffect((()=>{A(m)}),[m]);const I=k.filter((e=>e.isCompleted)).length,q=k.length,B=q>0?I/q*100:0;return e.jsxs(x.ProgressChecklistContainer,Object.assign({noBorder:O},{children:[e.jsxs(x.HeaderSection,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsx(j.TitleMedium,{children:y}),S&&e.jsx("div",{children:S})]})),e.jsx(j.BodySecondary,Object.assign({color:o.COLORS.content.secondary},{children:b}))]}),f&&e.jsxs(x.ProgressBarSection,Object.assign({style:{display:"flex",alignItems:"center",gap:"16px"}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(u.ProgressBarV2,{progress:Math.round(B),type:u.ProgressBarType.LINE,matchParentWidth:!0,showProgress:!1,color:null!=T?T:o.COLORS.background.positive.vibrant,progressBarThickness:12})})),e.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end",alignItems:"center",minWidth:12}},{children:e.jsxs(j.TitleSmall,Object.assign({style:{color:o.COLORS.content.secondary,textAlign:"right"}},{children:[I," / ",q]}))}))]})),e.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:k.map((n=>{var u,j,v,y,b,m,T,S;if("single"===n.type)return e.jsxs(x.SingleChecklistItem,Object.assign({isActive:n.isActive||!1},{children:[e.jsxs(x.SingleChecklistMainRow,{children:[e.jsx(x.SingleChecklistIconWrapper,{children:n.isCompleted?null!==(u=n.completedIcon)&&void 0!==u?u:e.jsx(s.CompletedChecklistIcon,{}):n.isActive?null!==(j=n.activeIcon)&&void 0!==j?j:e.jsx(t.ActiveChecklistIcon,{}):null!==(v=n.icon)&&void 0!==v?v:e.jsx(i.InactiveChecklistIcon,{})}),e.jsxs(x.SingleChecklistContent,{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:12}},{children:[e.jsx(x.SingleChecklistHeader,Object.assign({completed:!!n.isCompleted,isActive:!!n.isActive},{children:n.header})),(null===(y=n.tag)||void 0===y?void 0:y.tagText)&&(n.tag.tooltip?e.jsx(g.Tooltip,Object.assign({},n.tag.tooltip,{children:e.jsx("span",Object.assign({style:{display:"inline-flex"}},{children:e.jsx(p.Tag,{tagText:n.tag.tagText,variant:n.tag.variant,type:n.tag.type,theme:n.tag.theme})}))})):e.jsx(p.Tag,{tagText:n.tag.tagText,variant:n.tag.variant,type:n.tag.type,theme:n.tag.theme}))]})),e.jsx(x.SingleChecklistSubheader,{children:n.subheader})]}),n.isCompleted&&!n.hideRedirectButton&&e.jsx("div",Object.assign({onClick:n.onSetup,style:{cursor:"pointer"}},{children:e.jsx(r.default,{style:{marginLeft:"12px"},width:12,height:12,color:o.COLORS.content.secondary})})),!n.isCompleted&&n.isActive&&!n.hideSetupButton&&(n.customSetupButton?n.customSetupButton:e.jsx(x.SingleChecklistActionWrapper,{children:e.jsx(d.Button,{buttonText:null!==(b=n.buttonText)&&void 0!==b?b:"Setup",buttonType:null!==(m=n.buttonType)&&void 0!==m?m:"primary",onClick:n.onSetup,disabled:null!==(T=n.buttonDisabled)&&void 0!==T&&T})}))]}),n.alertText&&e.jsx(x.SingleChecklistAlertRow,{children:e.jsx(c.Alert,{text:n.alertText,type:null!==(S=n.alertType)&&void 0!==S?S:a.ALERT_TYPES.WARNING,contentPosition:a.CONTENT_POSITION.START,textColor:n.alertType===a.ALERT_TYPES.BRAND?"#4B1583":"",icon:t=>e.jsx(l.default,Object.assign({},t))})})]}),n.id);if("multiple"===n.type){const t=n.steps&&n.steps.length>0?n.steps.map(((e,t)=>{var s;return{id:null!==(s=e.id)&&void 0!==s?s:`${n.id}-sub-${t+1}`,text:e.text,label:e.text,onClick:e.onClick,isCompleted:!!e.isCompleted}})):[{id:`${n.id}-sub-1`,text:"Connect",label:"Connect",isCompleted:!1},{id:`${n.id}-sub-2`,text:"Configure",label:"Configure",isCompleted:!1},{id:`${n.id}-sub-3`,text:"Verify",label:"Verify",isCompleted:!1}];return e.jsx(h.default,Object.assign({item:n},{children:e.jsx(C.default,{steps:t,isStepperActive:n.isActive})}),n.id)}}))}))]}))};
|
|
@@ -5,8 +5,4 @@ export declare const GroupedMenuList: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
option: GroupedOption;
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
|
-
currentLevel: number;
|
|
12
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),t=require("../TypographyStyle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),t=require("../TypographyStyle.js"),o=require("./MenuItem.js"),n=require("./MultiLevelDropdown.styled.js");exports.GroupedMenuList=s=>{let{width:i,onDropdownItemClick:p,option:u,parents:l}=s;return e.jsxs(n.GroupedMenuListContainer,{children:[e.jsx(t.BodyTiny,Object.assign({style:{padding:"4px 8px 4px 12px",cursor:"default"},color:r.COLORS.content.placeholder},{children:u.label})),u.options.map(((r,t)=>e.jsx(o.MenuItem,{width:i,onDropdownItemClick:p,option:r,parents:l},t)))]})};
|
|
@@ -5,7 +5,4 @@ export declare const MenuItem: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
option: SingleOption;
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
currentLevel: number;
|
|
11
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("../../assets/icons/chevronRight2.svg.js"),t=require("react"),i=require("../../constants/Theme.js"),o=require("../TypographyStyle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("../../assets/icons/chevronRight2.svg.js"),t=require("react"),i=require("../../constants/Theme.js"),o=require("../TypographyStyle.js"),s=require("./MultiLevelDropdown.styled.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=r(t);const d=l.default.lazy((()=>Promise.resolve().then((function(){return require("./MenuList.js")})).then((e=>({default:e.MenuList})))));exports.MenuItem=r=>{let{width:a,onDropdownItemClick:c,option:u,parents:p}=r;var h,j,g,v,O,b,C;const[x,f]=l.default.useState(!1),[S,m]=l.default.useState(!1),[L,y]=l.default.useState({top:0,left:0}),M=t.useRef({top:0,left:0});return e.jsxs(s.MenuItemWrapper,Object.assign({onMouseEnter:e=>{f(!0),(e=>{const n=e.currentTarget.getBoundingClientRect();y({top:n.top,left:n.right}),M.current={top:n.top,left:n.right}})(e)},onMouseLeave:()=>{f(!1)},onClick:()=>{var e,n;!c||null!==(e=u.disabled)&&void 0!==e&&e||(null===(n=u.children)||void 0===n?void 0:n.length)||c(u,p)},id:"menuItemWrapper",style:{cursor:null!==(h=u.disabled)&&void 0!==h&&h?"not-allowed":"pointer",backgroundColor:null!==(j=u.disabled)&&void 0!==j&&j?i.COLORS.surface.standard:"transparent"}},{children:[u.customComponent?u.customComponent:e.jsxs(s.MenuItemContainer,Object.assign({isSelected:u.selected,isSubMenuOpen:x,isHovered:S,isDisabled:null!==(g=u.disabled)&&void 0!==g&&g},{children:[e.jsxs(s.ContentContainer,{children:[u.leadingIcon&&e.jsx(s.LeadingIconContainer,{children:u.leadingIcon}),e.jsxs("div",{children:[e.jsx(o.BodyCaption,Object.assign({style:{color:null!==(v=u.disabled)&&void 0!==v&&v?i.COLORS.content.inactive:u.selected||S?i.COLORS.content.positive:i.COLORS.content.primary}},{children:u.label})),u.subText&&e.jsx(o.BodyTiny,Object.assign({style:{color:null!==(O=u.disabled)&&void 0!==O&&O?i.COLORS.content.inactive:u.selected||S?i.COLORS.content.positive:i.COLORS.content.secondary,marginTop:"2px"}},{children:u.subText}))]})]}),u.children&&u.children.length>0?e.jsx(s.TrailingIconContainer,{children:e.jsx(n.default,{width:16,height:16,color:null!==(b=u.disabled)&&void 0!==b&&b?i.COLORS.content.inactive:u.selected||S?i.COLORS.content.positive:i.COLORS.content.primary})}):u.trailingIcon?e.jsx(s.TrailingIconContainer,{children:u.trailingIcon}):e.jsx(e.Fragment,{})]})),!(null!==(C=u.disabled)&&void 0!==C&&C)&&u.children&&u.children.length>0&&x&&e.jsx(s.SubMenuContainer,Object.assign({width:a,className:"submenu",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1)},{children:e.jsx(s.StyledSubMenuWrapper,Object.assign({width:a,top:L.top,left:L.left},{children:e.jsx(s.SubMenuListContainer,{children:e.jsx(t.Suspense,Object.assign({fallback:e.jsx("div",{children:"Loading..."})},{children:e.jsx(d,{width:a,onDropdownItemClick:c,options:u.children,parents:[...p,u]})}))})}))}))]}))};
|
|
@@ -5,8 +5,4 @@ export declare const MenuList: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
options: MultiLevelDropdownOption[];
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
|
-
currentLevel: number;
|
|
12
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("./GroupedMenuList.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("./GroupedMenuList.js"),n=require("./MenuItem.js"),o=require("./MultiLevelDropdown.styled.js");exports.MenuList=r=>{let{width:i,onDropdownItemClick:s,options:u,parents:p}=r;return e.jsx(o.StyledMenuList,{children:u.map(((o,r)=>"value"in o?e.jsx(n.MenuItem,{width:i,onDropdownItemClick:s,option:o,parents:p},r):"options"in o&&o.options.length>0?e.jsx(t.GroupedMenuList,{width:i,onDropdownItemClick:s,option:o,parents:p},r):void 0))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../zeroState/ZeroState.js"),r=require("../../constants/Theme.js"),s=require("../dropdown/OpenedDropdown/components/searchbox/SearchBox.js"),o=require("../floater/floater.js"),i=require("./MenuList.js"),l=require("./MultiLevelDropdown.styled.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../zeroState/ZeroState.js"),r=require("../../constants/Theme.js"),s=require("../dropdown/OpenedDropdown/components/searchbox/SearchBox.js"),o=require("../floater/floater.js"),i=require("./MenuList.js"),l=require("./MultiLevelDropdown.styled.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t);exports.MultiLevelDropdown=u=>{let{options:a,width:d,isSearchable:f,onDropdownItemClick:p,refElement:h,topOffset:j,leftOffset:w,isDropdownOpen:x,onDropdownOutsideClick:O}=u;const b=c.default.useRef(null),[g,m]=t.useState(a),v=e=>{const t=Array.isArray(a)?[...a]:[],n=[];for(;t.length>0;){const r=t.shift();r&&r.label.toLowerCase().includes(e.toLowerCase())&&n.push(r),r&&"children"in r&&r.children?t.push(...r.children):r&&"options"in r&&r.options&&t.push(...r.options)}const r=e=>e.map((e=>{if(n.includes(e))return e;if("children"in e&&e.children){const t=r(e.children);if(t.length>0)return Object.assign(Object.assign({},e),{children:t})}if("options"in e&&e.options){const t=r(e.options);if(t.length>0)return Object.assign(Object.assign({},e),{options:t})}return null})).filter((e=>null!==e));m(r(a))},y=e=>{b.current&&!b.current.contains(e.target)?O&&O(!0):O&&O(!1)};return t.useEffect((()=>{x&&v("")}),[x]),t.useEffect((()=>(document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)})),[]),t.useEffect((()=>{m(a)}),[a]),e.jsx(o.Floater,Object.assign({refElement:h,topOffset:j,leftOffset:w},{children:x&&e.jsx("div",Object.assign({ref:b,style:{backgroundColor:r.COLORS.surface.standard,zIndex:99999,borderRadius:"8px",whiteSpace:"normal"}},{children:e.jsxs(l.DropdownContainer,Object.assign({width:d},{children:[f&&e.jsx("div",Object.assign({style:{padding:"4px",width:null!=d?d:"200px"}},{children:e.jsx(s.SearchBox,{onSearch:v,version:"2.0"})})),e.jsx(l.OptionsContainer,Object.assign({width:d},{children:(null!=g?g:[]).length>0&&e.jsx(i.MenuList,{width:null!=d?d:"200px",onDropdownItemClick:p,options:g,parents:[]})})),0===(null!=g?g:[]).length&&e.jsx(l.NoResultsContainer,Object.assign({style:{width:null!=d?d:"200px"}},{children:e.jsx(n.ZeroState,{title:"No results found!",subTitle:"Sorry, we are unable to find any results for your search."})}))]}))}))}))};
|
|
@@ -5,9 +5,6 @@ export interface MultiLevelDropdownProps extends FloaterProps {
|
|
|
5
5
|
width?: string;
|
|
6
6
|
isSearchable?: boolean;
|
|
7
7
|
isDropdownOpen?: boolean;
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
8
|
onDropdownOutsideClick?: (isOutsideClick: any) => void;
|
|
12
9
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
13
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),s=require("./RadioButton.styled.js"),t=require("../TypographyStyle.js"),l=require("../../constants/Theme.js");const a=s=>{const t=i.useMemo((()=>(null==s?void 0:s.activeColor)||l.COLORS.background.positive.vibrant),[s.activeColor]),a=i.useMemo((()=>s.isDisabled?l.COLORS.content.inactive:s.isActive?t:l.COLORS.content.primary),[s.isDisabled,s.isActive,t]);return e.jsxs("svg",Object.assign({width:s.isSmall?"16":"20",height:s.isSmall?"16":"20",viewBox:s.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsx("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?6:9,stroke:a,strokeWidth:s.isSmall?1.5:2}),s.isActive&&e.jsx("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?3:5,fill:s.isDisabled?l.COLORS.content.inactive:t})]}))};exports.RadioButton=o=>{const[
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),s=require("./RadioButton.styled.js"),t=require("../TypographyStyle.js"),l=require("../../constants/Theme.js");const a=s=>{const t=i.useMemo((()=>(null==s?void 0:s.activeColor)||l.COLORS.background.positive.vibrant),[s.activeColor]),a=i.useMemo((()=>s.isDisabled?l.COLORS.content.inactive:s.isActive?t:l.COLORS.content.primary),[s.isDisabled,s.isActive,t]);return e.jsxs("svg",Object.assign({width:s.isSmall?"16":"20",height:s.isSmall?"16":"20",viewBox:s.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsx("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?6:9,stroke:a,strokeWidth:s.isSmall?1.5:2}),s.isActive&&e.jsx("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?3:5,fill:s.isDisabled?l.COLORS.content.inactive:t})]}))};exports.RadioButton=o=>{const[r,c]=i.useState(o.isActive||!1),[n,d]=i.useState(!1),[O,S]=i.useState(!1);i.useEffect((()=>{c(o.isActive)}),[o.isActive]);return e.jsxs(s.RadioButtonContainer,Object.assign({onClick:()=>{var e;if(!o.skipSelectingOff&&!o.isDisabled){const i=!r;c(i),null===(e=o.onValueChange)||void 0===e||e.call(o,i,o.value)}},onMouseEnter:()=>d(!o.skipHoverState),onMouseLeave:()=>d(!1),onMouseDown:()=>S(!o.skipHoverState),onMouseUp:()=>S(!1),style:o.caption?{alignItems:"flex-start"}:{}},{children:[e.jsx(s.RadioButtonIcon,Object.assign({checked:r,hovered:n,clicked:O,isDisabled:o.isDisabled||!1,size:o.size,style:o.caption?{margin:"2px 0"}:{}},{children:e.jsx(a,{isSmall:"SMALL"===o.size,isActive:r,isDisabled:o.isDisabled||!1,activeColor:o.activeColor})})),e.jsxs("div",{children:[o.label?o.boldOnChecked&&r||o.alwaysBold?e.jsx(t.TitleSmall,Object.assign({color:o.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:o.label})):"SMALL"===o.size?e.jsx(t.BodyCaption,Object.assign({color:o.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:o.label})):"MEDIUM"===o.labelSize?e.jsx(t.BodySecondary,Object.assign({color:o.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:o.label})):e.jsx(t.BodyPrimary,Object.assign({color:o.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:o.label})):e.jsx(e.Fragment,{}),o.caption&&e.jsx(t.BodyCaption,Object.assign({color:o.isDisabled?l.COLORS.text.disabled:l.COLORS.text.secondary},{children:o.caption}))]})]}))};
|
|
@@ -32,6 +32,8 @@ export interface SingleChecklistItemType {
|
|
|
32
32
|
buttonDisabled?: boolean;
|
|
33
33
|
hideRedirectButton?: boolean;
|
|
34
34
|
hideSetupButton?: boolean;
|
|
35
|
+
/** Custom node to render in place of the default setup button. */
|
|
36
|
+
customSetupButton?: React.ReactNode;
|
|
35
37
|
}
|
|
36
38
|
export interface MultiChecklistItemType {
|
|
37
39
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{ActiveChecklistIcon as i}from"../../assets/icons/ActiveChecklistIcon.js";import{CompletedChecklistIcon as s}from"../../assets/icons/CompletedChecklistIcon.js";import{InactiveChecklistIcon as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{ActiveChecklistIcon as i}from"../../assets/icons/ActiveChecklistIcon.js";import{CompletedChecklistIcon as s}from"../../assets/icons/CompletedChecklistIcon.js";import{InactiveChecklistIcon as o}from"../../assets/icons/InactiveChecklistIcon.js";import"../../_virtual/_tslib.js";import r from"../../assets/icons/chevronRight.svg.js";import n from"../../assets/icons/info.svg.js";import{useState as l,useEffect as c}from"react";import{COLORS as a}from"../../constants/Theme.js";import{Alert as d}from"../alerts/Alert.js";import{ALERT_TYPES as p,CONTENT_POSITION as m}from"../alerts/AlertHelper.js";import{Button as g}from"../button/Button.js";import{ProgressBarV2 as h,ProgressBarType as u}from"../progress-bar-v2/ProgressBarV2.js";import{Tag as v}from"../tag/Tag.js";import{Tooltip as f}from"../tooltips/Tooltip.js";import{TitleMedium as y,BodySecondary as b,TitleSmall as j}from"../TypographyStyle.js";import x from"./MultiChecklistItem.js";import{ProgressChecklistContainer as C,HeaderSection as T,ProgressBarSection as A,SingleChecklistItem as O,SingleChecklistMainRow as B,SingleChecklistIconWrapper as I,SingleChecklistContent as k,SingleChecklistHeader as S,SingleChecklistSubheader as P,SingleChecklistActionWrapper as w,SingleChecklistAlertRow as R}from"./ProgressChecklist.style.js";import $ from"./ProgressStepper.js";const D=D=>{let{header:N,subheader:V,items:W=[],progressBarColor:L,headerAction:M,showProgressBar:_=!0,noBorder:E=!1}=D;const[G,H]=l(W);c((()=>{H(W)}),[W]);const q=G.filter((e=>e.isCompleted)).length,z=G.length,F=z>0?q/z*100:0;return e(C,Object.assign({noBorder:E},{children:[e(T,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},{children:[t(y,{children:N}),M&&t("div",{children:M})]})),t(b,Object.assign({color:a.content.secondary},{children:V}))]}),_&&e(A,Object.assign({style:{display:"flex",alignItems:"center",gap:"16px"}},{children:[t("div",Object.assign({style:{flex:1}},{children:t(h,{progress:Math.round(F),type:u.LINE,matchParentWidth:!0,showProgress:!1,color:null!=L?L:a.background.positive.vibrant,progressBarThickness:12})})),t("div",Object.assign({style:{display:"flex",justifyContent:"flex-end",alignItems:"center",minWidth:12}},{children:e(j,Object.assign({style:{color:a.content.secondary,textAlign:"right"}},{children:[q," / ",z]}))}))]})),t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:G.map((l=>{var c,h,u,y,b,j,C,T;if("single"===l.type)return e(O,Object.assign({isActive:l.isActive||!1},{children:[e(B,{children:[t(I,{children:l.isCompleted?null!==(c=l.completedIcon)&&void 0!==c?c:t(s,{}):l.isActive?null!==(h=l.activeIcon)&&void 0!==h?h:t(i,{}):null!==(u=l.icon)&&void 0!==u?u:t(o,{})}),e(k,{children:[e("div",Object.assign({style:{display:"flex",alignItems:"center",gap:12}},{children:[t(S,Object.assign({completed:!!l.isCompleted,isActive:!!l.isActive},{children:l.header})),(null===(y=l.tag)||void 0===y?void 0:y.tagText)&&(l.tag.tooltip?t(f,Object.assign({},l.tag.tooltip,{children:t("span",Object.assign({style:{display:"inline-flex"}},{children:t(v,{tagText:l.tag.tagText,variant:l.tag.variant,type:l.tag.type,theme:l.tag.theme})}))})):t(v,{tagText:l.tag.tagText,variant:l.tag.variant,type:l.tag.type,theme:l.tag.theme}))]})),t(P,{children:l.subheader})]}),l.isCompleted&&!l.hideRedirectButton&&t("div",Object.assign({onClick:l.onSetup,style:{cursor:"pointer"}},{children:t(r,{style:{marginLeft:"12px"},width:12,height:12,color:a.content.secondary})})),!l.isCompleted&&l.isActive&&!l.hideSetupButton&&(l.customSetupButton?l.customSetupButton:t(w,{children:t(g,{buttonText:null!==(b=l.buttonText)&&void 0!==b?b:"Setup",buttonType:null!==(j=l.buttonType)&&void 0!==j?j:"primary",onClick:l.onSetup,disabled:null!==(C=l.buttonDisabled)&&void 0!==C&&C})}))]}),l.alertText&&t(R,{children:t(d,{text:l.alertText,type:null!==(T=l.alertType)&&void 0!==T?T:p.WARNING,contentPosition:m.START,textColor:l.alertType===p.BRAND?"#4B1583":"",icon:e=>t(n,Object.assign({},e))})})]}),l.id);if("multiple"===l.type){const e=l.steps&&l.steps.length>0?l.steps.map(((e,t)=>{var i;return{id:null!==(i=e.id)&&void 0!==i?i:`${l.id}-sub-${t+1}`,text:e.text,label:e.text,onClick:e.onClick,isCompleted:!!e.isCompleted}})):[{id:`${l.id}-sub-1`,text:"Connect",label:"Connect",isCompleted:!1},{id:`${l.id}-sub-2`,text:"Configure",label:"Configure",isCompleted:!1},{id:`${l.id}-sub-3`,text:"Verify",label:"Verify",isCompleted:!1}];return t(x,Object.assign({item:l},{children:t($,{steps:e,isStepperActive:l.isActive})}),l.id)}}))}))]}))};export{D as default};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"styled-components";import{CONTENT_POSITION as e,COLOR_CONFIG_MAP as t}from"./AlertHelper.js";const i=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
justify-content: ${
|
|
4
|
+
justify-content: ${o=>o.contentPosition||e.CENTER};
|
|
5
5
|
padding: 8px 16px;
|
|
6
|
-
background-color: ${
|
|
6
|
+
background-color: ${o=>t[o.type].backgroundColor};
|
|
7
7
|
border-radius: 4px;
|
|
8
|
-
border: 1px solid ${
|
|
9
|
-
`,
|
|
8
|
+
border: 1px solid ${o=>t[o.type].borderColor};
|
|
9
|
+
`,r=o.div`
|
|
10
10
|
flex: 1;
|
|
11
11
|
display: flex;
|
|
12
|
-
justify-content: ${
|
|
13
|
-
|
|
14
|
-
`,r=e.div`
|
|
12
|
+
justify-content: ${o=>o.contentPosition||e.CENTER};
|
|
13
|
+
`,n=o.div`
|
|
15
14
|
margin-left: 16px;
|
|
16
15
|
display: flex;
|
|
17
16
|
align-items: center;
|
|
18
|
-
`;export{
|
|
17
|
+
`;export{r as AlertContentWrapper,i as AlertStyle,n as CloseIconWrapper};
|
|
@@ -5,8 +5,4 @@ export declare const GroupedMenuList: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
option: GroupedOption;
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
|
-
currentLevel: number;
|
|
12
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as o,jsx as t}from"react/jsx-runtime";import{COLORS as r}from"../../constants/Theme.js";import{BodyTiny as e}from"../TypographyStyle.js";import{MenuItem as p}from"./MenuItem.js";import{GroupedMenuListContainer as n}from"./MultiLevelDropdown.styled.js";const i=i=>{let{width:l,onDropdownItemClick:m,option:s,parents:c}=i;return o(n,{children:[t(e,Object.assign({style:{padding:"4px 8px 4px 12px",cursor:"default"},color:r.content.placeholder},{children:s.label})),s.options.map(((o,r)=>t(p,{width:l,onDropdownItemClick:m,option:o,parents:c},r)))]})};export{i as GroupedMenuList};
|
|
@@ -5,7 +5,4 @@ export declare const MenuItem: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
option: SingleOption;
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
currentLevel: number;
|
|
11
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight2.svg.js";import o,{useRef as l,Suspense as r}from"react";import{COLORS as s}from"../../constants/Theme.js";import{BodyCaption as d,BodyTiny as c}from"../TypographyStyle.js";import{MenuItemWrapper as a,MenuItemContainer as p,ContentContainer as h,LeadingIconContainer as u,TrailingIconContainer as m,SubMenuContainer as g,StyledSubMenuWrapper as v,SubMenuListContainer as b}from"./MultiLevelDropdown.styled.js";const f=o.lazy((()=>import("./MenuList.js").then((e=>({default:e.MenuList}))))),j=j=>{let{width:y,onDropdownItemClick:w,option:M,parents:O}=j;var C,I,L,S,T,k,x;const[D,E]=o.useState(!1),[R,z]=o.useState(!1),[B,H]=o.useState({top:0,left:0}),N=l({top:0,left:0});return e(a,Object.assign({onMouseEnter:e=>{E(!0),(e=>{const t=e.currentTarget.getBoundingClientRect();H({top:t.top,left:t.right}),N.current={top:t.top,left:t.right}})(e)},onMouseLeave:()=>{E(!1)},onClick:()=>{var e,t;!w||null!==(e=M.disabled)&&void 0!==e&&e||(null===(t=M.children)||void 0===t?void 0:t.length)||w(M,O)},id:"menuItemWrapper",style:{cursor:null!==(C=M.disabled)&&void 0!==C&&C?"not-allowed":"pointer",backgroundColor:null!==(I=M.disabled)&&void 0!==I&&I?s.surface.standard:"transparent"}},{children:[M.customComponent?M.customComponent:e(p,Object.assign({isSelected:M.selected,isSubMenuOpen:D,isHovered:R,isDisabled:null!==(L=M.disabled)&&void 0!==L&&L},{children:[e(h,{children:[M.leadingIcon&&t(u,{children:M.leadingIcon}),e("div",{children:[t(d,Object.assign({style:{color:null!==(S=M.disabled)&&void 0!==S&&S?s.content.inactive:M.selected||R?s.content.positive:s.content.primary}},{children:M.label})),M.subText&&t(c,Object.assign({style:{color:null!==(T=M.disabled)&&void 0!==T&&T?s.content.inactive:M.selected||R?s.content.positive:s.content.secondary,marginTop:"2px"}},{children:M.subText}))]})]}),M.children&&M.children.length>0?t(m,{children:t(i,{width:16,height:16,color:null!==(k=M.disabled)&&void 0!==k&&k?s.content.inactive:M.selected||R?s.content.positive:s.content.primary})}):M.trailingIcon?t(m,{children:M.trailingIcon}):t(n,{})]})),!(null!==(x=M.disabled)&&void 0!==x&&x)&&M.children&&M.children.length>0&&D&&t(g,Object.assign({width:y,className:"submenu",onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1)},{children:t(v,Object.assign({width:y,top:B.top,left:B.left},{children:t(b,{children:t(r,Object.assign({fallback:t("div",{children:"Loading..."})},{children:t(f,{width:y,onDropdownItemClick:w,options:M.children,parents:[...O,M]})}))})}))}))]}))};export{j as MenuItem};
|
|
@@ -5,8 +5,4 @@ export declare const MenuList: React.FC<{
|
|
|
5
5
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
6
6
|
options: MultiLevelDropdownOption[];
|
|
7
7
|
parents: MultiLevelDropdownOption[];
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
|
-
currentLevel: number;
|
|
12
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{GroupedMenuList as t}from"./GroupedMenuList.js";import{MenuItem as n}from"./MenuItem.js";import{StyledMenuList as i}from"./MultiLevelDropdown.styled.js";const r=r=>{let{width:e,onDropdownItemClick:p,options:m,parents:s}=r;return o(i,{children:m.map(((i,r)=>"value"in i?o(n,{width:e,onDropdownItemClick:p,option:i,parents:s},r):"options"in i&&i.options.length>0?o(t,{width:e,onDropdownItemClick:p,option:i,parents:s},r):void 0))})};export{r as MenuList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import t,{useState as o,useEffect as r}from"react";import{ZeroState as s}from"../zeroState/ZeroState.js";import{COLORS as i}from"../../constants/Theme.js";import{SearchBox as l}from"../dropdown/OpenedDropdown/components/searchbox/SearchBox.js";import{Floater as c}from"../floater/floater.js";import{MenuList as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import t,{useState as o,useEffect as r}from"react";import{ZeroState as s}from"../zeroState/ZeroState.js";import{COLORS as i}from"../../constants/Theme.js";import{SearchBox as l}from"../dropdown/OpenedDropdown/components/searchbox/SearchBox.js";import{Floater as c}from"../floater/floater.js";import{MenuList as d}from"./MenuList.js";import{DropdownContainer as a,OptionsContainer as p,NoResultsContainer as u}from"./MultiLevelDropdown.styled.js";const f=f=>{let{options:h,width:m,isSearchable:w,onDropdownItemClick:g,refElement:b,topOffset:j,leftOffset:O,isDropdownOpen:x,onDropdownOutsideClick:y}=f;const v=t.useRef(null),[S,C]=o(h),D=e=>{const n=Array.isArray(h)?[...h]:[],t=[];for(;n.length>0;){const o=n.shift();o&&o.label.toLowerCase().includes(e.toLowerCase())&&t.push(o),o&&"children"in o&&o.children?n.push(...o.children):o&&"options"in o&&o.options&&n.push(...o.options)}const o=e=>e.map((e=>{if(t.includes(e))return e;if("children"in e&&e.children){const n=o(e.children);if(n.length>0)return Object.assign(Object.assign({},e),{children:n})}if("options"in e&&e.options){const n=o(e.options);if(n.length>0)return Object.assign(Object.assign({},e),{options:n})}return null})).filter((e=>null!==e));C(o(h))},L=e=>{v.current&&!v.current.contains(e.target)?y&&y(!0):y&&y(!1)};return r((()=>{x&&D("")}),[x]),r((()=>(document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)})),[]),r((()=>{C(h)}),[h]),e(c,Object.assign({refElement:b,topOffset:j,leftOffset:O},{children:x&&e("div",Object.assign({ref:v,style:{backgroundColor:i.surface.standard,zIndex:99999,borderRadius:"8px",whiteSpace:"normal"}},{children:n(a,Object.assign({width:m},{children:[w&&e("div",Object.assign({style:{padding:"4px",width:null!=m?m:"200px"}},{children:e(l,{onSearch:D,version:"2.0"})})),e(p,Object.assign({width:m},{children:(null!=S?S:[]).length>0&&e(d,{width:null!=m?m:"200px",onDropdownItemClick:g,options:S,parents:[]})})),0===(null!=S?S:[]).length&&e(u,Object.assign({style:{width:null!=m?m:"200px"}},{children:e(s,{title:"No results found!",subTitle:"Sorry, we are unable to find any results for your search."})}))]}))}))}))};export{f as MultiLevelDropdown};
|
|
@@ -5,9 +5,6 @@ export interface MultiLevelDropdownProps extends FloaterProps {
|
|
|
5
5
|
width?: string;
|
|
6
6
|
isSearchable?: boolean;
|
|
7
7
|
isDropdownOpen?: boolean;
|
|
8
|
-
allowParentSelection?: boolean;
|
|
9
|
-
maxLevels?: number;
|
|
10
|
-
hideGroupLabel?: boolean;
|
|
11
8
|
onDropdownOutsideClick?: (isOutsideClick: any) => void;
|
|
12
9
|
onDropdownItemClick?: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
|
|
13
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e,Fragment as s}from"react/jsx-runtime";import{useState as l,useEffect as t,useMemo as a}from"react";import{RadioButtonContainer as o,RadioButtonIcon as c}from"./RadioButton.styled.js";import{BodyCaption as
|
|
1
|
+
import{jsxs as i,jsx as e,Fragment as s}from"react/jsx-runtime";import{useState as l,useEffect as t,useMemo as a}from"react";import{RadioButtonContainer as o,RadioButtonIcon as c}from"./RadioButton.styled.js";import{BodyCaption as r,TitleSmall as n,BodySecondary as d,BodyPrimary as b}from"../TypographyStyle.js";import{COLORS as m}from"../../constants/Theme.js";const v=s=>{const l=a((()=>(null==s?void 0:s.activeColor)||m.background.positive.vibrant),[s.activeColor]),t=a((()=>s.isDisabled?m.content.inactive:s.isActive?l:m.content.primary),[s.isDisabled,s.isActive,l]);return i("svg",Object.assign({width:s.isSmall?"16":"20",height:s.isSmall?"16":"20",viewBox:s.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?6:9,stroke:t,strokeWidth:s.isSmall?1.5:2}),s.isActive&&e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?3:5,fill:s.isDisabled?m.content.inactive:l})]}))},p=a=>{const[p,h]=l(a.isActive||!1),[g,x]=l(!1),[S,y]=l(!1);t((()=>{h(a.isActive)}),[a.isActive]);return i(o,Object.assign({onClick:()=>{var i;if(!a.skipSelectingOff&&!a.isDisabled){const e=!p;h(e),null===(i=a.onValueChange)||void 0===i||i.call(a,e,a.value)}},onMouseEnter:()=>x(!a.skipHoverState),onMouseLeave:()=>x(!1),onMouseDown:()=>y(!a.skipHoverState),onMouseUp:()=>y(!1),style:a.caption?{alignItems:"flex-start"}:{}},{children:[e(c,Object.assign({checked:p,hovered:g,clicked:S,isDisabled:a.isDisabled||!1,size:a.size,style:a.caption?{margin:"2px 0"}:{}},{children:e(v,{isSmall:"SMALL"===a.size,isActive:p,isDisabled:a.isDisabled||!1,activeColor:a.activeColor})})),i("div",{children:[a.label?a.boldOnChecked&&p||a.alwaysBold?e(n,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):"SMALL"===a.size?e(r,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):"MEDIUM"===a.labelSize?e(d,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):e(b,Object.assign({color:a.isDisabled?m.text.disabled:m.text.primary},{children:a.label})):e(s,{}),a.caption&&e(r,Object.assign({color:a.isDisabled?m.text.disabled:m.text.secondary},{children:a.caption}))]})]}))};export{p as RadioButton};
|