@redis-ui/components 51.24.0 → 51.26.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,11 +1,16 @@
1
1
  const require_index = require("../node_modules/@radix-ui/react-id/dist/index.cjs");
2
2
  const require_Typography = require("../Typography/Typography.cjs");
3
+ const require_Badge = require("../Badge/Badge.cjs");
3
4
  const require_FlexDivider = require("../Layouts/FlexDivider/FlexDivider.cjs");
4
5
  const require_LinkList_style = require("./LinkList.style.cjs");
5
6
  let react_jsx_runtime = require("react/jsx-runtime");
6
7
  //#region src/LinkList/LinkList.tsx
7
8
  var isExternal = (href) => /^(https?:)?\/\//i.test(href);
8
- var getRowProps = ({ href, onClick }) => {
9
+ var getRowProps = ({ href, onClick, disabled }) => {
10
+ if (disabled) return {
11
+ as: "div",
12
+ "aria-disabled": true
13
+ };
9
14
  if (href) return {
10
15
  href,
11
16
  onClick,
@@ -34,7 +39,7 @@ var LinkList = ({ title, items, titleComponent = "h2", variant = "bordered", ...
34
39
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListItems, {
35
40
  "aria-labelledby": titleId,
36
41
  children: items.map((item, index) => {
37
- const { label, icon: Icon, meta, separated } = item;
42
+ const { label, icon: Icon, meta, separated, disabled, showInfoBadge = true, infoBadge = "Coming soon" } = item;
38
43
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkListItem, { children: [separated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FlexDivider.FlexDivider, {
39
44
  orientation: "horizontal",
40
45
  autoHide: false
@@ -43,7 +48,7 @@ var LinkList = ({ title, items, titleComponent = "h2", variant = "bordered", ...
43
48
  children: [Icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListIcon, {
44
49
  "aria-hidden": true,
45
50
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { size: "M" })
46
- }), /* @__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 })] })]
51
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkListText, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkListLabelRow, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListLabel, { children: label }), disabled && showInfoBadge && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Badge.default, { label: infoBadge })] }), meta && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkList_style.LinkListMeta, { children: meta })] })]
47
52
  })] }, `${index}-${label}`);
48
53
  })
49
54
  })]
@@ -1,11 +1,16 @@
1
1
  import { useId } from "../node_modules/@radix-ui/react-id/dist/index.js";
2
2
  import Typography from "../Typography/Typography.js";
3
+ import Badge from "../Badge/Badge.js";
3
4
  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 { LinkList as LinkList$1, LinkListIcon, LinkListItem, LinkListItems, LinkListLabel, LinkListLabelRow, LinkListMeta, LinkListRow, LinkListText } from "./LinkList.style.js";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  //#region src/LinkList/LinkList.tsx
7
8
  var isExternal = (href) => /^(https?:)?\/\//i.test(href);
8
- var getRowProps = ({ href, onClick }) => {
9
+ var getRowProps = ({ href, onClick, disabled }) => {
10
+ if (disabled) return {
11
+ as: "div",
12
+ "aria-disabled": true
13
+ };
9
14
  if (href) return {
10
15
  href,
11
16
  onClick,
@@ -34,7 +39,7 @@ var LinkList = ({ title, items, titleComponent = "h2", variant = "bordered", ...
34
39
  }), /* @__PURE__ */ jsx(LinkListItems, {
35
40
  "aria-labelledby": titleId,
36
41
  children: items.map((item, index) => {
37
- const { label, icon: Icon, meta, separated } = item;
42
+ const { label, icon: Icon, meta, separated, disabled, showInfoBadge = true, infoBadge = "Coming soon" } = item;
38
43
  return /* @__PURE__ */ jsxs(LinkListItem, { children: [separated && /* @__PURE__ */ jsx(FlexDivider, {
39
44
  orientation: "horizontal",
40
45
  autoHide: false
@@ -43,7 +48,7 @@ var LinkList = ({ title, items, titleComponent = "h2", variant = "bordered", ...
43
48
  children: [Icon && /* @__PURE__ */ jsx(LinkListIcon, {
44
49
  "aria-hidden": true,
45
50
  children: /* @__PURE__ */ jsx(Icon, { size: "M" })
46
- }), /* @__PURE__ */ jsxs(LinkListText, { children: [/* @__PURE__ */ jsx(LinkListLabel, { children: label }), meta && /* @__PURE__ */ jsx(LinkListMeta, { children: meta })] })]
51
+ }), /* @__PURE__ */ jsxs(LinkListText, { children: [/* @__PURE__ */ jsxs(LinkListLabelRow, { children: [/* @__PURE__ */ jsx(LinkListLabel, { children: label }), disabled && showInfoBadge && /* @__PURE__ */ jsx(Badge, { label: infoBadge })] }), meta && /* @__PURE__ */ jsx(LinkListMeta, { children: meta })] })]
47
52
  })] }, `${index}-${label}`);
48
53
  })
49
54
  })]
@@ -38,13 +38,21 @@ var LinkListLabel = styled_components.default.span.withConfig({
38
38
  displayName: "LinkListstyle__LinkListLabel",
39
39
  componentId: "RedisUI__sc-16e9e4l-5"
40
40
  })(["display:block;font-size:", ";"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.font.fontSize.s13);
41
+ var LinkListLabelRow = styled_components.default.span.withConfig({
42
+ displayName: "LinkListstyle__LinkListLabelRow",
43
+ componentId: "RedisUI__sc-16e9e4l-6"
44
+ })([
45
+ "display:flex;align-items:center;gap:",
46
+ ";> :not(",
47
+ "){flex:none;}"
48
+ ], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space100, LinkListLabel);
41
49
  var LinkListMeta = (0, styled_components.default)(require_Typography.default.Code).attrs({ size: "M" }).withConfig({
42
50
  displayName: "LinkListstyle__LinkListMeta",
43
- componentId: "RedisUI__sc-16e9e4l-6"
51
+ componentId: "RedisUI__sc-16e9e4l-7"
44
52
  })(["display:block;margin-top:", ";"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space025);
45
53
  var LinkListRow = styled_components.default.a.withConfig({
46
54
  displayName: "LinkListstyle__LinkListRow",
47
- componentId: "RedisUI__sc-16e9e4l-7"
55
+ componentId: "RedisUI__sc-16e9e4l-8"
48
56
  })([
49
57
  "display:flex;align-items:flex-start;gap:",
50
58
  ";width:100%;padding:0;border:0;border-radius:",
@@ -73,6 +81,7 @@ exports.LinkListIcon = LinkListIcon;
73
81
  exports.LinkListItem = LinkListItem;
74
82
  exports.LinkListItems = LinkListItems;
75
83
  exports.LinkListLabel = LinkListLabel;
84
+ exports.LinkListLabelRow = LinkListLabelRow;
76
85
  exports.LinkListMeta = LinkListMeta;
77
86
  exports.LinkListRow = LinkListRow;
78
87
  exports.LinkListText = LinkListText;
@@ -7,6 +7,7 @@ export declare const LinkListItem: import("styled-components").StyledComponent<"
7
7
  export declare const LinkListIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
8
8
  export declare const LinkListText: import("styled-components").StyledComponent<"span", any, {}, never>;
9
9
  export declare const LinkListLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
10
+ export declare const LinkListLabelRow: import("styled-components").StyledComponent<"span", any, {}, never>;
10
11
  export declare const LinkListMeta: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").TypographyCodeProps & import("react").RefAttributes<HTMLElement>>, any, {
11
12
  size: "M";
12
13
  }, "size">;
@@ -36,13 +36,21 @@ var LinkListLabel = _styled.span.withConfig({
36
36
  displayName: "LinkListstyle__LinkListLabel",
37
37
  componentId: "RedisUI__sc-16e9e4l-5"
38
38
  })(["display:block;font-size:", ";"], () => useTheme().core.font.fontSize.s13);
39
+ var LinkListLabelRow = _styled.span.withConfig({
40
+ displayName: "LinkListstyle__LinkListLabelRow",
41
+ componentId: "RedisUI__sc-16e9e4l-6"
42
+ })([
43
+ "display:flex;align-items:center;gap:",
44
+ ";> :not(",
45
+ "){flex:none;}"
46
+ ], () => useTheme().core.space.space100, LinkListLabel);
39
47
  var LinkListMeta = _styled(Typography.Code).attrs({ size: "M" }).withConfig({
40
48
  displayName: "LinkListstyle__LinkListMeta",
41
- componentId: "RedisUI__sc-16e9e4l-6"
49
+ componentId: "RedisUI__sc-16e9e4l-7"
42
50
  })(["display:block;margin-top:", ";"], () => useTheme().core.space.space025);
43
51
  var LinkListRow = _styled.a.withConfig({
44
52
  displayName: "LinkListstyle__LinkListRow",
45
- componentId: "RedisUI__sc-16e9e4l-7"
53
+ componentId: "RedisUI__sc-16e9e4l-8"
46
54
  })([
47
55
  "display:flex;align-items:flex-start;gap:",
48
56
  ";width:100%;padding:0;border:0;border-radius:",
@@ -66,4 +74,4 @@ var LinkListRow = _styled.a.withConfig({
66
74
  return `${duration.fast} ${easing.easeOut}`;
67
75
  }, LinkListLabel, () => useTheme().components.typography.colors.informative, () => useTheme().core.space.space025, LinkListLabel, () => useTheme().core.space.space050, () => useTheme().core.space.space025, () => useTheme().core.space.space010, getFocusStyle());
68
76
  //#endregion
69
- export { LinkList, LinkListIcon, LinkListItem, LinkListItems, LinkListLabel, LinkListMeta, LinkListRow, LinkListText };
77
+ export { LinkList, LinkListIcon, LinkListItem, LinkListItems, LinkListLabel, LinkListLabelRow, LinkListMeta, LinkListRow, LinkListText };
@@ -12,6 +12,12 @@ export type LinkListItem = {
12
12
  onClick?: () => void;
13
13
  /** Adds a divider above the row */
14
14
  separated?: boolean;
15
+ /** Renders the row as static, non-interactive text, ignoring `href` and `onClick` */
16
+ disabled?: boolean;
17
+ /** Shows the info badge next to the label of a disabled row. Defaults to `true` */
18
+ showInfoBadge?: boolean;
19
+ /** Text of the info badge. Defaults to `'Coming soon'` */
20
+ infoBadge?: string;
15
21
  };
16
22
  export type LinkListVariant = 'bordered' | 'plain';
17
23
  export type OwnLinkListProps = {
@@ -0,0 +1,28 @@
1
+ const require_Typography = require("../Typography/Typography.cjs");
2
+ const require_UseCaseList_style = require("./UseCaseList.style.cjs");
3
+ let react_jsx_runtime = require("react/jsx-runtime");
4
+ //#region src/UseCaseList/UseCaseList.tsx
5
+ var formatPosition = (index) => String(index + 1).padStart(2, "0");
6
+ var UseCaseList = ({ items, ...restProps }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UseCaseList_style.UseCaseList, {
7
+ role: "list",
8
+ ...restProps,
9
+ children: items.map(({ title, description, icon }, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_UseCaseList_style.UseCaseListItem, {
10
+ $numbered: !icon,
11
+ children: [icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UseCaseList_style.UseCaseListIcon, {
12
+ "aria-hidden": true,
13
+ children: icon
14
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_UseCaseList_style.UseCaseListNumber, {
15
+ "aria-hidden": true,
16
+ children: formatPosition(index)
17
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_UseCaseList_style.UseCaseListText, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.default.Body, {
18
+ variant: "semiBold",
19
+ children: title
20
+ }), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.default.Body, {
21
+ size: "S",
22
+ color: "secondary",
23
+ children: description
24
+ })] })]
25
+ }, `${index}-${title}`))
26
+ });
27
+ //#endregion
28
+ exports.default = UseCaseList;
@@ -0,0 +1,3 @@
1
+ import { UseCaseListProps } from './UseCaseList.types';
2
+ declare const UseCaseList: ({ items, ...restProps }: UseCaseListProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default UseCaseList;
@@ -0,0 +1,28 @@
1
+ import Typography from "../Typography/Typography.js";
2
+ import { UseCaseList as UseCaseList$1, UseCaseListIcon, UseCaseListItem, UseCaseListNumber, UseCaseListText } from "./UseCaseList.style.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/UseCaseList/UseCaseList.tsx
5
+ var formatPosition = (index) => String(index + 1).padStart(2, "0");
6
+ var UseCaseList = ({ items, ...restProps }) => /* @__PURE__ */ jsx(UseCaseList$1, {
7
+ role: "list",
8
+ ...restProps,
9
+ children: items.map(({ title, description, icon }, index) => /* @__PURE__ */ jsxs(UseCaseListItem, {
10
+ $numbered: !icon,
11
+ children: [icon ? /* @__PURE__ */ jsx(UseCaseListIcon, {
12
+ "aria-hidden": true,
13
+ children: icon
14
+ }) : /* @__PURE__ */ jsx(UseCaseListNumber, {
15
+ "aria-hidden": true,
16
+ children: formatPosition(index)
17
+ }), /* @__PURE__ */ jsxs(UseCaseListText, { children: [/* @__PURE__ */ jsx(Typography.Body, {
18
+ variant: "semiBold",
19
+ children: title
20
+ }), description && /* @__PURE__ */ jsx(Typography.Body, {
21
+ size: "S",
22
+ color: "secondary",
23
+ children: description
24
+ })] })]
25
+ }, `${index}-${title}`))
26
+ });
27
+ //#endregion
28
+ export { UseCaseList as default };
@@ -0,0 +1,54 @@
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/UseCaseList/UseCaseList.style.ts
7
+ var UseCaseList = styled_components.default.ul.withConfig({
8
+ displayName: "UseCaseListstyle__UseCaseList",
9
+ componentId: "RedisUI__sc-fvyp7z-0"
10
+ })(["display:flex;flex-direction:column;min-width:0;margin:0;padding:0;list-style:none;"]);
11
+ var UseCaseListItem = styled_components.default.li.withConfig({
12
+ displayName: "UseCaseListstyle__UseCaseListItem",
13
+ componentId: "RedisUI__sc-fvyp7z-1"
14
+ })([
15
+ "display:flex;align-items:",
16
+ ";gap:",
17
+ ";padding-block:",
18
+ ";&:first-child{padding-top:",
19
+ ";}&:not(:first-child){border-top:",
20
+ ";}"
21
+ ], ({ $numbered }) => $numbered ? "baseline" : "flex-start", () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space200, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space200, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space050, () => {
22
+ const { core, components } = (0, _redislabsdev_redis_ui_styles.useTheme)();
23
+ return `${core.space.space010} solid ${(0, _redislabsdev_redis_ui_styles.withOpacity)(components.card.variants.primary.borderColor, .55)}`;
24
+ });
25
+ var leadSlot = styled_components.css`
26
+ flex: none;
27
+ width: ${() => (0, _redislabsdev_redis_ui_styles.useTheme)().core.icon.size.L};
28
+ `;
29
+ var UseCaseListIcon = styled_components.default.span.withConfig({
30
+ displayName: "UseCaseListstyle__UseCaseListIcon",
31
+ componentId: "RedisUI__sc-fvyp7z-2"
32
+ })([
33
+ "",
34
+ ";display:flex;margin-top:",
35
+ ";color:",
36
+ ";"
37
+ ], leadSlot, () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space025, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.typography.colors.secondary);
38
+ var UseCaseListNumber = (0, styled_components.default)(require_Typography.default.Code).attrs({
39
+ size: "S",
40
+ color: "secondary"
41
+ }).withConfig({
42
+ displayName: "UseCaseListstyle__UseCaseListNumber",
43
+ componentId: "RedisUI__sc-fvyp7z-3"
44
+ })(["", ";"], leadSlot);
45
+ var UseCaseListText = styled_components.default.div.withConfig({
46
+ displayName: "UseCaseListstyle__UseCaseListText",
47
+ componentId: "RedisUI__sc-fvyp7z-4"
48
+ })(["display:flex;flex-direction:column;gap:", ";min-width:0;"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space050);
49
+ //#endregion
50
+ exports.UseCaseList = UseCaseList;
51
+ exports.UseCaseListIcon = UseCaseListIcon;
52
+ exports.UseCaseListItem = UseCaseListItem;
53
+ exports.UseCaseListNumber = UseCaseListNumber;
54
+ exports.UseCaseListText = UseCaseListText;
@@ -0,0 +1,10 @@
1
+ export declare const UseCaseList: import("styled-components").StyledComponent<"ul", any, {}, never>;
2
+ export declare const UseCaseListItem: import("styled-components").StyledComponent<"li", any, {
3
+ $numbered: boolean;
4
+ }, never>;
5
+ export declare const UseCaseListIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
6
+ export declare const UseCaseListNumber: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").TypographyCodeProps & import("react").RefAttributes<HTMLElement>>, any, {
7
+ size: "S";
8
+ color: "secondary";
9
+ }, "color" | "size">;
10
+ export declare const UseCaseListText: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,48 @@
1
+ import Typography from "../Typography/Typography.js";
2
+ import _styled, { css } from "styled-components";
3
+ import { useTheme, withOpacity } from "@redis-ui/styles";
4
+ //#region src/UseCaseList/UseCaseList.style.ts
5
+ var UseCaseList = _styled.ul.withConfig({
6
+ displayName: "UseCaseListstyle__UseCaseList",
7
+ componentId: "RedisUI__sc-fvyp7z-0"
8
+ })(["display:flex;flex-direction:column;min-width:0;margin:0;padding:0;list-style:none;"]);
9
+ var UseCaseListItem = _styled.li.withConfig({
10
+ displayName: "UseCaseListstyle__UseCaseListItem",
11
+ componentId: "RedisUI__sc-fvyp7z-1"
12
+ })([
13
+ "display:flex;align-items:",
14
+ ";gap:",
15
+ ";padding-block:",
16
+ ";&:first-child{padding-top:",
17
+ ";}&:not(:first-child){border-top:",
18
+ ";}"
19
+ ], ({ $numbered }) => $numbered ? "baseline" : "flex-start", () => useTheme().core.space.space200, () => useTheme().core.space.space200, () => useTheme().core.space.space050, () => {
20
+ const { core, components } = useTheme();
21
+ return `${core.space.space010} solid ${withOpacity(components.card.variants.primary.borderColor, .55)}`;
22
+ });
23
+ var leadSlot = css`
24
+ flex: none;
25
+ width: ${() => useTheme().core.icon.size.L};
26
+ `;
27
+ var UseCaseListIcon = _styled.span.withConfig({
28
+ displayName: "UseCaseListstyle__UseCaseListIcon",
29
+ componentId: "RedisUI__sc-fvyp7z-2"
30
+ })([
31
+ "",
32
+ ";display:flex;margin-top:",
33
+ ";color:",
34
+ ";"
35
+ ], leadSlot, () => useTheme().core.space.space025, () => useTheme().components.typography.colors.secondary);
36
+ var UseCaseListNumber = _styled(Typography.Code).attrs({
37
+ size: "S",
38
+ color: "secondary"
39
+ }).withConfig({
40
+ displayName: "UseCaseListstyle__UseCaseListNumber",
41
+ componentId: "RedisUI__sc-fvyp7z-3"
42
+ })(["", ";"], leadSlot);
43
+ var UseCaseListText = _styled.div.withConfig({
44
+ displayName: "UseCaseListstyle__UseCaseListText",
45
+ componentId: "RedisUI__sc-fvyp7z-4"
46
+ })(["display:flex;flex-direction:column;gap:", ";min-width:0;"], () => useTheme().core.space.space050);
47
+ //#endregion
48
+ export { UseCaseList, UseCaseListIcon, UseCaseListItem, UseCaseListNumber, UseCaseListText };
@@ -0,0 +1,12 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type UseCaseListItem = {
3
+ title: string;
4
+ description?: ReactNode;
5
+ /** Leading icon, sized `L`. Without one, the row shows its position as a two-digit number */
6
+ icon?: ReactNode;
7
+ };
8
+ export type OwnUseCaseListProps = {
9
+ items: UseCaseListItem[];
10
+ };
11
+ export type RestUseCaseListProps = HTMLAttributes<HTMLUListElement>;
12
+ export type UseCaseListProps = OwnUseCaseListProps & RestUseCaseListProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as UseCaseList } from './UseCaseList';
2
+ export * from './UseCaseList.types';
@@ -0,0 +1,2 @@
1
+ export { default as UseCaseList } from './UseCaseList';
2
+ export * from './UseCaseList.types';
package/dist/index.cjs CHANGED
@@ -114,6 +114,7 @@ const require_context = require("./Toast/core/context.cjs");
114
114
  const require_Toast = require("./Toast/Toast.cjs");
115
115
  const require_core = require("./Toast/core/core.cjs");
116
116
  const require_Toaster = require("./Toast/Toaster.cjs");
117
+ const require_UseCaseList = require("./UseCaseList/UseCaseList.cjs");
117
118
  const require_ProgressBar = require("./ProgressBar/ProgressBar.cjs");
118
119
  const require_ProfileIcon_style = require("./ProfileIcon/ProfileIcon.style.cjs");
119
120
  const require_ProfileIcon = require("./ProfileIcon/ProfileIcon.cjs");
@@ -267,6 +268,7 @@ exports.TooltipCard = require_TooltipCard.default;
267
268
  exports.TooltipProvider = require_Provider.default;
268
269
  exports.TreeView = require_TreeView.default;
269
270
  exports.Typography = require_Typography.default;
271
+ exports.UseCaseList = require_UseCaseList.default;
270
272
  exports.actionIconButtonSizes = require_ActionIconButton_types.actionIconButtonSizes;
271
273
  exports.badgeVariants = require_Badge_types.badgeVariants;
272
274
  exports.bannerVariants = require_Banner_types.bannerVariants;
package/dist/index.d.ts CHANGED
@@ -51,6 +51,7 @@ export * from './Toast';
51
51
  export * from './Tooltip';
52
52
  export * from './TreeView';
53
53
  export * from './Typography';
54
+ export * from './UseCaseList';
54
55
  export * from './ProgressBar';
55
56
  export * from './ProfileIcon';
56
57
  export * from './Slider';
package/dist/index.js CHANGED
@@ -114,8 +114,9 @@ import { useToastParams } from "./Toast/core/context.js";
114
114
  import Toast from "./Toast/Toast.js";
115
115
  import { toast } from "./Toast/core/core.js";
116
116
  import Toaster from "./Toast/Toaster.js";
117
+ import UseCaseList from "./UseCaseList/UseCaseList.js";
117
118
  import { ProgressBar } from "./ProgressBar/ProgressBar.js";
118
119
  import { ProfileIcon_style_exports } from "./ProfileIcon/ProfileIcon.style.js";
119
120
  import ProfileIcon from "./ProfileIcon/ProfileIcon.js";
120
121
  import Slider from "./Slider/Slider.js";
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 };
122
+ 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, UseCaseList, 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.24.0",
4
+ "version": "51.26.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": "git@github.com:redislabsdev/redis-ui.git",
@@ -171,6 +171,7 @@ Always check the relevant component reference before using a component. The refe
171
171
  - [ProgressBar](./references/ProgressBar.md)
172
172
  - [Gauge](./references/Gauge.md)
173
173
  - [Typography](./references/Typography.md)
174
+ - [UseCaseList](./references/UseCaseList.md)
174
175
  - [MoreInfoIcon](./references/MoreInfoIcon.md)
175
176
  - [HighlightedIcon](./references/HighlightedIcon.md)
176
177
  - [Icons](./references/Icons.md)
@@ -11,7 +11,7 @@ import { LinkList, LinkListItem } from '@redis-ui/components';
11
11
  Icons in the examples come from:
12
12
 
13
13
  ```tsx
14
- import { CliIcon, ContractsIcon, DatabaseIcon, RedisClientIcon, StarsIcon } from '@redis-ui/icons';
14
+ import { CliIcon, ContractsIcon, DatabaseIcon, RedisClientIcon, StarsIcon, VectorSearchIcon } from '@redis-ui/icons';
15
15
  ```
16
16
 
17
17
  ## Props
@@ -35,6 +35,9 @@ The component also extends `React.HTMLAttributes<HTMLDivElement>` (except `title
35
35
  | 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 |
36
36
  | onClick | `() => void` | Renders the row as a button when there is no `href`. With neither `href` nor `onClick`, the row renders as static text |
37
37
  | separated | `boolean` | Adds a divider above the row |
38
+ | disabled | `boolean` | Renders the row as static, non-interactive text with `aria-disabled`, ignoring `href` and `onClick` |
39
+ | showInfoBadge | `boolean` | Shows the info badge next to the label of a disabled row. Defaults to `true` |
40
+ | infoBadge | `string` | Text of the info badge. Defaults to `'Coming soon'` |
38
41
 
39
42
  ## Examples
40
43
 
@@ -68,6 +71,13 @@ const items: LinkListItem[] = [
68
71
  icon: DatabaseIcon,
69
72
  onClick: () => {}
70
73
  },
74
+ {
75
+ label: 'Vector search',
76
+ meta: 'embeddings · similarity',
77
+ icon: VectorSearchIcon,
78
+ href: 'https://redis.io/docs/latest/develop/ai/search-and-query/',
79
+ disabled: true
80
+ },
71
81
  {
72
82
  label: 'Ask the Assistant',
73
83
  meta: 'or contact support',
@@ -96,8 +106,43 @@ const items: LinkListItem[] = [
96
106
  <LinkList
97
107
  title="Resources"
98
108
  items={[
99
- ...items.map(({ label, href, onClick }) => ({ label, href, onClick })),
100
- { label: 'Coming soon' }
109
+ ...items.map(({ label, href, onClick, disabled }) => ({ label, href, onClick, disabled })),
110
+ { label: 'Changelog' }
111
+ ]}
112
+ />
113
+ ```
114
+
115
+ ### Disabled
116
+
117
+ > `disabled` renders the row as static text, even with `href`, and shows an info badge ("Coming soon" by default). Set `infoBadge` to change its text, or `showInfoBadge: false` to hide it.
118
+
119
+ ```tsx
120
+ <LinkList
121
+ title="Resources"
122
+ items={[
123
+ { label: 'Vector search', meta: 'embeddings · similarity', icon: VectorSearchIcon, disabled: true },
124
+ {
125
+ label: 'Bring existing data',
126
+ meta: 'import · connect existing redis',
127
+ icon: DatabaseIcon,
128
+ disabled: true,
129
+ showInfoBadge: false
130
+ },
131
+ {
132
+ label: 'Documentation',
133
+ meta: 'redis.io/docs · databases',
134
+ icon: ContractsIcon,
135
+ href: 'https://redis.io/docs/latest/',
136
+ disabled: true,
137
+ showInfoBadge: false
138
+ },
139
+ {
140
+ label: 'Ask the Assistant',
141
+ meta: 'or contact support',
142
+ icon: StarsIcon,
143
+ disabled: true,
144
+ infoBadge: 'Q1 2027'
145
+ }
101
146
  ]}
102
147
  />
103
148
  ```
@@ -0,0 +1,86 @@
1
+ # UseCaseList
2
+
3
+ A list of use cases, each a title with an optional description, separated by thin dividers. Use it on product landing pages and empty states to show what a product is for.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { UseCaseList, UseCaseListItem } from '@redis-ui/components';
9
+ ```
10
+
11
+ Icons in the examples come from:
12
+
13
+ ```tsx
14
+ import { DatabaseIcon, LeaderboardsIcon, NodesIcon } from '@redis-ui/icons';
15
+ ```
16
+
17
+ ## Props
18
+
19
+ | Prop | Type | Default | Description |
20
+ |------|------|---------|-------------|
21
+ | items | `UseCaseListItem[]` | required | Rows to render |
22
+
23
+ The component also extends `React.HTMLAttributes<HTMLUListElement>`, passed to the list.
24
+
25
+ ### UseCaseListItem
26
+
27
+ | Field | Type | Description |
28
+ |-------|------|-------------|
29
+ | title | `string` | Row title |
30
+ | description | `ReactNode` | Optional secondary text below the title |
31
+ | icon | `ReactNode` | Optional rendered icon, sized `L`. Without one, the row shows its position as a two-digit number (`01`, `02`, ...) |
32
+
33
+ ## Examples
34
+
35
+ ### Basic Usage
36
+
37
+ > Each row leads with its icon.
38
+
39
+ ```tsx
40
+ const items: UseCaseListItem[] = [
41
+ {
42
+ title: 'Caching and session store',
43
+ description:
44
+ 'Put Redis in front of a slower database, or hold session and token state that has to be read on every request.',
45
+ icon: <DatabaseIcon size="L" />
46
+ },
47
+ {
48
+ title: 'Real-time counters and leaderboards',
49
+ description:
50
+ 'Sorted sets and atomic counters handle ranking, rate limiting and quotas at write speed.',
51
+ icon: <LeaderboardsIcon size="L" />
52
+ },
53
+ {
54
+ title: 'Queues and streams between services',
55
+ description: 'Hand work between services with predictable latency instead of polling a table.',
56
+ icon: <NodesIcon size="L" />
57
+ }
58
+ ];
59
+
60
+ <UseCaseList items={items} style={{ width: '64rem' }} />
61
+ ```
62
+
63
+ ### Numbered
64
+
65
+ > Rows without an icon show their position as a two-digit number.
66
+
67
+ ```tsx
68
+ <UseCaseList items={items.map(({ title, description }) => ({ title, description }))} />
69
+ ```
70
+
71
+ ### Mixed
72
+
73
+ > Icons and numbers share one slot width, so the text of every row starts on the same line.
74
+
75
+ ```tsx
76
+ <UseCaseList
77
+ items={items.map(({ icon, ...item }, index) => (index === 1 ? item : { ...item, icon }))}
78
+ />
79
+ ```
80
+
81
+ ## Notes
82
+
83
+ - `icon` takes a rendered node, so both `@redis-ui/icons` icons and custom SVG components work. It inherits the secondary text color.
84
+ - The icon or number sits in a fixed slot as wide as an `L` icon, so the text of every row starts on the same line, even when only some rows have icons.
85
+ - Icons and numbers are decorative and hidden from assistive technology; the list semantics already announce each row's position.
86
+ - Put the section heading ("Use cases") on the page; the component renders only the list and fills the width it is given.