@mage-ui/components 1.0.111 → 1.0.113

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 client";import{cx as e}from"@mage-ui/styled-system/css";import{toast as t,toastBody as n,toastCloseButton as r,toastDescription as i,toastIcon as a,toastLoader as o,toastNotifications as s,toastRoot as c,toastTitle as l}from"@mage-ui/styled-system/recipes";import{jsx as u}from"react/jsx-runtime";import{Notifications as d,notifications as f}from"@mantine/notifications";const p={neutral:`neutral`,info:`info`,success:`success`,warning:`warning`,danger:`danger`},m=(s,u)=>{let d=s&&s!==`default`?p[s]:void 0,f=d?c({intent:d}):c();return{root:e(u?.toast??t(),u?.root??f),icon:e(u?.icon??a()),loader:e(u?.loader??o()),body:e(u?.body??n()),title:e(u?.title??l()),description:e(u?.description??i()),closeButton:e(u?.closeButton??r())}},h={Provider:({position:e=`top-right`,autoClose:t=5e3,limit:n=5,zIndex:r,transitionDuration:i=250,notificationMaxHeight:a=200})=>u(d,{position:e,autoClose:t,limit:n,zIndex:r,transitionDuration:i,notificationMaxHeight:a,classNames:{root:s()}}),show:({color:e,classNames:t,intent:n,...r})=>f.show({...r,classNames:m(n,t)}),update:({color:e,classNames:t,intent:n,...r})=>{f.update({...r,classNames:m(n,t)})},hide:e=>{f.hide(e)},clean:()=>{f.clean()},cleanQueue:()=>{f.cleanQueue()}};export{h as Toast};
1
+ "use client";import{cx as e}from"@mage-ui/styled-system/css";import{toast as t,toastBody as n,toastCloseButton as r,toastDescription as i,toastIcon as a,toastLoader as o,toastNotifications as s,toastRoot as c,toastTitle as l}from"@mage-ui/styled-system/recipes";import{jsx as u}from"react/jsx-runtime";import{Notifications as d,notifications as f}from"@mantine/notifications";const p={neutral:`neutral`,info:`info`,success:`success`,warning:`warning`,danger:`danger`},m=(s,u)=>{let d=s&&s!==`default`?p[s]:void 0,f=d?c({intent:d}):c();return{root:e(u?.toast??t(),u?.root??f),icon:e(u?.icon??a()),loader:e(u?.loader??o()),body:e(u?.body??n()),title:e(u?.title??l()),description:e(u?.description??i()),closeButton:e(u?.closeButton??r())}},h={Provider:({position:e=`top-right`,autoClose:t=1e4,limit:n=5,zIndex:r,transitionDuration:i=250,notificationMaxHeight:a=200})=>u(d,{position:e,autoClose:t,limit:n,zIndex:r,transitionDuration:i,notificationMaxHeight:a,classNames:{root:s()}}),show:({color:e,classNames:t,intent:n,...r})=>f.show({...r,classNames:m(n,t)}),update:({color:e,classNames:t,intent:n,...r})=>{f.update({...r,classNames:m(n,t)})},hide:e=>{f.hide(e)},clean:()=>{f.clean()},cleanQueue:()=>{f.cleanQueue()}};export{h as Toast};
2
2
  //# sourceMappingURL=Toast.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.mjs","names":["toastRecipe"],"sources":["../../../../src/components/overlays/toast/Toast.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n toastBody,\n toastCloseButton,\n toastDescription,\n toastIcon,\n toastLoader,\n toastNotifications,\n toast as toastRecipe,\n toastRoot,\n toastTitle,\n} from '@mage-ui/styled-system/recipes';\nimport { Notifications, notifications } from '@mantine/notifications';\n\nexport type ToastIntent =\n | 'default'\n | 'neutral'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger';\n\nexport type ToastOptions = {\n id?: string;\n title?: ReactNode;\n message: ReactNode;\n color?: string;\n icon?: ReactNode;\n loading?: boolean;\n autoClose?: number | false;\n withCloseButton?: boolean;\n withBorder?: boolean;\n intent?: ToastIntent;\n onClose?: () => void;\n onOpen?: () => void;\n classNames?: {\n toast?: string;\n root?: string;\n icon?: string;\n loader?: string;\n body?: string;\n title?: string;\n description?: string;\n closeButton?: string;\n };\n};\n\nexport type ToastProviderProps = {\n position?:\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n autoClose?: number | false;\n limit?: number;\n zIndex?: number;\n transitionDuration?: number;\n notificationMaxHeight?: number | string;\n};\n\nconst intentColorMap: Record<\n Exclude<ToastIntent, 'default'>,\n 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n> = {\n neutral: 'neutral',\n info: 'info',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n};\n\nconst applyClassNames = (\n intent?: ToastIntent,\n classNames?: ToastOptions['classNames'],\n) => {\n const intentColor =\n intent && intent !== 'default' ? intentColorMap[intent] : undefined;\n const rootClass = intentColor\n ? toastRoot({ intent: intentColor })\n : toastRoot();\n return {\n root: cx(classNames?.toast ?? toastRecipe(), classNames?.root ?? rootClass),\n icon: cx(classNames?.icon ?? toastIcon()),\n loader: cx(classNames?.loader ?? toastLoader()),\n body: cx(classNames?.body ?? toastBody()),\n title: cx(classNames?.title ?? toastTitle()),\n description: cx(classNames?.description ?? toastDescription()),\n closeButton: cx(classNames?.closeButton ?? toastCloseButton()),\n };\n};\n\nconst ToastProvider = ({\n position = 'top-right',\n autoClose = 5000,\n limit = 5,\n zIndex,\n transitionDuration = 250,\n notificationMaxHeight = 200,\n}: ToastProviderProps) => {\n return (\n <Notifications\n position={position}\n autoClose={autoClose}\n limit={limit}\n zIndex={zIndex}\n transitionDuration={transitionDuration}\n notificationMaxHeight={notificationMaxHeight}\n classNames={{\n root: toastNotifications(),\n }}\n />\n );\n};\n\nexport const Toast = {\n Provider: ToastProvider,\n\n show: ({ color, classNames, intent, ...props }: ToastOptions) => {\n return notifications.show({\n ...props,\n classNames: applyClassNames(intent, classNames),\n });\n },\n\n update: ({ color, classNames, intent, ...props }: ToastOptions) => {\n notifications.update({\n ...props,\n classNames: applyClassNames(intent, classNames),\n });\n },\n\n hide: (id: string) => {\n notifications.hide(id);\n },\n\n clean: () => {\n notifications.clean();\n },\n\n cleanQueue: () => {\n notifications.cleanQueue();\n },\n};\n"],"mappings":"wXAkEA,MAAM,EAGF,CACF,QAAS,UACT,KAAM,OACN,QAAS,UACT,QAAS,UACT,OAAQ,SACT,CAEK,GACJ,EACA,IACG,CACH,IAAM,EACJ,GAAU,IAAW,UAAY,EAAe,GAAU,IAAA,GACtD,EAAY,EACd,EAAU,CAAE,OAAQ,EAAa,CAAC,CAClC,GAAW,CACf,MAAO,CACL,KAAM,EAAG,GAAY,OAASA,GAAa,CAAE,GAAY,MAAQ,EAAU,CAC3E,KAAM,EAAG,GAAY,MAAQ,GAAW,CAAC,CACzC,OAAQ,EAAG,GAAY,QAAU,GAAa,CAAC,CAC/C,KAAM,EAAG,GAAY,MAAQ,GAAW,CAAC,CACzC,MAAO,EAAG,GAAY,OAAS,GAAY,CAAC,CAC5C,YAAa,EAAG,GAAY,aAAe,GAAkB,CAAC,CAC9D,YAAa,EAAG,GAAY,aAAe,GAAkB,CAAC,CAC/D,EA0BU,EAAQ,CACnB,UAxBqB,CACrB,WAAW,YACX,YAAY,IACZ,QAAQ,EACR,SACA,qBAAqB,IACrB,wBAAwB,OAGtB,EAAC,EAAD,CACY,WACC,YACJ,QACC,SACY,qBACG,wBACvB,WAAY,CACV,KAAM,GAAoB,CAC3B,CACD,CAAA,CAOJ,MAAO,CAAE,QAAO,aAAY,SAAQ,GAAG,KAC9B,EAAc,KAAK,CACxB,GAAG,EACH,WAAY,EAAgB,EAAQ,EAAW,CAChD,CAAC,CAGJ,QAAS,CAAE,QAAO,aAAY,SAAQ,GAAG,KAA0B,CACjE,EAAc,OAAO,CACnB,GAAG,EACH,WAAY,EAAgB,EAAQ,EAAW,CAChD,CAAC,EAGJ,KAAO,GAAe,CACpB,EAAc,KAAK,EAAG,EAGxB,UAAa,CACX,EAAc,OAAO,EAGvB,eAAkB,CAChB,EAAc,YAAY,EAE7B"}
1
+ {"version":3,"file":"Toast.mjs","names":["toastRecipe"],"sources":["../../../../src/components/overlays/toast/Toast.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\n\nimport { cx } from '@mage-ui/styled-system/css';\nimport {\n toastBody,\n toastCloseButton,\n toastDescription,\n toastIcon,\n toastLoader,\n toastNotifications,\n toast as toastRecipe,\n toastRoot,\n toastTitle,\n} from '@mage-ui/styled-system/recipes';\nimport { Notifications, notifications } from '@mantine/notifications';\n\nexport type ToastIntent =\n | 'default'\n | 'neutral'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger';\n\nexport type ToastOptions = {\n id?: string;\n title?: ReactNode;\n message: ReactNode;\n color?: string;\n icon?: ReactNode;\n loading?: boolean;\n autoClose?: number | false;\n withCloseButton?: boolean;\n withBorder?: boolean;\n intent?: ToastIntent;\n onClose?: () => void;\n onOpen?: () => void;\n classNames?: {\n toast?: string;\n root?: string;\n icon?: string;\n loader?: string;\n body?: string;\n title?: string;\n description?: string;\n closeButton?: string;\n };\n};\n\nexport type ToastProviderProps = {\n position?:\n | 'top-left'\n | 'top-right'\n | 'top-center'\n | 'bottom-left'\n | 'bottom-right'\n | 'bottom-center';\n autoClose?: number | false;\n limit?: number;\n zIndex?: number;\n transitionDuration?: number;\n notificationMaxHeight?: number | string;\n};\n\nconst intentColorMap: Record<\n Exclude<ToastIntent, 'default'>,\n 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n> = {\n neutral: 'neutral',\n info: 'info',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n};\n\nconst applyClassNames = (\n intent?: ToastIntent,\n classNames?: ToastOptions['classNames'],\n) => {\n const intentColor =\n intent && intent !== 'default' ? intentColorMap[intent] : undefined;\n const rootClass = intentColor\n ? toastRoot({ intent: intentColor })\n : toastRoot();\n return {\n root: cx(classNames?.toast ?? toastRecipe(), classNames?.root ?? rootClass),\n icon: cx(classNames?.icon ?? toastIcon()),\n loader: cx(classNames?.loader ?? toastLoader()),\n body: cx(classNames?.body ?? toastBody()),\n title: cx(classNames?.title ?? toastTitle()),\n description: cx(classNames?.description ?? toastDescription()),\n closeButton: cx(classNames?.closeButton ?? toastCloseButton()),\n };\n};\n\nconst ToastProvider = ({\n position = 'top-right',\n autoClose = 10000,\n limit = 5,\n zIndex,\n transitionDuration = 250,\n notificationMaxHeight = 200,\n}: ToastProviderProps) => {\n return (\n <Notifications\n position={position}\n autoClose={autoClose}\n limit={limit}\n zIndex={zIndex}\n transitionDuration={transitionDuration}\n notificationMaxHeight={notificationMaxHeight}\n classNames={{\n root: toastNotifications(),\n }}\n />\n );\n};\n\nexport const Toast = {\n Provider: ToastProvider,\n\n show: ({ color, classNames, intent, ...props }: ToastOptions) => {\n return notifications.show({\n ...props,\n classNames: applyClassNames(intent, classNames),\n });\n },\n\n update: ({ color, classNames, intent, ...props }: ToastOptions) => {\n notifications.update({\n ...props,\n classNames: applyClassNames(intent, classNames),\n });\n },\n\n hide: (id: string) => {\n notifications.hide(id);\n },\n\n clean: () => {\n notifications.clean();\n },\n\n cleanQueue: () => {\n notifications.cleanQueue();\n },\n};\n"],"mappings":"wXAkEA,MAAM,EAGF,CACF,QAAS,UACT,KAAM,OACN,QAAS,UACT,QAAS,UACT,OAAQ,SACT,CAEK,GACJ,EACA,IACG,CACH,IAAM,EACJ,GAAU,IAAW,UAAY,EAAe,GAAU,IAAA,GACtD,EAAY,EACd,EAAU,CAAE,OAAQ,EAAa,CAAC,CAClC,GAAW,CACf,MAAO,CACL,KAAM,EAAG,GAAY,OAASA,GAAa,CAAE,GAAY,MAAQ,EAAU,CAC3E,KAAM,EAAG,GAAY,MAAQ,GAAW,CAAC,CACzC,OAAQ,EAAG,GAAY,QAAU,GAAa,CAAC,CAC/C,KAAM,EAAG,GAAY,MAAQ,GAAW,CAAC,CACzC,MAAO,EAAG,GAAY,OAAS,GAAY,CAAC,CAC5C,YAAa,EAAG,GAAY,aAAe,GAAkB,CAAC,CAC9D,YAAa,EAAG,GAAY,aAAe,GAAkB,CAAC,CAC/D,EA0BU,EAAQ,CACnB,UAxBqB,CACrB,WAAW,YACX,YAAY,IACZ,QAAQ,EACR,SACA,qBAAqB,IACrB,wBAAwB,OAGtB,EAAC,EAAD,CACY,WACC,YACJ,QACC,SACY,qBACG,wBACvB,WAAY,CACV,KAAM,GAAoB,CAC3B,CACD,CAAA,CAOJ,MAAO,CAAE,QAAO,aAAY,SAAQ,GAAG,KAC9B,EAAc,KAAK,CACxB,GAAG,EACH,WAAY,EAAgB,EAAQ,EAAW,CAChD,CAAC,CAGJ,QAAS,CAAE,QAAO,aAAY,SAAQ,GAAG,KAA0B,CACjE,EAAc,OAAO,CACnB,GAAG,EACH,WAAY,EAAgB,EAAQ,EAAW,CAChD,CAAC,EAGJ,KAAO,GAAe,CACpB,EAAc,KAAK,EAAG,EAGxB,UAAa,CACX,EAAc,OAAO,EAGvB,eAAkB,CAChB,EAAc,YAAY,EAE7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mage-ui/components",
3
- "version": "1.0.111",
3
+ "version": "1.0.113",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -25,7 +25,7 @@
25
25
  "rimraf": "^6.1.3",
26
26
  "tsdown": "^0.21.4",
27
27
  "typescript": "^5.9.3",
28
- "@mage-ui/preset": "1.0.111",
28
+ "@mage-ui/preset": "1.0.113",
29
29
  "@mage-ui/styled-system": "1.0.8"
30
30
  },
31
31
  "peerDependencies": {