freemium-ui 2.0.45 → 2.0.47

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.
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "freemium-ui",
3
+ "version": "2.0.0-beta.73",
4
+ "description": "React Ui Components for Freemium Apps",
5
+ "main": "./index.js",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
8
+ "dependencies": {
9
+ "@blueprintjs/datetime2": "^2.3.4",
10
+ "@dnd-kit/core": "^6.1.0",
11
+ "@dnd-kit/modifiers": "^7.0.0",
12
+ "@dnd-kit/sortable": "^8.0.0",
13
+ "@dnd-kit/utilities": "^3.2.2",
14
+ "@radix-ui/react-accordion": "^1.1.2",
15
+ "@radix-ui/react-alert-dialog": "^1.0.5",
16
+ "@radix-ui/react-avatar": "^1.0.4",
17
+ "@radix-ui/react-checkbox": "^1.0.4",
18
+ "@radix-ui/react-dropdown-menu": "^2.0.6",
19
+ "@radix-ui/react-label": "^2.0.2",
20
+ "@radix-ui/react-popover": "^1.0.7",
21
+ "@radix-ui/react-radio-group": "^1.1.3",
22
+ "@radix-ui/react-select": "^2.0.0",
23
+ "@radix-ui/react-switch": "^1.0.3",
24
+ "@radix-ui/react-tabs": "^1.0.4",
25
+ "@radix-ui/react-toast": "^1.1.5",
26
+ "@radix-ui/react-tooltip": "^1.0.7",
27
+ "@tanstack/react-table": "^8.16.0",
28
+ "downshift": "^9.0.4",
29
+ "moment": "^2.30.1",
30
+ "react": "^18.2.0",
31
+ "react-dom": "^18.2.0",
32
+ "react-quill": "^2.0.0",
33
+ "react-scripts": "5.0.1",
34
+ "styled-components": "^6.1.8",
35
+ "typescript": "^4.9.5"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/freshdesk/freemium-ui.git"
40
+ },
41
+ "publishConfig": {
42
+ "registry": "https://registry.npmjs.org/"
43
+ },
44
+ "keywords": [
45
+ "Freemiui",
46
+ "React",
47
+ "UI",
48
+ "Material"
49
+ ],
50
+ "author": "Freshworks",
51
+ "bugs": {
52
+ "url": "https://github.com/freshdesk/freemium-ui/issues"
53
+ },
54
+ "homepage": "https://github.com/freshdesk/freemium-ui#readme",
55
+ "eslintConfig": {
56
+ "extends": [
57
+ "react-app",
58
+ "plugin:storybook/recommended"
59
+ ]
60
+ },
61
+ "browserslist": {
62
+ "production": [
63
+ ">0.2%",
64
+ "not dead",
65
+ "not op_mini all"
66
+ ],
67
+ "development": [
68
+ "last 1 chrome version",
69
+ "last 1 firefox version",
70
+ "last 1 safari version"
71
+ ]
72
+ },
73
+ "private": false
74
+ }
package/lib/index.cjs.js CHANGED
@@ -16926,7 +16926,7 @@ thumb:24,offTransform:[-2,-2],onTransform:[22,-2]}},zW=yr(gW)`
16926
16926
  transition: transform 100ms;
16927
16927
  transform: translate(
16928
16928
  ${({theme:e,size:t})=>("ltr"===e.direction?CW[t].offTransform:CW[t].onTransform).map((e=>`${e}px`)).join(",")}
16929
- );
16929
+ ) !important;
16930
16930
  will-change: transform;
16931
16931
  overflow: hidden;
16932
16932
  &[data-state='unchecked']:not([data-disabled]) {
@@ -16948,7 +16948,7 @@ thumb:24,offTransform:[-2,-2],onTransform:[22,-2]}},zW=yr(gW)`
16948
16948
  &[data-state='checked'] {
16949
16949
  transform: translate(
16950
16950
  ${({theme:e,size:t})=>("ltr"===e.direction?CW[t].onTransform:CW[t].offTransform).map((e=>`${e}px`)).join(",")}
16951
- );
16951
+ ) !important;
16952
16952
  border: 1px solid ${({theme:e})=>e.colors.common.accent};
16953
16953
  svg.toggle-off {
16954
16954
  display: none;
@@ -17381,34 +17381,34 @@ disabled:t.disabled,htmlFor:t?.[r]
17381
17381
  },exports.RadixMenuItem=jv,exports.RadixSelectItem=Lf,
17382
17382
  exports.Reorder=yj,exports.RequiredIndicator=Ao,
17383
17383
  exports.StyledLabel=Do,exports.Table=t=>{
17384
- const{data:n,columns:o,showFooter:a=!1,infoComponent:i,isLoading:l,isFetching:c,emptyComponent:s,loadingComponent:u,actionComponent:d,headerComponent:h,editColumnComponent:p,filterComponent:f,hideTableOnEmpty:m,hideTopPagination:v,hideFilters:g,sortingHeading:y,showTableOnLoading:b,hideLoaderOnTopPagination:w,hideActions:C,count:z,pageIndex:M=0,pageSize:x=20,enablePreviousPage:E,enableNextPage:S,hideColumnSettings:_=!0,hideBottomPagination:H,rowMenuOptions:D,onPreviousPageClick:k,enableSorting:A,sortingValues:L,sortingOptions:V,onSortingOptionSelect:T,onNextPageClick:R,disableRowSelect:P,hideSelectAllInTable:I,onSelectAllRows:O,onRowSelect:N,onMenuOptionSelect:F,onRowClick:$,columnOrder:B,setColumnOrder:j,setHiddenColumns:U,hiddenColumns:Y,selectedRowIds:W={},isDisableSortDropdown:G,setSelectedRowIds:K,dataKey:q="id",cellPropGetter:Z,setPageIndex:X,rowPropGetter:J}=t,Q=cr(),[ee,te]=e.useState(!g),ne={
17384
+ const{data:n,columns:o,showFooter:a=!1,infoComponent:i,isLoading:l,isFetching:c,emptyComponent:s,loadingComponent:u,actionComponent:d,headerComponent:h,editColumnComponent:p,filterComponent:f,hideTableOnEmpty:m,hideTopPagination:v,hideFilters:g,showFilters:y=!0,sortingHeading:b,showTableOnLoading:w,hideLoaderOnTopPagination:C,hideActions:z,count:M,pageIndex:x=0,pageSize:E=20,enablePreviousPage:S,enableNextPage:_,hideColumnSettings:H=!0,hideBottomPagination:D,rowMenuOptions:k,onPreviousPageClick:A,enableSorting:L,sortingValues:V,sortingOptions:T,onSortingOptionSelect:R,onNextPageClick:P,disableRowSelect:I,hideSelectAllInTable:O,onSelectAllRows:N,onRowSelect:F,onMenuOptionSelect:$,onRowClick:B,columnOrder:j,setColumnOrder:U,setHiddenColumns:Y,hiddenColumns:W,selectedRowIds:G={},isDisableSortDropdown:K,setSelectedRowIds:q,dataKey:Z="id",cellPropGetter:X,setPageIndex:J,rowPropGetter:Q}=t,ee=cr(),[te,ne]=e.useState(!!y),re={
17385
17385
  accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},
17386
- display:e=>e,group:e=>e},re=-1===z||void 0===z,oe=e.useMemo((()=>[...P?[]:[{
17387
- id:"select",header:({table:t})=>I?e.createElement("div",{
17386
+ display:e=>e,group:e=>e},oe=-1===M||void 0===M,ae=e.useMemo((()=>[...I?[]:[{
17387
+ id:"select",header:({table:t})=>O?e.createElement("div",{
17388
17388
  className:"table-checkbox-header"}):e.createElement(Yg,{
17389
17389
  className:"table-checkbox",
17390
17390
  checked:t.getIsSomeRowsSelected()?"indeterminate":t.getIsAllRowsSelected(),
17391
17391
  indeterminate:t.getIsSomeRowsSelected(),onCheckedChange:e=>{
17392
- t.toggleAllPageRowsSelected(!0===e),O?.(!0===e)}}),
17392
+ t.toggleAllPageRowsSelected(!0===e),N?.(!0===e)}}),
17393
17393
  cell:({row:t})=>e.createElement(Yg,{className:"table-checkbox",
17394
17394
  checked:t.getIsSelected(),disabled:!t.getCanSelect(),
17395
17395
  indeterminate:t.getIsSomeSelected(),onCheckedChange:e=>{
17396
- t.toggleSelected(!0===e),N?.(t.original,!0===e)}})
17397
- }],...o.map((e=>ne.accessor(e.id,{header:e.Header,id:e.id??e.Header,
17398
- cell:t=>e.accessorFn(t.row.original)}))),...D?[{id:"rowMenuOptions",
17396
+ t.toggleSelected(!0===e),F?.(t.original,!0===e)}})
17397
+ }],...o.map((e=>re.accessor(e.id,{header:e.Header,id:e.id??e.Header,
17398
+ cell:t=>e.accessorFn(t.row.original)}))),...k?[{id:"rowMenuOptions",
17399
17399
  header:()=>e.createElement("div",{id:"more-actions-header"}),
17400
17400
  cell:({row:t})=>e.createElement(sb,{trigger:e.createElement(co,{
17401
- className:"more-actions",fill:"currentcolor"}),options:D(t.original)||[],
17402
- onSelect:e=>{e.id&&F?.(e.id,t.original)},side:"bottom",align:"end"})
17403
- }]:[]]),[o,P,I,Q.colors.text.primary]),ae=e.useMemo((()=>{const e={}
17404
- ;return o.forEach((t=>{e[t.id]=!(Y??[]).includes(t.id)})),e
17405
- }),[o,Y]),ie=e.useMemo((()=>({pageIndex:M,pageSize:x})),[x,M]),le=function(e){
17401
+ className:"more-actions",fill:"currentcolor"}),options:k(t.original)||[],
17402
+ onSelect:e=>{e.id&&$?.(e.id,t.original)},side:"bottom",align:"end"})
17403
+ }]:[]]),[o,I,O,ee.colors.text.primary]),ie=e.useMemo((()=>{const e={}
17404
+ ;return o.forEach((t=>{e[t.id]=!(W??[]).includes(t.id)})),e
17405
+ }),[o,W]),le=e.useMemo((()=>({pageIndex:x,pageSize:E})),[E,x]),ce=function(e){
17406
17406
  const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e
17407
17407
  },[n]=r.useState((()=>({current:mU(t)
17408
17408
  }))),[o,a]=r.useState((()=>n.current.initialState))
17409
17409
  ;return n.current.setOptions((t=>({...t,...e,state:{...o,...e.state},
17410
17410
  onStateChange:t=>{a(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current
17411
- }({data:n,columns:oe,getRowId:e=>e?.[q]??"id",
17411
+ }({data:n,columns:ae,getRowId:e=>e?.[Z]??"id",
17412
17412
  getCoreRowModel:e=>Mj((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],
17413
17413
  rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[]
17414
17414
  ;for(let c=0;c<t.length;c++){
@@ -17418,69 +17418,69 @@ n.rowsById[s.id]=s,i.push(s),e.options.getSubRows&&(s.originalSubRows=e.options.
17418
17418
  null!=(l=s.originalSubRows)&&l.length&&(s.subRows=r(s.originalSubRows,o+1,s)))}
17419
17419
  return i};return n.rows=r(t),n
17420
17420
  }),xj(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),
17421
- state:{columnOrder:B,columnVisibility:ae,rowSelection:W,pagination:ie},
17421
+ state:{columnOrder:j,columnVisibility:ie,rowSelection:G,pagination:le},
17422
17422
  initialState:{columnPinning:{left:["select"],right:["rowMenuOptions"]}},
17423
- onPaginationChange:e=>{let t=ie;t="function"==typeof e?e(ie):e,X?.(t.pageIndex)
17424
- },onColumnVisibilityChange:e=>{let t=ae
17425
- ;t="function"==typeof e?e(ae):e,U?.(Object.keys(t).filter((e=>!t[e])))},
17426
- onColumnOrderChange:e=>{let t=B??[];t="function"==typeof e?e(B??[]):e,j?.(t)},
17427
- onRowSelectionChange:e=>{let t=W;t="function"==typeof e?e(W):e,K?.(t)},
17428
- enableRowSelection:!0,manualPagination:!0,rowCount:re?-1:z
17429
- }),{getPageCount:ce,getRowModel:se,getState:ue,getCanNextPage:de,getCanPreviousPage:he,getPageOptions:pe,previousPage:fe,setPageIndex:me,nextPage:ve,lastPage:ge,firstPage:ye}=le,{rows:be}=se(),{pagination:{pageIndex:we,pageSize:Ce}}=ue(),ze=we*Ce+(we<ce()-1?Ce:be.length),Me=le.getAllColumns().filter((e=>e.getIsVisible())).length+(P?0:1)+(D?1:0),xe=V?.[0].find((e=>e.id===L?.[0]))?.name
17430
- ;return e.createElement(gU,{className:"TableContainer"},!C&&e.createElement(MU,{
17423
+ onPaginationChange:e=>{let t=le;t="function"==typeof e?e(le):e,J?.(t.pageIndex)
17424
+ },onColumnVisibilityChange:e=>{let t=ie
17425
+ ;t="function"==typeof e?e(ie):e,Y?.(Object.keys(t).filter((e=>!t[e])))},
17426
+ onColumnOrderChange:e=>{let t=j??[];t="function"==typeof e?e(j??[]):e,U?.(t)},
17427
+ onRowSelectionChange:e=>{let t=G;t="function"==typeof e?e(G):e,q?.(t)},
17428
+ enableRowSelection:!0,manualPagination:!0,rowCount:oe?-1:M
17429
+ }),{getPageCount:se,getRowModel:ue,getState:de,getCanNextPage:he,getCanPreviousPage:pe,getPageOptions:fe,previousPage:me,setPageIndex:ve,nextPage:ge,lastPage:ye,firstPage:be}=ce,{rows:we}=ue(),{pagination:{pageIndex:Ce,pageSize:ze}}=de(),Me=Ce*ze+(Ce<se()-1?ze:we.length),xe=ce.getAllColumns().filter((e=>e.getIsVisible())).length+(I?0:1)+(k?1:0),Ee=T?.[0].find((e=>e.id===V?.[0]))?.name
17430
+ ;return e.createElement(gU,{className:"TableContainer"},!z&&e.createElement(MU,{
17431
17431
  className:"table-actions"
17432
17432
  },d&&e.createElement(e.Fragment,null,d),e.createElement(SU,{
17433
17433
  className:"table-header-component"},h??null),e.createElement(HU,{
17434
- className:"table-header-dropdown-pagination"},A&&e.createElement("div",{
17434
+ className:"table-header-dropdown-pagination"},L&&e.createElement("div",{
17435
17435
  className:"table-heading-dropdown"},e.createElement("div",{
17436
- className:"table-sorting-heading"},`${y}:`)," ",e.createElement(QU,{
17436
+ className:"table-sorting-heading"},`${b}:`)," ",e.createElement(QU,{
17437
17437
  trigger:e.createElement("div",{className:"table-sorting-value-continer"
17438
- },e.createElement("div",null,xe),e.createElement(KU,{fill:"currentcolor"})),
17439
- isDisableSortDropdown:!!G,options:V||[],value:L,onSelect:e=>{T?.(e??[])}
17438
+ },e.createElement("div",null,Ee),e.createElement(KU,{fill:"currentcolor"})),
17439
+ isDisableSortDropdown:!!K,options:T||[],value:V,onSelect:e=>{R?.(e??[])}
17440
17440
  })),e.createElement(_U,{className:"table-edit-column-component"
17441
17441
  },p??null),e.createElement(DU,{className:"pagination-actions"
17442
17442
  },!v&&e.createElement(e.Fragment,null,e.createElement(Yo,{variant:"primary",
17443
- className:"pagination-text"},l&&!w?e.createElement(wm,{size:"small"
17444
- }):e.createElement(e.Fragment,null,n.length>0?`${we*Ce+1} - ${ze} of ${re?""+(be.length>0?"Many":"-"):z??be.length??"-"}`:null)),e.createElement(xm,{
17443
+ className:"pagination-text"},l&&!C?e.createElement(wm,{size:"small"
17444
+ }):e.createElement(e.Fragment,null,n.length>0?`${Ce*ze+1} - ${Me} of ${oe?""+(we.length>0?"Many":"-"):M??we.length??"-"}`:null)),e.createElement(xm,{
17445
17445
  variant:"secondary",className:"table-pagination-button",onClick:()=>{
17446
- k?.(),re||fe()},disabled:re?!E:!he()||l||c},e.createElement(bU,{
17447
- fill:Q.colors.text.primary})),e.createElement(xm,{variant:"secondary",
17448
- className:"table-pagination-button",onClick:()=>{R?.(),re||ve()},
17449
- disabled:re?!S:!de()||l||c},e.createElement(wU,{fill:Q.colors.text.primary
17446
+ A?.(),oe||me()},disabled:oe?!S:!pe()||l||c},e.createElement(bU,{
17447
+ fill:ee.colors.text.primary})),e.createElement(xm,{variant:"secondary",
17448
+ className:"table-pagination-button",onClick:()=>{P?.(),oe||ge()},
17449
+ disabled:oe?!_:!he()||l||c},e.createElement(wU,{fill:ee.colors.text.primary
17450
17450
  }))),!g&&e.createElement(xm,{variant:"secondary",
17451
- className:"table-pagination-button filter-toggle",onClick:()=>te(!ee)
17452
- },e.createElement(yU,{style:{transform:ee?"rotateY(180deg)":"rotateY(0deg)"},
17451
+ className:"table-pagination-button filter-toggle",onClick:()=>ne(!te)
17452
+ },e.createElement(yU,{style:{transform:te?"rotateY(180deg)":"rotateY(0deg)"},
17453
17453
  fill:"currentcolor"}))))),e.createElement(CU,null,e.createElement(zU,{
17454
17454
  className:"table-wrapper"
17455
- },i&&e.createElement(EU,null,i),l&&!b?e.createElement(e.Fragment,null,u):e.createElement(e.Fragment,null,0===be.length&&m?e.createElement(e.Fragment,null,s):e.createElement(kU,null,e.createElement(AU,null,!_&&e.createElement(xF,{
17455
+ },i&&e.createElement(EU,null,i),l&&!w?e.createElement(e.Fragment,null,u):e.createElement(e.Fragment,null,0===we.length&&m?e.createElement(e.Fragment,null,s):e.createElement(kU,null,e.createElement(AU,null,!H&&e.createElement(xF,{
17456
17456
  align:"end",avoidCollisions:!0,side:"top",trigger:e.createElement(qU,{
17457
- fill:"currentcolor"})},e.createElement(JU,{table:le
17458
- })),e.createElement(LU,null,le.getHeaderGroups().map((t=>e.createElement(RU,{
17457
+ fill:"currentcolor"})},e.createElement(JU,{table:ce
17458
+ })),e.createElement(LU,null,ce.getHeaderGroups().map((t=>e.createElement(RU,{
17459
17459
  key:t.id},t.headers.map((t=>e.createElement(IU,{key:t.id
17460
- },t.isPlaceholder?null:vU(t.column.columnDef.header,t.getContext())))))))),e.createElement(VU,null,c&&!l&&e.createElement(PU,null,e.createElement(wm,null)),be.map((t=>e.createElement(RU,{
17461
- key:t.id,$isSelected:t.getIsSelected(),...J?.(t.original)
17460
+ },t.isPlaceholder?null:vU(t.column.columnDef.header,t.getContext())))))))),e.createElement(VU,null,c&&!l&&e.createElement(PU,null,e.createElement(wm,null)),we.map((t=>e.createElement(RU,{
17461
+ key:t.id,$isSelected:t.getIsSelected(),...Q?.(t.original)
17462
17462
  },t.getVisibleCells().map((n=>e.createElement(OU,{key:n.id,onClick:()=>{
17463
- $?.(t.original,n.column.columnDef)},...Z?.(n)
17464
- },vU(n.column.columnDef.cell,n.getContext())))))))),a&&e.createElement(TU,null,le.getFooterGroups().map((t=>e.createElement(RU,{
17463
+ B?.(t.original,n.column.columnDef)},...X?.(n)
17464
+ },vU(n.column.columnDef.cell,n.getContext())))))))),a&&e.createElement(TU,null,ce.getFooterGroups().map((t=>e.createElement(RU,{
17465
17465
  key:t.id},t.headers.map((t=>e.createElement(IU,{key:t.id
17466
- },t.isPlaceholder?null:vU(t.column.columnDef.footer,t.getContext())))))))),!H&&e.createElement(TU,null,e.createElement(RU,null,e.createElement(IU,{
17467
- colSpan:Me},e.createElement(GU,{className:"table-pagination"
17468
- },e.createElement(xm,{variant:"secondary",onClick:()=>{ye()},
17469
- disabled:!he()||l||c},"<<"),e.createElement(xm,{variant:"secondary",
17470
- onClick:()=>{fe()},disabled:!he()||l||c
17471
- },"<"),we+1>2&&e.createElement(e.Fragment,null,e.createElement(xm,{
17472
- variant:"secondary",onClick:()=>{ye()},disabled:l||c
17473
- },"1"),we+1-3!=0&&e.createElement(xm,{variant:"secondary",disabled:!0
17474
- },"...")),pe().map((t=>[t-2,t-1,t,t+1,t+2].includes(we+1)&&e.createElement(xm,{
17475
- key:t,variant:"secondary",className:we+1===t+1?"active":"",onClick:()=>{me?.(t)
17466
+ },t.isPlaceholder?null:vU(t.column.columnDef.footer,t.getContext())))))))),!D&&e.createElement(TU,null,e.createElement(RU,null,e.createElement(IU,{
17467
+ colSpan:xe},e.createElement(GU,{className:"table-pagination"
17468
+ },e.createElement(xm,{variant:"secondary",onClick:()=>{be()},
17469
+ disabled:!pe()||l||c},"<<"),e.createElement(xm,{variant:"secondary",
17470
+ onClick:()=>{me()},disabled:!pe()||l||c
17471
+ },"<"),Ce+1>2&&e.createElement(e.Fragment,null,e.createElement(xm,{
17472
+ variant:"secondary",onClick:()=>{be()},disabled:l||c
17473
+ },"1"),Ce+1-3!=0&&e.createElement(xm,{variant:"secondary",disabled:!0
17474
+ },"...")),fe().map((t=>[t-2,t-1,t,t+1,t+2].includes(Ce+1)&&e.createElement(xm,{
17475
+ key:t,variant:"secondary",className:Ce+1===t+1?"active":"",onClick:()=>{ve?.(t)
17476
17476
  },disabled:l||c
17477
- },t+1))),we+2<Math.ceil(n.length/Ce)-2&&e.createElement(e.Fragment,null,we+2+3!==Math.ceil(n.length/Ce)&&e.createElement(xm,{
17477
+ },t+1))),Ce+2<Math.ceil(n.length/ze)-2&&e.createElement(e.Fragment,null,Ce+2+3!==Math.ceil(n.length/ze)&&e.createElement(xm,{
17478
17478
  variant:"secondary",disabled:!0},"..."),e.createElement(xm,{variant:"secondary",
17479
- onClick:()=>{me?.(Math.ceil(n.length/Ce)-1)},disabled:l||c
17480
- },Math.ceil(n.length/Ce))),e.createElement(xm,{variant:"secondary",onClick:()=>{
17481
- ve()},disabled:!de()||l||c},">"),e.createElement(xm,{variant:"secondary",
17482
- onClick:()=>{ge()},disabled:!de()||l||c
17483
- },">>"))))))))),!g&&ee&&f&&e.createElement(xU,null,f)))
17479
+ onClick:()=>{ve?.(Math.ceil(n.length/ze)-1)},disabled:l||c
17480
+ },Math.ceil(n.length/ze))),e.createElement(xm,{variant:"secondary",onClick:()=>{
17481
+ ge()},disabled:!he()||l||c},">"),e.createElement(xm,{variant:"secondary",
17482
+ onClick:()=>{ye()},disabled:!he()||l||c
17483
+ },">>"))))))))),!g&&te&&f&&e.createElement(xU,null,f)))
17484
17484
  },exports.Tabs=({options:t=[],idAccessor:n="id",nameAccessor:r="name",disabledAccessor:o="disabled",onChange:a,defaultValue:i,label:l,renderTabsContent:c,value:s})=>{
17485
17485
  const u=cr();return e.createElement(hY,{className:"TabsRoot",value:s,
17486
17486
  defaultValue:i,onValueChange:a,dir:u.direction},e.createElement(fY,{
package/lib/index.d.ts CHANGED
@@ -1280,6 +1280,7 @@ interface TableProps<T extends RowDataType> {
1280
1280
  infoComponent?: React.ReactElement;
1281
1281
  filterComponent?: React.ReactElement;
1282
1282
  isDisableSortDropdown?: boolean | null;
1283
+ showFilters?: boolean | null;
1283
1284
  emptyComponent?: React.ReactElement;
1284
1285
  actionComponent?: React.ReactElement;
1285
1286
  loadingComponent?: React.ReactElement;
package/lib/index.js CHANGED
@@ -16630,34 +16630,34 @@ side:"bottom",sideOffset:4,align:"center",className:"DropdownMenuContent"
16630
16630
  className:"DropdownMenuItem",key:e?.[r],onSelect:()=>{const t=c??[];t[n]=e?.[r],
16631
16631
  a?.(t)}},e?.[o],c?.[n]===e?.[r]&&t.createElement(Ao,{fill:s.colors.common.accent
16632
16632
  })))),t.createElement(yg,{className:"DropdownMenuSeparator"})))))))},PY=n=>{
16633
- const{data:r,columns:o,showFooter:a=!1,infoComponent:i,isLoading:l,isFetching:c,emptyComponent:s,loadingComponent:u,actionComponent:d,headerComponent:h,editColumnComponent:p,filterComponent:f,hideTableOnEmpty:m,hideTopPagination:v,hideFilters:g,sortingHeading:y,showTableOnLoading:b,hideLoaderOnTopPagination:w,hideActions:C,count:z,pageIndex:M=0,pageSize:x=20,enablePreviousPage:E,enableNextPage:S,hideColumnSettings:_=!0,hideBottomPagination:H,rowMenuOptions:D,onPreviousPageClick:A,enableSorting:L,sortingValues:V,sortingOptions:k,onSortingOptionSelect:T,onNextPageClick:P,disableRowSelect:R,hideSelectAllInTable:I,onSelectAllRows:O,onRowSelect:N,onMenuOptionSelect:F,onRowClick:$,columnOrder:B,setColumnOrder:j,setHiddenColumns:U,hiddenColumns:Y,selectedRowIds:W={},isDisableSortDropdown:G,setSelectedRowIds:K,dataKey:q="id",cellPropGetter:Z,setPageIndex:X,rowPropGetter:J}=n,Q=Hr(),[ee,te]=t.useState(!g),ne={
16633
+ const{data:r,columns:o,showFooter:a=!1,infoComponent:i,isLoading:l,isFetching:c,emptyComponent:s,loadingComponent:u,actionComponent:d,headerComponent:h,editColumnComponent:p,filterComponent:f,hideTableOnEmpty:m,hideTopPagination:v,hideFilters:g,showFilters:y=!0,sortingHeading:b,showTableOnLoading:w,hideLoaderOnTopPagination:C,hideActions:z,count:M,pageIndex:x=0,pageSize:E=20,enablePreviousPage:S,enableNextPage:_,hideColumnSettings:H=!0,hideBottomPagination:D,rowMenuOptions:A,onPreviousPageClick:L,enableSorting:V,sortingValues:k,sortingOptions:T,onSortingOptionSelect:P,onNextPageClick:R,disableRowSelect:I,hideSelectAllInTable:O,onSelectAllRows:N,onRowSelect:F,onMenuOptionSelect:$,onRowClick:B,columnOrder:j,setColumnOrder:U,setHiddenColumns:Y,hiddenColumns:W,selectedRowIds:G={},isDisableSortDropdown:K,setSelectedRowIds:q,dataKey:Z="id",cellPropGetter:X,setPageIndex:J,rowPropGetter:Q}=n,ee=Hr(),[te,ne]=t.useState(!!y),re={
16634
16634
  accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},
16635
- display:e=>e,group:e=>e},re=-1===z||void 0===z,oe=t.useMemo((()=>[...R?[]:[{
16636
- id:"select",header:({table:e})=>I?t.createElement("div",{
16635
+ display:e=>e,group:e=>e},oe=-1===M||void 0===M,ae=t.useMemo((()=>[...I?[]:[{
16636
+ id:"select",header:({table:e})=>O?t.createElement("div",{
16637
16637
  className:"table-checkbox-header"}):t.createElement(vy,{
16638
16638
  className:"table-checkbox",
16639
16639
  checked:e.getIsSomeRowsSelected()?"indeterminate":e.getIsAllRowsSelected(),
16640
16640
  indeterminate:e.getIsSomeRowsSelected(),onCheckedChange:t=>{
16641
- e.toggleAllPageRowsSelected(!0===t),O?.(!0===t)}}),
16641
+ e.toggleAllPageRowsSelected(!0===t),N?.(!0===t)}}),
16642
16642
  cell:({row:e})=>t.createElement(vy,{className:"table-checkbox",
16643
16643
  checked:e.getIsSelected(),disabled:!e.getCanSelect(),
16644
16644
  indeterminate:e.getIsSomeSelected(),onCheckedChange:t=>{
16645
- e.toggleSelected(!0===t),N?.(e.original,!0===t)}})
16646
- }],...o.map((e=>ne.accessor(e.id,{header:e.Header,id:e.id??e.Header,
16647
- cell:t=>e.accessorFn(t.row.original)}))),...D?[{id:"rowMenuOptions",
16645
+ e.toggleSelected(!0===t),F?.(e.original,!0===t)}})
16646
+ }],...o.map((e=>re.accessor(e.id,{header:e.Header,id:e.id??e.Header,
16647
+ cell:t=>e.accessorFn(t.row.original)}))),...A?[{id:"rowMenuOptions",
16648
16648
  header:()=>t.createElement("div",{id:"more-actions-header"}),
16649
16649
  cell:({row:e})=>t.createElement(Rb,{trigger:t.createElement(Do,{
16650
- className:"more-actions",fill:"currentcolor"}),options:D(e.original)||[],
16651
- onSelect:t=>{t.id&&F?.(t.id,e.original)},side:"bottom",align:"end"})
16652
- }]:[]]),[o,R,I,Q.colors.text.primary]),ae=t.useMemo((()=>{const e={}
16653
- ;return o.forEach((t=>{e[t.id]=!(Y??[]).includes(t.id)})),e
16654
- }),[o,Y]),ie=t.useMemo((()=>({pageIndex:M,pageSize:x})),[x,M]),le=function(t){
16650
+ className:"more-actions",fill:"currentcolor"}),options:A(e.original)||[],
16651
+ onSelect:t=>{t.id&&$?.(t.id,e.original)},side:"bottom",align:"end"})
16652
+ }]:[]]),[o,I,O,ee.colors.text.primary]),ie=t.useMemo((()=>{const e={}
16653
+ ;return o.forEach((t=>{e[t.id]=!(W??[]).includes(t.id)})),e
16654
+ }),[o,W]),le=t.useMemo((()=>({pageIndex:x,pageSize:E})),[E,x]),ce=function(t){
16655
16655
  const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t
16656
16656
  },[r]=e.useState((()=>({current:ZU(n)
16657
16657
  }))),[o,a]=e.useState((()=>r.current.initialState))
16658
16658
  ;return r.current.setOptions((e=>({...e,...t,state:{...o,...t.state},
16659
16659
  onStateChange:e=>{a(e),null==t.onStateChange||t.onStateChange(e)}}))),r.current
16660
- }({data:r,columns:oe,getRowId:e=>e?.[q]??"id",
16660
+ }({data:r,columns:ae,getRowId:e=>e?.[Z]??"id",
16661
16661
  getCoreRowModel:e=>oU((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],
16662
16662
  rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[]
16663
16663
  ;for(let c=0;c<t.length;c++){
@@ -16667,69 +16667,69 @@ n.rowsById[s.id]=s,i.push(s),e.options.getSubRows&&(s.originalSubRows=e.options.
16667
16667
  null!=(l=s.originalSubRows)&&l.length&&(s.subRows=r(s.originalSubRows,o+1,s)))}
16668
16668
  return i};return n.rows=r(t),n
16669
16669
  }),aU(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),
16670
- state:{columnOrder:B,columnVisibility:ae,rowSelection:W,pagination:ie},
16670
+ state:{columnOrder:j,columnVisibility:ie,rowSelection:G,pagination:le},
16671
16671
  initialState:{columnPinning:{left:["select"],right:["rowMenuOptions"]}},
16672
- onPaginationChange:e=>{let t=ie;t="function"==typeof e?e(ie):e,X?.(t.pageIndex)
16673
- },onColumnVisibilityChange:e=>{let t=ae
16674
- ;t="function"==typeof e?e(ae):e,U?.(Object.keys(t).filter((e=>!t[e])))},
16675
- onColumnOrderChange:e=>{let t=B??[];t="function"==typeof e?e(B??[]):e,j?.(t)},
16676
- onRowSelectionChange:e=>{let t=W;t="function"==typeof e?e(W):e,K?.(t)},
16677
- enableRowSelection:!0,manualPagination:!0,rowCount:re?-1:z
16678
- }),{getPageCount:ce,getRowModel:se,getState:ue,getCanNextPage:de,getCanPreviousPage:he,getPageOptions:pe,previousPage:fe,setPageIndex:me,nextPage:ve,lastPage:ge,firstPage:ye}=le,{rows:be}=se(),{pagination:{pageIndex:we,pageSize:Ce}}=ue(),ze=we*Ce+(we<ce()-1?Ce:be.length),Me=le.getAllColumns().filter((e=>e.getIsVisible())).length+(R?0:1)+(D?1:0),xe=k?.[0].find((e=>e.id===V?.[0]))?.name
16679
- ;return t.createElement(JU,{className:"TableContainer"},!C&&t.createElement(oY,{
16672
+ onPaginationChange:e=>{let t=le;t="function"==typeof e?e(le):e,J?.(t.pageIndex)
16673
+ },onColumnVisibilityChange:e=>{let t=ie
16674
+ ;t="function"==typeof e?e(ie):e,Y?.(Object.keys(t).filter((e=>!t[e])))},
16675
+ onColumnOrderChange:e=>{let t=j??[];t="function"==typeof e?e(j??[]):e,U?.(t)},
16676
+ onRowSelectionChange:e=>{let t=G;t="function"==typeof e?e(G):e,q?.(t)},
16677
+ enableRowSelection:!0,manualPagination:!0,rowCount:oe?-1:M
16678
+ }),{getPageCount:se,getRowModel:ue,getState:de,getCanNextPage:he,getCanPreviousPage:pe,getPageOptions:fe,previousPage:me,setPageIndex:ve,nextPage:ge,lastPage:ye,firstPage:be}=ce,{rows:we}=ue(),{pagination:{pageIndex:Ce,pageSize:ze}}=de(),Me=Ce*ze+(Ce<se()-1?ze:we.length),xe=ce.getAllColumns().filter((e=>e.getIsVisible())).length+(I?0:1)+(A?1:0),Ee=T?.[0].find((e=>e.id===k?.[0]))?.name
16679
+ ;return t.createElement(JU,{className:"TableContainer"},!z&&t.createElement(oY,{
16680
16680
  className:"table-actions"
16681
16681
  },d&&t.createElement(t.Fragment,null,d),t.createElement(lY,{
16682
16682
  className:"table-header-component"},h??null),t.createElement(sY,{
16683
- className:"table-header-dropdown-pagination"},L&&t.createElement("div",{
16683
+ className:"table-header-dropdown-pagination"},V&&t.createElement("div",{
16684
16684
  className:"table-heading-dropdown"},t.createElement("div",{
16685
- className:"table-sorting-heading"},`${y}:`)," ",t.createElement(TY,{
16685
+ className:"table-sorting-heading"},`${b}:`)," ",t.createElement(TY,{
16686
16686
  trigger:t.createElement("div",{className:"table-sorting-value-continer"
16687
- },t.createElement("div",null,xe),t.createElement(DY,{fill:"currentcolor"})),
16688
- isDisableSortDropdown:!!G,options:k||[],value:V,onSelect:e=>{T?.(e??[])}
16687
+ },t.createElement("div",null,Ee),t.createElement(DY,{fill:"currentcolor"})),
16688
+ isDisableSortDropdown:!!K,options:T||[],value:k,onSelect:e=>{P?.(e??[])}
16689
16689
  })),t.createElement(cY,{className:"table-edit-column-component"
16690
16690
  },p??null),t.createElement(uY,{className:"pagination-actions"
16691
16691
  },!v&&t.createElement(t.Fragment,null,t.createElement(ha,{variant:"primary",
16692
- className:"pagination-text"},l&&!w?t.createElement(Bm,{size:"small"
16693
- }):t.createElement(t.Fragment,null,r.length>0?`${we*Ce+1} - ${ze} of ${re?""+(be.length>0?"Many":"-"):z??be.length??"-"}`:null)),t.createElement(Gm,{
16692
+ className:"pagination-text"},l&&!C?t.createElement(Bm,{size:"small"
16693
+ }):t.createElement(t.Fragment,null,r.length>0?`${Ce*ze+1} - ${Me} of ${oe?""+(we.length>0?"Many":"-"):M??we.length??"-"}`:null)),t.createElement(Gm,{
16694
16694
  variant:"secondary",className:"table-pagination-button",onClick:()=>{
16695
- A?.(),re||fe()},disabled:re?!E:!he()||l||c},t.createElement(eY,{
16696
- fill:Q.colors.text.primary})),t.createElement(Gm,{variant:"secondary",
16697
- className:"table-pagination-button",onClick:()=>{P?.(),re||ve()},
16698
- disabled:re?!S:!de()||l||c},t.createElement(tY,{fill:Q.colors.text.primary
16695
+ L?.(),oe||me()},disabled:oe?!S:!pe()||l||c},t.createElement(eY,{
16696
+ fill:ee.colors.text.primary})),t.createElement(Gm,{variant:"secondary",
16697
+ className:"table-pagination-button",onClick:()=>{R?.(),oe||ge()},
16698
+ disabled:oe?!_:!he()||l||c},t.createElement(tY,{fill:ee.colors.text.primary
16699
16699
  }))),!g&&t.createElement(Gm,{variant:"secondary",
16700
- className:"table-pagination-button filter-toggle",onClick:()=>te(!ee)
16701
- },t.createElement(QU,{style:{transform:ee?"rotateY(180deg)":"rotateY(0deg)"},
16700
+ className:"table-pagination-button filter-toggle",onClick:()=>ne(!te)
16701
+ },t.createElement(QU,{style:{transform:te?"rotateY(180deg)":"rotateY(0deg)"},
16702
16702
  fill:"currentcolor"}))))),t.createElement(nY,null,t.createElement(rY,{
16703
16703
  className:"table-wrapper"
16704
- },i&&t.createElement(iY,null,i),l&&!b?t.createElement(t.Fragment,null,u):t.createElement(t.Fragment,null,0===be.length&&m?t.createElement(t.Fragment,null,s):t.createElement(dY,null,t.createElement(hY,null,!_&&t.createElement(o$,{
16704
+ },i&&t.createElement(iY,null,i),l&&!w?t.createElement(t.Fragment,null,u):t.createElement(t.Fragment,null,0===we.length&&m?t.createElement(t.Fragment,null,s):t.createElement(dY,null,t.createElement(hY,null,!H&&t.createElement(o$,{
16705
16705
  align:"end",avoidCollisions:!0,side:"top",trigger:t.createElement(AY,{
16706
- fill:"currentcolor"})},t.createElement(kY,{table:le
16707
- })),t.createElement(pY,null,le.getHeaderGroups().map((e=>t.createElement(vY,{
16706
+ fill:"currentcolor"})},t.createElement(kY,{table:ce
16707
+ })),t.createElement(pY,null,ce.getHeaderGroups().map((e=>t.createElement(vY,{
16708
16708
  key:e.id},e.headers.map((e=>t.createElement(yY,{key:e.id
16709
- },e.isPlaceholder?null:XU(e.column.columnDef.header,e.getContext())))))))),t.createElement(fY,null,c&&!l&&t.createElement(gY,null,t.createElement(Bm,null)),be.map((e=>t.createElement(vY,{
16710
- key:e.id,$isSelected:e.getIsSelected(),...J?.(e.original)
16709
+ },e.isPlaceholder?null:XU(e.column.columnDef.header,e.getContext())))))))),t.createElement(fY,null,c&&!l&&t.createElement(gY,null,t.createElement(Bm,null)),we.map((e=>t.createElement(vY,{
16710
+ key:e.id,$isSelected:e.getIsSelected(),...Q?.(e.original)
16711
16711
  },e.getVisibleCells().map((n=>t.createElement(bY,{key:n.id,onClick:()=>{
16712
- $?.(e.original,n.column.columnDef)},...Z?.(n)
16713
- },XU(n.column.columnDef.cell,n.getContext())))))))),a&&t.createElement(mY,null,le.getFooterGroups().map((e=>t.createElement(vY,{
16712
+ B?.(e.original,n.column.columnDef)},...X?.(n)
16713
+ },XU(n.column.columnDef.cell,n.getContext())))))))),a&&t.createElement(mY,null,ce.getFooterGroups().map((e=>t.createElement(vY,{
16714
16714
  key:e.id},e.headers.map((e=>t.createElement(yY,{key:e.id
16715
- },e.isPlaceholder?null:XU(e.column.columnDef.footer,e.getContext())))))))),!H&&t.createElement(mY,null,t.createElement(vY,null,t.createElement(yY,{
16716
- colSpan:Me},t.createElement(HY,{className:"table-pagination"
16717
- },t.createElement(Gm,{variant:"secondary",onClick:()=>{ye()},
16718
- disabled:!he()||l||c},"<<"),t.createElement(Gm,{variant:"secondary",
16719
- onClick:()=>{fe()},disabled:!he()||l||c
16720
- },"<"),we+1>2&&t.createElement(t.Fragment,null,t.createElement(Gm,{
16721
- variant:"secondary",onClick:()=>{ye()},disabled:l||c
16722
- },"1"),we+1-3!=0&&t.createElement(Gm,{variant:"secondary",disabled:!0
16723
- },"...")),pe().map((e=>[e-2,e-1,e,e+1,e+2].includes(we+1)&&t.createElement(Gm,{
16724
- key:e,variant:"secondary",className:we+1===e+1?"active":"",onClick:()=>{me?.(e)
16715
+ },e.isPlaceholder?null:XU(e.column.columnDef.footer,e.getContext())))))))),!D&&t.createElement(mY,null,t.createElement(vY,null,t.createElement(yY,{
16716
+ colSpan:xe},t.createElement(HY,{className:"table-pagination"
16717
+ },t.createElement(Gm,{variant:"secondary",onClick:()=>{be()},
16718
+ disabled:!pe()||l||c},"<<"),t.createElement(Gm,{variant:"secondary",
16719
+ onClick:()=>{me()},disabled:!pe()||l||c
16720
+ },"<"),Ce+1>2&&t.createElement(t.Fragment,null,t.createElement(Gm,{
16721
+ variant:"secondary",onClick:()=>{be()},disabled:l||c
16722
+ },"1"),Ce+1-3!=0&&t.createElement(Gm,{variant:"secondary",disabled:!0
16723
+ },"...")),fe().map((e=>[e-2,e-1,e,e+1,e+2].includes(Ce+1)&&t.createElement(Gm,{
16724
+ key:e,variant:"secondary",className:Ce+1===e+1?"active":"",onClick:()=>{ve?.(e)
16725
16725
  },disabled:l||c
16726
- },e+1))),we+2<Math.ceil(r.length/Ce)-2&&t.createElement(t.Fragment,null,we+2+3!==Math.ceil(r.length/Ce)&&t.createElement(Gm,{
16726
+ },e+1))),Ce+2<Math.ceil(r.length/ze)-2&&t.createElement(t.Fragment,null,Ce+2+3!==Math.ceil(r.length/ze)&&t.createElement(Gm,{
16727
16727
  variant:"secondary",disabled:!0},"..."),t.createElement(Gm,{variant:"secondary",
16728
- onClick:()=>{me?.(Math.ceil(r.length/Ce)-1)},disabled:l||c
16729
- },Math.ceil(r.length/Ce))),t.createElement(Gm,{variant:"secondary",onClick:()=>{
16730
- ve()},disabled:!de()||l||c},">"),t.createElement(Gm,{variant:"secondary",
16731
- onClick:()=>{ge()},disabled:!de()||l||c
16732
- },">>"))))))))),!g&&ee&&f&&t.createElement(aY,null,f)))
16728
+ onClick:()=>{ve?.(Math.ceil(r.length/ze)-1)},disabled:l||c
16729
+ },Math.ceil(r.length/ze))),t.createElement(Gm,{variant:"secondary",onClick:()=>{
16730
+ ge()},disabled:!he()||l||c},">"),t.createElement(Gm,{variant:"secondary",
16731
+ onClick:()=>{ye()},disabled:!he()||l||c
16732
+ },">>"))))))))),!g&&te&&f&&t.createElement(aY,null,f)))
16733
16733
  },RY="Tabs",[IY,OY]=S(RY,[nv]),NY=nv(),[FY,$Y]=IY(RY),BY=l(((e,t)=>{
16734
16734
  const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:c,activationMode:s="automatic",...u}=e,d=ce(c),[h,p]=O({
16735
16735
  prop:r,onChange:a,defaultProp:i});return o(FY,{scope:n,baseId:W(),value:h,
@@ -17178,7 +17178,7 @@ width:44,height:20,thumb:24,offTransform:[-2,-2],onTransform:[22,-2]}
17178
17178
  transition: transform 100ms;
17179
17179
  transform: translate(
17180
17180
  ${({theme:e,size:t})=>("ltr"===e.direction?iG[t].offTransform:iG[t].onTransform).map((e=>`${e}px`)).join(",")}
17181
- );
17181
+ ) !important;
17182
17182
  will-change: transform;
17183
17183
  overflow: hidden;
17184
17184
  &[data-state='unchecked']:not([data-disabled]) {
@@ -17200,7 +17200,7 @@ width:44,height:20,thumb:24,offTransform:[-2,-2],onTransform:[22,-2]}
17200
17200
  &[data-state='checked'] {
17201
17201
  transform: translate(
17202
17202
  ${({theme:e,size:t})=>("ltr"===e.direction?iG[t].onTransform:iG[t].offTransform).map((e=>`${e}px`)).join(",")}
17203
- );
17203
+ ) !important;
17204
17204
  border: 1px solid ${({theme:e})=>e.colors.common.accent};
17205
17205
  svg.toggle-off {
17206
17206
  display: none;
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.45",
3
+ "version": "2.0.47",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.45",
3
+ "version": "2.0.47",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.js",