@foxford/ui 2.88.0-beta-e1cd83a-20251209 → 2.89.0-beta-1917b0e-20251209

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
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');var Anchor=require('../Anchor/Anchor.js');var IconButton=require('../IconButton/IconButton.js');const Notification=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="m",status:n="system",iconProps:r={},discardButtonProps:o={},titleProps:i={},textProps:a={},actionButtonProps:c={},anchorProps:u={},title:l,text:x,hideIcon:j,sizeXXS:d,sizeXS:p,sizeS:m,sizeM:h,sizeL:z,sizeXL:I,...R}=e;const S={size:s,sizeXXS:d,sizeXS:p,sizeS:m,sizeM:h,sizeL:z,sizeXL:I};return jsxRuntime.jsxs(style.Root,{...R,...S,status:n,ref:t,children:[!j&&jsxRuntime.jsx(style.Spacer,{children:jsxRuntime.jsx(Icon.Icon,{preset:"brand",name:constants.ICON_NAMES[n],sizes:constants.SIZES_ICON,...S,...r})}),jsxRuntime.jsxs(style.Container,{children:[jsxRuntime.jsxs(style.Content,{children:[l?jsxRuntime.jsx(Text.Text,{as:"p",appearance:"body",weight:700,wordBreak:"break-word",color:"content-onmain-primary",...S,...i,children:l}):null,x?jsxRuntime.jsx(Text.Text,{as:"p",appearance:"body",wordBreak:"break-word",color:"content-onmain-primary",marginTop:l?'0.2em':void 0,sizes:constants.SIZES_TEXT,...S,...a,children:x}):null]}),c.onClick||u.href||u.to?jsxRuntime.jsxs(style.Controls,{children:[c.onClick?jsxRuntime.jsx(Button.Button,{preset:"brand",black:!0,sizes:constants.SIZES_ACTION,...S,...c}):null,u.href||u.to?jsxRuntime.jsx(Anchor.Anchor,{preset:"brand",underline:!0,palette:{color:'content-onmain-primary'},textProps:{appearance:'body',wordBreak:'break-word'},marginLeft:c.onClick?'0.6em':void 0,...S,...u}):null]}):null]}),o.onClick?jsxRuntime.jsx(style.Spacer,{children:jsxRuntime.jsx(IconButton.IconButton,{icon:"close",square:!0,...S,...o})}):null]})})),{displayName:'Notification',sizes:constants.SIZES});exports.Notification=Notification;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var renderSlot=require('../../shared/utils/renderSlot.js');var sizes=require('./sizes.js');var style=require('./style.js');var layouts=require('./layouts.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const createText=(e,t)=>typeof e=='string'||typeof e=='number'?jsxRuntime.jsx(Text.Text,{...t,children:e}):null;const Notification=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="m",status:r="system",withIcon:o=!1,layout:n="horizontal",discardButton:i,icon:a,children:l,content:c,title:u,text:d,addon:p,sizeXXS:S,sizeXS:x,sizeS:y,sizeM:j,sizeL:z,sizeXL:m,layoutXXS:T,layoutXS:h,layoutS:I,layoutM:R,layoutL:X,layoutXL:b,...P}=e;const f={size:s,sizeXXS:S,sizeXS:x,sizeS:y,sizeM:j,sizeL:z,sizeXL:m};const w={layout:n,layoutXXS:T,layoutXS:h,layoutS:I,layoutM:R,layoutL:X,layoutXL:b};const L={...f,preset:'brand',name:'infoCircle',sizes:sizes.SIZES_ICON};const k={...f,as:'p',appearance:'body',color:'content-onmain-primary',wordBreak:'break-word',weight:700,sizes:d?sizes.SIZES_TITLE:sizes.SIZES_TITLE_WITHOUT_TEXT};const E={...f,as:'p',appearance:'body',wordBreak:'break-word',color:'content-onmain-primary',sizes:sizes.SIZES_TEXT};const q={...f,preset:'brand',black:!0,sizes:sizes.SIZES_ACTION};const N={...f,preset:'brand',underline:!0,textProps:{appearance:'body',wordBreak:'break-word'}};const v={...f,icon:'close',square:!0};const _={iconProps:L,titleProps:k,textProps:E,buttonProps:q,anchorProps:N,discardButtonProps:v};return jsxRuntime.jsx(style.Root,{...P,...f,status:r,ref:t,children:l?renderSlot.renderSlot({slot:l,props:_}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o?jsxRuntime.jsx(style.Icon,{children:renderSlot.renderSlot({slot:a,props:L,fallback:jsxRuntime.jsx(Icon.Icon,{...L})})}):null,jsxRuntime.jsxs(style.Container,{...w,layouts:layouts.LAYOUTS_CONTAINER,children:[jsxRuntime.jsx(style.Content,{children:renderSlot.renderSlot({slot:c,props:{titleProps:k,textProps:E},fallback:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[renderSlot.renderSlot({slot:u,props:k,fallback:createText(u,k)}),renderSlot.renderSlot({slot:d,props:E,fallback:createText(d,E)})]})})}),p?jsxRuntime.jsx(style.Addon,{...w,layouts:layouts.LAYOUTS_ADDON,children:renderSlot.renderSlot({slot:p,props:{anchorProps:N,buttonProps:q}})}):null]}),i?jsxRuntime.jsx(style.DiscardButton,{children:renderSlot.renderSlot({slot:i,props:v})}):null]})})})),{displayName:'Notification',sizes:sizes.SIZES});exports.Notification=Notification;
2
2
  //# sourceMappingURL=Notification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.js","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { IconButton } from 'components/IconButton'\nimport { Button } from 'components/Button'\nimport { Anchor } from 'components/Anchor'\nimport { Text } from 'components/Text'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, ICON_NAMES, SIZES_ACTION } from './constants'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\n\nconst COMPONENT_NAME = 'Notification'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Notification/types.ts).\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n iconProps = {},\n discardButtonProps = {},\n titleProps = {},\n textProps = {},\n actionButtonProps = {},\n anchorProps = {},\n title,\n text,\n hideIcon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {!hideIcon && (\n <Styled.Spacer>\n <Icon preset='brand' name={ICON_NAMES[status]} sizes={SIZES_ICON} {...sizeProps} {...iconProps} />\n </Styled.Spacer>\n )}\n <Styled.Container>\n <Styled.Content>\n {title ? (\n <Text\n as='p'\n appearance='body'\n weight={700}\n wordBreak='break-word'\n color='content-onmain-primary'\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n ) : null}\n {text ? (\n <Text\n as='p'\n appearance='body'\n wordBreak='break-word'\n color='content-onmain-primary'\n marginTop={title ? '0.2em' : undefined}\n sizes={SIZES_TEXT}\n {...sizeProps}\n {...textProps}\n >\n {text}\n </Text>\n ) : null}\n </Styled.Content>\n {actionButtonProps.onClick || anchorProps.href || anchorProps.to ? (\n <Styled.Controls>\n {actionButtonProps.onClick ? (\n <Button preset='brand' black sizes={SIZES_ACTION} {...sizeProps} {...actionButtonProps} />\n ) : null}\n {anchorProps.href || anchorProps.to ? (\n <Anchor\n preset='brand'\n underline\n palette={{\n color: 'content-onmain-primary',\n }}\n textProps={{\n appearance: 'body',\n wordBreak: 'break-word',\n }}\n marginLeft={actionButtonProps.onClick ? '0.6em' : undefined}\n {...sizeProps}\n {...anchorProps}\n />\n ) : null}\n </Styled.Controls>\n ) : null}\n </Styled.Container>\n {discardButtonProps.onClick ? (\n <Styled.Spacer>\n <IconButton icon='close' square {...sizeProps} {...discardButtonProps} />\n </Styled.Spacer>\n ) : null}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["Notification","withMergedProps","forwardRef","props","ref","size","status","iconProps","discardButtonProps","titleProps","textProps","actionButtonProps","anchorProps","title","text","hideIcon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","restProps","sizeProps","_jsxs","Styled","children","_jsx","jsx","Icon","preset","name","ICON_NAMES","sizes","SIZES_ICON","jsxs","Text","as","appearance","weight","wordBreak","color","marginTop","undefined","SIZES_TEXT","onClick","href","to","Button","black","SIZES_ACTION","Anchor","underline","palette","marginLeft","IconButton","icon","square","displayName","SIZES"],"mappings":"2aAwBMA,MAAAA,aAAmEC,gBAAAA,gBAIvEC,MAAAA,YAA2D,CAACC,EAAOC,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,UACjBA,EAAY,CAAE,EAAAC,mBACdA,EAAqB,CAAE,EAAAC,WACvBA,EAAa,CAAE,EAAAC,UACfA,EAAY,CAAE,EAAAC,kBACdA,EAAoB,CAAE,EAAAC,YACtBA,EAAc,CAAE,EAAAC,MAChBA,EAAKC,KACLA,EAAIC,SACJA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,KACGC,GACDnB,EAEJ,MAAMoB,EAAY,CAChBlB,OACAW,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEG,WAAAA,KAACC,MAAAA,KAAW,IAAKH,KAAeC,EAAWjB,OAAQA,EAAQF,IAAKA,EAAIsB,SAAA,EAChEX,GACAY,WAAAA,IAACF,MAAAA,OAAa,CAAAC,SACZC,WAAAC,IAACC,UAAI,CAACC,OAAO,QAAQC,KAAMC,UAAUA,WAAC1B,GAAS2B,MAAOC,UAAWA,cAAKX,KAAehB,MAGzFiB,WAAAW,KAACV,gBAAgB,CAAAC,SACfF,CAAAA,WAAAW,KAACV,cAAc,CAAAC,SACZb,CAAAA,EACCc,WAAAC,IAACQ,UAAI,CACHC,GAAG,IACHC,WAAW,OACXC,OAAQ,IACRC,UAAU,aACVC,MAAM,4BACFlB,KACAd,EAAUiB,SAEbb,IAED,KACHC,EACCa,WAAAA,IAACS,KAAAA,KAAI,CACHC,GAAG,IACHC,WAAW,OACXE,UAAU,aACVC,MAAM,yBACNC,UAAW7B,EAAQ,aAAU8B,EAC7BV,MAAOW,UAAWA,cACdrB,KACAb,EAASgB,SAEZZ,IAED,QAELH,EAAkBkC,SAAWjC,EAAYkC,MAAQlC,EAAYmC,GAC5DvB,WAAAW,KAACV,eAAe,CAAAC,UACbf,EAAkBkC,QACjBlB,WAAAA,IAACqB,OAAAA,OAAM,CAAClB,OAAO,QAAQmB,OAAK,EAAChB,MAAOiB,UAAaA,gBAAK3B,KAAeZ,IACnE,KACHC,EAAYkC,MAAQlC,EAAYmC,GAC/BpB,WAAAC,IAACuB,cAAM,CACLrB,OAAO,QACPsB,WAAS,EACTC,QAAS,CACPZ,MAAO,0BAET/B,UAAW,CACT4B,WAAY,OACZE,UAAW,cAEbc,WAAY3C,EAAkBkC,QAAU,aAAUF,KAC9CpB,KACAX,IAEJ,QAEJ,QAELJ,EAAmBqC,QAClBlB,WAAAA,IAACF,MAAAA,OAAa,CAAAC,SACZC,WAAAC,IAAC2B,sBAAU,CAACC,KAAK,QAAQC,QAAM,KAAKlC,KAAef,MAEnD,OACQ,IAGlB,CACEkD,YAtHmB,eAuHnBzB,MAAO0B,UAAAA"}
1
+ {"version":3,"file":"Notification.js","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport type { IconProps } from 'components/Icon'\nimport { Icon } from 'components/Icon'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ButtonProps } from 'components/Button'\nimport type { AnchorProps } from 'components/Anchor'\nimport type { TextProps } from 'components/Text'\nimport { Text } from 'components/Text'\nimport { renderSlot } from 'shared/utils/renderSlot'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, SIZES_ACTION, SIZES_TITLE, SIZES_TITLE_WITHOUT_TEXT } from './sizes'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\nimport { LAYOUTS_ADDON, LAYOUTS_CONTAINER } from './layouts'\n\nconst COMPONENT_NAME = 'Notification'\n\nconst createText = (content: unknown, props: TextProps) => {\n return typeof content === 'string' || typeof content === 'number' ? <Text {...props}>{content}</Text> : null\n}\n\n/**\n *\n * *v1.0.0*\n *\n * Компонент для отображения информационных сообщений, встроенных в интерфейс.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n *\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n withIcon = false,\n layout = 'horizontal',\n discardButton,\n icon,\n children,\n content,\n title,\n text,\n addon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const iconProps: IconProps = {\n ...sizeProps,\n preset: 'brand',\n name: 'infoCircle',\n sizes: SIZES_ICON,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n weight: 700,\n sizes: text ? SIZES_TITLE : SIZES_TITLE_WITHOUT_TEXT,\n }\n\n const textProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n wordBreak: 'break-word',\n color: 'content-onmain-primary',\n sizes: SIZES_TEXT,\n }\n\n const buttonProps: ButtonProps = {\n ...sizeProps,\n preset: 'brand',\n black: true,\n sizes: SIZES_ACTION,\n }\n\n const anchorProps: AnchorProps = {\n ...sizeProps,\n preset: 'brand',\n underline: true,\n textProps: {\n appearance: 'body',\n wordBreak: 'break-word',\n },\n }\n\n const discardButtonProps: IconButtonProps = {\n ...sizeProps,\n icon: 'close',\n square: true,\n }\n\n const rootProps = { iconProps, titleProps, textProps, buttonProps, anchorProps, discardButtonProps }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {children ? (\n renderSlot({\n slot: children,\n props: rootProps,\n })\n ) : (\n <>\n {withIcon ? (\n <Styled.Icon>\n {renderSlot({\n slot: icon,\n props: iconProps,\n fallback: <Icon {...iconProps} />,\n })}\n </Styled.Icon>\n ) : null}\n\n <Styled.Container {...layoutProps} layouts={LAYOUTS_CONTAINER}>\n <Styled.Content>\n {renderSlot({\n slot: content,\n props: { titleProps, textProps },\n fallback: (\n <>\n {renderSlot({\n slot: title,\n props: titleProps,\n fallback: createText(title, titleProps),\n })}\n {renderSlot({\n slot: text,\n props: textProps,\n fallback: createText(text, textProps),\n })}\n </>\n ),\n })}\n </Styled.Content>\n\n {addon ? (\n <Styled.Addon {...layoutProps} layouts={LAYOUTS_ADDON}>\n {renderSlot({\n slot: addon,\n props: { anchorProps, buttonProps },\n })}\n </Styled.Addon>\n ) : null}\n </Styled.Container>\n\n {discardButton ? (\n <Styled.DiscardButton>\n {renderSlot({\n slot: discardButton,\n props: discardButtonProps,\n })}\n </Styled.DiscardButton>\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["createText","content","props","_jsx","jsx","Text","children","Notification","withMergedProps","forwardRef","ref","size","status","withIcon","layout","discardButton","icon","title","text","addon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","restProps","sizeProps","layoutProps","iconProps","preset","name","sizes","SIZES_ICON","titleProps","as","appearance","color","wordBreak","weight","SIZES_TITLE","SIZES_TITLE_WITHOUT_TEXT","textProps","SIZES_TEXT","buttonProps","black","SIZES_ACTION","anchorProps","underline","discardButtonProps","square","rootProps","Styled","renderSlot","slot","_jsxs","jsxs","_Fragment","fallback","Icon","layouts","LAYOUTS_CONTAINER","LAYOUTS_ADDON","displayName","SIZES"],"mappings":"wXAkBA,MAAMA,WAAaA,CAACC,EAAkBC,WACtBD,GAAY,iBAAmBA,GAAY,SAAWE,WAAAC,IAACC,UAAI,IAAKH,EAAKI,SAAGL,IAAkB,KAYpGM,MAAAA,aAAmEC,gBAAAA,gBAIvEC,MAAAA,YAA2D,CAACP,EAAOQ,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,SACjBA,GAAW,EAAKC,OAChBA,EAAS,aAAYC,cACrBA,EAAaC,KACbA,EAAIV,SACJA,EAAQL,QACRA,EAAOgB,MACPA,EAAKC,KACLA,EAAIC,MACJA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,KACGC,GACD9B,EAEJ,MAAM+B,EAAY,CAChBtB,OACAS,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMS,EAAc,CAClBpB,SACAY,YACAC,WACAC,UACAC,UACAC,UACAC,YAGF,MAAMI,EAAuB,IACxBF,EACHG,OAA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KAAM1C,EACNhB,MAAO8C,EACPgB,SAAUhE,WAAWkB,EAAM8B,YAOpC7B,EACChB,WAAAC,IAACsD,YAAY,IAAKxB,EAAagC,QAASE,QAAcA,cAAA9D,SACnDqD,WAAAA,WAAW,CACVC,KAAMzC,EACNjB,MAAO,CAAEmD,cAAaH,mBAGxB,QAGLnC,EACCZ,WAAAC,IAACsD,oBAAoB,CAAApD,SAClBqD,WAAAA,WAAW,CACVC,KAAM7C,EACNb,MAAOqD,MAGT,SAGI,IAGlB,CACEc,YAvLmB,eAwLnB/B,MAAOgC,MAAAA"}
@@ -1,2 +1,2 @@
1
- import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES,ICON_NAMES,SIZES_ICON,SIZES_TEXT,SIZES_ACTION}from'./constants.mjs';import{Root,Spacer,Container,Content,Controls}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';import{Button}from'../Button/Button.mjs';import{Anchor}from'../Anchor/Anchor.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const Notification=withMergedProps(forwardRef(((o,r)=>{const{size:t="m",status:e="system",iconProps:n={},discardButtonProps:s={},titleProps:i={},textProps:c={},actionButtonProps:a={},anchorProps:m={},title:p,text:l,hideIcon:d,sizeXXS:S,sizeXS:x,sizeS:j,sizeM:I,sizeL:u,sizeXL:f,...h}=o;const z={size:t,sizeXXS:S,sizeXS:x,sizeS:j,sizeM:I,sizeL:u,sizeXL:f};return jsxs(Root,{...h,...z,status:e,ref:r,children:[!d&&jsx(Spacer,{children:jsx(Icon,{preset:"brand",name:ICON_NAMES[e],sizes:SIZES_ICON,...z,...n})}),jsxs(Container,{children:[jsxs(Content,{children:[p?jsx(Text,{as:"p",appearance:"body",weight:700,wordBreak:"break-word",color:"content-onmain-primary",...z,...i,children:p}):null,l?jsx(Text,{as:"p",appearance:"body",wordBreak:"break-word",color:"content-onmain-primary",marginTop:p?'0.2em':void 0,sizes:SIZES_TEXT,...z,...c,children:l}):null]}),a.onClick||m.href||m.to?jsxs(Controls,{children:[a.onClick?jsx(Button,{preset:"brand",black:!0,sizes:SIZES_ACTION,...z,...a}):null,m.href||m.to?jsx(Anchor,{preset:"brand",underline:!0,palette:{color:'content-onmain-primary'},textProps:{appearance:'body',wordBreak:'break-word'},marginLeft:a.onClick?'0.6em':void 0,...z,...m}):null]}):null]}),s.onClick?jsx(Spacer,{children:jsx(IconButton,{icon:"close",square:!0,...z,...s})}):null]})})),{displayName:'Notification',sizes:SIZES});export{Notification};
1
+ import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{renderSlot}from'../../shared/utils/renderSlot.mjs';import{SIZES,SIZES_ICON,SIZES_TITLE,SIZES_TITLE_WITHOUT_TEXT,SIZES_TEXT,SIZES_ACTION}from'./sizes.mjs';import{Root,Icon,Container,Content,Addon,DiscardButton}from'./style.mjs';import{LAYOUTS_CONTAINER,LAYOUTS_ADDON}from'./layouts.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon as Icon$1}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const createText=(o,t)=>typeof o=='string'||typeof o=='number'?jsx(Text,{...t,children:o}):null;const Notification=withMergedProps(forwardRef(((o,t)=>{const{size:r="m",status:e="system",withIcon:s=!1,layout:n="horizontal",discardButton:a,icon:i,children:l,content:c,title:p,text:d,addon:S,sizeXXS:m,sizeXS:u,sizeS:T,sizeM:I,sizeL:y,sizeXL:x,layoutXXS:f,layoutXS:E,layoutS:z,layoutM:h,layoutL:j,layoutXL:X,..._}=o;const b={size:r,sizeXXS:m,sizeXS:u,sizeS:T,sizeM:I,sizeL:y,sizeXL:x};const L={layout:n,layoutXXS:f,layoutXS:E,layoutS:z,layoutM:h,layoutL:j,layoutXL:X};const N={...b,preset:'brand',name:'infoCircle',sizes:SIZES_ICON};const O={...b,as:'p',appearance:'body',color:'content-onmain-primary',wordBreak:'break-word',weight:700,sizes:d?SIZES_TITLE:SIZES_TITLE_WITHOUT_TEXT};const P={...b,as:'p',appearance:'body',wordBreak:'break-word',color:'content-onmain-primary',sizes:SIZES_TEXT};const w={...b,preset:'brand',black:!0,sizes:SIZES_ACTION};const A={...b,preset:'brand',underline:!0,textProps:{appearance:'body',wordBreak:'break-word'}};const Z={...b,icon:'close',square:!0};const k={iconProps:N,titleProps:O,textProps:P,buttonProps:w,anchorProps:A,discardButtonProps:Z};return jsx(Root,{..._,...b,status:e,ref:t,children:l?renderSlot({slot:l,props:k}):jsxs(Fragment,{children:[s?jsx(Icon,{children:renderSlot({slot:i,props:N,fallback:jsx(Icon$1,{...N})})}):null,jsxs(Container,{...L,layouts:LAYOUTS_CONTAINER,children:[jsx(Content,{children:renderSlot({slot:c,props:{titleProps:O,textProps:P},fallback:jsxs(Fragment,{children:[renderSlot({slot:p,props:O,fallback:createText(p,O)}),renderSlot({slot:d,props:P,fallback:createText(d,P)})]})})}),S?jsx(Addon,{...L,layouts:LAYOUTS_ADDON,children:renderSlot({slot:S,props:{anchorProps:A,buttonProps:w}})}):null]}),a?jsx(DiscardButton,{children:renderSlot({slot:a,props:Z})}):null]})})})),{displayName:'Notification',sizes:SIZES});export{Notification};
2
2
  //# sourceMappingURL=Notification.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.mjs","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { IconButton } from 'components/IconButton'\nimport { Button } from 'components/Button'\nimport { Anchor } from 'components/Anchor'\nimport { Text } from 'components/Text'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, ICON_NAMES, SIZES_ACTION } from './constants'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\n\nconst COMPONENT_NAME = 'Notification'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Notification/types.ts).\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n iconProps = {},\n discardButtonProps = {},\n titleProps = {},\n textProps = {},\n actionButtonProps = {},\n anchorProps = {},\n title,\n text,\n hideIcon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {!hideIcon && (\n <Styled.Spacer>\n <Icon preset='brand' name={ICON_NAMES[status]} sizes={SIZES_ICON} {...sizeProps} {...iconProps} />\n </Styled.Spacer>\n )}\n <Styled.Container>\n <Styled.Content>\n {title ? (\n <Text\n as='p'\n appearance='body'\n weight={700}\n wordBreak='break-word'\n color='content-onmain-primary'\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n ) : null}\n {text ? (\n <Text\n as='p'\n appearance='body'\n wordBreak='break-word'\n color='content-onmain-primary'\n marginTop={title ? '0.2em' : undefined}\n sizes={SIZES_TEXT}\n {...sizeProps}\n {...textProps}\n >\n {text}\n </Text>\n ) : null}\n </Styled.Content>\n {actionButtonProps.onClick || anchorProps.href || anchorProps.to ? (\n <Styled.Controls>\n {actionButtonProps.onClick ? (\n <Button preset='brand' black sizes={SIZES_ACTION} {...sizeProps} {...actionButtonProps} />\n ) : null}\n {anchorProps.href || anchorProps.to ? (\n <Anchor\n preset='brand'\n underline\n palette={{\n color: 'content-onmain-primary',\n }}\n textProps={{\n appearance: 'body',\n wordBreak: 'break-word',\n }}\n marginLeft={actionButtonProps.onClick ? '0.6em' : undefined}\n {...sizeProps}\n {...anchorProps}\n />\n ) : null}\n </Styled.Controls>\n ) : null}\n </Styled.Container>\n {discardButtonProps.onClick ? (\n <Styled.Spacer>\n <IconButton icon='close' square {...sizeProps} {...discardButtonProps} />\n </Styled.Spacer>\n ) : null}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["Notification","withMergedProps","forwardRef","props","ref","size","status","iconProps","discardButtonProps","titleProps","textProps","actionButtonProps","anchorProps","title","text","hideIcon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","restProps","sizeProps","_jsxs","Styled","children","_jsx","Icon","preset","name","ICON_NAMES","sizes","SIZES_ICON","Text","as","appearance","weight","wordBreak","color","marginTop","undefined","SIZES_TEXT","onClick","href","to","Button","black","SIZES_ACTION","Anchor","underline","palette","marginLeft","IconButton","icon","square","displayName","SIZES"],"mappings":"geAwBMA,MAAAA,aAAmEC,gBAIvEC,YAA2D,CAACC,EAAOC,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,UACjBA,EAAY,CAAE,EAAAC,mBACdA,EAAqB,CAAE,EAAAC,WACvBA,EAAa,CAAE,EAAAC,UACfA,EAAY,CAAE,EAAAC,kBACdA,EAAoB,CAAE,EAAAC,YACtBA,EAAc,CAAE,EAAAC,MAChBA,EAAKC,KACLA,EAAIC,SACJA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,KACGC,GACDnB,EAEJ,MAAMoB,EAAY,CAChBlB,OACAW,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEG,KAACC,KAAW,IAAKH,KAAeC,EAAWjB,OAAQA,EAAQF,IAAKA,EAAIsB,SAAA,EAChEX,GACAY,IAACF,OAAa,CAAAC,SACZC,IAACC,KAAI,CAACC,OAAO,QAAQC,KAAMC,WAAWzB,GAAS0B,MAAOC,cAAgBV,KAAehB,MAGzFiB,KAACC,UAAgB,CAAAC,SACfF,CAAAA,KAACC,QAAc,CAAAC,SACZb,CAAAA,EACCc,IAACO,KAAI,CACHC,GAAG,IACHC,WAAW,OACXC,OAAQ,IACRC,UAAU,aACVC,MAAM,4BACFhB,KACAd,EAAUiB,SAEbb,IAED,KACHC,EACCa,IAACO,KAAI,CACHC,GAAG,IACHC,WAAW,OACXE,UAAU,aACVC,MAAM,yBACNC,UAAW3B,EAAQ,aAAU4B,EAC7BT,MAAOU,cACHnB,KACAb,EAASgB,SAEZZ,IAED,QAELH,EAAkBgC,SAAW/B,EAAYgC,MAAQhC,EAAYiC,GAC5DrB,KAACC,SAAe,CAAAC,UACbf,EAAkBgC,QACjBhB,IAACmB,OAAM,CAACjB,OAAO,QAAQkB,OAAK,EAACf,MAAOgB,gBAAkBzB,KAAeZ,IACnE,KACHC,EAAYgC,MAAQhC,EAAYiC,GAC/BlB,IAACsB,OAAM,CACLpB,OAAO,QACPqB,WAAS,EACTC,QAAS,CACPZ,MAAO,0BAET7B,UAAW,CACT0B,WAAY,OACZE,UAAW,cAEbc,WAAYzC,EAAkBgC,QAAU,aAAUF,KAC9ClB,KACAX,IAEJ,QAEJ,QAELJ,EAAmBmC,QAClBhB,IAACF,OAAa,CAAAC,SACZC,IAAC0B,WAAU,CAACC,KAAK,QAAQC,QAAM,KAAKhC,KAAef,MAEnD,OACQ,IAGlB,CACEgD,YAtHmB,eAuHnBxB,MAAOyB"}
1
+ {"version":3,"file":"Notification.mjs","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport type { IconProps } from 'components/Icon'\nimport { Icon } from 'components/Icon'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ButtonProps } from 'components/Button'\nimport type { AnchorProps } from 'components/Anchor'\nimport type { TextProps } from 'components/Text'\nimport { Text } from 'components/Text'\nimport { renderSlot } from 'shared/utils/renderSlot'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, SIZES_ACTION, SIZES_TITLE, SIZES_TITLE_WITHOUT_TEXT } from './sizes'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\nimport { LAYOUTS_ADDON, LAYOUTS_CONTAINER } from './layouts'\n\nconst COMPONENT_NAME = 'Notification'\n\nconst createText = (content: unknown, props: TextProps) => {\n return typeof content === 'string' || typeof content === 'number' ? <Text {...props}>{content}</Text> : null\n}\n\n/**\n *\n * *v1.0.0*\n *\n * Компонент для отображения информационных сообщений, встроенных в интерфейс.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n *\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n withIcon = false,\n layout = 'horizontal',\n discardButton,\n icon,\n children,\n content,\n title,\n text,\n addon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const iconProps: IconProps = {\n ...sizeProps,\n preset: 'brand',\n name: 'infoCircle',\n sizes: SIZES_ICON,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n weight: 700,\n sizes: text ? SIZES_TITLE : SIZES_TITLE_WITHOUT_TEXT,\n }\n\n const textProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n wordBreak: 'break-word',\n color: 'content-onmain-primary',\n sizes: SIZES_TEXT,\n }\n\n const buttonProps: ButtonProps = {\n ...sizeProps,\n preset: 'brand',\n black: true,\n sizes: SIZES_ACTION,\n }\n\n const anchorProps: AnchorProps = {\n ...sizeProps,\n preset: 'brand',\n underline: true,\n textProps: {\n appearance: 'body',\n wordBreak: 'break-word',\n },\n }\n\n const discardButtonProps: IconButtonProps = {\n ...sizeProps,\n icon: 'close',\n square: true,\n }\n\n const rootProps = { iconProps, titleProps, textProps, buttonProps, anchorProps, discardButtonProps }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {children ? (\n renderSlot({\n slot: children,\n props: rootProps,\n })\n ) : (\n <>\n {withIcon ? (\n <Styled.Icon>\n {renderSlot({\n slot: icon,\n props: iconProps,\n fallback: <Icon {...iconProps} />,\n })}\n </Styled.Icon>\n ) : null}\n\n <Styled.Container {...layoutProps} layouts={LAYOUTS_CONTAINER}>\n <Styled.Content>\n {renderSlot({\n slot: content,\n props: { titleProps, textProps },\n fallback: (\n <>\n {renderSlot({\n slot: title,\n props: titleProps,\n fallback: createText(title, titleProps),\n })}\n {renderSlot({\n slot: text,\n props: textProps,\n fallback: createText(text, textProps),\n })}\n </>\n ),\n })}\n </Styled.Content>\n\n {addon ? (\n <Styled.Addon {...layoutProps} layouts={LAYOUTS_ADDON}>\n {renderSlot({\n slot: addon,\n props: { anchorProps, buttonProps },\n })}\n </Styled.Addon>\n ) : null}\n </Styled.Container>\n\n {discardButton ? (\n <Styled.DiscardButton>\n {renderSlot({\n slot: discardButton,\n props: discardButtonProps,\n })}\n </Styled.DiscardButton>\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["createText","content","props","_jsx","Text","children","Notification","withMergedProps","forwardRef","ref","size","status","withIcon","layout","discardButton","icon","title","text","addon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","restProps","sizeProps","layoutProps","iconProps","preset","name","sizes","SIZES_ICON","titleProps","as","appearance","color","wordBreak","weight","SIZES_TITLE","SIZES_TITLE_WITHOUT_TEXT","textProps","SIZES_TEXT","buttonProps","black","SIZES_ACTION","anchorProps","underline","discardButtonProps","square","rootProps","Styled","renderSlot","slot","_jsxs","_Fragment","fallback","Icon","layouts","LAYOUTS_CONTAINER","LAYOUTS_ADDON","displayName","SIZES"],"mappings":"ggBAkBA,MAAMA,WAAaA,CAACC,EAAkBC,WACtBD,GAAY,iBAAmBA,GAAY,SAAWE,IAACC,KAAI,IAAKF,EAAKG,SAAGJ,IAAkB,KAYpGK,MAAAA,aAAmEC,gBAIvEC,YAA2D,CAACN,EAAOO,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,SACjBA,GAAW,EAAKC,OAChBA,EAAS,aAAYC,cACrBA,EAAaC,KACbA,EAAIV,SACJA,EAAQJ,QACRA,EAAOe,MACPA,EAAKC,KACLA,EAAIC,MACJA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,KACGC,GACD7B,EAEJ,MAAM8B,EAAY,CAChBtB,OACAS,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMS,EAAc,CAClBpB,SACAY,YACAC,WACAC,UACAC,UACAC,UACAC,YAGF,MAAMI,EAAuB,IACxBF,EACHG,OAAQ,QACRC,KAAM,aACNC,MAAOC,YAGT,MAAMC,EAAwB,IACzBP,EACHQ,GAAI,IACJC,WAAY,OACZC,MAAO,yBACPC,UAAW,aACXC,OAAQ,IACRP,MAAOpB,EAAO4B,YAAcC,0BAG9B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eAwLnB9B,MAAO+B"}
@@ -0,0 +1,2 @@
1
+ 'use strict';exports.LAYOUTS_ADDON={vertical:{marginTop:'var(--gap-container)'},horizontal:{marginTop:0}},exports.LAYOUTS_CONTAINER={vertical:{flexDirection:'column'},horizontal:{flexDirection:'row'}};
2
+ //# sourceMappingURL=layouts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layouts.js","sources":["../../../../src/components/Notification/layouts.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Layout } from './types'\n\nexport const LAYOUTS_CONTAINER: Record<Layout, CSSProperties> = {\n vertical: {\n flexDirection: 'column',\n },\n horizontal: {\n flexDirection: 'row',\n },\n}\n\nexport const LAYOUTS_ADDON: Record<Layout, CSSProperties> = {\n vertical: {\n marginTop: 'var(--gap-container)',\n },\n horizontal: {\n marginTop: 0,\n },\n}\n"],"names":["vertical","marginTop","horizontal","flexDirection"],"mappings":"mCAY4D,CAC1DA,SAAU,CACRC,UAAW,wBAEbC,WAAY,CACVD,UAAW,8BAdiD,CAC9DD,SAAU,CACRG,cAAe,UAEjBD,WAAY,CACVC,cAAe"}
@@ -0,0 +1,2 @@
1
+ const LAYOUTS_CONTAINER={vertical:{flexDirection:'column'},horizontal:{flexDirection:'row'}};const LAYOUTS_ADDON={vertical:{marginTop:'var(--gap-container)'},horizontal:{marginTop:0}};export{LAYOUTS_ADDON,LAYOUTS_CONTAINER};
2
+ //# sourceMappingURL=layouts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layouts.mjs","sources":["../../../../src/components/Notification/layouts.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Layout } from './types'\n\nexport const LAYOUTS_CONTAINER: Record<Layout, CSSProperties> = {\n vertical: {\n flexDirection: 'column',\n },\n horizontal: {\n flexDirection: 'row',\n },\n}\n\nexport const LAYOUTS_ADDON: Record<Layout, CSSProperties> = {\n vertical: {\n marginTop: 'var(--gap-container)',\n },\n horizontal: {\n marginTop: 0,\n },\n}\n"],"names":["LAYOUTS_CONTAINER","vertical","flexDirection","horizontal","LAYOUTS_ADDON","marginTop"],"mappings":"AAGO,MAAMA,kBAAmD,CAC9DC,SAAU,CACRC,cAAe,UAEjBC,WAAY,CACVD,cAAe,QAIZ,MAAME,cAA+C,CAC1DH,SAAU,CACRI,UAAW,wBAEbF,WAAY,CACVE,UAAW"}
@@ -0,0 +1,2 @@
1
+ 'use strict';var sizes=require('../Button/sizes.js');require('../Button/Button.js');const SIZES_ACTION={l:sizes.SIZES.l,m:sizes.SIZES.s,s:sizes.SIZES.s};exports.SIZES={l:{padding:20,borderRadius:12,minHeight:68,'--gap':'12px','--gap-container':'11px'},m:{padding:16,borderRadius:10,minHeight:58,'--gap':'10px','--gap-container':'8px'},s:{padding:12,borderRadius:8,minHeight:44,'--gap':'8px','--gap-container':'6px'}},exports.SIZES_ACTION=SIZES_ACTION,exports.SIZES_ICON={l:{fontSize:28},m:{fontSize:24},s:{fontSize:20}},exports.SIZES_TEXT={l:{fontSize:18,marginTop:2},m:{fontSize:16,marginTop:3},s:{fontSize:14,marginTop:1}},exports.SIZES_TITLE={l:{fontSize:20,marginTop:1,marginBottom:5},m:{fontSize:20,marginTop:-1,marginBottom:2},s:{fontSize:16,marginTop:1,marginBottom:1}},exports.SIZES_TITLE_WITHOUT_TEXT={l:{fontSize:20,marginTop:1,marginBottom:0},m:{fontSize:20,marginTop:-1,marginBottom:0},s:{fontSize:16,marginTop:1,marginBottom:0}};
2
+ //# sourceMappingURL=sizes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizes.js","sources":["../../../../src/components/Notification/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_BUTTON } from 'components/Button'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n l: {\n padding: 20,\n borderRadius: 12,\n minHeight: 68,\n '--gap': '12px',\n '--gap-container': '11px',\n },\n m: {\n padding: 16,\n borderRadius: 10,\n minHeight: 58,\n '--gap': '10px',\n '--gap-container': '8px',\n },\n s: {\n padding: 12,\n borderRadius: 8,\n minHeight: 44,\n '--gap': '8px',\n '--gap-container': '6px',\n },\n}\n\nexport const SIZES_ICON: Record<Size, CSSProperties> = {\n l: { fontSize: 28 },\n m: { fontSize: 24 },\n s: { fontSize: 20 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n l: { fontSize: 20, marginTop: 1, marginBottom: 5 },\n m: { fontSize: 20, marginTop: -1, marginBottom: 2 },\n s: { fontSize: 16, marginTop: 1, marginBottom: 1 },\n}\n\nexport const SIZES_TITLE_WITHOUT_TEXT: Record<Size, CSSProperties> = {\n l: { fontSize: 20, marginTop: 1, marginBottom: 0 },\n m: { fontSize: 20, marginTop: -1, marginBottom: 0 },\n s: { fontSize: 16, marginTop: 1, marginBottom: 0 },\n}\n\nexport const SIZES_TEXT: Record<Size, CSSProperties> = {\n l: { fontSize: 18, marginTop: 2 },\n m: { fontSize: 16, marginTop: 3 },\n s: { fontSize: 14, marginTop: 1 },\n}\n\nexport const SIZES_ACTION: Record<Size, CSSProperties> = {\n l: SIZES_BUTTON.l,\n m: SIZES_BUTTON.s,\n s: SIZES_BUTTON.s,\n}\n"],"names":["SIZES_ACTION","l","SIZES_BUTTON","SIZES","m","s","padding","borderRadius","minHeight","fontSize","marginTop","marginBottom"],"mappings":"oFAoDO,MAAMA,aAA4C,CACvDC,EAAGC,MAAYC,MAACF,EAChBG,EAAGF,MAAYC,MAACE,EAChBA,EAAGH,MAAYC,MAACE,iBAnDgC,CAChDJ,EAAG,CACDK,QAAS,GACTC,aAAc,GACdC,UAAW,GACX,QAAS,OACT,kBAAmB,QAErBJ,EAAG,CACDE,QAAS,GACTC,aAAc,GACdC,UAAW,GACX,QAAS,OACT,kBAAmB,OAErBH,EAAG,CACDC,QAAS,GACTC,aAAc,EACdC,UAAW,GACX,QAAS,MACT,kBAAmB,6DAIgC,CACrDP,EAAG,CAAEQ,SAAU,IACfL,EAAG,CAAEK,SAAU,IACfJ,EAAG,CAAEI,SAAU,wBAesC,CACrDR,EAAG,CAAEQ,SAAU,GAAIC,UAAW,GAC9BN,EAAG,CAAEK,SAAU,GAAIC,UAAW,GAC9BL,EAAG,CAAEI,SAAU,GAAIC,UAAW,wBAfwB,CACtDT,EAAG,CAAEQ,SAAU,GAAIC,UAAW,EAAGC,aAAc,GAC/CP,EAAG,CAAEK,SAAU,GAAIC,WAAY,EAAGC,aAAc,GAChDN,EAAG,CAAEI,SAAU,GAAIC,UAAW,EAAGC,aAAc,qCAGoB,CACnEV,EAAG,CAAEQ,SAAU,GAAIC,UAAW,EAAGC,aAAc,GAC/CP,EAAG,CAAEK,SAAU,GAAIC,WAAY,EAAGC,aAAc,GAChDN,EAAG,CAAEI,SAAU,GAAIC,UAAW,EAAGC,aAAc"}
@@ -0,0 +1,2 @@
1
+ import{SIZES as SIZES$1}from'../Button/sizes.mjs';import'../Button/Button.mjs';const SIZES={l:{padding:20,borderRadius:12,minHeight:68,'--gap':'12px','--gap-container':'11px'},m:{padding:16,borderRadius:10,minHeight:58,'--gap':'10px','--gap-container':'8px'},s:{padding:12,borderRadius:8,minHeight:44,'--gap':'8px','--gap-container':'6px'}};const SIZES_ICON={l:{fontSize:28},m:{fontSize:24},s:{fontSize:20}};const SIZES_TITLE={l:{fontSize:20,marginTop:1,marginBottom:5},m:{fontSize:20,marginTop:-1,marginBottom:2},s:{fontSize:16,marginTop:1,marginBottom:1}};const SIZES_TITLE_WITHOUT_TEXT={l:{fontSize:20,marginTop:1,marginBottom:0},m:{fontSize:20,marginTop:-1,marginBottom:0},s:{fontSize:16,marginTop:1,marginBottom:0}};const SIZES_TEXT={l:{fontSize:18,marginTop:2},m:{fontSize:16,marginTop:3},s:{fontSize:14,marginTop:1}};const SIZES_ACTION={l:SIZES$1.l,m:SIZES$1.s,s:SIZES$1.s};export{SIZES,SIZES_ACTION,SIZES_ICON,SIZES_TEXT,SIZES_TITLE,SIZES_TITLE_WITHOUT_TEXT};
2
+ //# sourceMappingURL=sizes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizes.mjs","sources":["../../../../src/components/Notification/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_BUTTON } from 'components/Button'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n l: {\n padding: 20,\n borderRadius: 12,\n minHeight: 68,\n '--gap': '12px',\n '--gap-container': '11px',\n },\n m: {\n padding: 16,\n borderRadius: 10,\n minHeight: 58,\n '--gap': '10px',\n '--gap-container': '8px',\n },\n s: {\n padding: 12,\n borderRadius: 8,\n minHeight: 44,\n '--gap': '8px',\n '--gap-container': '6px',\n },\n}\n\nexport const SIZES_ICON: Record<Size, CSSProperties> = {\n l: { fontSize: 28 },\n m: { fontSize: 24 },\n s: { fontSize: 20 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n l: { fontSize: 20, marginTop: 1, marginBottom: 5 },\n m: { fontSize: 20, marginTop: -1, marginBottom: 2 },\n s: { fontSize: 16, marginTop: 1, marginBottom: 1 },\n}\n\nexport const SIZES_TITLE_WITHOUT_TEXT: Record<Size, CSSProperties> = {\n l: { fontSize: 20, marginTop: 1, marginBottom: 0 },\n m: { fontSize: 20, marginTop: -1, marginBottom: 0 },\n s: { fontSize: 16, marginTop: 1, marginBottom: 0 },\n}\n\nexport const SIZES_TEXT: Record<Size, CSSProperties> = {\n l: { fontSize: 18, marginTop: 2 },\n m: { fontSize: 16, marginTop: 3 },\n s: { fontSize: 14, marginTop: 1 },\n}\n\nexport const SIZES_ACTION: Record<Size, CSSProperties> = {\n l: SIZES_BUTTON.l,\n m: SIZES_BUTTON.s,\n s: SIZES_BUTTON.s,\n}\n"],"names":["SIZES","l","padding","borderRadius","minHeight","m","s","SIZES_ICON","fontSize","SIZES_TITLE","marginTop","marginBottom","SIZES_TITLE_WITHOUT_TEXT","SIZES_TEXT","SIZES_ACTION","SIZES_BUTTON"],"mappings":"+EAIO,MAAMA,MAAqC,CAChDC,EAAG,CACDC,QAAS,GACTC,aAAc,GACdC,UAAW,GACX,QAAS,OACT,kBAAmB,QAErBC,EAAG,CACDH,QAAS,GACTC,aAAc,GACdC,UAAW,GACX,QAAS,OACT,kBAAmB,OAErBE,EAAG,CACDJ,QAAS,GACTC,aAAc,EACdC,UAAW,GACX,QAAS,MACT,kBAAmB,QAIhB,MAAMG,WAA0C,CACrDN,EAAG,CAAEO,SAAU,IACfH,EAAG,CAAEG,SAAU,IACfF,EAAG,CAAEE,SAAU,KAGV,MAAMC,YAA2C,CACtDR,EAAG,CAAEO,SAAU,GAAIE,UAAW,EAAGC,aAAc,GAC/CN,EAAG,CAAEG,SAAU,GAAIE,WAAY,EAAGC,aAAc,GAChDL,EAAG,CAAEE,SAAU,GAAIE,UAAW,EAAGC,aAAc,IAG1C,MAAMC,yBAAwD,CACnEX,EAAG,CAAEO,SAAU,GAAIE,UAAW,EAAGC,aAAc,GAC/CN,EAAG,CAAEG,SAAU,GAAIE,WAAY,EAAGC,aAAc,GAChDL,EAAG,CAAEE,SAAU,GAAIE,UAAW,EAAGC,aAAc,IAG1C,MAAME,WAA0C,CACrDZ,EAAG,CAAEO,SAAU,GAAIE,UAAW,GAC9BL,EAAG,CAAEG,SAAU,GAAIE,UAAW,GAC9BJ,EAAG,CAAEE,SAAU,GAAIE,UAAW,IAGzB,MAAMI,aAA4C,CACvDb,EAAGc,QAAad,EAChBI,EAAGU,QAAaT,EAChBA,EAAGS,QAAaT"}
@@ -1,2 +1,2 @@
1
- 'use strict';var styled=require('styled-components');var style=require('../../shared/utils/style.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const shouldForwardNotificationProp=style.createShouldForwardProp((e=>!['status','contentDirectionColumn'].includes(e)));const template=e=>`\n color: ${e.color};\n background-color: ${e.backgroundColor};\n`;const COLOR_SCHEMA={system:styled.css(["",""],(e=>template({color:e.theme.colors['content-onmain-primary'],backgroundColor:e.theme.colors['bg-onmain-secondary'],...e.palette}))),info:styled.css(["",""],(e=>template({color:e.theme.colors['alert-info'],backgroundColor:e.theme.colors['alert-bg-info-100'],...e.palette}))),success:styled.css(["",""],(e=>template({color:e.theme.colors['alert-success'],backgroundColor:e.theme.colors['alert-bg-success-100'],...e.palette}))),error:styled.css(["",""],(e=>template({color:e.theme.colors['alert-error'],backgroundColor:e.theme.colors['alert-bg-error-100'],...e.palette}))),warning:styled.css(["",""],(e=>template({color:e.theme.colors['alert-warning'],backgroundColor:e.theme.colors['alert-bg-warning-100'],...e.palette})))};const Container=styled__default.default.div.withConfig({displayName:"Notification__Container",componentId:"ui__sc-19hb9p3-0"})(["box-sizing:border-box;display:flex;flex-grow:1;"]);const Controls=styled__default.default.div.withConfig({displayName:"Notification__Controls",componentId:"ui__sc-19hb9p3-1"})(["box-sizing:border-box;display:flex;align-items:center;margin:0.2em 0.6em 0.2em 0;& > *{flex-shrink:1;}"]);const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardNotificationProp}).withConfig({displayName:"Notification__Root",componentId:"ui__sc-19hb9p3-2"})(["box-sizing:border-box;display:flex;min-width:min-content;"," "," "," ",""],(e=>COLOR_SCHEMA[e.status]),(e=>`\n ${Container} {\n flex-direction: ${e.contentDirectionColumn?'column':'row'};\n flex-wrap: ${e.contentDirectionColumn?'nowrap':'wrap'};\n }\n ${Controls} {\n justify-content: ${e.contentDirectionColumn?'flex-start':'flex-end'};\n }\n `),responsiveSize.responsiveSize,responsiveMargin.responsiveMargin);const Spacer=styled__default.default.div.withConfig({displayName:"Notification__Spacer",componentId:"ui__sc-19hb9p3-3"})(["box-sizing:border-box;display:flex;flex-shrink:0;margin:0.1em 0;&:first-child{margin-right:0.6em;}"]);const Content=styled__default.default.div.withConfig({displayName:"Notification__Content",componentId:"ui__sc-19hb9p3-4"})(["box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;flex-basis:60%;flex-grow:1;margin:0.2em 0.6em 0.2em 0;"]);exports.Container=Container,exports.Content=Content,exports.Controls=Controls,exports.Root=Root,exports.Spacer=Spacer;
1
+ 'use strict';var styled=require('styled-components');var style=require('../../shared/utils/style.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');var responsiveLayout=require('../../mixins/responsive-layout.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const filterLayoutProps=o=>!['layout','layoutXXS','layoutXS','layoutS','layoutM','layoutL','layoutXL','layouts'].includes(o);const shouldForwardNotificationProp=style.createShouldForwardProp((o=>!['status'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n`;const COLOR_SCHEMA={system:styled.css(["",""],(o=>template({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-secondary'],...o.palette}))),info:styled.css(["",""],(o=>template({color:o.theme.colors['alert-info'],backgroundColor:o.theme.colors['alert-bg-info-100'],...o.palette}))),success:styled.css(["",""],(o=>template({color:o.theme.colors['alert-success'],backgroundColor:o.theme.colors['alert-bg-success-100'],...o.palette}))),error:styled.css(["",""],(o=>template({color:o.theme.colors['alert-error'],backgroundColor:o.theme.colors['alert-bg-error-100'],...o.palette}))),warning:styled.css(["",""],(o=>template({color:o.theme.colors['alert-warning'],backgroundColor:o.theme.colors['alert-bg-warning-100'],...o.palette})))};const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardNotificationProp}).withConfig({displayName:"Notification__Root",componentId:"ui__sc-19hb9p3-0"})(["box-sizing:border-box;display:flex;min-width:min-content;& > *:not(:last-child){margin-right:var(--gap);}"," "," ",""],(o=>COLOR_SCHEMA[o.status]),responsiveSize.responsiveSize,responsiveMargin.responsiveMargin);const Container=styled__default.default.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"Notification__Container",componentId:"ui__sc-19hb9p3-1"})(["box-sizing:border-box;display:flex;align-items:flex-start;flex-grow:1;& > *:not(:last-child){margin-right:var(--gap-container);}",""],responsiveLayout.responsiveLayout);const Icon=styled__default.default.div.withConfig({displayName:"Notification__Icon",componentId:"ui__sc-19hb9p3-2"})(["box-sizing:border-box;display:flex;flex-shrink:0;height:fit-content;"]);const DiscardButton=styled__default.default.div.withConfig({displayName:"Notification__DiscardButton",componentId:"ui__sc-19hb9p3-3"})(["box-sizing:border-box;display:flex;flex-shrink:0;height:fit-content;"]);const Content=styled__default.default.div.withConfig({displayName:"Notification__Content",componentId:"ui__sc-19hb9p3-4"})(["box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;flex-basis:58%;flex-grow:1;width:100%;height:fit-content;"]);const Addon=styled__default.default.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"Notification__Addon",componentId:"ui__sc-19hb9p3-5"})(["box-sizing:border-box;display:flex;height:100%;",""],responsiveLayout.responsiveLayout);exports.Addon=Addon,exports.Container=Container,exports.Content=Content,exports.DiscardButton=DiscardButton,exports.Icon=Icon,exports.Root=Root;
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/Notification/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { FlattenInterpolation, ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport type { StyledNotificationProps, NotificationPalette, NotificationStatus } from './types'\n\nconst shouldForwardNotificationProp = createShouldForwardProp(\n (propKey) => !['status', 'contentDirectionColumn'].includes(propKey)\n)\n\nconst template = (palette: NotificationPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n`\n\nconst COLOR_SCHEMA: Record<\n NotificationStatus,\n FlattenInterpolation<ThemedStyledProps<StyledNotificationProps, DefaultTheme>>\n> = {\n system: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-secondary'],\n ...props.palette,\n })}\n `,\n info: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-info'],\n backgroundColor: props.theme.colors['alert-bg-info-100'],\n ...props.palette,\n })}\n `,\n success: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-success'],\n backgroundColor: props.theme.colors['alert-bg-success-100'],\n ...props.palette,\n })}\n `,\n error: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-error'],\n backgroundColor: props.theme.colors['alert-bg-error-100'],\n ...props.palette,\n })}\n `,\n warning: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-warning'],\n backgroundColor: props.theme.colors['alert-bg-warning-100'],\n ...props.palette,\n })}\n `,\n}\n\nexport const Container = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-grow: 1;\n`\n\nexport const Controls = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n margin: 0.2em 0.6em 0.2em 0;\n\n & > * {\n flex-shrink: 1;\n }\n`\n\nexport const Root = styled.div.withConfig<StyledNotificationProps>({\n shouldForwardProp: shouldForwardNotificationProp,\n})`\n box-sizing: border-box;\n display: flex;\n min-width: min-content;\n\n ${(props) => COLOR_SCHEMA[props.status]}\n\n ${(props) => `\n ${Container} {\n flex-direction: ${props.contentDirectionColumn ? 'column' : 'row'};\n flex-wrap: ${props.contentDirectionColumn ? 'nowrap' : 'wrap'};\n }\n ${Controls} {\n justify-content: ${props.contentDirectionColumn ? 'flex-start' : 'flex-end'};\n }\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n`\n\nexport const Spacer = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-shrink: 0;\n margin: 0.1em 0;\n &:first-child {\n margin-right: 0.6em;\n }\n`\n\nexport const Content = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-basis: 60%;\n flex-grow: 1;\n margin: 0.2em 0.6em 0.2em 0;\n`\n"],"names":["shouldForwardNotificationProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","COLOR_SCHEMA","system","css","props","theme","colors","info","success","error","warning","Container","styled","div","withConfig","displayName","componentId","Controls","Root","shouldForwardProp","status","contentDirectionColumn","responsiveSize","responsiveMargin","Spacer","Content"],"mappings":"mVAOA,MAAMA,8BAAgCC,MAAAA,yBACnCC,IAAa,CAAC,SAAU,0BAA0BC,SAASD,KAG9D,MAAME,SAAYC,GAAiC,cACxCA,EAAQC,+BACGD,EAAQE,qBAG9B,MAAMC,aAGF,CACFC,OAAQC,OAAGA,IAAA,CAAA,GAAA,KACNC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,0BAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,0BACjCF,EAAMN,YAGfS,KAAMJ,OAAGA,IAAA,CAAA,GAAA,KACJC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,cAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,wBACjCF,EAAMN,YAGfU,QAASL,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,iBAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,2BACjCF,EAAMN,YAGfW,MAAON,OAAGA,IAAA,CAAA,GAAA,KACLC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,eAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,yBACjCF,EAAMN,YAGfY,QAASP,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,iBAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,2BACjCF,EAAMN,mBAKJa,UAAYC,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,0BAAAC,YAAA,oBAAVJ,CAIxB,CAAA,0DAEYK,SAAWL,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,yBAAAC,YAAA,oBAAVJ,CASvB,CAAA,2GAEM,MAAMM,KAAON,gBAAAA,QAAOC,IAAIC,WAAoC,CACjEK,kBAAmB1B,gCACnBqB,WAAA,CAAAC,YAAA,qBAAAC,YAAA,oBAFkBJ,CAOfR,CAAAA,4DAAAA,IAAAA,IAAAA,IAAAA,KAAAA,GAAUH,aAAaG,EAAMgB,UAE7BhB,GAAU,SACTO,sCACkBP,EAAMiB,uBAAyB,SAAW,4BAC/CjB,EAAMiB,uBAAyB,SAAW,uBAEvDJ,sCACmBb,EAAMiB,uBAAyB,aAAe,0BAInEC,eAAcA,eACdC,yCAGSC,OAASZ,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,uBAAAC,YAAA,oBAAVJ,CAQrB,CAAA,6GAEYa,QAAUb,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,wBAAAC,YAAA,oBAAVJ,CAQtB,CAAA"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/Notification/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { FlattenInterpolation, ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport type { ResponsiveLayoutInterpolationProps } from 'shared/interfaces'\nimport { responsiveLayout } from 'mixins/responsive-layout'\nimport type { StyledNotificationProps, NotificationPalette, NotificationStatus, Layout } from './types'\n\nconst filterLayoutProps = (propKey: string) =>\n !['layout', 'layoutXXS', 'layoutXS', 'layoutS', 'layoutM', 'layoutL', 'layoutXL', 'layouts'].includes(propKey)\n\nconst shouldForwardNotificationProp = createShouldForwardProp((propKey) => !['status'].includes(propKey))\n\nconst template = (palette: NotificationPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n`\n\nconst COLOR_SCHEMA: Record<\n NotificationStatus,\n FlattenInterpolation<ThemedStyledProps<StyledNotificationProps, DefaultTheme>>\n> = {\n system: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-secondary'],\n ...props.palette,\n })}\n `,\n info: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-info'],\n backgroundColor: props.theme.colors['alert-bg-info-100'],\n ...props.palette,\n })}\n `,\n success: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-success'],\n backgroundColor: props.theme.colors['alert-bg-success-100'],\n ...props.palette,\n })}\n `,\n error: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-error'],\n backgroundColor: props.theme.colors['alert-bg-error-100'],\n ...props.palette,\n })}\n `,\n warning: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-warning'],\n backgroundColor: props.theme.colors['alert-bg-warning-100'],\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledNotificationProps>({\n shouldForwardProp: shouldForwardNotificationProp,\n})`\n box-sizing: border-box;\n display: flex;\n min-width: min-content;\n\n & > *:not(:last-child) {\n margin-right: var(--gap);\n }\n\n ${(props) => COLOR_SCHEMA[props.status]}\n\n ${responsiveSize}\n ${responsiveMargin}\n`\n\nexport const Container = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n display: flex;\n align-items: flex-start;\n flex-grow: 1;\n\n & > *:not(:last-child) {\n margin-right: var(--gap-container);\n }\n\n ${responsiveLayout}\n`\n\nexport const Icon = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-shrink: 0;\n height: fit-content;\n`\n\nexport const DiscardButton = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-shrink: 0;\n height: fit-content;\n`\n\nexport const Content = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-basis: 58%;\n flex-grow: 1;\n width: 100%;\n height: fit-content;\n`\n\nexport const Addon = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n display: flex;\n height: 100%;\n\n ${responsiveLayout}\n`\n"],"names":["filterLayoutProps","propKey","includes","shouldForwardNotificationProp","createShouldForwardProp","template","palette","color","backgroundColor","COLOR_SCHEMA","system","css","props","theme","colors","info","success","error","warning","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","status","responsiveSize","responsiveMargin","Container","responsiveLayout","Icon","DiscardButton","Content","Addon"],"mappings":"qZASA,MAAMA,kBAAqBC,IACxB,CAAC,SAAU,YAAa,WAAY,UAAW,UAAW,UAAW,WAAY,WAAWC,SAASD,GAExG,MAAME,8BAAgCC,MAAAA,yBAAyBH,IAAa,CAAC,UAAUC,SAASD,KAEhG,MAAMI,SAAYC,GAAiC,cACxCA,EAAQC,+BACGD,EAAQE,qBAG9B,MAAMC,aAGF,CACFC,OAAQC,OAAGA,IAAA,CAAA,GAAA,KACNC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,0BAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,0BACjCF,EAAMN,YAGfS,KAAMJ,OAAGA,IAAA,CAAA,GAAA,KACJC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,cAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,wBACjCF,EAAMN,YAGfU,QAASL,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,iBAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,2BACjCF,EAAMN,YAGfW,MAAON,OAAGA,IAAA,CAAA,GAAA,KACLC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,eAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,yBACjCF,EAAMN,YAGfY,QAASP,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDP,SAAS,CACPE,MAAOK,EAAMC,MAAMC,OAAO,iBAC1BN,gBAAiBI,EAAMC,MAAMC,OAAO,2BACjCF,EAAMN,aAKV,MAAMa,KAAOC,gBAAAA,QAAOC,IAAIC,WAAoC,CACjEC,kBAAmBpB,gCACnBmB,WAAA,CAAAE,YAAA,qBAAAC,YAAA,oBAFkBL,CAElB,CAAA,4GAAA,IAAA,IAAA,KASGR,GAAUH,aAAaG,EAAMc,SAE9BC,eAAAA,eACAC,iBAAAA,kBAGG,MAAMC,UAAYT,gBAAAA,QAAOC,IAAIC,WAAuD,CACzFC,kBAAmBvB,oBACnBsB,WAAA,CAAAE,YAAA,0BAAAC,YAAA,oBAFuBL,CAEvB,CAAA,mIAAA,IAUEU,iBAAAA,wBAGSC,KAAOX,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,qBAAAC,YAAA,oBAAVL,CAKnB,CAAA,+EAEYY,cAAgBZ,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,8BAAAC,YAAA,oBAAVL,CAK5B,CAAA,+EAEYa,QAAUb,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,wBAAAC,YAAA,oBAAVL,CAStB,CAAA,8IAEM,MAAMc,MAAQd,gBAAAA,QAAOC,IAAIC,WAAuD,CACrFC,kBAAmBvB,oBACnBsB,WAAA,CAAAE,YAAA,sBAAAC,YAAA,oBAFmBL,CAEnB,CAAA,kDAAA,IAKEU,iBAAgBA"}
@@ -1,2 +1,2 @@
1
- import styled,{css}from'styled-components';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';const shouldForwardNotificationProp=createShouldForwardProp((o=>!['status','contentDirectionColumn'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n`;const COLOR_SCHEMA={system:css(["",""],(o=>template({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-secondary'],...o.palette}))),info:css(["",""],(o=>template({color:o.theme.colors['alert-info'],backgroundColor:o.theme.colors['alert-bg-info-100'],...o.palette}))),success:css(["",""],(o=>template({color:o.theme.colors['alert-success'],backgroundColor:o.theme.colors['alert-bg-success-100'],...o.palette}))),error:css(["",""],(o=>template({color:o.theme.colors['alert-error'],backgroundColor:o.theme.colors['alert-bg-error-100'],...o.palette}))),warning:css(["",""],(o=>template({color:o.theme.colors['alert-warning'],backgroundColor:o.theme.colors['alert-bg-warning-100'],...o.palette})))};const Container=styled.div.withConfig({displayName:"Notification__Container",componentId:"ui__sc-19hb9p3-0"})(["box-sizing:border-box;display:flex;flex-grow:1;"]);const Controls=styled.div.withConfig({displayName:"Notification__Controls",componentId:"ui__sc-19hb9p3-1"})(["box-sizing:border-box;display:flex;align-items:center;margin:0.2em 0.6em 0.2em 0;& > *{flex-shrink:1;}"]);const Root=styled.div.withConfig({shouldForwardProp:shouldForwardNotificationProp}).withConfig({displayName:"Notification__Root",componentId:"ui__sc-19hb9p3-2"})(["box-sizing:border-box;display:flex;min-width:min-content;"," "," "," ",""],(o=>COLOR_SCHEMA[o.status]),(o=>`\n ${Container} {\n flex-direction: ${o.contentDirectionColumn?'column':'row'};\n flex-wrap: ${o.contentDirectionColumn?'nowrap':'wrap'};\n }\n ${Controls} {\n justify-content: ${o.contentDirectionColumn?'flex-start':'flex-end'};\n }\n `),responsiveSize,responsiveMargin);const Spacer=styled.div.withConfig({displayName:"Notification__Spacer",componentId:"ui__sc-19hb9p3-3"})(["box-sizing:border-box;display:flex;flex-shrink:0;margin:0.1em 0;&:first-child{margin-right:0.6em;}"]);const Content=styled.div.withConfig({displayName:"Notification__Content",componentId:"ui__sc-19hb9p3-4"})(["box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;flex-basis:60%;flex-grow:1;margin:0.2em 0.6em 0.2em 0;"]);export{Container,Content,Controls,Root,Spacer};
1
+ import styled,{css}from'styled-components';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';import{responsiveLayout}from'../../mixins/responsive-layout.mjs';const filterLayoutProps=o=>!['layout','layoutXXS','layoutXS','layoutS','layoutM','layoutL','layoutXL','layouts'].includes(o);const shouldForwardNotificationProp=createShouldForwardProp((o=>!['status'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n`;const COLOR_SCHEMA={system:css(["",""],(o=>template({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-secondary'],...o.palette}))),info:css(["",""],(o=>template({color:o.theme.colors['alert-info'],backgroundColor:o.theme.colors['alert-bg-info-100'],...o.palette}))),success:css(["",""],(o=>template({color:o.theme.colors['alert-success'],backgroundColor:o.theme.colors['alert-bg-success-100'],...o.palette}))),error:css(["",""],(o=>template({color:o.theme.colors['alert-error'],backgroundColor:o.theme.colors['alert-bg-error-100'],...o.palette}))),warning:css(["",""],(o=>template({color:o.theme.colors['alert-warning'],backgroundColor:o.theme.colors['alert-bg-warning-100'],...o.palette})))};const Root=styled.div.withConfig({shouldForwardProp:shouldForwardNotificationProp}).withConfig({displayName:"Notification__Root",componentId:"ui__sc-19hb9p3-0"})(["box-sizing:border-box;display:flex;min-width:min-content;& > *:not(:last-child){margin-right:var(--gap);}"," "," ",""],(o=>COLOR_SCHEMA[o.status]),responsiveSize,responsiveMargin);const Container=styled.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"Notification__Container",componentId:"ui__sc-19hb9p3-1"})(["box-sizing:border-box;display:flex;align-items:flex-start;flex-grow:1;& > *:not(:last-child){margin-right:var(--gap-container);}",""],responsiveLayout);const Icon=styled.div.withConfig({displayName:"Notification__Icon",componentId:"ui__sc-19hb9p3-2"})(["box-sizing:border-box;display:flex;flex-shrink:0;height:fit-content;"]);const DiscardButton=styled.div.withConfig({displayName:"Notification__DiscardButton",componentId:"ui__sc-19hb9p3-3"})(["box-sizing:border-box;display:flex;flex-shrink:0;height:fit-content;"]);const Content=styled.div.withConfig({displayName:"Notification__Content",componentId:"ui__sc-19hb9p3-4"})(["box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;flex-basis:58%;flex-grow:1;width:100%;height:fit-content;"]);const Addon=styled.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"Notification__Addon",componentId:"ui__sc-19hb9p3-5"})(["box-sizing:border-box;display:flex;height:100%;",""],responsiveLayout);export{Addon,Container,Content,DiscardButton,Icon,Root};
2
2
  //# sourceMappingURL=style.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","sources":["../../../../src/components/Notification/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { FlattenInterpolation, ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport type { StyledNotificationProps, NotificationPalette, NotificationStatus } from './types'\n\nconst shouldForwardNotificationProp = createShouldForwardProp(\n (propKey) => !['status', 'contentDirectionColumn'].includes(propKey)\n)\n\nconst template = (palette: NotificationPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n`\n\nconst COLOR_SCHEMA: Record<\n NotificationStatus,\n FlattenInterpolation<ThemedStyledProps<StyledNotificationProps, DefaultTheme>>\n> = {\n system: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-secondary'],\n ...props.palette,\n })}\n `,\n info: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-info'],\n backgroundColor: props.theme.colors['alert-bg-info-100'],\n ...props.palette,\n })}\n `,\n success: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-success'],\n backgroundColor: props.theme.colors['alert-bg-success-100'],\n ...props.palette,\n })}\n `,\n error: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-error'],\n backgroundColor: props.theme.colors['alert-bg-error-100'],\n ...props.palette,\n })}\n `,\n warning: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-warning'],\n backgroundColor: props.theme.colors['alert-bg-warning-100'],\n ...props.palette,\n })}\n `,\n}\n\nexport const Container = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-grow: 1;\n`\n\nexport const Controls = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n margin: 0.2em 0.6em 0.2em 0;\n\n & > * {\n flex-shrink: 1;\n }\n`\n\nexport const Root = styled.div.withConfig<StyledNotificationProps>({\n shouldForwardProp: shouldForwardNotificationProp,\n})`\n box-sizing: border-box;\n display: flex;\n min-width: min-content;\n\n ${(props) => COLOR_SCHEMA[props.status]}\n\n ${(props) => `\n ${Container} {\n flex-direction: ${props.contentDirectionColumn ? 'column' : 'row'};\n flex-wrap: ${props.contentDirectionColumn ? 'nowrap' : 'wrap'};\n }\n ${Controls} {\n justify-content: ${props.contentDirectionColumn ? 'flex-start' : 'flex-end'};\n }\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n`\n\nexport const Spacer = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-shrink: 0;\n margin: 0.1em 0;\n &:first-child {\n margin-right: 0.6em;\n }\n`\n\nexport const Content = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-basis: 60%;\n flex-grow: 1;\n margin: 0.2em 0.6em 0.2em 0;\n`\n"],"names":["shouldForwardNotificationProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","COLOR_SCHEMA","system","css","props","theme","colors","info","success","error","warning","Container","styled","div","withConfig","displayName","componentId","Controls","Root","shouldForwardProp","status","contentDirectionColumn","responsiveSize","responsiveMargin","Spacer","Content"],"mappings":"2OAOA,MAAMA,8BAAgCC,yB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B,EAAMiB,uBAAyB,SAAW,uBAEvDJ,sCACmBb,EAAMiB,uBAAyB,aAAe,0BAInEC,eACAC,wBAGSC,OAASZ,OAAOC,IAAGC,WAAA,CAAAC,YAAA,uBAAAC,YAAA,oBAAVJ,CAQrB,CAAA,6GAEYa,QAAUb,OAAOC,IAAGC,WAAA,CAAAC,YAAA,wBAAAC,YAAA,oBAAVJ,CAQtB,CAAA"}
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/Notification/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { FlattenInterpolation, ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport type { ResponsiveLayoutInterpolationProps } from 'shared/interfaces'\nimport { responsiveLayout } from 'mixins/responsive-layout'\nimport type { StyledNotificationProps, NotificationPalette, NotificationStatus, Layout } from './types'\n\nconst filterLayoutProps = (propKey: string) =>\n !['layout', 'layoutXXS', 'layoutXS', 'layoutS', 'layoutM', 'layoutL', 'layoutXL', 'layouts'].includes(propKey)\n\nconst shouldForwardNotificationProp = createShouldForwardProp((propKey) => !['status'].includes(propKey))\n\nconst template = (palette: NotificationPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n`\n\nconst COLOR_SCHEMA: Record<\n NotificationStatus,\n FlattenInterpolation<ThemedStyledProps<StyledNotificationProps, DefaultTheme>>\n> = {\n system: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-secondary'],\n ...props.palette,\n })}\n `,\n info: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-info'],\n backgroundColor: props.theme.colors['alert-bg-info-100'],\n ...props.palette,\n })}\n `,\n success: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-success'],\n backgroundColor: props.theme.colors['alert-bg-success-100'],\n ...props.palette,\n })}\n `,\n error: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-error'],\n backgroundColor: props.theme.colors['alert-bg-error-100'],\n ...props.palette,\n })}\n `,\n warning: css<StyledNotificationProps>`\n ${(props) =>\n template({\n color: props.theme.colors['alert-warning'],\n backgroundColor: props.theme.colors['alert-bg-warning-100'],\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledNotificationProps>({\n shouldForwardProp: shouldForwardNotificationProp,\n})`\n box-sizing: border-box;\n display: flex;\n min-width: min-content;\n\n & > *:not(:last-child) {\n margin-right: var(--gap);\n }\n\n ${(props) => COLOR_SCHEMA[props.status]}\n\n ${responsiveSize}\n ${responsiveMargin}\n`\n\nexport const Container = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n display: flex;\n align-items: flex-start;\n flex-grow: 1;\n\n & > *:not(:last-child) {\n margin-right: var(--gap-container);\n }\n\n ${responsiveLayout}\n`\n\nexport const Icon = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-shrink: 0;\n height: fit-content;\n`\n\nexport const DiscardButton = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-shrink: 0;\n height: fit-content;\n`\n\nexport const Content = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex-basis: 58%;\n flex-grow: 1;\n width: 100%;\n height: fit-content;\n`\n\nexport const Addon = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n display: flex;\n height: 100%;\n\n ${responsiveLayout}\n`\n"],"names":["filterLayoutProps","propKey","includes","shouldForwardNotificationProp","createShouldForwardProp","template","palette","color","backgroundColor","COLOR_SCHEMA","system","css","props","theme","colors","info","success","error","warning","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","status","responsiveSize","responsive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