@redis-ui/components 51.18.1 → 51.20.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.
@@ -1,9 +1,10 @@
1
1
  const require_Card_style = require("./Card.style.cjs");
2
2
  let react_jsx_runtime = require("react/jsx-runtime");
3
3
  //#region src/Card/Card.tsx
4
- var Card = ({ variant = "primary", border = true, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Card_style.Card, {
4
+ var Card = ({ variant = "primary", border = true, hoverEffect = "none", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Card_style.Card, {
5
5
  $variant: variant,
6
6
  $border: border,
7
+ $hoverEffect: hoverEffect,
7
8
  ...props
8
9
  });
9
10
  //#endregion
@@ -1,3 +1,3 @@
1
1
  import { CardProps } from './Card.types';
2
- declare const Card: ({ variant, border, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Card: ({ variant, border, hoverEffect, ...props }: CardProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Card;
package/dist/Card/Card.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { Card as Card$1 } from "./Card.style.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  //#region src/Card/Card.tsx
4
- var Card = ({ variant = "primary", border = true, ...props }) => /* @__PURE__ */ jsx(Card$1, {
4
+ var Card = ({ variant = "primary", border = true, hoverEffect = "none", ...props }) => /* @__PURE__ */ jsx(Card$1, {
5
5
  $variant: variant,
6
6
  $border: border,
7
+ $hoverEffect: hoverEffect,
7
8
  ...props
8
9
  });
9
10
  //#endregion
@@ -5,6 +5,57 @@ styled_components = require_runtime.__toESM(styled_components, 1);
5
5
  let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
6
6
  //#region src/Card/Card.style.ts
7
7
  var useCardTheme = () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.card;
8
+ var transition = (...props) => styled_components.css`
9
+ transition: ${props.map((prop) => `${prop} 200ms ease-in-out`).join(", ")};
10
+
11
+ @media (prefers-reduced-motion: reduce) {
12
+ transition: none;
13
+ }
14
+ `;
15
+ var hoverEffects = {
16
+ none: void 0,
17
+ sunset: styled_components.css`
18
+ position: relative;
19
+ isolation: isolate;
20
+
21
+ &::before {
22
+ content: '';
23
+ position: absolute;
24
+ inset: 0;
25
+ z-index: -1;
26
+ border-radius: inherit;
27
+ pointer-events: none;
28
+ background: radial-gradient(
29
+ 70% 90% at 78% 8%,
30
+ ${() => useCardTheme().hover?.sunsetColor},
31
+ transparent 70%
32
+ );
33
+ opacity: 0;
34
+ ${transition("opacity")};
35
+ }
36
+
37
+ &:hover::before {
38
+ opacity: 1;
39
+ }
40
+ `,
41
+ lift: styled_components.css`
42
+ cursor: pointer;
43
+ ${transition("border-color", "transform")};
44
+
45
+ &:hover {
46
+ border-color: ${() => useCardTheme().hover?.borderColor};
47
+ transform: translateY(-0.2rem);
48
+ }
49
+ `,
50
+ highlight: styled_components.css`
51
+ ${transition("background", "border-color")};
52
+
53
+ &:hover {
54
+ background: ${() => useCardTheme().hover?.bgColor};
55
+ border-color: ${() => useCardTheme().hover?.borderColor};
56
+ }
57
+ `
58
+ };
8
59
  var Card = styled_components.default.div.withConfig({
9
60
  displayName: "Cardstyle__Card",
10
61
  componentId: "RedisUI__sc-1r2rqs7-0"
@@ -15,7 +66,8 @@ var Card = styled_components.default.div.withConfig({
15
66
  ";background:",
16
67
  ";border:",
17
68
  ";border-radius:",
18
- ";box-shadow:none;"
19
- ], ({ width }) => require_css_utils.calcSize(width, useCardTheme().width), ({ height }) => require_css_utils.calcSize(height, useCardTheme().height), () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space200, ({ $variant }) => useCardTheme().variants[$variant].bgColor, ({ $border, $variant }) => $border ? `${(0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space010} solid ${useCardTheme().variants[$variant].borderColor}` : 0, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space100);
69
+ ";box-shadow:none;",
70
+ ";"
71
+ ], ({ width }) => require_css_utils.calcSize(width, useCardTheme().width), ({ height }) => require_css_utils.calcSize(height, useCardTheme().height), () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space200, ({ $variant }) => useCardTheme().variants[$variant].bgColor, ({ $border, $variant }) => $border ? `${(0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space010} solid ${useCardTheme().variants[$variant].borderColor}` : 0, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space100, ({ $hoverEffect }) => hoverEffects[$hoverEffect]);
20
72
  //#endregion
21
73
  exports.Card = Card;
@@ -1,7 +1,8 @@
1
- import type { CardVariant } from '@redis-ui/styles';
1
+ import type { CardHoverEffect, CardVariant } from '@redis-ui/styles';
2
2
  export declare const Card: import("styled-components").StyledComponent<"div", any, {
3
3
  width?: string | number;
4
4
  height?: string | number;
5
5
  $variant: CardVariant;
6
6
  $border: boolean;
7
+ $hoverEffect: CardHoverEffect;
7
8
  }, never>;
@@ -1,8 +1,59 @@
1
1
  import { calcSize } from "../Helpers/css.utils.js";
2
- import _styled from "styled-components";
2
+ import _styled, { css } from "styled-components";
3
3
  import { useTheme } from "@redis-ui/styles";
4
4
  //#region src/Card/Card.style.ts
5
5
  var useCardTheme = () => useTheme().components.card;
6
+ var transition = (...props) => css`
7
+ transition: ${props.map((prop) => `${prop} 200ms ease-in-out`).join(", ")};
8
+
9
+ @media (prefers-reduced-motion: reduce) {
10
+ transition: none;
11
+ }
12
+ `;
13
+ var hoverEffects = {
14
+ none: void 0,
15
+ sunset: css`
16
+ position: relative;
17
+ isolation: isolate;
18
+
19
+ &::before {
20
+ content: '';
21
+ position: absolute;
22
+ inset: 0;
23
+ z-index: -1;
24
+ border-radius: inherit;
25
+ pointer-events: none;
26
+ background: radial-gradient(
27
+ 70% 90% at 78% 8%,
28
+ ${() => useCardTheme().hover?.sunsetColor},
29
+ transparent 70%
30
+ );
31
+ opacity: 0;
32
+ ${transition("opacity")};
33
+ }
34
+
35
+ &:hover::before {
36
+ opacity: 1;
37
+ }
38
+ `,
39
+ lift: css`
40
+ cursor: pointer;
41
+ ${transition("border-color", "transform")};
42
+
43
+ &:hover {
44
+ border-color: ${() => useCardTheme().hover?.borderColor};
45
+ transform: translateY(-0.2rem);
46
+ }
47
+ `,
48
+ highlight: css`
49
+ ${transition("background", "border-color")};
50
+
51
+ &:hover {
52
+ background: ${() => useCardTheme().hover?.bgColor};
53
+ border-color: ${() => useCardTheme().hover?.borderColor};
54
+ }
55
+ `
56
+ };
6
57
  var Card = _styled.div.withConfig({
7
58
  displayName: "Cardstyle__Card",
8
59
  componentId: "RedisUI__sc-1r2rqs7-0"
@@ -13,7 +64,8 @@ var Card = _styled.div.withConfig({
13
64
  ";background:",
14
65
  ";border:",
15
66
  ";border-radius:",
16
- ";box-shadow:none;"
17
- ], ({ width }) => calcSize(width, useCardTheme().width), ({ height }) => calcSize(height, useCardTheme().height), () => useTheme().core.space.space200, ({ $variant }) => useCardTheme().variants[$variant].bgColor, ({ $border, $variant }) => $border ? `${useTheme().core.space.space010} solid ${useCardTheme().variants[$variant].borderColor}` : 0, () => useTheme().core.space.space100);
67
+ ";box-shadow:none;",
68
+ ";"
69
+ ], ({ width }) => calcSize(width, useCardTheme().width), ({ height }) => calcSize(height, useCardTheme().height), () => useTheme().core.space.space200, ({ $variant }) => useCardTheme().variants[$variant].bgColor, ({ $border, $variant }) => $border ? `${useTheme().core.space.space010} solid ${useCardTheme().variants[$variant].borderColor}` : 0, () => useTheme().core.space.space100, ({ $hoverEffect }) => hoverEffects[$hoverEffect]);
18
70
  //#endregion
19
71
  export { Card };
@@ -1,9 +1,10 @@
1
- import type { CardVariant } from '@redis-ui/styles';
2
- export { cardVariants } from '@redis-ui/styles';
3
- export type { CardVariant };
1
+ import type { CardHoverEffect, CardVariant } from '@redis-ui/styles';
2
+ export { cardHoverEffects, cardVariants } from '@redis-ui/styles';
3
+ export type { CardHoverEffect, CardVariant };
4
4
  export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  width?: number | string;
6
6
  height?: number | string;
7
7
  variant?: CardVariant;
8
8
  border?: boolean;
9
+ hoverEffect?: CardHoverEffect;
9
10
  }
@@ -1,2 +1,2 @@
1
- import { cardVariants } from "@redis-ui/styles";
2
- export { cardVariants };
1
+ import { cardHoverEffects, cardVariants } from "@redis-ui/styles";
2
+ export { cardHoverEffects, cardVariants };
@@ -1,3 +1,3 @@
1
1
  export { default as Card } from './Card';
2
- export { cardVariants } from './Card.types';
3
- export type { CardProps, CardVariant } from './Card.types';
2
+ export { cardHoverEffects, cardVariants } from './Card.types';
3
+ export type { CardHoverEffect, CardProps, CardVariant } from './Card.types';
@@ -1,2 +1,2 @@
1
1
  export { default as Card } from './Card';
2
- export { cardVariants } from './Card.types';
2
+ export { cardHoverEffects, cardVariants } from './Card.types';
@@ -0,0 +1,52 @@
1
+ const require_index = require("../node_modules/@radix-ui/react-id/dist/index.cjs");
2
+ const require_Typography = require("../Typography/Typography.cjs");
3
+ const require_FlexDivider = require("../Layouts/FlexDivider/FlexDivider.cjs");
4
+ const require_LinkList_style = require("./LinkList.style.cjs");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ //#region src/LinkList/LinkList.tsx
7
+ var isExternal = (href) => /^(https?:)?\/\//i.test(href);
8
+ var getRowProps = ({ href, onClick }) => {
9
+ if (href) return {
10
+ href,
11
+ onClick,
12
+ ...isExternal(href) && {
13
+ target: "_blank",
14
+ rel: "noopener noreferrer"
15
+ }
16
+ };
17
+ if (onClick) return {
18
+ as: "button",
19
+ type: "button",
20
+ onClick
21
+ };
22
+ return { as: "div" };
23
+ };
24
+ var LinkList = ({ title, items, titleComponent = "h2", ...restProps }) => {
25
+ const titleId = require_index.useId();
26
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkList, {
27
+ ...restProps,
28
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.default.Heading, {
29
+ component: titleComponent,
30
+ size: "XS",
31
+ id: titleId,
32
+ children: title
33
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListItems, {
34
+ "aria-labelledby": titleId,
35
+ children: items.map((item, index) => {
36
+ const { label, icon: Icon, meta, separated } = item;
37
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkListItem, { children: [separated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FlexDivider.FlexDivider, {
38
+ orientation: "horizontal",
39
+ autoHide: false
40
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkListRow, {
41
+ ...getRowProps(item),
42
+ children: [Icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListIcon, {
43
+ "aria-hidden": true,
44
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { size: "M" })
45
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkListText, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListLabel, { children: label }), meta && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListMeta, { children: meta })] })]
46
+ })] }, `${index}-${label}`);
47
+ })
48
+ })]
49
+ });
50
+ };
51
+ //#endregion
52
+ exports.default = LinkList;
@@ -0,0 +1,3 @@
1
+ import { LinkListProps } from './LinkList.types';
2
+ declare const LinkList: ({ title, items, titleComponent, ...restProps }: LinkListProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default LinkList;
@@ -0,0 +1,52 @@
1
+ import { useId } from "../node_modules/@radix-ui/react-id/dist/index.js";
2
+ import Typography from "../Typography/Typography.js";
3
+ import { FlexDivider } from "../Layouts/FlexDivider/FlexDivider.js";
4
+ import { LinkList as LinkList$1, LinkListIcon, LinkListItem, LinkListItems, LinkListLabel, LinkListMeta, LinkListRow, LinkListText } from "./LinkList.style.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/LinkList/LinkList.tsx
7
+ var isExternal = (href) => /^(https?:)?\/\//i.test(href);
8
+ var getRowProps = ({ href, onClick }) => {
9
+ if (href) return {
10
+ href,
11
+ onClick,
12
+ ...isExternal(href) && {
13
+ target: "_blank",
14
+ rel: "noopener noreferrer"
15
+ }
16
+ };
17
+ if (onClick) return {
18
+ as: "button",
19
+ type: "button",
20
+ onClick
21
+ };
22
+ return { as: "div" };
23
+ };
24
+ var LinkList = ({ title, items, titleComponent = "h2", ...restProps }) => {
25
+ const titleId = useId();
26
+ return /* @__PURE__ */ jsxs(LinkList$1, {
27
+ ...restProps,
28
+ children: [/* @__PURE__ */ jsx(Typography.Heading, {
29
+ component: titleComponent,
30
+ size: "XS",
31
+ id: titleId,
32
+ children: title
33
+ }), /* @__PURE__ */ jsx(LinkListItems, {
34
+ "aria-labelledby": titleId,
35
+ children: items.map((item, index) => {
36
+ const { label, icon: Icon, meta, separated } = item;
37
+ return /* @__PURE__ */ jsxs(LinkListItem, { children: [separated && /* @__PURE__ */ jsx(FlexDivider, {
38
+ orientation: "horizontal",
39
+ autoHide: false
40
+ }), /* @__PURE__ */ jsxs(LinkListRow, {
41
+ ...getRowProps(item),
42
+ children: [Icon && /* @__PURE__ */ jsx(LinkListIcon, {
43
+ "aria-hidden": true,
44
+ children: /* @__PURE__ */ jsx(Icon, { size: "M" })
45
+ }), /* @__PURE__ */ jsxs(LinkListText, { children: [/* @__PURE__ */ jsx(LinkListLabel, { children: label }), meta && /* @__PURE__ */ jsx(LinkListMeta, { children: meta })] })]
46
+ })] }, `${index}-${label}`);
47
+ })
48
+ })]
49
+ });
50
+ };
51
+ //#endregion
52
+ export { LinkList as default };
@@ -0,0 +1,74 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ const require_Typography = require("../Typography/Typography.cjs");
3
+ let styled_components = require("styled-components");
4
+ styled_components = require_runtime.__toESM(styled_components, 1);
5
+ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
6
+ //#region src/LinkList/LinkList.style.ts
7
+ var LinkList = styled_components.default.div.withConfig({
8
+ displayName: "LinkListstyle__LinkList",
9
+ componentId: "RedisUI__sc-16e9e4l-0"
10
+ })([
11
+ "display:flex;flex-direction:column;gap:",
12
+ ";min-width:0;padding-left:",
13
+ ";border-left:",
14
+ " solid ",
15
+ ";"
16
+ ], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space150, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space300, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space010, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.card.variants.primary.borderColor);
17
+ var LinkListItems = styled_components.default.ul.withConfig({
18
+ displayName: "LinkListstyle__LinkListItems",
19
+ componentId: "RedisUI__sc-16e9e4l-1"
20
+ })(["display:flex;flex-direction:column;gap:", ";margin:0;padding:0;list-style:none;"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space150);
21
+ var LinkListItem = styled_components.default.li.withConfig({
22
+ displayName: "LinkListstyle__LinkListItem",
23
+ componentId: "RedisUI__sc-16e9e4l-2"
24
+ })(["display:flex;flex-direction:column;gap:", ";"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space150);
25
+ var LinkListIcon = styled_components.default.span.withConfig({
26
+ displayName: "LinkListstyle__LinkListIcon",
27
+ componentId: "RedisUI__sc-16e9e4l-3"
28
+ })(["display:flex;flex:none;margin-top:", ";"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space025);
29
+ var LinkListText = styled_components.default.span.withConfig({
30
+ displayName: "LinkListstyle__LinkListText",
31
+ componentId: "RedisUI__sc-16e9e4l-4"
32
+ })(["min-width:0;"]);
33
+ var LinkListLabel = styled_components.default.span.withConfig({
34
+ displayName: "LinkListstyle__LinkListLabel",
35
+ componentId: "RedisUI__sc-16e9e4l-5"
36
+ })(["display:block;font-size:", ";"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.font.fontSize.s13);
37
+ var LinkListMeta = (0, styled_components.default)(require_Typography.default.Code).attrs({ size: "M" }).withConfig({
38
+ displayName: "LinkListstyle__LinkListMeta",
39
+ componentId: "RedisUI__sc-16e9e4l-6"
40
+ })(["display:block;margin-top:", ";"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space025);
41
+ var LinkListRow = styled_components.default.a.withConfig({
42
+ displayName: "LinkListstyle__LinkListRow",
43
+ componentId: "RedisUI__sc-16e9e4l-7"
44
+ })([
45
+ "display:flex;align-items:flex-start;gap:",
46
+ ";width:100%;padding:0;border:0;border-radius:",
47
+ ";background:none;font:inherit;text-align:start;text-decoration:none;",
48
+ ",",
49
+ "{color:",
50
+ ";}",
51
+ "{color:",
52
+ ";}&:is(a,button){cursor:pointer;transition:transform ",
53
+ ";",
54
+ "{color:",
55
+ ";}}&:is(a,button):hover{transform:translateX(",
56
+ ");",
57
+ "{text-decoration:underline;text-underline-offset:",
58
+ ";}}&:is(a,button):active{transform:translate( ",
59
+ ",",
60
+ " );}@media (prefers-reduced-motion:reduce){&:is(a,button):hover,&:is(a,button):active{transform:none;}}",
61
+ ";"
62
+ ], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space100, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space050, LinkListIcon, LinkListMeta, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.icon.variants.secondary, LinkListLabel, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.typography.colors.secondary, () => {
63
+ const { duration, easing } = (0, _redislabsdev_redis_ui_styles.useTheme)().core.motion;
64
+ return `${duration.fast} ${easing.easeOut}`;
65
+ }, LinkListLabel, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.typography.colors.informative, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space025, LinkListLabel, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space050, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space025, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space010, (0, _redislabsdev_redis_ui_styles.getFocusStyle)());
66
+ //#endregion
67
+ exports.LinkList = LinkList;
68
+ exports.LinkListIcon = LinkListIcon;
69
+ exports.LinkListItem = LinkListItem;
70
+ exports.LinkListItems = LinkListItems;
71
+ exports.LinkListLabel = LinkListLabel;
72
+ exports.LinkListMeta = LinkListMeta;
73
+ exports.LinkListRow = LinkListRow;
74
+ exports.LinkListText = LinkListText;
@@ -0,0 +1,10 @@
1
+ export declare const LinkList: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const LinkListItems: import("styled-components").StyledComponent<"ul", any, {}, never>;
3
+ export declare const LinkListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
4
+ export declare const LinkListIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
5
+ export declare const LinkListText: import("styled-components").StyledComponent<"span", any, {}, never>;
6
+ export declare const LinkListLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
7
+ export declare const LinkListMeta: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").TypographyCodeProps & import("react").RefAttributes<HTMLElement>>, any, {
8
+ size: "M";
9
+ }, "size">;
10
+ export declare const LinkListRow: import("styled-components").StyledComponent<"a", any, {}, never>;
@@ -0,0 +1,65 @@
1
+ import Typography from "../Typography/Typography.js";
2
+ import _styled from "styled-components";
3
+ import { getFocusStyle, useTheme } from "@redis-ui/styles";
4
+ //#region src/LinkList/LinkList.style.ts
5
+ var LinkList = _styled.div.withConfig({
6
+ displayName: "LinkListstyle__LinkList",
7
+ componentId: "RedisUI__sc-16e9e4l-0"
8
+ })([
9
+ "display:flex;flex-direction:column;gap:",
10
+ ";min-width:0;padding-left:",
11
+ ";border-left:",
12
+ " solid ",
13
+ ";"
14
+ ], () => useTheme().core.space.space150, () => useTheme().core.space.space300, () => useTheme().core.space.space010, () => useTheme().components.card.variants.primary.borderColor);
15
+ var LinkListItems = _styled.ul.withConfig({
16
+ displayName: "LinkListstyle__LinkListItems",
17
+ componentId: "RedisUI__sc-16e9e4l-1"
18
+ })(["display:flex;flex-direction:column;gap:", ";margin:0;padding:0;list-style:none;"], () => useTheme().core.space.space150);
19
+ var LinkListItem = _styled.li.withConfig({
20
+ displayName: "LinkListstyle__LinkListItem",
21
+ componentId: "RedisUI__sc-16e9e4l-2"
22
+ })(["display:flex;flex-direction:column;gap:", ";"], () => useTheme().core.space.space150);
23
+ var LinkListIcon = _styled.span.withConfig({
24
+ displayName: "LinkListstyle__LinkListIcon",
25
+ componentId: "RedisUI__sc-16e9e4l-3"
26
+ })(["display:flex;flex:none;margin-top:", ";"], () => useTheme().core.space.space025);
27
+ var LinkListText = _styled.span.withConfig({
28
+ displayName: "LinkListstyle__LinkListText",
29
+ componentId: "RedisUI__sc-16e9e4l-4"
30
+ })(["min-width:0;"]);
31
+ var LinkListLabel = _styled.span.withConfig({
32
+ displayName: "LinkListstyle__LinkListLabel",
33
+ componentId: "RedisUI__sc-16e9e4l-5"
34
+ })(["display:block;font-size:", ";"], () => useTheme().core.font.fontSize.s13);
35
+ var LinkListMeta = _styled(Typography.Code).attrs({ size: "M" }).withConfig({
36
+ displayName: "LinkListstyle__LinkListMeta",
37
+ componentId: "RedisUI__sc-16e9e4l-6"
38
+ })(["display:block;margin-top:", ";"], () => useTheme().core.space.space025);
39
+ var LinkListRow = _styled.a.withConfig({
40
+ displayName: "LinkListstyle__LinkListRow",
41
+ componentId: "RedisUI__sc-16e9e4l-7"
42
+ })([
43
+ "display:flex;align-items:flex-start;gap:",
44
+ ";width:100%;padding:0;border:0;border-radius:",
45
+ ";background:none;font:inherit;text-align:start;text-decoration:none;",
46
+ ",",
47
+ "{color:",
48
+ ";}",
49
+ "{color:",
50
+ ";}&:is(a,button){cursor:pointer;transition:transform ",
51
+ ";",
52
+ "{color:",
53
+ ";}}&:is(a,button):hover{transform:translateX(",
54
+ ");",
55
+ "{text-decoration:underline;text-underline-offset:",
56
+ ";}}&:is(a,button):active{transform:translate( ",
57
+ ",",
58
+ " );}@media (prefers-reduced-motion:reduce){&:is(a,button):hover,&:is(a,button):active{transform:none;}}",
59
+ ";"
60
+ ], () => useTheme().core.space.space100, () => useTheme().core.space.space050, LinkListIcon, LinkListMeta, () => useTheme().components.icon.variants.secondary, LinkListLabel, () => useTheme().components.typography.colors.secondary, () => {
61
+ const { duration, easing } = useTheme().core.motion;
62
+ return `${duration.fast} ${easing.easeOut}`;
63
+ }, LinkListLabel, () => useTheme().components.typography.colors.informative, () => useTheme().core.space.space025, LinkListLabel, () => useTheme().core.space.space050, () => useTheme().core.space.space025, () => useTheme().core.space.space010, getFocusStyle());
64
+ //#endregion
65
+ export { LinkList, LinkListIcon, LinkListItem, LinkListItems, LinkListLabel, LinkListMeta, LinkListRow, LinkListText };
@@ -0,0 +1,22 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { IconType } from '@redis-ui/icons';
3
+ import { TypographyHeadingComponent } from '../Typography';
4
+ export type LinkListItem = {
5
+ label: string;
6
+ icon?: IconType;
7
+ /** Secondary line rendered in a monospace font below the label */
8
+ meta?: string;
9
+ /** Renders the row as a link. Absolute http(s) and protocol-relative URLs open in a new tab */
10
+ href?: string;
11
+ /** Renders the row as a button when there is no `href`. Without either, the row is static text */
12
+ onClick?: () => void;
13
+ /** Adds a divider above the row */
14
+ separated?: boolean;
15
+ };
16
+ export type OwnLinkListProps = {
17
+ title: ReactNode;
18
+ items: LinkListItem[];
19
+ titleComponent?: Extract<TypographyHeadingComponent, 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
20
+ };
21
+ export type RestLinkListProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
22
+ export type LinkListProps = OwnLinkListProps & RestLinkListProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as LinkList } from './LinkList';
2
+ export * from './LinkList.types';
@@ -0,0 +1,2 @@
1
+ export { default as LinkList } from './LinkList';
2
+ export * from './LinkList.types';
package/dist/index.cjs CHANGED
@@ -88,6 +88,7 @@ const require_HighlightedIcon_style = require("./HighlightedIcon/HighlightedIcon
88
88
  const require_HighlightedIcon = require("./HighlightedIcon/HighlightedIcon.cjs");
89
89
  const require_KeyValueList = require("./KeyValueList/KeyValueList.cjs");
90
90
  const require_useKeyValueList = require("./KeyValueList/hooks/useKeyValueList.cjs");
91
+ const require_LinkList = require("./LinkList/LinkList.cjs");
91
92
  const require_Tabs = require("./Tabs/Tabs.cjs");
92
93
  const require_MidBar = require("./MidBar/MidBar.cjs");
93
94
  const require_Modal = require("./Modal/Modal.cjs");
@@ -201,6 +202,7 @@ exports.Input = require_Input.default;
201
202
  exports.KeyValueList = require_KeyValueList.KeyValueList;
202
203
  exports.Label = require_Label.default;
203
204
  exports.Link = require_Link.default;
205
+ exports.LinkList = require_LinkList.default;
204
206
  exports.LinkStyler = require_LinkStyler.LinkStyler;
205
207
  exports.Loader = require_Loader.default;
206
208
  exports.Menu = require_Menu.default;
@@ -271,6 +273,12 @@ exports.bannerVariants = require_Banner_types.bannerVariants;
271
273
  exports.buttonSizes = require_Button_types.buttonSizes;
272
274
  exports.buttonVariants = require_Button_types.buttonVariants;
273
275
  exports.buttonWithIconVariants = require_ActionIconButton_types.buttonWithIconVariants;
276
+ Object.defineProperty(exports, "cardHoverEffects", {
277
+ enumerable: true,
278
+ get: function() {
279
+ return _redislabsdev_redis_ui_styles.cardHoverEffects;
280
+ }
281
+ });
274
282
  Object.defineProperty(exports, "cardVariants", {
275
283
  enumerable: true,
276
284
  get: function() {
package/dist/index.d.ts CHANGED
@@ -25,6 +25,7 @@ export * from './KeyValueList';
25
25
  export * from './Label';
26
26
  export * from './Layouts';
27
27
  export * from './Link';
28
+ export * from './LinkList';
28
29
  export * from './Loader';
29
30
  export * from './Menu';
30
31
  export * from './MidBar';
package/dist/index.js CHANGED
@@ -65,7 +65,7 @@ import BoxSelectionGroup from "./BoxSelectionGroup/BoxSelectionGroup.js";
65
65
  import MultiBoxSelectionGroup from "./BoxSelectionGroup/MultiBoxSelectionGroup.js";
66
66
  import ButtonGroup from "./ButtonGroup/ButtonGroup.js";
67
67
  import Card from "./Card/Card.js";
68
- import { cardVariants } from "./Card/Card.types.js";
68
+ import { cardHoverEffects, cardVariants } from "./Card/Card.types.js";
69
69
  import Checkbox from "./Checkbox/Checkbox.js";
70
70
  import { ChipContainer } from "./Chip/components/Compose/Compose.style.js";
71
71
  import Chip from "./Chip/Chip.js";
@@ -88,6 +88,7 @@ import { HighlightedIcon_style_exports } from "./HighlightedIcon/HighlightedIcon
88
88
  import HighlightedIcon from "./HighlightedIcon/HighlightedIcon.js";
89
89
  import { KeyValueList } from "./KeyValueList/KeyValueList.js";
90
90
  import { useKeyValueList } from "./KeyValueList/hooks/useKeyValueList.js";
91
+ import LinkList from "./LinkList/LinkList.js";
91
92
  import Tabs from "./Tabs/Tabs.js";
92
93
  import MidBar from "./MidBar/MidBar.js";
93
94
  import Modal from "./Modal/Modal.js";
@@ -117,4 +118,4 @@ import { ProgressBar } from "./ProgressBar/ProgressBar.js";
117
118
  import { ProfileIcon_style_exports } from "./ProfileIcon/ProfileIcon.style.js";
118
119
  import ProfileIcon from "./ProfileIcon/ProfileIcon.js";
119
120
  import Slider from "./Slider/Slider.js";
120
- export { ActionIconButton_style_exports as ActionButtonWithIconStyles, ActionIconButton, AppBar, AppBar_style_exports as AppBarStyles, AppSelectionMenu, AutoCompleteSelect, Badge, Badge_style_exports as BadgeStyles, Banner, BoxSelectionGroup, Breadcrumbs, Button, ButtonGroup, Button_style_exports as ButtonStyles, IconButton_style_exports as ButtonWithIconStyles, Card, CategoryValueList, Checkbox, Chip, ChipContainer, ChipList, CodeBlock, ContextProvider, CopyToClipboardButton, CountryFlag, Drawer, ErrorContentProvider, FieldAdditionTextIdProvider, FieldAdditionTextIdTransProvider, FieldDisabledProvider, FieldDisabledTransProvider, FieldReadonlyProvider, FieldReadonlyTransProvider, FieldRequiredProvider, FieldRequiredTransProvider, FieldStatusProvider, FieldStatusTransProvider, Filters, FlexDivider, FlexGroup, FlexItem, FlexSplit, FormField, Gauge, Grid, Hero, HighlightedIcon, HighlightedIcon_style_exports as HighlightedIconStyles, IconButton, Input, KeyValueList, Label, Link, LinkStyler, Loader, Menu, MidBar, Modal, MoreInfoIcon, MultiBoxSelectionGroup, MultiSelect, NumericInput, Overflow, Pagination, PasswordInput, Popover, PopperProvider, ProfileIcon, ProfileIcon_style_exports as ProfileIconStyles, ProgressBar, QuantityCounter, RadioGroup, RestylableElement, ScreenReaderAnnounce, SearchBar, SearchInput, Section, Select, SelfContained, SharedIdProvider, SharedIdTransProvider, SideBar, Skeleton, Slider, Stepper, StepperStepState, Switch, TableHeading, Tabs, TextArea, TextButton, TextButton_style_exports as TextButtonStyles, ThemeModeSwitch, Toast, Toaster, ToggleButton, ToggleButton_style_exports as ToggleButtonStyles, Tooltip, TooltipCard, Provider as TooltipProvider, TreeView, Typography, actionIconButtonSizes, badgeVariants, bannerVariants, buttonSizes, buttonVariants, buttonWithIconVariants, cardVariants, childrenToString, codeBlockOverflows, codeBlockSizes, combineHandlers, copyToClipboardButtonVariants, createNullableContext, createPrimitiveContextState, debounce, forwardRefWithGenerics, generateId, getClosestDivisibleNumber, handlePreventDefault, handleStopPropagation, iconButtonSizes, isFragmentElement, isTextualNode, memoWithGenerics, textButtonSizes, textButtonVariants, throttle, toast, typographyColors, useEllipsisTooltip, useErrorContent, useFieldAdditionTextId, useFieldDisabled, useFieldReadonly, useFieldRequired, useFieldStatus, useGeneratedId, useInputValueApi, useInputValueProps, useKeyValueList, useMultiSelectContext, usePaginationContext, usePopperContext, useScrollable, useSelectContext, useSharedId, useThemeModeSwitch, useToastParams };
121
+ export { ActionIconButton_style_exports as ActionButtonWithIconStyles, ActionIconButton, AppBar, AppBar_style_exports as AppBarStyles, AppSelectionMenu, AutoCompleteSelect, Badge, Badge_style_exports as BadgeStyles, Banner, BoxSelectionGroup, Breadcrumbs, Button, ButtonGroup, Button_style_exports as ButtonStyles, IconButton_style_exports as ButtonWithIconStyles, Card, CategoryValueList, Checkbox, Chip, ChipContainer, ChipList, CodeBlock, ContextProvider, CopyToClipboardButton, CountryFlag, Drawer, ErrorContentProvider, FieldAdditionTextIdProvider, FieldAdditionTextIdTransProvider, FieldDisabledProvider, FieldDisabledTransProvider, FieldReadonlyProvider, FieldReadonlyTransProvider, FieldRequiredProvider, FieldRequiredTransProvider, FieldStatusProvider, FieldStatusTransProvider, Filters, FlexDivider, FlexGroup, FlexItem, FlexSplit, FormField, Gauge, Grid, Hero, HighlightedIcon, HighlightedIcon_style_exports as HighlightedIconStyles, IconButton, Input, KeyValueList, Label, Link, LinkList, LinkStyler, Loader, Menu, MidBar, Modal, MoreInfoIcon, MultiBoxSelectionGroup, MultiSelect, NumericInput, Overflow, Pagination, PasswordInput, Popover, PopperProvider, ProfileIcon, ProfileIcon_style_exports as ProfileIconStyles, ProgressBar, QuantityCounter, RadioGroup, RestylableElement, ScreenReaderAnnounce, SearchBar, SearchInput, Section, Select, SelfContained, SharedIdProvider, SharedIdTransProvider, SideBar, Skeleton, Slider, Stepper, StepperStepState, Switch, TableHeading, Tabs, TextArea, TextButton, TextButton_style_exports as TextButtonStyles, ThemeModeSwitch, Toast, Toaster, ToggleButton, ToggleButton_style_exports as ToggleButtonStyles, Tooltip, TooltipCard, Provider as TooltipProvider, TreeView, Typography, actionIconButtonSizes, badgeVariants, bannerVariants, buttonSizes, buttonVariants, buttonWithIconVariants, cardHoverEffects, cardVariants, childrenToString, codeBlockOverflows, codeBlockSizes, combineHandlers, copyToClipboardButtonVariants, createNullableContext, createPrimitiveContextState, debounce, forwardRefWithGenerics, generateId, getClosestDivisibleNumber, handlePreventDefault, handleStopPropagation, iconButtonSizes, isFragmentElement, isTextualNode, memoWithGenerics, textButtonSizes, textButtonVariants, throttle, toast, typographyColors, useEllipsisTooltip, useErrorContent, useFieldAdditionTextId, useFieldDisabled, useFieldReadonly, useFieldRequired, useFieldStatus, useGeneratedId, useInputValueApi, useInputValueProps, useKeyValueList, useMultiSelectContext, usePaginationContext, usePopperContext, useScrollable, useSelectContext, useSharedId, useThemeModeSwitch, useToastParams };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@redis-ui/components",
3
3
  "license": "UNLICENSED",
4
- "version": "51.18.1",
4
+ "version": "51.20.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": "git@github.com:redislabsdev/redis-ui.git",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@redis-ui/icons": "^8.0.0 || ^9.0.0 || ^10.0.0",
33
- "@redis-ui/styles": "^21.25.0",
33
+ "@redis-ui/styles": "^21.26.0",
34
34
  "react": "^18.0.0 || ^19.0.0",
35
35
  "react-dom": "^18.0.0 || ^19.0.0",
36
36
  "styled-components": "^5.0.0"
@@ -166,6 +166,7 @@ Always check the relevant component reference before using a component. The refe
166
166
  - [ChipList](./references/ChipList.md)
167
167
  - [Label](./references/Label.md)
168
168
  - [Link](./references/Link.md)
169
+ - [LinkList](./references/LinkList.md)
169
170
  - [Loader](./references/Loader.md)
170
171
  - [ProgressBar](./references/ProgressBar.md)
171
172
  - [Gauge](./references/Gauge.md)
@@ -1,6 +1,6 @@
1
1
  # Card
2
2
 
3
- A simple container card with configurable width, height, surface variant, and border. It renders as a flex column with default 1.6rem padding.
3
+ A simple container card with configurable width, height, surface variant, border, and hover effect. It renders as a flex column with default 1.6rem padding.
4
4
 
5
5
  ## Import
6
6
 
@@ -16,11 +16,16 @@ import { Card } from '@redis-ui/components';
16
16
  | height | `number \| string` | `fit-content` | Overrides the card height |
17
17
  | variant | `CardVariant` | `primary` | Controls the card surface color |
18
18
  | border | `boolean` | `true` | Shows a variant-matched border and keeps shadow disabled |
19
+ | hoverEffect | `CardHoverEffect` | `none` | Hover style that matches what the card does |
19
20
 
20
21
  The component also extends all native `React.HTMLAttributes<HTMLDivElement>` props.
21
22
 
22
23
  `CardVariant` is one of `primary`, `secondary`, `informative`, `success`, `notice`, `attention`, `danger`, or `upsell`.
23
24
 
25
+ `CardHoverEffect` is one of `none`, `sunset`, `lift`, or `highlight`.
26
+
27
+ Exported values and types: `cardVariants`, `cardHoverEffects`, `CardProps`, `CardVariant`, `CardHoverEffect`.
28
+
24
29
  ## Examples
25
30
 
26
31
  ### Basic usage
@@ -47,6 +52,28 @@ import { Card, cardVariants } from '@redis-ui/components';
47
52
  </>
48
53
  ```
49
54
 
55
+ ### Hover effects
56
+
57
+ > Pick the effect by what the card does.
58
+
59
+ ```tsx
60
+ import { Button, Card } from '@redis-ui/components';
61
+
62
+ <>
63
+ {/* Static card: a glow fades in, the card does not move */}
64
+ <Card hoverEffect="sunset">Content</Card>
65
+
66
+ {/* The whole card is the click target: the border darkens and the card lifts */}
67
+ <Card hoverEffect="lift" role="button" tabIndex={0} onClick={open}>Content</Card>
68
+
69
+ {/* The card holds a CTA: the surface and border change */}
70
+ <Card hoverEffect="highlight">
71
+ Content
72
+ <Button>Create</Button>
73
+ </Card>
74
+ </>
75
+ ```
76
+
50
77
  ## Notes
51
78
 
52
79
  - If `width` is not provided, the card defaults to `100%`.
@@ -55,3 +82,6 @@ import { Card, cardVariants } from '@redis-ui/components';
55
82
  - If `border` is not provided, the card renders with a variant-matched border and without shadow.
56
83
  - Use `border={false}` to render the card without border.
57
84
  - The component forwards standard `div` attributes through `React.HTMLAttributes<HTMLDivElement>`.
85
+ - If `hoverEffect` is not provided, the card has no hover style.
86
+ - Hover colors come from the theme and are tuned for the `primary` and `secondary` variants.
87
+ - `lift` only styles the card. Make it keyboard reachable with `role`, `tabIndex`, and key handlers, or render the action as a link or button inside.
@@ -0,0 +1,117 @@
1
+ # LinkList
2
+
3
+ A titled list of rows, each with an optional icon and a monospace meta line, set off from the page content by a left border. Use it for side rails of related links, such as a "Resources" column next to the page content.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { LinkList, LinkListItem } from '@redis-ui/components';
9
+ ```
10
+
11
+ Icons in the examples come from:
12
+
13
+ ```tsx
14
+ import { CliIcon, ContractsIcon, DatabaseIcon, RedisClientIcon, StarsIcon } from '@redis-ui/icons';
15
+ ```
16
+
17
+ ## Props
18
+
19
+ | Prop | Type | Default | Description |
20
+ |------|------|---------|-------------|
21
+ | title | `ReactNode` | required | Heading rendered above the list. It also labels the list |
22
+ | items | `LinkListItem[]` | required | Rows to render |
23
+ | titleComponent | `'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6'` | `'h2'` | Heading level of the title |
24
+
25
+ The component also extends `React.HTMLAttributes<HTMLDivElement>` (except `title`), passed to the container.
26
+
27
+ ### LinkListItem
28
+
29
+ | Field | Type | Description |
30
+ |-------|------|-------------|
31
+ | label | `string` | Row label |
32
+ | icon | `IconType` | Optional icon shown before the label |
33
+ | meta | `string` | Optional secondary line in a monospace font below the label |
34
+ | href | `string` | Renders the row as a link. Absolute `http(s)` and protocol-relative (`//`) URLs open in a new tab with `rel="noopener noreferrer"`; relative URLs stay in the same tab |
35
+ | onClick | `() => void` | Renders the row as a button when there is no `href`. With neither `href` nor `onClick`, the row renders as static text |
36
+ | separated | `boolean` | Adds a divider above the row |
37
+
38
+ ## Examples
39
+
40
+ ### Basic Usage
41
+
42
+ > A left border sets the list off from the page content.
43
+
44
+ ```tsx
45
+ const items: LinkListItem[] = [
46
+ {
47
+ label: 'Documentation',
48
+ meta: 'redis.io/docs · databases',
49
+ icon: ContractsIcon,
50
+ href: 'https://redis.io/docs/latest/'
51
+ },
52
+ {
53
+ label: 'Client libraries',
54
+ meta: 'node · python · java · go',
55
+ icon: CliIcon,
56
+ href: 'https://redis.io/docs/latest/develop/clients/'
57
+ },
58
+ {
59
+ label: 'Connect with a coding agent',
60
+ meta: 'mcp · claude code · cursor',
61
+ icon: RedisClientIcon,
62
+ onClick: () => {}
63
+ },
64
+ {
65
+ label: 'Bring existing data',
66
+ meta: 'import · connect existing redis',
67
+ icon: DatabaseIcon,
68
+ onClick: () => {}
69
+ },
70
+ {
71
+ label: 'Ask the Assistant',
72
+ meta: 'or contact support',
73
+ icon: StarsIcon,
74
+ href: 'https://redis.io/support/',
75
+ separated: true
76
+ }
77
+ ];
78
+
79
+ <LinkList title="Resources" items={items} titleComponent="h2" style={{ width: '28rem' }} />
80
+ ```
81
+
82
+ ### Minimal
83
+
84
+ > Rows without an icon or meta line. A row without `href` or `onClick` renders as static text.
85
+
86
+ ```tsx
87
+ <LinkList
88
+ title="Resources"
89
+ items={[
90
+ ...items.map(({ label, href, onClick }) => ({ label, href, onClick })),
91
+ { label: 'Coming soon' }
92
+ ]}
93
+ />
94
+ ```
95
+
96
+ ### NextThemes
97
+
98
+ > The list in the Next light and dark themes.
99
+
100
+ ```tsx
101
+ import { ThemeProvider } from 'styled-components';
102
+ import { themesNext } from '@redis-ui/styles';
103
+
104
+ <ThemeProvider theme={themesNext.light}>
105
+ <LinkList title="Resources" items={items} />
106
+ </ThemeProvider>
107
+
108
+ <ThemeProvider theme={themesNext.dark}>
109
+ <LinkList title="Resources" items={items} />
110
+ </ThemeProvider>
111
+ ```
112
+
113
+ ## Notes
114
+
115
+ - The whole row (icon, label and meta) is one link or button, so it is keyboard focusable and gets the design-system hover and focus treatment.
116
+ - Leave sticky positioning and the column width to the page layout; the component fills the width it is given.
117
+ - Use `onClick` for in-app navigation through your router, and `href` for links that should be real anchors.