@trafilea/afrodita-components 7.22.1 → 7.22.2

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,2 +1,2 @@
1
- import{__makeTemplateObject as n,__assign as o}from"tslib";import{jsx as r}from"react/jsx-runtime";import e from"@emotion/styled";import{useTheme as i}from"../../core/theme/Theme.js";import{ComponentSize as t}from"../../types/enums.js";var d,a=function(n){switch(n){case t.Large:return{widthHeight:"4.25rem",margin:"0.938rem"};case t.Medium:return{widthHeight:"2.5rem",margin:"0.625rem"};case t.Small:return{widthHeight:"1.5rem",margin:"0.375rem"}}},l=e.div(d||(d=n(["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"],["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"])),(function(n){return n.backgroundColor}),(function(n){var o,r=n.width,e=n.size;return n.hasText?null!=r?r:"auto":null===(o=a(e))||void 0===o?void 0:o.widthHeight}),(function(n){var o,r=n.size;return null===(o=a(r))||void 0===o?void 0:o.widthHeight}),(function(n){return n.border}),(function(n){var o=n.hasText,r=n.rounded;return o?r?"24px":"0.5rem":r?"50%":"0.5rem"}),(function(n){var o=n.boxShadow;return null!=o?o:"none"}),(function(n){var o,r=n.size;return null===(o=a(r))||void 0===o?void 0:o.margin}),(function(n){return n.hasText?"4px":"0"}),(function(n){return n.hoverBackgroundColor}),(function(n){return n.disabledColor}),(function(n){return n.disabledIconColor})),u=function(n){var e,d,a=n.children,u=n.disabled,c=n.size,s=void 0===c?t.Medium:c,h=n.onClick,b=n.backgroundColor,m=n.dataTestId,g=void 0===m?"Container":m,v=n.hasText,f=void 0!==v&&v,p=n.boxShadow,w=n.rounded,k=void 0===w||w,x=n.width,C=n.border,y=i();return r(l,o({border:C,width:x,className:u?"disabled":"",backgroundColor:null!==(e=null==b?void 0:b.active)&&void 0!==e?e:y.component.button.primary.active.backgroundColor,hoverBackgroundColor:null!==(d=null==b?void 0:b.hover)&&void 0!==d?d:y.component.button.secondary.active.backgroundColor,disabledColor:y.colors.shades[50].color,disabledIconColor:y.colors.shades[200].color,size:s,"data-testid":g,onClick:u?function(){}:h,hasText:f,boxShadow:p,rounded:k},{children:a}),void 0)};export{u as IconButton};
1
+ import{__makeTemplateObject as n,__assign as o}from"tslib";import{jsx as r}from"react/jsx-runtime";import e from"@emotion/styled";import{useTheme as i}from"../../core/theme/Theme.js";import{ComponentSize as t}from"../../types/enums.js";var d,a=function(n){switch(n){case t.Large:return{widthHeight:"4.25rem",margin:"0.938rem"};case t.Medium:return{widthHeight:"2.5rem",margin:"0.625rem"};case t.Small:return{widthHeight:"1.5rem",margin:"0.375rem"}}},l=e.div(d||(d=n(["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: ",";\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"],["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: ",";\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"])),(function(n){return n.backgroundColor}),(function(n){var o,r=n.width,e=n.size;return n.hasText?null!=r?r:"auto":null===(o=a(e))||void 0===o?void 0:o.widthHeight}),(function(n){var o,r=n.size;return null===(o=a(r))||void 0===o?void 0:o.widthHeight}),(function(n){return n.border}),(function(n){var o=n.hasText,r=n.rounded;return o?r?"24px":"0.5rem":r?"50%":"0.5rem"}),(function(n){return n.inline?"inline-flex":"flex"}),(function(n){var o=n.boxShadow;return null!=o?o:"none"}),(function(n){var o,r=n.size;return null===(o=a(r))||void 0===o?void 0:o.margin}),(function(n){return n.hasText?"4px":"0"}),(function(n){return n.hoverBackgroundColor}),(function(n){return n.disabledColor}),(function(n){return n.disabledIconColor})),u=function(n){var e,d,a=n.children,u=n.disabled,c=n.size,s=void 0===c?t.Medium:c,h=n.onClick,b=n.backgroundColor,m=n.dataTestId,g=void 0===m?"Container":m,v=n.hasText,f=void 0!==v&&v,p=n.boxShadow,w=n.rounded,k=void 0===w||w,x=n.width,C=n.border,y=n.inline,T=void 0!==y&&y,j=i();return r(l,o({border:C,width:x,className:u?"disabled":"",backgroundColor:null!==(e=null==b?void 0:b.active)&&void 0!==e?e:j.component.button.primary.active.backgroundColor,hoverBackgroundColor:null!==(d=null==b?void 0:b.hover)&&void 0!==d?d:j.component.button.secondary.active.backgroundColor,disabledColor:j.colors.shades[50].color,disabledIconColor:j.colors.shades[200].color,size:s,"data-testid":g,onClick:u?function(){}:h,hasText:f,boxShadow:p,rounded:k,inline:T},{children:a}),void 0)};export{u as IconButton};
2
2
  //# sourceMappingURL=IconButton.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__makeTemplateObject as n}from"tslib";import{jsx as t}from"@emotion/react/jsx-runtime";import{css as o}from"@emotion/react";import{useTheme as r}from"../../core/theme/Theme.js";import{ComponentSize as i}from"../../types/enums.js";import s from"../shared/button/BaseButton.js";var a,c=function(n,t){var o=function(e){switch(e){case i.Large:case i.Medium:return{fontSize:"1rem"};case i.Small:default:return{fontSize:"14px"}}}(t);return e(e({border:"none",background:"transparent",padding:0,color:n.colors.shades[550].color,alignItems:"center",fontFamily:n.fonts.config[0].family,lineHeight:n.component.textButton.lineHeight,fontWeight:n.component.textButton.fontWeight,textDecorationLine:"underline"},o),{"&:disabled":{color:n.colors.shades[250].color,textDecorationLine:"none"}})},l=function(r,i,s){return s&&t("span",e({css:o(a||(a=n(["\n display: flex;\n align-items: center;\n ","\n "],["\n display: flex;\n align-items: center;\n ","\n "])),i?"margin-right: 5px":"margin-left: 5px")},{children:t(s,{width:1.25,height:1.25,fill:r},void 0)}),void 0)},d=function(n){var o=n.text,a=n.LeadingIcon,d=n.TrailingIcon,m=n.iconColor,f=n.disabled,u=n.type,p=n.size,g=void 0===p?i.Medium:p,h=n.uppercase,x=void 0===h||h,v=n.onClick,b=n.testId,y=n.htmlContent,I=r(),L=function(e,n,t){return n?e.colors.shades[250].color:t||e.colors.shades[550].color}(I,f,m),j=l(L,!0,a),B=l(L,!1,d);return t(s,e({renderLeading:j,renderTrailing:B,disabled:f,type:u,onClick:v,css:c(I,g),uppercase:x,testId:b},{children:y||o}),void 0)};export{d as default};
1
+ import{__assign as e,__makeTemplateObject as n}from"tslib";import{jsx as t}from"@emotion/react/jsx-runtime";import{css as o}from"@emotion/react";import{useTheme as i}from"../../core/theme/Theme.js";import{ComponentSize as r}from"../../types/enums.js";import s from"../shared/button/BaseButton.js";var a,l=function(n,t){var o=function(e){switch(e){case r.Large:case r.Medium:return{fontSize:"1rem"};case r.Small:return{fontSize:"14px"};case r.XSmall:return{fontSize:"12px"};default:return{fontSize:"14px"}}}(t);return e(e({border:"none",background:"transparent",padding:0,color:n.colors.shades[550].color,alignItems:"center",fontFamily:n.fonts.config[0].family,lineHeight:n.component.textButton.lineHeight,fontWeight:n.component.textButton.fontWeight,textDecorationLine:"underline"},o),{"&:disabled":{color:n.colors.shades[250].color,textDecorationLine:"none"}})},c=function(i,r,s){return s&&t("span",e({css:o(a||(a=n(["\n display: flex;\n align-items: center;\n ","\n "],["\n display: flex;\n align-items: center;\n ","\n "])),r?"margin-right: 5px":"margin-left: 5px")},{children:t(s,{width:1.25,height:1.25,fill:i},void 0)}),void 0)},d=function(n){var o=n.text,a=n.LeadingIcon,d=n.TrailingIcon,m=n.iconColor,f=n.disabled,u=n.type,p=n.size,g=void 0===p?r.Medium:p,h=n.uppercase,x=void 0===h||h,v=n.onClick,b=n.testId,y=n.htmlContent,S=n.inline,z=void 0!==S&&S,I=i(),L=function(e,n,t){return n?e.colors.shades[250].color:t||e.colors.shades[550].color}(I,f,m),j=c(L,!0,a),B=c(L,!1,d);return t(s,e({renderLeading:j,renderTrailing:B,disabled:f,type:u,onClick:v,css:l(I,g),inline:z,uppercase:x,testId:b},{children:y||o}),void 0)};export{d as default};
2
2
  //# sourceMappingURL=TextButton.js.map
package/build/index.d.ts CHANGED
@@ -3498,6 +3498,7 @@ interface IconButtonProps {
3498
3498
  rounded?: boolean;
3499
3499
  width?: string;
3500
3500
  border?: string;
3501
+ inline?: boolean;
3501
3502
  }
3502
3503
  declare const IconButton: FC<IconButtonProps>;
3503
3504
 
@@ -4160,8 +4161,9 @@ interface TextButtonProps$1 extends BaseProps {
4160
4161
  size?: ComponentSize;
4161
4162
  uppercase?: boolean;
4162
4163
  htmlContent?: JSX.Element;
4164
+ inline?: boolean;
4163
4165
  }
4164
- declare const TextButton: ({ text, LeadingIcon, TrailingIcon, iconColor, disabled, type, size, uppercase, onClick, testId, htmlContent, }: TextButtonProps$1) => _emotion_react_jsx_runtime.JSX.Element;
4166
+ declare const TextButton: ({ text, LeadingIcon, TrailingIcon, iconColor, disabled, type, size, uppercase, onClick, testId, htmlContent, inline, }: TextButtonProps$1) => _emotion_react_jsx_runtime.JSX.Element;
4165
4167
 
4166
4168
  declare const Text: ({ variant, children, testId, asSpan, ...allProps }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
4167
4169
  declare type TextHeroProps = {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),o=require("react/jsx-runtime"),e=require("@emotion/styled"),r=require("../../core/theme/Theme.js"),t=require("../../types/enums.js");function i(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var d,a=function(n){switch(n){case t.ComponentSize.Large:return{widthHeight:"4.25rem",margin:"0.938rem"};case t.ComponentSize.Medium:return{widthHeight:"2.5rem",margin:"0.625rem"};case t.ComponentSize.Small:return{widthHeight:"1.5rem",margin:"0.375rem"}}},u=i(e).default.div(d||(d=n.__makeTemplateObject(["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"],["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"])),(function(n){return n.backgroundColor}),(function(n){var o,e=n.width,r=n.size;return n.hasText?null!=e?e:"auto":null===(o=a(r))||void 0===o?void 0:o.widthHeight}),(function(n){var o,e=n.size;return null===(o=a(e))||void 0===o?void 0:o.widthHeight}),(function(n){return n.border}),(function(n){var o=n.hasText,e=n.rounded;return o?e?"24px":"0.5rem":e?"50%":"0.5rem"}),(function(n){var o=n.boxShadow;return null!=o?o:"none"}),(function(n){var o,e=n.size;return null===(o=a(e))||void 0===o?void 0:o.margin}),(function(n){return n.hasText?"4px":"0"}),(function(n){return n.hoverBackgroundColor}),(function(n){return n.disabledColor}),(function(n){return n.disabledIconColor}));exports.IconButton=function(e){var i,d,a=e.children,l=e.disabled,c=e.size,s=void 0===c?t.ComponentSize.Medium:c,h=e.onClick,b=e.backgroundColor,g=e.dataTestId,v=void 0===g?"Container":g,m=e.hasText,f=void 0!==m&&m,p=e.boxShadow,k=e.rounded,w=void 0===k||k,x=e.width,C=e.border,y=r.useTheme();return o.jsx(u,n.__assign({border:C,width:x,className:l?"disabled":"",backgroundColor:null!==(i=null==b?void 0:b.active)&&void 0!==i?i:y.component.button.primary.active.backgroundColor,hoverBackgroundColor:null!==(d=null==b?void 0:b.hover)&&void 0!==d?d:y.component.button.secondary.active.backgroundColor,disabledColor:y.colors.shades[50].color,disabledIconColor:y.colors.shades[200].color,size:s,"data-testid":v,onClick:l?function(){}:h,hasText:f,boxShadow:p,rounded:w},{children:a}),void 0)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),o=require("react/jsx-runtime"),e=require("@emotion/styled"),r=require("../../core/theme/Theme.js"),i=require("../../types/enums.js");function t(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var d,a=function(n){switch(n){case i.ComponentSize.Large:return{widthHeight:"4.25rem",margin:"0.938rem"};case i.ComponentSize.Medium:return{widthHeight:"2.5rem",margin:"0.625rem"};case i.ComponentSize.Small:return{widthHeight:"1.5rem",margin:"0.375rem"}}},u=t(e).default.div(d||(d=n.__makeTemplateObject(["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: ",";\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"],["\n background-color: ",";\n width: ",";\n height: ",";\n border: ",";\n border-radius: ",";\n display: ",";\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n box-shadow: ",";\n padding: ",";\n gap: ",";\n\n &:hover {\n background-color: ",";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ",";\n cursor: not-allowed;\n\n svg path {\n fill: ",";\n }\n }\n"])),(function(n){return n.backgroundColor}),(function(n){var o,e=n.width,r=n.size;return n.hasText?null!=e?e:"auto":null===(o=a(r))||void 0===o?void 0:o.widthHeight}),(function(n){var o,e=n.size;return null===(o=a(e))||void 0===o?void 0:o.widthHeight}),(function(n){return n.border}),(function(n){var o=n.hasText,e=n.rounded;return o?e?"24px":"0.5rem":e?"50%":"0.5rem"}),(function(n){return n.inline?"inline-flex":"flex"}),(function(n){var o=n.boxShadow;return null!=o?o:"none"}),(function(n){var o,e=n.size;return null===(o=a(e))||void 0===o?void 0:o.margin}),(function(n){return n.hasText?"4px":"0"}),(function(n){return n.hoverBackgroundColor}),(function(n){return n.disabledColor}),(function(n){return n.disabledIconColor}));exports.IconButton=function(e){var t,d,a=e.children,l=e.disabled,c=e.size,s=void 0===c?i.ComponentSize.Medium:c,h=e.onClick,b=e.backgroundColor,g=e.dataTestId,v=void 0===g?"Container":g,m=e.hasText,f=void 0!==m&&m,p=e.boxShadow,k=e.rounded,w=void 0===k||k,x=e.width,C=e.border,y=e.inline,j=void 0!==y&&y,z=r.useTheme();return o.jsx(u,n.__assign({border:C,width:x,className:l?"disabled":"",backgroundColor:null!==(t=null==b?void 0:b.active)&&void 0!==t?t:z.component.button.primary.active.backgroundColor,hoverBackgroundColor:null!==(d=null==b?void 0:b.hover)&&void 0!==d?d:z.component.button.secondary.active.backgroundColor,disabledColor:z.colors.shades[50].color,disabledIconColor:z.colors.shades[200].color,size:s,"data-testid":v,onClick:l?function(){}:h,hasText:f,boxShadow:p,rounded:w,inline:j},{children:a}),void 0)};
2
2
  //# sourceMappingURL=IconButton.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var e,n=require("tslib"),t=require("@emotion/react/jsx-runtime"),i=require("@emotion/react"),o=require("../../core/theme/Theme.js"),r=require("../../types/enums.js"),s=require("../shared/button/BaseButton.js"),a=function(e,t){var i=function(e){switch(e){case r.ComponentSize.Large:case r.ComponentSize.Medium:return{fontSize:"1rem"};case r.ComponentSize.Small:default:return{fontSize:"14px"}}}(t);return n.__assign(n.__assign({border:"none",background:"transparent",padding:0,color:e.colors.shades[550].color,alignItems:"center",fontFamily:e.fonts.config[0].family,lineHeight:e.component.textButton.lineHeight,fontWeight:e.component.textButton.fontWeight,textDecorationLine:"underline"},i),{"&:disabled":{color:e.colors.shades[250].color,textDecorationLine:"none"}})},c=function(o,r,s){return s&&t.jsx("span",n.__assign({css:i.css(e||(e=n.__makeTemplateObject(["\n display: flex;\n align-items: center;\n ","\n "],["\n display: flex;\n align-items: center;\n ","\n "])),r?"margin-right: 5px":"margin-left: 5px")},{children:t.jsx(s,{width:1.25,height:1.25,fill:o},void 0)}),void 0)};module.exports=function(e){var i=e.text,l=e.LeadingIcon,d=e.TrailingIcon,u=e.iconColor,m=e.disabled,g=e.type,p=e.size,h=void 0===p?r.ComponentSize.Medium:p,f=e.uppercase,x=void 0===f||f,_=e.onClick,b=e.testId,j=e.htmlContent,v=o.useTheme(),C=function(e,n,t){return n?e.colors.shades[250].color:t||e.colors.shades[550].color}(v,m,u),y=c(C,!0,l),z=c(C,!1,d);return t.jsx(s,n.__assign({renderLeading:y,renderTrailing:z,disabled:m,type:g,onClick:_,css:a(v,h),uppercase:x,testId:b},{children:j||i}),void 0)};
1
+ "use strict";var e,n=require("tslib"),t=require("@emotion/react/jsx-runtime"),i=require("@emotion/react"),o=require("../../core/theme/Theme.js"),r=require("../../types/enums.js"),s=require("../shared/button/BaseButton.js"),a=function(e,t){var i=function(e){switch(e){case r.ComponentSize.Large:case r.ComponentSize.Medium:return{fontSize:"1rem"};case r.ComponentSize.Small:return{fontSize:"14px"};case r.ComponentSize.XSmall:return{fontSize:"12px"};default:return{fontSize:"14px"}}}(t);return n.__assign(n.__assign({border:"none",background:"transparent",padding:0,color:e.colors.shades[550].color,alignItems:"center",fontFamily:e.fonts.config[0].family,lineHeight:e.component.textButton.lineHeight,fontWeight:e.component.textButton.fontWeight,textDecorationLine:"underline"},i),{"&:disabled":{color:e.colors.shades[250].color,textDecorationLine:"none"}})},c=function(o,r,s){return s&&t.jsx("span",n.__assign({css:i.css(e||(e=n.__makeTemplateObject(["\n display: flex;\n align-items: center;\n ","\n "],["\n display: flex;\n align-items: center;\n ","\n "])),r?"margin-right: 5px":"margin-left: 5px")},{children:t.jsx(s,{width:1.25,height:1.25,fill:o},void 0)}),void 0)};module.exports=function(e){var i=e.text,l=e.LeadingIcon,d=e.TrailingIcon,u=e.iconColor,m=e.disabled,p=e.type,g=e.size,f=void 0===g?r.ComponentSize.Medium:g,h=e.uppercase,x=void 0===h||h,S=e.onClick,z=e.testId,_=e.htmlContent,v=e.inline,C=void 0!==v&&v,b=o.useTheme(),j=function(e,n,t){return n?e.colors.shades[250].color:t||e.colors.shades[550].color}(b,m,u),y=c(j,!0,l),q=c(j,!1,d);return t.jsx(s,n.__assign({renderLeading:y,renderTrailing:q,disabled:m,type:p,onClick:S,css:a(b,f),inline:C,uppercase:x,testId:z},{children:_||i}),void 0)};
2
2
  //# sourceMappingURL=TextButton.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Trafilea's Design System",
4
4
  "author": "Trafilea",
5
5
  "repository": "https://github.com/trafilea/afrodita-components",
6
- "version": "7.22.1",
6
+ "version": "7.22.2",
7
7
  "private": false,
8
8
  "main": "build/lib/index.js",
9
9
  "style": "build/es/index.css",