@zonos/amino 5.4.20 → 5.4.22

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/amino.css CHANGED
@@ -77,7 +77,7 @@ html {
77
77
 
78
78
  body {
79
79
  font-family: var(--amino-font-sans);
80
- font-size: var(--amino-text-base);
80
+ font-size: var(--amino-font-size-base);
81
81
  background: var(--amino-page-background);
82
82
  height: 100%;
83
83
  width: 100%;
@@ -121,7 +121,7 @@ h4 {
121
121
  }
122
122
 
123
123
  h5 {
124
- font-size: var(--amino-text-base);
124
+ font-size: var(--amino-font-size-base);
125
125
  font-weight: 400;
126
126
  }
127
127
 
@@ -50,6 +50,29 @@ export type SimpleTableProps<T extends object> = BaseProps & {
50
50
  children: ReactNode;
51
51
  href: string;
52
52
  }>;
53
+ /**
54
+ * @default false
55
+ * Use bordered variant of table
56
+ */
57
+ bordered?: boolean;
58
+ /**
59
+ * @default false
60
+ * @note Setting collapsible with onRowClick could result in unexpected behavior
61
+ * Enable rows to collapse and expand with more information
62
+ */
63
+ collapsible?: {
64
+ /**
65
+ * Content to show when row is expanded
66
+ */
67
+ collapseContent?: {
68
+ content: ReactNode;
69
+ /**
70
+ * @note Key must match the key of the item it is expanding from
71
+ */
72
+ key: string;
73
+ }[];
74
+ enabled: boolean;
75
+ };
53
76
  headers: SimpleTableHeader<T>[];
54
77
  items: T[];
55
78
  /**
@@ -115,6 +138,7 @@ export type SimpleTableProps<T extends object> = BaseProps & {
115
138
  * Callback for clicking anywhere on row.
116
139
  *
117
140
  * If having buttons in the table, remember to call e.stopPropagation() to prevent this from firing.
141
+ * @note Setting onRowClick with collapsible will result in unexpected behavior
118
142
  */
119
143
  onRowClick?: (item: T) => void;
120
144
  /** Callback for hovering anywhere on row */
@@ -127,5 +151,5 @@ export type SimpleTableProps<T extends object> = BaseProps & {
127
151
  * - 'row-hover-show': Shows only when the row is hovered
128
152
  * - 'cell-hover-show': Shows only when the cell is hovered
129
153
  */
130
- export declare const SimpleTable: <T extends object>({ className, CustomLinkComponent, getRowLink, headers, items, keyExtractor, loading, loadingItems, loadingSkeletonHeight, maxHeight, noHoverBackground, onRowClick, onRowHover, renderFooter, selectable, style, }: SimpleTableProps<T>) => import("react/jsx-runtime").JSX.Element;
154
+ export declare const SimpleTable: <T extends object>({ bordered, className, collapsible, CustomLinkComponent, getRowLink, headers, items, keyExtractor, loading, loadingItems, loadingSkeletonHeight, maxHeight, noHoverBackground, onRowClick, onRowHover, renderFooter, selectable, style, }: SimpleTableProps<T>) => import("react/jsx-runtime").JSX.Element;
131
155
  export {};
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),t=require("react"),i=require("clsx"),o=require("../checkbox/Checkbox.js"),a=require("../skeleton/Skeleton.js"),n=require("../text/Text.js"),d=require("../tooltip/Tooltip.js"),r=require("../../style-inject.es-d4ddeae4.js");function m(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js"),require("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var s=m(t),c=m(i),u="Amino_SimpleTable-module__tableContainer--UsGFZ",b="Amino_SimpleTable-module__tableStyled--Q3YSy",h="Amino_SimpleTable-module__noPadding--b5Y-c",_="Amino_SimpleTable-module__withHover--eL3XX",p="Amino_SimpleTable-module__clickable--XnaaE",y="Amino_SimpleTable-module__allowTextWrap--yVvjm",x="Amino_SimpleTable-module__loading--bvjof",S="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7",v="Amino_SimpleTable-module__shouldTruncate--x-zmL",g="Amino_SimpleTable-module__styledCheckbox---753a";r.styleInject(".Amino_SimpleTable-module__tableContainer--UsGFZ{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy{border-collapse:initial;border-spacing:0;font-size:var(--amino-font-size-base);width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:none}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border-subtle);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{background-color:var(--amino-gray-0);border-bottom:var(--amino-border-subtle);padding:12px;position:-webkit-sticky;position:sticky;top:0;white-space:nowrap}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr{height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-hover-color)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .row-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td{border-bottom:var(--amino-border-subtle);padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child{display:block;height:100%;padding:12px;white-space:nowrap;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__allowTextWrap--yVvjm{white-space:normal}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7{display:flex}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child:not(:hover) .cell-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL{max-width:var(--amino-cell-min-width);min-width:var(--amino-cell-min-width)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL>:first-child{overflow:hidden;text-overflow:ellipsis}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}");var T=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}},f=800;exports.SimpleTable=function(i){var r=i.className,m=i.CustomLinkComponent,j=i.getRowLink,k=i.headers,w=i.items,A=i.keyExtractor,C=i.loading,Y=void 0!==C&&C,q=i.loadingItems,Q=void 0===q?10:q,N=i.loadingSkeletonHeight,H=void 0===N?13:N,W=i.maxHeight,R=void 0===W?"100%":W,L=i.noHoverBackground,D=void 0!==L&&L,F=i.onRowClick,I=i.onRowHover,M=i.renderFooter,P=i.selectable,X=void 0===P?{enabled:!1}:P,z=i.style,E=function(e,t){var i=t[e.key],o=function(i){var o=s.default.Children.toArray(i).some((function(e){return!!s.default.isValidElement(e)&&/row-hover-show|cell-hover-show/.test(e.props.className)})),a=c.default("truncate"===e.textWrapMethod&&!o&&v),n={"--amino-cell-min-width":"".concat(e.minWidth||0,"px")},r=c.default(e.noPadding&&h,"normal"===e.textWrapMethod&&y),u={textAlign:e.align||"start"},b=function(e){switch(e){case"center":return"bottom";case"end":return"bottom-end";default:return"bottom-start"}}(e.align);if(j&&!X.anySelected&&!e.disabledLink){var _=m||"a";return l.jsx("td",{className:a,style:n,children:l.jsx(d.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:f,enterNextDelay:f,placement:b,subtitle:i,children:l.jsx(_,{className:r,href:j(t),style:u,children:i})})})}return l.jsx("td",{className:a,style:n,children:l.jsx(d.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:f,enterNextDelay:f,placement:b,subtitle:i,children:l.jsx("span",{className:r,style:u,children:i})})})};return e.renderCustom?l.jsx(l.Fragment,{children:o(e.renderCustom(i,t))}):l.jsx(l.Fragment,{children:o(String(i))})};return l.jsx("div",{className:c.default(u,r),style:e.__assign({maxHeight:R},z),children:l.jsxs("table",{className:b,children:[l.jsxs("colgroup",{children:[!!X.onHeaderCheckboxChange&&l.jsx("col",{width:0}),k.map((function(e){return l.jsx("col",{style:{minWidth:void 0!==e.minWidth?"".concat(e.minWidth,"px"):void 0},width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)}))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!X.onHeaderCheckboxChange&&l.jsx("th",{className:h,children:X.renderCustomHeaderCheckbox||l.jsx(o.Checkbox,{checked:!Y&&X.headerCheckboxValue||!1,className:g,disabled:Y,onChange:X.onHeaderCheckboxChange})}),k.map((function(e){return l.jsx("th",{className:c.default(e.noPadding&&h),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(n.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)}))]})}),l.jsx("tbody",{children:Y?e.__spreadArray([],e.__read(Array(Q).keys()),!1).map((function(e){return l.jsxs("tr",{children:[X.enabled&&l.jsx("td",{children:l.jsx("div",{children:l.jsx(a.Skeleton,{height:H},e)})}),k.map((function(t){return l.jsx("td",{className:c.default(x,t.noPadding&&h),children:l.jsx("div",{className:S,style:{justifyContent:T(t.align)},children:l.jsx(a.Skeleton,{height:H,style:{width:"50%"}},e)})},t.key)}))]},e)})):w.map((function(e,i){var a,n,d,r=!!F||!!X.anySelected&&!!X.onRowCheckboxChange;return l.jsxs("tr",{className:c.default(r&&p,!D&&_),onClick:function(l){var t,o,a;X.anySelected?(null===(t=X.isRowCheckboxDisabled)||void 0===t?void 0:t.call(X,e,i))||(l.preventDefault(),null===(o=X.onRowCheckboxChange)||void 0===o||o.call(X,!(null===(a=X.isRowChecked)||void 0===a?void 0:a.call(X,e,i)),e,i)):null==F||F(e)},onMouseEnter:function(){return null==I?void 0:I(e)},children:[X.enabled&&l.jsx("td",{children:(null===(a=X.renderCustomRowCheckbox)||void 0===a?void 0:a.call(X,e,i))||l.jsx(o.Checkbox,{checked:(null===(n=X.isRowChecked)||void 0===n?void 0:n.call(X,e,i))||!1,disabled:(null===(d=X.isRowCheckboxDisabled)||void 0===d?void 0:d.call(X,e,i))||!1,onChange:function(l){var t;return null===(t=X.onRowCheckboxChange)||void 0===t?void 0:t.call(X,l,e,i)}})}),k.map((function(i){return l.jsx(t.Fragment,{children:E(i,e)},i.key)}))]},A(e))}))}),M]})})};
1
+ "use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),i=require("clsx"),t=require("../checkbox/Checkbox.js"),d=require("../skeleton/Skeleton.js"),a=require("../table/TableRowCollapse.js"),r=require("../text/Text.js"),n=require("../tooltip/Tooltip.js"),m=require("../../style-inject.es-d4ddeae4.js");function s(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js"),require("../button/Button.js"),require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../collapse/Collapse.js"),require("@mui/material/Collapse"),require("../table/TableCell.js"),require("../table/TableRow.js"),require("../../icons/ChevronUpIcon.js"),require("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var b=s(o),_=s(i),u="Amino_SimpleTable-module__tableContainer--UsGFZ",c="Amino_SimpleTable-module__tableStyled--Q3YSy",p="Amino_SimpleTable-module__noHeaders---Nf59",h="Amino_SimpleTable-module__bordered--rYjAD",S="Amino_SimpleTable-module__noPadding--b5Y-c",y="Amino_SimpleTable-module__withHover--eL3XX",x="Amino_SimpleTable-module__clickable--XnaaE",T="Amino_SimpleTable-module__allowTextWrap--yVvjm",A="Amino_SimpleTable-module__loading--bvjof",v="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7",j="Amino_SimpleTable-module__shouldTruncate--x-zmL",f="Amino_SimpleTable-module__collapsible--ozkOZ",g="Amino_SimpleTable-module__collapsed--VazPW",k="Amino_SimpleTable-module__styledCheckbox---753a";m.styleInject(".Amino_SimpleTable-module__tableContainer--UsGFZ{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy{border-collapse:initial;border-spacing:0;font-size:var(--amino-font-size-base);width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__noHeaders---Nf59 thead{display:none;max-height:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD th{border:none}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td{border-top:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td:first-child{border-top-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:first-child td:last-child{border-top-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:last-child td:first-child{border-bottom-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD tr:last-child td:last-child{border-bottom-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD td:first-child{border-left:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__bordered--rYjAD td:last-child{border-right:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:none}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border-subtle);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{background-color:var(--amino-gray-0);border-bottom:var(--amino-border-subtle);padding:12px;position:-webkit-sticky;position:sticky;top:0;white-space:nowrap}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr{height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-hover-color)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .row-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td{border-bottom:var(--amino-border-subtle);padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child{display:block;height:100%;padding:12px;white-space:nowrap;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__allowTextWrap--yVvjm{white-space:normal}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child.Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7{display:flex}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td>:first-child:not(:hover) .cell-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL{max-width:var(--amino-cell-min-width);min-width:var(--amino-cell-min-width)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__shouldTruncate--x-zmL>:first-child{overflow:hidden;text-overflow:ellipsis}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ.Amino_SimpleTable-module__bordered--rYjAD tr:nth-last-child(2).Amino_SimpleTable-module__collapsed--VazPW td:first-child{border-bottom-left-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ.Amino_SimpleTable-module__bordered--rYjAD tr:nth-last-child(2).Amino_SimpleTable-module__collapsed--VazPW td:last-child{border-bottom-right-radius:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody *{transition:var(--amino-transition)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr{height:auto}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr:not(.Amino_SimpleTable-module__collapsed--VazPW) td{border-bottom:var(--amino-border-subtle)}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr.Amino_SimpleTable-module__collapsed--VazPW+tr>td{border:0}.Amino_SimpleTable-module__tableStyled--Q3YSy.Amino_SimpleTable-module__collapsible--ozkOZ>tbody>tr.Amino_SimpleTable-module__collapsed--VazPW+tr>td>:first-child{padding:0}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}");var C=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}},w=800;exports.SimpleTable=function(i){var m=i.bordered,s=void 0!==m&&m,Y=i.className,Q=i.collapsible,q=void 0===Q?{enabled:!1}:Q,R=i.CustomLinkComponent,z=i.getRowLink,D=i.headers,N=i.items,W=i.keyExtractor,H=i.loading,P=void 0!==H&&H,V=i.loadingItems,Z=void 0===V?10:V,F=i.loadingSkeletonHeight,I=void 0===F?13:F,L=i.maxHeight,O=void 0===L?"100%":L,M=i.noHoverBackground,X=void 0!==M&&M,E=i.onRowClick,B=i.onRowHover,G=i.renderFooter,U=i.selectable,J=void 0===U?{enabled:!1}:U,K=i.style,$=e.__read(o.useState([]),2),ee=$[0],le=$[1],oe=function(e,o){var i=o[e.key],t=function(i){var t=b.default.Children.toArray(i).some((function(e){return!!b.default.isValidElement(e)&&/row-hover-show|cell-hover-show/.test(e.props.className)})),d=_.default("truncate"===e.textWrapMethod&&!t&&j),a={"--amino-cell-min-width":"".concat(e.minWidth||0,"px")},r=_.default(e.noPadding&&S,"normal"===e.textWrapMethod&&T),m={textAlign:e.align||"start"},s=function(e){switch(e){case"center":return"bottom";case"end":return"bottom-end";default:return"bottom-start"}}(e.align);if(z&&!J.anySelected&&!e.disabledLink){var u=R||"a";return l.jsx("td",{className:d,style:a,children:l.jsx(n.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:w,enterNextDelay:w,placement:s,subtitle:i,children:l.jsx(u,{className:r,href:z(o),style:m,children:i})})})}return l.jsx("td",{className:d,style:a,children:l.jsx(n.Tooltip,{disabled:"truncate"!==e.textWrapMethod,enterDelay:w,enterNextDelay:w,placement:s,subtitle:i,children:l.jsx("span",{className:r,style:m,children:i})})})};return e.renderCustom?l.jsx(l.Fragment,{children:t(e.renderCustom(i,o))}):l.jsx(l.Fragment,{children:t(String(i))})};return l.jsx("div",{className:_.default(u,Y),style:e.__assign({maxHeight:O},K),children:l.jsxs("table",{className:_.default(q.enabled&&f,c,s&&h,D.every((function(e){return!e.name}))&&p),children:[l.jsxs("colgroup",{children:[!!J.onHeaderCheckboxChange&&l.jsx("col",{width:0}),D.map((function(e){return l.jsx("col",{style:{minWidth:void 0!==e.minWidth?"".concat(e.minWidth,"px"):void 0},width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)})),q.enabled&&l.jsx("col",{})]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!J.onHeaderCheckboxChange&&l.jsx("th",{className:S,children:J.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!P&&J.headerCheckboxValue||!1,className:k,disabled:P,onChange:J.onHeaderCheckboxChange})}),D.map((function(e){return l.jsx("th",{className:_.default(e.noPadding&&S),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(r.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)})),q.enabled&&l.jsx("th",{})]})}),l.jsx("tbody",{children:function(){var i;return P?e.__spreadArray([],e.__read(Array(Z).keys()),!1).map((function(e){return l.jsxs("tr",{children:[J.enabled&&l.jsx("td",{children:l.jsx("div",{children:l.jsx(d.Skeleton,{height:I},e)})}),D.map((function(o){return l.jsx("td",{className:_.default(A,o.noPadding&&S),children:l.jsx("div",{className:v,style:{justifyContent:C(o.align)},children:l.jsx(d.Skeleton,{height:I,style:{width:"50%"}},e)})},o.key)}))]},e)})):q.enabled&&(null===(i=q.collapseContent)||void 0===i?void 0:i.length)?N.map((function(e,i){var d,r,n,m,s,b=W(e),u=!ee.includes(b);return l.jsx(a.TableRowCollapse,{className:_.default(!X&&y,u&&g),collapsed:u,onToggleCollapse:function(){return e=b,le(ee.includes(e)?ee.filter((function(l){return l!==e})):ee.concat(e));var e},rowContent:l.jsxs(l.Fragment,{children:[J.enabled&&l.jsx("td",{children:(null===(d=J.renderCustomRowCheckbox)||void 0===d?void 0:d.call(J,e,i))||l.jsx(t.Checkbox,{checked:(null===(r=J.isRowChecked)||void 0===r?void 0:r.call(J,e,i))||!1,disabled:(null===(n=J.isRowCheckboxDisabled)||void 0===n?void 0:n.call(J,e,i))||!1,onChange:function(l){var o;return null===(o=J.onRowCheckboxChange)||void 0===o?void 0:o.call(J,l,e,i)}})}),D.map((function(i){return l.jsx(o.Fragment,{children:oe(i,e)},i.key)}))]}),children:null===(s=null===(m=q.collapseContent)||void 0===m?void 0:m.find((function(e){return e.key===b})))||void 0===s?void 0:s.content},b)})):N.map((function(e,i){var d,a,r,n=!!E||!!J.anySelected&&!!J.onRowCheckboxChange;return l.jsxs("tr",{className:_.default(n&&x,!X&&y),onClick:function(l){var o,t,d;J.anySelected?(null===(o=J.isRowCheckboxDisabled)||void 0===o?void 0:o.call(J,e,i))||(l.preventDefault(),null===(t=J.onRowCheckboxChange)||void 0===t||t.call(J,!(null===(d=J.isRowChecked)||void 0===d?void 0:d.call(J,e,i)),e,i)):null==E||E(e)},onMouseEnter:function(){return null==B?void 0:B(e)},children:[J.enabled&&l.jsx("td",{children:(null===(d=J.renderCustomRowCheckbox)||void 0===d?void 0:d.call(J,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=J.isRowChecked)||void 0===a?void 0:a.call(J,e,i))||!1,disabled:(null===(r=J.isRowCheckboxDisabled)||void 0===r?void 0:r.call(J,e,i))||!1,onChange:function(l){var o;return null===(o=J.onRowCheckboxChange)||void 0===o?void 0:o.call(J,l,e,i)}})}),D.map((function(i){return l.jsx(o.Fragment,{children:oe(i,e)},i.key)}))]},W(e))}))}()}),G]})})};
@@ -1 +1 @@
1
- "use strict";var o=require("../../_tslib-bd4862e8.js"),a=require("react"),n=require("react/jsx-runtime"),e=require("clsx"),i=require("framer-motion"),t=require("../button/Button.js"),s=require("../flex/Flex.js"),r=require("../../icons/CheckCircleIcon.js"),m=require("../../icons/InfoIcon.js"),_=require("../../icons/RemoveCircleIcon.js"),l=require("../../icons/RemoveIcon.js"),u=require("../../icons/WarningIcon.js"),c=require("../../style-inject.es-d4ddeae4.js");function d(o){return o&&o.__esModule?o:{default:o}}require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../../icons/icon-base/_IconBase.js");var T=d(e),g="Amino_Toast-module__aminoToast--Q7M1O",A="Amino_Toast-module__persistentToast--A93HB",f="Amino_Toast-module__dismissButton--HfPB9",v="Amino_Toast-module__aminoSuccessToast--M03g9",h="Amino_Toast-module__aminoErrorToast--8Xban",j="Amino_Toast-module__aminoWarningToast--rFQsd",M="Amino_Toast-module__aminoInfoToast--HSKJi";c.styleInject(".Amino_Toast-module__aminoToast--Q7M1O{background:linear-gradient(90deg,#94969e66 0,#94969e00 50%),var(--amino-gray-1000);border-radius:var(--amino-radius-12);box-shadow:var(--amino-v3-shadow-large);color:var(--amino-gray-0);flex:1;font-weight:500;padding:16px;-webkit-user-select:none;user-select:none;z-index:999999}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__persistentToast--A93HB{cursor:pointer}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__persistentToast--A93HB:hover{transform:scale(.95)}.Amino_Toast-module__aminoToast--Q7M1O .Amino_Toast-module__dismissButton--HfPB9{height:24px}.Amino_Toast-module__aminoToast--Q7M1O svg{color:var(--amino-gray-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O{background:linear-gradient(90deg,#94969e3d 0,#94969e00 50%),var(--amino-gray-50);color:var(--amino-gray-1000)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O svg{color:var(--amino-gray-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9{background:linear-gradient(90deg,#56c76f66 0,#56c76f00 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9 svg{color:var(--amino-green-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9{background:linear-gradient(90deg,#56c76f3d 0,#56c76f00 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9 svg{color:var(--amino-green-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban{background:linear-gradient(90deg,#f95c6766 0,#f95c6700 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban svg{color:var(--amino-red-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban{background:linear-gradient(90deg,#f95c673d 0,#f95c6700 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban svg{color:var(--amino-red-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd{background:linear-gradient(90deg,#f88c5366 0,#f88c5300 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd svg{color:var(--amino-orange-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd{background:linear-gradient(90deg,#f88c533d 0,#f88c5300 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd svg{color:var(--amino-orange-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi{background:linear-gradient(90deg,#5f92f666 0,#5f92f600 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi svg{color:var(--amino-blue-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi{background:linear-gradient(90deg,#5f92f63d 0,#5f92f600 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi svg{color:var(--amino-blue-600)}");exports.Toast=function(e){var c=e.actions,d=e.children,Q=e.direction,b=e.intent,p=e.isPersistent,x=e.onDismiss,y=e.style,O=e.toastKey,I=function(){switch(Q){case"top":return{opacity:0,translateX:0,translateY:-10};case"bottom":return{opacity:0,translateX:0,translateY:10};case"left":return{opacity:0,translateX:-10,translateY:0};default:return{opacity:0,translateX:10,translateY:0}}},q={animate:{opacity:1,translateX:0,translateY:0},exit:I(),initial:I()},k=function(){switch(b){case"success":return{class:v,icon:n.jsx(r.CheckCircleIcon,{})};case"error":return{class:h,icon:n.jsx(_.RemoveCircleIcon,{})};case"warning":return{class:j,icon:n.jsx(u.WarningIcon,{})};case"info":return{class:M,icon:n.jsx(m.InfoIcon,{})};default:return{class:g,icon:n.jsx(m.InfoIcon,{})}}}();return a.createElement(i.motion.div,o.__assign({className:T.default(g,k.class,p&&A),layout:!0,style:o.__assign({},y)},q,{key:O}),n.jsxs(s.Flex,{alignItems:"flex-start",gap:12,justifyContent:"space-between",children:[n.jsxs(s.Flex,{gap:12,children:[n.jsx("div",{children:k.icon}),n.jsx("div",{children:d})]}),n.jsxs(s.Flex,{alignItems:"flex-start",className:"toast-actions",gap:12,children:[c,p&&n.jsx(t.Button,{className:f,icon:n.jsx(l.RemoveIcon,{}),onClick:function(o){return null==x?void 0:x(o)},variant:"plain"})]})]}))};
1
+ "use strict";var o=require("../../_tslib-bd4862e8.js"),a=require("react"),n=require("react/jsx-runtime"),e=require("clsx"),i=require("framer-motion"),t=require("../button/Button.js"),s=require("../flex/Flex.js"),r=require("../../icons/CheckCircleIcon.js"),m=require("../../icons/InfoIcon.js"),_=require("../../icons/RemoveCircleIcon.js"),l=require("../../icons/RemoveIcon.js"),u=require("../../icons/WarningIcon.js"),c=require("../../style-inject.es-d4ddeae4.js");function d(o){return o&&o.__esModule?o:{default:o}}require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../../icons/icon-base/_IconBase.js");var T=d(e),g="Amino_Toast-module__aminoToast--Q7M1O",A="Amino_Toast-module__persistentToast--A93HB",f="Amino_Toast-module__dismissButton--HfPB9",v="Amino_Toast-module__aminoSuccessToast--M03g9",h="Amino_Toast-module__aminoErrorToast--8Xban",j="Amino_Toast-module__aminoWarningToast--rFQsd",M="Amino_Toast-module__aminoInfoToast--HSKJi";c.styleInject(".Amino_Toast-module__aminoToast--Q7M1O{background:linear-gradient(90deg,#94969e66 0,#94969e00 50%),var(--amino-gray-1000);border-radius:var(--amino-radius-12);box-shadow:var(--amino-v3-shadow-large);color:var(--amino-gray-0);flex:1;font-weight:500;line-height:24px;padding:16px;-webkit-user-select:none;user-select:none;z-index:999999}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__persistentToast--A93HB{cursor:pointer}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__persistentToast--A93HB:hover{transform:scale(.95)}.Amino_Toast-module__aminoToast--Q7M1O .Amino_Toast-module__dismissButton--HfPB9{height:24px}.Amino_Toast-module__aminoToast--Q7M1O svg{color:var(--amino-gray-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O{background:linear-gradient(90deg,#94969e3d 0,#94969e00 50%),var(--amino-gray-50);color:var(--amino-gray-1000)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O svg{color:var(--amino-gray-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9{background:linear-gradient(90deg,#56c76f66 0,#56c76f00 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9 svg{color:var(--amino-green-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9{background:linear-gradient(90deg,#56c76f3d 0,#56c76f00 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoSuccessToast--M03g9 svg{color:var(--amino-green-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban{background:linear-gradient(90deg,#f95c6766 0,#f95c6700 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban svg{color:var(--amino-red-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban{background:linear-gradient(90deg,#f95c673d 0,#f95c6700 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoErrorToast--8Xban svg{color:var(--amino-red-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd{background:linear-gradient(90deg,#f88c5366 0,#f88c5300 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd svg{color:var(--amino-orange-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd{background:linear-gradient(90deg,#f88c533d 0,#f88c5300 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoWarningToast--rFQsd svg{color:var(--amino-orange-600)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi{background:linear-gradient(90deg,#5f92f666 0,#5f92f600 50%),var(--amino-gray-1000)}.Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi svg{color:var(--amino-blue-500)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi{background:linear-gradient(90deg,#5f92f63d 0,#5f92f600 50%),var(--amino-gray-50)}[data-theme=night] .Amino_Toast-module__aminoToast--Q7M1O.Amino_Toast-module__aminoInfoToast--HSKJi svg{color:var(--amino-blue-600)}");exports.Toast=function(e){var c=e.actions,d=e.children,p=e.direction,Q=e.intent,b=e.isPersistent,x=e.onDismiss,y=e.style,O=e.toastKey,I=function(){switch(p){case"top":return{opacity:0,translateX:0,translateY:-10};case"bottom":return{opacity:0,translateX:0,translateY:10};case"left":return{opacity:0,translateX:-10,translateY:0};default:return{opacity:0,translateX:10,translateY:0}}},q={animate:{opacity:1,translateX:0,translateY:0},exit:I(),initial:I()},k=function(){switch(Q){case"success":return{class:v,icon:n.jsx(r.CheckCircleIcon,{})};case"error":return{class:h,icon:n.jsx(_.RemoveCircleIcon,{})};case"warning":return{class:j,icon:n.jsx(u.WarningIcon,{})};case"info":return{class:M,icon:n.jsx(m.InfoIcon,{})};default:return{class:g,icon:n.jsx(m.InfoIcon,{})}}}();return a.createElement(i.motion.div,o.__assign({className:T.default(g,k.class,b&&A),layout:!0,style:o.__assign({},y)},q,{key:O}),n.jsxs(s.Flex,{alignItems:"flex-start",gap:12,justifyContent:"space-between",children:[n.jsxs(s.Flex,{gap:12,children:[n.jsx("div",{children:k.icon}),n.jsx("div",{children:d})]}),n.jsxs(s.Flex,{alignItems:"center",className:"toast-actions",gap:12,children:[c,b&&n.jsx(t.Button,{className:f,icon:n.jsx(l.RemoveIcon,{}),onClick:function(o){return null==x?void 0:x(o)},variant:"plain"})]})]}))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.4.20",
3
+ "version": "5.4.22",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",