@superdispatch/ui-lab 0.21.14 → 0.21.19

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.
@@ -27,11 +27,13 @@ export var Alert = /*#__PURE__*/forwardRef((_ref, ref) => {
27
27
  var {
28
28
  children,
29
29
  onClose,
30
- severity = 'positive'
30
+ severity = 'positive',
31
+ icon
31
32
  } = _ref;
32
33
  return /*#__PURE__*/_jsx(StyledAlert, {
33
34
  ref: ref,
34
35
  variant: "outlined",
36
+ icon: icon,
35
37
  iconMapping: iconMapping,
36
38
  severity: toMaterialSeverity(severity),
37
39
  onClose: onClose,
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
2
  import { Accordion, AccordionSummary } from '@material-ui/core';
3
3
  import { ExpandMore } from '@material-ui/icons';
4
4
  import { Color, useUID } from '@superdispatch/ui';
5
- import { useEffect, useState } from 'react';
5
+ import { useEffect, useMemo, useState } from 'react';
6
6
  import styled from 'styled-components';
7
7
  import { useNavbarContext } from "./NavbarContext.js";
8
8
  import { NavbarItem } from "./NavbarItem.js";
@@ -43,6 +43,7 @@ export function NavbarAccordion(_ref) {
43
43
  useEffect(() => {
44
44
  setExpanded(isNavbarExpanded);
45
45
  }, [isNavbarExpanded]);
46
+ var filteredItems = useMemo(() => items.filter(item => !item.hide), [items]);
46
47
  return /*#__PURE__*/_jsxs(NavbarAccordionRoot, {
47
48
  square: true,
48
49
  "data-gutter": !gutter,
@@ -66,9 +67,9 @@ export function NavbarAccordion(_ref) {
66
67
  "data-expanded": isNavbarExpanded,
67
68
  children: label
68
69
  })]
69
- }), items.map(item => {
70
- var index = items.indexOf(item);
71
- var prev = items[index - 1];
70
+ }), filteredItems.map(item => {
71
+ var index = filteredItems.indexOf(item);
72
+ var prev = filteredItems[index - 1];
72
73
  var {
73
74
  ident = 0
74
75
  } = item;
@@ -12,6 +12,7 @@ declare type AlertSeverityProp = 'positive' | 'info' | 'caution' | 'critical';
12
12
  interface AlertProps {
13
13
  onClose?: () => void;
14
14
  children?: ReactNode;
15
+ icon?: ReactNode;
15
16
  severity?: AlertSeverityProp;
16
17
  }
17
18
  declare const Alert: ForwardRefExoticComponent<AlertProps & RefAttributes<HTMLDivElement>>;
package/dist-web/index.js CHANGED
@@ -35,11 +35,13 @@ var Alert = /*#__PURE__*/forwardRef((_ref, ref) => {
35
35
  var {
36
36
  children,
37
37
  onClose,
38
- severity = 'positive'
38
+ severity = 'positive',
39
+ icon
39
40
  } = _ref;
40
41
  return /*#__PURE__*/jsx(StyledAlert, {
41
42
  ref: ref,
42
43
  variant: "outlined",
44
+ icon: icon,
43
45
  iconMapping: iconMapping,
44
46
  severity: toMaterialSeverity(severity),
45
47
  onClose: onClose,
@@ -1217,6 +1219,7 @@ function NavbarAccordion(_ref) {
1217
1219
  useEffect(() => {
1218
1220
  setExpanded(isNavbarExpanded);
1219
1221
  }, [isNavbarExpanded]);
1222
+ var filteredItems = useMemo(() => items.filter(item => !item.hide), [items]);
1220
1223
  return /*#__PURE__*/jsxs(NavbarAccordionRoot, {
1221
1224
  square: true,
1222
1225
  "data-gutter": !gutter,
@@ -1240,9 +1243,9 @@ function NavbarAccordion(_ref) {
1240
1243
  "data-expanded": isNavbarExpanded,
1241
1244
  children: label
1242
1245
  })]
1243
- }), items.map(item => {
1244
- var index = items.indexOf(item);
1245
- var prev = items[index - 1];
1246
+ }), filteredItems.map(item => {
1247
+ var index = filteredItems.indexOf(item);
1248
+ var prev = filteredItems[index - 1];
1246
1249
  var {
1247
1250
  ident = 0
1248
1251
  } = item;