@elliemae/ds-truncated-tooltip-text 3.21.2-rc.9 → 3.22.0-next.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 (29) hide show
  1. package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWithTooltip.js +8 -5
  2. package/dist/cjs/truncateTextWithTooltip/DSTruncateTextWithTooltip.js.map +2 -2
  3. package/dist/cjs/truncateTextWithTooltip/index.js +15 -3
  4. package/dist/cjs/truncateTextWithTooltip/index.js.map +2 -2
  5. package/dist/cjs/truncateTextWithTooltip/{propTypes.js → react-desc-prop-types.js} +12 -6
  6. package/dist/cjs/truncateTextWithTooltip/react-desc-prop-types.js.map +7 -0
  7. package/dist/cjs/truncateTextWithTooltip/typescript-testing/typescript-truncate-text-with-tooltip-valid.js +72 -0
  8. package/dist/cjs/truncateTextWithTooltip/typescript-testing/typescript-truncate-text-with-tooltip-valid.js.map +7 -0
  9. package/dist/esm/truncateTextWithTooltip/DSTruncateTextWithTooltip.js +10 -4
  10. package/dist/esm/truncateTextWithTooltip/DSTruncateTextWithTooltip.js.map +2 -2
  11. package/dist/esm/truncateTextWithTooltip/index.js +15 -2
  12. package/dist/esm/truncateTextWithTooltip/index.js.map +2 -2
  13. package/dist/esm/truncateTextWithTooltip/{propTypes.js → react-desc-prop-types.js} +9 -3
  14. package/dist/esm/truncateTextWithTooltip/react-desc-prop-types.js.map +7 -0
  15. package/dist/esm/truncateTextWithTooltip/typescript-testing/typescript-truncate-text-with-tooltip-valid.js +49 -0
  16. package/dist/esm/truncateTextWithTooltip/typescript-testing/typescript-truncate-text-with-tooltip-valid.js.map +7 -0
  17. package/dist/types/truncateTextWithTooltip/DSTruncateTextWithTooltip.d.ts +1 -1
  18. package/dist/types/truncateTextWithTooltip/index.d.ts +3 -2
  19. package/dist/types/truncateTextWithTooltip/react-desc-prop-types.d.ts +19 -0
  20. package/dist/types/truncateTextWithTooltip/typescript-testing/typescript-truncate-text-with-tooltip-valid.d.ts +1 -0
  21. package/package.json +7 -7
  22. package/dist/cjs/truncateTextWithTooltip/defaultProps.js +0 -38
  23. package/dist/cjs/truncateTextWithTooltip/defaultProps.js.map +0 -7
  24. package/dist/cjs/truncateTextWithTooltip/propTypes.js.map +0 -7
  25. package/dist/esm/truncateTextWithTooltip/defaultProps.js +0 -8
  26. package/dist/esm/truncateTextWithTooltip/defaultProps.js.map +0 -7
  27. package/dist/esm/truncateTextWithTooltip/propTypes.js.map +0 -7
  28. package/dist/types/truncateTextWithTooltip/defaultProps.d.ts +0 -2
  29. package/dist/types/truncateTextWithTooltip/propTypes.d.ts +0 -14
@@ -37,13 +37,16 @@ var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var import_react = require("react");
38
38
  var import_ds_tooltip = require("@elliemae/ds-tooltip");
39
39
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
40
- var import_defaultProps = require("./defaultProps.js");
41
40
  var import_DSTruncateTextWIthTooltipDatatestid = require("./DSTruncateTextWIthTooltipDatatestid.js");
42
- var import_propTypes = require("./propTypes.js");
43
41
  var import_styles = require("./styles.js");
42
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
44
43
  const DSTruncateTextWithTooltip = (props) => {
45
- const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
46
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_propTypes.propTypes, "DSTruncateTextWithTooltip");
44
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
45
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(
46
+ propsWithDefault,
47
+ import_react_desc_prop_types.DSTruncateTextWithTooltipPropTypesSchema,
48
+ "DSTruncateTextWithTooltip"
49
+ );
47
50
  const { text, tooltipProps } = propsWithDefault;
48
51
  const [textWrapperEl, setTextWrapperEl] = (0, import_react.useState)(null);
49
52
  const [isShowingEllipsis, setIsShowingEllipsis] = (0, import_react.useState)(false);
@@ -73,5 +76,5 @@ const DSTruncateTextWithTooltip = (props) => {
73
76
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Text, { ref: setTextWrapperEl, "data-testid": import_DSTruncateTextWIthTooltipDatatestid.DSTruncateTextWithTooltipDatatestid.TEXT, children: text });
74
77
  };
75
78
  const DSTruncateTextWithTooltipWithSchema = (0, import_ds_props_helpers.describe)(DSTruncateTextWithTooltip);
76
- DSTruncateTextWithTooltipWithSchema.propTypes = import_propTypes.propTypes;
79
+ DSTruncateTextWithTooltipWithSchema.propTypes = import_react_desc_prop_types.DSTruncateTextWithTooltipPropTypesSchema;
77
80
  //# sourceMappingURL=DSTruncateTextWithTooltip.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/DSTruncateTextWithTooltip.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useState, useMemo, useEffect } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { defaultProps } from './defaultProps.js';\nimport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid.js';\nimport { propTypes } from './propTypes.js';\nimport { Text } from './styles.js';\nimport type { DSTruncateTextWithTooltipT } from './propTypes.js';\n\nconst DSTruncateTextWithTooltip = (props: DSTruncateTextWithTooltipT.Props): JSX.Element => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTruncateTextWithTooltipT.Props>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes, 'DSTruncateTextWithTooltip');\n\n const { text, tooltipProps } = propsWithDefault;\n\n const [textWrapperEl, setTextWrapperEl] = useState<HTMLSpanElement | null>(null);\n const [isShowingEllipsis, setIsShowingEllipsis] = useState<boolean>(false);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (textWrapperEl) {\n setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);\n resizeObserver.observe(textWrapperEl);\n }\n return () => {\n if (textWrapperEl) {\n resizeObserver.unobserve(textWrapperEl);\n }\n };\n }, [resizeObserver, textWrapperEl]);\n\n if (isShowingEllipsis)\n return (\n <DSTooltipV3 text={text} {...tooltipProps}>\n <Text ref={setTextWrapperEl} tabIndex={0} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n </DSTooltipV3>\n );\n\n return (\n <Text ref={setTextWrapperEl} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n );\n};\n\nconst DSTruncateTextWithTooltipWithSchema = describe<DSTruncateTextWithTooltipT.Props>(DSTruncateTextWithTooltip);\n\nDSTruncateTextWithTooltipWithSchema.propTypes = propTypes;\n\nexport { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8Cf;AA9CR,mBAAoD;AACpD,wBAA4B;AAC5B,8BAAuF;AACvF,0BAA6B;AAC7B,iDAAoD;AACpD,uBAA0B;AAC1B,oBAAqB;AAGrB,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM,uBAAmB,sDAA+D,OAAO,gCAAY;AAE3G,8DAA+B,kBAAkB,4BAAW,2BAA2B;AAEvF,QAAM,EAAE,MAAM,aAAa,IAAI;AAE/B,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAiC,IAAI;AAC/E,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,uBAAkB,KAAK;AAEzE,QAAM,qBAAiB;AAAA,IACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,UAAI,QAAQ,QAAQ;AAClB,cAAM,CAAC,gBAAgB,IAAI;AAC3B,cAAM,KAAK,iBAAiB;AAC5B,6BAAqB,IAAI,cAAc,IAAI,WAAW;AAAA,MACxD;AAAA,IACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,8BAAU,MAAM;AACd,QAAI,eAAe;AACjB,2BAAqB,eAAe,cAAc,eAAe,WAAW;AAC5E,qBAAe,QAAQ,aAAa;AAAA,IACtC;AACA,WAAO,MAAM;AACX,UAAI,eAAe;AACjB,uBAAe,UAAU,aAAa;AAAA,MACxC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,aAAa,CAAC;AAElC,MAAI;AACF,WACE,4CAAC,iCAAY,MAAa,GAAG,cAC3B,sDAAC,sBAAK,KAAK,kBAAkB,UAAU,GAAG,eAAa,+EAAoC,MACxF,gBACH,GACF;AAGJ,SACE,4CAAC,sBAAK,KAAK,kBAAkB,eAAa,+EAAoC,MAC3E,gBACH;AAEJ;AAEA,MAAM,0CAAsC,kCAA2C,yBAAyB;AAEhH,oCAAoC,YAAY;",
4
+ "sourcesContent": ["import React, { useState, useMemo, useEffect } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid.js';\nimport { Text } from './styles.js';\nimport {\n type DSTruncateTextWithTooltipT,\n DSTruncateTextWithTooltipPropTypesSchema,\n defaultProps,\n} from './react-desc-prop-types.js';\n\nconst DSTruncateTextWithTooltip = (props: DSTruncateTextWithTooltipT.Props): JSX.Element => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTruncateTextWithTooltipT.InternalProps>(props, defaultProps);\n\n useValidateTypescriptPropTypes(\n propsWithDefault,\n DSTruncateTextWithTooltipPropTypesSchema,\n 'DSTruncateTextWithTooltip',\n );\n\n const { text, tooltipProps } = propsWithDefault;\n\n const [textWrapperEl, setTextWrapperEl] = useState<HTMLSpanElement | null>(null);\n const [isShowingEllipsis, setIsShowingEllipsis] = useState<boolean>(false);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (textWrapperEl) {\n setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);\n resizeObserver.observe(textWrapperEl);\n }\n return () => {\n if (textWrapperEl) {\n resizeObserver.unobserve(textWrapperEl);\n }\n };\n }, [resizeObserver, textWrapperEl]);\n\n if (isShowingEllipsis)\n return (\n <DSTooltipV3 text={text} {...tooltipProps}>\n <Text ref={setTextWrapperEl} tabIndex={0} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n </DSTooltipV3>\n );\n\n return (\n <Text ref={setTextWrapperEl} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n );\n};\n\nconst DSTruncateTextWithTooltipWithSchema = describe(DSTruncateTextWithTooltip);\n\nDSTruncateTextWithTooltipWithSchema.propTypes = DSTruncateTextWithTooltipPropTypesSchema;\n\nexport { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoDf;AApDR,mBAAoD;AACpD,wBAA4B;AAC5B,8BAAuF;AACvF,iDAAoD;AACpD,oBAAqB;AACrB,mCAIO;AAEP,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM,uBAAmB,sDAAuE,OAAO,yCAAY;AAEnH;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,aAAa,IAAI;AAE/B,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAiC,IAAI;AAC/E,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,uBAAkB,KAAK;AAEzE,QAAM,qBAAiB;AAAA,IACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,UAAI,QAAQ,QAAQ;AAClB,cAAM,CAAC,gBAAgB,IAAI;AAC3B,cAAM,KAAK,iBAAiB;AAC5B,6BAAqB,IAAI,cAAc,IAAI,WAAW;AAAA,MACxD;AAAA,IACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,8BAAU,MAAM;AACd,QAAI,eAAe;AACjB,2BAAqB,eAAe,cAAc,eAAe,WAAW;AAC5E,qBAAe,QAAQ,aAAa;AAAA,IACtC;AACA,WAAO,MAAM;AACX,UAAI,eAAe;AACjB,uBAAe,UAAU,aAAa;AAAA,MACxC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,aAAa,CAAC;AAElC,MAAI;AACF,WACE,4CAAC,iCAAY,MAAa,GAAG,cAC3B,sDAAC,sBAAK,KAAK,kBAAkB,UAAU,GAAG,eAAa,+EAAoC,MACxF,gBACH,GACF;AAGJ,SACE,4CAAC,sBAAK,KAAK,kBAAkB,eAAa,+EAAoC,MAC3E,gBACH;AAEJ;AAEA,MAAM,0CAAsC,kCAAS,yBAAyB;AAE9E,oCAAoC,YAAY;",
6
6
  "names": []
7
7
  }
@@ -5,6 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
8
12
  var __copyProps = (to, from, except, desc) => {
9
13
  if (from && typeof from === "object" || typeof from === "function") {
10
14
  for (let key of __getOwnPropNames(from))
@@ -13,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
13
17
  }
14
18
  return to;
15
19
  };
16
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
21
  // If the importer is in node compatibility mode or this is not an ESM
19
22
  // file that has been converted to a CommonJS file using a Babel-
@@ -24,8 +27,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
27
  ));
25
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
29
  var truncateTextWithTooltip_exports = {};
30
+ __export(truncateTextWithTooltip_exports, {
31
+ DSTruncateTextWithTooltip: () => import_DSTruncateTextWithTooltip.DSTruncateTextWithTooltip,
32
+ DSTruncateTextWithTooltipDatatestid: () => import_DSTruncateTextWIthTooltipDatatestid.DSTruncateTextWithTooltipDatatestid,
33
+ DSTruncateTextWithTooltipPropTypes: () => import_react_desc_prop_types.DSTruncateTextWithTooltipPropTypes,
34
+ DSTruncateTextWithTooltipPropTypesSchema: () => import_react_desc_prop_types.DSTruncateTextWithTooltipPropTypesSchema,
35
+ DSTruncateTextWithTooltipWithSchema: () => import_DSTruncateTextWithTooltip.DSTruncateTextWithTooltipWithSchema,
36
+ defaultProps: () => import_react_desc_prop_types.defaultProps
37
+ });
27
38
  module.exports = __toCommonJS(truncateTextWithTooltip_exports);
28
39
  var React = __toESM(require("react"));
29
- __reExport(truncateTextWithTooltip_exports, require("./DSTruncateTextWithTooltip.js"), module.exports);
30
- __reExport(truncateTextWithTooltip_exports, require("./DSTruncateTextWIthTooltipDatatestid.js"), module.exports);
40
+ var import_DSTruncateTextWithTooltip = require("./DSTruncateTextWithTooltip.js");
41
+ var import_DSTruncateTextWIthTooltipDatatestid = require("./DSTruncateTextWIthTooltipDatatestid.js");
42
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
31
43
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/truncateTextWithTooltip/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './DSTruncateTextWithTooltip.js';\nexport * from './DSTruncateTextWIthTooltipDatatestid.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,4CAAc,2CAAd;AACA,4CAAc,qDADd;",
4
+ "sourcesContent": ["export { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema } from './DSTruncateTextWithTooltip.js';\nexport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid.js';\nexport {\n type DSTruncateTextWithTooltipT,\n defaultProps,\n DSTruncateTextWithTooltipPropTypes,\n DSTruncateTextWithTooltipPropTypesSchema,\n} from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uCAA+E;AAC/E,iDAAoD;AACpD,mCAKO;",
6
6
  "names": []
7
7
  }
@@ -26,17 +26,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var propTypes_exports = {};
30
- __export(propTypes_exports, {
31
- propTypes: () => propTypes
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSTruncateTextWithTooltipPropTypes: () => DSTruncateTextWithTooltipPropTypes,
32
+ DSTruncateTextWithTooltipPropTypesSchema: () => DSTruncateTextWithTooltipPropTypesSchema,
33
+ defaultProps: () => defaultProps
32
34
  });
33
- module.exports = __toCommonJS(propTypes_exports);
35
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
34
36
  var React = __toESM(require("react"));
35
37
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
- const propTypes = {
38
+ const defaultProps = {
39
+ tooltipProps: {}
40
+ };
41
+ const DSTruncateTextWithTooltipPropTypes = {
37
42
  text: import_ds_props_helpers.PropTypes.string.description("Text to show.").isRequired,
38
43
  tooltipProps: import_ds_props_helpers.PropTypes.object.description(
39
44
  "This component uses DSTooltip component, you can set properties directly to this component with this property."
40
45
  ).defaultValue({})
41
46
  };
42
- //# sourceMappingURL=propTypes.js.map
47
+ const DSTruncateTextWithTooltipPropTypesSchema = DSTruncateTextWithTooltipPropTypes;
48
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/truncateTextWithTooltip/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n// import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSTruncateTextWithTooltipT {\n export interface DefaultProps {\n tooltipProps: Record<string, unknown>;\n }\n export interface OptionalProps {}\n export interface RequiredProps {\n text: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSTruncateTextWithTooltipT.DefaultProps = {\n tooltipProps: {},\n};\n\nexport const DSTruncateTextWithTooltipPropTypes: DSPropTypesSchema<DSTruncateTextWithTooltipT.Props> = {\n text: PropTypes.string.description('Text to show.').isRequired,\n tooltipProps: PropTypes.object\n .description(\n 'This component uses DSTooltip component, you can set properties directly to this component with this property.',\n )\n .defaultValue({}),\n};\n\nexport const DSTruncateTextWithTooltipPropTypesSchema =\n DSTruncateTextWithTooltipPropTypes as unknown as WeakValidationMap<DSTruncateTextWithTooltipT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAA0B;AA2BnB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;AAEO,MAAM,qCAA0F;AAAA,EACrG,MAAM,kCAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,kCAAU,OACrB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,CAAC;AACpB;AAEO,MAAM,2CACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import__ = require("../index.js");
27
+ const testRequiredProps = {
28
+ text: "This is defined as just as string so this is fine for testing"
29
+ };
30
+ const testOptionalProps = {};
31
+ const testPartialDefaults = {
32
+ tooltipProps: {}
33
+ };
34
+ const testProps = {
35
+ ...testRequiredProps,
36
+ ...testOptionalProps,
37
+ ...testPartialDefaults
38
+ };
39
+ const testPropsAsSyntax = {
40
+ ...testRequiredProps,
41
+ ...testOptionalProps,
42
+ ...testPartialDefaults
43
+ };
44
+ const testCompleteDefaults = {
45
+ tooltipProps: {}
46
+ };
47
+ const testInternalProps = {
48
+ ...testRequiredProps,
49
+ ...testOptionalProps,
50
+ ...testCompleteDefaults
51
+ };
52
+ const testInternalPropsAsSyntax = {
53
+ ...testRequiredProps,
54
+ ...testOptionalProps,
55
+ ...testCompleteDefaults
56
+ };
57
+ const testExplicitDefinition = {
58
+ text: "This is defined as just as string so this is fine for testing"
59
+ };
60
+ const testInferedTypeCompatibility = {
61
+ text: "This is defined as just as string so this is fine for testing"
62
+ };
63
+ const testDefinitionAsConst = {
64
+ text: "This is defined as just as string so this is fine for testing"
65
+ };
66
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSTruncateTextWithTooltip, { ...testExplicitDefinition }),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSTruncateTextWithTooltip, { ...testInferedTypeCompatibility }),
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSTruncateTextWithTooltip, { ...testDefinitionAsConst }),
70
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSTruncateTextWithTooltip, { text: "System Message" })
71
+ ] });
72
+ //# sourceMappingURL=typescript-truncate-text-with-tooltip-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/truncateTextWithTooltip/typescript-testing/typescript-truncate-text-with-tooltip-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSTruncateTextWithTooltip } from '../index.js';\nimport type { DSTruncateTextWithTooltipT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSTruncateTextWithTooltipT.Props;\ntype ComponentPropsInternals = DSTruncateTextWithTooltipT.InternalProps;\ntype ComponentPropsDefaultProps = DSTruncateTextWithTooltipT.DefaultProps;\ntype ComponentPropsOptionalProps = DSTruncateTextWithTooltipT.OptionalProps;\ntype ComponentPropsRequiredProps = DSTruncateTextWithTooltipT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n text: 'This is defined as just as string so this is fine for testing',\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n tooltipProps: {},\n};\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n tooltipProps: {},\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n text: 'This is defined as just as string so this is fine for testing',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n text: 'This is defined as just as string so this is fine for testing',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n text: 'This is defined as just as string so this is fine for testing',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSTruncateTextWithTooltip {...testExplicitDefinition} />\n <DSTruncateTextWithTooltip {...testInferedTypeCompatibility} />\n <DSTruncateTextWithTooltip {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSTruncateTextWithTooltip text=\"System Message\" />\n </>\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;AC6DrB;AA5DF,eAA0C;AAU1C,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AACA,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,cAAc,CAAC;AACjB;AACA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,cAAc,CAAC;AACjB;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,MAAM;AACR;AAGA,MAAM,+BAA+B;AAAA,EACnC,MAAM;AACR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AACR;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,sCAA2B,GAAG,wBAAwB;AAAA,EACvD,4CAAC,sCAA2B,GAAG,8BAA8B;AAAA,EAC7D,4CAAC,sCAA2B,GAAG,uBAAuB;AAAA,EAEtD,4CAAC,sCAA0B,MAAK,kBAAiB;AAAA,GACnD;",
6
+ "names": []
7
+ }
@@ -3,13 +3,19 @@ import { jsx } from "react/jsx-runtime";
3
3
  import { useState, useMemo, useEffect } from "react";
4
4
  import { DSTooltipV3 } from "@elliemae/ds-tooltip";
5
5
  import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from "@elliemae/ds-props-helpers";
6
- import { defaultProps } from "./defaultProps.js";
7
6
  import { DSTruncateTextWithTooltipDatatestid } from "./DSTruncateTextWIthTooltipDatatestid.js";
8
- import { propTypes } from "./propTypes.js";
9
7
  import { Text } from "./styles.js";
8
+ import {
9
+ DSTruncateTextWithTooltipPropTypesSchema,
10
+ defaultProps
11
+ } from "./react-desc-prop-types.js";
10
12
  const DSTruncateTextWithTooltip = (props) => {
11
13
  const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
12
- useValidateTypescriptPropTypes(propsWithDefault, propTypes, "DSTruncateTextWithTooltip");
14
+ useValidateTypescriptPropTypes(
15
+ propsWithDefault,
16
+ DSTruncateTextWithTooltipPropTypesSchema,
17
+ "DSTruncateTextWithTooltip"
18
+ );
13
19
  const { text, tooltipProps } = propsWithDefault;
14
20
  const [textWrapperEl, setTextWrapperEl] = useState(null);
15
21
  const [isShowingEllipsis, setIsShowingEllipsis] = useState(false);
@@ -39,7 +45,7 @@ const DSTruncateTextWithTooltip = (props) => {
39
45
  return /* @__PURE__ */ jsx(Text, { ref: setTextWrapperEl, "data-testid": DSTruncateTextWithTooltipDatatestid.TEXT, children: text });
40
46
  };
41
47
  const DSTruncateTextWithTooltipWithSchema = describe(DSTruncateTextWithTooltip);
42
- DSTruncateTextWithTooltipWithSchema.propTypes = propTypes;
48
+ DSTruncateTextWithTooltipWithSchema.propTypes = DSTruncateTextWithTooltipPropTypesSchema;
43
49
  export {
44
50
  DSTruncateTextWithTooltip,
45
51
  DSTruncateTextWithTooltipWithSchema
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/DSTruncateTextWithTooltip.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useMemo, useEffect } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { defaultProps } from './defaultProps.js';\nimport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid.js';\nimport { propTypes } from './propTypes.js';\nimport { Text } from './styles.js';\nimport type { DSTruncateTextWithTooltipT } from './propTypes.js';\n\nconst DSTruncateTextWithTooltip = (props: DSTruncateTextWithTooltipT.Props): JSX.Element => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTruncateTextWithTooltipT.Props>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes, 'DSTruncateTextWithTooltip');\n\n const { text, tooltipProps } = propsWithDefault;\n\n const [textWrapperEl, setTextWrapperEl] = useState<HTMLSpanElement | null>(null);\n const [isShowingEllipsis, setIsShowingEllipsis] = useState<boolean>(false);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (textWrapperEl) {\n setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);\n resizeObserver.observe(textWrapperEl);\n }\n return () => {\n if (textWrapperEl) {\n resizeObserver.unobserve(textWrapperEl);\n }\n };\n }, [resizeObserver, textWrapperEl]);\n\n if (isShowingEllipsis)\n return (\n <DSTooltipV3 text={text} {...tooltipProps}>\n <Text ref={setTextWrapperEl} tabIndex={0} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n </DSTooltipV3>\n );\n\n return (\n <Text ref={setTextWrapperEl} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n );\n};\n\nconst DSTruncateTextWithTooltipWithSchema = describe<DSTruncateTextWithTooltipT.Props>(DSTruncateTextWithTooltip);\n\nDSTruncateTextWithTooltipWithSchema.propTypes = propTypes;\n\nexport { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC8Cf;AA9CR,SAAgB,UAAU,SAAS,iBAAiB;AACpD,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B,gCAAgC,gBAAgB;AACvF,SAAS,oBAAoB;AAC7B,SAAS,2CAA2C;AACpD,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAGrB,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM,mBAAmB,6BAA+D,OAAO,YAAY;AAE3G,iCAA+B,kBAAkB,WAAW,2BAA2B;AAEvF,QAAM,EAAE,MAAM,aAAa,IAAI;AAE/B,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAiC,IAAI;AAC/E,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAkB,KAAK;AAEzE,QAAM,iBAAiB;AAAA,IACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,UAAI,QAAQ,QAAQ;AAClB,cAAM,CAAC,gBAAgB,IAAI;AAC3B,cAAM,KAAK,iBAAiB;AAC5B,6BAAqB,IAAI,cAAc,IAAI,WAAW;AAAA,MACxD;AAAA,IACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,YAAU,MAAM;AACd,QAAI,eAAe;AACjB,2BAAqB,eAAe,cAAc,eAAe,WAAW;AAC5E,qBAAe,QAAQ,aAAa;AAAA,IACtC;AACA,WAAO,MAAM;AACX,UAAI,eAAe;AACjB,uBAAe,UAAU,aAAa;AAAA,MACxC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,aAAa,CAAC;AAElC,MAAI;AACF,WACE,oBAAC,eAAY,MAAa,GAAG,cAC3B,8BAAC,QAAK,KAAK,kBAAkB,UAAU,GAAG,eAAa,oCAAoC,MACxF,gBACH,GACF;AAGJ,SACE,oBAAC,QAAK,KAAK,kBAAkB,eAAa,oCAAoC,MAC3E,gBACH;AAEJ;AAEA,MAAM,sCAAsC,SAA2C,yBAAyB;AAEhH,oCAAoC,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useMemo, useEffect } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid.js';\nimport { Text } from './styles.js';\nimport {\n type DSTruncateTextWithTooltipT,\n DSTruncateTextWithTooltipPropTypesSchema,\n defaultProps,\n} from './react-desc-prop-types.js';\n\nconst DSTruncateTextWithTooltip = (props: DSTruncateTextWithTooltipT.Props): JSX.Element => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTruncateTextWithTooltipT.InternalProps>(props, defaultProps);\n\n useValidateTypescriptPropTypes(\n propsWithDefault,\n DSTruncateTextWithTooltipPropTypesSchema,\n 'DSTruncateTextWithTooltip',\n );\n\n const { text, tooltipProps } = propsWithDefault;\n\n const [textWrapperEl, setTextWrapperEl] = useState<HTMLSpanElement | null>(null);\n const [isShowingEllipsis, setIsShowingEllipsis] = useState<boolean>(false);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (textWrapperEl) {\n setIsShowingEllipsis(textWrapperEl?.scrollWidth > textWrapperEl?.clientWidth);\n resizeObserver.observe(textWrapperEl);\n }\n return () => {\n if (textWrapperEl) {\n resizeObserver.unobserve(textWrapperEl);\n }\n };\n }, [resizeObserver, textWrapperEl]);\n\n if (isShowingEllipsis)\n return (\n <DSTooltipV3 text={text} {...tooltipProps}>\n <Text ref={setTextWrapperEl} tabIndex={0} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n </DSTooltipV3>\n );\n\n return (\n <Text ref={setTextWrapperEl} data-testid={DSTruncateTextWithTooltipDatatestid.TEXT}>\n {text}\n </Text>\n );\n};\n\nconst DSTruncateTextWithTooltipWithSchema = describe(DSTruncateTextWithTooltip);\n\nDSTruncateTextWithTooltipWithSchema.propTypes = DSTruncateTextWithTooltipPropTypesSchema;\n\nexport { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoDf;AApDR,SAAgB,UAAU,SAAS,iBAAiB;AACpD,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B,gCAAgC,gBAAgB;AACvF,SAAS,2CAA2C;AACpD,SAAS,YAAY;AACrB;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAEP,MAAM,4BAA4B,CAAC,UAAyD;AAC1F,QAAM,mBAAmB,6BAAuE,OAAO,YAAY;AAEnH;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,aAAa,IAAI;AAE/B,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAiC,IAAI;AAC/E,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAkB,KAAK;AAEzE,QAAM,iBAAiB;AAAA,IACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,UAAI,QAAQ,QAAQ;AAClB,cAAM,CAAC,gBAAgB,IAAI;AAC3B,cAAM,KAAK,iBAAiB;AAC5B,6BAAqB,IAAI,cAAc,IAAI,WAAW;AAAA,MACxD;AAAA,IACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,YAAU,MAAM;AACd,QAAI,eAAe;AACjB,2BAAqB,eAAe,cAAc,eAAe,WAAW;AAC5E,qBAAe,QAAQ,aAAa;AAAA,IACtC;AACA,WAAO,MAAM;AACX,UAAI,eAAe;AACjB,uBAAe,UAAU,aAAa;AAAA,MACxC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,aAAa,CAAC;AAElC,MAAI;AACF,WACE,oBAAC,eAAY,MAAa,GAAG,cAC3B,8BAAC,QAAK,KAAK,kBAAkB,UAAU,GAAG,eAAa,oCAAoC,MACxF,gBACH,GACF;AAGJ,SACE,oBAAC,QAAK,KAAK,kBAAkB,eAAa,oCAAoC,MAC3E,gBACH;AAEJ;AAEA,MAAM,sCAAsC,SAAS,yBAAyB;AAE9E,oCAAoC,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,17 @@
1
1
  import * as React from "react";
2
- export * from "./DSTruncateTextWithTooltip.js";
3
- export * from "./DSTruncateTextWIthTooltipDatatestid.js";
2
+ import { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema } from "./DSTruncateTextWithTooltip.js";
3
+ import { DSTruncateTextWithTooltipDatatestid } from "./DSTruncateTextWIthTooltipDatatestid.js";
4
+ import {
5
+ defaultProps,
6
+ DSTruncateTextWithTooltipPropTypes,
7
+ DSTruncateTextWithTooltipPropTypesSchema
8
+ } from "./react-desc-prop-types.js";
9
+ export {
10
+ DSTruncateTextWithTooltip,
11
+ DSTruncateTextWithTooltipDatatestid,
12
+ DSTruncateTextWithTooltipPropTypes,
13
+ DSTruncateTextWithTooltipPropTypesSchema,
14
+ DSTruncateTextWithTooltipWithSchema,
15
+ defaultProps
16
+ };
4
17
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSTruncateTextWithTooltip.js';\nexport * from './DSTruncateTextWIthTooltipDatatestid.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema } from './DSTruncateTextWithTooltip.js';\nexport { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid.js';\nexport {\n type DSTruncateTextWithTooltipT,\n defaultProps,\n DSTruncateTextWithTooltipPropTypes,\n DSTruncateTextWithTooltipPropTypesSchema,\n} from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B,2CAA2C;AAC/E,SAAS,2CAA2C;AACpD;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -1,12 +1,18 @@
1
1
  import * as React from "react";
2
2
  import { PropTypes } from "@elliemae/ds-props-helpers";
3
- const propTypes = {
3
+ const defaultProps = {
4
+ tooltipProps: {}
5
+ };
6
+ const DSTruncateTextWithTooltipPropTypes = {
4
7
  text: PropTypes.string.description("Text to show.").isRequired,
5
8
  tooltipProps: PropTypes.object.description(
6
9
  "This component uses DSTooltip component, you can set properties directly to this component with this property."
7
10
  ).defaultValue({})
8
11
  };
12
+ const DSTruncateTextWithTooltipPropTypesSchema = DSTruncateTextWithTooltipPropTypes;
9
13
  export {
10
- propTypes
14
+ DSTruncateTextWithTooltipPropTypes,
15
+ DSTruncateTextWithTooltipPropTypesSchema,
16
+ defaultProps
11
17
  };
12
- //# sourceMappingURL=propTypes.js.map
18
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/react-desc-prop-types.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n// import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSTruncateTextWithTooltipT {\n export interface DefaultProps {\n tooltipProps: Record<string, unknown>;\n }\n export interface OptionalProps {}\n export interface RequiredProps {\n text: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSTruncateTextWithTooltipT.DefaultProps = {\n tooltipProps: {},\n};\n\nexport const DSTruncateTextWithTooltipPropTypes: DSPropTypesSchema<DSTruncateTextWithTooltipT.Props> = {\n text: PropTypes.string.description('Text to show.').isRequired,\n tooltipProps: PropTypes.object\n .description(\n 'This component uses DSTooltip component, you can set properties directly to this component with this property.',\n )\n .defaultValue({}),\n};\n\nexport const DSTruncateTextWithTooltipPropTypesSchema =\n DSTruncateTextWithTooltipPropTypes as unknown as WeakValidationMap<DSTruncateTextWithTooltipT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,iBAAiB;AA2BnB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;AAEO,MAAM,qCAA0F;AAAA,EACrG,MAAM,UAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,UAAU,OACrB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,CAAC;AACpB;AAEO,MAAM,2CACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,49 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSTruncateTextWithTooltip } from "../index.js";
4
+ const testRequiredProps = {
5
+ text: "This is defined as just as string so this is fine for testing"
6
+ };
7
+ const testOptionalProps = {};
8
+ const testPartialDefaults = {
9
+ tooltipProps: {}
10
+ };
11
+ const testProps = {
12
+ ...testRequiredProps,
13
+ ...testOptionalProps,
14
+ ...testPartialDefaults
15
+ };
16
+ const testPropsAsSyntax = {
17
+ ...testRequiredProps,
18
+ ...testOptionalProps,
19
+ ...testPartialDefaults
20
+ };
21
+ const testCompleteDefaults = {
22
+ tooltipProps: {}
23
+ };
24
+ const testInternalProps = {
25
+ ...testRequiredProps,
26
+ ...testOptionalProps,
27
+ ...testCompleteDefaults
28
+ };
29
+ const testInternalPropsAsSyntax = {
30
+ ...testRequiredProps,
31
+ ...testOptionalProps,
32
+ ...testCompleteDefaults
33
+ };
34
+ const testExplicitDefinition = {
35
+ text: "This is defined as just as string so this is fine for testing"
36
+ };
37
+ const testInferedTypeCompatibility = {
38
+ text: "This is defined as just as string so this is fine for testing"
39
+ };
40
+ const testDefinitionAsConst = {
41
+ text: "This is defined as just as string so this is fine for testing"
42
+ };
43
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
44
+ /* @__PURE__ */ jsx(DSTruncateTextWithTooltip, { ...testExplicitDefinition }),
45
+ /* @__PURE__ */ jsx(DSTruncateTextWithTooltip, { ...testInferedTypeCompatibility }),
46
+ /* @__PURE__ */ jsx(DSTruncateTextWithTooltip, { ...testDefinitionAsConst }),
47
+ /* @__PURE__ */ jsx(DSTruncateTextWithTooltip, { text: "System Message" })
48
+ ] });
49
+ //# sourceMappingURL=typescript-truncate-text-with-tooltip-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/truncateTextWithTooltip/typescript-testing/typescript-truncate-text-with-tooltip-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSTruncateTextWithTooltip } from '../index.js';\nimport type { DSTruncateTextWithTooltipT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSTruncateTextWithTooltipT.Props;\ntype ComponentPropsInternals = DSTruncateTextWithTooltipT.InternalProps;\ntype ComponentPropsDefaultProps = DSTruncateTextWithTooltipT.DefaultProps;\ntype ComponentPropsOptionalProps = DSTruncateTextWithTooltipT.OptionalProps;\ntype ComponentPropsRequiredProps = DSTruncateTextWithTooltipT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n text: 'This is defined as just as string so this is fine for testing',\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n tooltipProps: {},\n};\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n tooltipProps: {},\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n text: 'This is defined as just as string so this is fine for testing',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n text: 'This is defined as just as string so this is fine for testing',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n text: 'This is defined as just as string so this is fine for testing',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSTruncateTextWithTooltip {...testExplicitDefinition} />\n <DSTruncateTextWithTooltip {...testInferedTypeCompatibility} />\n <DSTruncateTextWithTooltip {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSTruncateTextWithTooltip text=\"System Message\" />\n </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC6DrB,mBAEE,KAFF;AA5DF,SAAS,iCAAiC;AAU1C,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AACA,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,cAAc,CAAC;AACjB;AACA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,cAAc,CAAC;AACjB;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,MAAM;AACR;AAGA,MAAM,+BAA+B;AAAA,EACnC,MAAM;AACR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AACR;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,6BAA2B,GAAG,wBAAwB;AAAA,EACvD,oBAAC,6BAA2B,GAAG,8BAA8B;AAAA,EAC7D,oBAAC,6BAA2B,GAAG,uBAAuB;AAAA,EAEtD,oBAAC,6BAA0B,MAAK,kBAAiB;AAAA,GACnD;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { DSTruncateTextWithTooltipT } from './propTypes.js';
2
+ import { type DSTruncateTextWithTooltipT } from './react-desc-prop-types.js';
3
3
  declare const DSTruncateTextWithTooltip: (props: DSTruncateTextWithTooltipT.Props) => JSX.Element;
4
4
  declare const DSTruncateTextWithTooltipWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSTruncateTextWithTooltipT.Props>;
5
5
  export { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema };
@@ -1,2 +1,3 @@
1
- export * from './DSTruncateTextWithTooltip.js';
2
- export * from './DSTruncateTextWIthTooltipDatatestid.js';
1
+ export { DSTruncateTextWithTooltip, DSTruncateTextWithTooltipWithSchema } from './DSTruncateTextWithTooltip.js';
2
+ export { DSTruncateTextWithTooltipDatatestid } from './DSTruncateTextWIthTooltipDatatestid.js';
3
+ export { type DSTruncateTextWithTooltipT, defaultProps, DSTruncateTextWithTooltipPropTypes, DSTruncateTextWithTooltipPropTypesSchema, } from './react-desc-prop-types.js';
@@ -0,0 +1,19 @@
1
+ import type { WeakValidationMap } from 'react';
2
+ import type { DSPropTypesSchema } from '@elliemae/ds-utilities';
3
+ export declare namespace DSTruncateTextWithTooltipT {
4
+ interface DefaultProps {
5
+ tooltipProps: Record<string, unknown>;
6
+ }
7
+ interface OptionalProps {
8
+ }
9
+ interface RequiredProps {
10
+ text: string;
11
+ }
12
+ interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
13
+ }
14
+ interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {
15
+ }
16
+ }
17
+ export declare const defaultProps: DSTruncateTextWithTooltipT.DefaultProps;
18
+ export declare const DSTruncateTextWithTooltipPropTypes: DSPropTypesSchema<DSTruncateTextWithTooltipT.Props>;
19
+ export declare const DSTruncateTextWithTooltipPropTypesSchema: WeakValidationMap<DSTruncateTextWithTooltipT.Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-truncated-tooltip-text",
3
- "version": "3.21.2-rc.9",
3
+ "version": "3.22.0-next.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Truncated Tooltip Text",
6
6
  "files": [
@@ -52,12 +52,12 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "prop-types": "~15.8.1",
55
- "@elliemae/ds-popover": "3.21.2-rc.9",
56
- "@elliemae/ds-popper": "3.21.2-rc.9",
57
- "@elliemae/ds-props-helpers": "3.21.2-rc.9",
58
- "@elliemae/ds-system": "3.21.2-rc.9",
59
- "@elliemae/ds-tooltip": "3.21.2-rc.9",
60
- "@elliemae/ds-utilities": "3.21.2-rc.9"
55
+ "@elliemae/ds-popover": "3.22.0-next.0",
56
+ "@elliemae/ds-popper": "3.22.0-next.0",
57
+ "@elliemae/ds-props-helpers": "3.22.0-next.0",
58
+ "@elliemae/ds-system": "3.22.0-next.0",
59
+ "@elliemae/ds-tooltip": "3.22.0-next.0",
60
+ "@elliemae/ds-utilities": "3.22.0-next.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "styled-components": "~5.3.9"
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var defaultProps_exports = {};
30
- __export(defaultProps_exports, {
31
- defaultProps: () => defaultProps
32
- });
33
- module.exports = __toCommonJS(defaultProps_exports);
34
- var React = __toESM(require("react"));
35
- const defaultProps = {
36
- tooltipProps: {}
37
- };
38
- //# sourceMappingURL=defaultProps.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/truncateTextWithTooltip/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { DSTruncateTextWithTooltipT } from './propTypes.js';\n\nexport const defaultProps: DSTruncateTextWithTooltipT.DefaultProps = {\n tooltipProps: {},\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/truncateTextWithTooltip/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-len */\n\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSTruncateTextWithTooltipT {\n export interface PropsRequired {\n text: string;\n }\n\n export interface DefaultProps {\n tooltipProps: Record<string, unknown>;\n }\n\n export interface Props extends DefaultProps, PropsRequired {}\n}\n\nexport const propTypes = {\n text: PropTypes.string.description('Text to show.').isRequired,\n tooltipProps: PropTypes.object\n .description(\n 'This component uses DSTooltip component, you can set properties directly to this component with this property.',\n )\n .defaultValue({}),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAA0B;AAcnB,MAAM,YAAY;AAAA,EACvB,MAAM,kCAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,kCAAU,OACrB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,CAAC;AACpB;",
6
- "names": []
7
- }
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- const defaultProps = {
3
- tooltipProps: {}
4
- };
5
- export {
6
- defaultProps
7
- };
8
- //# sourceMappingURL=defaultProps.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/defaultProps.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSTruncateTextWithTooltipT } from './propTypes.js';\n\nexport const defaultProps: DSTruncateTextWithTooltipT.DefaultProps = {\n tooltipProps: {},\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,eAAwD;AAAA,EACnE,cAAc,CAAC;AACjB;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/truncateTextWithTooltip/propTypes.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\n\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSTruncateTextWithTooltipT {\n export interface PropsRequired {\n text: string;\n }\n\n export interface DefaultProps {\n tooltipProps: Record<string, unknown>;\n }\n\n export interface Props extends DefaultProps, PropsRequired {}\n}\n\nexport const propTypes = {\n text: PropTypes.string.description('Text to show.').isRequired,\n tooltipProps: PropTypes.object\n .description(\n 'This component uses DSTooltip component, you can set properties directly to this component with this property.',\n )\n .defaultValue({}),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,iBAAiB;AAcnB,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,YAAY,eAAe,EAAE;AAAA,EACpD,cAAc,UAAU,OACrB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,CAAC;AACpB;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- import type { DSTruncateTextWithTooltipT } from './propTypes.js';
2
- export declare const defaultProps: DSTruncateTextWithTooltipT.DefaultProps;
@@ -1,14 +0,0 @@
1
- export declare namespace DSTruncateTextWithTooltipT {
2
- interface PropsRequired {
3
- text: string;
4
- }
5
- interface DefaultProps {
6
- tooltipProps: Record<string, unknown>;
7
- }
8
- interface Props extends DefaultProps, PropsRequired {
9
- }
10
- }
11
- export declare const propTypes: {
12
- text: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
13
- tooltipProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
14
- };