pixelon 0.6.1 → 0.6.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.
@@ -110,6 +110,8 @@ export interface SubMenuProps {
110
110
  level?: number;
111
111
  /** Si el submenu está deshabilitado */
112
112
  disabled?: boolean;
113
+ /** Contador sobre el propio submenu (p. ej. el total de sus hijos) */
114
+ badge?: number | string;
113
115
  }
114
116
  /**
115
117
  * Props del componente MenuItemGroup
package/dist/index.esm.js CHANGED
@@ -20992,8 +20992,10 @@ const SubMenu = ({
20992
20992
  icon,
20993
20993
  children = [],
20994
20994
  level = 0,
20995
- disabled = false
20995
+ disabled = false,
20996
+ badge
20996
20997
  }) => {
20998
+ const hasBadge = badge != null && badge !== "" && badge !== 0;
20997
20999
  const {
20998
21000
  openKeys,
20999
21001
  setOpenKeys,
@@ -21083,6 +21085,7 @@ const SubMenu = ({
21083
21085
  icon: item.icon,
21084
21086
  level: childLevel,
21085
21087
  disabled: !item.state,
21088
+ badge: item.badge,
21086
21089
  children: item.children
21087
21090
  },
21088
21091
  item.id
@@ -21094,6 +21097,7 @@ const SubMenu = ({
21094
21097
  itemKey: item.id,
21095
21098
  title: item.name,
21096
21099
  icon: item.icon,
21100
+ badge: item.badge,
21097
21101
  to: item.route,
21098
21102
  disabled: !item.state,
21099
21103
  level: childLevel
@@ -21130,6 +21134,7 @@ const SubMenu = ({
21130
21134
  children: [
21131
21135
  iconType && /* @__PURE__ */ jsx("span", { className: `${COMPONENT_PREFIX}submenu__icon`, children: /* @__PURE__ */ jsx(Icon, { type: iconType, size: "medium" }) }),
21132
21136
  /* @__PURE__ */ jsx("span", { className: `${COMPONENT_PREFIX}submenu__title-text`, children: title }),
21137
+ hasBadge && /* @__PURE__ */ jsx("span", { className: `${COMPONENT_PREFIX}submenu__badge`, "aria-label": `${badge} sin leer`, children: badge }),
21133
21138
  /* @__PURE__ */ jsx("span", { className: `${COMPONENT_PREFIX}submenu__arrow ${isOpen ? `${COMPONENT_PREFIX}submenu__arrow--open` : ""}`, children: /* @__PURE__ */ jsx(
21134
21139
  Icon,
21135
21140
  {
@@ -21249,6 +21254,7 @@ const Menu = ({
21249
21254
  icon: item.icon,
21250
21255
  level,
21251
21256
  disabled: !item.state,
21257
+ badge: item.badge,
21252
21258
  children: item.children
21253
21259
  },
21254
21260
  item.id
package/dist/index.js CHANGED
@@ -21013,8 +21013,10 @@ const SubMenu = ({
21013
21013
  icon,
21014
21014
  children = [],
21015
21015
  level = 0,
21016
- disabled = false
21016
+ disabled = false,
21017
+ badge
21017
21018
  }) => {
21019
+ const hasBadge = badge != null && badge !== "" && badge !== 0;
21018
21020
  const {
21019
21021
  openKeys,
21020
21022
  setOpenKeys,
@@ -21104,6 +21106,7 @@ const SubMenu = ({
21104
21106
  icon: item.icon,
21105
21107
  level: childLevel,
21106
21108
  disabled: !item.state,
21109
+ badge: item.badge,
21107
21110
  children: item.children
21108
21111
  },
21109
21112
  item.id
@@ -21115,6 +21118,7 @@ const SubMenu = ({
21115
21118
  itemKey: item.id,
21116
21119
  title: item.name,
21117
21120
  icon: item.icon,
21121
+ badge: item.badge,
21118
21122
  to: item.route,
21119
21123
  disabled: !item.state,
21120
21124
  level: childLevel
@@ -21151,6 +21155,7 @@ const SubMenu = ({
21151
21155
  children: [
21152
21156
  iconType && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${COMPONENT_PREFIX}submenu__icon`, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: iconType, size: "medium" }) }),
21153
21157
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${COMPONENT_PREFIX}submenu__title-text`, children: title }),
21158
+ hasBadge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${COMPONENT_PREFIX}submenu__badge`, "aria-label": `${badge} sin leer`, children: badge }),
21154
21159
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${COMPONENT_PREFIX}submenu__arrow ${isOpen ? `${COMPONENT_PREFIX}submenu__arrow--open` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
21155
21160
  Icon,
21156
21161
  {
@@ -21270,6 +21275,7 @@ const Menu = ({
21270
21275
  icon: item.icon,
21271
21276
  level,
21272
21277
  disabled: !item.state,
21278
+ badge: item.badge,
21273
21279
  children: item.children
21274
21280
  },
21275
21281
  item.id