@mobilestock-native/button 1.1.8 → 1.1.10

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.
Files changed (3) hide show
  1. package/index.d.ts +14 -2
  2. package/index.js +19 -19
  3. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { DefaultTheme } from 'styled-components/native';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ReactElement } from 'react';
4
- import { ClickableProps } from '@mobilestock-native/clickable';
4
+ import { ClickableProps, ClickableStateProps } from '@mobilestock-native/clickable';
5
5
  import { ViewBaseProps } from '@mobilestock-native/container';
6
6
  import { IconName } from '@mobilestock-native/icons';
7
7
  import { TypographyProps } from '@mobilestock-native/typography';
@@ -16,7 +16,19 @@ type TextAlign = 'START' | 'CENTER' | 'END';
16
16
  type NotificationPosition = 'ICON' | 'TEXT' | 'END';
17
17
  type BorderColor = 'AUTO' | BackgroundColor | `#${string}`;
18
18
  type BorderWidth = Uppercase<keyof DefaultTheme['borderWidth'] & string>;
19
- interface ButtonProps extends Omit<ClickableProps, 'children' | 'size'> {
19
+ /**
20
+ * The Clickable now carries the layout props of the Container (CBF-78); the Button keeps its own `backgroundColor`,
21
+ * `borderColor` and `borderWidth`, typed by its palette and resolved by its variants, so those are left out here.
22
+ */
23
+ /**
24
+ * The variants of the Button paint `backgroundColor`, `borderColor` and `borderWidth` through `style`, which wins over
25
+ * the interaction states of the Clickable; those three are left out of `whenHovered` and `whenPressed` so a value
26
+ * there is a type error instead of a silent no-op. Shadows, ring, highlight and bevel still work in those states.
27
+ */
28
+ type ButtonStateProps = Omit<ClickableStateProps, 'backgroundColor' | 'borderColor' | 'borderWidth'>;
29
+ interface ButtonProps extends Omit<ClickableProps, 'children' | 'size' | 'backgroundColor' | 'borderColor' | 'borderWidth' | 'whenHovered' | 'whenPressed'> {
30
+ whenHovered?: ButtonStateProps;
31
+ whenPressed?: ButtonStateProps;
20
32
  text?: string | ReactElement;
21
33
  disabled?: boolean;
22
34
  circular?: boolean;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Co=Object.create;var b=Object.defineProperty,ho=Object.defineProperties,$o=Object.getOwnPropertyDescriptor,yo=Object.getOwnPropertyDescriptors,Ro=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,Bo=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var H=(o,e,t)=>e in o?b(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,K=(o,e)=>{for(var t in e||(e={}))S.call(e,t)&&H(o,t,e[t]);if(N)for(var t of N(e))M.call(e,t)&&H(o,t,e[t]);return o},j=(o,e)=>ho(o,yo(e));var _=(o,e)=>{var t={};for(var i in o)S.call(o,i)&&e.indexOf(i)<0&&(t[i]=o[i]);if(o!=null&&N)for(var i of N(o))e.indexOf(i)<0&&M.call(o,i)&&(t[i]=o[i]);return t};var Eo=(o,e)=>{for(var t in e)b(o,t,{get:e[t],enumerable:!0})},G=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ro(e))!S.call(o,r)&&r!==t&&b(o,r,{get:()=>e[r],enumerable:!(i=$o(e,r))||i.enumerable});return o};var m=(o,e,t)=>(t=o!=null?Co(Bo(o)):{},G(e||!o||!o.__esModule?b(t,"default",{value:o,enumerable:!0}):t,o)),Po=o=>G(b({},"__esModule",{value:!0}),o);var Do={};Eo(Do,{Button:()=>po});module.exports=Po(Do);var co=require("react-native"),C=m(require("styled-components/native")),lo=require("@mobilestock-native/clickable"),E=require("@mobilestock-native/container"),so=m(require("@mobilestock-native/tools")),uo=require("@mobilestock-native/typography");var $=m(require("chroma-js")),l=require("styled-components/native"),n=m(require("@mobilestock-native/tools"));function x(o,e){let t=o.split("_"),i=500;if(t.length>1)switch(t[1]){case"LIGHT":i=400;break;case"DARK":i=600;break}return n.default.getColorWithLuminosity(e.colors.button[t[0].toLowerCase()],i)}function J(o,e,t){if(o==="AUTO"){let i=x(e,t);return(0,$.default)(i).luminance()>.5?(0,$.default)(i).darken(.8).hex():(0,$.default)(i).brighten(.8).hex()}return o.startsWith("#")?o:x(o,t)}function Y(o,e,t,i,r,s){if(o){let d=x(t,i),c={transform:"scale(0.98)"};switch(e){case"DEFAULT":c.backgroundColor=(0,$.default)(d).shade(.25).css();break;case"OUTLINE":{let p=r?J(r,t,i):d,u=s?parseFloat(i.borderWidth[s.toLowerCase()]):void 0;c.borderColor=(0,$.default)(p).shade(.25).css(),u!==void 0&&(c.borderWidth=u);break}}return c}return{}}function L(o){switch(o){case"START":return l.css`
1
+ "use strict";var Co=Object.create;var E=Object.defineProperty,ho=Object.defineProperties,$o=Object.getOwnPropertyDescriptor,yo=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,bo=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var H=(o,e,t)=>e in o?E(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,K=(o,e)=>{for(var t in e||(e={}))A.call(e,t)&&H(o,t,e[t]);if(N)for(var t of N(e))M.call(e,t)&&H(o,t,e[t]);return o},j=(o,e)=>ho(o,yo(e));var _=(o,e)=>{var t={};for(var r in o)A.call(o,r)&&e.indexOf(r)<0&&(t[r]=o[r]);if(o!=null&&N)for(var r of N(o))e.indexOf(r)<0&&M.call(o,r)&&(t[r]=o[r]);return t};var Ro=(o,e)=>{for(var t in e)E(o,t,{get:e[t],enumerable:!0})},G=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Po(e))!A.call(o,i)&&i!==t&&E(o,i,{get:()=>e[i],enumerable:!(r=$o(e,i))||r.enumerable});return o};var m=(o,e,t)=>(t=o!=null?Co(bo(o)):{},G(e||!o||!o.__esModule?E(t,"default",{value:o,enumerable:!0}):t,o)),Bo=o=>G(E({},"__esModule",{value:!0}),o);var Do={};Ro(Do,{Button:()=>po});module.exports=Bo(Do);var co=require("react-native"),C=m(require("styled-components/native")),lo=require("@mobilestock-native/clickable"),R=require("@mobilestock-native/container"),so=m(require("@mobilestock-native/tools")),uo=require("@mobilestock-native/typography");var $=m(require("chroma-js")),l=require("styled-components/native"),n=m(require("@mobilestock-native/tools"));function x(o,e){let t=o.split("_"),r=500;if(t.length>1)switch(t[1]){case"LIGHT":r=400;break;case"DARK":r=600;break}return n.default.getColorWithLuminosity(e.colors.button[t[0].toLowerCase()],r)}function J(o,e,t){if(o==="AUTO"){let r=x(e,t);return(0,$.default)(r).luminance()>.5?(0,$.default)(r).darken(.8).hex():(0,$.default)(r).brighten(.8).hex()}return o.startsWith("#")?o:x(o,t)}function Y(o,e,t,r,i,s){if(o){let d=x(t,r),c={transform:"scale(0.98)"};switch(e){case"DEFAULT":c.backgroundColor=(0,$.default)(d).shade(.25).css();break;case"OUTLINE":{let p=i?J(i,t,r):d,u=s?parseFloat(r.borderWidth[s.toLowerCase()]):void 0;c.borderColor=(0,$.default)(p).shade(.25).css(),u!==void 0&&(c.borderWidth=u);break}}return c}return{}}function w(o){switch(o){case"START":return l.css`
2
2
  justify-content: space-between;
3
3
  `;case"BEFORE-TEXT":return l.css`
4
4
  justify-content: center;
@@ -16,19 +16,19 @@
16
16
  justify-content: center;
17
17
  `;case"END":return l.css`
18
18
  justify-content: flex-end;
19
- `}}function Q(o,e,t,i,r){let s=x(e,t),d=i?J(i,e,t):void 0,c=r?t.borderWidth[r.toLowerCase()]:void 0;switch(o){case"DEFAULT":return l.css`
19
+ `}}function Q(o,e,t,r,i){let s=x(e,t),d=r?J(r,e,t):void 0,c=i?t.borderWidth[i.toLowerCase()]:void 0;switch(o){case"DEFAULT":return l.css`
20
20
  background-color: ${s};
21
21
  ${d?`border: ${c||"2px"} solid ${d};`:""}
22
22
  `;case"OUTLINE":return l.css`
23
23
  border: ${c||"3px"} solid ${d||s};
24
- `;case"LINK":case"TRANSPARENT":return""}}function Z(o,e,t){let i=3;e&&(i=4);let s={"2XS":{padding:`${n.default.calculateRemToPx("0.125rem")} ${n.default.calculateRemToPx("0.5rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+1}px`},XS:{padding:`${n.default.calculateRemToPx("0.25rem")} ${n.default.calculateRemToPx("0.75rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+1}px`},SM:{padding:`${n.default.calculateRemToPx("0.5rem")} ${n.default.calculateRemToPx("1rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+1}px`},MD:{padding:`${n.default.calculateRemToPx("0.75rem")} ${n.default.calculateRemToPx("1.25rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+3}px`},LG:{padding:`${n.default.calculateRemToPx("1rem")} ${n.default.calculateRemToPx("1.75rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+3}px`},XL:{padding:`${n.default.calculateRemToPx("1.25rem")} ${n.default.calculateRemToPx("2.25rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+5}px`},"2XL":{padding:`${n.default.calculateRemToPx("1.5rem")} ${n.default.calculateRemToPx("2.75rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+7}px`},"3XL":{padding:`${n.default.calculateRemToPx("1.75rem")} ${n.default.calculateRemToPx("3.25rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+9}px`}}[o],d=l.css`
24
+ `;case"LINK":case"TRANSPARENT":return""}}function Z(o,e,t){let r=3;e&&(r=4);let s={"2XS":{padding:`${n.default.calculateRemToPx("0.125rem")} ${n.default.calculateRemToPx("0.5rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+1}px`},XS:{padding:`${n.default.calculateRemToPx("0.25rem")} ${n.default.calculateRemToPx("0.75rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+1}px`},SM:{padding:`${n.default.calculateRemToPx("0.5rem")} ${n.default.calculateRemToPx("1rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+1}px`},MD:{padding:`${n.default.calculateRemToPx("0.75rem")} ${n.default.calculateRemToPx("1.25rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+3}px`},LG:{padding:`${n.default.calculateRemToPx("1rem")} ${n.default.calculateRemToPx("1.75rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+3}px`},XL:{padding:`${n.default.calculateRemToPx("1.25rem")} ${n.default.calculateRemToPx("2.25rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+5}px`},"2XL":{padding:`${n.default.calculateRemToPx("1.5rem")} ${n.default.calculateRemToPx("2.75rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+7}px`},"3XL":{padding:`${n.default.calculateRemToPx("1.75rem")} ${n.default.calculateRemToPx("3.25rem")}`,borderRadius:`${parseFloat(t.borderRadius.default)+9}px`}}[o],d=l.css`
25
25
  padding: ${e?"0":s.padding};
26
26
  border-radius: ${e?t.borderRadius.rounded:s.borderRadius};
27
- `;if(e){let c=`${i*parseFloat(t.spacing[o.toLowerCase()])}px`;return l.css`
27
+ `;if(e){let c=`${r*parseFloat(t.spacing[o.toLowerCase()])}px`;return l.css`
28
28
  ${d}
29
29
  width: ${c};
30
30
  min-height: ${c};
31
- `}return d}var eo=require("styled-components/native"),k=require("@mobilestock-native/icons"),io=m(require("@mobilestock-native/tools"));var y=m(require("styled-components/native")),oo=m(require("@mobilestock-native/tools")),to=require("@mobilestock-native/typography"),w=require("react/jsx-runtime");function R(o){return(0,w.jsx)(No,{$position:o.notificationPosition,$size:o.size,children:(0,w.jsx)(Ao,{size:o.size,weight:"BOLD",children:o.notification>99?"99+":o.notification})})}var bo={XS:{top:"-8px",right:"-10px"},SM:{top:"-10px",right:"-8px"},MD:{top:"-10px",right:"-8px"},LG:{top:"-12px",right:"-8px"},XL:{top:"-16px",right:"-10px"},"2XL":{top:"-16px",right:"-10px"},"3XL":{top:"-18px",right:"-10px"}},No=y.default.View`
31
+ `}return d}var eo=require("styled-components/native"),L=require("@mobilestock-native/icons"),ro=m(require("@mobilestock-native/tools"));var y=m(require("styled-components/native")),oo=m(require("@mobilestock-native/tools")),to=require("@mobilestock-native/typography"),k=require("react/jsx-runtime");function P(o){return(0,k.jsx)(No,{$position:o.notificationPosition,$size:o.size,children:(0,k.jsx)(So,{size:o.size,weight:"BOLD",children:o.notification>99?"99+":o.notification})})}var Eo={XS:{top:"-8px",right:"-10px"},SM:{top:"-10px",right:"-8px"},MD:{top:"-10px",right:"-8px"},LG:{top:"-12px",right:"-8px"},XL:{top:"-16px",right:"-10px"},"2XL":{top:"-16px",right:"-10px"},"3XL":{top:"-18px",right:"-10px"}},No=y.default.View`
32
32
  position: absolute;
33
33
  background-color: ${({theme:o})=>o.colors.alert.urgent};
34
34
  padding: 2px 4px;
@@ -36,35 +36,35 @@
36
36
 
37
37
  ${({$position:o,$size:e})=>{if(o==="END")return y.css`
38
38
  position: static;
39
- `;let t=bo[e];return y.css`
39
+ `;let t=Eo[e];return y.css`
40
40
  top: ${t.top};
41
41
  right: ${t.right};
42
42
  `}}
43
- `,Ao=(0,y.default)(to.Typography)`
43
+ `,So=(0,y.default)(to.Typography)`
44
44
  color: ${({theme:o})=>oo.default.defineTextColor(o.colors.alert.urgent)};
45
- `;var g=require("react/jsx-runtime");function I(o){let e=(0,eo.useTheme)(),t=o.notification&&o.notificationPosition==="ICON";function i(){let r=x(o.backgroundColor,e);if(o.color)return o.color;switch(o.variant){case"DEFAULT":return io.default.defineTextColor(r);case"TRANSPARENT":case"OUTLINE":return r;case"LINK":return e.colors.text.default}}return o.icon?t?(0,g.jsxs)(A,{children:[(0,g.jsx)(k.Icon,{color:i(),name:o.icon,size:o.size}),(0,g.jsx)(R,{notification:o.notification,notificationPosition:o.notificationPosition,size:o.size})]}):(0,g.jsx)(k.Icon,{testID:"icon-container",color:i(),name:o.icon,size:o.size}):(0,g.jsx)(g.Fragment,{})}var h=m(require("styled-components/native")),no=m(require("@mobilestock-native/tools")),ao=require("@mobilestock-native/typography");var B=require("react/jsx-runtime");function D(o){return o.text?o.notification&&o.notificationPosition==="TEXT"?(0,B.jsxs)(A,{children:[(0,B.jsx)(ro,{$color:o.color,$backgroundColor:o.backgroundColor,$variant:o.variant,align:"CENTER",weight:o.fontWeight,size:o.size,withUnderline:o.withUnderline,children:o.text}),(0,B.jsx)(R,{notification:o.notification,notificationPosition:o.notificationPosition,size:o.size})]}):(0,B.jsx)(ro,{$color:o.color,$backgroundColor:o.backgroundColor,$variant:o.variant,align:"CENTER",weight:o.fontWeight,size:o.size,withUnderline:o.withUnderline,children:o.text}):null}var ro=(0,h.default)(ao.Typography)`
46
- ${({$variant:o,$backgroundColor:e,$color:t,theme:i})=>{let r=x(e,i);if(t)return h.css`
45
+ `;var g=require("react/jsx-runtime");function I(o){let e=(0,eo.useTheme)(),t=o.notification&&o.notificationPosition==="ICON";function r(){let i=x(o.backgroundColor,e);if(o.color)return o.color;switch(o.variant){case"DEFAULT":return ro.default.defineTextColor(i);case"TRANSPARENT":case"OUTLINE":return i;case"LINK":return e.colors.text.default}}return o.icon?t?(0,g.jsxs)(S,{children:[(0,g.jsx)(L.Icon,{color:r(),name:o.icon,size:o.size}),(0,g.jsx)(P,{notification:o.notification,notificationPosition:o.notificationPosition,size:o.size})]}):(0,g.jsx)(L.Icon,{testID:"icon-container",color:r(),name:o.icon,size:o.size}):(0,g.jsx)(g.Fragment,{})}var h=m(require("styled-components/native")),no=m(require("@mobilestock-native/tools")),ao=require("@mobilestock-native/typography");var b=require("react/jsx-runtime");function D(o){return o.text?o.notification&&o.notificationPosition==="TEXT"?(0,b.jsxs)(S,{children:[(0,b.jsx)(io,{$color:o.color,$backgroundColor:o.backgroundColor,$variant:o.variant,align:"CENTER",weight:o.fontWeight,size:o.size,withUnderline:o.withUnderline,children:o.text}),(0,b.jsx)(P,{notification:o.notification,notificationPosition:o.notificationPosition,size:o.size})]}):(0,b.jsx)(io,{$color:o.color,$backgroundColor:o.backgroundColor,$variant:o.variant,align:"CENTER",weight:o.fontWeight,size:o.size,withUnderline:o.withUnderline,children:o.text}):null}var io=(0,h.default)(ao.Typography)`
46
+ ${({$variant:o,$backgroundColor:e,$color:t,theme:r})=>{let i=x(e,r);if(t)return h.css`
47
47
  color: ${t};
48
48
  `;switch(o){case"DEFAULT":return h.css`
49
- color: ${no.default.defineTextColor(r)};
49
+ color: ${no.default.defineTextColor(i)};
50
50
  `;case"TRANSPARENT":case"OUTLINE":return h.css`
51
- color: ${r};
51
+ color: ${i};
52
52
  `;case"LINK":return h.css`
53
- color: ${i.colors.text.default};
53
+ color: ${r.colors.text.default};
54
54
  `}}}
55
- `;var a=require("react/jsx-runtime"),fo=[{name:"View",component:co.View},{name:"Container",component:E.Container},{name:"Container.Vertical",component:E.Container.Vertical},{name:"Container.Horizontal",component:E.Container.Horizontal},{name:"Typography",component:uo.Typography}],So=fo.map(o=>o.component);function po(zo){var U=zo,{variant:o="DEFAULT",size:e="MD",iconAlign:t="BEFORE-TEXT",backgroundColor:i="DEFAULT",notificationPosition:r="ICON",fontWeight:s="REGULAR",textAlign:d="CENTER",circular:c=!1,notification:p,text:u,isLoading:z,icon:V,disabled:mo,padding:go,borderColor:W,borderWidth:v}=U,F=_(U,["variant","size","iconAlign","backgroundColor","notificationPosition","fontWeight","textAlign","circular","notification","text","isLoading","icon","disabled","padding","borderColor","borderWidth"]);let To=(0,C.useTheme)();function O(f){return typeof f=="object"&&f&&"color"in f&&typeof f.color=="string"?f.color:""}if(typeof u!="string"&&u&&!so.default.validateJSXTree(u,So))throw new Error(`Invalid jsx text props. Expected one of ${fo.map(T=>T.name).join(", ")}, but received: ${u.type.target||u.type}`);return(0,a.jsx)(Lo,j(K({style:({pressed:f})=>Y(f,o,i,To,W,v)},F),{isLoading:z,disabled:mo||z,size:e,$backgroundColor:i,$variant:o,$circular:c,$borderColor:W,$borderWidth:v,children:f=>{let T=F.style;typeof T=="function"&&(T=T({pressed:f.pressed}));let P=O(T);if(Array.isArray(T)){let xo=T.findLast(X=>X&&"color"in X);P=O(xo)}return(0,a.jsxs)(wo,{padding:go,gap:e,align:"CENTER",$textAlign:d,$iconAlign:t,children:[t!=="START"&&t!=="END"?(0,a.jsxs)(ko,{gap:t==="ABOVE-TEXT"?"NONE":e,align:"CENTER",$iconAlign:t,children:[(0,a.jsx)(I,{variant:o,backgroundColor:i,icon:V,size:e,color:P,notification:p,notificationPosition:r}),(0,a.jsx)(D,{backgroundColor:i,variant:o,fontWeight:s,text:u,size:e,color:P,withUnderline:o==="LINK",notification:p,notificationPosition:r})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(I,{variant:o,backgroundColor:i,icon:V,size:e,color:P,notification:p,notificationPosition:r}),(0,a.jsx)(D,{backgroundColor:i,variant:o,fontWeight:s,text:u,size:e,color:P,withUnderline:o==="LINK",notification:p,notificationPosition:r})]}),!!p&&r==="END"&&(0,a.jsx)(R,{notification:p,notificationPosition:r,size:e}),!p&&(t==="START"||t==="END")&&!c&&(0,a.jsx)(Io,{})]})}}))}var Lo=(0,C.default)(lo.Clickable)`
55
+ `;var a=require("react/jsx-runtime"),fo=[{name:"View",component:co.View},{name:"Container",component:R.Container},{name:"Container.Vertical",component:R.Container.Vertical},{name:"Container.Horizontal",component:R.Container.Horizontal},{name:"Typography",component:uo.Typography}],Ao=fo.map(o=>o.component);function po(zo){var U=zo,{variant:o="DEFAULT",size:e="MD",iconAlign:t="BEFORE-TEXT",backgroundColor:r="DEFAULT",notificationPosition:i="ICON",fontWeight:s="REGULAR",textAlign:d="CENTER",circular:c=!1,notification:p,text:u,isLoading:z,icon:W,disabled:mo,padding:go,borderColor:V,borderWidth:v}=U,F=_(U,["variant","size","iconAlign","backgroundColor","notificationPosition","fontWeight","textAlign","circular","notification","text","isLoading","icon","disabled","padding","borderColor","borderWidth"]);let To=(0,C.useTheme)();function O(f){return typeof f=="object"&&f&&"color"in f&&typeof f.color=="string"?f.color:""}if(typeof u!="string"&&u&&!so.default.validateJSXTree(u,Ao))throw new Error(`Invalid jsx text props. Expected one of ${fo.map(T=>T.name).join(", ")}, but received: ${u.type.target||u.type}`);return(0,a.jsx)(wo,j(K({style:({pressed:f})=>Y(f,o,r,To,V,v)},F),{isLoading:z,disabled:mo||z,size:e,$backgroundColor:r,$variant:o,$circular:c,$borderColor:V,$borderWidth:v,children:f=>{let T=F.style;typeof T=="function"&&(T=T({pressed:f.pressed}));let B=O(T);if(Array.isArray(T)){let xo=T.findLast(X=>X&&"color"in X);B=O(xo)}return(0,a.jsxs)(ko,{padding:go,gap:e,align:"CENTER",$textAlign:d,$iconAlign:t,children:[t!=="START"&&t!=="END"?(0,a.jsxs)(Lo,{gap:t==="ABOVE-TEXT"?"NONE":e,align:"CENTER",$iconAlign:t,children:[(0,a.jsx)(I,{variant:o,backgroundColor:r,icon:W,size:e,color:B,notification:p,notificationPosition:i}),(0,a.jsx)(D,{backgroundColor:r,variant:o,fontWeight:s,text:u,size:e,color:B,withUnderline:o==="LINK",notification:p,notificationPosition:i})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(I,{variant:o,backgroundColor:r,icon:W,size:e,color:B,notification:p,notificationPosition:i}),(0,a.jsx)(D,{backgroundColor:r,variant:o,fontWeight:s,text:u,size:e,color:B,withUnderline:o==="LINK",notification:p,notificationPosition:i})]}),!!p&&i==="END"&&(0,a.jsx)(P,{notification:p,notificationPosition:i,size:e}),!p&&(t==="START"||t==="END")&&!c&&(0,a.jsx)(Io,{})]})}}))}var wo=(0,C.default)(lo.Clickable)`
56
56
  justify-content: center;
57
- ${({$variant:o,$backgroundColor:e,$borderColor:t,$borderWidth:i,theme:r})=>Q(o,e,r,t,i)}
57
+ ${({$variant:o,$backgroundColor:e,$borderColor:t,$borderWidth:r,theme:i})=>Q(o,e,i,t,r)}
58
58
  ${({size:o,$circular:e,theme:t})=>Z(o,e,t)}
59
- `,wo=(0,C.default)(E.Container)`
59
+ `,ko=(0,C.default)(R.Container)`
60
60
  flex-direction: row;
61
61
  ${({$textAlign:o})=>q(o)};
62
- ${({$iconAlign:o})=>o==="START"||o==="END"?L(o):""};
63
- `,A=C.default.View`
62
+ ${({$iconAlign:o})=>o==="START"||o==="END"?w(o):""};
63
+ `,S=C.default.View`
64
64
  position: relative;
65
65
  display: inline-flex;
66
66
  align-items: center;
67
- `,ko=(0,C.default)(E.Container)`
67
+ `,Lo=(0,C.default)(R.Container)`
68
68
  flex-direction: row;
69
- ${({$iconAlign:o})=>L(o)};
69
+ ${({$iconAlign:o})=>w(o)};
70
70
  `,Io=C.default.View``;0&&(module.exports={Button});
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@mobilestock-native/button",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "chroma-js": "^3.1.2",
7
- "@mobilestock-native/clickable": "^1.0.18",
8
- "@mobilestock-native/container": "^1.3.1",
9
- "@mobilestock-native/icons": "^0.7.0",
10
- "@mobilestock-native/tools": "^0.0.11",
11
- "@mobilestock-native/typography": "^0.1.2"
7
+ "@mobilestock-native/clickable": "^1.1.0",
8
+ "@mobilestock-native/container": "^1.4.0",
9
+ "@mobilestock-native/icons": "^0.8.0",
10
+ "@mobilestock-native/tools": "^0.1.0",
11
+ "@mobilestock-native/typography": "^0.1.3"
12
12
  },
13
13
  "peerDependencies": {
14
14
  "react": "18.2.0",