freemium-ui 2.0.0-beta.52 → 2.0.0-beta.53

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/index.cjs.js CHANGED
@@ -983,7 +983,11 @@ variant:n,weight:r,ref:o,...a},t))),ma=on.div`
983
983
  display: flex;
984
984
  align-items: center;
985
985
  gap: 4px;
986
- justify-content: center;
986
+ justify-content: ${({align:e})=>e};
987
+ & .alert-icon {
988
+ margin-right: 4px;
989
+ min-width: 18px;
990
+ }
987
991
  `,ga={error:Sr,success:_r,info:Hr,warning:Er},ya={large:{height:"45px",
988
992
  size:"16px"},mini:{height:"24px",size:"12px"},normal:{height:"32px",size:"14px"}
989
993
  },ba=on.button`
@@ -16229,17 +16233,18 @@ onValueChange:c,...u},i.map((i=>e.createElement(Tr,{key:i?.[t],
16229
16233
  className:"AccordionItem",value:i?.[t],disabled:i?.disabled
16230
16234
  },e.createElement(Or,{hideIcon:a
16231
16235
  },o?o(i):i?.[n]),e.createElement(Nr,null,r?r(i):null))))),
16232
- exports.Alert=({canDismiss:t=!0,onClose:n,children:r,level:a,onDisappear:o,data:i,icon:l,timeout:c=0,overideClassName:s,...u})=>{
16233
- const d=qt(),h=ga[a],[p,f]=e.useState(!0);return e.useEffect((()=>{
16234
- c>0&&(p||f(!0),setTimeout((()=>{f(!1),o?.()}),c))}),[c]),e.useEffect((()=>{
16235
- "string"==typeof r||"string"==typeof i?.message||u["aria-describedby"]||console.warn("The `aria-describedby` prop is required when the children of the Alert are not a string. This is to ensure that assistive technologies can announce the content of the alert. Please provide a valid `aria-describedby` prop to the Alert component.")
16236
- }),[]),p?e.createElement(ma,{level:a,role:"alert",
16237
- "aria-describedby":"string"==typeof i?.message?i.message:void 0,...u
16238
- },e.createElement(va,null,l??e.createElement(h,{fill:d.colors.text.semantic[a]
16239
- }),i?.message?e.createElement(fa,null,i.message):r,i?.linkText&&e.createElement(Ur,{
16240
- target:"_blank",rel:"noreferrer",href:i?.href??"#"
16241
- },i.linkText)),t&&e.createElement($r,{onClick:()=>{f(!1),n?.()}
16242
- },e.createElement(Mr,{fill:d.colors.text.primary}))):null
16236
+ exports.Alert=({onClose:t,children:n,level:r,onDisappear:a,data:o,icon:i,overideClassName:l,timeout:c=0,canDismiss:s=!0,alignContent:u="center",...d})=>{
16237
+ const h=qt(),p=ga[r],[f,m]=e.useState(!0);return e.useEffect((()=>{
16238
+ c>0&&(f||m(!0),setTimeout((()=>{m(!1),a?.()}),c))}),[c]),e.useEffect((()=>{
16239
+ "string"==typeof n||"string"==typeof o?.message||d["aria-describedby"]||console.warn("The `aria-describedby` prop is required when the children of the Alert are not a string. This is to ensure that assistive technologies can announce the content of the alert. Please provide a valid `aria-describedby` prop to the Alert component.")
16240
+ }),[]),f?e.createElement(ma,{level:r,role:"alert",
16241
+ "aria-describedby":"string"==typeof o?.message?o.message:void 0,...d
16242
+ },e.createElement(va,{align:u},i??e.createElement(p,{className:"alert-icon",
16243
+ fill:h.colors.text.semantic[r]
16244
+ }),o?.message?e.createElement(fa,null,o.message):n,o?.linkText&&e.createElement(Ur,{
16245
+ target:"_blank",rel:"noreferrer",href:o?.href??"#"
16246
+ },o.linkText)),s&&e.createElement($r,{onClick:()=>{m(!1),t?.()}
16247
+ },e.createElement(Mr,{fill:h.colors.text.primary}))):null
16243
16248
  },exports.BoxedRadio=({options:t,defaultValue:n,idAccessor:r="id",onChange:a,isErrored:o,errorText:i,disabled:l=!1,getTextContent:c,className:s,id:u,isRequired:d,readOnly:h,itemComponent:p,label:f,value:m,customIndicator:v,...g})=>e.createElement(us,{
16244
16249
  className:"StyledBoxedRadio"},f&&e.createElement(Fr,{htmlFor:u,
16245
16250
  className:"input-label"},f,d&&e.createElement(jr,null,"*")),e.createElement(ds,{
package/index.d.ts CHANGED
@@ -121,12 +121,16 @@ interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
121
121
  * @default getAlertIcon(level)
122
122
  **/
123
123
  icon?: React.ReactNode;
124
+ /**
125
+ * Alignment of the content in the alert
126
+ */
127
+ alignContent?: 'flex-start' | 'center' | 'flex-end';
124
128
  }
125
129
 
126
130
  /**
127
131
  * Alert displays an alert on the user interface and enables displaying additional information to the context of the page.
128
132
  */
129
- declare const Alert: ({ canDismiss, onClose, children, level, onDisappear, data, icon, timeout, overideClassName, ...props }: AlertProps) => react__default.JSX.Element | null;
133
+ declare const Alert: ({ onClose, children, level, onDisappear, data, icon, overideClassName, timeout, canDismiss, alignContent, ...props }: AlertProps) => react__default.JSX.Element | null;
130
134
 
131
135
  type ButtonSizeKey = 'mini' | 'normal' | 'large';
132
136
  type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link';
package/index.js CHANGED
@@ -979,19 +979,24 @@ variant:n,weight:r,ref:o,...a},e))),Pa=En.div`
979
979
  display: flex;
980
980
  align-items: center;
981
981
  gap: 4px;
982
- justify-content: center;
982
+ justify-content: ${({align:e})=>e};
983
+ & .alert-icon {
984
+ margin-right: 4px;
985
+ min-width: 18px;
986
+ }
983
987
  `,Oa={error:Wr,success:Gr,info:Kr,warning:Yr
984
- },Na=({canDismiss:e=!0,onClose:n,children:r,level:a,onDisappear:o,data:i,icon:l,timeout:c=0,overideClassName:s,...u})=>{
985
- const d=vn(),h=Oa[a],[p,f]=t.useState(!0);return t.useEffect((()=>{
986
- c>0&&(p||f(!0),setTimeout((()=>{f(!1),o?.()}),c))}),[c]),t.useEffect((()=>{
987
- "string"==typeof r||"string"==typeof i?.message||u["aria-describedby"]||console.warn("The `aria-describedby` prop is required when the children of the Alert are not a string. This is to ensure that assistive technologies can announce the content of the alert. Please provide a valid `aria-describedby` prop to the Alert component.")
988
- }),[]),p?t.createElement(Pa,{level:a,role:"alert",
989
- "aria-describedby":"string"==typeof i?.message?i.message:void 0,...u
990
- },t.createElement(Ra,null,l??t.createElement(h,{fill:d.colors.text.semantic[a]
991
- }),i?.message?t.createElement(Ia,null,i.message):r,i?.linkText&&t.createElement(da,{
992
- target:"_blank",rel:"noreferrer",href:i?.href??"#"
993
- },i.linkText)),e&&t.createElement(ua,{onClick:()=>{f(!1),n?.()}
994
- },t.createElement($r,{fill:d.colors.text.primary}))):null},Fa={large:{
988
+ },Na=({onClose:e,children:n,level:r,onDisappear:a,data:o,icon:i,overideClassName:l,timeout:c=0,canDismiss:s=!0,alignContent:u="center",...d})=>{
989
+ const h=vn(),p=Oa[r],[f,m]=t.useState(!0);return t.useEffect((()=>{
990
+ c>0&&(f||m(!0),setTimeout((()=>{m(!1),a?.()}),c))}),[c]),t.useEffect((()=>{
991
+ "string"==typeof n||"string"==typeof o?.message||d["aria-describedby"]||console.warn("The `aria-describedby` prop is required when the children of the Alert are not a string. This is to ensure that assistive technologies can announce the content of the alert. Please provide a valid `aria-describedby` prop to the Alert component.")
992
+ }),[]),f?t.createElement(Pa,{level:r,role:"alert",
993
+ "aria-describedby":"string"==typeof o?.message?o.message:void 0,...d
994
+ },t.createElement(Ra,{align:u},i??t.createElement(p,{className:"alert-icon",
995
+ fill:h.colors.text.semantic[r]
996
+ }),o?.message?t.createElement(Ia,null,o.message):n,o?.linkText&&t.createElement(da,{
997
+ target:"_blank",rel:"noreferrer",href:o?.href??"#"
998
+ },o.linkText)),s&&t.createElement(ua,{onClick:()=>{m(!1),e?.()}
999
+ },t.createElement($r,{fill:h.colors.text.primary}))):null},Fa={large:{
995
1000
  height:"45px",size:"16px"},mini:{height:"24px",size:"12px"},normal:{
996
1001
  height:"32px",size:"14px"}},Ba=En.button`
997
1002
  font-weight: ${({theme:e})=>e.typography.fontWeight["semi-bold"]};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.0-beta.52",
3
+ "version": "2.0.0-beta.53",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",