@kodiak-ui/message
Advanced tools
Comparing version 0.2.44 to 0.2.45
@@ -1,11 +0,1 @@ | ||
// are you seeing an error that a default export doesn't exist but your source file has a default export? | ||
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook | ||
// curious why you need to? | ||
// this file exists so that you can import from the entrypoint normally | ||
// except that it points to your source file and you don't need to run build constantly | ||
// which means we need to re-export all of the modules from your source file | ||
// and since export * doesn't include default exports, we need to read your source file | ||
// to check for a default export and re-export it if it exists | ||
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯ | ||
export * from "../src/index"; | ||
export * from "./declarations/src/index"; |
@@ -1,21 +0,7 @@ | ||
"use strict"; | ||
// this file might look strange and you might be wondering what it's for | ||
// it's lets you import your source files by importing this entrypoint | ||
// as you would import it if it was built with preconstruct build | ||
// this file is slightly different to some others though | ||
// it has a require hook which compiles your code with Babel | ||
// this means that you don't have to set up @babel/register or anything like that | ||
// but you can still require this module and it'll be compiled | ||
'use strict'; | ||
const path = require("path"); | ||
// this bit of code imports the require hook and registers it | ||
let unregister = require("../../../node_modules/@preconstruct/hook/dist/hook.cjs.js").___internalHook(path.resolve(__dirname, "../../.."), path.resolve(__dirname, "..")); | ||
// this re-exports the source file | ||
module.exports = require("../src/index.ts"); | ||
// this unregisters the require hook so that any modules required after this one | ||
// aren't compiled with the require hook in case you have some other require hook | ||
// or something that should be used on other modules | ||
unregister(); | ||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("./message.cjs.prod.js"); | ||
} else { | ||
module.exports = require("./message.cjs.dev.js"); | ||
} |
@@ -1,15 +0,68 @@ | ||
// 👋 hey!! | ||
// you might be reading this and seeing .esm in the filename | ||
// and being confused why there is commonjs below this filename | ||
// DON'T WORRY! | ||
// this is intentional | ||
// it's only commonjs with `preconstruct dev` | ||
// when you run `preconstruct build`, it will be ESM | ||
// why is it commonjs? | ||
// we need to re-export every export from the source file | ||
// but we can't do that with ESM without knowing what the exports are (because default exports aren't included in export/import *) | ||
// and they could change after running `preconstruct dev` so we can't look at the file without forcing people to | ||
// run preconstruct dev again which wouldn't be ideal | ||
// this solution could change but for now, it's working | ||
import { forwardRef, createElement } from 'react'; | ||
import { Box } from '@kodiak-ui/primitives/box'; | ||
import { Button } from '@kodiak-ui/primitives/button'; | ||
import { Flex } from '@kodiak-ui/primitives/flex'; | ||
import { SvgIcon } from '@kodiak-ui/primitives/svg'; | ||
import { VisuallyHidden } from '@kodiak-ui/primitives/visually-hidden'; | ||
module.exports = require("../src/index.ts") | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
var Message = /*#__PURE__*/forwardRef(function Message(_ref, forwardedRef) { | ||
var children = _ref.children, | ||
_ref$type = _ref.type, | ||
type = _ref$type === void 0 ? 'polite' : _ref$type, | ||
dismissLabel = _ref.dismissLabel, | ||
onDismiss = _ref.onDismiss, | ||
_ref$variantKey = _ref.variantKey, | ||
variantKey = _ref$variantKey === void 0 ? 'messages' : _ref$variantKey, | ||
props = _objectWithoutProperties(_ref, ["children", "type", "dismissLabel", "onDismiss", "variantKey"]); | ||
return /*#__PURE__*/createElement(Box, _extends({ | ||
__base: { | ||
alignItems: 'center', | ||
bg: 'highlight', | ||
borderLeftStyle: 'solid', | ||
borderLeftWidth: function borderLeftWidth(t) { | ||
return t.space[2]; | ||
}, | ||
borderLeftColor: 'primary', | ||
borderRadius: 'default', | ||
display: 'inline-flex', | ||
justifyContent: 'space-between', | ||
maxWidth: 636, | ||
minWidth: 370, | ||
minHeight: 64, | ||
padding: 4 | ||
}, | ||
ref: forwardedRef, | ||
role: type === 'assertive' ? 'alert' : 'status', | ||
"aria-live": type, | ||
variantKey: variantKey | ||
}, props), /*#__PURE__*/createElement(Flex, { | ||
sx: { | ||
alignItems: 'center', | ||
flexGrow: 1 | ||
} | ||
}, children), onDismiss ? /*#__PURE__*/createElement(Button, { | ||
variant: "shadow", | ||
onClick: onDismiss, | ||
"data-testid": "messageDismiss", | ||
sx: { | ||
color: 'currentColor' | ||
} | ||
}, /*#__PURE__*/createElement(VisuallyHidden, null, dismissLabel ? dismissLabel : 'Dismiss message'), /*#__PURE__*/createElement(SvgIcon, { | ||
viewBox: "0 0 16 16", | ||
height: "16px", | ||
width: "16px", | ||
sx: { | ||
color: 'currentColor' | ||
} | ||
}, /*#__PURE__*/createElement("path", { | ||
d: "M9.15 8.088a.125.125 0 010-.177l4.63-4.63a.75.75 0 00-1.061-1.06l-4.63 4.628a.125.125 0 01-.178 0L3.281 2.22A.75.75 0 002.22 3.28l4.63 4.631a.125.125 0 010 .177L2.22 12.72a.75.75 0 101.06 1.06l4.631-4.63a.125.125 0 01.177 0l4.63 4.63a.75.75 0 101.062-1.06L9.15 8.09z" | ||
}))) : null); | ||
}); | ||
export { Message }; |
{ | ||
"name": "@kodiak-ui/message", | ||
"version": "0.2.44", | ||
"version": "0.2.45", | ||
"description": "Component to display messages to users (i.e. alerts, notifications)", | ||
@@ -23,5 +23,5 @@ "main": "dist/message.cjs.js", | ||
"dependencies": { | ||
"@kodiak-ui/primitives": "^0.18.5" | ||
"@kodiak-ui/primitives": "^0.18.6" | ||
}, | ||
"gitHead": "ee8aafc7b061191f3ff278122bce1310c64b16e5" | ||
"gitHead": "dbab163275e24d148c1d53146d168331b4376c44" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12769
9
230
2