@redis-ui/components 51.23.0 → 51.25.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/Hero/components/Compose/Compose.style.cjs +7 -1
- package/dist/Hero/components/Compose/Compose.style.js +8 -2
- package/dist/LinkList/LinkList.cjs +8 -3
- package/dist/LinkList/LinkList.js +9 -4
- package/dist/LinkList/LinkList.style.cjs +11 -2
- package/dist/LinkList/LinkList.style.d.ts +1 -0
- package/dist/LinkList/LinkList.style.js +11 -3
- package/dist/LinkList/LinkList.types.d.ts +6 -0
- package/package.json +1 -1
- package/skills/redis-ui-components/references/Hero.md +1 -1
- package/skills/redis-ui-components/references/LinkList.md +48 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_Media_style = require("../Media/Media.style.cjs");
|
|
2
3
|
let styled_components = require("styled-components");
|
|
3
4
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
4
5
|
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
@@ -6,6 +7,11 @@ let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
|
6
7
|
var HeroContainer = styled_components.default.div.withConfig({
|
|
7
8
|
displayName: "Composestyle__HeroContainer",
|
|
8
9
|
componentId: "RedisUI__sc-126p7uz-0"
|
|
9
|
-
})([
|
|
10
|
+
})([
|
|
11
|
+
"display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:",
|
|
12
|
+
";align-items:start;@media ",
|
|
13
|
+
"{grid-template-columns:minmax(0,1fr);& > ",
|
|
14
|
+
"{order:-1;justify-items:start;padding-inline:0;}}"
|
|
15
|
+
], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space200, _redislabsdev_redis_ui_styles.media.laptop, require_Media_style.Media);
|
|
10
16
|
//#endregion
|
|
11
17
|
exports.HeroContainer = HeroContainer;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { Media } from "../Media/Media.style.js";
|
|
1
2
|
import _styled from "styled-components";
|
|
2
|
-
import { useTheme } from "@redis-ui/styles";
|
|
3
|
+
import { media, useTheme } from "@redis-ui/styles";
|
|
3
4
|
//#region src/Hero/components/Compose/Compose.style.ts
|
|
4
5
|
var HeroContainer = _styled.div.withConfig({
|
|
5
6
|
displayName: "Composestyle__HeroContainer",
|
|
6
7
|
componentId: "RedisUI__sc-126p7uz-0"
|
|
7
|
-
})([
|
|
8
|
+
})([
|
|
9
|
+
"display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:",
|
|
10
|
+
";align-items:start;@media ",
|
|
11
|
+
"{grid-template-columns:minmax(0,1fr);& > ",
|
|
12
|
+
"{order:-1;justify-items:start;padding-inline:0;}}"
|
|
13
|
+
], () => useTheme().core.space.space200, media.laptop, Media);
|
|
8
14
|
//#endregion
|
|
9
15
|
export { HeroContainer };
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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 = {
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ Every slot except `heading` is optional. A slot is skipped when its value is `nu
|
|
|
36
36
|
|
|
37
37
|
`Hero` is assembled with `Object.assign`; drop to these for full control. Each part spreads its own props, so any single slot can be restyled or rearranged.
|
|
38
38
|
|
|
39
|
-
- `Hero.Compose` - the two-column container: copy on the leading side, media on the trailing side
|
|
39
|
+
- `Hero.Compose` - the two-column container: copy on the leading side, media on the trailing side. Below the `laptop` breakpoint the columns stack with the media on top, left-aligned with the copy; the DOM order stays copy first.
|
|
40
40
|
- `Hero.Content` - the copy column. It spaces its children apart: wrap the heading and subtitle in one column `FlexGroup` and the details, actions and footnote in another, as the root does.
|
|
41
41
|
- `Hero.Heading` - the main claim (`h1` by default; pass `component` to change the level; wraps `Typography.Heading`).
|
|
42
42
|
- `Hero.Subtitle` - supporting copy (wraps `Typography.Body`).
|
|
@@ -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: '
|
|
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
|
```
|