@redsift/design-system 10.3.1 → 10.4.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 +6 -2
- package/index.js +70 -15
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -2585,6 +2585,8 @@ declare const Button: Comp<ButtonProps, HTMLButtonElement>;
|
|
|
2585
2585
|
interface LinkProps extends ComponentProps<'a'>, StylingProps {
|
|
2586
2586
|
/** Prop to pass a custom react component instead of a simple HTML anchor (useful for Nextjs or React Router Link component). */
|
|
2587
2587
|
as?: 'a' | ElementType;
|
|
2588
|
+
/** Color variant. Either from color palette or hex or rgb strings. */
|
|
2589
|
+
color?: NotificationsColorPalette | NeutralColorPalette | 'radar' | (string & {});
|
|
2588
2590
|
/** Whether the component is disabled or not. */
|
|
2589
2591
|
isDisabled?: boolean;
|
|
2590
2592
|
/** Theme. */
|
|
@@ -2592,6 +2594,7 @@ interface LinkProps extends ComponentProps<'a'>, StylingProps {
|
|
|
2592
2594
|
}
|
|
2593
2595
|
type StyledLinkProps = Omit<LinkProps, 'isDisabled'> & {
|
|
2594
2596
|
$isDisabled: LinkProps['isDisabled'];
|
|
2597
|
+
$color: LinkProps['color'];
|
|
2595
2598
|
$theme: LinkProps['theme'];
|
|
2596
2599
|
};
|
|
2597
2600
|
|
|
@@ -2600,6 +2603,7 @@ type StyledLinkProps = Omit<LinkProps, 'isDisabled'> & {
|
|
|
2600
2603
|
*/
|
|
2601
2604
|
declare const StyledLink: styled_components.StyledComponent<"a", any, Omit<LinkProps, "isDisabled"> & {
|
|
2602
2605
|
$isDisabled: boolean | undefined;
|
|
2606
|
+
$color: (string & {}) | "radar" | NotificationsColorPalette | NeutralColorPalette | undefined;
|
|
2603
2607
|
$theme: Theme | undefined;
|
|
2604
2608
|
}, never>;
|
|
2605
2609
|
|
|
@@ -2708,7 +2712,7 @@ interface HeadingProps extends ComponentProps<'span'>, StylingProps {
|
|
|
2708
2712
|
/** The actual component rendered in the DOM. */
|
|
2709
2713
|
as: HeadingComponent;
|
|
2710
2714
|
/** Color variant. Either from color palette or hex or rgb strings. */
|
|
2711
|
-
color?: NotificationsColorPalette | NeutralColorPalette | (string & {});
|
|
2715
|
+
color?: NotificationsColorPalette | NeutralColorPalette | 'radar' | (string & {});
|
|
2712
2716
|
/** Font family. */
|
|
2713
2717
|
fontFamily?: FontFamily;
|
|
2714
2718
|
/** Font size. */
|
|
@@ -3083,7 +3087,7 @@ interface TextProps extends ComponentProps<'span'>, StylingProps {
|
|
|
3083
3087
|
/** Override component. */
|
|
3084
3088
|
as?: TextComponent;
|
|
3085
3089
|
/** Color variant. Either from color palette or hex or rgb strings. */
|
|
3086
|
-
color?: NotificationsColorPalette | NeutralColorPalette | (string & {});
|
|
3090
|
+
color?: NotificationsColorPalette | NeutralColorPalette | 'radar' | (string & {});
|
|
3087
3091
|
/** Font family. */
|
|
3088
3092
|
fontFamily?: FontFamily;
|
|
3089
3093
|
/** Font size. */
|
package/index.js
CHANGED
|
@@ -5535,7 +5535,11 @@ const StyledText = styled.span`
|
|
|
5535
5535
|
let {
|
|
5536
5536
|
$color
|
|
5537
5537
|
} = _ref;
|
|
5538
|
-
return $color &&
|
|
5538
|
+
return $color && $color === 'radar' ? css`
|
|
5539
|
+
background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
|
|
5540
|
+
background-clip: text;
|
|
5541
|
+
color: transparent;
|
|
5542
|
+
` : Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
|
|
5539
5543
|
color: var(--redsift-color-notifications-${$color}-primary);
|
|
5540
5544
|
` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
|
|
5541
5545
|
color: var(--redsift-color-neutral-${$color});
|
|
@@ -6033,7 +6037,11 @@ const StyledHeading = styled.span`
|
|
|
6033
6037
|
$color,
|
|
6034
6038
|
$theme
|
|
6035
6039
|
} = _ref;
|
|
6036
|
-
return $color &&
|
|
6040
|
+
return $color && $color === 'radar' ? css`
|
|
6041
|
+
background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
|
|
6042
|
+
background-clip: text;
|
|
6043
|
+
color: transparent;
|
|
6044
|
+
` : Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
|
|
6037
6045
|
color: var(--redsift-color-notifications-${$color}-primary);
|
|
6038
6046
|
` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
|
|
6039
6047
|
color: var(--redsift-color-neutral-${$color});
|
|
@@ -17476,11 +17484,13 @@ Item.displayName = COMPONENT_NAME$b;
|
|
|
17476
17484
|
* Component style.
|
|
17477
17485
|
*/
|
|
17478
17486
|
const StyledLink = styled.a`
|
|
17487
|
+
width: fit-content;
|
|
17488
|
+
height: var(--redsift-typography-link-line-height);
|
|
17479
17489
|
${baseStyling}
|
|
17480
17490
|
|
|
17481
17491
|
background: none;
|
|
17482
17492
|
border: none;
|
|
17483
|
-
color:
|
|
17493
|
+
color: unset;
|
|
17484
17494
|
cursor: text !important;
|
|
17485
17495
|
font-family: var(--redsift-typography-link-font-family);
|
|
17486
17496
|
font-size: var(--redsift-typography-link-font-size);
|
|
@@ -17491,19 +17501,62 @@ const StyledLink = styled.a`
|
|
|
17491
17501
|
|
|
17492
17502
|
${_ref => {
|
|
17493
17503
|
let {
|
|
17494
|
-
$isDisabled
|
|
17504
|
+
$isDisabled,
|
|
17505
|
+
$color,
|
|
17506
|
+
$theme
|
|
17495
17507
|
} = _ref;
|
|
17496
17508
|
return !$isDisabled ? css`
|
|
17497
|
-
color
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17509
|
+
${$color && $color === 'radar' ? css`
|
|
17510
|
+
background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
|
|
17511
|
+
background-clip: text;
|
|
17512
|
+
color: transparent;
|
|
17513
|
+
` : Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
|
|
17514
|
+
color: var(--redsift-color-notifications-${$color}-primary);
|
|
17515
|
+
` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
|
|
17516
|
+
color: var(--redsift-color-neutral-${$color});
|
|
17517
|
+
` : Object.keys(ProductColorPalette).indexOf($color) !== -1 ? css`
|
|
17518
|
+
color: var(--redsift-color-product-${$color});
|
|
17519
|
+
` : css`
|
|
17520
|
+
color: ${$color || css`var(--redsift-color-${$theme}-components-text-primary)`};
|
|
17521
|
+
`}}
|
|
17522
|
+
|
|
17523
|
+
${$color && $color === 'radar' ? css`
|
|
17524
|
+
position: relative;
|
|
17525
|
+
|
|
17526
|
+
&:hover,
|
|
17527
|
+
&:focus-visible {
|
|
17528
|
+
cursor: pointer !important;
|
|
17529
|
+
}
|
|
17530
|
+
|
|
17531
|
+
&:hover::before,
|
|
17532
|
+
&:focus-visible::before {
|
|
17533
|
+
content: '';
|
|
17534
|
+
position: absolute;
|
|
17535
|
+
bottom: 3px;
|
|
17536
|
+
width: 100%;
|
|
17537
|
+
left: 0;
|
|
17538
|
+
height: 1px;
|
|
17539
|
+
background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
|
|
17540
|
+
}
|
|
17541
|
+
` : css`
|
|
17542
|
+
text-decoration: underline;
|
|
17543
|
+
text-decoration-color: transparent;
|
|
17544
|
+
text-underline-offset: 2px;
|
|
17545
|
+
|
|
17546
|
+
&:hover,
|
|
17547
|
+
&:focus-visible {
|
|
17548
|
+
cursor: pointer !important;
|
|
17549
|
+
${Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
|
|
17550
|
+
text-decoration-color: var(--redsift-color-notifications-${$color}-primary);
|
|
17551
|
+
` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
|
|
17552
|
+
text-decoration-color: var(--redsift-color-neutral-${$color});
|
|
17553
|
+
` : Object.keys(ProductColorPalette).indexOf($color) !== -1 ? css`
|
|
17554
|
+
text-decoration-color: var(--redsift-color-product-${$color});
|
|
17555
|
+
` : css`
|
|
17556
|
+
text-decoration-color: ${$color || css`var(--redsift-color-${$theme}-components-text-primary)`};
|
|
17557
|
+
`}
|
|
17558
|
+
}
|
|
17559
|
+
`}
|
|
17507
17560
|
` : '';
|
|
17508
17561
|
}}
|
|
17509
17562
|
|
|
@@ -17512,7 +17565,7 @@ const StyledLink = styled.a`
|
|
|
17512
17565
|
}
|
|
17513
17566
|
`;
|
|
17514
17567
|
|
|
17515
|
-
const _excluded$e = ["as", "children", "className", "href", "isDisabled", "theme"];
|
|
17568
|
+
const _excluded$e = ["as", "children", "className", "color", "href", "isDisabled", "theme"];
|
|
17516
17569
|
const COMPONENT_NAME$a = 'Link';
|
|
17517
17570
|
const CLASSNAME$a = 'redsift-link';
|
|
17518
17571
|
|
|
@@ -17529,6 +17582,7 @@ const Link = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
17529
17582
|
as,
|
|
17530
17583
|
children,
|
|
17531
17584
|
className,
|
|
17585
|
+
color = 'primary',
|
|
17532
17586
|
href,
|
|
17533
17587
|
isDisabled,
|
|
17534
17588
|
theme: propsTheme
|
|
@@ -17541,6 +17595,7 @@ const Link = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
17541
17595
|
role: "link",
|
|
17542
17596
|
tabIndex: !isDisabled ? 0 : undefined
|
|
17543
17597
|
}, forwardedProps, {
|
|
17598
|
+
$color: color,
|
|
17544
17599
|
$isDisabled: isDisabled,
|
|
17545
17600
|
$theme: theme,
|
|
17546
17601
|
className: classNames(Link.className, className),
|