@fvc/notification 1.1.0 → 1.2.1
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/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{notification as n}from"antd";import t,{useMemo as
|
|
1
|
+
import{notification as n}from"antd";import t,{useMemo as i}from"react";import{Icon as o}from"@fvc/icons";var e;function c(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}!function(n){n.success="success",n.info="info",n.warning="warning",n.error="error"}(e||(e={})),"function"==typeof SuppressedError&&SuppressedError;var r,a={exports:{}};
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|
|
5
5
|
http://jedwatson.github.io/classnames
|
|
6
|
-
*/var s
|
|
6
|
+
*/var f,s=(r||(r=1,f=a,function(){var n={}.hasOwnProperty;function t(){for(var n="",t=0;t<arguments.length;t++){var e=arguments[t];e&&(n=o(n,i(e)))}return n}function i(i){if("string"==typeof i||"number"==typeof i)return i;if("object"!=typeof i)return"";if(Array.isArray(i))return t.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var e="";for(var c in i)n.call(i,c)&&i[c]&&(e=o(e,c));return e}function o(n,t){return t?n?n+" "+t:n+t:n}f.exports?(t.default=t,f.exports=t):window.classNames=t}()),a.exports),p=c(s);const l="fvc-notification",v=n=>{switch(n){case e.success:return t.createElement(o.CheckCircleOutline,{color:"var(--link-on-dark-bg-color-400)",width:24,height:24});case e.info:return t.createElement(o.Info,{color:"var(--gray-300)",width:24,height:24});case e.warning:return t.createElement(o.Warning,{color:"var(--orange-200)",width:24,height:24});case e.error:return t.createElement(o.Report,{color:"var(--warning-text-on-dark-bg-color-400)",width:24,height:24});default:return}},g=n=>{var{icon:t,innerComponent:i}=n,o=function(n,t){var i={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(i[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var e=0;for(o=Object.getOwnPropertySymbols(n);e<o.length;e++)t.indexOf(o[e])<0&&Object.prototype.propertyIsEnumerable.call(n,o[e])&&(i[o[e]]=n[o[e]])}return i}(n,["icon","innerComponent"]);return Object.assign(Object.assign({},o),{icon:t||v(o.type),btn:i,className:p({[o.className]:!!o.className})})},u=(t,i=n)=>n=>i[t](Object.assign({},g(Object.assign(Object.assign({},n),{type:t}))));!function(n,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css","top"===i&&o.firstChild?o.insertBefore(e,o.firstChild):o.appendChild(e),e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}}('.fvc-notification {\n font-family: "Roboto", sans-serif;\n}\n.fvc-notification .fvc-notification-notice-wrapper {\n background-color: var(--blue-gray-700) !important;\n border-radius: 8px;\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice {\n padding: 16px;\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-close {\n width: 16px;\n height: 16px;\n top: 4px;\n right: 4px;\n border-radius: 50%;\n background-color: var(--blue-gray-900);\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-close:hover {\n background-color: var(--blue-gray-900);\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-close-icon {\n width: 7px;\n height: 7px;\n color: var(--blue-gray-250);\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-with-icon .fvc-notification-notice-message, .fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-message {\n font-family: Roboto, Arial, sans-serif;\n font-weight: 400;\n font-size: 14px;\n line-height: 16px;\n margin-bottom: 0;\n margin-left: 0;\n color: var(--neutral-0);\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-with-icon .fvc-notification-notice-message {\n margin-left: 32px;\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-icon {\n transform: translateY(-3px);\n display: flex;\n align-items: flex-start;\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-btn {\n display: flex;\n width: 100%;\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-success .fvc-notification-notice-message {\n color: var(--link-on-dark-bg-color-400);\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-info .fvc-notification-notice-message {\n color: var(--gray-300);\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-error .fvc-notification-notice-message {\n color: var(--warning-icon-on-dark-bg-color-400);\n}\n.fvc-notification .fvc-notification-notice-wrapper .fvc-notification-notice-warning .fvc-notification-notice-message {\n color: var(--orange-200);\n}');const d={config:t=>{n.config(Object.assign(Object.assign({},t),{prefixCls:l}))},destroy:t=>{n.destroy(t)},open:t=>{n.open(Object.assign({},g(t)))},success:u(e.success),info:u(e.info),warning:u(e.warning),error:u(e.error),useNotification:t=>{const[o,c]=n.useNotification(Object.assign(Object.assign({},t),{prefixCls:l}));return[i(()=>({info:u(e.info,o),success:u(e.success,o),error:u(e.error,o),warning:u(e.warning,o),open:n=>{o.open(Object.assign({},g(Object.assign({},n))))},destroy:o.destroy}),[o]),c]}};export{d as notification};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
1
|
import { ArgsProps as BaseArgsProps } from 'antd/es/notification';
|
|
3
2
|
import { GlobalConfigProps, NotificationConfig as BaseNotificationConfig, NotificationInstance as BaseNotificationInstance } from 'antd/es/notification/interface';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
4
|
export type ArgsProps = Omit<BaseArgsProps, 'description'> & {
|
|
5
5
|
innerComponent?: ReactNode;
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { notification as baseNotification, NotificationArgsProps as BaseNotificationArgsProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { ArgsProps, NotificationInstance, NotificationTypes, StaticFn } from '../types';
|
|
4
4
|
export declare const prefixCls = "fvc-notification";
|
|
5
5
|
export declare const getNotificationIcon: (type: BaseNotificationArgsProps["type"]) => React.JSX.Element | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fvc/notification",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"main": "./dist/lib/index.js",
|
|
5
5
|
"types": "./dist/lib/notification/src/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
21
|
+
"build": "rollup -c ./rollup.config.mjs",
|
|
22
|
+
"clean": "rm -rf dist && rm -rf .rollup.cache && rm -rf .turbo",
|
|
23
|
+
"lint": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\"",
|
|
24
|
+
"lint:fix": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\" --fix",
|
|
25
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
26
|
+
"type-check": "tsc --noEmit",
|
|
27
|
+
"test": "bun test --preload ../../tests/happydom.ts --preload ../../tests/testing-library.tsx"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
30
|
"@fvc/icons": "*",
|