@bikdotai/bik-component-library 0.0.772-beta.16 → 0.0.772-beta.17

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/chevronDown.svg.js"),i=require("../input/Input.js"),l=require("../input/context/InputStyleProvider.js"),s=require("./ChipInput.js"),a=require("./DropdownPopover/index.js"),d=require("./OpenedDropdown/utils/iterationOnOptions.js");function c(){}const u=u=>{var p,h,v,g,{placeHolder:x,size:j,onSelect:f,defaultOptions:w,disabled:b,noErrorHint:O,placeHolderHeight:I,showPlaceholderWhenSelected:S=!1,inputStyle:m={},inputType:y="default",onDeleteChip:E,truncatedText:H,showLeadingIconInPlaceholder:C=!1,showTrailingIconPlaceholder:D=!1,showLabelsOnMoreHover:P=!1,value:T}=u,q=e.__rest(u,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover","value"]);const[M,L]=n.useState(!1),[W,_]=n.useState(!1),z=null!=j?j:"default",k=n.useRef(),[A,F]=n.useState(null!=w?w:[]);n.useEffect((()=>{var e;const t=[];null===(e=null==q?void 0:q.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&t.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&t.push(e)})),F([...t])}),[q.options]),n.useEffect((()=>{w&&F([...w])}),[w]);const R=d.getSelectedOptionsAsText(A),N=S?x:null!==(p=null!=R?R:x)&&void 0!==p?p:"Select an option",U=q.buttonWidth,V=null!==(h=q.dropdownWidth)&&void 0!==h?h:"100%";return t.jsx(t.Fragment,{children:t.jsx(l.InputStyleContext.Provider,Object.assign({value:{InputWrapper:Object.assign(Object.assign(Object.assign({height:I||("x-small"===z?24:"small"===z?32:48),width:null!=U?U:"100%"},U?{maxWidth:U}:{}),{zIndex:1,cursor:"pointer",padding:"x-small"===z?"4px 8px":"6px 8px",backgroundColor:void 0!==T?"#C3E4C4":W?"#E0E0E0":"#ffffff",transition:"background-color 0.3s ease"}),m),input:{minHeight:"100%",maxWidth:"100%",color:void 0!==T?"#00580E":"inherit"}}},{children:t.jsx("div",Object.assign({onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),style:q.width?{width:q.width}:void 0},{children:t.jsxs(a.DropdownPopover,Object.assign({"data-test":q["data-test"],ref:k,onSelect:function(e){Array.isArray(e)?F([...e]):F([e]),null==f||f(e)},disabled:b,onDropdownVisbilityChange:e=>L(e)},q,{width:V},{children:["default"==y&&t.jsx(i.Input,{version:q.version,noErrorHint:O,state:b?"disabled":"none",value:void 0===T?N:T,errorMessage:q.error,variant:z,placeholder:null!=x?x:"Select an option",onChangeText:c,leftIcon:C&&(null===(v=A[0])||void 0===v?void 0:v.leadingIcon)?{icon:()=>{var e;return t.jsx(t.Fragment,{children:null===(e=A[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return t.jsxs("div",Object.assign({style:{display:"flex"}},{children:[D&&(null===(e=A[0])||void 0===e?void 0:e.trailingIcon),t.jsx(r.default,{style:{transform:M?"rotate(180deg)":"rotate(0deg)"},onClick:c,width:"x-small"===z?16:"small"===z?20:24,height:"x-small"===z?16:"small"===z?20:24,color:o.COLORS.content.primary})]}))}},truncateText:null==H||H}),"chip"==y&&t.jsx(s.default,{placeholder:null!=x?x:"Select options",chips:A,onDeleteChip:e=>{null==E||E(e)},errorMessage:q.error,isDropdownOpened:M,sizeToUse:z,containerStyle:{width:null!==(g=q.width)&&void 0!==g?g:"100%",cursor:"pointer"},showLabelsOnMoreHover:P})]}))}))}))})};u.displayName="Dropdown",exports.Dropdown=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/chevronDown.svg.js"),i=require("../input/Input.js"),l=require("../input/context/InputStyleProvider.js"),s=require("./ChipInput.js"),a=require("./DropdownPopover/index.js"),d=require("./OpenedDropdown/utils/iterationOnOptions.js");function c(){}const u=u=>{var p,h,v,g,{placeHolder:x,size:j,onSelect:f,defaultOptions:w,disabled:b,noErrorHint:O,placeHolderHeight:I,showPlaceholderWhenSelected:S=!1,inputStyle:m={},inputType:y="default",onDeleteChip:E,truncatedText:H,showLeadingIconInPlaceholder:C=!1,showTrailingIconPlaceholder:D=!1,showLabelsOnMoreHover:P=!1,value:T}=u,q=e.__rest(u,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover","value"]);const[M,W]=n.useState(!1),[L,_]=n.useState(!1),z=null!=j?j:"default",k=n.useRef(),[A,F]=n.useState(null!=w?w:[]);n.useEffect((()=>{var e;const t=[];null===(e=null==q?void 0:q.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&t.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&t.push(e)})),F([...t])}),[q.options]),n.useEffect((()=>{w&&F([...w])}),[w]);const R=d.getSelectedOptionsAsText(A),N=S?x:null!==(p=null!=R?R:x)&&void 0!==p?p:"Select an option",U=q.buttonWidth,V=null!==(h=q.dropdownWidth)&&void 0!==h?h:q.buttonWidth;return t.jsx(t.Fragment,{children:t.jsx(l.InputStyleContext.Provider,Object.assign({value:{InputWrapper:Object.assign(Object.assign(Object.assign({height:I||("x-small"===z?24:"small"===z?32:48),width:null!=U?U:"100%"},U?{maxWidth:U}:{}),{zIndex:1,cursor:"pointer",padding:"x-small"===z?"4px 8px":"6px 8px",backgroundColor:void 0!==T?"#C3E4C4":L?"#E0E0E0":"#ffffff",transition:"background-color 0.3s ease"}),m),input:{minHeight:"100%",maxWidth:"100%",color:void 0!==T?"#00580E":"inherit"}}},{children:t.jsx("div",Object.assign({onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),style:q.width?{width:q.width}:void 0},{children:t.jsxs(a.DropdownPopover,Object.assign({"data-test":q["data-test"],ref:k,onSelect:function(e){Array.isArray(e)?F([...e]):F([e]),null==f||f(e)},disabled:b,onDropdownVisbilityChange:e=>W(e)},q,{width:V},{children:["default"==y&&t.jsx(i.Input,{version:q.version,noErrorHint:O,state:b?"disabled":"none",value:void 0===T?N:T,errorMessage:q.error,variant:z,placeholder:null!=x?x:"Select an option",onChangeText:c,leftIcon:C&&(null===(v=A[0])||void 0===v?void 0:v.leadingIcon)?{icon:()=>{var e;return t.jsx(t.Fragment,{children:null===(e=A[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return t.jsxs("div",Object.assign({style:{display:"flex"}},{children:[D&&(null===(e=A[0])||void 0===e?void 0:e.trailingIcon),t.jsx(r.default,{style:{transform:M?"rotate(180deg)":"rotate(0deg)"},onClick:c,width:"x-small"===z?16:"small"===z?20:24,height:"x-small"===z?16:"small"===z?20:24,color:o.COLORS.content.primary})]}))}},truncateText:null==H||H}),"chip"==y&&t.jsx(s.default,{placeholder:null!=x?x:"Select options",chips:A,onDeleteChip:e=>{null==E||E(e)},errorMessage:q.error,isDropdownOpened:M,sizeToUse:z,containerStyle:{width:null!==(g=q.width)&&void 0!==g?g:"100%",cursor:"pointer"},showLabelsOnMoreHover:P})]}))}))}))})};u.displayName="Dropdown",exports.Dropdown=u;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ChipStyle: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any> | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const DurationSelectorStyled: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any> | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -2,7 +2,7 @@
2
2
  import type { Color, Variant } from './SampleButton';
3
3
  export declare const SampleButton: import("@emotion/styled").StyledComponent<{
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
5
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
6
  } & {
7
7
  $color: Color;
8
8
  variant: Variant;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- import{__rest as e}from"../../_virtual/_tslib.js";import{jsx as o,Fragment as n,jsxs as t}from"react/jsx-runtime";import{useState as i,useRef as l,useEffect as r}from"react";import{COLORS as s}from"../../constants/Theme.js";import a from"../../assets/icons/chevronDown.svg.js";import{Input as d}from"../input/Input.js";import{InputStyleContext as c}from"../input/context/InputStyleProvider.js";import p from"./ChipInput.js";import{DropdownPopover as h}from"./DropdownPopover/index.js";import{getSelectedOptionsAsText as u}from"./OpenedDropdown/utils/iterationOnOptions.js";function v(){}const m=m=>{var g,f,w,b,{placeHolder:x,size:j,onSelect:O,defaultOptions:I,disabled:y,noErrorHint:H,placeHolderHeight:S,showPlaceholderWhenSelected:E=!1,inputStyle:C={},inputType:T="default",onDeleteChip:D,truncatedText:P,showLeadingIconInPlaceholder:M=!1,showTrailingIconPlaceholder:W=!1,showLabelsOnMoreHover:L=!1,value:z}=m,k=e(m,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover","value"]);const[A,_]=i(!1),[N,U]=i(!1),V=null!=j?j:"default",q=l(),[B,F]=i(null!=I?I:[]);r((()=>{var e;const o=[];null===(e=null==k?void 0:k.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&o.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&o.push(e)})),F([...o])}),[k.options]),r((()=>{I&&F([...I])}),[I]);const G=u(B),J=E?x:null!==(g=null!=G?G:x)&&void 0!==g?g:"Select an option",K=k.buttonWidth,Q=null!==(f=k.dropdownWidth)&&void 0!==f?f:"100%";return o(n,{children:o(c.Provider,Object.assign({value:{InputWrapper:Object.assign(Object.assign(Object.assign({height:S||("x-small"===V?24:"small"===V?32:48),width:null!=K?K:"100%"},K?{maxWidth:K}:{}),{zIndex:1,cursor:"pointer",padding:"x-small"===V?"4px 8px":"6px 8px",backgroundColor:void 0!==z?"#C3E4C4":N?"#E0E0E0":"#ffffff",transition:"background-color 0.3s ease"}),C),input:{minHeight:"100%",maxWidth:"100%",color:void 0!==z?"#00580E":"inherit"}}},{children:o("div",Object.assign({onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),style:k.width?{width:k.width}:void 0},{children:t(h,Object.assign({"data-test":k["data-test"],ref:q,onSelect:function(e){Array.isArray(e)?F([...e]):F([e]),null==O||O(e)},disabled:y,onDropdownVisbilityChange:e=>_(e)},k,{width:Q},{children:["default"==T&&o(d,{version:k.version,noErrorHint:H,state:y?"disabled":"none",value:void 0===z?J:z,errorMessage:k.error,variant:V,placeholder:null!=x?x:"Select an option",onChangeText:v,leftIcon:M&&(null===(w=B[0])||void 0===w?void 0:w.leadingIcon)?{icon:()=>{var e;return o(n,{children:null===(e=B[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return t("div",Object.assign({style:{display:"flex"}},{children:[W&&(null===(e=B[0])||void 0===e?void 0:e.trailingIcon),o(a,{style:{transform:A?"rotate(180deg)":"rotate(0deg)"},onClick:v,width:"x-small"===V?16:"small"===V?20:24,height:"x-small"===V?16:"small"===V?20:24,color:s.content.primary})]}))}},truncateText:null==P||P}),"chip"==T&&o(p,{placeholder:null!=x?x:"Select options",chips:B,onDeleteChip:e=>{null==D||D(e)},errorMessage:k.error,isDropdownOpened:A,sizeToUse:V,containerStyle:{width:null!==(b=k.width)&&void 0!==b?b:"100%",cursor:"pointer"},showLabelsOnMoreHover:L})]}))}))}))})};m.displayName="Dropdown";export{m as Dropdown};
1
+ import{__rest as e}from"../../_virtual/_tslib.js";import{jsx as o,Fragment as n,jsxs as t}from"react/jsx-runtime";import{useState as i,useRef as l,useEffect as r}from"react";import{COLORS as s}from"../../constants/Theme.js";import a from"../../assets/icons/chevronDown.svg.js";import{Input as d}from"../input/Input.js";import{InputStyleContext as c}from"../input/context/InputStyleProvider.js";import p from"./ChipInput.js";import{DropdownPopover as h}from"./DropdownPopover/index.js";import{getSelectedOptionsAsText as u}from"./OpenedDropdown/utils/iterationOnOptions.js";function v(){}const m=m=>{var g,f,b,w,{placeHolder:x,size:j,onSelect:O,defaultOptions:I,disabled:y,noErrorHint:H,placeHolderHeight:S,showPlaceholderWhenSelected:E=!1,inputStyle:C={},inputType:T="default",onDeleteChip:D,truncatedText:P,showLeadingIconInPlaceholder:W=!1,showTrailingIconPlaceholder:M=!1,showLabelsOnMoreHover:L=!1,value:z}=m,k=e(m,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover","value"]);const[A,_]=i(!1),[N,U]=i(!1),V=null!=j?j:"default",q=l(),[B,F]=i(null!=I?I:[]);r((()=>{var e;const o=[];null===(e=null==k?void 0:k.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&o.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&o.push(e)})),F([...o])}),[k.options]),r((()=>{I&&F([...I])}),[I]);const G=u(B),J=E?x:null!==(g=null!=G?G:x)&&void 0!==g?g:"Select an option",K=k.buttonWidth,Q=null!==(f=k.dropdownWidth)&&void 0!==f?f:k.buttonWidth;return o(n,{children:o(c.Provider,Object.assign({value:{InputWrapper:Object.assign(Object.assign(Object.assign({height:S||("x-small"===V?24:"small"===V?32:48),width:null!=K?K:"100%"},K?{maxWidth:K}:{}),{zIndex:1,cursor:"pointer",padding:"x-small"===V?"4px 8px":"6px 8px",backgroundColor:void 0!==z?"#C3E4C4":N?"#E0E0E0":"#ffffff",transition:"background-color 0.3s ease"}),C),input:{minHeight:"100%",maxWidth:"100%",color:void 0!==z?"#00580E":"inherit"}}},{children:o("div",Object.assign({onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),style:k.width?{width:k.width}:void 0},{children:t(h,Object.assign({"data-test":k["data-test"],ref:q,onSelect:function(e){Array.isArray(e)?F([...e]):F([e]),null==O||O(e)},disabled:y,onDropdownVisbilityChange:e=>_(e)},k,{width:Q},{children:["default"==T&&o(d,{version:k.version,noErrorHint:H,state:y?"disabled":"none",value:void 0===z?J:z,errorMessage:k.error,variant:V,placeholder:null!=x?x:"Select an option",onChangeText:v,leftIcon:W&&(null===(b=B[0])||void 0===b?void 0:b.leadingIcon)?{icon:()=>{var e;return o(n,{children:null===(e=B[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return t("div",Object.assign({style:{display:"flex"}},{children:[M&&(null===(e=B[0])||void 0===e?void 0:e.trailingIcon),o(a,{style:{transform:A?"rotate(180deg)":"rotate(0deg)"},onClick:v,width:"x-small"===V?16:"small"===V?20:24,height:"x-small"===V?16:"small"===V?20:24,color:s.content.primary})]}))}},truncateText:null==P||P}),"chip"==T&&o(p,{placeholder:null!=x?x:"Select options",chips:B,onDeleteChip:e=>{null==D||D(e)},errorMessage:k.error,isDropdownOpened:A,sizeToUse:V,containerStyle:{width:null!==(w=k.width)&&void 0!==w?w:"100%",cursor:"pointer"},showLabelsOnMoreHover:L})]}))}))}))})};m.displayName="Dropdown";export{m as Dropdown};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ChipStyle: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any> | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const DurationSelectorStyled: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any> | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -2,7 +2,7 @@
2
2
  import type { Color, Variant } from './SampleButton';
3
3
  export declare const SampleButton: import("@emotion/styled").StyledComponent<{
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
5
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
6
  } & {
7
7
  $color: Color;
8
8
  variant: Variant;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.772-beta.16",
3
+ "version": "0.0.772-beta.17",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,6 +48,7 @@
48
48
  "dependencies": {
49
49
  "@amplitude/analytics-browser": "^2.9.3",
50
50
  "@babel/runtime": "^7.20.7",
51
+ "@bikdotai/bik-component-library": "^0.0.772-beta.16",
51
52
  "@bikdotai/bik-models": "^2.12.0",
52
53
  "@popperjs/core": "^2.11.7",
53
54
  "@tippyjs/react": "^4.2.6",