@ringcentral/juno 2.16.1 → 2.17.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.
Files changed (72) hide show
  1. package/components/Text/index.d.ts +0 -1
  2. package/components/Text/index.js +0 -1
  3. package/components/index.d.ts +0 -1
  4. package/components/index.js +0 -1
  5. package/es6/components/Text/index.js +0 -1
  6. package/es6/components/index.js +0 -1
  7. package/foundation/theme/ThemeHandler.d.ts +1 -1
  8. package/foundation/theme/ThemeSwitcherProvider/ThemeSwitcherProvider.d.ts +2 -2
  9. package/package.json +1 -1
  10. package/components/Autocomplete/Autocomplete.d.ts +0 -4
  11. package/components/Autocomplete/Autocomplete.js +0 -7
  12. package/components/Autocomplete/index.d.ts +0 -1
  13. package/components/Autocomplete/index.js +0 -4
  14. package/components/Grid/deprecated/Grid.d.ts +0 -6
  15. package/components/Grid/deprecated/Grid.js +0 -8
  16. package/components/Grid/deprecated/index.d.ts +0 -1
  17. package/components/Grid/deprecated/index.js +0 -4
  18. package/components/ImageView/ImageView.d.ts +0 -311
  19. package/components/ImageView/ImageView.js +0 -206
  20. package/components/ImageView/index.d.ts +0 -1
  21. package/components/ImageView/index.js +0 -4
  22. package/components/Tables/Table.d.ts +0 -34
  23. package/components/Tables/Table.js +0 -31
  24. package/components/Tables/TableBodyCellContent.d.ts +0 -10
  25. package/components/Tables/TableBodyCellContent.js +0 -16
  26. package/components/Tables/TableHead.d.ts +0 -4
  27. package/components/Tables/TableHead.js +0 -18
  28. package/components/Tables/TableHeadCell.d.ts +0 -4
  29. package/components/Tables/TableHeadCell.js +0 -64
  30. package/components/Tables/TableRow.d.ts +0 -3
  31. package/components/Tables/TableRow.js +0 -6
  32. package/components/Tables/index.d.ts +0 -7
  33. package/components/Tables/index.js +0 -10
  34. package/components/Tables/styled.d.ts +0 -24
  35. package/components/Tables/styled.js +0 -46
  36. package/components/Tables/types.d.ts +0 -60
  37. package/components/Tables/types.js +0 -49
  38. package/components/Text/TextWithEllipsis.d.ts +0 -6
  39. package/components/Text/TextWithEllipsis.js +0 -21
  40. package/components/TextWithHighlight/TextWithHighlight.d.ts +0 -6
  41. package/components/TextWithHighlight/TextWithHighlight.js +0 -20
  42. package/components/TextWithHighlight/index.d.ts +0 -1
  43. package/components/TextWithHighlight/index.js +0 -4
  44. package/components/TextWithLink/TextWithLink.d.ts +0 -14
  45. package/components/TextWithLink/TextWithLink.js +0 -31
  46. package/components/TextWithLink/index.d.ts +0 -1
  47. package/components/TextWithLink/index.js +0 -4
  48. package/components/TextWithTooltip/TextWithTooltip.d.ts +0 -8
  49. package/components/TextWithTooltip/TextWithTooltip.js +0 -35
  50. package/components/TextWithTooltip/index.d.ts +0 -1
  51. package/components/TextWithTooltip/index.js +0 -4
  52. package/es6/components/Autocomplete/Autocomplete.js +0 -4
  53. package/es6/components/Autocomplete/index.js +0 -1
  54. package/es6/components/Grid/deprecated/Grid.js +0 -6
  55. package/es6/components/Grid/deprecated/index.js +0 -1
  56. package/es6/components/ImageView/ImageView.js +0 -204
  57. package/es6/components/ImageView/index.js +0 -1
  58. package/es6/components/Tables/Table.js +0 -29
  59. package/es6/components/Tables/TableBodyCellContent.js +0 -14
  60. package/es6/components/Tables/TableHead.js +0 -15
  61. package/es6/components/Tables/TableHeadCell.js +0 -62
  62. package/es6/components/Tables/TableRow.js +0 -4
  63. package/es6/components/Tables/index.js +0 -7
  64. package/es6/components/Tables/styled.js +0 -38
  65. package/es6/components/Tables/types.js +0 -41
  66. package/es6/components/Text/TextWithEllipsis.js +0 -19
  67. package/es6/components/TextWithHighlight/TextWithHighlight.js +0 -18
  68. package/es6/components/TextWithHighlight/index.js +0 -1
  69. package/es6/components/TextWithLink/TextWithLink.js +0 -29
  70. package/es6/components/TextWithLink/index.js +0 -1
  71. package/es6/components/TextWithTooltip/TextWithTooltip.js +0 -33
  72. package/es6/components/TextWithTooltip/index.js +0 -1
@@ -1,62 +0,0 @@
1
- import { __assign } from "tslib";
2
- import React, { useMemo } from 'react';
3
- import isFunction from 'lodash/isFunction';
4
- import isNumber from 'lodash/isNumber';
5
- import { JumpToLatest as arrowDown, JumpToUnread as arrowUp, } from '@ringcentral/juno-icon';
6
- import { useA11yKeyEvent } from '../../foundation';
7
- import { RcIcon } from '../Icon';
8
- import { StyledSortIconWrapper, StyledTableHeadCell, StyledTableHeadCellContent, StyledTableHeadText, } from './styled';
9
- import { ARIA_SORT_VALUES, ORDER_TABLE_BY, SORT_ICON_CLASS, } from './types';
10
- var RcTableHeadCell = function (props) {
11
- var automationID = props.automationID, title = props.title, width = props.width, sortDirection = props.sortDirection, sortKey = props.sortKey, textAlign = props.textAlign;
12
- var onClick = function () {
13
- var sortHandler = props.sortHandler, sortKey = props.sortKey, sortDirection = props.sortDirection;
14
- if (sortKey === undefined || !sortHandler) {
15
- return;
16
- }
17
- if (sortDirection === ORDER_TABLE_BY.ASC) {
18
- sortHandler(ORDER_TABLE_BY.DESC, sortKey);
19
- }
20
- else {
21
- sortHandler(ORDER_TABLE_BY.ASC, sortKey);
22
- }
23
- };
24
- var onKeyDown = useA11yKeyEvent(onClick);
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- var shouldSort = function () {
27
- var sortHandler = props.sortHandler, sortKey = props.sortKey;
28
- return isFunction(sortHandler) && isNumber(sortKey);
29
- };
30
- var sortDirectionArrow = useMemo(function () {
31
- var sortClass = '';
32
- switch (sortDirection) {
33
- case ORDER_TABLE_BY.ASC:
34
- sortClass = SORT_ICON_CLASS.SORT_UP;
35
- break;
36
- case ORDER_TABLE_BY.DESC:
37
- sortClass = SORT_ICON_CLASS.SORT_DOWN;
38
- break;
39
- default:
40
- }
41
- if (shouldSort()) {
42
- return (React.createElement(StyledSortIconWrapper, { className: sortClass },
43
- React.createElement(RcIcon, { symbol: sortDirection === ORDER_TABLE_BY.ASC ? arrowUp : arrowDown, size: "small" })));
44
- }
45
- return React.createElement(React.Fragment, null);
46
- }, [shouldSort, sortDirection]);
47
- var ariaSort = __assign({}, (sortDirection !== undefined &&
48
- [ORDER_TABLE_BY.ASC, ORDER_TABLE_BY.DESC].includes(sortDirection) && {
49
- 'aria-sort': ARIA_SORT_VALUES[ORDER_TABLE_BY[sortDirection]],
50
- }));
51
- var headCellSortProps = __assign({}, (shouldSort() && __assign({ onKeyDown: onKeyDown }, ariaSort)));
52
- var cellContentSortProps = __assign({}, (shouldSort() && {
53
- role: 'button',
54
- onClickCapture: onClick,
55
- }));
56
- var hasSortKey = sortKey !== undefined;
57
- return (React.createElement(StyledTableHeadCell, __assign({ scope: "col", tabIndex: hasSortKey ? 0 : undefined, width: width, hasSortKey: hasSortKey, sortDirection: sortDirection, "data-test-automation-value": automationID, "data-test-automation-class": "table-header-cell" }, headCellSortProps),
58
- React.createElement(StyledTableHeadCellContent, __assign({ textAlign: textAlign }, cellContentSortProps),
59
- React.createElement(StyledTableHeadText, null, title),
60
- sortDirectionArrow)));
61
- };
62
- export { RcTableHeadCell };
@@ -1,4 +0,0 @@
1
- import { __makeTemplateObject } from "tslib";
2
- import { palette2, setOpacity, styled } from '../../foundation';
3
- export var RcTableRow = styled.tr(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n outline: none;\n\n &:not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n"], ["\n outline: none;\n\n &:not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n"])), palette2('neutral', 'l02'), setOpacity(palette2('action', 'grayLight'), '08'));
4
- var templateObject_1;
@@ -1,7 +0,0 @@
1
- export * from './Table';
2
- export * from './TableHead';
3
- export * from './TableHeadCell';
4
- export * from './types';
5
- export * from './TableRow';
6
- export * from './TableBodyCellContent';
7
- export * from './styled';
@@ -1,38 +0,0 @@
1
- import { __makeTemplateObject } from "tslib";
2
- import { css, fakeBorder, focusVisibleShadowStyle, focusWithin, palette2, spacing, styled, } from '../../foundation';
3
- import { COLUMN_TEXT_ALIGN, ORDER_TABLE_BY, TABLE_BORDER_TYPE, TABLE_STICKY_TYPE, TABLE_TYPE, } from './types';
4
- var TableWrapper = styled('div')(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n overflow: auto;\n\n background-color: ", ";\n &.", " {\n border-radius: 4px;\n border: 1px solid ", ";\n }\n"], ["\n height: 100%;\n width: 100%;\n overflow: auto;\n\n background-color: ", ";\n &.", " {\n border-radius: 4px;\n border: 1px solid ", ";\n }\n"])), palette2('neutral', 'b01'), TABLE_BORDER_TYPE.BORDERED, palette2('neutral', 'l02'));
5
- var StyledTable = styled('table')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n display: table;\n /* scroll when viewport is less than 960px including the 332px from left navs */\n min-width: ", ";\n\n @media only screen and (max-width: ", ") {\n table-layout: auto;\n }\n\n &.", " th {\n position: sticky;\n top: 0;\n }\n\n thead {\n border-bottom: 1px solid ", ";\n width: 100%;\n position: sticky;\n top: 0;\n display: table-header-group;\n z-index: 5;\n }\n\n tbody {\n display: table-row-group;\n }\n\n tr {\n display: table-row;\n padding-left: ", ";\n\n th,\n td {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n vertical-align: middle;\n }\n td:first-child {\n padding-left: ", ";\n margin-left: -", ";\n }\n td:not(:first-child) {\n padding-left: ", ";\n padding-right: ", ";\n }\n }\n\n &.", " tr td {\n overflow: hidden;\n height: 40px;\n }\n\n &.", " tr td {\n overflow: hidden;\n height: 52px;\n }\n\n &.", " tr td {\n overflow: hidden;\n height: 64px;\n }\n\n &.", " tr td {\n overflow: hidden;\n padding: ", ";\n height: auto;\n }\n"], ["\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n display: table;\n /* scroll when viewport is less than 960px including the 332px from left navs */\n min-width: ", ";\n\n @media only screen and (max-width: ", ") {\n table-layout: auto;\n }\n\n &.", " th {\n position: sticky;\n top: 0;\n }\n\n thead {\n border-bottom: 1px solid ", ";\n width: 100%;\n position: sticky;\n top: 0;\n display: table-header-group;\n z-index: 5;\n }\n\n tbody {\n display: table-row-group;\n }\n\n tr {\n display: table-row;\n padding-left: ", ";\n\n th,\n td {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n vertical-align: middle;\n }\n td:first-child {\n padding-left: ", ";\n margin-left: -", ";\n }\n td:not(:first-child) {\n padding-left: ", ";\n padding-right: ", ";\n }\n }\n\n &.", " tr td {\n overflow: hidden;\n height: 40px;\n }\n\n &.", " tr td {\n overflow: hidden;\n height: 52px;\n }\n\n &.", " tr td {\n overflow: hidden;\n height: 64px;\n }\n\n &.", " tr td {\n overflow: hidden;\n padding: ", ";\n height: auto;\n }\n"])), spacing(157), spacing(157), TABLE_STICKY_TYPE.STICKY, palette2('neutral', 'l02'), spacing(4), spacing(4), spacing(4), spacing(4), spacing(4), TABLE_TYPE.MODAL, TABLE_TYPE.CARD, TABLE_TYPE.FULL, TABLE_TYPE.AUTO, spacing(3, 4));
6
- var StyledTableRow = styled('tr')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 25px;\n display: table-row;\n font-size: 12px;\n text-align: left;\n vertical-align: middle;\n"], ["\n height: 25px;\n display: table-row;\n font-size: 12px;\n text-align: left;\n vertical-align: middle;\n"])));
7
- var StyledSortIconWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding-left: 8px;\n padding-right: 8px;\n vertical-align: middle;\n display: inline-flex;\n\n & path {\n fill: ", ";\n }\n"], ["\n padding-left: 8px;\n padding-right: 8px;\n vertical-align: middle;\n display: inline-flex;\n\n & path {\n fill: ", ";\n }\n"])), palette2('neutral', 'f04'));
8
- var StyledTableHeadText = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: auto;\n"], ["\n text-overflow: ellipsis;\n overflow: auto;\n"])));
9
- var StyledTableHeadCell = styled('th')(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n user-select: none;\n text-align: left;\n background-color: ", ";\n z-index: 100;\n line-height: 32px;\n width: ", ";\n padding-top: 0;\n padding-bottom: 0;\n display: table-cell;\n white-space: nowrap;\n overflow: hidden;\n\n & > div {\n border: 1px solid inherit;\n padding-left: ", ";\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n ", "\n"], ["\n color: ",
10
- ";\n user-select: none;\n text-align: left;\n background-color: ",
11
- ";\n z-index: 100;\n line-height: 32px;\n width: ", ";\n padding-top: 0;\n padding-bottom: 0;\n display: table-cell;\n white-space: nowrap;\n overflow: hidden;\n\n & > div {\n border: 1px solid inherit;\n padding-left: ", ";\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n ",
12
- "\n"])), function (props) {
13
- return props.sortDirection === ORDER_TABLE_BY.NONE
14
- ? palette2('neutral', 'f06')
15
- : palette2('interactive', 'f01');
16
- }, function (props) {
17
- return props.sortDirection === ORDER_TABLE_BY.NONE
18
- ? palette2('neutral', 'b02')
19
- : palette2('neutral', 'b03');
20
- }, function (props) { return props.width; }, spacing(4), function (_a) {
21
- var hasSortKey = _a.hasSortKey;
22
- return hasSortKey && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", " {\n background-color: ", ";\n ", ";\n cursor: pointer;\n outline: none;\n }\n position: relative;\n ", ";\n "], ["\n ", " {\n background-color: ", ";\n ", ";\n cursor: pointer;\n outline: none;\n }\n position: relative;\n ", ";\n "])), focusWithin, palette2('neutral', 'b03'), fakeBorder(), focusVisibleShadowStyle());
23
- });
24
- var StyledTableHeadCellContent = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n\n flex-direction: ", ";\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n display: flex;\n align-items: center;\n\n flex-direction: ",
25
- ";\n padding-left: ",
26
- ";\n padding-right: ",
27
- ";\n"])), function (_a) {
28
- var textAlign = _a.textAlign;
29
- return textAlign === COLUMN_TEXT_ALIGN.RIGHT ? 'row-reverse' : 'row';
30
- }, function (_a) {
31
- var textAlign = _a.textAlign;
32
- return textAlign === COLUMN_TEXT_ALIGN.RIGHT ? 0 : spacing(4);
33
- }, function (_a) {
34
- var textAlign = _a.textAlign;
35
- return textAlign === COLUMN_TEXT_ALIGN.RIGHT ? spacing(4) : 0;
36
- });
37
- export { TableWrapper, StyledTable, StyledTableRow, StyledSortIconWrapper, StyledTableHeadCell, StyledTableHeadText, StyledTableHeadCellContent, };
38
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -1,41 +0,0 @@
1
- var TABLE_BORDER_TYPE;
2
- (function (TABLE_BORDER_TYPE) {
3
- TABLE_BORDER_TYPE["BORDERED"] = "table-bordered";
4
- TABLE_BORDER_TYPE["NONE"] = "";
5
- })(TABLE_BORDER_TYPE || (TABLE_BORDER_TYPE = {}));
6
- var TABLE_STICKY_TYPE;
7
- (function (TABLE_STICKY_TYPE) {
8
- TABLE_STICKY_TYPE["STICKY"] = "table-sticky";
9
- TABLE_STICKY_TYPE["NONE"] = "";
10
- })(TABLE_STICKY_TYPE || (TABLE_STICKY_TYPE = {}));
11
- var TABLE_TYPE;
12
- (function (TABLE_TYPE) {
13
- TABLE_TYPE["AUTO"] = "table-auto";
14
- TABLE_TYPE["MODAL"] = "table-modal";
15
- TABLE_TYPE["CARD"] = "table-card";
16
- TABLE_TYPE["FULL"] = "table-full";
17
- })(TABLE_TYPE || (TABLE_TYPE = {}));
18
- var COLUMN_TEXT_ALIGN;
19
- (function (COLUMN_TEXT_ALIGN) {
20
- COLUMN_TEXT_ALIGN["LEFT"] = "left";
21
- COLUMN_TEXT_ALIGN["RIGHT"] = "right";
22
- })(COLUMN_TEXT_ALIGN || (COLUMN_TEXT_ALIGN = {}));
23
- var ORDER_TABLE_BY;
24
- (function (ORDER_TABLE_BY) {
25
- ORDER_TABLE_BY[ORDER_TABLE_BY["ASC"] = 0] = "ASC";
26
- ORDER_TABLE_BY[ORDER_TABLE_BY["DESC"] = 1] = "DESC";
27
- ORDER_TABLE_BY[ORDER_TABLE_BY["NONE"] = 2] = "NONE";
28
- })(ORDER_TABLE_BY || (ORDER_TABLE_BY = {}));
29
- var ARIA_SORT_VALUES;
30
- (function (ARIA_SORT_VALUES) {
31
- ARIA_SORT_VALUES["ASC"] = "ascending";
32
- ARIA_SORT_VALUES["DESC"] = "descending";
33
- ARIA_SORT_VALUES["NONE"] = "none";
34
- ARIA_SORT_VALUES["OTHER"] = "other";
35
- })(ARIA_SORT_VALUES || (ARIA_SORT_VALUES = {}));
36
- var SORT_ICON_CLASS;
37
- (function (SORT_ICON_CLASS) {
38
- SORT_ICON_CLASS["SORT_UP"] = "icon-sort-up";
39
- SORT_ICON_CLASS["SORT_DOWN"] = "icon-sort-down";
40
- })(SORT_ICON_CLASS || (SORT_ICON_CLASS = {}));
41
- export { ARIA_SORT_VALUES, COLUMN_TEXT_ALIGN, ORDER_TABLE_BY, SORT_ICON_CLASS, TABLE_BORDER_TYPE, TABLE_STICKY_TYPE, TABLE_TYPE, };
@@ -1,19 +0,0 @@
1
- import { __assign, __makeTemplateObject } from "tslib";
2
- import React, { forwardRef } from 'react';
3
- import { Typography as MuiTypography } from '@material-ui/core';
4
- import { ellipsis, useDeprecatedLog } from '../../foundation';
5
- import styled from '../../foundation/styled-components';
6
- var _RcTextWithEllipsis = forwardRef(function (props, ref) {
7
- if (process.env.NODE_ENV !== 'production') {
8
- // eslint-disable-next-line react-hooks/rules-of-hooks
9
- useDeprecatedLog({
10
- component: 'RcTextWithEllipsis',
11
- message: 'should not use that, just use `RcText` with `titleWhenOverflow` and `flexFull`',
12
- });
13
- }
14
- return React.createElement(MuiTypography, __assign({}, props, { ref: ref }));
15
- });
16
- /** @deprecated should not use that, just use `RcText` with `titleWhenOverflow` and `flexFull` */
17
- var RcTextWithEllipsis = styled(_RcTextWithEllipsis)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n flex: 1 1 auto;\n"], ["\n ", ";\n flex: 1 1 auto;\n"])), ellipsis());
18
- export { RcTextWithEllipsis };
19
- var templateObject_1;
@@ -1,18 +0,0 @@
1
- import { __assign, __makeTemplateObject } from "tslib";
2
- import React from 'react';
3
- import { palette2, useDeprecatedLog } from '../../foundation';
4
- import styled from '../../foundation/styled-components';
5
- var StyledSpan = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n a {\n color: inherit;\n }\n"], ["\n color: ", ";\n background-color: ", ";\n a {\n color: inherit;\n }\n"])), palette2('highlight', 'f01'), palette2('highlight', 'b02'));
6
- /** @deprecated should not use that, just use RcText with `highlight` */
7
- var RcTextWithHighlight = function (props) {
8
- if (process.env.NODE_ENV !== 'production') {
9
- // eslint-disable-next-line react-hooks/rules-of-hooks
10
- useDeprecatedLog({
11
- component: 'RcTextWithHighlight',
12
- message: 'should not use that, just use RcText with `highlight`',
13
- });
14
- }
15
- return React.createElement(StyledSpan, __assign({ className: "highlight-term" }, props));
16
- };
17
- export { RcTextWithHighlight };
18
- var templateObject_1;
@@ -1 +0,0 @@
1
- export * from './TextWithHighlight';
@@ -1,29 +0,0 @@
1
- import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import React, { memo } from 'react';
3
- import MuiTypography from '@material-ui/core/Typography';
4
- import { palette2, typography, useDeprecatedLog } from '../../foundation';
5
- import styled from '../../foundation/styled-components';
6
- import { RcLink } from '../Link';
7
- var TipsText = styled(MuiTypography)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n && {\n color: ", ";\n ", ";\n * {\n ", ";\n }\n }\n"], ["\n && {\n color: ", ";\n ", ";\n * {\n ", ";\n }\n }\n"])), palette2('neutral', 'f04'), typography('caption1'), typography('caption1'));
8
- /** @deprecated please don't use that component, just use RcText and RcLink directly */
9
- var RcTextWithLink = memo(function (props) {
10
- if (process.env.NODE_ENV !== 'production') {
11
- // eslint-disable-next-line react-hooks/rules-of-hooks
12
- useDeprecatedLog({
13
- component: 'RcTextWithLink',
14
- message: "please don't use that component, just use `RcText` and RcLink directly",
15
- });
16
- }
17
- var text = props.text, linkText = props.linkText, onClick = props.onClick, TypographyProps = props.TypographyProps, RcLinkProps = props.RcLinkProps;
18
- var textProps;
19
- if (TypographyProps) {
20
- var innerRef = TypographyProps.innerRef, rest = __rest(TypographyProps, ["innerRef"]);
21
- textProps = rest;
22
- }
23
- return (React.createElement(TipsText, __assign({}, textProps),
24
- text,
25
- React.createElement(RcLink, __assign({ handleOnClick: onClick }, RcLinkProps), linkText)));
26
- });
27
- RcTextWithLink.displayName = 'RcTextWithLink';
28
- export { RcTextWithLink };
29
- var templateObject_1;
@@ -1 +0,0 @@
1
- export * from './TextWithLink';
@@ -1,33 +0,0 @@
1
- import { __makeTemplateObject, __read } from "tslib";
2
- import React, { useRef, useState } from 'react';
3
- import { getParsePaletteColor, palette2, styled, useDeprecatedLog, } from '../../foundation';
4
- var StyledText = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ",
5
- ";\n"])), function (_a) {
6
- var textColor = _a.textColor;
7
- return getParsePaletteColor(textColor, palette2('neutral', 'f06'));
8
- });
9
- /** @deprecated please don't use that component, just use `RcText` with `title` directly */
10
- var RcTextWithTooltip = function (props) {
11
- if (process.env.NODE_ENV !== 'production') {
12
- // eslint-disable-next-line react-hooks/rules-of-hooks
13
- useDeprecatedLog({
14
- component: 'RcTextWithTooltip',
15
- message: "please don't use that component, just use `RcText` with `title` directly",
16
- });
17
- }
18
- var tooltip = props.tooltip, children = props.children, _a = props.textColor, textColor = _a === void 0 ? ['neutral', 'f06'] : _a;
19
- var ref = useRef(null);
20
- var _b = __read(useState(false), 2), showTooltip = _b[0], setShowTooltip = _b[1];
21
- var onMouseOver = function () {
22
- var span = ref.current;
23
- if (span && span.parentElement) {
24
- var _a = span.parentElement, scrollHeight = _a.scrollHeight, scrollWidth = _a.scrollWidth, clientHeight = _a.clientHeight, clientWidth = _a.clientWidth;
25
- setShowTooltip(scrollWidth > clientWidth || scrollHeight > clientHeight);
26
- }
27
- };
28
- var toolTipText = typeof children === 'string' ? children : tooltip || '';
29
- return (React.createElement("span", { title: showTooltip ? toolTipText : '', onMouseOver: onMouseOver, ref: ref },
30
- React.createElement(StyledText, { textColor: textColor }, children)));
31
- };
32
- export { RcTextWithTooltip };
33
- var templateObject_1;
@@ -1 +0,0 @@
1
- export * from './TextWithTooltip';