@redsift/design-system 10.6.0 → 10.6.1-muiv5

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.
package/index.d.ts CHANGED
@@ -2156,6 +2156,42 @@ type StyledAppSidePanelProps = Omit<AppSidePanelProps, 'isCollapsed' | 'logo'> &
2156
2156
  */
2157
2157
  declare const AppSidePanel: Comp<AppSidePanelProps, HTMLDivElement>;
2158
2158
 
2159
+ /**
2160
+ * Component variant.
2161
+ */
2162
+ declare const BadgeVariant: {
2163
+ readonly dot: "dot";
2164
+ readonly standard: "standard";
2165
+ };
2166
+ type BadgeVariant = ValueOf<typeof BadgeVariant>;
2167
+ /**
2168
+ * Component props.
2169
+ */
2170
+ interface BadgeProps extends ComponentProps<'div'>, LayoutProps, SpacingProps, PositioningProps {
2171
+ /** Whether the badge should automatically break content. */
2172
+ autoBreak?: boolean;
2173
+ /** Color variant. The product colors are available but should only be used to display the Badge in the color of another product. To display a Badge with a color of the current product, use `default`. */
2174
+ color?: NotificationsColorPalette | PresentationColorPalette;
2175
+ /** Whether the Badge has its colors reversed or not. */
2176
+ isReversed?: boolean;
2177
+ /** Theme. */
2178
+ theme?: Theme;
2179
+ /** Badge variant. */
2180
+ variant?: BadgeVariant;
2181
+ }
2182
+ type StyledBadgeProps = Omit<BadgeProps, 'color' | 'variant' | 'isReversed' | 'autoBreak'> & {
2183
+ $autoBreak: BadgeProps['autoBreak'];
2184
+ $color: BadgeProps['color'];
2185
+ $isReversed: BadgeProps['isReversed'];
2186
+ $variant: BadgeProps['variant'];
2187
+ $theme: BadgeProps['theme'];
2188
+ };
2189
+
2190
+ /**
2191
+ * The Badge component.
2192
+ */
2193
+ declare const Badge: Comp<BadgeProps, HTMLDivElement>;
2194
+
2159
2195
  /**
2160
2196
  * Context props.
2161
2197
  */
@@ -2187,6 +2223,8 @@ interface SideNavigationMenuProps extends ComponentProps<'div'> {
2187
2223
  buttonProps?: ComponentProps<'button'>;
2188
2224
  /** Custom ref to pass to the button. */
2189
2225
  buttonRef?: MutableRefObject<HTMLButtonElement>;
2226
+ /** Custom props to pass to the Badge component, if any. */
2227
+ badgeProps?: Omit<BadgeProps, 'ref'>;
2190
2228
  /** Whether or not the menu contains children that have a badge. */
2191
2229
  hasBadge?: boolean;
2192
2230
  /**
@@ -2202,6 +2240,8 @@ interface SideNavigationMenuProps extends ComponentProps<'div'> {
2202
2240
  isDisabled?: boolean;
2203
2241
  /** Whether the menu is expanded or not. */
2204
2242
  isExpanded?: boolean;
2243
+ /** By default, the badge is hidden when the menu is expanded. This prop controls this behavior. */
2244
+ keepBadgeVisible?: boolean;
2205
2245
  /** Custom props to pass to the menu. */
2206
2246
  menuProps?: ComponentProps<'ul'>;
2207
2247
  /** Custom ref to pass to the menu. */
@@ -2222,42 +2262,6 @@ type StyledSideNavigationMenuProps = Omit<SideNavigationMenuProps, 'isDisabled'
2222
2262
  */
2223
2263
  declare const SideNavigationMenu: Comp<SideNavigationMenuProps, HTMLDivElement>;
2224
2264
 
2225
- /**
2226
- * Component variant.
2227
- */
2228
- declare const BadgeVariant: {
2229
- readonly dot: "dot";
2230
- readonly standard: "standard";
2231
- };
2232
- type BadgeVariant = ValueOf<typeof BadgeVariant>;
2233
- /**
2234
- * Component props.
2235
- */
2236
- interface BadgeProps extends ComponentProps<'div'>, LayoutProps, SpacingProps, PositioningProps {
2237
- /** Whether the badge should automatically break content. */
2238
- autoBreak?: boolean;
2239
- /** Color variant. The product colors are available but should only be used to display the Badge in the color of another product. To display a Badge with a color of the current product, use `default`. */
2240
- color?: NotificationsColorPalette | PresentationColorPalette;
2241
- /** Whether the Badge has its colors reversed or not. */
2242
- isReversed?: boolean;
2243
- /** Theme. */
2244
- theme?: Theme;
2245
- /** Badge variant. */
2246
- variant?: BadgeVariant;
2247
- }
2248
- type StyledBadgeProps = Omit<BadgeProps, 'color' | 'variant' | 'isReversed' | 'autoBreak'> & {
2249
- $autoBreak: BadgeProps['autoBreak'];
2250
- $color: BadgeProps['color'];
2251
- $isReversed: BadgeProps['isReversed'];
2252
- $variant: BadgeProps['variant'];
2253
- $theme: BadgeProps['theme'];
2254
- };
2255
-
2256
- /**
2257
- * The Badge component.
2258
- */
2259
- declare const Badge: Comp<BadgeProps, HTMLDivElement>;
2260
-
2261
2265
  /**
2262
2266
  * Component props.
2263
2267
  */
package/index.js CHANGED
@@ -6866,6 +6866,10 @@ const StyledSideNavigationMenu = styled.div`
6866
6866
  width: 100%;
6867
6867
  }
6868
6868
 
6869
+ .redsift-badge {
6870
+ margin-left: 8px;
6871
+ }
6872
+
6869
6873
  ${_ref => {
6870
6874
  let {
6871
6875
  $isDisabled,
@@ -7193,7 +7197,7 @@ const AppContainer = /*#__PURE__*/forwardRef((props, ref) => {
7193
7197
  AppContainer.className = CLASSNAME$H;
7194
7198
  AppContainer.displayName = COMPONENT_NAME$H;
7195
7199
 
7196
- const _excluded$K = ["aria-label", "buttonProps", "buttonRef", "children", "className", "hasBadge", "icon", "iconProps", "iconRef", "id", "isDisabled", "isExpanded", "menuProps", "menuRef", "tabIndex", "theme"];
7200
+ const _excluded$K = ["aria-label", "buttonProps", "buttonRef", "children", "className", "badgeProps", "hasBadge", "icon", "iconProps", "iconRef", "id", "isDisabled", "isExpanded", "keepBadgeVisible", "menuProps", "menuRef", "tabIndex", "theme"];
7197
7201
  const COMPONENT_NAME$G = 'SideNavigationMenu';
7198
7202
  const CLASSNAME$G = 'redsift-side-navigation-menu';
7199
7203
 
@@ -7207,6 +7211,7 @@ const SideNavigationMenu = /*#__PURE__*/forwardRef((props, ref) => {
7207
7211
  buttonRef = useRef(),
7208
7212
  children,
7209
7213
  className,
7214
+ badgeProps,
7210
7215
  hasBadge,
7211
7216
  icon,
7212
7217
  iconProps,
@@ -7214,6 +7219,7 @@ const SideNavigationMenu = /*#__PURE__*/forwardRef((props, ref) => {
7214
7219
  id: propsId,
7215
7220
  isDisabled,
7216
7221
  isExpanded: propsIsExpanded,
7222
+ keepBadgeVisible,
7217
7223
  menuProps = {},
7218
7224
  menuRef = useRef(),
7219
7225
  tabIndex,
@@ -7517,9 +7523,9 @@ const SideNavigationMenu = /*#__PURE__*/forwardRef((props, ref) => {
7517
7523
  size: IconSize.large
7518
7524
  })), /*#__PURE__*/React__default.createElement("span", {
7519
7525
  className: "content"
7520
- }, ariaLabel), hasBadge && !isExpanded ? /*#__PURE__*/React__default.createElement(Badge, {
7526
+ }, ariaLabel), hasBadge && (!isExpanded || keepBadgeVisible) ? /*#__PURE__*/React__default.createElement(Badge, _extends$1({
7521
7527
  color: "error"
7522
- }) : null, /*#__PURE__*/React__default.createElement(Icon, {
7528
+ }, badgeProps)) : null, /*#__PURE__*/React__default.createElement(Icon, {
7523
7529
  icon: mdiChevronDown,
7524
7530
  className: `${SideNavigationMenu.className}__expand-icon`,
7525
7531
  size: IconSize.medium