karsten-design-system 1.0.68 → 1.0.70
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/dist/index.js
CHANGED
|
@@ -32,5 +32,5 @@ export { EmptyContent } from './stories/components/emptyContent.js';
|
|
|
32
32
|
export { Select } from './stories/components/select.js';
|
|
33
33
|
export { CalendarInput } from './stories/components/calendarInput.js';
|
|
34
34
|
export { Table } from './stories/components/table.js';
|
|
35
|
-
|
|
35
|
+
export { CustomToast } from './stories/components/customToast.js';
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,9 +6,10 @@ import SuccessIcon from '../../assets/icons/success.js';
|
|
|
6
6
|
import ErrorIcon from '../../assets/icons/error.js';
|
|
7
7
|
import InfoIcon from '../../assets/icons/info.js';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function CustomToast(props, ref) {
|
|
10
|
+
const { severity = 'info', summary = '', detail = '', life = 3000, onShow } = props;
|
|
10
11
|
const customToastRef = useRef(null);
|
|
11
|
-
|
|
12
|
+
function getIcon(severity) {
|
|
12
13
|
switch (severity) {
|
|
13
14
|
case 'success':
|
|
14
15
|
return SuccessIcon;
|
|
@@ -17,7 +18,7 @@ forwardRef(({ severity = 'info', summary = '', detail = '', life = 3000, onShow
|
|
|
17
18
|
default:
|
|
18
19
|
return InfoIcon;
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
+
}
|
|
21
22
|
useImperativeHandle(ref, () => ({
|
|
22
23
|
show: (showProps) => {
|
|
23
24
|
const mergedProps = { severity, summary, detail, life, onShow, ...showProps };
|
|
@@ -37,5 +38,8 @@ forwardRef(({ severity = 'info', summary = '', detail = '', life = 3000, onShow
|
|
|
37
38
|
},
|
|
38
39
|
}));
|
|
39
40
|
return jsxRuntimeExports.jsx(Toast, { ref: customToastRef });
|
|
40
|
-
}
|
|
41
|
+
}
|
|
42
|
+
forwardRef(CustomToast);
|
|
43
|
+
|
|
44
|
+
export { CustomToast };
|
|
41
45
|
//# sourceMappingURL=customToast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customToast.js","sources":["../../../../src/stories/components/customToast.tsx"],"sourcesContent":[null],"names":["_jsx","ToastPrime"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"customToast.js","sources":["../../../../src/stories/components/customToast.tsx"],"sourcesContent":[null],"names":["_jsx","ToastPrime"],"mappings":";;;;;;;;AAqBgB,SAAA,WAAW,CAAC,KAAuB,EAAE,GAA8B,EAAA;IACjF,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK;AACnF,IAAA,MAAM,cAAc,GAAG,MAAM,CAAa,IAAI,CAAC;IAE/C,SAAS,OAAO,CAAC,QAA6B,EAAA;QAC5C,QAAQ,QAAQ;AACd,YAAA,KAAK,SAAS;AACZ,gBAAA,OAAO,WAAW;AACpB,YAAA,KAAK,OAAO;AACV,gBAAA,OAAO,SAAS;AAClB,YAAA;AACE,gBAAA,OAAO,QAAQ;;;AAIrB,IAAA,mBAAmB,CAAC,GAAG,EAAE,OAAO;AAC9B,QAAA,IAAI,EAAE,CAAC,SAA4B,KAAI;AACrC,YAAA,MAAM,WAAW,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE;AAE7E,YAAA,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC;gBAC3B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,MAAM,EAAE,WAAW,CAAC,MAAM;gBAC1B,IAAI,EAAE,WAAW,CAAC,IAAI;AACtB,gBAAA,SAAS,EAAE,IAAI,CACb,WAAW,CAAC,QAAQ,KAAK,OAAO,GAAG,iBAAiB,GAAG,gBAAgB,CACxE;AACD,gBAAA,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC;gBACnC,gBAAgB,EAAE,IAAI,CACpB,0DAA0D,EAC1D,WAAW,CAAC,QAAQ,KAAK;AACvB,sBAAE;sBACA,6BAA6B,CAClC;AACD,gBAAA,SAAS,EAAE,IAAI,CACb,0BAA0B,EAC1B,WAAW,CAAC,QAAQ,KAAK,OAAO,GAAG,eAAe,GAAG,cAAc,CACpE;AACF,aAAA,CAAC;AAEF,YAAA,WAAW,CAAC,MAAM,IAAI;SACvB;AACF,KAAA,CAAC,CAAC;AAEH,IAAA,OAAOA,sBAACC,KAAU,EAAA,EAAC,GAAG,EAAE,cAAc,GAAI;AAC5C;AAEe,UAAU,CAAC,WAAW,CAAC;;;;"}
|
|
@@ -9,5 +9,6 @@ export type CustomToastProps = {
|
|
|
9
9
|
export type CustomToastRef = {
|
|
10
10
|
show: (props?: CustomToastProps) => void;
|
|
11
11
|
};
|
|
12
|
-
declare
|
|
13
|
-
|
|
12
|
+
export declare function CustomToast(props: CustomToastProps, ref: React.Ref<CustomToastRef>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const _default: import("react").ForwardRefExoticComponent<CustomToastProps & import("react").RefAttributes<CustomToastRef>>;
|
|
14
|
+
export default _default;
|