@redis-ui/components 41.3.2 → 41.4.1

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.
Files changed (96) hide show
  1. package/dist/AppSelectionMenu/components/Item/Item.styles.d.ts +1 -1
  2. package/dist/Banner/components/Message/Message.style.d.ts +2 -1
  3. package/dist/Checkbox/components/Label/Label.style.d.ts +2 -1
  4. package/dist/ChipList/Components/ExtraItem.style.d.ts +2 -1
  5. package/dist/Drawer/components/Description/components/Text/Text.style.d.ts +2 -1
  6. package/dist/Drawer/components/Header/components/Title/Title.style.d.ts +2 -1
  7. package/dist/FormField/components/AdditionalText/AdditionalText.style.d.ts +2 -1
  8. package/dist/Inputs/Input/Input.d.ts +1 -1
  9. package/dist/Inputs/NumericInput/NumericInput.d.ts +1 -1
  10. package/dist/Inputs/QuantityCounter/QuantityCounter.d.ts +1 -1
  11. package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.style.d.ts +2 -1
  12. package/dist/Inputs/TextArea/TextArea.d.ts +1 -1
  13. package/dist/Inputs/TextArea/components/Compose/Compose.style.d.ts +1 -1
  14. package/dist/Inputs/components/Compose/Compose.style.d.ts +2 -1
  15. package/dist/Inputs/components/InputTag/InputTag.style.cjs +1 -1
  16. package/dist/Inputs/components/InputTag/InputTag.style.js +1 -1
  17. package/dist/Label/components/Optional/Optional.style.d.ts +2 -1
  18. package/dist/Label/components/Required/Required.style.d.ts +2 -1
  19. package/dist/Label/components/Text/Text.style.d.ts +2 -1
  20. package/dist/Link/Link.style.d.ts +2 -1
  21. package/dist/Menu/components/Content/components/Item/Components/SubHead/SubHead.style.d.ts +2 -1
  22. package/dist/Menu/components/Content/components/Label/components/Text/Text.style.d.ts +2 -1
  23. package/dist/Modal/components/Content/components/Body/components/Text/Text.style.d.ts +2 -1
  24. package/dist/Modal/components/Content/components/Description/components/Text/Text.style.d.ts +2 -1
  25. package/dist/Modal/components/Content/components/Header/components/Title/Title.style.d.ts +2 -1
  26. package/dist/Pagination/Pagination.d.ts +3 -2
  27. package/dist/Popover/Popover.d.ts +2 -2
  28. package/dist/Popover/components/Content/Content.d.ts +1 -1
  29. package/dist/Popover/components/Content/components/Body/components/BodyText/BodyText.styles.d.ts +2 -1
  30. package/dist/Popover/components/Content/components/Header/components/HeaderTitle/HeaderTitle.styles.d.ts +2 -1
  31. package/dist/Popover/components/Content/components/Text/Text.styles.d.ts +2 -1
  32. package/dist/Popover/components/Content/components/WindowBar/WindowBar.d.ts +1 -1
  33. package/dist/Popover/components/Content/components/WindowBar/WindowBar.style.d.ts +2 -1
  34. package/dist/Popover/components/PopoverCard/PopoverCard.d.ts +1 -1
  35. package/dist/ProfileIcon/ProfileIcon.style.cjs +2 -2
  36. package/dist/ProfileIcon/ProfileIcon.style.js +2 -2
  37. package/dist/ProgressBar/ProgressBar.styles.d.ts +1 -1
  38. package/dist/Section/components/Header/components/CategoryValueList/CategoryValueList.style.d.ts +2 -1
  39. package/dist/Section/components/Header/components/CategoryValueList/components/CategoryValueChip/CategoryValueChip.style.d.ts +3 -2
  40. package/dist/Section/components/Header/components/Label/Label.style.d.ts +2 -1
  41. package/dist/Select/components/Trigger/components/Compose/Compose.style.cjs +1 -1
  42. package/dist/Select/components/Trigger/components/Compose/Compose.style.js +1 -1
  43. package/dist/SideBar/components/Footer/components/Text/Text.style.d.ts +2 -1
  44. package/dist/SideBar/components/Item/components/Text/Text.style.d.ts +2 -1
  45. package/dist/Stepper/components/Step/components/Label/Label.style.d.ts +2 -1
  46. package/dist/Stepper/components/Step/components/Label/Label.types.d.ts +2 -3
  47. package/dist/Switch/components/Title/Title.style.d.ts +2 -1
  48. package/dist/Switch/components/Title/Title.types.d.ts +4 -4
  49. package/dist/TableHeading/TableHeading.style.cjs +1 -1
  50. package/dist/TableHeading/TableHeading.style.js +1 -1
  51. package/dist/Tabs/components/TabBar/utils/theme.utils.d.ts +3 -3
  52. package/dist/Toast/components/Content/components/Description/Description.style.d.ts +2 -1
  53. package/dist/Toast/components/Content/components/Message/Message.style.d.ts +2 -1
  54. package/dist/Tooltip/components/Content/components/Text/Text.styles.d.ts +2 -1
  55. package/dist/TreeView/components/TreeItem/components/Checkbox/Checkbox.style.d.ts +2 -1
  56. package/dist/Typography/Typography.cjs +3 -1
  57. package/dist/Typography/Typography.d.ts +5 -3
  58. package/dist/Typography/Typography.js +8 -6
  59. package/dist/Typography/components/Base/Base.cjs +18 -0
  60. package/dist/Typography/components/Base/Base.d.ts +4 -0
  61. package/dist/Typography/components/Base/Base.js +18 -0
  62. package/dist/Typography/components/Base/Base.style.cjs +16 -0
  63. package/dist/Typography/components/Base/Base.style.d.ts +3 -0
  64. package/dist/Typography/components/Base/Base.style.js +14 -0
  65. package/dist/Typography/components/Base/Base.types.d.ts +7 -0
  66. package/dist/Typography/components/Body/Body.cjs +11 -12
  67. package/dist/Typography/components/Body/Body.d.ts +3 -2
  68. package/dist/Typography/components/Body/Body.js +12 -13
  69. package/dist/Typography/components/Body/Body.style.cjs +5 -10
  70. package/dist/Typography/components/Body/Body.style.d.ts +2 -3
  71. package/dist/Typography/components/Body/Body.style.js +5 -10
  72. package/dist/Typography/components/Body/Body.types.d.ts +2 -5
  73. package/dist/Typography/components/Code/Code.cjs +11 -11
  74. package/dist/Typography/components/Code/Code.d.ts +3 -2
  75. package/dist/Typography/components/Code/Code.js +12 -12
  76. package/dist/Typography/components/Code/Code.style.cjs +5 -10
  77. package/dist/Typography/components/Code/Code.style.d.ts +1 -2
  78. package/dist/Typography/components/Code/Code.style.js +5 -10
  79. package/dist/Typography/components/Code/Code.types.d.ts +2 -5
  80. package/dist/Typography/components/Heading/Heading.cjs +11 -20
  81. package/dist/Typography/components/Heading/Heading.d.ts +3 -2
  82. package/dist/Typography/components/Heading/Heading.js +11 -20
  83. package/dist/Typography/components/Heading/Heading.style.cjs +4 -10
  84. package/dist/Typography/components/Heading/Heading.style.d.ts +2 -2
  85. package/dist/Typography/components/Heading/Heading.style.js +4 -10
  86. package/dist/Typography/components/Heading/Heading.types.d.ts +2 -5
  87. package/dist/Typography/components/Heading/Heading.utils.cjs +12 -0
  88. package/dist/Typography/components/Heading/Heading.utils.d.ts +2 -0
  89. package/dist/Typography/components/Heading/Heading.utils.js +12 -0
  90. package/dist/Typography/hooks/useEllipsisTooltip.cjs +7 -4
  91. package/dist/Typography/hooks/useEllipsisTooltip.d.ts +3 -8
  92. package/dist/Typography/hooks/useEllipsisTooltip.js +7 -4
  93. package/dist/Typography/index.d.ts +1 -0
  94. package/dist/packages/icons/dist/multicolor/LoaderLarge.cjs +1 -1
  95. package/dist/packages/icons/dist/multicolor/LoaderLarge.js +1 -1
  96. package/package.json +3 -3
@@ -1,10 +1,12 @@
1
- import Heading from "./components/Heading/Heading.js";
2
- import Body from "./components/Body/Body.js";
3
- import Code from "./components/Code/Code.js";
1
+ import TypographyHeading from "./components/Heading/Heading.js";
2
+ import TypographyBody from "./components/Body/Body.js";
3
+ import TypographyCode from "./components/Code/Code.js";
4
+ import TypographyBase from "./components/Base/Base.js";
4
5
  const Typography = {
5
- Heading,
6
- Body,
7
- Code
6
+ Heading: TypographyHeading,
7
+ Body: TypographyBody,
8
+ Code: TypographyCode,
9
+ Base: TypographyBase
8
10
  };
9
11
  const Typography$1 = Typography;
10
12
  export {
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
+ const React = require("react");
5
+ const useEllipsisTooltip = require("../../hooks/useEllipsisTooltip.cjs");
6
+ const Base_style = require("./Base.style.cjs");
7
+ const TypographyBase = React.forwardRef(({
8
+ component,
9
+ ellipsis = false,
10
+ ...restProps
11
+ }, ref) => jsxRuntime.jsxRuntimeExports.jsx(Base_style.TypographyBase, {
12
+ as: component,
13
+ "$ellipsis": ellipsis,
14
+ ...restProps,
15
+ ...useEllipsisTooltip.useEllipsisTooltip(restProps, ref)
16
+ }));
17
+ TypographyBase.displayName = "TypographyBase";
18
+ exports.default = TypographyBase;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TypographyBaseProps } from './Base.types';
3
+ declare const TypographyBase: import("react").ForwardRefExoticComponent<TypographyBaseProps & import("react").RefAttributes<HTMLElement>>;
4
+ export default TypographyBase;
@@ -0,0 +1,18 @@
1
+ import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
+ import { forwardRef } from "react";
3
+ import { useEllipsisTooltip } from "../../hooks/useEllipsisTooltip.js";
4
+ import { TypographyBase as TypographyBase$1 } from "./Base.style.js";
5
+ const TypographyBase = forwardRef(({
6
+ component,
7
+ ellipsis = false,
8
+ ...restProps
9
+ }, ref) => jsxRuntimeExports.jsx(TypographyBase$1, {
10
+ as: component,
11
+ "$ellipsis": ellipsis,
12
+ ...restProps,
13
+ ...useEllipsisTooltip(restProps, ref)
14
+ }));
15
+ TypographyBase.displayName = "TypographyBase";
16
+ export {
17
+ TypographyBase as default
18
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _styled = require("styled-components");
4
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
5
+ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
6
+ const TypographyBase = _styled__default.default.span.withConfig({
7
+ displayName: "Basestyle__TypographyBase",
8
+ componentId: "RedisUI__sc-1tw1hj6-0"
9
+ })(["margin-block:0;", ""], ({
10
+ $ellipsis
11
+ }) => $ellipsis && _styled.css`
12
+ overflow: hidden;
13
+ text-overflow: ellipsis;
14
+ white-space: nowrap;
15
+ `);
16
+ exports.TypographyBase = TypographyBase;
@@ -0,0 +1,3 @@
1
+ export declare const TypographyBase: import("styled-components").StyledComponent<"span", any, {
2
+ $ellipsis?: boolean | undefined;
3
+ }, never>;
@@ -0,0 +1,14 @@
1
+ import _styled, { css } from "styled-components";
2
+ const TypographyBase = _styled.span.withConfig({
3
+ displayName: "Basestyle__TypographyBase",
4
+ componentId: "RedisUI__sc-1tw1hj6-0"
5
+ })(["margin-block:0;", ""], ({
6
+ $ellipsis
7
+ }) => $ellipsis && css`
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ white-space: nowrap;
11
+ `);
12
+ export {
13
+ TypographyBase
14
+ };
@@ -0,0 +1,7 @@
1
+ import React, { ComponentType, HTMLAttributes } from 'react';
2
+ import { EllipsisTooltipParams } from '../../hooks/useEllipsisTooltip';
3
+ export interface TypographyBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'color'>, Pick<EllipsisTooltipParams, 'tooltipOnEllipsis'> {
4
+ children: React.ReactNode;
5
+ component?: string | ComponentType;
6
+ ellipsis?: boolean;
7
+ }
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
- const useEllipsisTooltip = require("../../hooks/useEllipsisTooltip.cjs");
4
+ const React = require("react");
5
5
  const Body_style = require("./Body.style.cjs");
6
- const Body = ({
6
+ const TypographyBody = React.forwardRef(({
7
7
  size,
8
8
  variant,
9
9
  color,
10
10
  component,
11
- ellipsis = false,
12
11
  ...restProps
13
- }) => jsxRuntime.jsxRuntimeExports.jsx(Body_style.Body, {
14
- as: component || "p",
15
- "$size": size || "M",
12
+ }, ref) => jsxRuntime.jsxRuntimeExports.jsx(Body_style.TypographyBody, {
13
+ ref,
14
+ component: component || "p",
15
+ "$size": size,
16
16
  "$color": color,
17
- "$variant": variant || "regular",
18
- "$ellipsis": ellipsis,
19
- ...restProps,
20
- ...useEllipsisTooltip.useEllipsisTooltip(restProps)
21
- });
22
- exports.default = Body;
17
+ "$variant": variant,
18
+ ...restProps
19
+ }));
20
+ TypographyBody.displayName = "TypographyBody";
21
+ exports.default = TypographyBody;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { TypographyBodyProps } from './Body.types';
2
- declare const Body: ({ size, variant, color, component, ellipsis, ...restProps }: TypographyBodyProps) => import("react/jsx-runtime").JSX.Element;
3
- export default Body;
3
+ declare const TypographyBody: import("react").ForwardRefExoticComponent<TypographyBodyProps & import("react").RefAttributes<HTMLElement>>;
4
+ export default TypographyBody;
@@ -1,22 +1,21 @@
1
1
  import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
- import { useEllipsisTooltip } from "../../hooks/useEllipsisTooltip.js";
3
- import { Body as Body$1 } from "./Body.style.js";
4
- const Body = ({
2
+ import { forwardRef } from "react";
3
+ import { TypographyBody as TypographyBody$1 } from "./Body.style.js";
4
+ const TypographyBody = forwardRef(({
5
5
  size,
6
6
  variant,
7
7
  color,
8
8
  component,
9
- ellipsis = false,
10
9
  ...restProps
11
- }) => jsxRuntimeExports.jsx(Body$1, {
12
- as: component || "p",
13
- "$size": size || "M",
10
+ }, ref) => jsxRuntimeExports.jsx(TypographyBody$1, {
11
+ ref,
12
+ component: component || "p",
13
+ "$size": size,
14
14
  "$color": color,
15
- "$variant": variant || "regular",
16
- "$ellipsis": ellipsis,
17
- ...restProps,
18
- ...useEllipsisTooltip(restProps)
19
- });
15
+ "$variant": variant,
16
+ ...restProps
17
+ }));
18
+ TypographyBody.displayName = "TypographyBody";
20
19
  export {
21
- Body as default
20
+ TypographyBody as default
22
21
  };
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const _styled = require("styled-components");
4
4
  const redisUiStyles = require("@redislabsdev/redis-ui-styles");
5
+ const Base = require("../Base/Base.cjs");
5
6
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
6
7
  const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
8
  const useBodyStyles = ({
8
9
  $size = "M",
9
10
  $variant = "regular",
10
- $ellipsis,
11
11
  $color
12
12
  } = {}) => {
13
13
  const theme = redisUiStyles.useTheme();
@@ -18,16 +18,11 @@ const useBodyStyles = ({
18
18
  font-weight: ${bodyTheme.fontWeight[$variant]};
19
19
  font-style: ${bodyTheme.fontStyle[$variant]};
20
20
  color: ${$color && theme.components.typography.colors[$color] || "unset"};
21
- ${$ellipsis && _styled.css`
22
- overflow: hidden;
23
- text-overflow: ellipsis;
24
- white-space: nowrap;
25
- `}
26
21
  `;
27
22
  };
28
- const Body = _styled__default.default.span.withConfig({
29
- displayName: "Bodystyle__Body",
23
+ const TypographyBody = _styled__default.default(Base.default).withConfig({
24
+ displayName: "Bodystyle__TypographyBody",
30
25
  componentId: "RedisUI__sc-1y8s1er-0"
31
- })(["margin-block:0;", ""], useBodyStyles);
32
- exports.Body = Body;
26
+ })(["", ""], useBodyStyles);
27
+ exports.TypographyBody = TypographyBody;
33
28
  exports.useBodyStyles = useBodyStyles;
@@ -3,8 +3,7 @@ import { TypographyBodyProps } from './Body.types';
3
3
  export interface MapProps extends HTMLAttributes<HTMLElement> {
4
4
  $size?: TypographyBodyProps['size'];
5
5
  $variant?: TypographyBodyProps['variant'];
6
- $ellipsis?: boolean;
7
6
  $color?: TypographyBodyProps['color'];
8
7
  }
9
- export declare const useBodyStyles: ({ $size, $variant, $ellipsis, $color }?: MapProps) => import("styled-components").FlattenSimpleInterpolation;
10
- export declare const Body: import("styled-components").StyledComponent<"span", any, MapProps, never>;
8
+ export declare const useBodyStyles: ({ $size, $variant, $color }?: MapProps) => import("styled-components").FlattenSimpleInterpolation;
9
+ export declare const TypographyBody: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../..").TypographyBaseProps & import("react").RefAttributes<HTMLElement>>, any, MapProps, never>;
@@ -1,9 +1,9 @@
1
1
  import _styled, { css } from "styled-components";
2
2
  import { useTheme } from "@redislabsdev/redis-ui-styles";
3
+ import TypographyBase from "../Base/Base.js";
3
4
  const useBodyStyles = ({
4
5
  $size = "M",
5
6
  $variant = "regular",
6
- $ellipsis,
7
7
  $color
8
8
  } = {}) => {
9
9
  const theme = useTheme();
@@ -14,18 +14,13 @@ const useBodyStyles = ({
14
14
  font-weight: ${bodyTheme.fontWeight[$variant]};
15
15
  font-style: ${bodyTheme.fontStyle[$variant]};
16
16
  color: ${$color && theme.components.typography.colors[$color] || "unset"};
17
- ${$ellipsis && css`
18
- overflow: hidden;
19
- text-overflow: ellipsis;
20
- white-space: nowrap;
21
- `}
22
17
  `;
23
18
  };
24
- const Body = _styled.span.withConfig({
25
- displayName: "Bodystyle__Body",
19
+ const TypographyBody = _styled(TypographyBase).withConfig({
20
+ displayName: "Bodystyle__TypographyBody",
26
21
  componentId: "RedisUI__sc-1y8s1er-0"
27
- })(["margin-block:0;", ""], useBodyStyles);
22
+ })(["", ""], useBodyStyles);
28
23
  export {
29
- Body,
24
+ TypographyBody,
30
25
  useBodyStyles
31
26
  };
@@ -1,14 +1,11 @@
1
- import React, { HTMLAttributes } from 'react';
2
- import { EllipsisTooltipParams } from '../../hooks/useEllipsisTooltip';
3
1
  import { TypographyColor } from '../../Typography.types';
2
+ import { TypographyBaseProps } from '../Base/Base.types';
4
3
  export type TypographyBodySize = 'XL' | 'L' | 'M' | 'S' | 'XS' | 'auto';
5
4
  export type TypographyBodyVariant = 'regular' | 'semiBold' | 'italic';
6
5
  export type TypographyBodyComponent = 'p' | 'span' | 'div';
7
- export interface TypographyBodyProps extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'color'>, Pick<EllipsisTooltipParams, 'tooltipOnEllipsis'> {
8
- children: React.ReactNode;
6
+ export interface TypographyBodyProps extends TypographyBaseProps {
9
7
  component?: TypographyBodyComponent;
10
8
  size?: TypographyBodySize;
11
9
  variant?: TypographyBodyVariant;
12
- ellipsis?: boolean;
13
10
  color?: TypographyColor;
14
11
  }
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
- const useEllipsisTooltip = require("../../hooks/useEllipsisTooltip.cjs");
4
+ const React = require("react");
5
5
  const Code_style = require("./Code.style.cjs");
6
- const Code = ({
6
+ const TypographyCode = React.forwardRef(({
7
7
  size,
8
8
  variant,
9
9
  color,
10
- ellipsis = false,
11
10
  ...restProps
12
- }) => jsxRuntime.jsxRuntimeExports.jsx(Code_style.Code, {
13
- "$size": size || "L",
14
- "$variant": variant || "regular",
15
- "$color": color,
16
- "$ellipsis": ellipsis,
11
+ }, ref) => jsxRuntime.jsxRuntimeExports.jsx(Code_style.TypographyCode, {
12
+ ref,
17
13
  ...restProps,
18
- ...useEllipsisTooltip.useEllipsisTooltip(restProps)
19
- });
20
- exports.default = Code;
14
+ "$size": size,
15
+ "$variant": variant,
16
+ "$color": color,
17
+ component: "code"
18
+ }));
19
+ TypographyCode.displayName = "TypographyCode";
20
+ exports.default = TypographyCode;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { TypographyCodeProps } from './Code.types';
2
- declare const Code: ({ size, variant, color, ellipsis, ...restProps }: TypographyCodeProps) => import("react/jsx-runtime").JSX.Element;
3
- export default Code;
3
+ declare const TypographyCode: import("react").ForwardRefExoticComponent<TypographyCodeProps & import("react").RefAttributes<HTMLElement>>;
4
+ export default TypographyCode;
@@ -1,20 +1,20 @@
1
1
  import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
- import { useEllipsisTooltip } from "../../hooks/useEllipsisTooltip.js";
3
- import { Code as Code$1 } from "./Code.style.js";
4
- const Code = ({
2
+ import { forwardRef } from "react";
3
+ import { TypographyCode as TypographyCode$1 } from "./Code.style.js";
4
+ const TypographyCode = forwardRef(({
5
5
  size,
6
6
  variant,
7
7
  color,
8
- ellipsis = false,
9
8
  ...restProps
10
- }) => jsxRuntimeExports.jsx(Code$1, {
11
- "$size": size || "L",
12
- "$variant": variant || "regular",
13
- "$color": color,
14
- "$ellipsis": ellipsis,
9
+ }, ref) => jsxRuntimeExports.jsx(TypographyCode$1, {
10
+ ref,
15
11
  ...restProps,
16
- ...useEllipsisTooltip(restProps)
17
- });
12
+ "$size": size,
13
+ "$variant": variant,
14
+ "$color": color,
15
+ component: "code"
16
+ }));
17
+ TypographyCode.displayName = "TypographyCode";
18
18
  export {
19
- Code as default
19
+ TypographyCode as default
20
20
  };
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const _styled = require("styled-components");
4
4
  const redisUiStyles = require("@redislabsdev/redis-ui-styles");
5
+ const Base = require("../Base/Base.cjs");
5
6
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
6
7
  const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
8
  const useCodeStyles = ({
8
- $size = "M",
9
+ $size = "L",
9
10
  $variant = "regular",
10
- $ellipsis,
11
11
  $color
12
12
  } = {}) => {
13
13
  const theme = redisUiStyles.useTheme();
@@ -17,15 +17,10 @@ const useCodeStyles = ({
17
17
  font-size: ${codeTheme.fontSizes[$size]};
18
18
  font-weight: ${codeTheme.fontWeight[$variant]};
19
19
  color: ${$color && theme.components.typography.colors[$color] || "unset"};
20
- ${$ellipsis && _styled.css`
21
- overflow: hidden;
22
- text-overflow: ellipsis;
23
- white-space: nowrap;
24
- `}
25
20
  `;
26
21
  };
27
- const Code = _styled__default.default.code.withConfig({
28
- displayName: "Codestyle__Code",
22
+ const TypographyCode = _styled__default.default(Base.default).withConfig({
23
+ displayName: "Codestyle__TypographyCode",
29
24
  componentId: "RedisUI__sc-1babmep-0"
30
25
  })(["", ""], useCodeStyles);
31
- exports.Code = Code;
26
+ exports.TypographyCode = TypographyCode;
@@ -3,7 +3,6 @@ import { TypographyCodeProps } from './Code.types';
3
3
  export interface MapProps extends HTMLAttributes<HTMLElement> {
4
4
  $size?: TypographyCodeProps['size'];
5
5
  $variant?: TypographyCodeProps['variant'];
6
- $ellipsis?: boolean;
7
6
  $color?: TypographyCodeProps['color'];
8
7
  }
9
- export declare const Code: import("styled-components").StyledComponent<"code", any, MapProps, never>;
8
+ export declare const TypographyCode: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../..").TypographyBaseProps & import("react").RefAttributes<HTMLElement>>, any, MapProps, never>;
@@ -1,9 +1,9 @@
1
1
  import _styled, { css } from "styled-components";
2
2
  import { useTheme } from "@redislabsdev/redis-ui-styles";
3
+ import TypographyBase from "../Base/Base.js";
3
4
  const useCodeStyles = ({
4
- $size = "M",
5
+ $size = "L",
5
6
  $variant = "regular",
6
- $ellipsis,
7
7
  $color
8
8
  } = {}) => {
9
9
  const theme = useTheme();
@@ -13,17 +13,12 @@ const useCodeStyles = ({
13
13
  font-size: ${codeTheme.fontSizes[$size]};
14
14
  font-weight: ${codeTheme.fontWeight[$variant]};
15
15
  color: ${$color && theme.components.typography.colors[$color] || "unset"};
16
- ${$ellipsis && css`
17
- overflow: hidden;
18
- text-overflow: ellipsis;
19
- white-space: nowrap;
20
- `}
21
16
  `;
22
17
  };
23
- const Code = _styled.code.withConfig({
24
- displayName: "Codestyle__Code",
18
+ const TypographyCode = _styled(TypographyBase).withConfig({
19
+ displayName: "Codestyle__TypographyCode",
25
20
  componentId: "RedisUI__sc-1babmep-0"
26
21
  })(["", ""], useCodeStyles);
27
22
  export {
28
- Code
23
+ TypographyCode
29
24
  };
@@ -1,12 +1,9 @@
1
- import React from 'react';
2
- import { EllipsisTooltipParams } from '../../hooks/useEllipsisTooltip';
3
1
  import { TypographyColor } from '../../Typography.types';
2
+ import { TypographyBaseProps } from '../Base/Base.types';
4
3
  export type TypographyCodeSize = 'S' | 'M' | 'L';
5
4
  export type TypographyCodeVariant = 'regular' | 'semiBold';
6
- export interface TypographyCodeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'color'>, Pick<EllipsisTooltipParams, 'tooltipOnEllipsis'> {
7
- children: React.ReactNode;
5
+ export interface TypographyCodeProps extends Omit<TypographyBaseProps, 'component'> {
8
6
  size?: TypographyCodeSize;
9
7
  variant?: TypographyCodeVariant;
10
- ellipsis?: boolean;
11
8
  color?: TypographyColor;
12
9
  }
@@ -1,33 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
- const useEllipsisTooltip = require("../../hooks/useEllipsisTooltip.cjs");
4
+ const React = require("react");
5
+ const Heading_utils = require("./Heading.utils.cjs");
5
6
  const Heading_style = require("./Heading.style.cjs");
6
- const level = {
7
- XXL: "1",
8
- XL: "2",
9
- L: "3",
10
- M: "4",
11
- S: "5",
12
- XS: "6"
13
- };
14
- const getHeadingLevel = (size, component) => typeof component === "string" && !Number.isNaN(+component[1]) && +component[1] && component[1] || level[size];
15
- const Heading = ({
7
+ const TypographyHeading = React.forwardRef(({
16
8
  size = "XL",
17
- ellipsis = false,
18
9
  color,
19
10
  variant,
20
11
  component = "div",
21
12
  ...restProps
22
- }) => jsxRuntime.jsxRuntimeExports.jsx(Heading_style.Heading, {
23
- as: component,
24
- "$ellipsis": ellipsis,
13
+ }, ref) => jsxRuntime.jsxRuntimeExports.jsx(Heading_style.TypographyHeading, {
14
+ ref,
15
+ component,
25
16
  "$size": size,
26
17
  "$color": color,
27
18
  "$variant": variant,
28
19
  "data-role": "heading",
29
- "data-heading-level": getHeadingLevel(size, component),
30
- ...restProps,
31
- ...useEllipsisTooltip.useEllipsisTooltip(restProps)
32
- });
33
- exports.default = Heading;
20
+ "data-heading-level": Heading_utils.getHeadingLevel(size, component),
21
+ ...restProps
22
+ }));
23
+ TypographyHeading.displayName = "TypographyHeading";
24
+ exports.default = TypographyHeading;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { TypographyHeadingProps } from './Heading.types';
2
- declare const Heading: ({ size, ellipsis, color, variant, component, ...restProps }: TypographyHeadingProps) => import("react/jsx-runtime").JSX.Element;
3
- export default Heading;
3
+ declare const TypographyHeading: import("react").ForwardRefExoticComponent<TypographyHeadingProps & import("react").RefAttributes<HTMLElement>>;
4
+ export default TypographyHeading;
@@ -1,33 +1,24 @@
1
1
  import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
- import { useEllipsisTooltip } from "../../hooks/useEllipsisTooltip.js";
3
- import { Heading as Heading$1 } from "./Heading.style.js";
4
- const level = {
5
- XXL: "1",
6
- XL: "2",
7
- L: "3",
8
- M: "4",
9
- S: "5",
10
- XS: "6"
11
- };
12
- const getHeadingLevel = (size, component) => typeof component === "string" && !Number.isNaN(+component[1]) && +component[1] && component[1] || level[size];
13
- const Heading = ({
2
+ import { forwardRef } from "react";
3
+ import { getHeadingLevel } from "./Heading.utils.js";
4
+ import { TypographyHeading as TypographyHeading$1 } from "./Heading.style.js";
5
+ const TypographyHeading = forwardRef(({
14
6
  size = "XL",
15
- ellipsis = false,
16
7
  color,
17
8
  variant,
18
9
  component = "div",
19
10
  ...restProps
20
- }) => jsxRuntimeExports.jsx(Heading$1, {
21
- as: component,
22
- "$ellipsis": ellipsis,
11
+ }, ref) => jsxRuntimeExports.jsx(TypographyHeading$1, {
12
+ ref,
13
+ component,
23
14
  "$size": size,
24
15
  "$color": color,
25
16
  "$variant": variant,
26
17
  "data-role": "heading",
27
18
  "data-heading-level": getHeadingLevel(size, component),
28
- ...restProps,
29
- ...useEllipsisTooltip(restProps)
30
- });
19
+ ...restProps
20
+ }));
21
+ TypographyHeading.displayName = "TypographyHeading";
31
22
  export {
32
- Heading as default
23
+ TypographyHeading as default
33
24
  };
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const _styled = require("styled-components");
4
4
  const redisUiStyles = require("@redislabsdev/redis-ui-styles");
5
+ const Base = require("../Base/Base.cjs");
5
6
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
6
7
  const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
- const Heading = _styled__default.default.span.withConfig({
8
- displayName: "Headingstyle__Heading",
8
+ const TypographyHeading = _styled__default.default(Base.default).withConfig({
9
+ displayName: "Headingstyle__TypographyHeading",
9
10
  componentId: "RedisUI__sc-14rmj7o-0"
10
11
  })(["line-height:1.2;margin-block:0;", ""], ({
11
12
  $size,
12
- $ellipsis,
13
13
  $color,
14
14
  $variant
15
15
  }) => {
@@ -22,12 +22,6 @@ const Heading = _styled__default.default.span.withConfig({
22
22
  font-family: ${headingTheme.fontFamily};
23
23
  margin: ${sizeTheme.margin || 0};
24
24
  color: ${$color && theme.components.typography.colors[$color] || "unset"};
25
-
26
- ${$ellipsis && _styled.css`
27
- overflow: hidden;
28
- text-overflow: ellipsis;
29
- white-space: nowrap;
30
- `}
31
25
  `;
32
26
  });
33
- exports.Heading = Heading;
27
+ exports.TypographyHeading = TypographyHeading;
@@ -1,8 +1,8 @@
1
+ /// <reference types="react" />
1
2
  import { TypographyHeadingSize, TypographyHeadingVariant } from './Heading.types';
2
3
  import { TypographyColor } from '../../Typography.types';
3
- export declare const Heading: import("styled-components").StyledComponent<"span", any, {
4
+ export declare const TypographyHeading: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../..").TypographyBaseProps & import("react").RefAttributes<HTMLElement>>, any, {
4
5
  $size: TypographyHeadingSize;
5
- $ellipsis: boolean;
6
6
  $color?: TypographyColor | undefined;
7
7
  $variant?: TypographyHeadingVariant | undefined;
8
8
  }, never>;
@@ -1,11 +1,11 @@
1
1
  import _styled, { css } from "styled-components";
2
2
  import { useTheme } from "@redislabsdev/redis-ui-styles";
3
- const Heading = _styled.span.withConfig({
4
- displayName: "Headingstyle__Heading",
3
+ import TypographyBase from "../Base/Base.js";
4
+ const TypographyHeading = _styled(TypographyBase).withConfig({
5
+ displayName: "Headingstyle__TypographyHeading",
5
6
  componentId: "RedisUI__sc-14rmj7o-0"
6
7
  })(["line-height:1.2;margin-block:0;", ""], ({
7
8
  $size,
8
- $ellipsis,
9
9
  $color,
10
10
  $variant
11
11
  }) => {
@@ -18,14 +18,8 @@ const Heading = _styled.span.withConfig({
18
18
  font-family: ${headingTheme.fontFamily};
19
19
  margin: ${sizeTheme.margin || 0};
20
20
  color: ${$color && theme.components.typography.colors[$color] || "unset"};
21
-
22
- ${$ellipsis && css`
23
- overflow: hidden;
24
- text-overflow: ellipsis;
25
- white-space: nowrap;
26
- `}
27
21
  `;
28
22
  });
29
23
  export {
30
- Heading
24
+ TypographyHeading
31
25
  };