@zonos/amino 5.4.14 → 5.4.16

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.
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import type { GroupBase, Props, PropsValue, SelectComponentsConfig, StylesConfig } from 'react-select';
3
3
  import type { HelpTextProps } from "../help-text/HelpText";
4
4
  import type { BaseProps } from "../../types/BaseProps";
5
- import type { SelectOption } from "../../types/SelectOption";
5
+ import type { SelectOption, SelectValue } from "../../types/SelectOption";
6
6
  type RequiredProps = 'onChange' | 'options' | 'value';
7
7
  export type MultiSelectProps<Option extends SelectOption = SelectOption, IsMulti extends true = true, Group extends GroupBase<Option> = GroupBase<Option>> = BaseProps & {
8
8
  components?: SelectComponentsConfig<Option, IsMulti, Group>;
@@ -23,5 +23,5 @@ export type GroupOption<Option extends SelectOption> = {
23
23
  isSelected: false;
24
24
  type: 'option';
25
25
  } & SelectOption;
26
- export declare const MultiSelect: <Option extends SelectOption, Group extends GroupBase<Option>>({ closeMenuOnSelect, hideSelectedOptions, ...props }: MultiSelectProps<Option, true, Group>) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const MultiSelect: <V extends SelectValue, Option extends SelectOption<V>, Group extends GroupBase<Option>>({ closeMenuOnSelect, hideSelectedOptions, ...props }: MultiSelectProps<Option, true, Group>) => import("react/jsx-runtime").JSX.Element;
27
27
  export {};
@@ -2,7 +2,7 @@ import { type ReactNode } from 'react';
2
2
  import type { GroupBase, OptionProps, Props, SelectComponentsConfig, StylesConfig } from 'react-select';
3
3
  import { type HelpTextProps } from "../help-text/HelpText";
4
4
  import type { BaseProps } from "../../types/BaseProps";
5
- import type { SelectOption } from "../../types/SelectOption";
5
+ import type { SelectOption, SelectValue } from "../../types/SelectOption";
6
6
  import type { Size } from "../../types/Size";
7
7
  type AdditionalProps<Value> = {
8
8
  hasGroups?: boolean;
@@ -12,11 +12,11 @@ type AdditionalProps<Value> = {
12
12
  customOption?: (value: Value) => ReactNode;
13
13
  };
14
14
  export declare const CheckboxOptionComponent: <Option extends SelectOption, IsMulti extends boolean, Group extends GroupBase<Option>>(props: OptionProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
15
- export type StyledReactSelectProps<Option extends SelectOption, IsMulti extends boolean, Group extends GroupBase<Option>> = {
15
+ export type StyledReactSelectProps<V extends SelectValue, Option extends SelectOption<V>, IsMulti extends boolean, Group extends GroupBase<Option>> = {
16
16
  closeOnOutsideScroll?: boolean;
17
17
  components?: SelectComponentsConfig<Option, IsMulti, Group>;
18
18
  size?: Size;
19
19
  styles?: StylesConfig<Option, IsMulti, Group>;
20
20
  } & Props<Option, IsMulti, Group> & HelpTextProps & AdditionalProps<Option['value']> & BaseProps;
21
- export declare const StyledReactSelect: <Option extends SelectOption, IsMulti extends boolean, Group extends GroupBase<Option>>({ closeOnOutsideScroll, components, customOption, error, hasGroups, helpText, icon, label, menuPosition, placeholder, size, style, ...props }: StyledReactSelectProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const StyledReactSelect: <V extends SelectValue, Option extends SelectOption<V>, IsMulti extends boolean, Group extends GroupBase<Option>>({ closeOnOutsideScroll, components, customOption, error, hasGroups, helpText, icon, label, menuPosition, placeholder, size, style, ...props }: StyledReactSelectProps<V, Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
22
22
  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 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("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var m=s(t),c=s(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"}};exports.SimpleTable=function(i){var r=i.className,s=i.CustomLinkComponent,f=i.getRowLink,j=i.headers,k=i.items,w=i.keyExtractor,A=i.loading,C=void 0!==A&&A,Y=i.loadingItems,q=void 0===Y?10:Y,Q=i.loadingSkeletonHeight,N=void 0===Q?13:Q,H=i.maxHeight,W=void 0===H?"100%":H,R=i.noHoverBackground,L=void 0!==R&&R,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=m.default.Children.toArray(i).some((function(e){return!!m.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(f&&!X.anySelected&&!e.disabledLink){var _=s||"a";return l.jsx("td",{className:a,style:n,children:l.jsx(d.Tooltip,{disabled:"truncate"!==e.textWrapMethod,placement:b,subtitle:i,children:l.jsx(_,{className:r,href:f(t),style:u,children:i})})})}return l.jsx("td",{className:a,style:n,children:l.jsx(d.Tooltip,{disabled:"truncate"!==e.textWrapMethod,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:W},z),children:l.jsxs("table",{className:b,children:[l.jsxs("colgroup",{children:[!!X.onHeaderCheckboxChange&&l.jsx("col",{width:0}),j.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:!C&&X.headerCheckboxValue||!1,className:g,disabled:C,onChange:X.onHeaderCheckboxChange})}),j.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:C?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:N},e)})}),j.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:N,style:{width:"50%"}},e)})},t.key)}))]},e)})):k.map((function(e,i){var a,n,d,r=!!F||!!X.anySelected&&!!X.onRowCheckboxChange;return l.jsxs("tr",{className:c.default(r&&p,!L&&_),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)}})}),j.map((function(i){return l.jsx(t.Fragment,{children:E(i,e)},i.key)}))]},w(e))}))}),M]})})};
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]})})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.4.14",
3
+ "version": "5.4.16",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",