draft-components 1.3.0 → 1.4.1

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.
@@ -4,18 +4,18 @@ const jsxRuntime = require('react/jsx-runtime');
4
4
  const react = require('react');
5
5
  const reactHelpers = require('../../lib/react-helpers.cjs');
6
6
 
7
- const MenuItem = react.forwardRef(function MenuItem({ role = 'menuitem', appearance = 'default', iconLeft = null, iconRight = null, className, children, ...props }, ref) {
7
+ const MenuItem = react.forwardRef(function MenuItem({ role = 'menuitem', appearance = 'default', leftIcon = null, rightIcon = null, className, children, ...props }, ref) {
8
8
  let label = children;
9
- if (iconLeft || iconRight) {
9
+ if (leftIcon || rightIcon) {
10
10
  const className = reactHelpers.classNames('dc-menu-btn__label', {
11
- 'dc-menu-btn__label_gap_left': iconLeft,
12
- 'dc-menu-btn__label_gap_right': iconRight,
11
+ 'dc-menu-btn__label_gap_left': leftIcon,
12
+ 'dc-menu-btn__label_gap_right': rightIcon,
13
13
  });
14
14
  label = jsxRuntime.jsx("span", { className: className, children: label });
15
15
  }
16
16
  return (jsxRuntime.jsx("li", { role: "presentation", children: jsxRuntime.jsxs("button", { ...props, ref: ref, className: reactHelpers.classNames(className, 'dc-menu-btn', {
17
17
  [`dc-menu-btn_${appearance}`]: appearance,
18
- }), type: "button", role: role, tabIndex: -1, children: [iconLeft, label, iconRight] }) }));
18
+ }), type: "button", role: role, tabIndex: -1, children: [leftIcon, label, rightIcon] }) }));
19
19
  });
20
20
 
21
21
  exports.MenuItem = MenuItem;
@@ -28,7 +28,7 @@
28
28
 
29
29
  /* Colors */
30
30
  --dc-white: #fff;
31
- --dc-white-rgb: 255, 255, 255;
31
+ --dc-white-rgb: 255 255 255;
32
32
  --dc-black: #000;
33
33
  --dc-black-rgb: 0 0 0;
34
34
 
@@ -2,18 +2,18 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { classNames } from '../../lib/react-helpers.js';
4
4
 
5
- const MenuItem = forwardRef(function MenuItem({ role = 'menuitem', appearance = 'default', iconLeft = null, iconRight = null, className, children, ...props }, ref) {
5
+ const MenuItem = forwardRef(function MenuItem({ role = 'menuitem', appearance = 'default', leftIcon = null, rightIcon = null, className, children, ...props }, ref) {
6
6
  let label = children;
7
- if (iconLeft || iconRight) {
7
+ if (leftIcon || rightIcon) {
8
8
  const className = classNames('dc-menu-btn__label', {
9
- 'dc-menu-btn__label_gap_left': iconLeft,
10
- 'dc-menu-btn__label_gap_right': iconRight,
9
+ 'dc-menu-btn__label_gap_left': leftIcon,
10
+ 'dc-menu-btn__label_gap_right': rightIcon,
11
11
  });
12
12
  label = jsx("span", { className: className, children: label });
13
13
  }
14
14
  return (jsx("li", { role: "presentation", children: jsxs("button", { ...props, ref: ref, className: classNames(className, 'dc-menu-btn', {
15
15
  [`dc-menu-btn_${appearance}`]: appearance,
16
- }), type: "button", role: role, tabIndex: -1, children: [iconLeft, label, iconRight] }) }));
16
+ }), type: "button", role: role, tabIndex: -1, children: [leftIcon, label, rightIcon] }) }));
17
17
  });
18
18
 
19
19
  export { MenuItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "The React based UI components library.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -6,8 +6,8 @@ export type MenuItemRole = 'menuitem' | 'menuitemradio';
6
6
  export type MenuItemProps = {
7
7
  role?: MenuItemRole;
8
8
  appearance?: MenuItemAppearance;
9
- iconLeft?: ReactNode;
10
- iconRight?: ReactNode;
9
+ leftIcon?: ReactNode;
10
+ rightIcon?: ReactNode;
11
11
  children: ReactNode;
12
12
  } & MenuItemBaseProps;
13
13
  export declare const MenuItem: import("react").ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;