mantine-alert-system
Version:
Alert system based on Mantine components
8 lines (7 loc) • 11.1 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../node_modules/prop-types/lib/ReactPropTypesSecret.js", "../../../node_modules/prop-types/factoryWithThrowingShims.js", "../../../node_modules/prop-types/index.js", "../../../node_modules/@tabler/icons-react/src/defaultAttributes.js", "../../../node_modules/@tabler/icons-react/src/createReactComponent.js", "../../../node_modules/@tabler/icons-react/src/icons/IconAlertTriangle.js", "../../../node_modules/@tabler/icons-react/src/icons/IconCheck.js", "../../../node_modules/@tabler/icons-react/src/icons/IconInfoCircle.js", "../../../node_modules/@tabler/icons-react/src/icons/IconX.js", "../src/use-alert-severity.tsx"],
"sourcesContent": ["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n", "export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n", "import { forwardRef, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport defaultAttributes from './defaultAttributes';\n\nexport default (iconName, iconNamePascal, iconNode) => {\n const Component = forwardRef(\n ({ color = 'currentColor', size = 24, stroke = 2, children, ...rest }, ref) =>\n createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: stroke,\n className: `tabler-icon tabler-icon-${iconName}`,\n ...rest,\n },\n [...iconNode.map(([tag, attrs]) => createElement(tag, attrs)), ...(children || [])],\n ),\n );\n\n Component.propTypes = {\n color: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n stroke: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n };\n\n Component.displayName = `${iconNamePascal}`;\n\n return Component;\n};\n", "import createReactComponent from '../createReactComponent';\nexport default createReactComponent('alert-triangle', 'IconAlertTriangle', [\n [\n 'path',\n {\n d: 'M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z',\n key: 'svg-0',\n },\n ],\n ['path', { d: 'M12 9v4', key: 'svg-1' }],\n ['path', { d: 'M12 17h.01', key: 'svg-2' }],\n]);\n", "import createReactComponent from '../createReactComponent';\nexport default createReactComponent('check', 'IconCheck', [\n ['path', { d: 'M5 12l5 5l10 -10', key: 'svg-0' }],\n]);\n", "import createReactComponent from '../createReactComponent';\nexport default createReactComponent('info-circle', 'IconInfoCircle', [\n ['path', { d: 'M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0', key: 'svg-0' }],\n ['path', { d: 'M12 9h.01', key: 'svg-1' }],\n ['path', { d: 'M11 12h1v4h1', key: 'svg-2' }],\n]);\n", "import createReactComponent from '../createReactComponent';\nexport default createReactComponent('x', 'IconX', [\n ['path', { d: 'M18 6l-12 12', key: 'svg-0' }],\n ['path', { d: 'M6 6l12 12', key: 'svg-1' }],\n]);\n", "import { IconCheck, IconInfoCircle, IconAlertTriangle, IconX } from '@tabler/icons-react';\nimport { AlertShow } from './types';\n\nexport interface AlertShowSeverities {\n success: AlertShow;\n info: AlertShow;\n warning: AlertShow;\n error: AlertShow;\n}\n\ninterface AlertSeverityOptions {\n iconSize?: string | number;\n}\n\nexport const useAlertSeverity = (show: AlertShow, props: AlertSeverityOptions = {}) => {\n const { iconSize = '1.1rem' } = props;\n\n const success: AlertShow = (data) => {\n const severity = { color: 'green', title: 'Success', icon: <IconCheck size={iconSize} /> };\n return show({ ...severity, ...data });\n };\n\n const info: AlertShow = (data) => {\n const severity = { color: 'blue', title: 'Info', icon: <IconInfoCircle size={iconSize} /> };\n return show({ ...severity, ...data });\n };\n\n const warning: AlertShow = (data) => {\n const severity = { color: 'yellow', title: 'Warning', icon: <IconAlertTriangle size={iconSize} /> };\n return show({ ...severity, ...data });\n };\n\n const error: AlertShow = (data) => {\n const severity = { color: 'red', title: 'Error', icon: <IconX size={iconSize} /> };\n return show({ ...severity, ...data });\n };\n\n return { success, info, warning, error };\n};\n"],
"mappings": "ygBAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cASA,IAAIC,EAAuB,+CAE3BD,EAAO,QAAUC,ICXjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cASA,IAAIC,EAAuB,IAE3B,SAASC,GAAgB,CAAC,CAC1B,SAASC,GAAyB,CAAC,CACnCA,EAAuB,kBAAoBD,EAE3CF,EAAO,QAAU,UAAW,CAC1B,SAASI,EAAKC,EAAOC,EAAUC,EAAeC,EAAUC,EAAcC,EAAQ,CAC5E,GAAIA,IAAWT,EAIf,KAAIU,EAAM,IAAI,MACZ,iLAGF,EACA,MAAAA,EAAI,KAAO,sBACLA,EACR,CACAP,EAAK,WAAaA,EAClB,SAASQ,GAAU,CACjB,OAAOR,CACT,CAGA,IAAIS,EAAiB,CACnB,MAAOT,EACP,OAAQA,EACR,KAAMA,EACN,KAAMA,EACN,OAAQA,EACR,OAAQA,EACR,OAAQA,EACR,OAAQA,EAER,IAAKA,EACL,QAASQ,EACT,QAASR,EACT,YAAaA,EACb,WAAYQ,EACZ,KAAMR,EACN,SAAUQ,EACV,MAAOA,EACP,UAAWA,EACX,MAAOA,EACP,MAAOA,EAEP,eAAgBT,EAChB,kBAAmBD,CACrB,EAEA,OAAAW,EAAe,UAAYA,EAEpBA,CACT,IChEA,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,CAiBEA,EAAO,QAAU,IAAsC,EATnD,IAAAC,GAIAC,wECZN,IAAeC,EAAA,CACb,MAAO,6BACP,MAAO,GACP,OAAQ,GACR,QAAS,YACT,KAAM,OACN,OAAQ,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,CAAC,ECFD,IAAAC,EAAeC,EAAqB,cAAe,iBAAkB,CACnE,CAAC,OAAQ,CAAE,EAAG,uCAAwC,IAAK,OAAA,CAAS,EACpE,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,OAAA,CAAS,EACzC,CAAC,OAAQ,CAAE,EAAG,eAAgB,IAAK,OAAA,CAAS,CAC9C,CAAC,ECJD,IAAAC,EAAeC,EAAqB,IAAK,QAAS,CAChD,CAAC,OAAQ,CAAE,EAAG,eAAgB,IAAK,OAAA,CAAS,EAC5C,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,OAAA,CAAS,CAC5C,CAAC,ECc8D,cAAAC,MAAA,oBAJxD,IAAMC,GAAmB,CAACC,EAAiBC,EAA8B,CAAC,IAAM,CACrF,GAAM,CAAE,SAAAC,EAAW,QAAS,EAAID,EAsBhC,MAAO,CAAE,QApBmBE,GAEnBH,EAAK,CAAE,GADG,CAAE,MAAO,QAAS,MAAO,UAAW,KAAMF,EAACM,EAAA,CAAU,KAAMF,EAAU,CAAG,EAC9D,GAAGC,CAAK,CAAC,EAkBpB,KAfOA,GAEhBH,EAAK,CAAE,GADG,CAAE,MAAO,OAAQ,MAAO,OAAQ,KAAMF,EAACO,EAAA,CAAe,KAAMH,EAAU,CAAG,EAC/D,GAAGC,CAAK,CAAC,EAad,QAVIA,GAEnBH,EAAK,CAAE,GADG,CAAE,MAAO,SAAU,MAAO,UAAW,KAAMF,EAACQ,EAAA,CAAkB,KAAMJ,EAAU,CAAG,EACvE,GAAGC,CAAK,CAAC,EAQL,MALPA,GAEjBH,EAAK,CAAE,GADG,CAAE,MAAO,MAAO,MAAO,QAAS,KAAMF,EAACS,EAAA,CAAM,KAAML,EAAU,CAAG,EACtD,GAAGC,CAAK,CAAC,CAGC,CACzC",
"names": ["require_ReactPropTypesSecret", "__commonJSMin", "exports", "module", "ReactPropTypesSecret", "require_factoryWithThrowingShims", "__commonJSMin", "exports", "module", "ReactPropTypesSecret", "emptyFunction", "emptyFunctionWithReset", "shim", "props", "propName", "componentName", "location", "propFullName", "secret", "err", "getShim", "ReactPropTypes", "require_prop_types", "__commonJSMin", "exports", "module", "ReactIs", "throwOnDirectAccess", "defaultAttributes", "createReactComponent", "iconName", "iconNamePascal", "iconNode", "Component", "forwardRef", "_a", "ref", "_b", "color", "size", "stroke", "children", "rest", "__objRest", "createElement", "__spreadValues", "__spreadProps", "defaultAttributes", "tag", "attrs", "PropTypes", "IconAlertTriangle", "createReactComponent", "IconCheck", "createReactComponent", "IconInfoCircle", "createReactComponent", "IconX", "createReactComponent", "jsx", "useAlertSeverity", "show", "props", "iconSize", "data", "IconCheck", "IconInfoCircle", "IconAlertTriangle", "IconX"]
}