@conveyorhq/arrow-ds 1.208.0 → 1.209.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@conveyorhq/arrow-ds",
3
3
  "author": "Conveyor",
4
4
  "license": "MIT",
5
- "version": "1.208.0",
5
+ "version": "1.209.0",
6
6
  "description": "Arrow Design System",
7
7
  "repository": "https://github.com/conveyor/arrow-ds",
8
8
  "publishConfig": {
@@ -3,4 +3,4 @@ import { BoxProps } from "../Box";
3
3
  export interface TruncateProps extends BoxProps {
4
4
  lines?: number;
5
5
  }
6
- export declare const Truncate: ({ className, children, lines, ...rest }: TruncateProps) => React.JSX.Element;
6
+ export declare const Truncate: React.ForwardRefExoticComponent<Omit<TruncateProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,16 +1,38 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.Truncate = void 0;
7
- const react_1 = __importDefault(require("react"));
30
+ const react_1 = __importStar(require("react"));
8
31
  const classnames_1 = __importDefault(require("classnames"));
9
32
  const Box_1 = require("../Box");
10
33
  const bem_1 = require("../../utilities/bem");
11
34
  const cn = "Truncate";
12
- const Truncate = ({ className, children, lines = 1, ...rest }) => {
13
- return (react_1.default.createElement(Box_1.Box, { className: (0, classnames_1.default)((0, bem_1.bem)(cn), className), ...rest },
35
+ exports.Truncate = (0, react_1.forwardRef)(function Truncate({ className, children, lines = 1, ...rest }, ref) {
36
+ return (react_1.default.createElement(Box_1.Box, { ref: ref, className: (0, classnames_1.default)((0, bem_1.bem)(cn), className), ...rest },
14
37
  react_1.default.createElement("span", { style: { WebkitLineClamp: lines }, className: (0, classnames_1.default)((0, bem_1.bem)(cn, { e: "inner" })) }, children)));
15
- };
16
- exports.Truncate = Truncate;
38
+ });
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import classNames from "classnames";
3
3
  import { Box, BoxProps } from "../Box";
4
4
  import { bem } from "../../utilities/bem";
@@ -9,20 +9,17 @@ export interface TruncateProps extends BoxProps {
9
9
  lines?: number;
10
10
  }
11
11
 
12
- export const Truncate = ({
13
- className,
14
- children,
15
- lines = 1,
16
- ...rest
17
- }: TruncateProps) => {
18
- return (
19
- <Box className={classNames(bem(cn), className)} {...rest}>
20
- <span
21
- style={{ WebkitLineClamp: lines }}
22
- className={classNames(bem(cn, { e: "inner" }))}
23
- >
24
- {children}
25
- </span>
26
- </Box>
27
- );
28
- };
12
+ export const Truncate = forwardRef<HTMLDivElement, TruncateProps>(
13
+ function Truncate({ className, children, lines = 1, ...rest }, ref) {
14
+ return (
15
+ <Box ref={ref} className={classNames(bem(cn), className)} {...rest}>
16
+ <span
17
+ style={{ WebkitLineClamp: lines }}
18
+ className={classNames(bem(cn, { e: "inner" }))}
19
+ >
20
+ {children}
21
+ </span>
22
+ </Box>
23
+ );
24
+ },
25
+ );