@redis-ui/components 51.19.0 → 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.
@@ -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;
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
@@ -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, 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 };
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.19.0",
4
+ "version": "51.20.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": "git@github.com:redislabsdev/redis-ui.git",
@@ -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)
@@ -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.