@fvc/alert 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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
1
|
import { type AlertProps as DefaultAlertProps } from 'antd';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
3
|
export type AlertProps = Omit<DefaultAlertProps, 'description' | 'banner'> & {
|
|
4
4
|
block?: boolean;
|
|
5
5
|
iconColor?: CSSProperties['color'];
|
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e
|
|
1
|
+
import{Alert as e}from"antd";import r from"react";import{Icon as n}from"@fvc/icons";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var o,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 l,
|
|
6
|
+
*/var l,c=t((o||(o=1,l=a,function(){var e={}.hasOwnProperty;function r(){for(var e="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(e=t(e,n(o)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var a in n)e.call(n,a)&&n[a]&&(o=t(o,a));return o}function t(e,r){return r?e?e+" "+r:e+r:e}l.exports?(r.default=r,l.exports=r):window.classNames=r}()),a.exports));!function(e,r){void 0===r&&(r={});var n=r.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".fvc-alert {\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.fvc-alert .fvc-alert-message {\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.fvc-alert .fvc-alert-icon {\n margin-right: 0;\n}\n.fvc-alert-size-small {\n padding: 8px 16px 8px 8px;\n gap: 8px;\n}\n.fvc-alert-size-small .fvc-alert-message {\n font-size: 14px;\n line-height: 16px;\n color: var(--body-text-color-1000);\n}\n.fvc-alert-size-small .fvc-alert-icon {\n width: 20px;\n height: 20px;\n}\n.fvc-alert-block {\n width: 100%;\n}\n.fvc-alert-info {\n background-color: var(--gray-50);\n}\n.fvc-alert-info .fvc-alert-message {\n color: var(--body-text-color-1000);\n}\n.fvc-alert-success {\n background-color: var(--green-700);\n}\n.fvc-alert-success .fvc-alert-message {\n color: var(--white-text-color-0);\n}\n.fvc-alert-error {\n background-color: var(--red-800);\n}\n.fvc-alert-error .fvc-alert-message {\n color: var(--white-text-color-0);\n}\n.fvc-alert-warning {\n background-color: var(--orange-200);\n}\n.fvc-alert-warning .fvc-alert-message {\n color: var(--body-text-color-1000);\n}\n.fvc-alert .fvc-alert-close-icon {\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.fvc-alert .fvc-alert-close-icon > span {\n width: 7px;\n height: 7px;\n}\n.fvc-alert .fvc-alert-close-icon > span > svg {\n color: var(--white-text-color-0);\n}");const i="fvc-alert",s=(e,t)=>{if(t)return t;switch(e){case"info":return r.createElement(n.Info,{color:"var(--gray-900)","aria-label":"alert-info-icon"});case"warning":return r.createElement(n.InfoFilled,{color:"var(--gray-900)","aria-label":"alert-warning-icon"});case"success":return r.createElement(n.Done,{color:"var(--white-text-color-0)","aria-label":"alert-success-icon"});case"error":return r.createElement(n.WarningAmber,{color:"var(--white-text-color-0)","aria-label":"alert-error-icon"});default:return r.createElement(n.Info,{color:"var(--gray-900)","aria-label":"alert-default-icon"})}},f=n=>{var{block:t=!1,className:o,type:a,icon:l,size:f="medium"}=n,p=function(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]])}return n}(n,["block","className","type","icon","size"]);const v=c(i,{[`${i}-block`]:!!t,[`${i}-size-${f}`]:!!f},o);return r.createElement(e,Object.assign({},p,{className:v,prefixCls:i,type:a,icon:s(a,l)}))};export{f as Alert};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fvc/alert",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"main": "./dist/lib/index.js",
|
|
5
5
|
"types": "./dist/lib/alert/src/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -18,14 +18,17 @@
|
|
|
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
|
-
"@fvc/icons": "*"
|
|
30
|
+
"@fvc/icons": "*",
|
|
31
|
+
"react": "^18.0.0",
|
|
32
|
+
"antd": "^5.0.0"
|
|
30
33
|
}
|
|
31
34
|
}
|