@kodiak-ui/message
Advanced tools
Comparing version 0.2.18 to 0.2.19
@@ -1,1 +0,11 @@ | ||
export * from "./declarations/src/index"; | ||
// 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"; |
@@ -1,7 +0,19 @@ | ||
'use strict'; | ||
"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 | ||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("./message.cjs.prod.js"); | ||
} else { | ||
module.exports = require("./message.cjs.dev.js"); | ||
} | ||
// this bit of code imports the require hook and registers it | ||
let unregister = require("/Users/wescole/Jilt/kodiak-ui/node_modules/@preconstruct/hook/dist/hook.cjs.js").___internalHook("/Users/wescole/Jilt/kodiak-ui"); | ||
// this re-exports the source file | ||
module.exports = require("/Users/wescole/Jilt/kodiak-ui/packages/message/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(); |
@@ -1,62 +0,15 @@ | ||
import { forwardRef, createElement } from 'react'; | ||
import { Box, Flex, Button, VisuallyHidden, SvgIcon } from '@kodiak-ui/primitives'; | ||
// 👋 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 | ||
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, { | ||
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 }; | ||
module.exports = require("/Users/wescole/Jilt/kodiak-ui/packages/message/src/index.ts") |
{ | ||
"name": "@kodiak-ui/message", | ||
"version": "0.2.18", | ||
"version": "0.2.19", | ||
"description": "Component to display messages to users (i.e. alerts, notifications)", | ||
@@ -25,6 +25,6 @@ "main": "dist/message.cjs.js", | ||
"@kodiak-ui/core": "^0.1.16", | ||
"@kodiak-ui/primitives": "^0.16.8", | ||
"@kodiak-ui/primitives": "^0.16.9", | ||
"theme-ui": "^0.3.1" | ||
}, | ||
"gitHead": "6a4b2c1555886c353eed7b877cadccd7b0a4d00c" | ||
"gitHead": "5b3355d28f558f34eb09bb6950493d81a3407114" | ||
} |
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
1
4405
5
40
1
+ Addedsnyk@1.1295.1(transitive)
- Removedsnyk@1.1295.0(transitive)