@redis-ui/components 51.22.0 → 51.24.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,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
- })(["display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:", ";align-items:start;@media (max-width:75rem){grid-template-columns:minmax(0,1fr);}"], () => (0, _redislabsdev_redis_ui_styles.useTheme)().core.space.space200);
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
- })(["display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:", ";align-items:start;@media (max-width:75rem){grid-template-columns:minmax(0,1fr);}"], () => useTheme().core.space.space200);
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 };
@@ -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.22.0",
4
+ "version": "51.24.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": "git@github.com:redislabsdev/redis-ui.git",
@@ -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, stacking on narrow viewports.
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`).
@@ -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.