@chasi/ui
Advanced tools
Comparing version 0.2.90 to 0.2.91
@@ -1,2 +0,2 @@ | ||
type CNotifierParams = { | ||
type CNotifierParamsObj = { | ||
title: string; | ||
@@ -8,2 +8,3 @@ text?: string; | ||
}; | ||
type CNotifierParams = CNotifierParamsObj | string; | ||
declare function error(opt: CNotifierParams): void; | ||
@@ -10,0 +11,0 @@ declare function info(opt: CNotifierParams): void; |
@@ -40,10 +40,18 @@ import CNotify from './CNotify.svelte'; | ||
function error(opt) { | ||
send({ ...opt, type: 'error' }); | ||
send({ ...parseOpts(opt), type: 'error' }); | ||
} | ||
function info(opt) { | ||
send({ ...opt, type: 'brand' }); | ||
send({ ...parseOpts(opt), type: 'brand' }); | ||
} | ||
function success(opt) { | ||
send({ ...opt, type: 'success' }); | ||
send({ ...parseOpts(opt), type: 'success' }); | ||
} | ||
function parseOpts(opt) { | ||
if (typeof opt === 'string') { | ||
return { | ||
title: opt | ||
}; | ||
} | ||
return opt; | ||
} | ||
export const CNotifier = { | ||
@@ -50,0 +58,0 @@ error, |
{ | ||
"name": "@chasi/ui", | ||
"version": "0.2.90", | ||
"version": "0.2.91", | ||
"bin": { | ||
@@ -5,0 +5,0 @@ "gen-theme": "./dist/bin/theme.js" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
109915
1192