@bikdotai/bik-component-library 0.0.799-beta.10 → 0.0.799-beta.11
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/dropdown-button/DropdownButton.js +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.style.js +2 -2
- package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/esm/components/dropdown-button/DropdownButton.style.js +6 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("../../_virtual/_tslib.js"),e=require("react/jsx-runtime"),r=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("react"),require("../zeroState/ZeroState.js"),require("../../constants/Theme.js"),require("lodash/debounce"),require("../TypographyStyle.js"),require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js");var n=require("../button/Button.js");require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var t=require("../icon-button/IconButton.js");require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("../../_virtual/_tslib.js"),e=require("react/jsx-runtime"),r=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("react"),require("../zeroState/ZeroState.js"),require("../../constants/Theme.js"),require("lodash/debounce"),require("../TypographyStyle.js"),require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js");var n=require("../button/Button.js");require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var t=require("../icon-button/IconButton.js");require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var s=require("../button/themes.js"),i=require("../spinner/Spinner.js"),d=require("./DropdownButton.style.js");exports.DropdownButton=p=>{var u,l,a,c,b,j,x,v;const m=!!p.iconButtonProps,y=m?null===(u=p.iconButtonProps)||void 0===u?void 0:u.disabled:null===(l=p.buttonProps)||void 0===l?void 0:l.disabled;if(m){const{iconButtonProps:o}=p;return e.jsxs(d.DropdownButtonStyle,Object.assign({type:void 0,disabled:y,isIconButton:!0,iconButtonType:null!==(a=null==o?void 0:o.iconButtonType)&&void 0!==a?a:"primary",iconButtonSize:null!==(c=null==o?void 0:o.size)&&void 0!==c?c:"default"},{children:[e.jsx(t.IconButton,Object.assign({},o,{style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}})),e.jsx("div",{className:"dd-button-divider"}),e.jsx(r.DropdownPopover,Object.assign({},p.dropdownProps,{isChildLoading:!1},{children:e.jsx(t.IconButton,{Icon:p.iconProps,iconButtonType:null!==(b=null==o?void 0:o.iconButtonType)&&void 0!==b?b:"primary",size:null==o?void 0:o.size,disabled:y,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}})}))]}))}const w=p.buttonProps,B=o.__rest(w,["onClick"]);return e.jsxs(d.DropdownButtonStyle,Object.assign({type:p.buttonProps.buttonType,disabled:p.buttonProps.disabled,size:p.buttonProps.size},{children:[(null===(j=p.buttonProps)||void 0===j?void 0:j.isLoading)&&e.jsx(d.LoaderContainer,Object.assign({type:p.buttonProps.buttonType},{children:e.jsx(i.Spinner,{className:"spinner",size:"small",color:s.SpinnerColorMap(p.buttonProps.buttonType||"primary",p.buttonProps.inverse)})})),e.jsx(n.Button,Object.assign({},p.buttonProps,{isLoading:!1,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px"}})),e.jsx("div",{className:"dd-button-divider"}),e.jsx(r.DropdownPopover,Object.assign({},p.dropdownProps,{isChildLoading:null===(x=p.buttonProps)||void 0===x?void 0:x.isLoading},{children:e.jsx(n.Button,Object.assign({},B,{isLoading:!1,buttonText:"",TrailingIcon:p.iconProps,style:Object.assign({borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"},"xs"===(null===(v=p.buttonProps)||void 0===v?void 0:v.size)?{borderLeft:"0px"}:{})}))}))]}))};
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
${t=>{var n,r,i;return t.isIconButton&&`\n\t\tborder-radius: 4px;\n\t\tbackground: ${r=null!==(n=t.iconButtonType)&&void 0!==n?n:"primary",i=t.disabled,i?e.COLORS.background.inactive:"primary"===r?e.COLORS.background.inverseLight:"transparent"};\n\t\toverflow: hidden;\n\t\theight: ${"xs"===t.iconButtonSize?"24px":"32px"};\n\t\talign-items: center;\n\t`}}
|
|
8
8
|
${t=>("xs"===t.size||"xs"===t.iconButtonSize)&&"height: 24px; align-items: center; overflow: hidden;"}
|
|
9
9
|
.dd-button-divider {
|
|
10
|
-
width: ${t=>["primary","destructive"].includes(t.type)||t.isIconButton?"1px":"0px"};
|
|
10
|
+
width: ${t=>["primary","destructive"].includes(t.type)||t.isIconButton||"xs"===t.size?"1px":"0px"};
|
|
11
11
|
height: ${t=>t.isIconButton||"xs"===t.size?"12px":"auto"};
|
|
12
12
|
flex-shrink: 0;
|
|
13
|
-
background-color: ${t=>{return t.isIconButton?"rgba(255, 255, 255, 0.3)":(n=t.type,(null==t?void 0:t.disabled)?e.COLORS.content.inactive:"primary"===n?"#CDA2FC":e.COLORS.content.primaryInverse);var n}};
|
|
13
|
+
background-color: ${t=>{return t.isIconButton?"rgba(255, 255, 255, 0.3)":"xs"===t.size?e.COLORS.stroke.primary:(n=t.type,(null==t?void 0:t.disabled)?e.COLORS.content.inactive:"primary"===n?"#CDA2FC":e.COLORS.content.primaryInverse);var n}};
|
|
14
14
|
}
|
|
15
15
|
`,o=r.default.div`
|
|
16
16
|
position: absolute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as i}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"../../constants/Theme.js";import"lodash/debounce";import"../TypographyStyle.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import{Button as
|
|
1
|
+
import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as i}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"../../constants/Theme.js";import"lodash/debounce";import"../TypographyStyle.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import{Button as e}from"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{IconButton as r}from"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{SpinnerColorMap as s}from"../button/themes.js";import{Spinner as d}from"../spinner/Spinner.js";import{DropdownButtonStyle as p,LoaderContainer as u}from"./DropdownButton.style.js";const l=l=>{var m,a,c,b,j,y,v,w;const g=!!l.iconButtonProps,x=g?null===(m=l.iconButtonProps)||void 0===m?void 0:m.disabled:null===(a=l.buttonProps)||void 0===a?void 0:a.disabled;if(g){const{iconButtonProps:o}=l;return t(p,Object.assign({type:void 0,disabled:x,isIconButton:!0,iconButtonType:null!==(c=null==o?void 0:o.iconButtonType)&&void 0!==c?c:"primary",iconButtonSize:null!==(b=null==o?void 0:o.size)&&void 0!==b?b:"default"},{children:[n(r,Object.assign({},o,{style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}})),n("div",{className:"dd-button-divider"}),n(i,Object.assign({},l.dropdownProps,{isChildLoading:!1},{children:n(r,{Icon:l.iconProps,iconButtonType:null!==(j=null==o?void 0:o.iconButtonType)&&void 0!==j?j:"primary",size:null==o?void 0:o.size,disabled:x,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}})}))]}))}const B=l.buttonProps,P=o(B,["onClick"]);return t(p,Object.assign({type:l.buttonProps.buttonType,disabled:l.buttonProps.disabled,size:l.buttonProps.size},{children:[(null===(y=l.buttonProps)||void 0===y?void 0:y.isLoading)&&n(u,Object.assign({type:l.buttonProps.buttonType},{children:n(d,{className:"spinner",size:"small",color:s(l.buttonProps.buttonType||"primary",l.buttonProps.inverse)})})),n(e,Object.assign({},l.buttonProps,{isLoading:!1,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px"}})),n("div",{className:"dd-button-divider"}),n(i,Object.assign({},l.dropdownProps,{isChildLoading:null===(v=l.buttonProps)||void 0===v?void 0:v.isLoading},{children:n(e,Object.assign({},P,{isLoading:!1,buttonText:"",TrailingIcon:l.iconProps,style:Object.assign({borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"},"xs"===(null===(w=l.buttonProps)||void 0===w?void 0:w.size)?{borderLeft:"0px"}:{})}))}))]}))};export{l as DropdownButton};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import t from"styled-components";import{COLORS as e}from"../../constants/Theme.js";const
|
|
1
|
+
import t from"styled-components";import{COLORS as e}from"../../constants/Theme.js";const i=t.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
width: max-content;
|
|
5
5
|
position: relative;
|
|
6
6
|
align-items: stretch;
|
|
7
|
-
${t=>{var n,
|
|
7
|
+
${t=>{var i,n,r;return t.isIconButton&&`\n\t\tborder-radius: 4px;\n\t\tbackground: ${n=null!==(i=t.iconButtonType)&&void 0!==i?i:"primary",r=t.disabled,r?e.background.inactive:"primary"===n?e.background.inverseLight:"transparent"};\n\t\toverflow: hidden;\n\t\theight: ${"xs"===t.iconButtonSize?"24px":"32px"};\n\t\talign-items: center;\n\t`}}
|
|
8
8
|
${t=>("xs"===t.size||"xs"===t.iconButtonSize)&&"height: 24px; align-items: center; overflow: hidden;"}
|
|
9
9
|
.dd-button-divider {
|
|
10
|
-
width: ${t=>["primary","destructive"].includes(t.type)||t.isIconButton?"1px":"0px"};
|
|
10
|
+
width: ${t=>["primary","destructive"].includes(t.type)||t.isIconButton||"xs"===t.size?"1px":"0px"};
|
|
11
11
|
height: ${t=>t.isIconButton||"xs"===t.size?"12px":"auto"};
|
|
12
12
|
flex-shrink: 0;
|
|
13
|
-
background-color: ${t=>{return t.isIconButton?"rgba(255, 255, 255, 0.3)":(
|
|
13
|
+
background-color: ${t=>{return t.isIconButton?"rgba(255, 255, 255, 0.3)":"xs"===t.size?e.stroke.primary:(i=t.type,(null==t?void 0:t.disabled)?e.content.inactive:"primary"===i?"#CDA2FC":e.content.primaryInverse);var i}};
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,n=t.div`
|
|
16
16
|
position: absolute;
|
|
17
17
|
inset: 0;
|
|
18
18
|
display: flex;
|
|
@@ -23,4 +23,4 @@ import t from"styled-components";import{COLORS as e}from"../../constants/Theme.j
|
|
|
23
23
|
border-radius: 4px;
|
|
24
24
|
background: ${t=>(t=>{switch(t){case"destructive":return e.background.negative.light;case"secondaryGray":return e.surface.subdued;default:return e.background.brandLight}})(t.type)};
|
|
25
25
|
z-index: 3;
|
|
26
|
-
`;export{
|
|
26
|
+
`;export{i as DropdownButtonStyle,n as LoaderContainer};
|