@zonos/amino 5.1.90 → 5.1.92

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.
@@ -1,8 +1,9 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { BaseProps } from "../../types/BaseProps";
2
3
  export type RadioProps = BaseProps & {
3
4
  checked: boolean;
4
5
  disabled?: boolean;
5
- label?: string;
6
+ label?: ReactNode;
6
7
  onChange: (checked: boolean) => void;
7
8
  };
8
9
  export declare const Radio: ({ checked, className, disabled, label, onChange, style, }: RadioProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
+ import { type ReactNode } from 'react';
1
2
  import type { BaseProps } from "../../types/BaseProps";
2
3
  export type RadioGroupItem<T extends string = string> = {
3
- label: string;
4
+ label: ReactNode;
4
5
  value: T;
5
6
  };
6
7
  export type RadioGroupProps<T extends string = string> = BaseProps & {
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-bd4862e8.js"),r=require("react/jsx-runtime"),i=require("react"),a=require("clsx"),t=require("./Radio.js"),n=require("../../style-inject.es-d4ddeae4.js");function u(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../text/Text.js"),require("../../styles/constants/theme.js");var s=u(a),l="Amino_RadioGroup-module__radioContainer--gii0d";n.styleInject(".Amino_RadioGroup-module__radioContainer--gii0d{display:flex;gap:var(--amino-space-8)}");exports.RadioGroup=function(a){var n=a.className,u=a.disabled,o=a.initialValue,d=a.items,c=a.onChange,f=a.style,m=e.__read(i.useState(-1),2),_=m[0],j=m[1],q=d.findIndex((function(e){return e.value===o}));i.useEffect((function(){q>-1&&j(q)}),[q]);var v=d.map((function(e,i){return r.jsx(t.Radio,{checked:i===_,disabled:u,label:e.label,onChange:function(){u||(j(i),c&&e.value&&c(e.value))}},e.label)}));return r.jsx("div",{className:s.default(n,l),style:f,children:v})};
1
+ "use strict";var e=require("../../_tslib-bd4862e8.js"),r=require("react/jsx-runtime"),i=require("react"),a=require("clsx"),t=require("./Radio.js"),n=require("../../style-inject.es-d4ddeae4.js");function u(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../text/Text.js"),require("../../styles/constants/theme.js");var s=u(a),o="Amino_RadioGroup-module__radioContainer--gii0d";n.styleInject(".Amino_RadioGroup-module__radioContainer--gii0d{display:flex;gap:var(--amino-space-8)}");exports.RadioGroup=function(a){var n=a.className,u=a.disabled,l=a.initialValue,d=a.items,c=a.onChange,f=a.style,m=e.__read(i.useState(-1),2),_=m[0],j=m[1],v=d.findIndex((function(e){return e.value===l}));i.useEffect((function(){v>-1&&j(v)}),[v]);var q=d.map((function(e,i){return r.jsx(t.Radio,{checked:i===_,disabled:u,label:e.label,onChange:function(){u||(j(i),c&&e.value&&c(e.value))}},e.value)}));return r.jsx("div",{className:s.default(n,o),style:f,children:q})};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("clsx"),t=require("./_SectionHeader.js"),s=require("./_SectionInnerWrapper.js"),i=require("./_SectionSubheader.js"),n=require("../stack/HStack.js"),c=require("../../style-inject.es-d4ddeae4.js");function a(e){return e&&e.__esModule?e:{default:e}}require("../text/Text.js"),require("../../_tslib-bd4862e8.js"),require("../../styles/constants/theme.js"),require("../stack/Stack.js");var l=a(r),u="Amino_VSection-module__styledSectionWrapper--jKcx5";c.styleInject(".Amino_VSection-module__styledSectionWrapper--jKcx5{margin-bottom:40px}");exports.VSection=function(r){var c=r.actions,a=r.children,o=r.className,d=r.label,j=r.style,S=r.sublabel,x=void 0===S?"":S;return e.jsxs("div",{className:l.default(o,u),style:j,children:[d&&e.jsxs(s.SectionInnerWrapper,{children:[e.jsxs(t.SectionHeader,{children:[d,e.jsx(i.SectionSubheader,{children:x})]}),e.jsx(n.HStack,{spacing:8,children:c})]}),e.jsx("div",{children:a})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("clsx"),t=require("./_SectionHeader.js"),s=require("./_SectionInnerWrapper.js"),i=require("./_SectionSubheader.js"),n=require("../stack/HStack.js"),c=require("../../style-inject.es-d4ddeae4.js");function a(e){return e&&e.__esModule?e:{default:e}}require("../text/Text.js"),require("../../_tslib-bd4862e8.js"),require("../../styles/constants/theme.js"),require("../stack/Stack.js");var l=a(r),o="Amino_VSection-module__styledSectionWrapper--jKcx5";c.styleInject(".Amino_VSection-module__styledSectionWrapper--jKcx5{margin-bottom:40px}");exports.VSection=function(r){var c=r.actions,a=r.children,u=r.className,d=r.label,j=r.style,S=r.sublabel,x=void 0===S?"":S;return e.jsxs("div",{className:l.default(u,o),style:j,children:[d&&e.jsxs(s.SectionInnerWrapper,{children:[e.jsxs("div",{children:["string"==typeof d?e.jsx(t.SectionHeader,{children:d}):d,"string"==typeof x?e.jsx(i.SectionSubheader,{children:x}):x]}),e.jsx(n.HStack,{spacing:8,children:c})]}),e.jsx("div",{children:a})]})};
@@ -22,7 +22,7 @@ export type SimpleTableHeader<T extends object> = {
22
22
  /** The key for each record that the header corresponds to */
23
23
  key: Key;
24
24
  /** null means don't show a header for this column */
25
- name: string | null;
25
+ name: ReactNode | null;
26
26
  renderCustom?: (value: T[Key], item: T) => React.ReactNode;
27
27
  } & SimpleTableHeaderBaseProps;
28
28
  }[keyof T extends React.Key ? keyof T : never];
@@ -1 +1 @@
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"),n=require("../skeleton/Skeleton.js"),d=require("../text/Text.js"),a=require("../../style-inject.es-d4ddeae4.js");function r(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("../../utils/getTestId.js");var m=r(i),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",_="Amino_SimpleTable-module__withHover--eL3XX",b="Amino_SimpleTable-module__clickable--XnaaE",u="Amino_SimpleTable-module__loading--bvjof",h="Amino_SimpleTable-module__cellLink--jySVK",S="Amino_SimpleTable-module__styledCheckbox---753a";a.styleInject(".Amino_SimpleTable-module__tableStyled--Q3YSy{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:uppercase}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border);height:56px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{padding:16px;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{border-bottom:var(--amino-border);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-gray-50)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .Amino_SimpleTable-module__row-hover-show--wkowE{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td{padding:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td:not(:hover) .Amino_SimpleTable-module__cell-hover-show--fenGT{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a{display:block;height:100%;padding:12px;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}");exports.SimpleTable=function(i){var a=i.className,r=i.getRowLink,y=i.headers,p=i.items,x=i.keyExtractor,g=i.loading,k=void 0!==g&&g,j=i.loadingItems,v=void 0===j?10:j,A=i.noHoverBackground,T=void 0!==A&&A,C=i.onRowClick,f=i.onRowHover,w=i.renderFooter,Y=i.selectable,Q=void 0===Y?{enabled:!1}:Y,q=i.style,N=function(e,o){var i=o[e.key],t=function(i){return r&&!Q.anySelected?l.jsx("td",{className:h,children:l.jsx("a",{className:m.default(e.noPadding&&c),href:r(o),style:{textAlign:e.align||"start"},children:i})}):l.jsx("td",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},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.jsxs("table",{className:m.default(a,s),style:q,children:[l.jsxs("colgroup",{children:[!!Q.onHeaderCheckboxChange&&l.jsx("col",{width:0}),y.map((function(e){return l.jsx("col",{width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)}))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!Q.onHeaderCheckboxChange&&l.jsx("th",{className:c,children:Q.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!k&&Q.headerCheckboxValue||!1,className:S,disabled:k,onChange:Q.onHeaderCheckboxChange})}),y.map((function(e){return l.jsx("th",{style:{textAlign:e.align||"start"},children:l.jsx(d.Text,{color:"gray800",type:"small-header",children:e.name})},e.key)}))]})}),l.jsx("tbody",{children:k?e.__spreadArray([],e.__read(Array(v).keys()),!1).map((function(e){return l.jsxs("tr",{children:[Q.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:30},e)}),y.map((function(o){return l.jsx("td",{className:m.default(u,o.noPadding&&c),children:l.jsx(n.Skeleton,{height:30},e)},o.key)}))]},e)})):p.map((function(e,i){var n,d,a,r=!!C||!!Q.anySelected&&!!Q.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&b,!T&&_),onClick:function(){var l,o,t;Q.anySelected?(null===(l=Q.isRowCheckboxDisabled)||void 0===l?void 0:l.call(Q,e,i))||null===(o=Q.onRowCheckboxChange)||void 0===o||o.call(Q,!(null===(t=Q.isRowChecked)||void 0===t?void 0:t.call(Q,e,i)),e,i):null==C||C(e)},onMouseEnter:function(){return null==f?void 0:f(e)},children:[Q.enabled&&l.jsx("td",{className:c,children:(null===(n=Q.renderCustomRowCheckbox)||void 0===n?void 0:n.call(Q,e,i))||l.jsx(t.Checkbox,{checked:(null===(d=Q.isRowChecked)||void 0===d?void 0:d.call(Q,e,i))||!1,className:S,disabled:(null===(a=Q.isRowCheckboxDisabled)||void 0===a?void 0:a.call(Q,e,i))||!1,onChange:function(l){var o;return null===(o=Q.onRowCheckboxChange)||void 0===o?void 0:o.call(Q,l,e,i)}})}),y.map((function(i){return l.jsx(o.Fragment,{children:N(i,e)},i.key)}))]},x(e))}))}),w]})};
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"),n=require("../skeleton/Skeleton.js"),a=require("../text/Text.js"),d=require("../../style-inject.es-d4ddeae4.js");function r(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("../../utils/getTestId.js");var m=r(i),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",_="Amino_SimpleTable-module__withHover--eL3XX",b="Amino_SimpleTable-module__clickable--XnaaE",u="Amino_SimpleTable-module__loading--bvjof",h="Amino_SimpleTable-module__cellLink--jySVK",S="Amino_SimpleTable-module__styledCheckbox---753a";d.styleInject(".Amino_SimpleTable-module__tableStyled--Q3YSy{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:uppercase}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border);height:56px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{padding:16px;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{border-bottom:var(--amino-border);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-gray-50)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .Amino_SimpleTable-module__row-hover-show--wkowE{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td{padding:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td:not(:hover) .Amino_SimpleTable-module__cell-hover-show--fenGT{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a{display:block;height:100%;padding:12px;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}");exports.SimpleTable=function(i){var d=i.className,r=i.getRowLink,y=i.headers,p=i.items,x=i.keyExtractor,g=i.loading,k=void 0!==g&&g,j=i.loadingItems,v=void 0===j?10:j,A=i.noHoverBackground,T=void 0!==A&&A,C=i.onRowClick,f=i.onRowHover,w=i.renderFooter,Y=i.selectable,Q=void 0===Y?{enabled:!1}:Y,q=i.style,N=function(e,o){var i=o[e.key],t=function(i){return r&&!Q.anySelected?l.jsx("td",{className:h,children:l.jsx("a",{className:m.default(e.noPadding&&c),href:r(o),style:{textAlign:e.align||"start"},children:i})}):l.jsx("td",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},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.jsxs("table",{className:m.default(d,s),style:q,children:[l.jsxs("colgroup",{children:[!!Q.onHeaderCheckboxChange&&l.jsx("col",{width:0}),y.map((function(e){return l.jsx("col",{width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)}))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!Q.onHeaderCheckboxChange&&l.jsx("th",{className:c,children:Q.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!k&&Q.headerCheckboxValue||!1,className:S,disabled:k,onChange:Q.onHeaderCheckboxChange})}),y.map((function(e){return l.jsx("th",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(a.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)}))]})}),l.jsx("tbody",{children:k?e.__spreadArray([],e.__read(Array(v).keys()),!1).map((function(e){return l.jsxs("tr",{children:[Q.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:30},e)}),y.map((function(o){return l.jsx("td",{className:m.default(u,o.noPadding&&c),children:l.jsx(n.Skeleton,{height:30},e)},o.key)}))]},e)})):p.map((function(e,i){var n,a,d,r=!!C||!!Q.anySelected&&!!Q.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&b,!T&&_),onClick:function(){var l,o,t;Q.anySelected?(null===(l=Q.isRowCheckboxDisabled)||void 0===l?void 0:l.call(Q,e,i))||null===(o=Q.onRowCheckboxChange)||void 0===o||o.call(Q,!(null===(t=Q.isRowChecked)||void 0===t?void 0:t.call(Q,e,i)),e,i):null==C||C(e)},onMouseEnter:function(){return null==f?void 0:f(e)},children:[Q.enabled&&l.jsx("td",{className:c,children:(null===(n=Q.renderCustomRowCheckbox)||void 0===n?void 0:n.call(Q,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=Q.isRowChecked)||void 0===a?void 0:a.call(Q,e,i))||!1,className:S,disabled:(null===(d=Q.isRowCheckboxDisabled)||void 0===d?void 0:d.call(Q,e,i))||!1,onChange:function(l){var o;return null===(o=Q.onRowCheckboxChange)||void 0===o?void 0:o.call(Q,l,e,i)}})}),y.map((function(i){return l.jsx(o.Fragment,{children:N(i,e)},i.key)}))]},x(e))}))}),w]})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.1.90",
3
+ "version": "5.1.92",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",