@britannica/ui
Advanced tools
Comparing version
@@ -287,6 +287,6 @@ 'use strict'; | ||
var isOpen = React.useContext(DropdownContext).isOpen; | ||
return isOpen ? /*#__PURE__*/React__default["default"].createElement(Tag, __assign({ | ||
return isOpen ? ( /*#__PURE__*/React__default["default"].createElement(Tag, __assign({ | ||
className: classnames__default["default"](className, 'dropdown-menu'), | ||
"data-testid": "DropdownMenu" | ||
}, props)) : null; | ||
}, props))) : null; | ||
}; | ||
@@ -387,4 +387,13 @@ | ||
} | ||
var originPathname; | ||
try { | ||
var _c = new URL(src), | ||
origin_1 = _c.origin, | ||
pathname = _c.pathname; | ||
originPathname = origin_1 + pathname; | ||
} catch (_d) { | ||
originPathname = CDN_URL + src; | ||
} | ||
var irisParamsString = irisParams.toString(); | ||
var computedSrc = CDN_URL + src + (irisParamsString === '' ? '' : "?".concat(irisParamsString)); | ||
var computedSrc = originPathname + (irisParamsString === '' ? '' : "?".concat(irisParamsString)); | ||
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("img", __assign({ | ||
@@ -441,3 +450,3 @@ loading: loading, | ||
}, [isOpen]); | ||
return /*#__PURE__*/React__default["default"].createElement(ClientPortal, null, isOpen && /*#__PURE__*/React__default["default"].createElement("div", { | ||
return /*#__PURE__*/React__default["default"].createElement(ClientPortal, null, isOpen && ( /*#__PURE__*/React__default["default"].createElement("div", { | ||
className: classnames__default["default"]('modal', { | ||
@@ -450,3 +459,3 @@ 'modal-centered': centered | ||
className: classnames__default["default"](className, 'modal-dialog') | ||
}, props)))); | ||
}, props))))); | ||
}; | ||
@@ -453,0 +462,0 @@ |
@@ -278,6 +278,6 @@ import classnames from 'classnames'; | ||
var isOpen = useContext(DropdownContext).isOpen; | ||
return isOpen ? /*#__PURE__*/React.createElement(Tag, __assign({ | ||
return isOpen ? ( /*#__PURE__*/React.createElement(Tag, __assign({ | ||
className: classnames(className, 'dropdown-menu'), | ||
"data-testid": "DropdownMenu" | ||
}, props)) : null; | ||
}, props))) : null; | ||
}; | ||
@@ -378,4 +378,13 @@ | ||
} | ||
var originPathname; | ||
try { | ||
var _c = new URL(src), | ||
origin_1 = _c.origin, | ||
pathname = _c.pathname; | ||
originPathname = origin_1 + pathname; | ||
} catch (_d) { | ||
originPathname = CDN_URL + src; | ||
} | ||
var irisParamsString = irisParams.toString(); | ||
var computedSrc = CDN_URL + src + (irisParamsString === '' ? '' : "?".concat(irisParamsString)); | ||
var computedSrc = originPathname + (irisParamsString === '' ? '' : "?".concat(irisParamsString)); | ||
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", __assign({ | ||
@@ -432,3 +441,3 @@ loading: loading, | ||
}, [isOpen]); | ||
return /*#__PURE__*/React.createElement(ClientPortal, null, isOpen && /*#__PURE__*/React.createElement("div", { | ||
return /*#__PURE__*/React.createElement(ClientPortal, null, isOpen && ( /*#__PURE__*/React.createElement("div", { | ||
className: classnames('modal', { | ||
@@ -441,3 +450,3 @@ 'modal-centered': centered | ||
className: classnames(className, 'modal-dialog') | ||
}, props)))); | ||
}, props))))); | ||
}; | ||
@@ -444,0 +453,0 @@ |
@@ -75,30 +75,41 @@ (function (global, factory) { | ||
function classNames() { | ||
var classes = []; | ||
var classes = ''; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var arg = arguments[i]; | ||
if (!arg) continue; | ||
var argType = typeof arg; | ||
if (argType === 'string' || argType === 'number') { | ||
classes.push(arg); | ||
} else if (Array.isArray(arg)) { | ||
if (arg.length) { | ||
var inner = classNames.apply(null, arg); | ||
if (inner) { | ||
classes.push(inner); | ||
} | ||
} | ||
} else if (argType === 'object') { | ||
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { | ||
classes.push(arg.toString()); | ||
continue; | ||
} | ||
for (var key in arg) { | ||
if (hasOwn.call(arg, key) && arg[key]) { | ||
classes.push(key); | ||
} | ||
} | ||
if (arg) { | ||
classes = appendClass(classes, parseValue(arg)); | ||
} | ||
} | ||
return classes.join(' '); | ||
return classes; | ||
} | ||
function parseValue(arg) { | ||
if (typeof arg === 'string' || typeof arg === 'number') { | ||
return arg; | ||
} | ||
if (typeof arg !== 'object') { | ||
return ''; | ||
} | ||
if (Array.isArray(arg)) { | ||
return classNames.apply(null, arg); | ||
} | ||
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { | ||
return arg.toString(); | ||
} | ||
var classes = ''; | ||
for (var key in arg) { | ||
if (hasOwn.call(arg, key) && arg[key]) { | ||
classes = appendClass(classes, key); | ||
} | ||
} | ||
return classes; | ||
} | ||
function appendClass(value, newClass) { | ||
if (!newClass) { | ||
return value; | ||
} | ||
if (value) { | ||
return value + ' ' + newClass; | ||
} | ||
return value + newClass; | ||
} | ||
if (module.exports) { | ||
@@ -341,6 +352,6 @@ classNames.default = classNames; | ||
var isOpen = React.useContext(DropdownContext).isOpen; | ||
return isOpen ? /*#__PURE__*/React__default["default"].createElement(Tag, __assign({ | ||
return isOpen ? ( /*#__PURE__*/React__default["default"].createElement(Tag, __assign({ | ||
className: classnames(className, 'dropdown-menu'), | ||
"data-testid": "DropdownMenu" | ||
}, props)) : null; | ||
}, props))) : null; | ||
}; | ||
@@ -441,4 +452,13 @@ | ||
} | ||
var originPathname; | ||
try { | ||
var _c = new URL(src), | ||
origin_1 = _c.origin, | ||
pathname = _c.pathname; | ||
originPathname = origin_1 + pathname; | ||
} catch (_d) { | ||
originPathname = CDN_URL + src; | ||
} | ||
var irisParamsString = irisParams.toString(); | ||
var computedSrc = CDN_URL + src + (irisParamsString === '' ? '' : "?".concat(irisParamsString)); | ||
var computedSrc = originPathname + (irisParamsString === '' ? '' : "?".concat(irisParamsString)); | ||
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("img", __assign({ | ||
@@ -495,3 +515,3 @@ loading: loading, | ||
}, [isOpen]); | ||
return /*#__PURE__*/React__default["default"].createElement(ClientPortal, null, isOpen && /*#__PURE__*/React__default["default"].createElement("div", { | ||
return /*#__PURE__*/React__default["default"].createElement(ClientPortal, null, isOpen && ( /*#__PURE__*/React__default["default"].createElement("div", { | ||
className: classnames('modal', { | ||
@@ -504,3 +524,3 @@ 'modal-centered': centered | ||
className: classnames(className, 'modal-dialog') | ||
}, props)))); | ||
}, props))))); | ||
}; | ||
@@ -507,0 +527,0 @@ |
{ | ||
"name": "@britannica/ui", | ||
"version": "1.16.0-beta.1", | ||
"version": "1.16.0-beta.2", | ||
"description": "Consumer style system", | ||
@@ -40,15 +40,16 @@ "main": "dist/britannica-ui.cjs.js", | ||
"devDependencies": { | ||
"@babel/core": "7.23.0", | ||
"@babel/core": "7.23.7", | ||
"@babel/eslint-parser": "7.23.3", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6", | ||
"@babel/plugin-proposal-optional-chaining": "7.21.0", | ||
"@babel/preset-react": "7.22.15", | ||
"@babel/preset-react": "7.23.3", | ||
"@britannica/eslint-config": "2.0.1", | ||
"@commitlint/cli": "17.7.2", | ||
"@commitlint/config-conventional": "17.7.0", | ||
"@commitlint/cli": "18.4.4", | ||
"@commitlint/config-conventional": "18.4.4", | ||
"@popperjs/core": "2.11.8", | ||
"@rollup/plugin-babel": "6.0.3", | ||
"@rollup/plugin-commonjs": "25.0.4", | ||
"@rollup/plugin-node-resolve": "15.2.1", | ||
"@rollup/plugin-replace": "5.0.2", | ||
"@rollup/plugin-typescript": "11.1.4", | ||
"@rollup/plugin-babel": "6.0.4", | ||
"@rollup/plugin-commonjs": "25.0.7", | ||
"@rollup/plugin-node-resolve": "15.2.3", | ||
"@rollup/plugin-replace": "5.0.5", | ||
"@rollup/plugin-typescript": "11.1.5", | ||
"@semantic-release/commit-analyzer": "9.0.2", | ||
@@ -65,8 +66,7 @@ "@semantic-release/git": "10.0.1", | ||
"@storybook/react": "6.5.16", | ||
"@testing-library/jest-dom": "6.1.3", | ||
"@types/lodash-es": "4.17.9", | ||
"@types/react": "18.2.24", | ||
"@types/react-dom": "18.2.8", | ||
"@typescript-eslint/parser": "6.7.3", | ||
"@babel/eslint-parser": "7.22.15", | ||
"@testing-library/jest-dom": "6.2.0", | ||
"@types/lodash-es": "4.17.12", | ||
"@types/react": "18.2.47", | ||
"@types/react-dom": "18.2.18", | ||
"@typescript-eslint/parser": "6.18.0", | ||
"babel-loader": "9.1.3", | ||
@@ -76,16 +76,16 @@ "babel-plugin-annotate-pure-calls": "0.4.0", | ||
"css-loader": "6.8.1", | ||
"eslint": "8.50.0", | ||
"eslint-config-prettier": "8.10.0", | ||
"eslint-plugin-import": "2.28.1", | ||
"eslint-plugin-jsx-a11y": "6.7.1", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"eslint": "8.56.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-import": "2.29.1", | ||
"eslint-plugin-jsx-a11y": "6.8.0", | ||
"eslint-plugin-prettier": "5.1.2", | ||
"eslint-plugin-react": "7.33.2", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"husky": "7.0.4", | ||
"husky": "8.0.3", | ||
"jest": "28.1.3", | ||
"jest-environment-jsdom": "28.1.3", | ||
"lint-staged": "15.2.0", | ||
"lodash-es": "4.17.21", | ||
"postcss": "8.4.31", | ||
"prettier": "2.8.8", | ||
"pretty-quick": "3.1.3", | ||
"postcss": "8.4.33", | ||
"prettier": "3.1.1", | ||
"react": "18.2.0", | ||
@@ -99,3 +99,3 @@ "react-dom": "18.2.0", | ||
"rollup-plugin-terser": "7.0.2", | ||
"sass": "1.68.0", | ||
"sass": "1.69.7", | ||
"sass-loader": "12.6.0", | ||
@@ -110,3 +110,3 @@ "semantic-release": "18.0.1", | ||
"@testing-library/react": "13.4.0", | ||
"classnames": "2.3.2" | ||
"classnames": "2.5.1" | ||
}, | ||
@@ -186,3 +186,6 @@ "peerDependencies": { | ||
"testEnvironment": "jsdom" | ||
}, | ||
"lint-staged": { | ||
"*.{ts,js,css,md}": "prettier --write" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
656470
4.24%16850
0.3%+ Added
- Removed
Updated