@redis-ui/components 51.22.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.
- package/dist/LinkList/LinkList.cjs +2 -1
- package/dist/LinkList/LinkList.d.ts +1 -1
- package/dist/LinkList/LinkList.js +2 -1
- package/dist/LinkList/LinkList.style.cjs +9 -5
- package/dist/LinkList/LinkList.style.d.ts +4 -1
- package/dist/LinkList/LinkList.style.js +10 -6
- package/dist/LinkList/LinkList.types.d.ts +2 -0
- package/package.json +1 -1
- package/skills/redis-ui-components/references/LinkList.md +9 -0
|
@@ -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;
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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;
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
@@ -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.
|