@fvc/alert 1.0.0
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert } from './Alert';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { type AlertProps as DefaultAlertProps } from 'antd';
|
|
3
|
+
export type AlertProps = Omit<DefaultAlertProps, 'description' | 'banner'> & {
|
|
4
|
+
block?: boolean;
|
|
5
|
+
iconColor?: CSSProperties['color'];
|
|
6
|
+
size?: 'medium' | 'small';
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Alert.types';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import e from"react";import{Alert as r}from"antd";import{Icon as t}from"@fvc/icons";var l=function(){return l=Object.assign||function(e){for(var r,t=1,l=arguments.length;t<l;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},l.apply(this,arguments)};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var n,a={exports:{}};
|
|
2
|
+
/*!
|
|
3
|
+
Copyright (c) 2018 Jed Watson.
|
|
4
|
+
Licensed under the MIT License (MIT), see
|
|
5
|
+
http://jedwatson.github.io/classnames
|
|
6
|
+
*/var c,i=o((n||(n=1,c=a,function(){var e={}.hasOwnProperty;function r(){for(var e="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(e=l(e,t(o)))}return e}function t(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return r.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var o="";for(var n in t)e.call(t,n)&&t[n]&&(o=l(o,n));return o}function l(e,r){return r?e?e+" "+r:e+r:e}c.exports?(r.default=r,c.exports=r):window.classNames=r}()),a.exports));var s={"fvc-alert":"Alert-module_fvc-alert__b7EMC","fvc-alert-message":"Alert-module_fvc-alert-message__p2SgU","fvc-alert-icon":"Alert-module_fvc-alert-icon__lWXeZ","fvc-alert-size-small":"Alert-module_fvc-alert-size-small__iZ8Tu","fvc-alert-block":"Alert-module_fvc-alert-block__aq9yC","fvc-alert-info":"Alert-module_fvc-alert-info__LZi9f","fvc-alert-success":"Alert-module_fvc-alert-success__Twe46","fvc-alert-error":"Alert-module_fvc-alert-error__w5j--","fvc-alert-warning":"Alert-module_fvc-alert-warning__hoOWw","fvc-alert-close-icon":"Alert-module_fvc-alert-close-icon__cvIsQ"};!function(e,r){void 0===r&&(r={});var t=r.insertAt;if("undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".Alert-module_fvc-alert__b7EMC {\n position: relative;\n display: flex;\n align-items: flex-start;\n width: 336px;\n padding: 16px;\n border-radius: 8px;\n outline: none;\n border: none;\n background-color: var(--gray-50);\n gap: 16px;\n}\n.Alert-module_fvc-alert__b7EMC .Alert-module_fvc-alert-message__p2SgU {\n font-family: Roboto, Arial, sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: var(--body-text-color-1000);\n}\n.Alert-module_fvc-alert__b7EMC .Alert-module_fvc-alert-icon__lWXeZ {\n margin-right: 0;\n}\n.Alert-module_fvc-alert-size-small__iZ8Tu {\n padding: 8px 16px 8px 8px;\n gap: 8px;\n}\n.Alert-module_fvc-alert-size-small__iZ8Tu .Alert-module_fvc-alert-message__p2SgU {\n font-size: 14px;\n line-height: 16px;\n color: var(--body-text-color-1000);\n}\n.Alert-module_fvc-alert-size-small__iZ8Tu .Alert-module_fvc-alert-icon__lWXeZ {\n width: 20px;\n height: 20px;\n}\n.Alert-module_fvc-alert-block__aq9yC {\n width: 100%;\n}\n.Alert-module_fvc-alert-info__LZi9f {\n background-color: var(--gray-50);\n}\n.Alert-module_fvc-alert-info__LZi9f .Alert-module_fvc-alert-message__p2SgU {\n color: var(--body-text-color-1000);\n}\n.Alert-module_fvc-alert-success__Twe46 {\n background-color: var(--button-text-color-500);\n}\n.Alert-module_fvc-alert-success__Twe46 .Alert-module_fvc-alert-message__p2SgU {\n color: var(--white-text-color-0);\n}\n.Alert-module_fvc-alert-error__w5j-- {\n background-color: var(--red-800);\n}\n.Alert-module_fvc-alert-error__w5j-- .Alert-module_fvc-alert-message__p2SgU {\n color: var(--white-text-color-0);\n}\n.Alert-module_fvc-alert-warning__hoOWw {\n background-color: var(--orange-200);\n}\n.Alert-module_fvc-alert-warning__hoOWw .Alert-module_fvc-alert-message__p2SgU {\n color: var(--body-text-color-1000);\n}\n.Alert-module_fvc-alert__b7EMC .Alert-module_fvc-alert-close-icon__cvIsQ {\n position: absolute;\n top: 4px;\n right: 4px;\n width: 16px;\n height: 16px;\n background-color: var(--blue-gray-900);\n border-radius: 50%;\n margin: 0;\n padding: 0;\n}\n.Alert-module_fvc-alert__b7EMC .Alert-module_fvc-alert-close-icon__cvIsQ > span {\n width: 7px;\n height: 7px;\n}\n.Alert-module_fvc-alert__b7EMC .Alert-module_fvc-alert-close-icon__cvIsQ > span > svg {\n color: var(--white-text-color-0);\n}");var _="fvc-alert",f=function(r,l){if(l)return l;switch(r){case"info":return e.createElement(t.Info,{color:"var(--gray-900)","aria-label":"alert-info-icon"});case"warning":return e.createElement(t.InfoFilled,{color:"var(--gray-900)","aria-label":"alert-warning-icon"});case"success":return e.createElement(t.Done,{color:"var(--white-text-color-0)","aria-label":"alert-success-icon"});case"error":return e.createElement(t.WarningAmber,{color:"var(--white-text-color-0)","aria-label":"alert-error-icon"});default:return e.createElement(t.Info,{color:"var(--gray-900)","aria-label":"alert-default-icon"})}},u=function(t){var o,n=t.block,a=void 0!==n&&n,c=t.className,u=t.type,d=t.icon,v=t.size,p=void 0===v?"medium":v,m=function(e,r){var t={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&r.indexOf(l)<0&&(t[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)r.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(t[l[o]]=e[l[o]])}return t}(t,["block","className","type","icon","size"]),g=i(s[_],c,((o={})["".concat(_,"-block")]=!!a,o["".concat(_,"-size-").concat(p)]=!!p,o));return e.createElement(r,l({},m,{className:g,prefixCls:_,type:u,icon:f(u,d)}))};export{u as Alert};
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fvc/alert",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "./dist/lib/index.js",
|
|
5
|
+
"types": "./dist/lib/alert/src/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/lib/index.js",
|
|
8
|
+
"dist/lib/alert",
|
|
9
|
+
"package.json"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/lib/index.js",
|
|
14
|
+
"types": "./dist/lib/alert/src/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./types": {
|
|
17
|
+
"types": "./dist/lib/alert/src/types/index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rm -rf dist && eslint --config ../../eslint.config.js . && bunx tsc --noEmit && rollup -c ./rollup.config.mjs"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"react": "^18.0.0",
|
|
25
|
+
"antd": "^5.0.0",
|
|
26
|
+
"@fvc/icons": "file:../icons"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@fvc/icons": "*"
|
|
30
|
+
}
|
|
31
|
+
}
|