@zonos/amino 5.3.14 → 5.3.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.
- package/all.d.ts +1 -0
- package/components/input/MultiInput.d.ts +9 -0
- package/components/input/MultiInput.js +1 -0
- package/components/simple-table/SimpleTable.d.ts +5 -0
- package/components/simple-table/SimpleTable.js +1 -1
- package/components/tag/Tag.d.ts +6 -3
- package/components/tag/Tag.js +1 -1
- package/package.json +1 -1
package/all.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ import './components/glow/GlowWrapper';
|
|
|
48
48
|
import './components/graph-matrix/GraphMatrix';
|
|
49
49
|
import './components/help-text/HelpText';
|
|
50
50
|
import './components/input/Input';
|
|
51
|
+
import './components/input/MultiInput';
|
|
51
52
|
import './components/input/SearchInput';
|
|
52
53
|
import './components/layout/Layout';
|
|
53
54
|
import './components/layout/NavigationGroup';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type MultiInputProps = {
|
|
2
|
+
className?: string;
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
tags: string[];
|
|
5
|
+
setHasValidationError?: (hasValidationError: boolean) => void;
|
|
6
|
+
setTags: (tags: string[]) => void;
|
|
7
|
+
tagValidation?: (tag: string) => boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const MultiInput: ({ className, setHasValidationError, setTags, style, tags, tagValidation, }: MultiInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("clsx"),u=require("../flex/Flex.js"),l=require("../tag/Tag.js"),a=require("../../style-inject.es-d4ddeae4.js");function i(e){return e&&e.__esModule?e:{default:e}}require("../../icons/RemoveIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js");var o=i(r),s="Amino_MultiInput-module__tagInputWrapper--FTdAL",c="Amino_MultiInput-module__tagInput--cBsz8";a.styleInject(".Amino_MultiInput-module__tagInputWrapper--FTdAL.Amino_MultiInput-module__tagInputWrapper--FTdAL{border:1px solid #ccc;border-radius:4px;overflow-x:auto;padding:5px}.Amino_MultiInput-module__tagInputWrapper--FTdAL.Amino_MultiInput-module__tagInputWrapper--FTdAL .Amino_MultiInput-module__tagInput--cBsz8{border:none;flex:1 1 auto;flex-grow:1;font-size:var(--amino-font-size-base);font-weight:500;min-width:100px;min-width:50px;outline:none;padding:5px}");exports.MultiInput=function(r){var a=r.className,i=r.setHasValidationError,p=r.setTags,d=r.style,g=r.tags,_=r.tagValidation,f=e.__read(n.useState(""),2),m=f[0],h=f[1],x=n.useRef(null),I=e.__read(n.useState(null),2),A=I[0],v=I[1];n.useEffect((function(){if(i&&_){var e=g.some((function(e){return!_(e)}));i(e)}}),[g,_,i]);var j=function(e){p(g.filter((function(t,n){return n!==e})))};return t.jsxs(u.Flex,{alignItems:"center",className:o.default([a,s]),flexWrap:"wrap",gap:4,style:d,children:[g.map((function(e,n){var r=!(!_||_(e)),a=A===n,i=r?"error":"default";return t.jsx(u.Flex,{alignItems:"center",gap:0,children:t.jsx(l.Tag,{highlighted:a,intent:i,onClick:function(){return v(n)},onClose:function(){return j(n)},size:"lg",children:e})},e)})),t.jsx("input",{ref:x,className:c,onChange:function(e){h(e.target.value)},onFocus:function(){x.current&&(x.current.selectionStart=x.current.value.length,x.current.selectionEnd=x.current.value.length)},onKeyDown:function(t){var n;"Enter"!==t.key&&","!==t.key&&" "!==t.key||!m?"Backspace"===t.key?""===m&&g.length>0&&(null===A?v(g.length-1):(j(A),v(null))):"ArrowLeft"===t.key?null===A&&g.length>0?v(g.length-1):null!==A&&A>0&&v(A-1):"ArrowRight"===t.key&&null!==A&&A<g.length-1?v(A+1):v(null):(t.preventDefault(),(n=m.trim())&&(p(e.__spreadArray(e.__spreadArray([],e.__read(g),!1),[n],!1)),h("")))},placeholder:g.length?"":"Enter email",value:m})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),t=require("clsx"),i=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("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getTestId.js");var m=r(t),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),t=require("clsx"),i=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("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getTestId.js");var m=r(t),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",b="Amino_SimpleTable-module__withHover--eL3XX",u="Amino_SimpleTable-module__clickable--XnaaE",_="Amino_SimpleTable-module__loading--bvjof",h="Amino_SimpleTable-module__cellLink--jySVK",y="Amino_SimpleTable-module__styledCheckbox---753a",S="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7";d.styleInject(".Amino_SimpleTable-module__tableStyled--Q3YSy{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{padding:12px;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-subtle);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{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) .cell-hover-show{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}.Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7{display:flex}");var p=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}};exports.SimpleTable=function(t){var d=t.className,r=t.CustomLinkComponent,x=t.getRowLink,g=t.headers,k=t.items,v=t.keyExtractor,j=t.loading,A=void 0!==j&&j,T=t.loadingItems,C=void 0===T?10:T,f=t.loadingSkeletonHeight,w=void 0===f?13:f,Y=t.noHoverBackground,Q=void 0!==Y&&Y,q=t.onRowClick,N=t.onRowHover,R=t.renderFooter,H=t.selectable,L=void 0===H?{enabled:!1}:H,P=t.style,I=function(e,o){var t=o[e.key],i=function(t){if(x&&!L.anySelected&&!e.disabledLink){var i=r||"a";return l.jsx("td",{className:h,children:l.jsx(i,{className:m.default(e.noPadding&&c),href:x(o),style:{textAlign:e.align||"start"},children:t})})}return l.jsx("td",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},children:t})};return e.renderCustom?l.jsx(l.Fragment,{children:i(e.renderCustom(t,o))}):l.jsx(l.Fragment,{children:i(String(t))})};return l.jsxs("table",{className:m.default(d,s),style:P,children:[l.jsxs("colgroup",{children:[!!L.onHeaderCheckboxChange&&l.jsx("col",{width:0}),g.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:[!!L.onHeaderCheckboxChange&&l.jsx("th",{className:c,children:L.renderCustomHeaderCheckbox||l.jsx(i.Checkbox,{checked:!A&&L.headerCheckboxValue||!1,className:y,disabled:A,onChange:L.onHeaderCheckboxChange})}),g.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:A?e.__spreadArray([],e.__read(Array(C).keys()),!1).map((function(e){return l.jsxs("tr",{children:[L.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:w},e)}),g.map((function(o){return l.jsx("td",{className:m.default(_,o.noPadding&&c),children:l.jsx("div",{className:S,style:{justifyContent:p(o.align)},children:l.jsx(n.Skeleton,{height:w,style:{width:"50%"}},e)})},o.key)}))]},e)})):k.map((function(e,t){var n,a,d,r=!!q||!!L.anySelected&&!!L.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&u,!Q&&b),onClick:function(){var l,o,i;L.anySelected?(null===(l=L.isRowCheckboxDisabled)||void 0===l?void 0:l.call(L,e,t))||null===(o=L.onRowCheckboxChange)||void 0===o||o.call(L,!(null===(i=L.isRowChecked)||void 0===i?void 0:i.call(L,e,t)),e,t):null==q||q(e)},onMouseEnter:function(){return null==N?void 0:N(e)},children:[L.enabled&&l.jsx("td",{className:c,children:(null===(n=L.renderCustomRowCheckbox)||void 0===n?void 0:n.call(L,e,t))||l.jsx(i.Checkbox,{checked:(null===(a=L.isRowChecked)||void 0===a?void 0:a.call(L,e,t))||!1,className:y,disabled:(null===(d=L.isRowCheckboxDisabled)||void 0===d?void 0:d.call(L,e,t))||!1,onChange:function(l){var o;return null===(o=L.onRowCheckboxChange)||void 0===o?void 0:o.call(L,l,e,t)}})}),g.map((function(t){return l.jsx(o.Fragment,{children:I(t,e)},t.key)}))]},v(e))}))}),R]})};
|
package/components/tag/Tag.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { BaseProps } from "../../types/BaseProps";
|
|
3
3
|
type TagSize = 'base' | 'lg';
|
|
4
|
-
|
|
4
|
+
type TagIntent = 'default' | 'error';
|
|
5
|
+
export type TagProps = BaseProps & HTMLAttributes<HTMLDivElement> & {
|
|
5
6
|
children?: ReactNode | string;
|
|
7
|
+
highlighted?: boolean;
|
|
6
8
|
icon?: ReactNode;
|
|
7
9
|
iconRight?: boolean;
|
|
10
|
+
intent?: TagIntent;
|
|
8
11
|
size?: TagSize;
|
|
9
12
|
onClick?: () => void;
|
|
10
13
|
onClose: () => void;
|
|
11
14
|
};
|
|
12
|
-
export declare const Tag: ({ children, className, icon, iconRight, onClick, onClose, size, style, }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Tag: ({ children, className, highlighted, icon, iconRight, intent, onClick, onClose, size, style, }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export {};
|
package/components/tag/Tag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),o=require("clsx"),a=require("../../icons/RemoveIcon.js"),i=require("../../style-inject.es-d4ddeae4.js");function r(e){return e&&e.__esModule?e:{default:e}}require("react"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js");var l=r(o),n={tagWrapper:"Amino_Tag-module__tagWrapper--5McNK",base:"Amino_Tag-module__base--z0-9-",highlight:"Amino_Tag-module__highlight--b9lSD",error:"Amino_Tag-module__error--JytAu",styledTagRight:"Amino_Tag-module__styledTagRight--5GHpr",styledTagLeft:"Amino_Tag-module__styledTagLeft--2XXDe",iconRight:"Amino_Tag-module__iconRight--LHvji",styledRemoveBtn:"Amino_Tag-module__styledRemoveBtn--nSh7A"};i.styleInject(".Amino_Tag-module__tagWrapper--5McNK{background-color:var(--amino-gray-50);border:1px solid var(--amino-gray-200);border-radius:var(--amino-radius-6);color:var(--amino-text-color);display:inline-flex}.Amino_Tag-module__tagWrapper--5McNK.Amino_Tag-module__base--z0-9-{height:20px}.Amino_Tag-module__tagWrapper--5McNK.Amino_Tag-module__highlight--b9lSD{background-color:var(--amino-blue-50);border:1px solid var(--amino-blue-600);color:var(--amino-blue-800)}.Amino_Tag-module__tagWrapper--5McNK.Amino_Tag-module__error--JytAu{background-color:var(--amino-red-50);border:1px solid var(--amino-red-200);color:var(--amino-red-800)}.Amino_Tag-module__tagWrapper--5McNK.Amino_Tag-module__error--JytAu.Amino_Tag-module__highlight--b9lSD{border:1px solid var(--amino-red-600)}.Amino_Tag-module__tagWrapper--5McNK:hover,.Amino_Tag-module__tagWrapper--5McNK:hover .Amino_Tag-module__styledTagRight--5GHpr{background-color:var(--amino-gray-100)}.Amino_Tag-module__tagWrapper--5McNK:hover.Amino_Tag-module__highlight--b9lSD,.Amino_Tag-module__tagWrapper--5McNK:hover.Amino_Tag-module__highlight--b9lSD .Amino_Tag-module__styledTagRight--5GHpr{background-color:var(--amino-blue-100)}.Amino_Tag-module__tagWrapper--5McNK:hover.Amino_Tag-module__error--JytAu,.Amino_Tag-module__tagWrapper--5McNK:hover.Amino_Tag-module__error--JytAu .Amino_Tag-module__styledTagRight--5GHpr{background-color:var(--amino-red-100)}.Amino_Tag-module__styledTagLeft--2XXDe{align-items:center;border-radius:var(--amino-radius-6) 0 0 var(--amino-radius-6);display:inline-flex;font-size:var(--amino-font-size-base);font-weight:400;font-weight:500;gap:4px;padding:4px 4px 4px 8px;text-align:center}.Amino_Tag-module__styledTagLeft--2XXDe:focus{outline:none}.Amino_Tag-module__styledTagLeft--2XXDe p{margin:0}.Amino_Tag-module__styledTagLeft--2XXDe.Amino_Tag-module__iconRight--LHvji svg{order:2}.Amino_Tag-module__base--z0-9- .Amino_Tag-module__styledTagLeft--2XXDe{padding:2px 4px}.Amino_Tag-module__styledTagRight--5GHpr{align-items:center;border-radius:var(--amino-radius-6);display:inline-flex;padding:4px 5px}.Amino_Tag-module__base--z0-9- .Amino_Tag-module__styledTagRight--5GHpr{padding:2px 3px}.Amino_Tag-module__styledRemoveBtn--nSh7A{display:flex}");exports.Tag=function(o){var i=o.children,r=o.className,_=o.highlighted,t=void 0!==_&&_,g=o.icon,d=o.iconRight,m=o.intent,s=void 0===m?"default":m,u=o.onClick,c=o.onClose,p=o.size,T=void 0===p?"base":p,h=o.style;return e.jsxs("div",{className:l.default(r,n.tagWrapper,"base"===T&&n.base,"default"!==s?n[s]:"",t&&n.highlight),style:h,children:[e.jsxs("button",{className:l.default(n.styledTagLeft,d&&n.iconRight),onClick:u,type:"button",children:[g,e.jsx("p",{children:i})]}),e.jsx("button",{className:n.styledTagRight,onClick:c,type:"button",children:e.jsx("div",{className:n.styledRemoveBtn,children:e.jsx(a.RemoveIcon,{size:14})})})]})};
|