@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.
- package/dist/cjs/components/TablePagination/TablePagination.d.ts +1 -0
- package/dist/cjs/components/TablePagination/TablePagination.js +1 -1
- package/dist/cjs/components/TablePagination/TablePagination.styled.js +1 -0
- package/dist/cjs/components/tag/Tag.d.ts +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/model.d.ts +7 -0
- package/dist/esm/components/TablePagination/TablePagination.d.ts +1 -0
- package/dist/esm/components/TablePagination/TablePagination.js +1 -1
- package/dist/esm/components/TablePagination/TablePagination.styled.js +1 -0
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +1 -1
- package/dist/esm/components/tag/model.d.ts +7 -0
- package/package.json +1 -1
|
@@ -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"),
|
|
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"]}))]}))]})};
|
|
@@ -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"),
|
|
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
|
|
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};
|
|
@@ -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
|
|
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
|
}
|