@redis-ui/components 51.21.0 → 51.23.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.
@@ -35,7 +35,8 @@ var sizeTokenMaps = [
35
35
  require_css_utils.tokenMaps.borderRadius,
36
36
  require_css_utils.tokenMaps.padding,
37
37
  require_css_utils.tokenMaps.height,
38
- require_css_utils.tokenMaps.lineHeight
38
+ require_css_utils.tokenMaps.lineHeight,
39
+ require_css_utils.tokenMaps.gap
39
40
  ];
40
41
  var variantTokenMaps = [
41
42
  require_css_utils.tokenMaps.bgColor,
@@ -34,7 +34,8 @@ var sizeTokenMaps = [
34
34
  tokenMaps.borderRadius,
35
35
  tokenMaps.padding,
36
36
  tokenMaps.height,
37
- tokenMaps.lineHeight
37
+ tokenMaps.lineHeight,
38
+ tokenMaps.gap
38
39
  ];
39
40
  var variantTokenMaps = [
40
41
  tokenMaps.bgColor,
@@ -21,9 +21,10 @@ var getRowProps = ({ href, onClick }) => {
21
21
  };
22
22
  return { as: "div" };
23
23
  };
24
- var LinkList = ({ title, items, titleComponent = "h2", ...restProps }) => {
24
+ var LinkList = ({ title, items, titleComponent = "h2", variant = "bordered", ...restProps }) => {
25
25
  const titleId = require_index.useId();
26
26
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_LinkList_style.LinkList, {
27
+ $variant: variant,
27
28
  ...restProps,
28
29
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.default.Heading, {
29
30
  component: titleComponent,
@@ -1,3 +1,3 @@
1
1
  import { LinkListProps } from './LinkList.types';
2
- declare const LinkList: ({ title, items, titleComponent, ...restProps }: LinkListProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const LinkList: ({ title, items, titleComponent, variant, ...restProps }: LinkListProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default LinkList;
@@ -21,9 +21,10 @@ var getRowProps = ({ href, onClick }) => {
21
21
  };
22
22
  return { as: "div" };
23
23
  };
24
- var LinkList = ({ title, items, titleComponent = "h2", ...restProps }) => {
24
+ var LinkList = ({ title, items, titleComponent = "h2", variant = "bordered", ...restProps }) => {
25
25
  const titleId = useId();
26
26
  return /* @__PURE__ */ jsxs(LinkList$1, {
27
+ $variant: variant,
27
28
  ...restProps,
28
29
  children: [/* @__PURE__ */ jsx(Typography.Heading, {
29
30
  component: titleComponent,
@@ -9,11 +9,15 @@ var LinkList = styled_components.default.div.withConfig({
9
9
  componentId: "RedisUI__sc-16e9e4l-0"
10
10
  })([
11
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);
12
+ ";min-width:0;",
13
+ ""
14
+ ], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space150, ({ $variant }) => {
15
+ const { core, components } = (0, _redislabsdev_redis_ui_styles.useTheme)();
16
+ return $variant === "bordered" && styled_components.css`
17
+ padding-left: ${core.space.space300};
18
+ border-left: ${core.space.space010} solid ${components.card.variants.primary.borderColor};
19
+ `;
20
+ });
17
21
  var LinkListItems = styled_components.default.ul.withConfig({
18
22
  displayName: "LinkListstyle__LinkListItems",
19
23
  componentId: "RedisUI__sc-16e9e4l-1"
@@ -1,4 +1,7 @@
1
- export declare const LinkList: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ import { LinkListVariant } from './LinkList.types';
2
+ export declare const LinkList: import("styled-components").StyledComponent<"div", any, {
3
+ $variant: LinkListVariant;
4
+ }, never>;
2
5
  export declare const LinkListItems: import("styled-components").StyledComponent<"ul", any, {}, never>;
3
6
  export declare const LinkListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
4
7
  export declare const LinkListIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -1,5 +1,5 @@
1
1
  import Typography from "../Typography/Typography.js";
2
- import _styled from "styled-components";
2
+ import _styled, { css } from "styled-components";
3
3
  import { getFocusStyle, useTheme } from "@redis-ui/styles";
4
4
  //#region src/LinkList/LinkList.style.ts
5
5
  var LinkList = _styled.div.withConfig({
@@ -7,11 +7,15 @@ var LinkList = _styled.div.withConfig({
7
7
  componentId: "RedisUI__sc-16e9e4l-0"
8
8
  })([
9
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);
10
+ ";min-width:0;",
11
+ ""
12
+ ], () => useTheme().core.space.space150, ({ $variant }) => {
13
+ const { core, components } = useTheme();
14
+ return $variant === "bordered" && css`
15
+ padding-left: ${core.space.space300};
16
+ border-left: ${core.space.space010} solid ${components.card.variants.primary.borderColor};
17
+ `;
18
+ });
15
19
  var LinkListItems = _styled.ul.withConfig({
16
20
  displayName: "LinkListstyle__LinkListItems",
17
21
  componentId: "RedisUI__sc-16e9e4l-1"
@@ -13,8 +13,10 @@ export type LinkListItem = {
13
13
  /** Adds a divider above the row */
14
14
  separated?: boolean;
15
15
  };
16
+ export type LinkListVariant = 'bordered' | 'plain';
16
17
  export type OwnLinkListProps = {
17
18
  title: ReactNode;
19
+ variant?: LinkListVariant;
18
20
  items: LinkListItem[];
19
21
  titleComponent?: Extract<TypographyHeadingComponent, 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;
20
22
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@redis-ui/components",
3
3
  "license": "UNLICENSED",
4
- "version": "51.21.0",
4
+ "version": "51.23.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.26.0",
33
+ "@redis-ui/styles": "^21.28.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"
@@ -21,6 +21,7 @@ import { CliIcon, ContractsIcon, DatabaseIcon, RedisClientIcon, StarsIcon } from
21
21
  | title | `ReactNode` | required | Heading rendered above the list. It also labels the list |
22
22
  | items | `LinkListItem[]` | required | Rows to render |
23
23
  | titleComponent | `'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6'` | `'h2'` | Heading level of the title |
24
+ | variant | `'bordered' \| 'plain'` | `'bordered'` | `plain` drops the left border and its padding |
24
25
 
25
26
  The component also extends `React.HTMLAttributes<HTMLDivElement>` (except `title`), passed to the container.
26
27
 
@@ -79,6 +80,14 @@ const items: LinkListItem[] = [
79
80
  <LinkList title="Resources" items={items} titleComponent="h2" style={{ width: '28rem' }} />
80
81
  ```
81
82
 
83
+ ### Plain
84
+
85
+ > `variant="plain"` drops the left border, for layouts such as mobile where the list stacks under the content.
86
+
87
+ ```tsx
88
+ <LinkList title="Resources" items={items} variant="plain" />
89
+ ```
90
+
82
91
  ### Minimal
83
92
 
84
93
  > Rows without an icon or meta line. A row without `href` or `onClick` renders as static text.