@bikdotai/bik-component-library 0.0.548-productpicker.0 → 0.0.549-0

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.
@@ -7,5 +7,6 @@ export type TablePaginationProps = {
7
7
  hidePageSizeOptions?: boolean;
8
8
  updatePageNumber: (pageNumber: number) => void;
9
9
  updatePageSize: (option: DropdownOption | DropdownOption[]) => void;
10
+ showTotalText?: boolean;
10
11
  };
11
12
  export declare const TablePagination: React.FC<TablePaginationProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronLeft.svg.js"),t=require("../../assets/icons/chevronRight.svg.js"),n=require("./TablePagination.styled.js"),a=require("../../constants/Theme.js"),i=require("../dropdown/Dropdown.js"),r=require("../TypographyStyle.js");exports.TablePagination=o=>{let{pageNumber:l,pageSize:c,totalRows:d,updatePageNumber:g,updatePageSize:h,hidePageSizeOptions:j}=o;const p=a.DEFAULT_THEME.colorsV2,u=(l-1)*c+1,y=(l-1)*c+c,b=Math.ceil(d/c),x=1==b;let v=[];v=b>=5?l===b?[l-4,l-3,l-2,l-1,l]:1===l?[l,l+1,l+2,l+3,l+4]:2===l?[l-1,l,l+1,l+2,l+3]:l===b-1?[l-3,l-2,l-1,l,l+1]:[l-2,l-1,l,l+1,l+2]:Array.from({length:b},((e,s)=>s+1));const m=[{label:"5 rows per page",value:"5",selected:5===c},{label:"10 rows per page",value:"10",selected:10===c},{label:"20 rows per page",value:"20",selected:20===c}];return e.jsxs(n.StyledTablePaginationContainer,{children:[!j&&e.jsx("div",{children:e.jsx(i.Dropdown,{size:"small",options:m,onSelect:h,width:"162px"})}),e.jsxs("div",Object.assign({className:"paging__container"},{children:[!j&&d&&e.jsxs(r.BodySecondary,Object.assign({style:{color:p.content.placeholder,marginRight:8}},{children:["Showing ",u,"-",y>d?d:y," of"," ",d," results"]})),e.jsxs("div",Object.assign({className:"pages__buttons-container"},{children:[!x&&e.jsx(n.StyledPagingContainer,Object.assign({active:!1,onClick:()=>{1!==l&&g(Math.max(l-1,1))},disabled:1===l},{children:e.jsx(s.default,{color:p.content.secondary,height:14,width:14})})),v.map((s=>e.jsx(n.StyledPagingContainer,Object.assign({active:s==l,onClick:()=>g(s),style:{display:1==s&&d<=c?"none":"flex"}},{children:e.jsx(r.BodySecondary,Object.assign({style:{color:s==l?p.content.primaryInverse:p.content.secondary}},{children:s}))}),s))),!x&&e.jsx(n.StyledPagingContainer,Object.assign({isLast:!0,active:!1,onClick:()=>{l!==b&&g(Math.min(l+1,b))},disabled:l===b},{children:e.jsx(t.default,{color:p.content.secondary,height:14,width:14})}))]}))]}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronLeft.svg.js"),t=require("../../assets/icons/chevronRight.svg.js"),n=require("./TablePagination.styled.js"),a=require("../../constants/Theme.js"),i=require("../dropdown/Dropdown.js"),o=require("../TypographyStyle.js");exports.TablePagination=r=>{let{pageNumber:l,pageSize:c,totalRows:d,updatePageNumber:g,updatePageSize:h,hidePageSizeOptions:j,showTotalText:p}=r;const y=a.DEFAULT_THEME.colorsV2,u=(l-1)*c+1,b=(l-1)*c+c,x=Math.ceil(d/c),v=1==x;let S=[];S=x>=5?l===x?[l-4,l-3,l-2,l-1,l]:1===l?[l,l+1,l+2,l+3,l+4]:2===l?[l-1,l,l+1,l+2,l+3]:l===x-1?[l-3,l-2,l-1,l,l+1]:[l-2,l-1,l,l+1,l+2]:Array.from({length:x},((e,s)=>s+1));const w=[{label:"5 rows per page",value:"5",selected:5===c},{label:"10 rows per page",value:"10",selected:10===c},{label:"20 rows per page",value:"20",selected:20===c}];return e.jsxs(n.StyledTablePaginationContainer,{children:[!j&&e.jsx("div",{children:e.jsx(i.Dropdown,{size:"small",options:w,onSelect:h,width:"162px"})}),e.jsxs("div",Object.assign({className:"paging__container"},{children:[!j&&d&&e.jsxs(o.BodySecondary,Object.assign({style:{color:y.content.placeholder}},{children:["Showing ",u,"-",b>d?d:b," of"," ",d," results"]})),e.jsxs("div",Object.assign({className:"pages__buttons-container"},{children:[!v&&e.jsx(n.StyledPagingContainer,Object.assign({active:!1,onClick:()=>{1!==l&&g(Math.max(l-1,1))},disabled:1===l},{children:e.jsx(s.default,{color:y.content.secondary,height:14,width:14})})),S.map((s=>e.jsx(n.StyledPagingContainer,Object.assign({active:s==l,onClick:()=>g(s),style:{display:1==s&&d<=c?"none":"flex"}},{children:e.jsx(o.BodySecondary,Object.assign({style:{color:s==l?y.content.primaryInverse:y.content.secondary}},{children:s}))}),s))),!v&&e.jsx(n.StyledPagingContainer,Object.assign({isLast:!0,active:!1,onClick:()=>{l!==x&&g(Math.min(l+1,x))},disabled:l===x},{children:e.jsx(t.default,{color:y.content.secondary,height:14,width:14})}))]})),j&&d&&p&&e.jsxs(o.BodySecondary,Object.assign({style:{color:y.content.placeholder}},{children:["Showing ",u,"-",b>d?d:b," of"," ",d," results"]}))]}))]})};
@@ -13,6 +13,7 @@
13
13
  margin-bottom: 8px;
14
14
  justify-content: center;
15
15
  align-items: center;
16
+ gap: 8px;
16
17
  }
17
18
 
18
19
  .pages__buttons-container {
@@ -1,5 +1,5 @@
1
1
  import { TagProps } from './model';
2
2
  export declare const Tag: {
3
- ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, }: TagProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, tooltipContent, tooltipDirection, showTooltipArrow, }: TagProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../TypographyStyle.js"),r=require("./model.js"),t=require("./Tag.styled.js"),a=require("./themes.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(i);const l=i=>{let{tagText:s,LeadingIcon:l,TrailingIcon:o,onLeadingIconClicked:d,leadingIconId:g,trailingIconId:p,onTrailingIconClicked:j,theme:u="light",type:y="neutral",variant:m="regular",version:h,cursor:b}=i,x=s;const T=u;let O=y;r.ValidTagTypeMap[m][y]||(O="neutral"),"circle"===m&&"number"==typeof x&&x>99&&(x="99+");const I={height:"compressed"===m?11:16,width:"compressed"===m?11:16,color:a.getTagIconColor(u,O),style:{display:"block"}};return e.jsx(t.Tag,Object.assign({cursor:b,theme:T,type:y,variant:m,version:h},{children:e.jsxs("div",Object.assign({className:"container"},{children:[l&&e.jsx("button",Object.assign({className:"icon-leading",onClick:d,id:`${g}-wrapper`||"leading-icon-wrapper"},{children:c.default.createElement(l,Object.assign(Object.assign({},I),{id:g||"leading-icon"}))})),""!==x&&("ai"===y&&"light"===u?"compressed"===m?e.jsx(n.AiBodyTiny,{children:x}):e.jsx(n.AiBodyCaption,{children:x}):"compressed"===m?e.jsx(n.BodyTiny,Object.assign({className:"text"},{children:x})):e.jsx(n.BodyCaption,Object.assign({className:"text"},{children:x}))),o&&e.jsx("button",Object.assign({className:"icon-trailing",onClick:j,id:`${p}-wrapper`||"trailing-icon-wrapper"},{children:c.default.createElement(o,Object.assign(Object.assign({},I),{id:p||"trailing-icon"}))}))]}))}))};l.displayName="Tag",exports.Tag=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),t=require("../tooltips/Tooltip.js"),r=require("../TypographyStyle.js"),n=require("./model.js"),s=require("./Tag.styled.js"),a=require("./themes.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(i);const l=i=>{let{tagText:o,LeadingIcon:l,TrailingIcon:d,onLeadingIconClicked:g,leadingIconId:p,trailingIconId:j,onTrailingIconClicked:u,theme:h="light",type:y="neutral",variant:m="regular",version:b,cursor:T,tooltipContent:x,tooltipDirection:O,showTooltipArrow:I}=i,f=o;const v=h;let w=y;n.ValidTagTypeMap[m][y]||(w="neutral"),"circle"===m&&"number"==typeof f&&f>99&&(f="99+");const C={height:"compressed"===m?11:16,width:"compressed"===m?11:16,color:a.getTagIconColor(h,w),style:{display:"block"}};return e.jsx(s.Tag,Object.assign({cursor:T,theme:v,type:y,variant:m,version:b},{children:e.jsx(t.Tooltip,Object.assign({body:x,placement:O||"right",hideArrow:!I},{children:e.jsxs("div",Object.assign({className:"container"},{children:[l&&e.jsx("button",Object.assign({className:"icon-leading",onClick:g,id:`${p}-wrapper`||"leading-icon-wrapper"},{children:c.default.createElement(l,Object.assign(Object.assign({},C),{id:p||"leading-icon"}))})),""!==f&&("ai"===y&&"light"===h?"compressed"===m?e.jsx(r.AiBodyTiny,{children:f}):e.jsx(r.AiBodyCaption,{children:f}):"compressed"===m?e.jsx(r.BodyTiny,Object.assign({className:"text"},{children:f})):e.jsx(r.BodyCaption,Object.assign({className:"text"},{children:f}))),d&&e.jsx("button",Object.assign({className:"icon-trailing",onClick:u,id:`${j}-wrapper`||"trailing-icon-wrapper"},{children:c.default.createElement(d,Object.assign(Object.assign({},C),{id:j||"trailing-icon"}))}))]}))}))}))};l.displayName="Tag",exports.Tag=l;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MouseEventHandler } from 'react';
3
+ import { Placement } from '../tooltips/Tooltip';
3
4
  export type TagTheme = 'light' | 'dark';
4
5
  export type TagVariant = 'regular' | 'circle' | 'compressed';
5
6
  export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey' | 'ai';
@@ -83,4 +84,10 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
83
84
  tagText: string | number;
84
85
  version?: '1.0' | '2.0';
85
86
  cursor?: string;
87
+ /**
88
+ * Tooltip content. If blank then not displayed
89
+ */
90
+ tooltipContent?: string;
91
+ tooltipDirection?: Placement;
92
+ showTooltipArrow?: boolean;
86
93
  }
@@ -7,5 +7,6 @@ export type TablePaginationProps = {
7
7
  hidePageSizeOptions?: boolean;
8
8
  updatePageNumber: (pageNumber: number) => void;
9
9
  updatePageSize: (option: DropdownOption | DropdownOption[]) => void;
10
+ showTotalText?: boolean;
10
11
  };
11
12
  export declare const TablePagination: React.FC<TablePaginationProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import s from"../../assets/icons/chevronLeft.svg.js";import o from"../../assets/icons/chevronRight.svg.js";import{StyledTablePaginationContainer as i,StyledPagingContainer as n}from"./TablePagination.styled.js";import{DEFAULT_THEME as a}from"../../constants/Theme.js";import{Dropdown as r}from"../dropdown/Dropdown.js";import{BodySecondary as c}from"../TypographyStyle.js";const l=l=>{let{pageNumber:d,pageSize:p,totalRows:g,updatePageNumber:h,updatePageSize:m,hidePageSizeOptions:b}=l;const j=a.colorsV2,v=(d-1)*p+1,y=(d-1)*p+p,f=Math.ceil(g/p),u=1==f;let w=[];w=f>=5?d===f?[d-4,d-3,d-2,d-1,d]:1===d?[d,d+1,d+2,d+3,d+4]:2===d?[d-1,d,d+1,d+2,d+3]:d===f-1?[d-3,d-2,d-1,d,d+1]:[d-2,d-1,d,d+1,d+2]:Array.from({length:f},((e,t)=>t+1));return e(i,{children:[!b&&t("div",{children:t(r,{size:"small",options:[{label:"5 rows per page",value:"5",selected:5===p},{label:"10 rows per page",value:"10",selected:10===p},{label:"20 rows per page",value:"20",selected:20===p}],onSelect:m,width:"162px"})}),e("div",Object.assign({className:"paging__container"},{children:[!b&&g&&e(c,Object.assign({style:{color:j.content.placeholder,marginRight:8}},{children:["Showing ",v,"-",y>g?g:y," of"," ",g," results"]})),e("div",Object.assign({className:"pages__buttons-container"},{children:[!u&&t(n,Object.assign({active:!1,onClick:()=>{1!==d&&h(Math.max(d-1,1))},disabled:1===d},{children:t(s,{color:j.content.secondary,height:14,width:14})})),w.map((e=>t(n,Object.assign({active:e==d,onClick:()=>h(e),style:{display:1==e&&g<=p?"none":"flex"}},{children:t(c,Object.assign({style:{color:e==d?j.content.primaryInverse:j.content.secondary}},{children:e}))}),e))),!u&&t(n,Object.assign({isLast:!0,active:!1,onClick:()=>{d!==f&&h(Math.min(d+1,f))},disabled:d===f},{children:t(o,{color:j.content.secondary,height:14,width:14})}))]}))]}))]})};export{l as TablePagination};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"../../assets/icons/chevronLeft.svg.js";import s from"../../assets/icons/chevronRight.svg.js";import{StyledTablePaginationContainer as n,StyledPagingContainer as i}from"./TablePagination.styled.js";import{DEFAULT_THEME as r}from"../../constants/Theme.js";import{Dropdown as a}from"../dropdown/Dropdown.js";import{BodySecondary as l}from"../TypographyStyle.js";const c=c=>{let{pageNumber:d,pageSize:h,totalRows:p,updatePageNumber:g,updatePageSize:m,hidePageSizeOptions:b,showTotalText:j}=c;const v=r.colorsV2,y=(d-1)*h+1,f=(d-1)*h+h,u=Math.ceil(p/h),w=1==u;let O=[];O=u>=5?d===u?[d-4,d-3,d-2,d-1,d]:1===d?[d,d+1,d+2,d+3,d+4]:2===d?[d-1,d,d+1,d+2,d+3]:d===u-1?[d-3,d-2,d-1,d,d+1]:[d-2,d-1,d,d+1,d+2]:Array.from({length:u},((e,t)=>t+1));return e(n,{children:[!b&&t("div",{children:t(a,{size:"small",options:[{label:"5 rows per page",value:"5",selected:5===h},{label:"10 rows per page",value:"10",selected:10===h},{label:"20 rows per page",value:"20",selected:20===h}],onSelect:m,width:"162px"})}),e("div",Object.assign({className:"paging__container"},{children:[!b&&p&&e(l,Object.assign({style:{color:v.content.placeholder}},{children:["Showing ",y,"-",f>p?p:f," of"," ",p," results"]})),e("div",Object.assign({className:"pages__buttons-container"},{children:[!w&&t(i,Object.assign({active:!1,onClick:()=>{1!==d&&g(Math.max(d-1,1))},disabled:1===d},{children:t(o,{color:v.content.secondary,height:14,width:14})})),O.map((e=>t(i,Object.assign({active:e==d,onClick:()=>g(e),style:{display:1==e&&p<=h?"none":"flex"}},{children:t(l,Object.assign({style:{color:e==d?v.content.primaryInverse:v.content.secondary}},{children:e}))}),e))),!w&&t(i,Object.assign({isLast:!0,active:!1,onClick:()=>{d!==u&&g(Math.min(d+1,u))},disabled:d===u},{children:t(s,{color:v.content.secondary,height:14,width:14})}))]})),b&&p&&j&&e(l,Object.assign({style:{color:v.content.placeholder}},{children:["Showing ",y,"-",f>p?p:f," of"," ",p," results"]}))]}))]})};export{c as TablePagination};
@@ -13,6 +13,7 @@ import r from"styled-components";import{DEFAULT_THEME as t}from"../../constants/
13
13
  margin-bottom: 8px;
14
14
  justify-content: center;
15
15
  align-items: center;
16
+ gap: 8px;
16
17
  }
17
18
 
18
19
  .pages__buttons-container {
@@ -1,5 +1,5 @@
1
1
  import { TagProps } from './model';
2
2
  export declare const Tag: {
3
- ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, }: TagProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, tooltipContent, tooltipDirection, showTooltipArrow, }: TagProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{AiBodyTiny as r,AiBodyCaption as t,BodyTiny as a,BodyCaption as c}from"../TypographyStyle.js";import{ValidTagTypeMap as s}from"./model.js";import{Tag as o}from"./Tag.styled.js";import{getTagIconColor as l}from"./themes.js";const d=d=>{let{tagText:g,LeadingIcon:m,TrailingIcon:p,onLeadingIconClicked:h,leadingIconId:j,trailingIconId:b,onTrailingIconClicked:u,theme:y="light",type:O="neutral",variant:I="regular",version:f,cursor:T}=d,k=g;const v=y;let w=O;s[I][O]||(w="neutral"),"circle"===I&&"number"==typeof k&&k>99&&(k="99+");const N={height:"compressed"===I?11:16,width:"compressed"===I?11:16,color:l(y,w),style:{display:"block"}};return e(o,Object.assign({cursor:T,theme:v,type:O,variant:I,version:f},{children:i("div",Object.assign({className:"container"},{children:[m&&e("button",Object.assign({className:"icon-leading",onClick:h,id:`${j}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(m,Object.assign(Object.assign({},N),{id:j||"leading-icon"}))})),""!==k&&("ai"===O&&"light"===y?e("compressed"===I?r:t,{children:k}):e("compressed"===I?a:c,Object.assign({className:"text"},{children:k}))),p&&e("button",Object.assign({className:"icon-trailing",onClick:u,id:`${b}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(p,Object.assign(Object.assign({},N),{id:b||"trailing-icon"}))}))]}))}))};d.displayName="Tag";export{d as Tag};
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import t from"react";import{Tooltip as r}from"../tooltips/Tooltip.js";import{AiBodyTiny as n,AiBodyCaption as o,BodyTiny as a,BodyCaption as c}from"../TypographyStyle.js";import{ValidTagTypeMap as s}from"./model.js";import{Tag as l}from"./Tag.styled.js";import{getTagIconColor as d}from"./themes.js";const p=p=>{let{tagText:g,LeadingIcon:m,TrailingIcon:h,onLeadingIconClicked:j,leadingIconId:b,trailingIconId:y,onTrailingIconClicked:u,theme:O="light",type:T="neutral",variant:f="regular",version:w,cursor:I,tooltipContent:k,tooltipDirection:v,showTooltipArrow:C}=p,N=g;const x=O;let A=T;s[f][T]||(A="neutral"),"circle"===f&&"number"==typeof N&&N>99&&(N="99+");const E={height:"compressed"===f?11:16,width:"compressed"===f?11:16,color:d(O,A),style:{display:"block"}};return e(l,Object.assign({cursor:I,theme:x,type:T,variant:f,version:w},{children:e(r,Object.assign({body:k,placement:v||"right",hideArrow:!C},{children:i("div",Object.assign({className:"container"},{children:[m&&e("button",Object.assign({className:"icon-leading",onClick:j,id:`${b}-wrapper`||"leading-icon-wrapper"},{children:t.createElement(m,Object.assign(Object.assign({},E),{id:b||"leading-icon"}))})),""!==N&&("ai"===T&&"light"===O?e("compressed"===f?n:o,{children:N}):e("compressed"===f?a:c,Object.assign({className:"text"},{children:N}))),h&&e("button",Object.assign({className:"icon-trailing",onClick:u,id:`${y}-wrapper`||"trailing-icon-wrapper"},{children:t.createElement(h,Object.assign(Object.assign({},E),{id:y||"trailing-icon"}))}))]}))}))}))};p.displayName="Tag";export{p as Tag};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MouseEventHandler } from 'react';
3
+ import { Placement } from '../tooltips/Tooltip';
3
4
  export type TagTheme = 'light' | 'dark';
4
5
  export type TagVariant = 'regular' | 'circle' | 'compressed';
5
6
  export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey' | 'ai';
@@ -83,4 +84,10 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
83
84
  tagText: string | number;
84
85
  version?: '1.0' | '2.0';
85
86
  cursor?: string;
87
+ /**
88
+ * Tooltip content. If blank then not displayed
89
+ */
90
+ tooltipContent?: string;
91
+ tooltipDirection?: Placement;
92
+ showTooltipArrow?: boolean;
86
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.548-productpicker.0",
3
+ "version": "0.0.549-0",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",