freemium-ui 2.0.91 → 2.1.0-alpha.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.
Files changed (137) hide show
  1. package/lib/Accordion-Ccv-p2G6.js +134 -0
  2. package/lib/Accordion.d.ts +56 -0
  3. package/lib/Accordion.js +7 -0
  4. package/lib/Alert-BtEbkVK1.js +52 -0
  5. package/lib/Alert.d.ts +66 -0
  6. package/lib/Alert.js +6 -0
  7. package/lib/AutoComplete-DF33_uur.js +608 -0
  8. package/lib/AutoComplete.d.ts +105 -0
  9. package/lib/AutoComplete.js +14 -0
  10. package/lib/BoxedRadio-D5Kiintm.js +75 -0
  11. package/lib/BoxedRadio.d.ts +61 -0
  12. package/lib/BoxedRadio.js +10 -0
  13. package/lib/Button-Bd1O8_k7.js +34 -0
  14. package/lib/Button.d.ts +34 -0
  15. package/lib/Button.js +2 -0
  16. package/lib/ButtonDropdown-BZvCwUDe.js +37 -0
  17. package/lib/ButtonDropdown.d.ts +82 -0
  18. package/lib/ButtonDropdown.js +11 -0
  19. package/lib/Calendar-C0xW_pPO.js +32 -0
  20. package/lib/Calendar.d.ts +25 -0
  21. package/lib/Calendar.js +2 -0
  22. package/lib/Checkbox-By1CgFUJ.js +66 -0
  23. package/lib/Checkbox.d.ts +28 -0
  24. package/lib/Checkbox.js +7 -0
  25. package/lib/ChevronUp-BWiG3XYd.js +7 -0
  26. package/lib/Combination-AmN1Cqrf.js +210 -0
  27. package/lib/Confirmation-49GhlyzQ.js +66 -0
  28. package/lib/Confirmation.d.ts +72 -0
  29. package/lib/Confirmation.js +8 -0
  30. package/lib/Cross-CIeKwtq6.js +7 -0
  31. package/lib/CustomizeColumns-BSF8e_we.js +865 -0
  32. package/lib/Drawer-CnmXL5_B.js +33 -0
  33. package/lib/Drawer.d.ts +50 -0
  34. package/lib/Drawer.js +8 -0
  35. package/lib/Dropdown-D59u6zOt.js +89 -0
  36. package/lib/Dropdown.d.ts +162 -0
  37. package/lib/Dropdown.js +15 -0
  38. package/lib/ErrorText-Uvye7uop.js +8 -0
  39. package/lib/Info-BsILbpCG.js +9 -0
  40. package/lib/Input.d.ts +66 -0
  41. package/lib/Input.js +5 -0
  42. package/lib/Loader-b8lHCp4N.js +13 -0
  43. package/lib/Loader.d.ts +21 -0
  44. package/lib/Loader.js +3 -0
  45. package/lib/Menu-DoE00Mg-.js +19 -0
  46. package/lib/Menu.d.ts +80 -0
  47. package/lib/Menu.js +11 -0
  48. package/lib/Modal-D5RJHnbn.js +51 -0
  49. package/lib/Modal.d.ts +51 -0
  50. package/lib/Modal.js +7 -0
  51. package/lib/MultiSelectDropdown-DblSkVpv.js +84 -0
  52. package/lib/MultiSelectDropdown.d.ts +116 -0
  53. package/lib/MultiSelectDropdown.js +14 -0
  54. package/lib/Pickers.d.ts +94 -0
  55. package/lib/Pickers.js +16 -0
  56. package/lib/Popover-BU73-g73.js +90 -0
  57. package/lib/Popover.d.ts +94 -0
  58. package/lib/Popover.js +8 -0
  59. package/lib/QuillEditor.d.ts +29 -0
  60. package/lib/QuillEditor.js +3369 -0
  61. package/lib/Radio.d.ts +69 -0
  62. package/lib/Radio.js +10 -0
  63. package/lib/RadioGroup-DM_Y48_b.js +42 -0
  64. package/lib/Reorder-DUSHsq7i.js +697 -0
  65. package/lib/Reorder.d.ts +36 -0
  66. package/lib/Reorder.js +5 -0
  67. package/lib/SortDropdown-B0SSCJX6.js +17 -0
  68. package/lib/SortDropdown.d.ts +47 -0
  69. package/lib/SortDropdown.js +10 -0
  70. package/lib/Table-cidceyn5.js +117 -0
  71. package/lib/Table.d.ts +95 -0
  72. package/lib/Table.js +18 -0
  73. package/lib/Tabs-j1c7ybY-.js +50 -0
  74. package/lib/Tabs.d.ts +68 -0
  75. package/lib/Tabs.js +6 -0
  76. package/lib/Tag-Cu75ReQP.js +49 -0
  77. package/lib/Tag.d.ts +50 -0
  78. package/lib/Tag.js +4 -0
  79. package/lib/TextArea--fiwZ_QM.js +98 -0
  80. package/lib/ThemeProvider-bWL8hyYA.js +7 -0
  81. package/lib/ThemeProvider.d.ts +158 -0
  82. package/lib/ThemeProvider.js +9 -0
  83. package/lib/TickIcon-BJqSAG4_.js +7 -0
  84. package/lib/TimePicker-7Uqb3xJn.js +6598 -0
  85. package/lib/Toast.d.ts +61 -0
  86. package/lib/Toast.js +10 -0
  87. package/lib/ToastProvider-CMk1PSzB.js +264 -0
  88. package/lib/Toggle-BGV7Nc6t.js +59 -0
  89. package/lib/Toggle.d.ts +35 -0
  90. package/lib/Toggle.js +6 -0
  91. package/lib/Tooltip-DU_ATFRB.js +127 -0
  92. package/lib/Tooltip.d.ts +53 -0
  93. package/lib/Tooltip.js +8 -0
  94. package/lib/Typography-BcAppjDF.js +11 -0
  95. package/lib/Typography.d.ts +20 -0
  96. package/lib/Typography.js +2 -0
  97. package/lib/WorkspaceTable-BV5zccyt.js +100 -0
  98. package/lib/WorkspaceTable.d.ts +85 -0
  99. package/lib/WorkspaceTable.js +18 -0
  100. package/lib/_commonjsHelpers-fGXyuM93.js +4 -0
  101. package/lib/allPaths-DKtiSqHL.js +19 -0
  102. package/lib/allPathsLoader-Drb6xO2O.js +5 -0
  103. package/lib/index-B9EcTy5B.js +46 -0
  104. package/lib/index-BPxkexqj.js +60 -0
  105. package/lib/index-BROhcSiX.js +8 -0
  106. package/lib/index-BT1o947S.js +8 -0
  107. package/lib/index-BY9lf-do.js +2 -0
  108. package/lib/index-BdTXfGkV.js +24 -0
  109. package/lib/index-BnDw8kbT.js +135 -0
  110. package/lib/index-BrF1HKA1.js +338 -0
  111. package/lib/index-BxNZ3C71.js +4 -0
  112. package/lib/index-ByHJlnsx.js +26 -0
  113. package/lib/index-COoRg_pp.js +55 -0
  114. package/lib/index-CeIB4COQ.js +10 -0
  115. package/lib/index-Cjkk7z9c.js +19 -0
  116. package/lib/index-D6iTv28r.js +607 -0
  117. package/lib/index-D8E8s0tV.js +60 -0
  118. package/lib/index-DtILdK5l.js +48 -0
  119. package/lib/index-DtzckyT3.js +4 -0
  120. package/lib/index-Dy5ztCxm.js +27 -0
  121. package/lib/index-KMLwCm58.js +607 -0
  122. package/lib/index-_WvIFKTM.js +6 -0
  123. package/lib/index.d.ts +1826 -1842
  124. package/lib/index.js +54 -17049
  125. package/lib/isTypedArray-DN-UDJh5.js +89 -0
  126. package/lib/keyframes-PnzFl0I5.js +20 -0
  127. package/lib/package.json +133 -3
  128. package/lib/rollup.config.d.ts.map +1 -0
  129. package/lib/splitPathsBySizeLoader-Cm_vHo5k.js +23 -0
  130. package/lib/styled-components.browser.esm-Bq2p-e5F.js +479 -0
  131. package/lib/styles-BbwNLGy3.js +177 -0
  132. package/lib/styles-BlCCKAZq.js +1192 -0
  133. package/lib/use-toasts-GqvPVmSy.js +5 -0
  134. package/package.json +148 -12
  135. package/buildspec.yml +0 -22
  136. package/freemium-ui-2.0.91.tgz +0 -0
  137. package/lib/index.cjs.js +0 -17225
@@ -0,0 +1,36 @@
1
+ /// <reference types="react" />
2
+ import React$1 from 'react';
3
+ import { DraggableSyntheticListeners } from '@dnd-kit/core';
4
+
5
+ type ReorderItemType = {
6
+ id: string | number;
7
+ [key: string]: any;
8
+ };
9
+ type ReorderProps<T extends ReorderItemType = ReorderItemType> = {
10
+ /**
11
+ * Items of reorder
12
+ */
13
+ items: T[];
14
+ /**
15
+ * Class name of reorder
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Whether disabled select
20
+ */
21
+ disabled?: boolean;
22
+ /**
23
+ * should show the Dragger?
24
+ */
25
+ showDragger?: boolean;
26
+ customFilter?: (item: T) => boolean;
27
+ onReorder?: (items: T[]) => void;
28
+ customRender: (item: T, index: number, listeners?: DraggableSyntheticListeners) => React.ReactNode;
29
+ };
30
+
31
+ /**
32
+ * Reorder is a component that enables reordering of items in a list. It provides a drag handle to reorder the items.
33
+ */
34
+ declare const Reorder: <T extends ReorderItemType = ReorderItemType>(props: ReorderProps<T>) => React$1.JSX.Element;
35
+
36
+ export { Reorder, type ReorderItemType, type ReorderProps };
package/lib/Reorder.js ADDED
@@ -0,0 +1,5 @@
1
+ export{R as Reorder}from"./Reorder-DUSHsq7i.js"
2
+ ;import"./styled-components.browser.esm-Bq2p-e5F.js";import"react"
3
+ ;import"react-dom";import"./index-BT1o947S.js";import"./index-BnDw8kbT.js"
4
+ ;import"./index-D8E8s0tV.js";import"./index-ByHJlnsx.js"
5
+ ;import"./keyframes-PnzFl0I5.js";
@@ -0,0 +1,17 @@
1
+ import e from"react"
2
+ ;import{e as n}from"./styled-components.browser.esm-Bq2p-e5F.js"
3
+ ;import{T as o}from"./index-D8E8s0tV.js"
4
+ ;import{a as t,b as l,c as r,d as a,D as s,e as i}from"./styles-BbwNLGy3.js"
5
+ ;import{T as m}from"./TickIcon-BJqSAG4_.js";var c=function(c){
6
+ var d=c.trigger,u=c.idAccessor,p=void 0===u?"id":u,v=c.nameAccessor,f=void 0===v?"name":v,E=c.onSelect,b=c.isDisableSortDropdown,D=void 0!==b&&b,w=c.options,S=void 0===w?[]:w,g=c.value,j=n()
7
+ ;return e.createElement(t,null,e.createElement(l,{asChild:!0,disabled:D
8
+ },e.createElement(o,null,d)),e.createElement(r,null,e.createElement(a,{
9
+ side:"bottom",sideOffset:4,align:"center",className:"DropdownMenuContent"
10
+ },S.map((function(n,o){return e.createElement(e.Fragment,{key:o
11
+ },n.map((function(n){return e.createElement(s,{id:null==n?void 0:n[p],
12
+ disabled:null==n?void 0:n.disabled,className:"DropdownMenuItem",
13
+ key:null==n?void 0:n[p],onSelect:function(){var e=null!=g?g:[]
14
+ ;e[o]=null==n?void 0:n[p],null==E||E(e)}
15
+ },null==n?void 0:n[f],(null==g?void 0:g[o])===(null==n?void 0:n[p])&&e.createElement(m,{
16
+ fill:j.colors.common.accent}))})),e.createElement(i,{
17
+ className:"DropdownMenuSeparator"}))})))))};export{c as S};
@@ -0,0 +1,47 @@
1
+ /// <reference types="react" />
2
+ import React$1 from 'react';
3
+
4
+ interface DefaultMenuItemProps {
5
+ disabled?: boolean;
6
+ [key: string]: any;
7
+ }
8
+
9
+ type TableSortingMenuProps<T extends DefaultMenuItemProps = DefaultMenuItemProps> = {
10
+ /**
11
+ * value of menu
12
+ */
13
+ value?: string[];
14
+ /**
15
+ * Called when a menu item is selected
16
+ */
17
+ onSelect?: (value?: string[]) => void;
18
+ /**
19
+ * options for menu button
20
+ */
21
+ options?: T[][];
22
+ /**
23
+ * The children or label
24
+ */
25
+ trigger: React.ReactNode | string;
26
+ /**
27
+ * Is the button inline
28
+ * @deprecated
29
+ */
30
+ highlightedIndex?: number | null;
31
+ /**
32
+ * id Accessor of menu
33
+ */
34
+ idAccessor?: string;
35
+ /**
36
+ * name Accessor of menu
37
+ */
38
+ nameAccessor?: string;
39
+ isDisableSortDropdown?: boolean;
40
+ };
41
+
42
+ /**
43
+ * SortDropdown component is used to render the dropdown for sorting the table
44
+ */
45
+ declare const SortDropdown: <T extends DefaultMenuItemProps>(props: TableSortingMenuProps<T>) => React$1.JSX.Element;
46
+
47
+ export { SortDropdown, type TableSortingMenuProps };
@@ -0,0 +1,10 @@
1
+ export{S as SortDropdown}from"./SortDropdown-B0SSCJX6.js";import"react"
2
+ ;import"./styled-components.browser.esm-Bq2p-e5F.js";import"./index-D8E8s0tV.js"
3
+ ;import"./index-ByHJlnsx.js";import"react-dom";import"./index-BnDw8kbT.js"
4
+ ;import"./keyframes-PnzFl0I5.js";import"./styles-BbwNLGy3.js"
5
+ ;import"./index-CeIB4COQ.js";import"./index-BdTXfGkV.js"
6
+ ;import"./index-Cjkk7z9c.js";import"./index-BY9lf-do.js"
7
+ ;import"./index-COoRg_pp.js";import"./Combination-AmN1Cqrf.js"
8
+ ;import"./index-BrF1HKA1.js";import"./index-BROhcSiX.js"
9
+ ;import"./index-Dy5ztCxm.js";import"./index-DtILdK5l.js"
10
+ ;import"./index-BxNZ3C71.js";import"./TickIcon-BJqSAG4_.js";
@@ -0,0 +1,117 @@
1
+ import{e,c as n,b as t}from"./styled-components.browser.esm-Bq2p-e5F.js"
2
+ ;import l from"react"
3
+ ;import{u as a,T as o,a as r,b as i,c,x as s,d as m,C as u,e as d,y as g,f,g as p,h as E,S as h,i as v,j as C,k as b,l as w,m as y,n as S,o as k,p as P,B as x,q as N,r as I,s as M,t as O,v as R,M as F,w as j}from"./CustomizeColumns-BSF8e_we.js"
4
+ ;import{B as T}from"./Button-Bd1O8_k7.js"
5
+ ;import{C as D}from"./Checkbox-By1CgFUJ.js";import{L}from"./Loader-b8lHCp4N.js"
6
+ ;import{M as B}from"./Menu-DoE00Mg-.js";import"./styles-BbwNLGy3.js"
7
+ ;import{P as z}from"./Popover-BU73-g73.js"
8
+ ;import{S as A}from"./SortDropdown-B0SSCJX6.js"
9
+ ;import{T as H}from"./Typography-BcAppjDF.js";var V=l.forwardRef((function(e,n){
10
+ return l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",
11
+ fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{
12
+ width:"16",height:"16",fill:"white","fill-opacity":"0.01"
13
+ }),l.createElement("path",{
14
+ d:"M7.99999 10.62C7.84999 10.62 7.68999 10.56 7.57999 10.44L3.53999 6.41001C3.30999 6.18001 3.30999 5.80001 3.53999 5.56001C3.76999 5.33001 4.14999 5.33001 4.38999 5.56001L7.99999 9.17001L11.61 5.56001C11.84 5.33001 12.23 5.33001 12.46 5.56001C12.69 5.79001 12.69 6.17001 12.46 6.41001L8.41999 10.44C8.29999 10.56 8.14999 10.62 7.99999 10.62Z",
15
+ fill:"currentcolor"}))})),G=function(G){
16
+ var Y,q,K=G.data,Z=G.columns,$=G.showFooter,J=void 0!==$&&$,Q=G.infoComponent,U=G.isLoading,W=G.isFetching,X=G.emptyComponent,_=G.loadingComponent,ee=G.actionComponent,ne=G.headerComponent,te=G.editColumnComponent,le=G.filterComponent,ae=G.hideTableOnEmpty,oe=G.hideTopPagination,re=G.hideFilters,ie=G.isFilterOpenByDefault,ce=void 0===ie||ie,se=G.sortingHeading,me=G.showTableOnLoading,ue=G.hideLoaderOnTopPagination,de=G.hideActions,ge=G.count,fe=G.pageIndex,pe=void 0===fe?0:fe,Ee=G.pageSize,he=void 0===Ee?20:Ee,ve=G.enablePreviousPage,Ce=G.enableNextPage,be=G.hideColumnSettings,we=void 0===be||be,ye=G.hideBottomPagination,Se=G.rowMenuOptions,ke=G.onPreviousPageClick,Pe=G.enableSorting,xe=G.sortingValues,Ne=G.sortingOptions,Ie=G.onSortingOptionSelect,Me=G.onNextPageClick,Oe=G.disableRowSelect,Re=G.hideSelectAllInTable,Fe=G.onSelectAllRows,je=G.onRowSelect,Te=G.onMenuOptionSelect,De=G.onRowClick,Le=G.columnOrder,Be=G.setColumnOrder,ze=G.setHiddenColumns,Ae=G.hiddenColumns,He=G.selectedRowIds,Ve=void 0===He?{}:He,Ge=G.isDisableSortDropdown,Ye=G.setSelectedRowIds,qe=G.dataKey,Ke=void 0===qe?"id":qe,Ze=G.cellPropGetter,$e=G.setPageIndex,Je=G.rowPropGetter,Qe=G.translationTexts,Ue=e(),We=l.useState(!!ce),Xe=We[0],_e=We[1],en=R(),nn=-1===ge||void 0===ge,tn=l.useMemo((function(){
17
+ return n(n(n([],Oe?[]:[{id:"select",header:function(e){var n=e.table
18
+ ;return Re?l.createElement("div",{className:"table-checkbox-header"
19
+ }):l.createElement(D,t({className:"table-checkbox"},{
20
+ checked:n.getIsSomeRowsSelected()?"indeterminate":n.getIsAllRowsSelected(),
21
+ indeterminate:n.getIsSomeRowsSelected(),onCheckedChange:function(e){
22
+ n.toggleAllPageRowsSelected(!0===e),null==Fe||Fe(!0===e)}}))},cell:function(e){
23
+ var n=e.row;return l.createElement(D,t({className:"table-checkbox"},{
24
+ checked:n.getIsSelected(),disabled:!n.getCanSelect(),
25
+ indeterminate:n.getIsSomeSelected(),onCheckedChange:function(e){
26
+ n.toggleSelected(!0===e),null==je||je(n.original,!0===e)}}))}
27
+ }],!0),Z.map((function(e){var n;return en.accessor(e.id,{header:e.Header,
28
+ id:null!==(n=e.id)&&void 0!==n?n:e.Header,cell:function(n){
29
+ return e.accessorFn(n.row.original)}})})),!0),Se?[{id:"rowMenuOptions",
30
+ header:function(){return l.createElement("div",{id:"more-actions-header"})},
31
+ cell:function(e){var n=e.row;return l.createElement(B,{
32
+ trigger:l.createElement(F,{className:"more-actions",fill:"currentcolor"}),
33
+ options:Se(n.original)||[],onSelect:function(e){
34
+ e.id&&(null==Te||Te(e.id,n.original))},side:"bottom",
35
+ align:"rtl"===Ue.direction?"start":"end"})}}]:[],!0)
36
+ }),[Z,Oe,Re,Ue.colors.text.primary]),ln=l.useMemo((function(){var e={}
37
+ ;return Z.forEach((function(n){e[n.id]=!(null!=Ae?Ae:[]).includes(n.id)})),e
38
+ }),[Z,Ae]),an=l.useMemo((function(){return{pageIndex:pe,pageSize:he}
39
+ }),[he,pe]),on=a({data:K,columns:tn,getRowId:function(e){var n
40
+ ;return null!==(n=null==e?void 0:e[Ke])&&void 0!==n?n:"id"},getCoreRowModel:j(),
41
+ state:{columnOrder:Le,columnVisibility:ln,rowSelection:Ve,pagination:an},
42
+ initialState:{columnPinning:{left:["select"],right:["rowMenuOptions"]}},
43
+ onPaginationChange:function(e){var n=an
44
+ ;n="function"==typeof e?e(an):e,null==$e||$e(n.pageIndex)},
45
+ onColumnVisibilityChange:function(e){var n=ln
46
+ ;n="function"==typeof e?e(ln):e,null==ze||ze(Object.keys(n).filter((function(e){
47
+ return!n[e]})))},onColumnOrderChange:function(e){var n=null!=Le?Le:[]
48
+ ;n="function"==typeof e?e(null!=Le?Le:[]):e,null==Be||Be(n)},
49
+ onRowSelectionChange:function(e){var n=Ve
50
+ ;n="function"==typeof e?e(Ve):e,null==Ye||Ye(n)},enableRowSelection:!0,
51
+ manualPagination:!0,rowCount:nn?-1:ge
52
+ }),rn=on.getPageCount,cn=on.getRowModel,sn=on.getState,mn=on.getCanNextPage,un=on.getCanPreviousPage,dn=on.getPageOptions,gn=on.previousPage,fn=on.setPageIndex,pn=on.nextPage,En=on.lastPage,hn=on.firstPage,vn=cn().rows,Cn=sn().pagination,bn=Cn.pageIndex,wn=Cn.pageSize,yn=bn*wn+(bn<rn()-1?wn:vn.length),Sn=on.getAllColumns().filter((function(e){
53
+ return e.getIsVisible()
54
+ })).length+(Oe?0:1)+(Se?1:0),kn=null===(Y=null==Ne?void 0:Ne[0].find((function(e){
55
+ return e.id===(null==xe?void 0:xe[0])})))||void 0===Y?void 0:Y.name
56
+ ;return l.createElement(o,{className:"TableContainer"},!de&&l.createElement(r,{
57
+ className:"table-actions"
58
+ },ee&&l.createElement(l.Fragment,null,ee),l.createElement(i,{
59
+ className:"table-header-component"},null!=ne?ne:null),l.createElement(c,{
60
+ className:"table-header-dropdown-pagination"},Pe&&l.createElement("div",{
61
+ className:"table-heading-dropdown"},l.createElement("div",{
62
+ className:"table-sorting-heading"},"".concat(se,":"))," ",l.createElement(A,{
63
+ trigger:l.createElement("div",{className:"table-sorting-value-continer"
64
+ },l.createElement("div",null,kn),l.createElement(V,{fill:"currentcolor"})),
65
+ isDisableSortDropdown:!!Ge,options:Ne||[],value:xe,onSelect:function(e){
66
+ null==Ie||Ie(null!=e?e:[])}})),l.createElement(s,{
67
+ className:"table-edit-column-component"},null!=te?te:null),l.createElement(m,{
68
+ className:"pagination-actions"
69
+ },!oe&&l.createElement(l.Fragment,null,l.createElement(H,{variant:"primary",
70
+ className:"pagination-text"},U&&!ue?l.createElement(L,{size:"small"
71
+ }):l.createElement(l.Fragment,null,K.length>0?"".concat(bn*wn+1," - ").concat(yn," ").concat((null==Qe?void 0:Qe.of)||"of"," ").concat(nn?"".concat(vn.length>0?"".concat((null==Qe?void 0:Qe.many)||"Many"):"-"):null!==(q=null!=ge?ge:vn.length)&&void 0!==q?q:"-"):null)),l.createElement(T,{
72
+ variant:"secondary",className:"table-pagination-button",onClick:function(){
73
+ null==ke||ke(),nn||gn()},disabled:nn?!ve:!un()||U||W},l.createElement(u,{
74
+ fill:Ue.colors.text.primary})),l.createElement(T,{variant:"secondary",
75
+ className:"table-pagination-button",onClick:function(){null==Me||Me(),nn||pn()},
76
+ disabled:nn?!Ce:!mn()||U||W},l.createElement(d,{fill:Ue.colors.text.primary
77
+ }))),!re&&l.createElement(T,{variant:"secondary",
78
+ className:"table-pagination-button filter-toggle",onClick:function(){
79
+ return _e(!Xe)}},l.createElement(g,{style:{
80
+ transform:Xe?"rotateY(180deg)":"rotateY(0deg)"},fill:"currentcolor"
81
+ }))))),l.createElement(f,null,l.createElement(p,{className:"table-wrapper"
82
+ },Q&&l.createElement(E,null,Q),U&&!me?l.createElement(l.Fragment,null,_):l.createElement(l.Fragment,null,0===vn.length&&ae?l.createElement(l.Fragment,null,X):l.createElement(h,null,l.createElement(v,null,!we&&l.createElement(z,{
83
+ align:"end",avoidCollisions:!0,side:"top",trigger:l.createElement(C,{
84
+ fill:"currentcolor"})},l.createElement(b,{table:on
85
+ })),l.createElement(w,null,on.getHeaderGroups().map((function(e){
86
+ return l.createElement(y,{key:e.id},e.headers.map((function(e){
87
+ return l.createElement(S,{key:e.id
88
+ },e.isPlaceholder?null:k(e.column.columnDef.header,e.getContext()))})))
89
+ }))),l.createElement(P,null,W&&!U&&l.createElement(x,null,l.createElement(L,null)),vn.map((function(e){
90
+ return l.createElement(y,t({key:e.id,$isSelected:e.getIsSelected()
91
+ },null==Je?void 0:Je(e.original)),e.getVisibleCells().map((function(n){
92
+ return l.createElement(N,t({key:n.id,onClick:function(){
93
+ null==De||De(e.original,n.column.columnDef)}
94
+ },null==Ze?void 0:Ze(n)),k(n.column.columnDef.cell,n.getContext()))})))
95
+ }))),J&&l.createElement(I,null,on.getFooterGroups().map((function(e){
96
+ return l.createElement(y,{key:e.id},e.headers.map((function(e){
97
+ return l.createElement(S,{key:e.id
98
+ },e.isPlaceholder?null:k(e.column.columnDef.footer,e.getContext()))})))
99
+ }))),!ye&&l.createElement(I,null,l.createElement(y,null,l.createElement(S,{
100
+ colSpan:Sn},l.createElement(M,{className:"table-pagination"},l.createElement(T,{
101
+ variant:"secondary",onClick:function(){hn()},disabled:!un()||U||W
102
+ },"<<"),l.createElement(T,{variant:"secondary",onClick:function(){gn()},
103
+ disabled:!un()||U||W
104
+ },"<"),bn+1>2&&l.createElement(l.Fragment,null,l.createElement(T,{
105
+ variant:"secondary",onClick:function(){hn()},disabled:U||W
106
+ },"1"),bn+1-3!=0&&l.createElement(T,{variant:"secondary",disabled:!0
107
+ },"...")),dn().map((function(e){
108
+ return[e-2,e-1,e,e+1,e+2].includes(bn+1)&&l.createElement(T,{key:e,
109
+ variant:"secondary",className:bn+1===e+1?"active":"",onClick:function(){
110
+ null==fn||fn(e)},disabled:U||W},e+1)
111
+ })),bn+2<Math.ceil(K.length/wn)-2&&l.createElement(l.Fragment,null,bn+2+3!==Math.ceil(K.length/wn)&&l.createElement(T,{
112
+ variant:"secondary",disabled:!0},"..."),l.createElement(T,{variant:"secondary",
113
+ onClick:function(){null==fn||fn(Math.ceil(K.length/wn)-1)},disabled:U||W
114
+ },Math.ceil(K.length/wn))),l.createElement(T,{variant:"secondary",
115
+ onClick:function(){pn()},disabled:!mn()||U||W},">"),l.createElement(T,{
116
+ variant:"secondary",onClick:function(){En()},disabled:!mn()||U||W
117
+ },">>"))))))))),!re&&Xe&&le&&l.createElement(O,null,le)))};export{G as T};
package/lib/Table.d.ts ADDED
@@ -0,0 +1,95 @@
1
+ /// <reference types="react" />
2
+ import react from 'react';
3
+ import { CoreOptions, ColumnDef, Cell, RowSelectionState } from '@tanstack/react-table';
4
+ import { MenuItemProps as MenuItemProps$1 } from '@radix-ui/react-dropdown-menu';
5
+
6
+ type MenuItemProps = MenuItemProps$1 & {
7
+ isSelected?: boolean;
8
+ };
9
+
10
+ type RowDataType = {
11
+ [key in string]: any;
12
+ };
13
+ type SortingOptionsType = {
14
+ id: string;
15
+ name: string;
16
+ };
17
+ interface FuiTableColumnType<T extends RowDataType> {
18
+ id: string;
19
+ Header: string;
20
+ accessorFn: (row: T) => React.ReactNode | string | null;
21
+ disableSortBy?: boolean;
22
+ }
23
+ interface TableProps<T extends RowDataType> {
24
+ /**
25
+ * How large should the button be?
26
+ */
27
+ data: CoreOptions<T>['data'];
28
+ columns: FuiTableColumnType<T>[];
29
+ count?: number;
30
+ pageSize?: number;
31
+ pageIndex?: number;
32
+ sortingHeading?: string;
33
+ enableSorting?: boolean;
34
+ sortingOptions?: SortingOptionsType[][];
35
+ sortingValues?: string[];
36
+ onSortingOptionSelect?: (option: string[]) => void;
37
+ enablePreviousPage?: boolean;
38
+ enableNextPage?: boolean;
39
+ isLoading?: boolean;
40
+ isFetching?: boolean;
41
+ showFooter?: boolean;
42
+ hideColumnSettings?: boolean;
43
+ hideTableOnEmpty?: boolean;
44
+ hideTopPagination?: boolean;
45
+ hideFilters?: boolean;
46
+ showTableOnLoading?: boolean;
47
+ hideLoaderOnTopPagination?: boolean;
48
+ hideActions?: boolean;
49
+ showWorkspaceActions?: boolean;
50
+ hideSelectAllInTable?: boolean;
51
+ hideBottomPagination?: boolean;
52
+ disableRowSelect?: boolean;
53
+ infoComponent?: React.ReactElement;
54
+ filterComponent?: React.ReactElement;
55
+ isDisableSortDropdown?: boolean | null;
56
+ isFilterOpenByDefault?: boolean | null;
57
+ emptyComponent?: React.ReactElement;
58
+ actionComponent?: React.ReactElement;
59
+ loadingComponent?: React.ReactElement;
60
+ headerComponent?: React.ReactElement;
61
+ editColumnComponent?: React.ReactElement;
62
+ translationTexts?: Record<string, any> | null;
63
+ onNextPageClick?: () => void;
64
+ onPreviousPageClick?: () => void;
65
+ onSelectAllRows?: (checked: boolean) => void;
66
+ onRowSelect?: (row: T, checked: boolean) => void;
67
+ rowMenuOptions?: (RowDataType: T) => MenuItemProps[];
68
+ onMenuOptionSelect?: (optionId: string, row: T) => void;
69
+ onRowClick?: (row: T, column: ColumnDef<T, unknown>) => void;
70
+ dataKey?: string;
71
+ rowPropGetter?: (row: T) => React.HTMLAttributes<HTMLTableRowElement>;
72
+ cellPropGetter?: (cell: Cell<T, unknown>) => React.HTMLAttributes<HTMLTableCellElement>;
73
+ /**
74
+ * @deprecated
75
+ */
76
+ tableOptions?: any;
77
+ /**
78
+ * @deprecated
79
+ */
80
+ loaderStyles?: React.CSSProperties;
81
+ setPageIndex?: (pageIndex: number) => void | React.Dispatch<React.SetStateAction<number>>;
82
+ hiddenColumns?: string[];
83
+ setHiddenColumns?: (hiddenColumns: string[]) => void | React.Dispatch<React.SetStateAction<string[]>>;
84
+ columnOrder?: string[];
85
+ setColumnOrder?: (columnOrder: string[]) => void | React.Dispatch<React.SetStateAction<string[]>>;
86
+ selectedRowIds?: RowSelectionState;
87
+ setSelectedRowIds?: (selectedRowIds: RowSelectionState) => void | React.Dispatch<React.SetStateAction<RowSelectionState>>;
88
+ }
89
+
90
+ /**
91
+ * Table component is used to display data in a tabular format. It is used to show data in a structured manner. It can be used to show data in a grid format.
92
+ */
93
+ declare const Table: <T extends RowDataType = RowDataType>(props: TableProps<T>) => react.JSX.Element;
94
+
95
+ export { type RowDataType, Table, type TableProps };
package/lib/Table.js ADDED
@@ -0,0 +1,18 @@
1
+ export{T as Table}from"./Table-cidceyn5.js"
2
+ ;import"./styled-components.browser.esm-Bq2p-e5F.js";import"react"
3
+ ;import"./CustomizeColumns-BSF8e_we.js";import"./index-D8E8s0tV.js"
4
+ ;import"./index-ByHJlnsx.js";import"react-dom";import"./index-BnDw8kbT.js"
5
+ ;import"./keyframes-PnzFl0I5.js";import"./ChevronUp-BWiG3XYd.js"
6
+ ;import"./Button-Bd1O8_k7.js";import"./Checkbox-By1CgFUJ.js"
7
+ ;import"./index-BdTXfGkV.js";import"./index-CeIB4COQ.js"
8
+ ;import"./index-DtzckyT3.js";import"./index-BROhcSiX.js"
9
+ ;import"./index-Dy5ztCxm.js";import"./TickIcon-BJqSAG4_.js"
10
+ ;import"./Cross-CIeKwtq6.js";import"./TextArea--fiwZ_QM.js"
11
+ ;import"./ErrorText-Uvye7uop.js";import"./Popover-BU73-g73.js"
12
+ ;import"./index-COoRg_pp.js";import"./Combination-AmN1Cqrf.js"
13
+ ;import"./index-BxNZ3C71.js";import"./index-BrF1HKA1.js"
14
+ ;import"./Reorder-DUSHsq7i.js";import"./index-BT1o947S.js"
15
+ ;import"./Typography-BcAppjDF.js";import"./Loader-b8lHCp4N.js"
16
+ ;import"./Menu-DoE00Mg-.js";import"./styles-BbwNLGy3.js"
17
+ ;import"./index-Cjkk7z9c.js";import"./index-BY9lf-do.js"
18
+ ;import"./index-DtILdK5l.js";import"./SortDropdown-B0SSCJX6.js";
@@ -0,0 +1,50 @@
1
+ import n,{forwardRef as e,createElement as o,useRef as t,useEffect as r}from"react"
2
+ ;import{u as a,_ as i,e as s}from"./styled-components.browser.esm-Bq2p-e5F.js"
3
+ ;import{a as l,_ as d}from"./index-ByHJlnsx.js"
4
+ ;import{a as c,$ as u}from"./index-CeIB4COQ.js"
5
+ ;import{$ as p}from"./index-BdTXfGkV.js"
6
+ ;import{$ as b,a as m,b as f}from"./index-DtILdK5l.js"
7
+ ;import{$ as v}from"./index-Dy5ztCxm.js";import{$ as h}from"./index-BY9lf-do.js"
8
+ ;import{$ as x}from"./index-BxNZ3C71.js"
9
+ ;const g="Tabs",[y,w]=p(g,[b]),T=b(),[C,$]=y(g),_=e(((n,e)=>{
10
+ const{__scopeTabs:t,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:u,activationMode:p="automatic",...b}=n,m=h(u),[f,v]=c({
11
+ prop:r,onChange:a,defaultProp:i});return o(C,{scope:t,baseId:x(),value:f,
12
+ onValueChange:v,orientation:s,dir:m,activationMode:p},o(l.div,d({dir:m,
13
+ "data-orientation":s},b,{ref:e})))}));function k(n,e){return`${n}-trigger-${e}`}
14
+ function V(n,e){return`${n}-content-${e}`}const j=e(((n,e)=>{
15
+ const{__scopeTabs:t,loop:r=!0,...a}=n,i=$("TabsList",t),s=T(t);return o(m,d({
16
+ asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),o(l.div,d({
17
+ role:"tablist","aria-orientation":i.orientation},a,{ref:e})))})),D=e(((n,e)=>{
18
+ const{__scopeTabs:t,value:r,disabled:a=!1,...i}=n,s=$("TabsTrigger",t),c=T(t),p=k(s.baseId,r),b=V(s.baseId,r),m=r===s.value
19
+ ;return o(f,d({asChild:!0},c,{focusable:!a,active:m}),o(l.button,d({
20
+ type:"button",role:"tab","aria-selected":m,"aria-controls":b,
21
+ "data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:p
22
+ },i,{ref:e,onMouseDown:u(n.onMouseDown,(n=>{
23
+ a||0!==n.button||!1!==n.ctrlKey?n.preventDefault():s.onValueChange(r)})),
24
+ onKeyDown:u(n.onKeyDown,(n=>{[" ","Enter"].includes(n.key)&&s.onValueChange(r)
25
+ })),onFocus:u(n.onFocus,(()=>{const n="manual"!==s.activationMode
26
+ ;m||a||!n||s.onValueChange(r)}))})))})),I=e(((n,e)=>{
27
+ const{__scopeTabs:a,value:i,forceMount:s,children:c,...u}=n,p=$("TabsContent",a),b=k(p.baseId,i),m=V(p.baseId,i),f=i===p.value,h=t(f)
28
+ ;return r((()=>{const n=requestAnimationFrame((()=>h.current=!1))
29
+ ;return()=>cancelAnimationFrame(n)}),[]),o(v,{present:s||f
30
+ },(({present:t})=>o(l.div,d({"data-state":f?"active":"inactive",
31
+ "data-orientation":p.orientation,role:"tabpanel","aria-labelledby":b,hidden:!t,
32
+ id:m,tabIndex:0},u,{ref:e,style:{...n.style,
33
+ animationDuration:h.current?"0s":void 0}}),t&&c)))}))
34
+ ;var M,A,E,F,N=a(_)(M||(M=i([""],[""]))),z=a(I)(A||(A=i([""],[""]))),K=a(j)(E||(E=i(["\n border-bottom: 1px solid ",";\n display: flex;\n flex-wrap: nowrap;\n gap: 12px;\n direction: ",";\n"],["\n border-bottom: 1px solid ",";\n display: flex;\n flex-wrap: nowrap;\n gap: 12px;\n direction: ",";\n"])),(function(n){
35
+ return n.theme.colors.border.light}),(function(n){return n.theme.direction
36
+ })),L=a(D)(F||(F=i(["\n font-family: ",";\n direction: ",";\n background-color: unset;\n border: unset;\n margin: 0;\n padding: 8px;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n white-space: nowrap;\n color: ",";\n border-bottom: 2px solid transparent;\n border-radius: 4px 4px 0 0;\n &:hover {\n border-color: ",";\n cursor: pointer;\n }\n &[data-state='active'] {\n color: "," !important;\n border-color: ",";\n cursor: pointer !important;\n }\n &[disabled] {\n background-color: inherit;\n color: ",";\n cursor: not-allowed;\n }\n"],["\n font-family: ",";\n direction: ",";\n background-color: unset;\n border: unset;\n margin: 0;\n padding: 8px;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n white-space: nowrap;\n color: ",";\n border-bottom: 2px solid transparent;\n border-radius: 4px 4px 0 0;\n &:hover {\n border-color: ",";\n cursor: pointer;\n }\n &[data-state='active'] {\n color: "," !important;\n border-color: ",";\n cursor: pointer !important;\n }\n &[disabled] {\n background-color: inherit;\n color: ",";\n cursor: not-allowed;\n }\n"])),(function(n){
37
+ return n.theme.typography.fontFamily}),(function(n){return n.theme.direction
38
+ }),(function(n){return n.theme.colors.text.primary}),(function(n){
39
+ return n.theme.colors.border.divider}),(function(n){
40
+ return n.theme.colors.text.link}),(function(n){return n.theme.colors.text.link
41
+ }),(function(n){return n.theme.colors.text.disabled})),q=function(e){
42
+ var o=e.options,t=void 0===o?[]:o,r=e.idAccessor,a=void 0===r?"id":r,i=e.nameAccessor,l=void 0===i?"name":i,d=e.disabledAccessor,c=void 0===d?"disabled":d,u=e.onChange,p=e.defaultValue,b=e.label,m=e.renderTabsContent,f=e.value,v=s()
43
+ ;return n.createElement(N,{className:"TabsRoot",value:f,defaultValue:p,
44
+ onValueChange:u,dir:v.direction},n.createElement(K,{className:"TabsList",
45
+ "aria-label":b},t.map((function(e){return n.createElement(L,{
46
+ className:"TabsTrigger",value:null==e?void 0:e[a],key:null==e?void 0:e[a],
47
+ disabled:null==e?void 0:e[c]},null==e?void 0:e[l])}))),t.map((function(e){
48
+ return n.createElement(z,{className:"TabsContent",value:null==e?void 0:e[a],
49
+ key:null==e?void 0:e[a]},m?m(e):null)})))}
50
+ ;export{q as T,z as a,N as b,K as c,L as d};
package/lib/Tabs.d.ts ADDED
@@ -0,0 +1,68 @@
1
+ /// <reference types="react" />
2
+ import * as react from 'react';
3
+ import react__default from 'react';
4
+ import * as Tabs$1 from '@radix-ui/react-tabs';
5
+ import { TabsProps as TabsProps$1 } from '@radix-ui/react-tabs';
6
+ import * as styled_components from 'styled-components';
7
+ import * as styled_components_dist_types from 'styled-components/dist/types';
8
+
9
+ declare const TabsRoot: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
10
+ ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
11
+ }, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsProps & react.RefAttributes<HTMLDivElement>>, keyof react.Component<any, {}, any>>;
12
+ declare const TabsContent: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
13
+ ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
14
+ }, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsContentProps & react.RefAttributes<HTMLDivElement>>, keyof react.Component<any, {}, any>>;
15
+ declare const TabsList: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsListProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
16
+ ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
17
+ }, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsListProps & react.RefAttributes<HTMLDivElement>>, keyof react.Component<any, {}, any>>;
18
+ declare const TabsTrigger: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
19
+ ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
20
+ }, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>>, keyof react.Component<any, {}, any>>;
21
+
22
+ interface TabsItemProps {
23
+ id: string;
24
+ name: string;
25
+ hide?: boolean;
26
+ disabled?: boolean;
27
+ [key: string]: any;
28
+ }
29
+ type TabsProps<T extends TabsItemProps = TabsItemProps> = {
30
+ /**
31
+ * options for Tabs
32
+ */
33
+ options?: Array<T>;
34
+ renderTabsContent?: (tabOption: T) => React.ReactNode;
35
+ /**
36
+ * Id accessor of tabes
37
+ */
38
+ idAccessor?: string;
39
+ label?: string;
40
+ /**
41
+ * Name accessor of tabs
42
+ */
43
+ nameAccessor?: string;
44
+ /**
45
+ * Disabled accessor of tabs
46
+ */
47
+ disabledAccessor?: string;
48
+ ref?: React.RefObject<HTMLDivElement>;
49
+ /**
50
+ * value for tabs
51
+ */
52
+ value?: TabsProps$1['value'];
53
+ /**
54
+ * default value of tabes
55
+ */
56
+ defaultValue?: TabsProps$1['defaultValue'];
57
+ /**
58
+ * Function to be called when the selected item changes
59
+ */
60
+ onChange?: TabsProps$1['onValueChange'];
61
+ };
62
+
63
+ /**
64
+ * Tabs component is used to show a set of tabs to the user. It is used to show different sections of content in a single view. It can be used to show different categories of content.
65
+ */
66
+ declare const Tabs: <T extends TabsItemProps>({ options, idAccessor, nameAccessor, disabledAccessor, onChange, defaultValue, label, renderTabsContent, value, }: TabsProps<T>) => react__default.JSX.Element;
67
+
68
+ export { Tabs, TabsContent, type TabsItemProps, TabsList, type TabsProps, TabsRoot, TabsTrigger };
package/lib/Tabs.js ADDED
@@ -0,0 +1,6 @@
1
+ export{T as Tabs,a as TabsContent,c as TabsList,b as TabsRoot,d as TabsTrigger}from"./Tabs-j1c7ybY-.js"
2
+ ;import"react";import"./styled-components.browser.esm-Bq2p-e5F.js"
3
+ ;import"./index-ByHJlnsx.js";import"react-dom";import"./index-CeIB4COQ.js"
4
+ ;import"./index-BdTXfGkV.js";import"./index-DtILdK5l.js"
5
+ ;import"./index-Cjkk7z9c.js";import"./index-BxNZ3C71.js"
6
+ ;import"./index-BY9lf-do.js";import"./index-Dy5ztCxm.js";
@@ -0,0 +1,49 @@
1
+ import{u as n,_ as e,a as r,e as t,b as o}from"./styled-components.browser.esm-Bq2p-e5F.js"
2
+
3
+ ;import i,{forwardRef as a,useState as s,createElement as l,useEffect as c}from"react"
4
+ ;import{a as d,_ as h}from"./index-ByHJlnsx.js"
5
+ ;import{$ as f,b as u,c as m}from"./index-BdTXfGkV.js"
6
+ ;import{C as p}from"./Cross-CIeKwtq6.js"
7
+ ;const g="Avatar",[y,v]=f(g),[x,b]=y(g),w=a(((n,e)=>{
8
+ const{__scopeAvatar:r,...t}=n,[o,i]=s("idle");return l(x,{scope:r,
9
+ imageLoadingStatus:o,onImageLoadingStatusChange:i},l(d.span,h({},t,{ref:e})))}))
10
+ ;const S=a(((n,e)=>{
11
+ const{__scopeAvatar:r,src:t,onLoadingStatusChange:o=(()=>{}),...i}=n,a=b("AvatarImage",r),c=function(n){
12
+ const[e,r]=s("idle");return m((()=>{if(!n)return void r("error");let e=!0
13
+ ;const t=new window.Image,o=n=>()=>{e&&r(n)}
14
+ ;return r("loading"),t.onload=o("loaded"),t.onerror=o("error"),t.src=n,()=>{e=!1
15
+ }}),[n]),e}(t),f=u((n=>{o(n),a.onImageLoadingStatusChange(n)}));return m((()=>{
16
+ "idle"!==c&&f(c)}),[c,f]),"loaded"===c?l(d.img,h({},i,{ref:e,src:t})):null
17
+ })),k=a(((n,e)=>{
18
+ const{__scopeAvatar:r,delayMs:t,...o}=n,i=b("AvatarFallback",r),[a,f]=s(void 0===t)
19
+ ;return c((()=>{if(void 0!==t){const n=window.setTimeout((()=>f(!0)),t)
20
+ ;return()=>window.clearTimeout(n)}
21
+ }),[t]),a&&"loaded"!==i.imageLoadingStatus?l(d.span,h({},o,{ref:e})):null}))
22
+ ;var A,j,C,I,E,_=n(w)(A||(A=e(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n overflow: hidden;\n user-select: none;\n width: 24px;\n height: 24px;\n border-radius: 100%;\n"],["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n overflow: hidden;\n user-select: none;\n width: 24px;\n height: 24px;\n border-radius: 100%;\n"]))),z=n(S)(j||(j=e(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: inherit;\n"],["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: inherit;\n"]))),T=n(k)(C||(C=e(["\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: white;\n color: ",";\n font-family: ",";\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n"],["\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: white;\n color: ",";\n font-family: ",";\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n"])),(function(n){
23
+ return n.theme.colors.text.primary}),(function(n){
24
+ return n.theme.typography.fontFamily}),(function(n){
25
+ return n.theme.typography.secondary.fontSize}),(function(n){
26
+ return n.theme.typography.secondary.fontWeight}),(function(n){
27
+ return n.theme.typography.secondary.lineHeight
28
+ })),L=n.button(I||(I=e(["\n border: none;\n cursor: pointer;\n padding: 6px;\n display: flex;\n border-radius: 50%;\n &:focus,\n &:hover {\n background-color: ",";\n }\n"],["\n border: none;\n cursor: pointer;\n padding: 6px;\n display: flex;\n border-radius: 50%;\n &:focus,\n &:hover {\n background-color: ",";\n }\n"])),(function(n){
29
+ var e=n.theme;return"dark"===e.mode?e.colors.fill.hover:e.colors.fill.surface
30
+ })),B=n.span(E||(E=e(["\n padding: 4px 6px;\n border-radius: 16px;\n display: flex;\n align-items: center;\n gap: 6px;\n width: fit-content;\n direction: ",";\n font-family: ",";\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n color: ",";\n background-color: ",";\n border: 1px solid\n ",";\n &:hover {\n border-color: ",";\n }\n"],["\n padding: 4px 6px;\n border-radius: 16px;\n display: flex;\n align-items: center;\n gap: 6px;\n width: fit-content;\n direction: ",";\n font-family: ",";\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n color: ",";\n background-color: ",";\n border: 1px solid\n ",";\n &:hover {\n border-color: ",";\n }\n"])),(function(n){
31
+ return n.theme.direction}),(function(n){return n.theme.typography.fontFamily
32
+ }),(function(n){return n.theme.typography.secondary.fontSize}),(function(n){
33
+ return n.theme.typography.fontWeight["semi-bold"]}),(function(n){
34
+ return n.theme.typography.secondary.lineHeight}),(function(n){
35
+ return n.theme.colors.text.primary}),(function(n){
36
+ return n.theme.colors.fill.base}),(function(n){var e=n.theme
37
+ ;return n.$showBorder?e.colors.border.normal:"transparent"}),(function(n){
38
+ return n.theme.colors.border.hover})),F=i.forwardRef((function(n,e){
39
+ var a=n.children,s=n.iconProps,l=n.onClose,c=n.showBorder,d=void 0!==c&&c,h=n.hideClose,f=void 0!==h&&h,u=n.avatarImgAlt,m=n.avatarImgSrc,g=n.avatarText,y=n.style
40
+ ;n.state
41
+ ;var v=n.iconSVGProps,x=r(n,["children","iconProps","onClose","showBorder","hideClose","avatarImgAlt","avatarImgSrc","avatarText","style","state","iconSVGProps"]),b=t()
42
+ ;return i.createElement(B,o({$showBorder:d,style:y,className:"StyledTag",
43
+ dir:b.direction},x,{ref:e}),m||g?i.createElement(_,{className:"AvatarRoot"
44
+ },i.createElement(z,{className:"AvatarImage",src:m,alt:u}),i.createElement(T,{
45
+ className:"AvatarFallback",delayMs:600
46
+ },g)):i.createElement("div",null),a,f?i.createElement("div",null):i.createElement(L,o({},s,{
47
+ onClick:l}),i.createElement(p,o({},v,{
48
+ fill:"dark"===b.mode?b.colors.text.inverse:b.colors.text.primary}))))}))
49
+ ;export{F as T};
package/lib/Tag.d.ts ADDED
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ import React$1 from 'react';
3
+
4
+ interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
5
+ /**
6
+ * State of the tag
7
+ */
8
+ state?: 'error' | 'default' | 'transparent';
9
+ /**
10
+ * Show border around the tag
11
+ */
12
+ showBorder?: boolean;
13
+ /**
14
+ * Show border around the tag
15
+ */
16
+ hideClose?: boolean;
17
+ /**
18
+ * Image source for the avatar
19
+ */
20
+ avatarImgSrc?: string;
21
+ /**
22
+ * Image alt for the avatar
23
+ */
24
+ avatarImgAlt?: string;
25
+ /**
26
+ * Text for the avatar
27
+ */
28
+ avatarText?: string;
29
+ /**
30
+ * Function to be called when the tag is closed
31
+ */
32
+ onClose?: React.MouseEventHandler<HTMLButtonElement>;
33
+ /**
34
+ * Children of the tag
35
+ */
36
+ children?: React.ReactNode;
37
+ /**
38
+ * Props for the icon
39
+ */
40
+ iconProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
41
+ iconSVGProps?: React.SVGProps<SVGSVGElement>;
42
+ style?: React.CSSProperties;
43
+ }
44
+
45
+ /**
46
+ * Tag component is used to show a tag to the user. It is used to show a label or a category
47
+ */
48
+ declare const Tag: React$1.ForwardRefExoticComponent<TagProps & React$1.RefAttributes<HTMLSpanElement>>;
49
+
50
+ export { Tag, type TagProps };
package/lib/Tag.js ADDED
@@ -0,0 +1,4 @@
1
+ export{T as Tag}from"./Tag-Cu75ReQP.js"
2
+ ;import"./styled-components.browser.esm-Bq2p-e5F.js";import"react"
3
+ ;import"./index-ByHJlnsx.js";import"react-dom";import"./index-BdTXfGkV.js"
4
+ ;import"./Cross-CIeKwtq6.js";