@moderneinc/neo-styled-components 2.8.0-next.fea0d4 → 3.0.0

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/dist/index.js CHANGED
@@ -1046,9 +1046,17 @@ const StyledIconButton$1 = styles.styled(IconButton)(({ closeIconColor }) => ({
1046
1046
  backgroundColor: 'transparent',
1047
1047
  },
1048
1048
  }));
1049
- const NeoBanner = ({ intent = 'info', type = 'outlined', message, messagePosition = 'left', linkText, showClose = true, icon, onClose, onLinkClick, ...props }) => {
1049
+ const NeoBanner = ({ intent = 'info', type = 'outlined', message, messagePosition = 'left', linkText, showClose = false, icon, onClose, onLinkClick, ...props }) => {
1050
+ const [dismissed, setDismissed] = React.useState(false);
1051
+ const handleClose = () => {
1052
+ setDismissed(true);
1053
+ onClose?.();
1054
+ };
1055
+ if (dismissed) {
1056
+ return null;
1057
+ }
1050
1058
  const closeIconColor = type === 'filled' ? neoDesign.semanticColors.surfaces.white : intentColors[intent].default;
1051
- return (jsxRuntime.jsx(StyledAlert$2, { ...props, intent: intent, bannerType: type, messagePosition: messagePosition, icon: messagePosition === 'left' ? icon || false : false, action: showClose ? (jsxRuntime.jsx(StyledIconButton$1, { size: "small", onClick: onClose, closeIconColor: closeIconColor, children: jsxRuntime.jsx(X, { size: 24 }) })) : undefined, children: messagePosition === 'center' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [icon, jsxRuntime.jsx("span", { children: message }), linkText && (jsxRuntime.jsx(LinkText, { bannerType: type, onClick: onLinkClick, children: linkText }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { children: message }), linkText && (jsxRuntime.jsx(LinkText, { bannerType: type, onClick: onLinkClick, children: linkText }))] })) }));
1059
+ return (jsxRuntime.jsx(StyledAlert$2, { ...props, intent: intent, bannerType: type, messagePosition: messagePosition, icon: messagePosition === 'left' ? icon || false : false, action: showClose ? (jsxRuntime.jsx(StyledIconButton$1, { size: "small", onClick: handleClose, closeIconColor: closeIconColor, children: jsxRuntime.jsx(X, { size: 24 }) })) : undefined, children: messagePosition === 'center' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [icon, jsxRuntime.jsx("span", { children: message }), linkText && (jsxRuntime.jsx(LinkText, { bannerType: type, onClick: onLinkClick, children: linkText }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { children: message }), linkText && (jsxRuntime.jsx(LinkText, { bannerType: type, onClick: onLinkClick, children: linkText }))] })) }));
1052
1060
  };
1053
1061
  NeoBanner.displayName = 'NeoBanner';
1054
1062
 
@@ -2841,9 +2849,9 @@ const StyledChip$1 = styles.styled(Chip)(({ theme, size, variant, color }) => ({
2841
2849
  * - state (Neutral|Error|Warning|Success|Info|Violet|Beta) → color (default|error|warning|success|info|violet|beta)
2842
2850
  * - Label text → label prop
2843
2851
  */
2844
- const NeoTag = ({ size = 'small', variant = 'outlined', ...props }) => {
2852
+ function NeoTag({ size = 'small', variant = 'outlined', ...props }) {
2845
2853
  return jsxRuntime.jsx(StyledChip$1, { size: size, variant: variant, ...props });
2846
- };
2854
+ }
2847
2855
  NeoTag.displayName = 'NeoTag';
2848
2856
 
2849
2857
  /**
@@ -4488,7 +4496,7 @@ const InfoIconWrapper = styles.styled('span')({
4488
4496
  });
4489
4497
  const StyledInputBase = styles.styled(InputBase, {
4490
4498
  shouldForwardProp: prop => prop !== 'size' && prop !== 'destructive',
4491
- })(({ theme, size = 'medium', destructive, startAdornment }) => {
4499
+ })(({ theme, size = 'medium', destructive, startAdornment, multiline }) => {
4492
4500
  const sizeConfig = {
4493
4501
  small: {
4494
4502
  height: neoDesign.spacing.spacing_5,
@@ -4505,7 +4513,7 @@ const StyledInputBase = styles.styled(InputBase, {
4505
4513
  };
4506
4514
  const sizeStyles = sizeConfig[size];
4507
4515
  return {
4508
- height: sizeStyles.height,
4516
+ height: multiline ? 'auto' : sizeStyles.height,
4509
4517
  fontSize: sizeStyles.fontSize,
4510
4518
  borderRadius: sizeStyles.borderRadius,
4511
4519
  backgroundColor: neoDesign.semanticColors.input.background,