@zonos/amino 5.3.16 → 5.3.17

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,9 +1,10 @@
1
1
  export type MultiInputProps = {
2
2
  className?: string;
3
+ placeholder?: string;
3
4
  style?: React.CSSProperties;
4
5
  tags: string[];
5
6
  setHasValidationError?: (hasValidationError: boolean) => void;
6
7
  setTags: (tags: string[]) => void;
7
8
  tagValidation?: (tag: string) => boolean;
8
9
  };
9
- export declare const MultiInput: ({ className, setHasValidationError, setTags, style, tags, tagValidation, }: MultiInputProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const MultiInput: ({ className, placeholder, setHasValidationError, setTags, style, tags, tagValidation, }: MultiInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +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
+ "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.placeholder,p=void 0===i?"":i,d=r.setHasValidationError,g=r.setTags,_=r.style,f=r.tags,m=r.tagValidation,h=e.__read(n.useState(""),2),x=h[0],I=h[1],v=n.useRef(null),A=e.__read(n.useState(null),2),j=A[0],y=A[1];n.useEffect((function(){if(d&&m){var e=f.some((function(e){return!m(e)}));d(e)}}),[f,m,d]);var q=function(e){g(f.filter((function(t,n){return n!==e})))};return t.jsxs(u.Flex,{alignItems:"center",className:o.default([a,s]),flexWrap:"wrap",gap:4,style:_,children:[f.map((function(e,n){var r=!(!m||m(e)),a=j===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 y(n)},onClose:function(){return q(n)},size:"lg",children:e})},e)})),t.jsx("input",{ref:v,className:c,onChange:function(e){I(e.target.value)},onFocus:function(){v.current&&(v.current.selectionStart=v.current.value.length,v.current.selectionEnd=v.current.value.length)},onKeyDown:function(t){var n;"Enter"!==t.key&&","!==t.key&&" "!==t.key||!x?"Backspace"===t.key?""===x&&f.length>0&&(null===j?y(f.length-1):(q(j),y(null))):"ArrowLeft"===t.key?null===j&&f.length>0?y(f.length-1):null!==j&&j>0&&y(j-1):"ArrowRight"===t.key&&null!==j&&j<f.length-1?y(j+1):y(null):(t.preventDefault(),(n=x.trim())&&(g(e.__spreadArray(e.__spreadArray([],e.__read(f),!1),[n],!1)),I("")))},placeholder:f.length?"":p,value:x})]})};
@@ -1,4 +1,6 @@
1
1
  export type TextAvatarProps = {
2
+ className?: string;
2
3
  label: string;
4
+ style?: React.CSSProperties;
3
5
  };
4
- export declare const TextAvatar: ({ label }: TextAvatarProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const TextAvatar: ({ className, label, style }: TextAvatarProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";var a=require("react/jsx-runtime"),e=require("../../style-inject.es-d4ddeae4.js"),t="Amino_TextAvatar-module__gradientSquare--XZznH";e.styleInject(".Amino_TextAvatar-module__gradientSquare--XZznH{align-items:center;background:linear-gradient(137deg,var(--amino-text-avatar-gradient-start),var(--amino-text-avatar-gradient-end));border-radius:var(--amino-radius-6);color:var(--amino-gray-0);display:flex;font-weight:500;height:32px;justify-content:center;width:32px}[data-theme=night] .Amino_TextAvatar-module__gradientSquare--XZznH{color:var(--amino-gray-1000)}");var r=function(a,e){var t=Array.from(a).reduce((function(a,e){return e.charCodeAt(0)+((a<<5)-a)}),0);return"hsl(".concat(t%360,", 80%, ").concat(e,"%)")};exports.TextAvatar=function(e){var n,i=e.label;return a.jsx("div",{className:t,style:{"--amino-text-avatar-gradient-end":r(i&&i.split("").reverse().join("")||"default label",40),"--amino-text-avatar-gradient-start":r(i||"default label",45)},children:i&&(null===(n=i[0])||void 0===n?void 0:n.toUpperCase())||"D"})};
1
+ "use strict";var e=require("../../_tslib-bd4862e8.js"),a=require("react/jsx-runtime"),t=require("clsx"),r=require("../../style-inject.es-d4ddeae4.js");function n(e){return e&&e.__esModule?e:{default:e}}var i=n(t),o="Amino_TextAvatar-module__gradientSquare--XZznH";r.styleInject(".Amino_TextAvatar-module__gradientSquare--XZznH{align-items:center;background:linear-gradient(137deg,var(--amino-text-avatar-gradient-start),var(--amino-text-avatar-gradient-end));border-radius:var(--amino-radius-6);color:var(--amino-gray-0);display:flex;font-weight:500;height:32px;justify-content:center;width:32px}[data-theme=night] .Amino_TextAvatar-module__gradientSquare--XZznH{color:var(--amino-gray-1000)}");var s=function(e,a){var t=Array.from(e).reduce((function(e,a){return a.charCodeAt(0)+((e<<5)-e)}),0);return"hsl(".concat(t%360,", 80%, ").concat(a,"%)")};exports.TextAvatar=function(t){var r,n=t.className,l=t.label,d=t.style,u={"--amino-text-avatar-gradient-end":s(l&&l.split("").reverse().join("")||"default label",40),"--amino-text-avatar-gradient-start":s(l||"default label",45)};return a.jsx("div",{className:i.default([o,n]),style:e.__assign(e.__assign({},u),d),children:l&&(null===(r=l[0])||void 0===r?void 0:r.toUpperCase())||"D"})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.3.16",
3
+ "version": "5.3.17",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",