@redsift/design-system 10.4.0 → 10.5.0-alpha.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/index.d.ts CHANGED
@@ -473,7 +473,7 @@ declare function partitionComponents<T>(components: T[], predicates: Array<(t: T
473
473
 
474
474
  /**
475
475
  * Do not edit directly
476
- * Generated on Tue, 16 Jul 2024 19:17:14 GMT
476
+ * Generated on Fri, 20 Sep 2024 07:42:41 GMT
477
477
  */
478
478
  declare const RedsiftColorDarkComponentsPageBackground = "#333333";
479
479
  declare const RedsiftColorDarkComponentsTextPrimary = "#ffffff";
@@ -1793,7 +1793,7 @@ declare const RedsiftTypographyH2LineHeight = "30px";
1793
1793
  declare const RedsiftTypographyH2TextTransform = "unset";
1794
1794
  declare const RedsiftTypographyH3FontFamily = "'Poppins', sans-serif";
1795
1795
  declare const RedsiftTypographyH3FontSize = "20px";
1796
- declare const RedsiftTypographyH3FontWeight = "600";
1796
+ declare const RedsiftTypographyH3FontWeight = "500";
1797
1797
  declare const RedsiftTypographyH3LineHeight = "30px";
1798
1798
  declare const RedsiftTypographyH3TextTransform = "unset";
1799
1799
  declare const RedsiftTypographyH4FontFamily = "'Poppins', sans-serif";
@@ -2589,6 +2589,20 @@ interface LinkProps extends ComponentProps<'a'>, StylingProps {
2589
2589
  color?: NotificationsColorPalette | NeutralColorPalette | 'radar' | (string & {});
2590
2590
  /** Whether the component is disabled or not. */
2591
2591
  isDisabled?: boolean;
2592
+ /**
2593
+ * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
2594
+ * Can also be a ReactElement.
2595
+ */
2596
+ leftIcon?: IconProps['icon'];
2597
+ /** Props to add to the left icon. */
2598
+ leftIconProps?: Omit<IconProps, 'icon' | 'ref'>;
2599
+ /**
2600
+ * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
2601
+ * Can also be a ReactElement.
2602
+ */
2603
+ rightIcon?: IconProps['icon'];
2604
+ /** Props to add to the right icon. */
2605
+ rightIconProps?: Omit<IconProps, 'icon' | 'ref'>;
2592
2606
  /** Theme. */
2593
2607
  theme?: Theme;
2594
2608
  }
@@ -2596,6 +2610,7 @@ type StyledLinkProps = Omit<LinkProps, 'isDisabled'> & {
2596
2610
  $isDisabled: LinkProps['isDisabled'];
2597
2611
  $color: LinkProps['color'];
2598
2612
  $theme: LinkProps['theme'];
2613
+ $hasIcons: boolean;
2599
2614
  };
2600
2615
 
2601
2616
  /**
@@ -2605,6 +2620,7 @@ declare const StyledLink: styled_components.StyledComponent<"a", any, Omit<LinkP
2605
2620
  $isDisabled: boolean | undefined;
2606
2621
  $color: (string & {}) | "radar" | NotificationsColorPalette | NeutralColorPalette | undefined;
2607
2622
  $theme: Theme | undefined;
2623
+ $hasIcons: boolean;
2608
2624
  }, never>;
2609
2625
 
2610
2626
  /**
@@ -2620,7 +2636,7 @@ declare const Link: Comp<LinkProps, HTMLAnchorElement>;
2620
2636
  /**
2621
2637
  * Component props.
2622
2638
  */
2623
- interface ButtonLinkProps extends Omit<LinkProps, 'color'>, Pick<ButtonProps, 'color' | 'isActive' | 'isDisabled' | 'isHovered' | 'leftIcon' | 'rightIcon' | 'variant' | 'theme'> {
2639
+ interface ButtonLinkProps extends Omit<LinkProps, 'color'>, Pick<ButtonProps, 'color' | 'isActive' | 'isDisabled' | 'isHovered' | 'leftIcon' | 'leftIconProps' | 'rightIconProps' | 'rightIcon' | 'variant' | 'theme'> {
2624
2640
  }
2625
2641
  type StyledButtonLinkProps = ButtonLinkProps & {
2626
2642
  $isActive: ButtonLinkProps['isActive'];
@@ -3739,7 +3755,7 @@ declare const Item: Comp<ItemProps, HTMLElement>;
3739
3755
  /**
3740
3756
  * Component props.
3741
3757
  */
3742
- interface LinkButtonProps extends Omit<ButtonProps, 'color' | 'fullWidth' | 'leftIcon' | 'rightIcon' | 'size' | 'variant'> {
3758
+ interface LinkButtonProps extends Pick<LinkProps, 'color' | 'leftIcon' | 'leftIconProps' | 'rightIconProps' | 'rightIcon'>, Omit<ButtonProps, 'color' | 'fullWidth' | 'leftIcon' | 'leftIconProps' | 'rightIconProps' | 'rightIcon' | 'size' | 'variant'> {
3743
3759
  }
3744
3760
  type StyledLinkButtonProps = Omit<LinkButtonProps, 'isDisabled'> & {
3745
3761
  $isDisabled: LinkButtonProps['isDisabled'];
package/index.js CHANGED
@@ -483,7 +483,7 @@ function partitionComponents(components, predicates) {
483
483
 
484
484
  /**
485
485
  * Do not edit directly
486
- * Generated on Tue, 16 Jul 2024 19:17:14 GMT
486
+ * Generated on Fri, 20 Sep 2024 07:42:41 GMT
487
487
  */
488
488
 
489
489
  const RedsiftColorDarkComponentsPageBackground = '#333333';
@@ -1804,7 +1804,7 @@ const RedsiftTypographyH2LineHeight = '30px';
1804
1804
  const RedsiftTypographyH2TextTransform = 'unset';
1805
1805
  const RedsiftTypographyH3FontFamily = "'Poppins', sans-serif";
1806
1806
  const RedsiftTypographyH3FontSize = '20px';
1807
- const RedsiftTypographyH3FontWeight = '600';
1807
+ const RedsiftTypographyH3FontWeight = '500';
1808
1808
  const RedsiftTypographyH3LineHeight = '30px';
1809
1809
  const RedsiftTypographyH3TextTransform = 'unset';
1810
1810
  const RedsiftTypographyH4FontFamily = "'Poppins', sans-serif";
@@ -5338,7 +5338,7 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
5338
5338
  className: classNames(Button.className, className),
5339
5339
  disabled: isDisabled,
5340
5340
  ref: buttonRef
5341
- }), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
5341
+ }), leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
5342
5342
  icon: leftIcon,
5343
5343
  "aria-hidden": "true",
5344
5344
  className: "left"
@@ -5349,7 +5349,7 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
5349
5349
  icon: rightIcon,
5350
5350
  "aria-hidden": "true",
5351
5351
  className: "right"
5352
- }, rightIconProps)) : null)));
5352
+ }, rightIconProps)) : null));
5353
5353
  });
5354
5354
  Button.className = CLASSNAME$Q;
5355
5355
  Button.displayName = COMPONENT_NAME$Q;
@@ -8353,7 +8353,7 @@ const ButtonGroup = /*#__PURE__*/forwardRef((props, ref) => {
8353
8353
  ButtonGroup.className = CLASSNAME$A;
8354
8354
  ButtonGroup.displayName = COMPONENT_NAME$A;
8355
8355
 
8356
- const _excluded$C = ["as", "children", "className", "color", "href", "isActive", "isDisabled", "isHovered", "leftIcon", "rightIcon", "target", "theme", "variant"];
8356
+ const _excluded$C = ["as", "children", "className", "color", "href", "isActive", "isDisabled", "isHovered", "leftIcon", "leftIconProps", "rightIcon", "rightIconProps", "target", "theme", "variant"];
8357
8357
  const COMPONENT_NAME$z = 'ButtonLink';
8358
8358
  const CLASSNAME$z = 'redsift-button-link';
8359
8359
 
@@ -8375,7 +8375,9 @@ const ButtonLink = /*#__PURE__*/forwardRef((props, ref) => {
8375
8375
  isDisabled,
8376
8376
  isHovered,
8377
8377
  leftIcon,
8378
+ leftIconProps,
8378
8379
  rightIcon,
8380
+ rightIconProps,
8379
8381
  target,
8380
8382
  theme: propsTheme,
8381
8383
  variant: propsVariant
@@ -8410,15 +8412,15 @@ const ButtonLink = /*#__PURE__*/forwardRef((props, ref) => {
8410
8412
  href: !isDisabled ? href : undefined,
8411
8413
  ref: ref,
8412
8414
  target: target
8413
- }), leftIcon ? /*#__PURE__*/React__default.createElement(Icon, {
8415
+ }), leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
8414
8416
  icon: leftIcon,
8415
8417
  "aria-hidden": "true",
8416
8418
  className: "left"
8417
- }) : null, /*#__PURE__*/React__default.createElement("span", null, children), rightIcon ? /*#__PURE__*/React__default.createElement(Icon, {
8419
+ }, leftIconProps)) : null, /*#__PURE__*/React__default.createElement("span", null, children), rightIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
8418
8420
  icon: rightIcon,
8419
8421
  "aria-hidden": "true",
8420
8422
  className: "right"
8421
- }) : null));
8423
+ }, rightIconProps)) : null));
8422
8424
  });
8423
8425
  ButtonLink.className = CLASSNAME$z;
8424
8426
  ButtonLink.displayName = COMPONENT_NAME$z;
@@ -17484,43 +17486,73 @@ Item.displayName = COMPONENT_NAME$b;
17484
17486
  * Component style.
17485
17487
  */
17486
17488
  const StyledLink = styled.a`
17487
- width: fit-content;
17488
- height: var(--redsift-typography-link-line-height);
17489
- ${baseStyling}
17490
-
17491
17489
  background: none;
17492
17490
  border: none;
17493
17491
  color: unset;
17494
17492
  cursor: text !important;
17493
+ display: inline-flex;
17494
+ gap: 4px;
17495
+ align-items: center;
17495
17496
  font-family: var(--redsift-typography-link-font-family);
17496
17497
  font-size: var(--redsift-typography-link-font-size);
17497
17498
  font-weight: var(--redsift-typography-link-font-weight);
17499
+ height: var(--redsift-typography-link-line-height);
17498
17500
  line-height: var(--redsift-typography-link-line-height);
17499
17501
  padding: unset;
17502
+ position: relative;
17500
17503
  text-decoration: none;
17504
+ width: fit-content;
17501
17505
 
17502
17506
  ${_ref => {
17507
+ let {
17508
+ $hasIcons
17509
+ } = _ref;
17510
+ return $hasIcons ? css`
17511
+ bottom: -2px;
17512
+ ` : '';
17513
+ }}
17514
+
17515
+ ${baseStyling}
17516
+
17517
+ ${_ref2 => {
17503
17518
  let {
17504
17519
  $isDisabled,
17505
17520
  $color,
17506
- $theme
17507
- } = _ref;
17521
+ $theme,
17522
+ $hasIcons
17523
+ } = _ref2;
17508
17524
  return !$isDisabled ? css`
17509
17525
  ${$color && $color === 'radar' ? css`
17510
17526
  background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
17511
17527
  background-clip: text;
17512
17528
  color: transparent;
17529
+
17530
+ path {
17531
+ fill: url(#${$color}-gradient-default);
17532
+ }
17513
17533
  ` : Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
17514
- color: var(--redsift-color-notifications-${$color}-primary);
17534
+ &,
17535
+ .redsift-icon:not(.colored) {
17536
+ color: var(--redsift-color-notifications-${$color}-primary);
17537
+ }
17515
17538
  ` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
17516
- color: var(--redsift-color-neutral-${$color});
17539
+ &,
17540
+ .redsift-icon:not(.colored) {
17541
+ color: var(--redsift-color-neutral-${$color});
17542
+ }
17517
17543
  ` : Object.keys(ProductColorPalette).indexOf($color) !== -1 ? css`
17518
- color: var(--redsift-color-product-${$color});
17544
+ &,
17545
+ .redsift-icon:not(.colored) {
17546
+ color: var(--redsift-color-product-${$color});
17547
+ }
17519
17548
  ` : css`
17520
- color: ${$color || css`var(--redsift-color-${$theme}-components-text-primary)`};
17549
+ &,
17550
+ .redsift-icon:not(.colored) {
17551
+ color: ${$color || css`var(--redsift-color-${$theme}-components-text-primary)`};
17552
+ }
17521
17553
  `}}
17522
17554
 
17523
- ${$color && $color === 'radar' ? css`
17555
+ ${$color && $color === 'radar' && !$hasIcons ? css`
17524
17556
  position: relative;
17525
17557
 
17526
17558
  &:hover,
@@ -17538,6 +17570,30 @@ const StyledLink = styled.a`
17538
17570
  height: 1px;
17539
17571
  background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
17540
17572
  }
17573
+ ` : $color && $color === 'radar' && $hasIcons ? css`
17574
+ position: relative;
17575
+
17576
+ &:hover,
17577
+ &:focus-visible {
17578
+ cursor: pointer !important;
17579
+ }
17580
+
17581
+ .text::before {
17582
+ content: '';
17583
+ position: absolute;
17584
+ bottom: 3px;
17585
+ width: 100%;
17586
+ left: 0;
17587
+ height: 1px;
17588
+ background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
17589
+ transform: scaleX(0);
17590
+ }
17591
+
17592
+ &:hover .text::before,
17593
+ .icon:hover + .text::before,
17594
+ .text:hover::before {
17595
+ transform: scaleX(1);
17596
+ }
17541
17597
  ` : css`
17542
17598
  text-decoration: underline;
17543
17599
  text-decoration-color: transparent;
@@ -17565,7 +17621,7 @@ const StyledLink = styled.a`
17565
17621
  }
17566
17622
  `;
17567
17623
 
17568
- const _excluded$e = ["as", "children", "className", "color", "href", "isDisabled", "theme"];
17624
+ const _excluded$e = ["as", "children", "className", "color", "href", "isDisabled", "leftIcon", "leftIconProps", "rightIcon", "rightIconProps", "theme"];
17569
17625
  const COMPONENT_NAME$a = 'Link';
17570
17626
  const CLASSNAME$a = 'redsift-link';
17571
17627
 
@@ -17585,6 +17641,10 @@ const Link = /*#__PURE__*/forwardRef((props, ref) => {
17585
17641
  color = 'primary',
17586
17642
  href,
17587
17643
  isDisabled,
17644
+ leftIcon,
17645
+ leftIconProps,
17646
+ rightIcon,
17647
+ rightIconProps,
17588
17648
  theme: propsTheme
17589
17649
  } = props,
17590
17650
  forwardedProps = _objectWithoutProperties(props, _excluded$e);
@@ -17598,15 +17658,28 @@ const Link = /*#__PURE__*/forwardRef((props, ref) => {
17598
17658
  $color: color,
17599
17659
  $isDisabled: isDisabled,
17600
17660
  $theme: theme,
17661
+ $hasIcons: leftIcon || rightIcon,
17601
17662
  className: classNames(Link.className, className),
17602
17663
  href: !isDisabled ? href : undefined,
17603
17664
  ref: ref
17604
- }), children);
17665
+ }), leftIcon || rightIcon ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
17666
+ icon: leftIcon,
17667
+ "aria-hidden": "true",
17668
+ className: "left",
17669
+ size: "xsmall"
17670
+ }, leftIconProps)) : null, /*#__PURE__*/React__default.createElement("span", {
17671
+ className: "text"
17672
+ }, children), rightIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
17673
+ icon: rightIcon,
17674
+ "aria-hidden": "true",
17675
+ className: "right",
17676
+ size: "xsmall"
17677
+ }, rightIconProps)) : null) : children);
17605
17678
  });
17606
17679
  Link.className = CLASSNAME$a;
17607
17680
  Link.displayName = COMPONENT_NAME$a;
17608
17681
 
17609
- const _excluded$d = ["children", "className", "disabled", "isDisabled", "theme"];
17682
+ const _excluded$d = ["children", "className", "color", "disabled", "isDisabled", "leftIcon", "leftIconProps", "rightIcon", "rightIconProps", "theme"];
17610
17683
  const COMPONENT_NAME$9 = 'LinkButton';
17611
17684
  const CLASSNAME$9 = 'redsift-link-button';
17612
17685
 
@@ -17622,8 +17695,13 @@ const LinkButton = /*#__PURE__*/forwardRef((props, ref) => {
17622
17695
  const {
17623
17696
  children,
17624
17697
  className,
17698
+ color = 'primary',
17625
17699
  disabled,
17626
17700
  isDisabled: propsIsDisabled,
17701
+ leftIcon,
17702
+ leftIconProps,
17703
+ rightIcon,
17704
+ rightIconProps,
17627
17705
  theme: propsTheme
17628
17706
  } = props,
17629
17707
  forwardedProps = _objectWithoutProperties(props, _excluded$d);
@@ -17632,6 +17710,7 @@ const LinkButton = /*#__PURE__*/forwardRef((props, ref) => {
17632
17710
  return /*#__PURE__*/React__default.createElement(StyledLink, _extends$1({
17633
17711
  as: "button"
17634
17712
  }, forwardedProps, {
17713
+ $color: color,
17635
17714
  $isDisabled: isDisabled || disabled,
17636
17715
  $theme: theme,
17637
17716
  "aria-disabled": isDisabled || disabled,
@@ -17640,7 +17719,19 @@ const LinkButton = /*#__PURE__*/forwardRef((props, ref) => {
17640
17719
  // @ts-ignore
17641
17720
  ,
17642
17721
  ref: buttonRef
17643
- }), children);
17722
+ }), leftIcon || rightIcon ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
17723
+ icon: leftIcon,
17724
+ "aria-hidden": "true",
17725
+ className: "left",
17726
+ size: "xsmall"
17727
+ }, leftIconProps)) : null, /*#__PURE__*/React__default.createElement("span", {
17728
+ className: "text"
17729
+ }, children), rightIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends$1({
17730
+ icon: rightIcon,
17731
+ "aria-hidden": "true",
17732
+ className: "right",
17733
+ size: "xsmall"
17734
+ }, rightIconProps)) : null) : children);
17644
17735
  });
17645
17736
  LinkButton.className = CLASSNAME$9;
17646
17737
  LinkButton.displayName = COMPONENT_NAME$9;