@elliemae/ds-tooltip-v3 3.60.0-next.9 → 3.61.0-rc.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.
- package/dist/cjs/DSTooltipV3.js +9 -7
- package/dist/cjs/DSTooltipV3.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js +2 -2
- package/dist/cjs/config/useValidateProps.js.map +2 -2
- package/dist/cjs/{constants.js → constants/index.js} +27 -3
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/react-desc-prop-types.js +2 -1
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styles.js +17 -4
- package/dist/cjs/styles.js.map +2 -2
- package/dist/cjs/{TooltipV3DatatestId.js → typescript-testing/slot-props.js} +13 -15
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/DSTooltipV3.js +10 -8
- package/dist/esm/DSTooltipV3.js.map +2 -2
- package/dist/esm/config/useValidateProps.js +2 -2
- package/dist/esm/config/useValidateProps.js.map +2 -2
- package/dist/esm/constants/index.js +62 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +12 -2
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/package.json +1 -4
- package/dist/esm/react-desc-prop-types.js +3 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styles.js +17 -4
- package/dist/esm/styles.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +15 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/types/constants/index.d.ts +30 -0
- package/dist/types/index.d.ts +1 -2
- package/dist/types/react-desc-prop-types.d.ts +9 -1
- package/dist/types/tests/DSTooltipV3.exports.test.d.ts +1 -0
- package/dist/types/tests/DSTooltipV3.get-owner-props-arguments-slots.test.d.ts +1 -0
- package/dist/types/tests/DSTooltipV3.keyboard.test.d.ts +1 -0
- package/dist/types/typescript-testing/slot-props.d.ts +1 -0
- package/package.json +25 -28
- package/dist/cjs/TooltipV3DatatestId.js.map +0 -7
- package/dist/cjs/constants.js.map +0 -7
- package/dist/esm/TooltipV3DatatestId.js +0 -10
- package/dist/esm/TooltipV3DatatestId.js.map +0 -7
- package/dist/esm/constants.js +0 -38
- package/dist/esm/constants.js.map +0 -7
- package/dist/types/TooltipV3DatatestId.d.ts +0 -5
- package/dist/types/constants.d.ts +0 -18
- /package/dist/types/tests/{DSTooltipV3.TextComponentProp.test.d.ts → DSTooltipV3.a11y.test.d.ts} +0 -0
- /package/dist/types/tests/{DSTooltipV3.test.d.ts → DSTooltipV3.api.test.d.ts} +0 -0
- /package/dist/types/tests/{DSTooltipV3.validatePropIsStable.test.d.ts → DSTooltipV3.data-testid.test.d.ts} +0 -0
- /package/dist/types/tests/{DSTooltipv3.showPopover.test.d.ts → DSTooltipV3.events.test.d.ts} +0 -0
package/dist/cjs/DSTooltipV3.js
CHANGED
|
@@ -39,10 +39,9 @@ var import_react = __toESM(require("react"));
|
|
|
39
39
|
var import_ds_floating_context = require("@elliemae/ds-floating-context");
|
|
40
40
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
41
41
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
42
|
-
var import_TooltipV3DatatestId = require("./TooltipV3DatatestId.js");
|
|
43
42
|
var import_styles = require("./styles.js");
|
|
44
43
|
var import_useTooltipV3 = require("./config/useTooltipV3.js");
|
|
45
|
-
var import_constants = require("./constants.js");
|
|
44
|
+
var import_constants = require("./constants/index.js");
|
|
46
45
|
const DSTooltipV3 = (props) => {
|
|
47
46
|
const { propsWithDefault } = (0, import_useTooltipV3.useTooltipV3)(props);
|
|
48
47
|
const {
|
|
@@ -65,6 +64,7 @@ const DSTooltipV3 = (props) => {
|
|
|
65
64
|
Text,
|
|
66
65
|
textProps
|
|
67
66
|
} = propsWithDefault;
|
|
67
|
+
const ownerPropsConfig = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
68
68
|
const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = (0, import_ds_floating_context.useFloatingContext)({
|
|
69
69
|
placement: startPlacementPreference,
|
|
70
70
|
customOffset,
|
|
@@ -85,7 +85,8 @@ const DSTooltipV3 = (props) => {
|
|
|
85
85
|
{
|
|
86
86
|
...handlers,
|
|
87
87
|
innerRef: refs.setReference,
|
|
88
|
-
"data-testid": `${
|
|
88
|
+
"data-testid": `${import_constants.TOOLTIP_V3_DATA_TESTID.ROOT}${id !== "" ? `_${id}` : ""}`,
|
|
89
|
+
...ownerPropsConfig,
|
|
89
90
|
children: [
|
|
90
91
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
91
92
|
import_ds_floating_context.FloatingWrapper,
|
|
@@ -95,7 +96,7 @@ const DSTooltipV3 = (props) => {
|
|
|
95
96
|
floatingStyles,
|
|
96
97
|
context,
|
|
97
98
|
children: [
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledTooltipContainer, { "data-testid":
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledTooltipContainer, { "data-testid": import_constants.TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER, ...ownerPropsConfig, children: [
|
|
99
100
|
Text ? (
|
|
100
101
|
// this "as T" is an oversimplification but it's safe due to how js {...undefined} works
|
|
101
102
|
// users of the component that want the strict types will define T, others won't, no reason to force it on our end
|
|
@@ -103,14 +104,15 @@ const DSTooltipV3 = (props) => {
|
|
|
103
104
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
105
|
import_styles.StyledTooltipText,
|
|
105
106
|
{
|
|
106
|
-
"data-testid":
|
|
107
|
+
"data-testid": import_constants.TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT,
|
|
107
108
|
textAlign,
|
|
108
109
|
wrapWords,
|
|
109
110
|
$applyTooltipOverflowWrap: applyTooltipOverflowWrap,
|
|
111
|
+
...ownerPropsConfig,
|
|
110
112
|
children: text
|
|
111
113
|
}
|
|
112
114
|
),
|
|
113
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledMouseOverDetectionBox, {})
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledMouseOverDetectionBox, { ...ownerPropsConfig })
|
|
114
116
|
] }),
|
|
115
117
|
!withoutArrow ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles }) : null
|
|
116
118
|
]
|
|
@@ -121,7 +123,7 @@ const DSTooltipV3 = (props) => {
|
|
|
121
123
|
}
|
|
122
124
|
);
|
|
123
125
|
};
|
|
124
|
-
DSTooltipV3.displayName = import_constants.
|
|
126
|
+
DSTooltipV3.displayName = import_constants.DSTooltipV3SlotName;
|
|
125
127
|
const DSTooltipV3WithSchema = (0, import_ds_props_helpers.describe)(DSTooltipV3);
|
|
126
128
|
DSTooltipV3WithSchema.propTypes = import_react_desc_prop_types.DSTooltipV3PropTypesSchema;
|
|
127
129
|
var DSTooltipV3_default = DSTooltipV3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSTooltipV3.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styles.js';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { useTooltipV3 } from './config/useTooltipV3.js';\nimport { DSTooltipV3SlotName, TOOLTIP_V3_DATA_TESTID } from './constants/index.js';\n\nconst DSTooltipV3 = <T extends DSTooltipV3T.CustomInterface>(props: DSTooltipV3T.Props<T>) => {\n const { propsWithDefault } = useTooltipV3(props);\n\n const {\n text,\n startPlacementPreference,\n children,\n onOpen,\n onClose,\n id,\n textAlign,\n wrapWords,\n withoutArrow,\n customOffset,\n animationDuration,\n withoutAnimation,\n withoutPortal,\n portalDOMContainer,\n applyTooltipOverflowWrap,\n showPopover,\n Text,\n textProps,\n } = propsWithDefault;\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = useFloatingContext({\n placement: startPlacementPreference,\n customOffset,\n onOpen,\n onClose,\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n externallyControlledIsOpen: showPopover,\n });\n\n const isOpenSourceOfTruth = React.useMemo(() => {\n if (showPopover !== undefined) return showPopover;\n return isOpen;\n }, [showPopover, isOpen]);\n\n return (\n <StyledTriggerWrapper\n {...handlers}\n innerRef={refs.setReference}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={`${TOOLTIP_V3_DATA_TESTID.ROOT}${id !== '' ? `_${id}` : ''}`}\n {...ownerPropsConfig}\n >\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isOpenSourceOfTruth}\n floatingStyles={floatingStyles}\n context={context}\n >\n {/* legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed */}\n <StyledTooltipContainer data-testid={TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER} {...ownerPropsConfig}>\n {Text ? (\n // this \"as T\" is an oversimplification but it's safe due to how js {...undefined} works\n // users of the component that want the strict types will define T, others won't, no reason to force it on our end\n <Text {...(textProps as T)} />\n ) : (\n <StyledTooltipText\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT}\n textAlign={textAlign}\n wrapWords={wrapWords}\n $applyTooltipOverflowWrap={applyTooltipOverflowWrap}\n {...ownerPropsConfig}\n >\n {text}\n </StyledTooltipText>\n )}\n <StyledMouseOverDetectionBox {...ownerPropsConfig} />\n </StyledTooltipContainer>\n {!withoutArrow ? <PopoverArrow {...arrowStyles} /> : null}\n </FloatingWrapper>\n\n {children}\n </StyledTriggerWrapper>\n );\n};\n\nDSTooltipV3.displayName = DSTooltipV3SlotName;\nconst DSTooltipV3WithSchema = describe(DSTooltipV3);\nDSTooltipV3WithSchema.propTypes = DSTooltipV3PropTypesSchema;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\n\nexport default DSTooltipV3;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyEf;AAxER,mBAAkB;AAClB,iCAAkE;AAClE,8BAAwC;AACxC,mCAA2C;AAC3C,oBAKO;AAEP,0BAA6B;AAC7B,uBAA4D;AAE5D,MAAM,cAAc,CAAyC,UAAiC;AAC5F,QAAM,EAAE,iBAAiB,QAAI,kCAAa,KAAK;AAE/C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,uBAAmB,uCAAc,gBAAgB;AAEvD,QAAM,EAAE,UAAU,aAAa,gBAAgB,QAAQ,MAAM,QAAQ,QAAI,+CAAmB;AAAA,IAC1F,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,4BAA4B;AAAA,EAC9B,CAAC;AAED,QAAM,sBAAsB,aAAAA,QAAM,QAAQ,MAAM;AAC9C,QAAI,gBAAgB,OAAW,QAAO;AACtC,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,MAAM,CAAC;AAExB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,KAAK;AAAA,MAEf,eAAa,GAAG,wCAAuB,IAAI,GAAG,OAAO,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,MACtE,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YAGA;AAAA,2DAAC,wCAAuB,eAAa,wCAAuB,mBAAoB,GAAG,kBAChF;AAAA;AAAA;AAAA;AAAA,kBAGC,4CAAC,QAAM,GAAI,WAAiB;AAAA,oBAE5B;AAAA,kBAAC;AAAA;AAAA,oBAEC,eAAa,wCAAuB;AAAA,oBACpC;AAAA,oBACA;AAAA,oBACA,2BAA2B;AAAA,oBAC1B,GAAG;AAAA,oBAEH;AAAA;AAAA,gBACH;AAAA,gBAEF,4CAAC,6CAA6B,GAAG,kBAAkB;AAAA,iBACrD;AAAA,cACC,CAAC,eAAe,4CAAC,2CAAc,GAAG,aAAa,IAAK;AAAA;AAAA;AAAA,QACvD;AAAA,QAEC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,4BAAwB,kCAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -33,8 +33,8 @@ __export(useValidateProps_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(useValidateProps_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
-
var import_constants = require("../constants.js");
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
37
|
const useValidateProps = (props, propTypes) => {
|
|
38
|
-
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.
|
|
38
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSTooltipV3SlotName);
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport { DSTooltipV3SlotName } from '../constants/index.js';\n\nexport const useValidateProps = <T extends DSTooltipV3T.CustomInterface>(\n props: DSTooltipV3T.InternalProps<T>,\n propTypes: ValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSTooltipV3SlotName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAoC;AAE7B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,oCAAmB;AACtE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,13 +28,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var constants_exports = {};
|
|
30
30
|
__export(constants_exports, {
|
|
31
|
-
|
|
31
|
+
DSTooltipV3SlotName: () => DSTooltipV3SlotName,
|
|
32
32
|
PLACEMENT: () => PLACEMENT,
|
|
33
33
|
TEXT_ALIGNMENT: () => TEXT_ALIGNMENT,
|
|
34
|
+
TOOLTIP_V3_DATA_TESTID: () => TOOLTIP_V3_DATA_TESTID,
|
|
35
|
+
TOOLTIP_V3_SLOTS: () => TOOLTIP_V3_SLOTS,
|
|
36
|
+
TooltipV3DatatestId: () => TooltipV3DatatestId,
|
|
34
37
|
tooltipPositions: () => tooltipPositions
|
|
35
38
|
});
|
|
36
39
|
module.exports = __toCommonJS(constants_exports);
|
|
37
40
|
var React = __toESM(require("react"));
|
|
41
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
38
42
|
const PLACEMENT = [
|
|
39
43
|
"top-start",
|
|
40
44
|
"top",
|
|
@@ -50,7 +54,27 @@ const PLACEMENT = [
|
|
|
50
54
|
"left-start"
|
|
51
55
|
];
|
|
52
56
|
const TEXT_ALIGNMENT = ["left", "right", "center", "justify", "initial", "inherit"];
|
|
53
|
-
const
|
|
57
|
+
const DSTooltipV3SlotName = "DSTooltipv3";
|
|
58
|
+
const TOOLTIP_V3_SLOTS = {
|
|
59
|
+
ROOT: "root",
|
|
60
|
+
TOOLTIP_CONTAINER: "tooltip-container",
|
|
61
|
+
// legacy test id
|
|
62
|
+
TOOLTIP_TEXT: "tooltip-text",
|
|
63
|
+
// legacy test id
|
|
64
|
+
MOUSE_OVER_DETECTION_BOX: "mouse-over-detection-box"
|
|
65
|
+
};
|
|
66
|
+
const TOOLTIP_V3_DATA_TESTID = {
|
|
67
|
+
...(0, import_ds_system.slotObjectToDataTestIds)(DSTooltipV3SlotName, TOOLTIP_V3_SLOTS),
|
|
68
|
+
// legacy test IDs — preserved for QA/consumer compatibility, breaking change if removed
|
|
69
|
+
ROOT: "ds-tooltip-v3-trigger-wrapper",
|
|
70
|
+
TOOLTIP_CONTAINER: "ds-tooltip-v3-tooltip-text-wrapper",
|
|
71
|
+
TOOLTIP_TEXT: "ds-tooltip-v3-opinionated-text-wrapper"
|
|
72
|
+
};
|
|
73
|
+
const TooltipV3DatatestId = {
|
|
74
|
+
TRIGGER_WRAPPER: TOOLTIP_V3_DATA_TESTID.ROOT,
|
|
75
|
+
TOOLTIP_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER,
|
|
76
|
+
OPINIONATED_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT
|
|
77
|
+
};
|
|
54
78
|
const tooltipPositions = {
|
|
55
79
|
TOP: "top",
|
|
56
80
|
BOTTOM: "bottom",
|
|
@@ -65,4 +89,4 @@ const tooltipPositions = {
|
|
|
65
89
|
LEFT_START: "left-start",
|
|
66
90
|
LEFT_END: "left-end"
|
|
67
91
|
};
|
|
68
|
-
//# sourceMappingURL=
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const PLACEMENT = [\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n\nexport const TEXT_ALIGNMENT = ['left', 'right', 'center', 'justify', 'initial', 'inherit'];\n\n// Slot system name \u2014 single-capitalisation PascalCase after DS prefix (checkNamingConvention enforced)\nexport const DSTooltipV3SlotName = 'DSTooltipv3';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const TOOLTIP_V3_SLOTS = {\n ROOT: 'root',\n TOOLTIP_CONTAINER: 'tooltip-container', // legacy test id\n TOOLTIP_TEXT: 'tooltip-text', // legacy test id\n MOUSE_OVER_DETECTION_BOX: 'mouse-over-detection-box',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const TOOLTIP_V3_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSTooltipV3SlotName, TOOLTIP_V3_SLOTS),\n // legacy test IDs \u2014 preserved for QA/consumer compatibility, breaking change if removed\n ROOT: 'ds-tooltip-v3-trigger-wrapper',\n TOOLTIP_CONTAINER: 'ds-tooltip-v3-tooltip-text-wrapper',\n TOOLTIP_TEXT: 'ds-tooltip-v3-opinionated-text-wrapper',\n} as Record<keyof typeof TOOLTIP_V3_SLOTS, string>;\n\n// Legacy export \u2014 kept for backward compatibility. TOOLTIP_V3_DATA_TESTID is the source of truth.\n// Do not add new values here; add them to TOOLTIP_V3_SLOTS instead and the data-testid be generated automatically.\nexport const TooltipV3DatatestId = {\n TRIGGER_WRAPPER: TOOLTIP_V3_DATA_TESTID.ROOT,\n TOOLTIP_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER,\n OPINIONATED_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT,\n};\n\n// many stories where using this from ds-tooltip.\n// we need to preserve this format to avoid breaking changes.\nconst tooltipPositions = {\n TOP: 'top' as const,\n BOTTOM: 'bottom' as const,\n RIGHT: 'right' as const,\n LEFT: 'left' as const,\n TOP_START: 'top-start' as const,\n TOP_END: 'top-end' as const,\n BOTTOM_START: 'bottom-start' as const,\n BOTTOM_END: 'bottom-end' as const,\n RIGHT_START: 'right-start' as const,\n RIGHT_END: 'right-end' as const,\n LEFT_START: 'left-start' as const,\n LEFT_END: 'left-end' as const,\n};\n\nexport { tooltipPositions };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,iBAAiB,CAAC,QAAQ,SAAS,UAAU,WAAW,WAAW,SAAS;AAGlF,MAAM,sBAAsB;AAG5B,MAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,mBAAmB;AAAA;AAAA,EACnB,cAAc;AAAA;AAAA,EACd,0BAA0B;AAC5B;AAGO,MAAM,yBAAyB;AAAA,EACpC,OAAG,0CAAwB,qBAAqB,gBAAgB;AAAA;AAAA,EAEhE,MAAM;AAAA,EACN,mBAAmB;AAAA,EACnB,cAAc;AAChB;AAIO,MAAM,sBAAsB;AAAA,EACjC,iBAAiB,uBAAuB;AAAA,EACxC,sBAAsB,uBAAuB;AAAA,EAC7C,0BAA0B,uBAAuB;AACnD;AAIA,MAAM,mBAAmB;AAAA,EACvB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,15 +29,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var index_exports = {};
|
|
30
30
|
__export(index_exports, {
|
|
31
31
|
DSTooltipV3: () => import_DSTooltipV3.DSTooltipV3,
|
|
32
|
+
DSTooltipV3SlotName: () => import_constants.DSTooltipV3SlotName,
|
|
32
33
|
DSTooltipV3WithSchema: () => import_DSTooltipV3.DSTooltipV3WithSchema,
|
|
33
34
|
PLACEMENT: () => import_constants.PLACEMENT,
|
|
34
35
|
TEXT_ALIGNMENT: () => import_constants.TEXT_ALIGNMENT,
|
|
35
|
-
|
|
36
|
+
TOOLTIP_V3_DATA_TESTID: () => import_constants.TOOLTIP_V3_DATA_TESTID,
|
|
37
|
+
TOOLTIP_V3_SLOTS: () => import_constants.TOOLTIP_V3_SLOTS,
|
|
38
|
+
TooltipV3DatatestId: () => import_constants.TooltipV3DatatestId,
|
|
36
39
|
tooltipPositions: () => import_constants.tooltipPositions
|
|
37
40
|
});
|
|
38
41
|
module.exports = __toCommonJS(index_exports);
|
|
39
42
|
var React = __toESM(require("react"));
|
|
40
43
|
var import_DSTooltipV3 = require("./DSTooltipV3.js");
|
|
41
|
-
var
|
|
42
|
-
var import_constants = require("./constants.js");
|
|
44
|
+
var import_constants = require("./constants/index.js");
|
|
43
45
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { DSTooltipV3, DSTooltipV3WithSchema } from './DSTooltipV3.js';\nexport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAmD;
|
|
4
|
+
"sourcesContent": ["export { DSTooltipV3, DSTooltipV3WithSchema } from './DSTooltipV3.js';\nexport { type DSTooltipV3T } from './react-desc-prop-types.js';\nexport {\n tooltipPositions,\n PLACEMENT,\n TEXT_ALIGNMENT,\n DSTooltipV3SlotName,\n TOOLTIP_V3_SLOTS,\n TOOLTIP_V3_DATA_TESTID,\n TooltipV3DatatestId,\n} from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAmD;AAEnD,uBAQO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/package.json
CHANGED
|
@@ -34,8 +34,9 @@ __export(react_desc_prop_types_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
-
var import_constants = require("./constants.js");
|
|
37
|
+
var import_constants = require("./constants/index.js");
|
|
38
38
|
const DSTooltipV3PropTypes = {
|
|
39
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSTooltipV3SlotName, import_constants.TOOLTIP_V3_SLOTS),
|
|
39
40
|
text: import_ds_props_helpers.PropTypes.string.description(
|
|
40
41
|
"Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence."
|
|
41
42
|
).isRequiredIf((props) => !props.Text),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT } from './constants.js';\n\nexport declare namespace DSTooltipV3T {\n export type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset: [number, number];\n }\n\n export interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,
|
|
4
|
+
"sourcesContent": ["import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, getPropsPerSlotPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT, DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from './constants/index.js';\n\nexport declare namespace DSTooltipV3T {\n export type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset: [number, number];\n }\n\n export type SlotFunctionArguments = {\n dsTooltipv3Root: () => object;\n dsTooltipv3TooltipContainer: () => object;\n dsTooltipv3TooltipText: () => object;\n dsTooltipv3MouseOverDetectionBox: () => object;\n };\n\n export interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown>>\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSTooltipV3SlotName, typeof TOOLTIP_V3_SLOTS> {\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n portalDOMContainer?: HTMLElement;\n showPopover?: boolean;\n Text?: React.ComponentType<T>;\n textProps?: T;\n text?: string;\n }\n\n export interface RequiredProps {\n children: React.ReactNode;\n }\n export interface InternalProps<T extends CustomInterface = CustomInterface>\n extends DefaultProps,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface Props<T extends CustomInterface = CustomInterface>\n extends Partial<DefaultProps>,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const DSTooltipV3PropTypes: DSPropTypesSchema<DSTooltipV3T.Props> = {\n ...getPropsPerSlotPropTypes(DSTooltipV3SlotName, TOOLTIP_V3_SLOTS),\n text: PropTypes.string\n .description(\n 'Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.Text),\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n applyTooltipOverflowWrap: PropTypes.bool\n .description(\n 'when a tooltip is present, the tooltip text may be too long to fit in the pill. If true, the tooltip will wrap to the next line using overflow-wrap',\n )\n .defaultValue(false),\n wrapWords: PropTypes.bool\n .description('Break words into a new line. Useful when words exceed tooltip max-lenght.')\n .defaultValue(false),\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n portalDOMContainer: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n startPlacementPreference: PropTypes.oneOf(PLACEMENT)\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n showPopover: PropTypes.bool.description('Whether or not the tooltip should be always shown'),\n Text: PropTypes.func\n .description(\n 'Custom component to be displayed in the tooltip, will receive textProps as props. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.text),\n textProps: PropTypes.object.description(\n 'Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance',\n ),\n};\n\nexport const DSTooltipV3PropTypesSchema = DSTooltipV3PropTypes as unknown as ValidationMap<DSTooltipV3T.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAoD;AAEpD,uBAAiF;AAoE1E,MAAM,uBAA8D;AAAA,EACzE,OAAG,kDAAyB,sCAAqB,iCAAgB;AAAA,EACjE,MAAM,kCAAU,OACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,kCAAU,MAAM,+BAAsC,EAC9D,YAAY,wBAAwB,EACpC,aAAa,MAAM;AAAA,EACtB,0BAA0B,kCAAU,KACjC;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,WAAW,kCAAU,KAClB,YAAY,2EAA2E,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,KAAK,YAAY,sDAAsD,EAAE;AAAA,EAC7F,eAAe,kCAAU,KACtB,YAAY,yEAAyE,EACrF,aAAa,IAAI;AAAA,EACpB,cAAc,kCAAU,KAAK,YAAY,iDAAiD,EAAE,aAAa,KAAK;AAAA,EAC9G,kBAAkB,kCAAU,KACzB,YAAY,2DAA2D,EACvE,aAAa,KAAK;AAAA,EACrB,mBAAmB,kCAAU,OAAO,YAAY,+CAA+C,EAAE,aAAa,GAAG;AAAA,EACjH,oBAAoB,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC9E,YAAY,gGAAgG,EAC5G,aAAa,MAAS;AAAA,EACzB,0BAA0B,kCAAU,MAAM,0BAAS,EAChD,YAAY,+DAA+D,EAC3E,aAAa,OAAO;AAAA,EACvB,cAAc,kCAAU,QAAQ,kCAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE,aAAa,CAAC,GAAG,EAAE,CAAC;AAAA,EAC5G,IAAI,kCAAU,OAAO,YAAY,qCAAqC,EAAE,aAAa,EAAE;AAAA,EACvF,QAAQ,kCAAU,KAAK,YAAY,wDAAwD,EAAE,aAAa,UAAU;AAAA,EACpH,SAAS,kCAAU,KAChB,YAAY,yDAAyD,EACrE,aAAa,UAAU;AAAA,EAC1B,aAAa,kCAAU,KAAK,YAAY,mDAAmD;AAAA,EAC3F,MAAM,kCAAU,KACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,kCAAU,OAAO;AAAA,IAC1B;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -36,7 +36,11 @@ __export(styles_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(styles_exports);
|
|
37
37
|
var React = __toESM(require("react"));
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
-
|
|
39
|
+
var import_constants = require("./constants/index.js");
|
|
40
|
+
const StyledTooltipContainer = (0, import_ds_system.styled)("div", {
|
|
41
|
+
name: import_constants.DSTooltipV3SlotName,
|
|
42
|
+
slot: import_constants.TOOLTIP_V3_SLOTS.TOOLTIP_CONTAINER
|
|
43
|
+
})`
|
|
40
44
|
text-align: center;
|
|
41
45
|
min-width: ${({ theme }) => theme.space.l};
|
|
42
46
|
max-width: 250px;
|
|
@@ -50,7 +54,10 @@ const StyledTooltipContainer = import_ds_system.styled.div`
|
|
|
50
54
|
font-size: 13px;
|
|
51
55
|
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
52
56
|
`;
|
|
53
|
-
const StyledTooltipText = import_ds_system.styled
|
|
57
|
+
const StyledTooltipText = (0, import_ds_system.styled)("div", {
|
|
58
|
+
name: import_constants.DSTooltipV3SlotName,
|
|
59
|
+
slot: import_constants.TOOLTIP_V3_SLOTS.TOOLTIP_TEXT
|
|
60
|
+
})`
|
|
54
61
|
display: inline-block;
|
|
55
62
|
text-align: ${({ textAlign }) => textAlign};
|
|
56
63
|
|
|
@@ -69,7 +76,10 @@ const StyledTooltipText = import_ds_system.styled.div`
|
|
|
69
76
|
overflow-wrap: break-word;`;
|
|
70
77
|
}};
|
|
71
78
|
`;
|
|
72
|
-
const StyledMouseOverDetectionBox = import_ds_system.styled
|
|
79
|
+
const StyledMouseOverDetectionBox = (0, import_ds_system.styled)("div", {
|
|
80
|
+
name: import_constants.DSTooltipV3SlotName,
|
|
81
|
+
slot: import_constants.TOOLTIP_V3_SLOTS.MOUSE_OVER_DETECTION_BOX
|
|
82
|
+
})`
|
|
73
83
|
position: absolute;
|
|
74
84
|
top: -15px;
|
|
75
85
|
right: -15px;
|
|
@@ -77,7 +87,10 @@ const StyledMouseOverDetectionBox = import_ds_system.styled.div`
|
|
|
77
87
|
height: calc(100% + 30px);
|
|
78
88
|
z-index: -1;
|
|
79
89
|
`;
|
|
80
|
-
const StyledTriggerWrapper = import_ds_system.styled
|
|
90
|
+
const StyledTriggerWrapper = (0, import_ds_system.styled)("div", {
|
|
91
|
+
name: import_constants.DSTooltipV3SlotName,
|
|
92
|
+
slot: import_constants.TOOLTIP_V3_SLOTS.ROOT
|
|
93
|
+
})`
|
|
81
94
|
display: inline-flex;
|
|
82
95
|
width: 100%;
|
|
83
96
|
`;
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\n\ninterface StyledTooltipTextT {\n wrapWords: boolean;\n textAlign: DSTooltipV3T.TextAlignment;\n}\n\nexport const StyledTooltipContainer = styled.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;
|
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from './constants/index.js';\n\ninterface StyledTooltipTextT {\n wrapWords: boolean;\n textAlign: DSTooltipV3T.TextAlignment;\n}\n\nexport const StyledTooltipContainer = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n`;\n\nexport const StyledTooltipText = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.TOOLTIP_TEXT,\n})<StyledTooltipTextT & { $applyTooltipOverflowWrap: boolean }>`\n display: inline-block;\n text-align: ${({ textAlign }) => textAlign};\n\n ${({ wrapWords, $applyTooltipOverflowWrap }) => {\n if ($applyTooltipOverflowWrap) {\n // word-wrap: break-word; // <- this is the legacy \"overflow-wrap\" property, we should not need the legacy declaration\n // min-width: 0px; // <-- min-width:0px is needed because css grid auto-sizing are broken in css and impossible to understand\n return `overflow-wrap: break-word;\n white-space: pre-wrap;\n min-width: 0px;`;\n }\n if (wrapWords) {\n return `white-space: pre-wrap;\n word-break: break-all;\n overflow-wrap: break-word;`;\n }\n return `white-space: normal;\n overflow-wrap: break-word;`;\n }};\n`;\n\nexport const StyledMouseOverDetectionBox = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.MOUSE_OVER_DETECTION_BOX,\n})`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n\nexport const StyledTriggerWrapper = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.ROOT,\n})`\n display: inline-flex;\n width: 100%;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAEvB,uBAAsD;AAO/C,MAAM,6BAAyB,yBAAO,OAAO;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,kCAAiB;AACzB,CAAC;AAAA;AAAA,eAEc,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAK9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,WAKxD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAG5C,MAAM,wBAAoB,yBAAO,OAAO;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,kCAAiB;AACzB,CAAC;AAAA;AAAA,gBAEe,CAAC,EAAE,UAAU,MAAM,SAAS;AAAA;AAAA,IAExC,CAAC,EAAE,WAAW,0BAA0B,MAAM;AAC9C,MAAI,2BAA2B;AAG7B,WAAO;AAAA;AAAA;AAAA,EAGT;AACA,MAAI,WAAW;AACb,WAAO;AAAA;AAAA;AAAA,EAGT;AACA,SAAO;AAAA;AAET,CAAC;AAAA;AAGI,MAAM,kCAA8B,yBAAO,OAAO;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,kCAAiB;AACzB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASM,MAAM,2BAAuB,yBAAO,OAAO;AAAA,EAChD,MAAM;AAAA,EACN,MAAM,kCAAiB;AACzB,CAAC;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,10 +5,6 @@ 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
|
-
};
|
|
12
8
|
var __copyProps = (to, from, except, desc) => {
|
|
13
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,16 +21,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
22
|
mod
|
|
27
23
|
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var TooltipV3DatatestId_exports = {};
|
|
30
|
-
__export(TooltipV3DatatestId_exports, {
|
|
31
|
-
TooltipV3DatatestId: () => TooltipV3DatatestId
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(TooltipV3DatatestId_exports);
|
|
34
24
|
var React = __toESM(require("react"));
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
const SlotPropsAsObj = {
|
|
26
|
+
dsTooltipv3Root: { "aria-label": "just a typescript test" },
|
|
27
|
+
dsTooltipv3TooltipContainer: { "aria-label": "just a typescript test" },
|
|
28
|
+
dsTooltipv3TooltipText: { "aria-label": "just a typescript test" },
|
|
29
|
+
dsTooltipv3MouseOverDetectionBox: { "aria-label": "just a typescript test" }
|
|
30
|
+
};
|
|
31
|
+
const SlotPropsAsFunctions = {
|
|
32
|
+
dsTooltipv3Root: () => ({ "aria-label": "just a typescript test" }),
|
|
33
|
+
dsTooltipv3TooltipContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
34
|
+
dsTooltipv3TooltipText: () => ({ "aria-label": "just a typescript test" }),
|
|
35
|
+
dsTooltipv3MouseOverDetectionBox: () => ({ "aria-label": "just a typescript test" })
|
|
39
36
|
};
|
|
40
|
-
|
|
37
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
38
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from '../constants/index.js';\nimport type { DSTooltipV3T } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObj: Partial<DSTooltipV3T.Props> = {\n dsTooltipv3Root: { 'aria-label': 'just a typescript test' },\n dsTooltipv3TooltipContainer: { 'aria-label': 'just a typescript test' },\n dsTooltipv3TooltipText: { 'aria-label': 'just a typescript test' },\n dsTooltipv3MouseOverDetectionBox: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSTooltipV3T.SlotFunctionArguments = {\n dsTooltipv3Root: () => ({ 'aria-label': 'just a typescript test' }),\n dsTooltipv3TooltipContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsTooltipv3TooltipText: () => ({ 'aria-label': 'just a typescript test' }),\n dsTooltipv3MouseOverDetectionBox: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSTooltipV3SlotName, typeof TOOLTIP_V3_SLOTS>\n> = SlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACMvB,MAAM,iBAA8C;AAAA,EAClD,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,wBAAwB,EAAE,cAAc,yBAAyB;AAAA,EACjE,kCAAkC,EAAE,cAAc,yBAAyB;AAC7E;AAEA,MAAM,uBAA2D;AAAA,EAC/D,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC7E,wBAAwB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACxE,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AACpF;AAGA,MAAM,6CAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/DSTooltipV3.js
CHANGED
|
@@ -2,9 +2,8 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2 from "react";
|
|
4
4
|
import { useFloatingContext, PopoverArrow, FloatingWrapper } from "@elliemae/ds-floating-context";
|
|
5
|
-
import { describe } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { describe, useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
6
6
|
import { DSTooltipV3PropTypesSchema } from "./react-desc-prop-types.js";
|
|
7
|
-
import { TooltipV3DatatestId } from "./TooltipV3DatatestId.js";
|
|
8
7
|
import {
|
|
9
8
|
StyledTooltipContainer,
|
|
10
9
|
StyledTooltipText,
|
|
@@ -12,7 +11,7 @@ import {
|
|
|
12
11
|
StyledTriggerWrapper
|
|
13
12
|
} from "./styles.js";
|
|
14
13
|
import { useTooltipV3 } from "./config/useTooltipV3.js";
|
|
15
|
-
import {
|
|
14
|
+
import { DSTooltipV3SlotName, TOOLTIP_V3_DATA_TESTID } from "./constants/index.js";
|
|
16
15
|
const DSTooltipV3 = (props) => {
|
|
17
16
|
const { propsWithDefault } = useTooltipV3(props);
|
|
18
17
|
const {
|
|
@@ -35,6 +34,7 @@ const DSTooltipV3 = (props) => {
|
|
|
35
34
|
Text,
|
|
36
35
|
textProps
|
|
37
36
|
} = propsWithDefault;
|
|
37
|
+
const ownerPropsConfig = useOwnerProps(propsWithDefault);
|
|
38
38
|
const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = useFloatingContext({
|
|
39
39
|
placement: startPlacementPreference,
|
|
40
40
|
customOffset,
|
|
@@ -55,7 +55,8 @@ const DSTooltipV3 = (props) => {
|
|
|
55
55
|
{
|
|
56
56
|
...handlers,
|
|
57
57
|
innerRef: refs.setReference,
|
|
58
|
-
"data-testid": `${
|
|
58
|
+
"data-testid": `${TOOLTIP_V3_DATA_TESTID.ROOT}${id !== "" ? `_${id}` : ""}`,
|
|
59
|
+
...ownerPropsConfig,
|
|
59
60
|
children: [
|
|
60
61
|
/* @__PURE__ */ jsxs(
|
|
61
62
|
FloatingWrapper,
|
|
@@ -65,7 +66,7 @@ const DSTooltipV3 = (props) => {
|
|
|
65
66
|
floatingStyles,
|
|
66
67
|
context,
|
|
67
68
|
children: [
|
|
68
|
-
/* @__PURE__ */ jsxs(StyledTooltipContainer, { "data-testid":
|
|
69
|
+
/* @__PURE__ */ jsxs(StyledTooltipContainer, { "data-testid": TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER, ...ownerPropsConfig, children: [
|
|
69
70
|
Text ? (
|
|
70
71
|
// this "as T" is an oversimplification but it's safe due to how js {...undefined} works
|
|
71
72
|
// users of the component that want the strict types will define T, others won't, no reason to force it on our end
|
|
@@ -73,14 +74,15 @@ const DSTooltipV3 = (props) => {
|
|
|
73
74
|
) : /* @__PURE__ */ jsx(
|
|
74
75
|
StyledTooltipText,
|
|
75
76
|
{
|
|
76
|
-
"data-testid":
|
|
77
|
+
"data-testid": TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT,
|
|
77
78
|
textAlign,
|
|
78
79
|
wrapWords,
|
|
79
80
|
$applyTooltipOverflowWrap: applyTooltipOverflowWrap,
|
|
81
|
+
...ownerPropsConfig,
|
|
80
82
|
children: text
|
|
81
83
|
}
|
|
82
84
|
),
|
|
83
|
-
/* @__PURE__ */ jsx(StyledMouseOverDetectionBox, {})
|
|
85
|
+
/* @__PURE__ */ jsx(StyledMouseOverDetectionBox, { ...ownerPropsConfig })
|
|
84
86
|
] }),
|
|
85
87
|
!withoutArrow ? /* @__PURE__ */ jsx(PopoverArrow, { ...arrowStyles }) : null
|
|
86
88
|
]
|
|
@@ -91,7 +93,7 @@ const DSTooltipV3 = (props) => {
|
|
|
91
93
|
}
|
|
92
94
|
);
|
|
93
95
|
};
|
|
94
|
-
DSTooltipV3.displayName =
|
|
96
|
+
DSTooltipV3.displayName = DSTooltipV3SlotName;
|
|
95
97
|
const DSTooltipV3WithSchema = describe(DSTooltipV3);
|
|
96
98
|
DSTooltipV3WithSchema.propTypes = DSTooltipV3PropTypesSchema;
|
|
97
99
|
var DSTooltipV3_default = DSTooltipV3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSTooltipV3.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSTooltipV3PropTypesSchema } from './react-desc-prop-types.js';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styles.js';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { useTooltipV3 } from './config/useTooltipV3.js';\nimport { DSTooltipV3SlotName, TOOLTIP_V3_DATA_TESTID } from './constants/index.js';\n\nconst DSTooltipV3 = <T extends DSTooltipV3T.CustomInterface>(props: DSTooltipV3T.Props<T>) => {\n const { propsWithDefault } = useTooltipV3(props);\n\n const {\n text,\n startPlacementPreference,\n children,\n onOpen,\n onClose,\n id,\n textAlign,\n wrapWords,\n withoutArrow,\n customOffset,\n animationDuration,\n withoutAnimation,\n withoutPortal,\n portalDOMContainer,\n applyTooltipOverflowWrap,\n showPopover,\n Text,\n textProps,\n } = propsWithDefault;\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n const { handlers, arrowStyles, floatingStyles, isOpen, refs, context } = useFloatingContext({\n placement: startPlacementPreference,\n customOffset,\n onOpen,\n onClose,\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n externallyControlledIsOpen: showPopover,\n });\n\n const isOpenSourceOfTruth = React.useMemo(() => {\n if (showPopover !== undefined) return showPopover;\n return isOpen;\n }, [showPopover, isOpen]);\n\n return (\n <StyledTriggerWrapper\n {...handlers}\n innerRef={refs.setReference}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={`${TOOLTIP_V3_DATA_TESTID.ROOT}${id !== '' ? `_${id}` : ''}`}\n {...ownerPropsConfig}\n >\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isOpenSourceOfTruth}\n floatingStyles={floatingStyles}\n context={context}\n >\n {/* legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed */}\n <StyledTooltipContainer data-testid={TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER} {...ownerPropsConfig}>\n {Text ? (\n // this \"as T\" is an oversimplification but it's safe due to how js {...undefined} works\n // users of the component that want the strict types will define T, others won't, no reason to force it on our end\n <Text {...(textProps as T)} />\n ) : (\n <StyledTooltipText\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT}\n textAlign={textAlign}\n wrapWords={wrapWords}\n $applyTooltipOverflowWrap={applyTooltipOverflowWrap}\n {...ownerPropsConfig}\n >\n {text}\n </StyledTooltipText>\n )}\n <StyledMouseOverDetectionBox {...ownerPropsConfig} />\n </StyledTooltipContainer>\n {!withoutArrow ? <PopoverArrow {...arrowStyles} /> : null}\n </FloatingWrapper>\n\n {children}\n </StyledTriggerWrapper>\n );\n};\n\nDSTooltipV3.displayName = DSTooltipV3SlotName;\nconst DSTooltipV3WithSchema = describe(DSTooltipV3);\nDSTooltipV3WithSchema.propTypes = DSTooltipV3PropTypesSchema;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\n\nexport default DSTooltipV3;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyEf,SAII,KAJJ;AAxER,OAAOA,YAAW;AAClB,SAAS,oBAAoB,cAAc,uBAAuB;AAClE,SAAS,UAAU,qBAAqB;AACxC,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB,8BAA8B;AAE5D,MAAM,cAAc,CAAyC,UAAiC;AAC5F,QAAM,EAAE,iBAAiB,IAAI,aAAa,KAAK;AAE/C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,mBAAmB,cAAc,gBAAgB;AAEvD,QAAM,EAAE,UAAU,aAAa,gBAAgB,QAAQ,MAAM,QAAQ,IAAI,mBAAmB;AAAA,IAC1F,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,4BAA4B;AAAA,EAC9B,CAAC;AAED,QAAM,sBAAsBA,OAAM,QAAQ,MAAM;AAC9C,QAAI,gBAAgB,OAAW,QAAO;AACtC,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,MAAM,CAAC;AAExB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,KAAK;AAAA,MAEf,eAAa,GAAG,uBAAuB,IAAI,GAAG,OAAO,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,MACtE,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YAGA;AAAA,mCAAC,0BAAuB,eAAa,uBAAuB,mBAAoB,GAAG,kBAChF;AAAA;AAAA;AAAA;AAAA,kBAGC,oBAAC,QAAM,GAAI,WAAiB;AAAA,oBAE5B;AAAA,kBAAC;AAAA;AAAA,oBAEC,eAAa,uBAAuB;AAAA,oBACpC;AAAA,oBACA;AAAA,oBACA,2BAA2B;AAAA,oBAC1B,GAAG;AAAA,oBAEH;AAAA;AAAA,gBACH;AAAA,gBAEF,oBAAC,+BAA6B,GAAG,kBAAkB;AAAA,iBACrD;AAAA,cACC,CAAC,eAAe,oBAAC,gBAAc,GAAG,aAAa,IAAK;AAAA;AAAA;AAAA,QACvD;AAAA,QAEC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
-
import {
|
|
3
|
+
import { DSTooltipV3SlotName } from "../constants/index.js";
|
|
4
4
|
const useValidateProps = (props, propTypes) => {
|
|
5
|
-
useValidateTypescriptPropTypes(props, propTypes,
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSTooltipV3SlotName);
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
useValidateProps
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSTooltipV3T } from '../react-desc-prop-types.js';\nimport { DSTooltipV3SlotName } from '../constants/index.js';\n\nexport const useValidateProps = <T extends DSTooltipV3T.CustomInterface>(\n props: DSTooltipV3T.InternalProps<T>,\n propTypes: ValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSTooltipV3SlotName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,2BAA2B;AAE7B,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,mBAAmB;AACtE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
const PLACEMENT = [
|
|
4
|
+
"top-start",
|
|
5
|
+
"top",
|
|
6
|
+
"top-end",
|
|
7
|
+
"right-start",
|
|
8
|
+
"right",
|
|
9
|
+
"right-end",
|
|
10
|
+
"bottom-end",
|
|
11
|
+
"bottom",
|
|
12
|
+
"bottom-start",
|
|
13
|
+
"left-end",
|
|
14
|
+
"left",
|
|
15
|
+
"left-start"
|
|
16
|
+
];
|
|
17
|
+
const TEXT_ALIGNMENT = ["left", "right", "center", "justify", "initial", "inherit"];
|
|
18
|
+
const DSTooltipV3SlotName = "DSTooltipv3";
|
|
19
|
+
const TOOLTIP_V3_SLOTS = {
|
|
20
|
+
ROOT: "root",
|
|
21
|
+
TOOLTIP_CONTAINER: "tooltip-container",
|
|
22
|
+
// legacy test id
|
|
23
|
+
TOOLTIP_TEXT: "tooltip-text",
|
|
24
|
+
// legacy test id
|
|
25
|
+
MOUSE_OVER_DETECTION_BOX: "mouse-over-detection-box"
|
|
26
|
+
};
|
|
27
|
+
const TOOLTIP_V3_DATA_TESTID = {
|
|
28
|
+
...slotObjectToDataTestIds(DSTooltipV3SlotName, TOOLTIP_V3_SLOTS),
|
|
29
|
+
// legacy test IDs — preserved for QA/consumer compatibility, breaking change if removed
|
|
30
|
+
ROOT: "ds-tooltip-v3-trigger-wrapper",
|
|
31
|
+
TOOLTIP_CONTAINER: "ds-tooltip-v3-tooltip-text-wrapper",
|
|
32
|
+
TOOLTIP_TEXT: "ds-tooltip-v3-opinionated-text-wrapper"
|
|
33
|
+
};
|
|
34
|
+
const TooltipV3DatatestId = {
|
|
35
|
+
TRIGGER_WRAPPER: TOOLTIP_V3_DATA_TESTID.ROOT,
|
|
36
|
+
TOOLTIP_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER,
|
|
37
|
+
OPINIONATED_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT
|
|
38
|
+
};
|
|
39
|
+
const tooltipPositions = {
|
|
40
|
+
TOP: "top",
|
|
41
|
+
BOTTOM: "bottom",
|
|
42
|
+
RIGHT: "right",
|
|
43
|
+
LEFT: "left",
|
|
44
|
+
TOP_START: "top-start",
|
|
45
|
+
TOP_END: "top-end",
|
|
46
|
+
BOTTOM_START: "bottom-start",
|
|
47
|
+
BOTTOM_END: "bottom-end",
|
|
48
|
+
RIGHT_START: "right-start",
|
|
49
|
+
RIGHT_END: "right-end",
|
|
50
|
+
LEFT_START: "left-start",
|
|
51
|
+
LEFT_END: "left-end"
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
DSTooltipV3SlotName,
|
|
55
|
+
PLACEMENT,
|
|
56
|
+
TEXT_ALIGNMENT,
|
|
57
|
+
TOOLTIP_V3_DATA_TESTID,
|
|
58
|
+
TOOLTIP_V3_SLOTS,
|
|
59
|
+
TooltipV3DatatestId,
|
|
60
|
+
tooltipPositions
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const PLACEMENT = [\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n\nexport const TEXT_ALIGNMENT = ['left', 'right', 'center', 'justify', 'initial', 'inherit'];\n\n// Slot system name \u2014 single-capitalisation PascalCase after DS prefix (checkNamingConvention enforced)\nexport const DSTooltipV3SlotName = 'DSTooltipv3';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const TOOLTIP_V3_SLOTS = {\n ROOT: 'root',\n TOOLTIP_CONTAINER: 'tooltip-container', // legacy test id\n TOOLTIP_TEXT: 'tooltip-text', // legacy test id\n MOUSE_OVER_DETECTION_BOX: 'mouse-over-detection-box',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const TOOLTIP_V3_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSTooltipV3SlotName, TOOLTIP_V3_SLOTS),\n // legacy test IDs \u2014 preserved for QA/consumer compatibility, breaking change if removed\n ROOT: 'ds-tooltip-v3-trigger-wrapper',\n TOOLTIP_CONTAINER: 'ds-tooltip-v3-tooltip-text-wrapper',\n TOOLTIP_TEXT: 'ds-tooltip-v3-opinionated-text-wrapper',\n} as Record<keyof typeof TOOLTIP_V3_SLOTS, string>;\n\n// Legacy export \u2014 kept for backward compatibility. TOOLTIP_V3_DATA_TESTID is the source of truth.\n// Do not add new values here; add them to TOOLTIP_V3_SLOTS instead and the data-testid be generated automatically.\nexport const TooltipV3DatatestId = {\n TRIGGER_WRAPPER: TOOLTIP_V3_DATA_TESTID.ROOT,\n TOOLTIP_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_CONTAINER,\n OPINIONATED_TEXT_WRAPPER: TOOLTIP_V3_DATA_TESTID.TOOLTIP_TEXT,\n};\n\n// many stories where using this from ds-tooltip.\n// we need to preserve this format to avoid breaking changes.\nconst tooltipPositions = {\n TOP: 'top' as const,\n BOTTOM: 'bottom' as const,\n RIGHT: 'right' as const,\n LEFT: 'left' as const,\n TOP_START: 'top-start' as const,\n TOP_END: 'top-end' as const,\n BOTTOM_START: 'bottom-start' as const,\n BOTTOM_END: 'bottom-end' as const,\n RIGHT_START: 'right-start' as const,\n RIGHT_END: 'right-end' as const,\n LEFT_START: 'left-start' as const,\n LEFT_END: 'left-end' as const,\n};\n\nexport { tooltipPositions };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,iBAAiB,CAAC,QAAQ,SAAS,UAAU,WAAW,WAAW,SAAS;AAGlF,MAAM,sBAAsB;AAG5B,MAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,mBAAmB;AAAA;AAAA,EACnB,cAAc;AAAA;AAAA,EACd,0BAA0B;AAC5B;AAGO,MAAM,yBAAyB;AAAA,EACpC,GAAG,wBAAwB,qBAAqB,gBAAgB;AAAA;AAAA,EAEhE,MAAM;AAAA,EACN,mBAAmB;AAAA,EACnB,cAAc;AAChB;AAIO,MAAM,sBAAsB;AAAA,EACjC,iBAAiB,uBAAuB;AAAA,EACxC,sBAAsB,uBAAuB;AAAA,EAC7C,0BAA0B,uBAAuB;AACnD;AAIA,MAAM,mBAAmB;AAAA,EACvB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { DSTooltipV3, DSTooltipV3WithSchema } from "./DSTooltipV3.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
tooltipPositions,
|
|
5
|
+
PLACEMENT,
|
|
6
|
+
TEXT_ALIGNMENT,
|
|
7
|
+
DSTooltipV3SlotName,
|
|
8
|
+
TOOLTIP_V3_SLOTS,
|
|
9
|
+
TOOLTIP_V3_DATA_TESTID,
|
|
10
|
+
TooltipV3DatatestId
|
|
11
|
+
} from "./constants/index.js";
|
|
5
12
|
export {
|
|
6
13
|
DSTooltipV3,
|
|
14
|
+
DSTooltipV3SlotName,
|
|
7
15
|
DSTooltipV3WithSchema,
|
|
8
16
|
PLACEMENT,
|
|
9
17
|
TEXT_ALIGNMENT,
|
|
18
|
+
TOOLTIP_V3_DATA_TESTID,
|
|
19
|
+
TOOLTIP_V3_SLOTS,
|
|
10
20
|
TooltipV3DatatestId,
|
|
11
21
|
tooltipPositions
|
|
12
22
|
};
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSTooltipV3, DSTooltipV3WithSchema } from './DSTooltipV3.js';\nexport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,6BAA6B;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSTooltipV3, DSTooltipV3WithSchema } from './DSTooltipV3.js';\nexport { type DSTooltipV3T } from './react-desc-prop-types.js';\nexport {\n tooltipPositions,\n PLACEMENT,\n TEXT_ALIGNMENT,\n DSTooltipV3SlotName,\n TOOLTIP_V3_SLOTS,\n TOOLTIP_V3_DATA_TESTID,\n TooltipV3DatatestId,\n} from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,6BAA6B;AAEnD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
-
import { PLACEMENT, TEXT_ALIGNMENT } from "./constants.js";
|
|
2
|
+
import { PropTypes, getPropsPerSlotPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { PLACEMENT, TEXT_ALIGNMENT, DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from "./constants/index.js";
|
|
4
4
|
const DSTooltipV3PropTypes = {
|
|
5
|
+
...getPropsPerSlotPropTypes(DSTooltipV3SlotName, TOOLTIP_V3_SLOTS),
|
|
5
6
|
text: PropTypes.string.description(
|
|
6
7
|
"Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence."
|
|
7
8
|
).isRequiredIf((props) => !props.Text),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT } from './constants.js';\n\nexport declare namespace DSTooltipV3T {\n export type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset: [number, number];\n }\n\n export interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, getPropsPerSlotPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { PLACEMENT, TEXT_ALIGNMENT, DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from './constants/index.js';\n\nexport declare namespace DSTooltipV3T {\n export type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;\n export type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n export type TextAlignment = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n startPlacementPreference: Placement;\n applyTooltipOverflowWrap: boolean;\n customOffset: [number, number];\n }\n\n export type SlotFunctionArguments = {\n dsTooltipv3Root: () => object;\n dsTooltipv3TooltipContainer: () => object;\n dsTooltipv3TooltipText: () => object;\n dsTooltipv3MouseOverDetectionBox: () => object;\n };\n\n export interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown>>\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSTooltipV3SlotName, typeof TOOLTIP_V3_SLOTS> {\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n animationDuration?: number;\n portalDOMContainer?: HTMLElement;\n showPopover?: boolean;\n Text?: React.ComponentType<T>;\n textProps?: T;\n text?: string;\n }\n\n export interface RequiredProps {\n children: React.ReactNode;\n }\n export interface InternalProps<T extends CustomInterface = CustomInterface>\n extends DefaultProps,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface Props<T extends CustomInterface = CustomInterface>\n extends Partial<DefaultProps>,\n OptionalProps<T>,\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const DSTooltipV3PropTypes: DSPropTypesSchema<DSTooltipV3T.Props> = {\n ...getPropsPerSlotPropTypes(DSTooltipV3SlotName, TOOLTIP_V3_SLOTS),\n text: PropTypes.string\n .description(\n 'Tooltip text to be displayed on hover/focus. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.Text),\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n applyTooltipOverflowWrap: PropTypes.bool\n .description(\n 'when a tooltip is present, the tooltip text may be too long to fit in the pill. If true, the tooltip will wrap to the next line using overflow-wrap',\n )\n .defaultValue(false),\n wrapWords: PropTypes.bool\n .description('Break words into a new line. Useful when words exceed tooltip max-lenght.')\n .defaultValue(false),\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\n portalDOMContainer: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf([null])])\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n startPlacementPreference: PropTypes.oneOf(PLACEMENT)\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n showPopover: PropTypes.bool.description('Whether or not the tooltip should be always shown'),\n Text: PropTypes.func\n .description(\n 'Custom component to be displayed in the tooltip, will receive textProps as props. If both `text` and `Text` are provided, only `Text` will take precedence.',\n )\n .isRequiredIf((props: Record<string, unknown>) => !props.text),\n textProps: PropTypes.object.description(\n 'Props to be passed to the custom Text component, if provided, used mainly to avoiding inline components definition to improve performance',\n ),\n};\n\nexport const DSTooltipV3PropTypesSchema = DSTooltipV3PropTypes as unknown as ValidationMap<DSTooltipV3T.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,gCAAgC;AAEpD,SAAS,WAAW,gBAAgB,qBAAqB,wBAAwB;AAoE1E,MAAM,uBAA8D;AAAA,EACzE,GAAG,yBAAyB,qBAAqB,gBAAgB;AAAA,EACjE,MAAM,UAAU,OACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,UAAU,MAAM,cAAsC,EAC9D,YAAY,wBAAwB,EACpC,aAAa,MAAM;AAAA,EACtB,0BAA0B,UAAU,KACjC;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,WAAW,UAAU,KAClB,YAAY,2EAA2E,EACvF,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,KAAK,YAAY,sDAAsD,EAAE;AAAA,EAC7F,eAAe,UAAU,KACtB,YAAY,yEAAyE,EACrF,aAAa,IAAI;AAAA,EACpB,cAAc,UAAU,KAAK,YAAY,iDAAiD,EAAE,aAAa,KAAK;AAAA,EAC9G,kBAAkB,UAAU,KACzB,YAAY,2DAA2D,EACvE,aAAa,KAAK;AAAA,EACrB,mBAAmB,UAAU,OAAO,YAAY,+CAA+C,EAAE,aAAa,GAAG;AAAA,EACjH,oBAAoB,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAC9E,YAAY,gGAAgG,EAC5G,aAAa,MAAS;AAAA,EACzB,0BAA0B,UAAU,MAAM,SAAS,EAChD,YAAY,+DAA+D,EAC3E,aAAa,OAAO;AAAA,EACvB,cAAc,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE,aAAa,CAAC,GAAG,EAAE,CAAC;AAAA,EAC5G,IAAI,UAAU,OAAO,YAAY,qCAAqC,EAAE,aAAa,EAAE;AAAA,EACvF,QAAQ,UAAU,KAAK,YAAY,wDAAwD,EAAE,aAAa,UAAU;AAAA,EACpH,SAAS,UAAU,KAChB,YAAY,yDAAyD,EACrE,aAAa,UAAU;AAAA,EAC1B,aAAa,UAAU,KAAK,YAAY,mDAAmD;AAAA,EAC3F,MAAM,UAAU,KACb;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC,UAAmC,CAAC,MAAM,IAAI;AAAA,EAC/D,WAAW,UAAU,OAAO;AAAA,IAC1B;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styles.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { styled } from "@elliemae/ds-system";
|
|
3
|
-
|
|
3
|
+
import { DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from "./constants/index.js";
|
|
4
|
+
const StyledTooltipContainer = styled("div", {
|
|
5
|
+
name: DSTooltipV3SlotName,
|
|
6
|
+
slot: TOOLTIP_V3_SLOTS.TOOLTIP_CONTAINER
|
|
7
|
+
})`
|
|
4
8
|
text-align: center;
|
|
5
9
|
min-width: ${({ theme }) => theme.space.l};
|
|
6
10
|
max-width: 250px;
|
|
@@ -14,7 +18,10 @@ const StyledTooltipContainer = styled.div`
|
|
|
14
18
|
font-size: 13px;
|
|
15
19
|
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
16
20
|
`;
|
|
17
|
-
const StyledTooltipText = styled
|
|
21
|
+
const StyledTooltipText = styled("div", {
|
|
22
|
+
name: DSTooltipV3SlotName,
|
|
23
|
+
slot: TOOLTIP_V3_SLOTS.TOOLTIP_TEXT
|
|
24
|
+
})`
|
|
18
25
|
display: inline-block;
|
|
19
26
|
text-align: ${({ textAlign }) => textAlign};
|
|
20
27
|
|
|
@@ -33,7 +40,10 @@ const StyledTooltipText = styled.div`
|
|
|
33
40
|
overflow-wrap: break-word;`;
|
|
34
41
|
}};
|
|
35
42
|
`;
|
|
36
|
-
const StyledMouseOverDetectionBox = styled
|
|
43
|
+
const StyledMouseOverDetectionBox = styled("div", {
|
|
44
|
+
name: DSTooltipV3SlotName,
|
|
45
|
+
slot: TOOLTIP_V3_SLOTS.MOUSE_OVER_DETECTION_BOX
|
|
46
|
+
})`
|
|
37
47
|
position: absolute;
|
|
38
48
|
top: -15px;
|
|
39
49
|
right: -15px;
|
|
@@ -41,7 +51,10 @@ const StyledMouseOverDetectionBox = styled.div`
|
|
|
41
51
|
height: calc(100% + 30px);
|
|
42
52
|
z-index: -1;
|
|
43
53
|
`;
|
|
44
|
-
const StyledTriggerWrapper = styled
|
|
54
|
+
const StyledTriggerWrapper = styled("div", {
|
|
55
|
+
name: DSTooltipV3SlotName,
|
|
56
|
+
slot: TOOLTIP_V3_SLOTS.ROOT
|
|
57
|
+
})`
|
|
45
58
|
display: inline-flex;
|
|
46
59
|
width: 100%;
|
|
47
60
|
`;
|
package/dist/esm/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\n\ninterface StyledTooltipTextT {\n wrapWords: boolean;\n textAlign: DSTooltipV3T.TextAlignment;\n}\n\nexport const StyledTooltipContainer = styled.
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\nimport { DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from './constants/index.js';\n\ninterface StyledTooltipTextT {\n wrapWords: boolean;\n textAlign: DSTooltipV3T.TextAlignment;\n}\n\nexport const StyledTooltipContainer = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n`;\n\nexport const StyledTooltipText = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.TOOLTIP_TEXT,\n})<StyledTooltipTextT & { $applyTooltipOverflowWrap: boolean }>`\n display: inline-block;\n text-align: ${({ textAlign }) => textAlign};\n\n ${({ wrapWords, $applyTooltipOverflowWrap }) => {\n if ($applyTooltipOverflowWrap) {\n // word-wrap: break-word; // <- this is the legacy \"overflow-wrap\" property, we should not need the legacy declaration\n // min-width: 0px; // <-- min-width:0px is needed because css grid auto-sizing are broken in css and impossible to understand\n return `overflow-wrap: break-word;\n white-space: pre-wrap;\n min-width: 0px;`;\n }\n if (wrapWords) {\n return `white-space: pre-wrap;\n word-break: break-all;\n overflow-wrap: break-word;`;\n }\n return `white-space: normal;\n overflow-wrap: break-word;`;\n }};\n`;\n\nexport const StyledMouseOverDetectionBox = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.MOUSE_OVER_DETECTION_BOX,\n})`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n\nexport const StyledTriggerWrapper = styled('div', {\n name: DSTooltipV3SlotName,\n slot: TOOLTIP_V3_SLOTS.ROOT,\n})`\n display: inline-flex;\n width: 100%;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAEvB,SAAS,qBAAqB,wBAAwB;AAO/C,MAAM,yBAAyB,OAAO,OAAO;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,iBAAiB;AACzB,CAAC;AAAA;AAAA,eAEc,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAK9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,WAKxD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAG5C,MAAM,oBAAoB,OAAO,OAAO;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,iBAAiB;AACzB,CAAC;AAAA;AAAA,gBAEe,CAAC,EAAE,UAAU,MAAM,SAAS;AAAA;AAAA,IAExC,CAAC,EAAE,WAAW,0BAA0B,MAAM;AAC9C,MAAI,2BAA2B;AAG7B,WAAO;AAAA;AAAA;AAAA,EAGT;AACA,MAAI,WAAW;AACb,WAAO;AAAA;AAAA;AAAA,EAGT;AACA,SAAO;AAAA;AAET,CAAC;AAAA;AAGI,MAAM,8BAA8B,OAAO,OAAO;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,iBAAiB;AACzB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASM,MAAM,uBAAuB,OAAO,OAAO;AAAA,EAChD,MAAM;AAAA,EACN,MAAM,iBAAiB;AACzB,CAAC;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SlotPropsAsObj = {
|
|
3
|
+
dsTooltipv3Root: { "aria-label": "just a typescript test" },
|
|
4
|
+
dsTooltipv3TooltipContainer: { "aria-label": "just a typescript test" },
|
|
5
|
+
dsTooltipv3TooltipText: { "aria-label": "just a typescript test" },
|
|
6
|
+
dsTooltipv3MouseOverDetectionBox: { "aria-label": "just a typescript test" }
|
|
7
|
+
};
|
|
8
|
+
const SlotPropsAsFunctions = {
|
|
9
|
+
dsTooltipv3Root: () => ({ "aria-label": "just a typescript test" }),
|
|
10
|
+
dsTooltipv3TooltipContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
11
|
+
dsTooltipv3TooltipText: () => ({ "aria-label": "just a typescript test" }),
|
|
12
|
+
dsTooltipv3MouseOverDetectionBox: () => ({ "aria-label": "just a typescript test" })
|
|
13
|
+
};
|
|
14
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
15
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from '../constants/index.js';\nimport type { DSTooltipV3T } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObj: Partial<DSTooltipV3T.Props> = {\n dsTooltipv3Root: { 'aria-label': 'just a typescript test' },\n dsTooltipv3TooltipContainer: { 'aria-label': 'just a typescript test' },\n dsTooltipv3TooltipText: { 'aria-label': 'just a typescript test' },\n dsTooltipv3MouseOverDetectionBox: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSTooltipV3T.SlotFunctionArguments = {\n dsTooltipv3Root: () => ({ 'aria-label': 'just a typescript test' }),\n dsTooltipv3TooltipContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsTooltipv3TooltipText: () => ({ 'aria-label': 'just a typescript test' }),\n dsTooltipv3MouseOverDetectionBox: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSTooltipV3SlotName, typeof TOOLTIP_V3_SLOTS>\n> = SlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACMvB,MAAM,iBAA8C;AAAA,EAClD,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,wBAAwB,EAAE,cAAc,yBAAyB;AAAA,EACjE,kCAAkC,EAAE,cAAc,yBAAyB;AAC7E;AAEA,MAAM,uBAA2D;AAAA,EAC/D,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC7E,wBAAwB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACxE,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AACpF;AAGA,MAAM,6CAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const PLACEMENT: string[];
|
|
2
|
+
export declare const TEXT_ALIGNMENT: string[];
|
|
3
|
+
export declare const DSTooltipV3SlotName = "DSTooltipv3";
|
|
4
|
+
export declare const TOOLTIP_V3_SLOTS: {
|
|
5
|
+
readonly ROOT: "root";
|
|
6
|
+
readonly TOOLTIP_CONTAINER: "tooltip-container";
|
|
7
|
+
readonly TOOLTIP_TEXT: "tooltip-text";
|
|
8
|
+
readonly MOUSE_OVER_DETECTION_BOX: "mouse-over-detection-box";
|
|
9
|
+
};
|
|
10
|
+
export declare const TOOLTIP_V3_DATA_TESTID: Record<keyof typeof TOOLTIP_V3_SLOTS, string>;
|
|
11
|
+
export declare const TooltipV3DatatestId: {
|
|
12
|
+
TRIGGER_WRAPPER: string;
|
|
13
|
+
TOOLTIP_TEXT_WRAPPER: string;
|
|
14
|
+
OPINIONATED_TEXT_WRAPPER: string;
|
|
15
|
+
};
|
|
16
|
+
declare const tooltipPositions: {
|
|
17
|
+
TOP: "top";
|
|
18
|
+
BOTTOM: "bottom";
|
|
19
|
+
RIGHT: "right";
|
|
20
|
+
LEFT: "left";
|
|
21
|
+
TOP_START: "top-start";
|
|
22
|
+
TOP_END: "top-end";
|
|
23
|
+
BOTTOM_START: "bottom-start";
|
|
24
|
+
BOTTOM_END: "bottom-end";
|
|
25
|
+
RIGHT_START: "right-start";
|
|
26
|
+
RIGHT_END: "right-end";
|
|
27
|
+
LEFT_START: "left-start";
|
|
28
|
+
LEFT_END: "left-end";
|
|
29
|
+
};
|
|
30
|
+
export { tooltipPositions };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { DSTooltipV3, DSTooltipV3WithSchema } from './DSTooltipV3.js';
|
|
2
|
-
export { TooltipV3DatatestId } from './TooltipV3DatatestId.js';
|
|
3
2
|
export { type DSTooltipV3T } from './react-desc-prop-types.js';
|
|
4
|
-
export { tooltipPositions, PLACEMENT, TEXT_ALIGNMENT } from './constants.js';
|
|
3
|
+
export { tooltipPositions, PLACEMENT, TEXT_ALIGNMENT, DSTooltipV3SlotName, TOOLTIP_V3_SLOTS, TOOLTIP_V3_DATA_TESTID, TooltipV3DatatestId, } from './constants/index.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
3
|
+
import { DSTooltipV3SlotName, TOOLTIP_V3_SLOTS } from './constants/index.js';
|
|
2
4
|
export declare namespace DSTooltipV3T {
|
|
3
5
|
type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;
|
|
4
6
|
type Placement = 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
|
|
@@ -13,7 +15,13 @@ export declare namespace DSTooltipV3T {
|
|
|
13
15
|
applyTooltipOverflowWrap: boolean;
|
|
14
16
|
customOffset: [number, number];
|
|
15
17
|
}
|
|
16
|
-
|
|
18
|
+
type SlotFunctionArguments = {
|
|
19
|
+
dsTooltipv3Root: () => object;
|
|
20
|
+
dsTooltipv3TooltipContainer: () => object;
|
|
21
|
+
dsTooltipv3TooltipText: () => object;
|
|
22
|
+
dsTooltipv3MouseOverDetectionBox: () => object;
|
|
23
|
+
};
|
|
24
|
+
interface OptionalProps<T extends Record<string, unknown> = Record<string, unknown>> extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSTooltipV3SlotName, typeof TOOLTIP_V3_SLOTS> {
|
|
17
25
|
withoutPortal?: boolean;
|
|
18
26
|
withoutArrow?: boolean;
|
|
19
27
|
withoutAnimation?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-tooltip-v3",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.61.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Tooltip V3",
|
|
6
6
|
"files": [
|
|
@@ -35,40 +35,37 @@
|
|
|
35
35
|
"reportFile": "tests.xml",
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
40
|
-
"test": "playwright test -c ./playwright.config.mjs && pui-cli test --passWithNoTests --coverage=\"false\"",
|
|
41
|
-
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
42
|
-
"lint:strict": "node ../../../scripts/lint-strict.mjs",
|
|
43
|
-
"dts": "node ../../../scripts/dts.mjs",
|
|
44
|
-
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
45
|
-
"checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
46
|
-
},
|
|
47
38
|
"dependencies": {
|
|
48
|
-
"@elliemae/ds-
|
|
49
|
-
"@elliemae/ds-
|
|
50
|
-
"@elliemae/ds-
|
|
51
|
-
"@elliemae/ds-shared": "3.60.0-next.9",
|
|
52
|
-
"@elliemae/ds-system": "3.60.0-next.9"
|
|
39
|
+
"@elliemae/ds-floating-context": "3.61.0-rc.1",
|
|
40
|
+
"@elliemae/ds-props-helpers": "3.61.0-rc.1",
|
|
41
|
+
"@elliemae/ds-system": "3.61.0-rc.1"
|
|
53
42
|
},
|
|
54
43
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
44
|
+
"@playwright/experimental-ct-react": "^1.51.1",
|
|
45
|
+
"jest": "^30.0.0",
|
|
46
|
+
"react": "^18.3.1",
|
|
47
|
+
"react-dom": "^18.3.1",
|
|
48
|
+
"styled-components": "~5.3.9",
|
|
49
|
+
"@elliemae/ds-grid": "3.61.0-rc.1",
|
|
50
|
+
"@elliemae/ds-monorepo-devops": "3.61.0-rc.1",
|
|
51
|
+
"@elliemae/ds-test-utils": "3.61.0-rc.1"
|
|
63
52
|
},
|
|
64
53
|
"peerDependencies": {
|
|
65
|
-
"react": "
|
|
66
|
-
"react-dom": "
|
|
67
|
-
"styled-components": "
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"react-dom": "^18.3.1",
|
|
56
|
+
"styled-components": "~5.3.9"
|
|
68
57
|
},
|
|
69
58
|
"publishConfig": {
|
|
70
59
|
"access": "public",
|
|
71
60
|
"typeSafety": true
|
|
72
61
|
},
|
|
73
|
-
"
|
|
74
|
-
|
|
62
|
+
"scripts": {
|
|
63
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
64
|
+
"test": "playwright test -c ./playwright.config.mjs && ds-monorepo-devops test --passWithNoTests --coverage=\"false\"",
|
|
65
|
+
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
66
|
+
"lint:strict": "node ../../../scripts/lint-strict.mjs",
|
|
67
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
68
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
69
|
+
"checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/TooltipV3DatatestId.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const TooltipV3DatatestId = {\n TRIGGER_WRAPPER: 'ds-tooltip-v3-trigger-wrapper',\n TOOLTIP_TEXT_WRAPPER: 'ds-tooltip-v3-tooltip-text-wrapper',\n OPINIONATED_TEXT_WRAPPER: 'ds-tooltip-v3-opinionated-text-wrapper',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,sBAAsB;AAAA,EACjC,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,0BAA0B;AAC5B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/constants.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const PLACEMENT = [\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n\nexport const TEXT_ALIGNMENT = ['left', 'right', 'center', 'justify', 'initial', 'inherit'];\n\nexport const DSTooltipV3Name = 'DSTooltipV3';\n\n// many stories where using this from ds-tooltip.\n// we need to preserve this format to avoid breaking changes.\nconst tooltipPositions = {\n TOP: 'top' as const,\n BOTTOM: 'bottom' as const,\n RIGHT: 'right' as const,\n LEFT: 'left' as const,\n TOP_START: 'top-start' as const,\n TOP_END: 'top-end' as const,\n BOTTOM_START: 'bottom-start' as const,\n BOTTOM_END: 'bottom-end' as const,\n RIGHT_START: 'right-start' as const,\n RIGHT_END: 'right-end' as const,\n LEFT_START: 'left-start' as const,\n LEFT_END: 'left-end' as const,\n};\n\nexport { tooltipPositions };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,iBAAiB,CAAC,QAAQ,SAAS,UAAU,WAAW,WAAW,SAAS;AAElF,MAAM,kBAAkB;AAI/B,MAAM,mBAAmB;AAAA,EACvB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const TooltipV3DatatestId = {
|
|
3
|
-
TRIGGER_WRAPPER: "ds-tooltip-v3-trigger-wrapper",
|
|
4
|
-
TOOLTIP_TEXT_WRAPPER: "ds-tooltip-v3-tooltip-text-wrapper",
|
|
5
|
-
OPINIONATED_TEXT_WRAPPER: "ds-tooltip-v3-opinionated-text-wrapper"
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
TooltipV3DatatestId
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=TooltipV3DatatestId.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TooltipV3DatatestId.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TooltipV3DatatestId = {\n TRIGGER_WRAPPER: 'ds-tooltip-v3-trigger-wrapper',\n TOOLTIP_TEXT_WRAPPER: 'ds-tooltip-v3-tooltip-text-wrapper',\n OPINIONATED_TEXT_WRAPPER: 'ds-tooltip-v3-opinionated-text-wrapper',\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,sBAAsB;AAAA,EACjC,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,0BAA0B;AAC5B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/constants.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const PLACEMENT = [
|
|
3
|
-
"top-start",
|
|
4
|
-
"top",
|
|
5
|
-
"top-end",
|
|
6
|
-
"right-start",
|
|
7
|
-
"right",
|
|
8
|
-
"right-end",
|
|
9
|
-
"bottom-end",
|
|
10
|
-
"bottom",
|
|
11
|
-
"bottom-start",
|
|
12
|
-
"left-end",
|
|
13
|
-
"left",
|
|
14
|
-
"left-start"
|
|
15
|
-
];
|
|
16
|
-
const TEXT_ALIGNMENT = ["left", "right", "center", "justify", "initial", "inherit"];
|
|
17
|
-
const DSTooltipV3Name = "DSTooltipV3";
|
|
18
|
-
const tooltipPositions = {
|
|
19
|
-
TOP: "top",
|
|
20
|
-
BOTTOM: "bottom",
|
|
21
|
-
RIGHT: "right",
|
|
22
|
-
LEFT: "left",
|
|
23
|
-
TOP_START: "top-start",
|
|
24
|
-
TOP_END: "top-end",
|
|
25
|
-
BOTTOM_START: "bottom-start",
|
|
26
|
-
BOTTOM_END: "bottom-end",
|
|
27
|
-
RIGHT_START: "right-start",
|
|
28
|
-
RIGHT_END: "right-end",
|
|
29
|
-
LEFT_START: "left-start",
|
|
30
|
-
LEFT_END: "left-end"
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
DSTooltipV3Name,
|
|
34
|
-
PLACEMENT,
|
|
35
|
-
TEXT_ALIGNMENT,
|
|
36
|
-
tooltipPositions
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/constants.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const PLACEMENT = [\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n\nexport const TEXT_ALIGNMENT = ['left', 'right', 'center', 'justify', 'initial', 'inherit'];\n\nexport const DSTooltipV3Name = 'DSTooltipV3';\n\n// many stories where using this from ds-tooltip.\n// we need to preserve this format to avoid breaking changes.\nconst tooltipPositions = {\n TOP: 'top' as const,\n BOTTOM: 'bottom' as const,\n RIGHT: 'right' as const,\n LEFT: 'left' as const,\n TOP_START: 'top-start' as const,\n TOP_END: 'top-end' as const,\n BOTTOM_START: 'bottom-start' as const,\n BOTTOM_END: 'bottom-end' as const,\n RIGHT_START: 'right-start' as const,\n RIGHT_END: 'right-end' as const,\n LEFT_START: 'left-start' as const,\n LEFT_END: 'left-end' as const,\n};\n\nexport { tooltipPositions };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,iBAAiB,CAAC,QAAQ,SAAS,UAAU,WAAW,WAAW,SAAS;AAElF,MAAM,kBAAkB;AAI/B,MAAM,mBAAmB;AAAA,EACvB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const PLACEMENT: string[];
|
|
2
|
-
export declare const TEXT_ALIGNMENT: string[];
|
|
3
|
-
export declare const DSTooltipV3Name = "DSTooltipV3";
|
|
4
|
-
declare const tooltipPositions: {
|
|
5
|
-
TOP: "top";
|
|
6
|
-
BOTTOM: "bottom";
|
|
7
|
-
RIGHT: "right";
|
|
8
|
-
LEFT: "left";
|
|
9
|
-
TOP_START: "top-start";
|
|
10
|
-
TOP_END: "top-end";
|
|
11
|
-
BOTTOM_START: "bottom-start";
|
|
12
|
-
BOTTOM_END: "bottom-end";
|
|
13
|
-
RIGHT_START: "right-start";
|
|
14
|
-
RIGHT_END: "right-end";
|
|
15
|
-
LEFT_START: "left-start";
|
|
16
|
-
LEFT_END: "left-end";
|
|
17
|
-
};
|
|
18
|
-
export { tooltipPositions };
|
/package/dist/types/tests/{DSTooltipV3.TextComponentProp.test.d.ts → DSTooltipV3.a11y.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/tests/{DSTooltipv3.showPopover.test.d.ts → DSTooltipV3.events.test.d.ts}
RENAMED
|
File without changes
|