@ebay/ui-core-react 7.0.0 → 7.0.2

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.
@@ -13,6 +13,10 @@ import { EbayButton } from '@ebay/ui-core-react/ebay-button'
13
13
  ```jsx harmony
14
14
  import "@ebay/skin/button"
15
15
  ```
16
+ ### If tokens haven't been added to the project at a higher level, make sure to import
17
+ ```jsx harmony
18
+ import '@ebay/skin/tokens';
19
+ ```
16
20
  ### Or import styles using SCSS/CSS
17
21
  ```jsx harmony
18
22
  import '@ebay/skin/button.css'
@@ -22,6 +22,18 @@ import '@ebay/skin/checkbox'
22
22
  import '@ebay/skin/checkbox.css'
23
23
  ```
24
24
 
25
+ ## Import EbaySvg
26
+
27
+ After you render the EbayCheckbox component in your application, if you do not see the checkbox svg, you should add import and render EbaySvg component once at the root level of your application (usually layout file).
28
+
29
+ ```jsx
30
+ import { EbaySvg } from "@ebay/ui-core-react/ebay-svg";
31
+
32
+ // Render this in your layout or root level component.
33
+ <EbaySvg />
34
+ ```
35
+
36
+
25
37
  ```jsx
26
38
  import { EbayLabel } from '@ebay/ui-core-react/ebay-field';
27
39
 
@@ -95,7 +95,7 @@ const EbayDrawerDialog = (_a) => {
95
95
  const childrenArray = react_1.Children.toArray(children);
96
96
  const header = childrenArray.find(({ type }) => type === ebay_dialog_base_1.EbayDialogHeader);
97
97
  const withoutHeader = childrenArray.filter(({ type }) => type !== ebay_dialog_base_1.EbayDialogHeader);
98
- return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, Object.assign({}, rest, { classPrefix: classPrefix, onCloseBtnClick: onClose, className: (0, classnames_1.default)(rest.className, `${classPrefix}--mask-fade-slow`), windowClass: (0, classnames_1.default)(`${classPrefix}__window`, `${classPrefix}__window--slide`, {
98
+ return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, Object.assign({}, rest, { classPrefix: classPrefix, onCloseBtnClick: onClose, className: (0, classnames_1.default)(rest.className, `${classPrefix}--mask-fade-slow`), windowClass: (0, classnames_1.default)(rest.windowClass, `${classPrefix}__window`, `${classPrefix}__window--slide`, {
99
99
  [`${classPrefix}__window--expanded`]: expanded
100
100
  }), onBackgroundClick: onClose, top: handle }),
101
101
  header || react_1.default.createElement(ebay_dialog_base_1.EbayDialogHeader, null),
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/ebay-icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,GAAG,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAA;AAIrE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CACrC,CAAC;;AA2EF,wBAAuC"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/ebay-icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,GAAG,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAA;AAIrE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CACrC,CAAC;;AAwFF,wBAAuC"}
package/ebay-icon/icon.js CHANGED
@@ -58,7 +58,8 @@ const EbayIcon = (_a) => {
58
58
  };
59
59
  const kebabName = kebabCased(name);
60
60
  const size = getIconSize(kebabName) || kebabName;
61
- const className = (0, classnames_1.default)(extraClass, { [`icon icon--${size}`]: !noSkinClasses });
61
+ const skinClassName = [`icon`, `icon--${size}`, getFilledIconName(kebabName)].filter(Boolean).join(' ');
62
+ const className = (0, classnames_1.default)(extraClass, { [skinClassName]: !noSkinClasses });
62
63
  return (react_1.default.createElement("svg", Object.assign({}, rest, { className: className, xmlns: "http://www.w3.org/2000/svg", focusable: false, ref: forwardedRef }, a11yProps),
63
64
  a11yText && !withAriaLabel && react_1.default.createElement("title", { id: a11yTextId }, a11yText),
64
65
  react_1.default.createElement("use", { xlinkHref: `#icon-${kebabName}` })));
@@ -81,6 +82,14 @@ function getIconSize(iconName) {
81
82
  }
82
83
  return size;
83
84
  }
85
+ function getFilledIconName(iconName) {
86
+ const iconNameArray = iconName.split('-');
87
+ const filledIndex = iconNameArray.indexOf('filled');
88
+ if (filledIndex === -1) {
89
+ return '';
90
+ }
91
+ return `icon--${iconNameArray.slice(0, filledIndex + 1).join('-')}`;
92
+ }
84
93
  function kebabCased(str) {
85
94
  return str
86
95
  .replace(/([0-9]+)/g, (s, n) => `-${n}`)
@@ -13,11 +13,13 @@ import { EbayIconButton } from '@ebay/ui-core-react/ebay-icon-button'
13
13
 
14
14
  ### Import following styles from SKIN
15
15
  ```jsx harmony
16
+ import "@ebay/skin/icon"
16
17
  import "@ebay/skin/icon-button"
17
18
  ```
18
19
 
19
20
  ### Or import styles using SCSS/CSS
20
21
  ```jsx harmony
22
+ import '@ebay/skin/icon.css'
21
23
  import '@ebay/skin/icon-button.css'
22
24
  ```
23
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"progress-spinner.d.ts","sourceRoot":"","sources":["../../src/ebay-progress-spinner/progress-spinner.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAIjD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAEvD,KAAK,wBAAwB,GAAG;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAA;AAED,KAAK,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAQtD,QAAA,MAAM,mBAAmB,EAAE,EAAE,CAAC,SAAS,GAAG,wBAAwB,CAcjE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"progress-spinner.d.ts","sourceRoot":"","sources":["../../src/ebay-progress-spinner/progress-spinner.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAIjD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAEvD,KAAK,wBAAwB,GAAG;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAA;AAED,KAAK,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AActD,QAAA,MAAM,mBAAmB,EAAE,EAAE,CAAC,SAAS,GAAG,wBAAwB,CAcjE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -22,9 +22,14 @@ const sizeClass = {
22
22
  'small': 'progress-spinner--small',
23
23
  'large': 'progress-spinner--large'
24
24
  };
25
+ const iconName = {
26
+ 'default': 'spinner24',
27
+ 'small': 'spinner20',
28
+ 'large': 'spinner30'
29
+ };
25
30
  const EbayProgressSpinner = (_a) => {
26
31
  var { size = 'default', 'aria-label': ariaLabel = 'Busy', className } = _a, rest = __rest(_a, ["size", 'aria-label', "className"]);
27
32
  return (react_1.default.createElement("span", Object.assign({}, rest, { className: (0, classnames_1.default)('progress-spinner', sizeClass[size], className), "aria-label": ariaLabel, role: "img" }),
28
- react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "spinner24" })));
33
+ react_1.default.createElement(ebay_icon_1.EbayIcon, { name: iconName[size] })));
29
34
  };
30
35
  exports.default = EbayProgressSpinner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebay/ui-core-react",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "description": "Skin components build off React",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -23,8 +23,8 @@
23
23
  "update-icons": "node ./scripts/update-icons",
24
24
  "copy": "copyfiles package.json README.md lib; yarn copy:rest",
25
25
  "copy:rest": "yarn copyfiles -u 1 'src/**/*.md' lib",
26
- "prepublishOnly": "if [ -z \"$CI\" ]; then echo \"Please use CI, do not publish manually\"; exit 1; fi",
27
- "prerelease": "npm version prerelease --preid rc && yarn clean && yarn build && yarn copy && CI=1 npm publish --tag rc lib/",
26
+ "release": "yarn build && yarn copy && CI=1 npm publish lib/ --access public",
27
+ "release:rc": "npm version prerelease --preid rc && yarn clean && yarn build && yarn copy && CI=1 npm publish --tag rc lib/",
28
28
  "prepare": "node scripts/husky-install || node ../scripts/husky-install"
29
29
  },
30
30
  "lint-staged": {