@elliemae/ds-tooltip-v3 3.44.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 +101 -0
- package/dist/cjs/DSTooltipV3.js.map +7 -0
- package/dist/cjs/TooltipV3DatatestId.js +39 -0
- package/dist/cjs/TooltipV3DatatestId.js.map +7 -0
- package/dist/cjs/constants.js +66 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/defaultProps.js +45 -0
- package/dist/cjs/defaultProps.js.map +7 -0
- package/dist/cjs/index.js +43 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +59 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styles.js +73 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-tooltip-v3-valid.js +190 -0
- package/dist/cjs/typescript-testing/typescript-tooltip-v3-valid.js.map +7 -0
- package/dist/cjs/utils.js +42 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/esm/DSTooltipV3.js +76 -0
- package/dist/esm/DSTooltipV3.js.map +7 -0
- package/dist/esm/TooltipV3DatatestId.js +9 -0
- package/dist/esm/TooltipV3DatatestId.js.map +7 -0
- package/dist/esm/constants.js +36 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/defaultProps.js +15 -0
- package/dist/esm/defaultProps.js.map +7 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +29 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styles.js +43 -0
- package/dist/esm/styles.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-tooltip-v3-valid.js +167 -0
- package/dist/esm/typescript-testing/typescript-tooltip-v3-valid.js.map +7 -0
- package/dist/esm/utils.js +12 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/types/DSTooltipV3.d.ts +6 -0
- package/dist/types/TooltipV3DatatestId.d.ts +4 -0
- package/dist/types/constants.d.ts +17 -0
- package/dist/types/defaultProps.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/react-desc-prop-types.d.ts +37 -0
- package/dist/types/styles.d.ts +10 -0
- package/dist/types/tests/DSTooltipV3.test.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-tooltip-v3-valid.d.ts +1 -0
- package/dist/types/utils.d.ts +3 -0
- package/package.json +131 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const mockChildren = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {});
|
|
28
|
+
const mockPlacementOrderPreference = ["bottom-start", "bottom", "bottom-end"];
|
|
29
|
+
const mockCustomOffset = [0, 0];
|
|
30
|
+
const mockModifiers = [{}];
|
|
31
|
+
const testRequiredProps = {
|
|
32
|
+
children: mockChildren(),
|
|
33
|
+
text: ""
|
|
34
|
+
};
|
|
35
|
+
const testOptionalProps = {
|
|
36
|
+
zIndex: 1,
|
|
37
|
+
ariaLabel: "",
|
|
38
|
+
withoutPortal: false,
|
|
39
|
+
withoutArrow: false,
|
|
40
|
+
withoutAnimation: false,
|
|
41
|
+
boundaryElement: void 0,
|
|
42
|
+
animationDuration: 1e3,
|
|
43
|
+
portalDOMContainer: void 0,
|
|
44
|
+
placementOrderPreference: mockPlacementOrderPreference,
|
|
45
|
+
customOffset: mockCustomOffset,
|
|
46
|
+
modifiers: mockModifiers,
|
|
47
|
+
showPopover: true
|
|
48
|
+
};
|
|
49
|
+
const testPartialDefaults = {
|
|
50
|
+
id: "",
|
|
51
|
+
onOpen: () => {
|
|
52
|
+
},
|
|
53
|
+
onClose: () => {
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const testProps = {
|
|
57
|
+
...testRequiredProps,
|
|
58
|
+
...testOptionalProps,
|
|
59
|
+
...testPartialDefaults
|
|
60
|
+
};
|
|
61
|
+
const testPropsAsSyntax = {
|
|
62
|
+
...testRequiredProps,
|
|
63
|
+
...testOptionalProps,
|
|
64
|
+
...testPartialDefaults
|
|
65
|
+
};
|
|
66
|
+
const testCompleteDefaults = {
|
|
67
|
+
id: "id",
|
|
68
|
+
onOpen: () => {
|
|
69
|
+
},
|
|
70
|
+
onClose: () => {
|
|
71
|
+
},
|
|
72
|
+
textAlign: "center",
|
|
73
|
+
wrapWords: false,
|
|
74
|
+
startPlacementPreference: "bottom"
|
|
75
|
+
};
|
|
76
|
+
const testInternalProps = {
|
|
77
|
+
...testRequiredProps,
|
|
78
|
+
...testOptionalProps,
|
|
79
|
+
...testCompleteDefaults
|
|
80
|
+
};
|
|
81
|
+
const testInternalPropsAsSyntax = {
|
|
82
|
+
...testRequiredProps,
|
|
83
|
+
...testOptionalProps,
|
|
84
|
+
...testCompleteDefaults
|
|
85
|
+
};
|
|
86
|
+
const testExplicitDefinition = {
|
|
87
|
+
id: "id",
|
|
88
|
+
onOpen: () => {
|
|
89
|
+
},
|
|
90
|
+
onClose: () => {
|
|
91
|
+
},
|
|
92
|
+
textAlign: "center",
|
|
93
|
+
wrapWords: false,
|
|
94
|
+
children: mockChildren(),
|
|
95
|
+
text: "",
|
|
96
|
+
zIndex: 1,
|
|
97
|
+
ariaLabel: "",
|
|
98
|
+
withoutPortal: false,
|
|
99
|
+
withoutArrow: false,
|
|
100
|
+
withoutAnimation: false,
|
|
101
|
+
boundaryElement: void 0,
|
|
102
|
+
animationDuration: 1e3,
|
|
103
|
+
portalDOMContainer: void 0,
|
|
104
|
+
startPlacementPreference: "bottom",
|
|
105
|
+
placementOrderPreference: mockPlacementOrderPreference,
|
|
106
|
+
customOffset: mockCustomOffset,
|
|
107
|
+
modifiers: mockModifiers,
|
|
108
|
+
showPopover: true
|
|
109
|
+
};
|
|
110
|
+
const testInferedTypeCompatibility = {
|
|
111
|
+
id: "id",
|
|
112
|
+
onOpen: () => {
|
|
113
|
+
},
|
|
114
|
+
onClose: () => {
|
|
115
|
+
},
|
|
116
|
+
textAlign: "center",
|
|
117
|
+
wrapWords: false,
|
|
118
|
+
children: mockChildren(),
|
|
119
|
+
text: "",
|
|
120
|
+
zIndex: 1,
|
|
121
|
+
ariaLabel: "",
|
|
122
|
+
withoutPortal: false,
|
|
123
|
+
withoutArrow: false,
|
|
124
|
+
withoutAnimation: false,
|
|
125
|
+
boundaryElement: void 0,
|
|
126
|
+
animationDuration: 1e3,
|
|
127
|
+
portalDOMContainer: void 0,
|
|
128
|
+
startPlacementPreference: "bottom",
|
|
129
|
+
placementOrderPreference: mockPlacementOrderPreference,
|
|
130
|
+
customOffset: mockCustomOffset,
|
|
131
|
+
modifiers: mockModifiers,
|
|
132
|
+
showPopover: true
|
|
133
|
+
};
|
|
134
|
+
const testDefinitionAsConst = {
|
|
135
|
+
id: "id",
|
|
136
|
+
onOpen: () => {
|
|
137
|
+
},
|
|
138
|
+
onClose: () => {
|
|
139
|
+
},
|
|
140
|
+
textAlign: "center",
|
|
141
|
+
wrapWords: false,
|
|
142
|
+
children: mockChildren(),
|
|
143
|
+
text: "",
|
|
144
|
+
zIndex: 1,
|
|
145
|
+
ariaLabel: "",
|
|
146
|
+
withoutPortal: false,
|
|
147
|
+
withoutArrow: false,
|
|
148
|
+
withoutAnimation: false,
|
|
149
|
+
boundaryElement: void 0,
|
|
150
|
+
animationDuration: 1e3,
|
|
151
|
+
portalDOMContainer: void 0,
|
|
152
|
+
startPlacementPreference: "bottom",
|
|
153
|
+
placementOrderPreference: mockPlacementOrderPreference,
|
|
154
|
+
customOffset: mockCustomOffset,
|
|
155
|
+
modifiers: mockModifiers,
|
|
156
|
+
showPopover: true
|
|
157
|
+
};
|
|
158
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSTooltipV3, { ...testExplicitDefinition }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSTooltipV3, { ...testInferedTypeCompatibility }),
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSTooltipV3, { ...testDefinitionAsConst }),
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
+
import__.DSTooltipV3,
|
|
164
|
+
{
|
|
165
|
+
id: "id",
|
|
166
|
+
onOpen: () => {
|
|
167
|
+
},
|
|
168
|
+
onClose: () => {
|
|
169
|
+
},
|
|
170
|
+
textAlign: "center",
|
|
171
|
+
wrapWords: false,
|
|
172
|
+
text: "",
|
|
173
|
+
zIndex: 1,
|
|
174
|
+
ariaLabel: "",
|
|
175
|
+
withoutPortal: false,
|
|
176
|
+
withoutArrow: false,
|
|
177
|
+
withoutAnimation: false,
|
|
178
|
+
boundaryElement: void 0,
|
|
179
|
+
animationDuration: 1e3,
|
|
180
|
+
portalDOMContainer: void 0,
|
|
181
|
+
startPlacementPreference: "bottom",
|
|
182
|
+
placementOrderPreference: ["bottom-start", "bottom", "bottom-end"],
|
|
183
|
+
customOffset: [0, 0],
|
|
184
|
+
modifiers: [],
|
|
185
|
+
showPopover: true,
|
|
186
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
] });
|
|
190
|
+
//# sourceMappingURL=typescript-tooltip-v3-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-tooltip-v3-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSTooltipV3 } from '../index.js';\nimport type { DSTooltipV3T } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSTooltipV3T.Props;\ntype ComponentPropsInternals = DSTooltipV3T.InternalProps;\ntype ComponentPropsDefaultProps = DSTooltipV3T.DefaultProps;\ntype ComponentPropsOptionalProps = DSTooltipV3T.OptionalProps;\ntype ComponentPropsRequiredProps = DSTooltipV3T.RequiredProps;\n\nconst mockChildren = () => <div></div>;\n\nconst mockPlacementOrderPreference: DSTooltipV3T.Placement[] = ['bottom-start', 'bottom', 'bottom-end'];\nconst mockCustomOffset: DSTooltipV3T.OptionalProps['customOffset'] = [0, 0];\nconst mockModifiers: DSTooltipV3T.OptionalProps['modifiers'] = [{}];\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n children: mockChildren(),\n text: '',\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n zIndex: 1,\n ariaLabel: '',\n withoutPortal: false,\n withoutArrow: false,\n withoutAnimation: false,\n boundaryElement: undefined,\n animationDuration: 1000,\n portalDOMContainer: undefined,\n placementOrderPreference: mockPlacementOrderPreference,\n customOffset: mockCustomOffset,\n modifiers: mockModifiers,\n showPopover: true,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n id: '',\n onOpen: () => {},\n onClose: () => {},\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n id: 'id',\n onOpen: () => {},\n onClose: () => {},\n textAlign: 'center',\n wrapWords: false,\n startPlacementPreference: 'bottom',\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n id: 'id',\n onOpen: () => {},\n onClose: () => {},\n textAlign: 'center',\n wrapWords: false,\n children: mockChildren(),\n text: '',\n zIndex: 1,\n ariaLabel: '',\n withoutPortal: false,\n withoutArrow: false,\n withoutAnimation: false,\n boundaryElement: undefined,\n animationDuration: 1000,\n portalDOMContainer: undefined,\n startPlacementPreference: 'bottom',\n placementOrderPreference: mockPlacementOrderPreference,\n customOffset: mockCustomOffset,\n modifiers: mockModifiers,\n showPopover: true,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n id: 'id',\n onOpen: () => {},\n onClose: () => {},\n textAlign: 'center',\n wrapWords: false,\n children: mockChildren(),\n text: '',\n zIndex: 1,\n ariaLabel: '',\n withoutPortal: false,\n withoutArrow: false,\n withoutAnimation: false,\n boundaryElement: undefined,\n animationDuration: 1000,\n portalDOMContainer: undefined,\n startPlacementPreference: 'bottom',\n placementOrderPreference: mockPlacementOrderPreference,\n customOffset: mockCustomOffset,\n modifiers: mockModifiers,\n showPopover: true,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n id: 'id',\n onOpen: () => {},\n onClose: () => {},\n textAlign: 'center',\n wrapWords: false,\n children: mockChildren(),\n text: '',\n zIndex: 1,\n ariaLabel: '',\n withoutPortal: false,\n withoutArrow: false,\n withoutAnimation: false,\n boundaryElement: undefined,\n animationDuration: 1000,\n portalDOMContainer: undefined,\n startPlacementPreference: 'bottom',\n placementOrderPreference: mockPlacementOrderPreference,\n customOffset: mockCustomOffset,\n modifiers: mockModifiers,\n showPopover: true,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSTooltipV3 {...testExplicitDefinition} />\n <DSTooltipV3 {...testInferedTypeCompatibility} />\n <DSTooltipV3 {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSTooltipV3\n id=\"id\"\n onOpen={() => {}}\n onClose={() => {}}\n textAlign=\"center\"\n wrapWords={false}\n text=\"\"\n zIndex={1}\n ariaLabel=\"\"\n withoutPortal={false}\n withoutArrow={false}\n withoutAnimation={false}\n boundaryElement={undefined}\n animationDuration={1000}\n portalDOMContainer={undefined}\n startPlacementPreference=\"bottom\"\n placementOrderPreference={['bottom-start', 'bottom', 'bottom-end']}\n customOffset={[0, 0]}\n modifiers={[]}\n showPopover\n >\n <div />\n </DSTooltipV3>\n </>\n);\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var utils_exports = {};
|
|
30
|
+
__export(utils_exports, {
|
|
31
|
+
useGlobalKeyboardListener: () => useGlobalKeyboardListener
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(utils_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
const useGlobalKeyboardListener = (func) => {
|
|
37
|
+
(0, import_react.useEffect)(() => {
|
|
38
|
+
document.addEventListener("keydown", func);
|
|
39
|
+
return () => document.removeEventListener("keydown", func);
|
|
40
|
+
}, [func]);
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useEffect } from 'react';\n\nexport const useGlobalKeyboardListener = (func: ({ key }: { key: string }) => void) => {\n useEffect(() => {\n document.addEventListener('keydown', func);\n return () => document.removeEventListener('keydown', func);\n }, [func]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA0B;AAEnB,MAAM,4BAA4B,CAAC,SAA6C;AACrF,8BAAU,MAAM;AACd,aAAS,iBAAiB,WAAW,IAAI;AACzC,WAAO,MAAM,SAAS,oBAAoB,WAAW,IAAI;AAAA,EAC3D,GAAG,CAAC,IAAI,CAAC;AACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React2 from "react";
|
|
4
|
+
import { useFloatingContext, PopoverArrow, FloatingWrapper } from "@elliemae/ds-floating-context";
|
|
5
|
+
import { useMemoMergePropsWithDefault, describe } from "@elliemae/ds-props-helpers";
|
|
6
|
+
import { propTypes } from "./react-desc-prop-types.js";
|
|
7
|
+
import { TooltipV3DatatestId } from "./TooltipV3DatatestId.js";
|
|
8
|
+
import { defaultProps } from "./defaultProps.js";
|
|
9
|
+
import {
|
|
10
|
+
StyledTooltipContainer,
|
|
11
|
+
StyledTooltipText,
|
|
12
|
+
StyledMouseOverDetectionBox,
|
|
13
|
+
StyledTriggerWrapper
|
|
14
|
+
} from "./styles.js";
|
|
15
|
+
const DSTooltipV3 = (props) => {
|
|
16
|
+
const {
|
|
17
|
+
text,
|
|
18
|
+
startPlacementPreference,
|
|
19
|
+
children,
|
|
20
|
+
onOpen,
|
|
21
|
+
onClose,
|
|
22
|
+
id,
|
|
23
|
+
textAlign,
|
|
24
|
+
wrapWords,
|
|
25
|
+
withoutArrow,
|
|
26
|
+
customOffset,
|
|
27
|
+
animationDuration,
|
|
28
|
+
withoutAnimation,
|
|
29
|
+
withoutPortal,
|
|
30
|
+
portalDOMContainer,
|
|
31
|
+
...extraPopperJsProps
|
|
32
|
+
} = useMemoMergePropsWithDefault(props, defaultProps);
|
|
33
|
+
const { handlers, arrowStyles, floatingStyles, isOpen, refs, hideTooltip, context } = useFloatingContext({
|
|
34
|
+
placement: startPlacementPreference,
|
|
35
|
+
customOffset,
|
|
36
|
+
onOpen,
|
|
37
|
+
onClose,
|
|
38
|
+
withoutPortal,
|
|
39
|
+
withoutAnimation,
|
|
40
|
+
portalDOMContainer,
|
|
41
|
+
animationDuration
|
|
42
|
+
});
|
|
43
|
+
React2.useEffect(() => {
|
|
44
|
+
if (extraPopperJsProps.showPopover === false) {
|
|
45
|
+
hideTooltip();
|
|
46
|
+
}
|
|
47
|
+
}, [extraPopperJsProps.showPopover, hideTooltip]);
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
StyledTriggerWrapper,
|
|
50
|
+
{
|
|
51
|
+
...handlers,
|
|
52
|
+
innerRef: refs.setReference,
|
|
53
|
+
"data-testid": `${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== "" ? `_${id}` : ""}`,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsxs(FloatingWrapper, { innerRef: refs.setFloating, isOpen, floatingStyles, context, children: [
|
|
56
|
+
/* @__PURE__ */ jsxs(StyledTooltipContainer, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(StyledTooltipText, { "aria-label": text, textAlign, wrapWords, children: text }),
|
|
58
|
+
/* @__PURE__ */ jsx(StyledMouseOverDetectionBox, {})
|
|
59
|
+
] }),
|
|
60
|
+
!withoutArrow ? /* @__PURE__ */ jsx(PopoverArrow, { ...arrowStyles }) : null
|
|
61
|
+
] }),
|
|
62
|
+
children
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
DSTooltipV3.displayName = "DSTooltipV3";
|
|
68
|
+
const DSTooltipV3WithSchema = describe(DSTooltipV3);
|
|
69
|
+
DSTooltipV3WithSchema.propTypes = propTypes;
|
|
70
|
+
var DSTooltipV3_default = DSTooltipV3;
|
|
71
|
+
export {
|
|
72
|
+
DSTooltipV3,
|
|
73
|
+
DSTooltipV3WithSchema,
|
|
74
|
+
DSTooltipV3_default as default
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=DSTooltipV3.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { useMemoMergePropsWithDefault, describe } from '@elliemae/ds-props-helpers';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId.js';\nimport { defaultProps } from './defaultProps.js';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styles.js';\nimport type { DSTooltipV3T } from './react-desc-prop-types.js';\n\nconst DSTooltipV3: React.ComponentType<DSTooltipV3T.Props> = (props) => {\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 ...extraPopperJsProps\n } = useMemoMergePropsWithDefault<DSTooltipV3T.InternalProps>(props, defaultProps);\n\n const { handlers, arrowStyles, floatingStyles, isOpen, refs, hideTooltip, context } = useFloatingContext({\n placement: startPlacementPreference,\n customOffset,\n onOpen,\n onClose,\n withoutPortal,\n withoutAnimation,\n portalDOMContainer,\n animationDuration,\n });\n React.useEffect(() => {\n if (extraPopperJsProps.showPopover === false) {\n hideTooltip();\n }\n }, [extraPopperJsProps.showPopover, hideTooltip]);\n return (\n <StyledTriggerWrapper\n {...handlers}\n innerRef={refs.setReference}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n <FloatingWrapper innerRef={refs.setFloating} isOpen={isOpen} floatingStyles={floatingStyles} context={context}>\n <StyledTooltipContainer>\n <StyledTooltipText aria-label={text} textAlign={textAlign} wrapWords={wrapWords}>\n {text}\n </StyledTooltipText>\n <StyledMouseOverDetectionBox />\n </StyledTooltipContainer>\n {!withoutArrow ? <PopoverArrow {...arrowStyles} /> : null}\n </FloatingWrapper>\n\n {children}\n </StyledTriggerWrapper>\n );\n};\n\nDSTooltipV3.displayName = 'DSTooltipV3';\nconst DSTooltipV3WithSchema = describe(DSTooltipV3);\nDSTooltipV3WithSchema.propTypes = propTypes;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\n\nexport default DSTooltipV3;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACwDf,SACE,KADF;AAvDR,OAAOA,YAAW;AAClB,SAAS,oBAAoB,cAAc,uBAAuB;AAClE,SAAS,8BAA8B,gBAAgB;AACvD,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,MAAM,cAAuD,CAAC,UAAU;AACtE,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,GAAG;AAAA,EACL,IAAI,6BAAyD,OAAO,YAAY;AAEhF,QAAM,EAAE,UAAU,aAAa,gBAAgB,QAAQ,MAAM,aAAa,QAAQ,IAAI,mBAAmB;AAAA,IACvG,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI,mBAAmB,gBAAgB,OAAO;AAC5C,kBAAY;AAAA,IACd;AAAA,EACF,GAAG,CAAC,mBAAmB,aAAa,WAAW,CAAC;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,KAAK;AAAA,MACf,eAAa,GAAG,oBAAoB,eAAe,GAAG,OAAO,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,MAE/E;AAAA,6BAAC,mBAAgB,UAAU,KAAK,aAAa,QAAgB,gBAAgC,SAC3F;AAAA,+BAAC,0BACC;AAAA,gCAAC,qBAAkB,cAAY,MAAM,WAAsB,WACxD,gBACH;AAAA,YACA,oBAAC,+BAA4B;AAAA,aAC/B;AAAA,UACC,CAAC,eAAe,oBAAC,gBAAc,GAAG,aAAa,IAAK;AAAA,WACvD;AAAA,QAEC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
TooltipV3DatatestId
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=TooltipV3DatatestId.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,sBAAsB;AAAA,EACjC,iBAAiB;AAAA,EACjB,sBAAsB;AACxB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 tooltipPositions = {
|
|
18
|
+
TOP: "top",
|
|
19
|
+
BOTTOM: "bottom",
|
|
20
|
+
RIGHT: "right",
|
|
21
|
+
LEFT: "left",
|
|
22
|
+
TOP_START: "top-start",
|
|
23
|
+
TOP_END: "top-end",
|
|
24
|
+
BOTTOM_START: "bottom-start",
|
|
25
|
+
BOTTOM_END: "bottom-end",
|
|
26
|
+
RIGHT_START: "right-start",
|
|
27
|
+
RIGHT_END: "right-end",
|
|
28
|
+
LEFT_START: "left-start",
|
|
29
|
+
LEFT_END: "left-end"
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
PLACEMENT,
|
|
33
|
+
TEXT_ALIGNMENT,
|
|
34
|
+
tooltipPositions
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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\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;AAIzF,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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const noop = () => {
|
|
3
|
+
};
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
onOpen: noop,
|
|
6
|
+
onClose: noop,
|
|
7
|
+
id: "",
|
|
8
|
+
textAlign: "left",
|
|
9
|
+
wrapWords: false,
|
|
10
|
+
startPlacementPreference: "top"
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
defaultProps
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSTooltipV3T } from './react-desc-prop-types.js';\n\nconst noop = () => {};\n\nexport const defaultProps: DSTooltipV3T.DefaultProps = {\n onOpen: noop,\n onClose: noop,\n id: '',\n textAlign: 'left',\n wrapWords: false,\n startPlacementPreference: 'top',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,OAAO,MAAM;AAAC;AAEb,MAAM,eAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,0BAA0B;AAC5B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSTooltipV3, DSTooltipV3WithSchema } from "./DSTooltipV3.js";
|
|
3
|
+
import { TooltipV3DatatestId } from "./TooltipV3DatatestId.js";
|
|
4
|
+
import { tooltipPositions, PLACEMENT, TEXT_ALIGNMENT } from "./constants.js";
|
|
5
|
+
export {
|
|
6
|
+
DSTooltipV3,
|
|
7
|
+
DSTooltipV3WithSchema,
|
|
8
|
+
PLACEMENT,
|
|
9
|
+
TEXT_ALIGNMENT,
|
|
10
|
+
TooltipV3DatatestId,
|
|
11
|
+
tooltipPositions
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { TooltipV3DatatestId } from './TooltipV3DatatestId.js';\nexport { type DSTooltipV3T } from './react-desc-prop-types.js';\nexport { tooltipPositions, PLACEMENT, TEXT_ALIGNMENT } from './constants.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,6BAA6B;AACnD,SAAS,2BAA2B;AAEpC,SAAS,kBAAkB,WAAW,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { PLACEMENT, TEXT_ALIGNMENT } from "./constants.js";
|
|
4
|
+
const propTypes = {
|
|
5
|
+
text: PropTypes.string.description("Tooltip text to be displayed on hover/focus").isRequired,
|
|
6
|
+
textAlign: PropTypes.oneOf(TEXT_ALIGNMENT).description("Tooltip text alignment").defaultValue("left"),
|
|
7
|
+
wrapWords: PropTypes.bool.description("Break words into a new line. Useful when words exceed tooltip max-lenght.").defaultValue(false),
|
|
8
|
+
children: PropTypes.node.description("Element to tie the tooltip to, must be a single node").isRequired,
|
|
9
|
+
withoutPortal: PropTypes.bool.description("Whether or not the tooltip content should appear in a DOM portal or not").defaultValue(true),
|
|
10
|
+
withoutArrow: PropTypes.bool.description("Whether or not the tooltip should use the arrow").defaultValue(false),
|
|
11
|
+
boundaryElement: PropTypes.element.description(
|
|
12
|
+
'Bounding element to calculate upon, defaults to "clippingParents",which are the scrolling containers that may cause element to be partially or fully cut off'
|
|
13
|
+
).defaultValue(void 0),
|
|
14
|
+
withoutAnimation: PropTypes.bool.description("Whether or not the popper context menu should be animated").defaultValue(false),
|
|
15
|
+
animationDuration: PropTypes.number.description("Popper context menus Animation duration in ms").defaultValue(100),
|
|
16
|
+
portalDOMContainer: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf([null])]).description("When using portal, the container in which to append the DOM content, defaults to document body").defaultValue(void 0),
|
|
17
|
+
startPlacementPreference: PropTypes.oneOf(PLACEMENT).description("start placement preferences, as per popperjs placement option").defaultValue("'top'"),
|
|
18
|
+
placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf(PLACEMENT)).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
|
|
19
|
+
zIndex: PropTypes.number.description("popperjs content z-index").defaultValue(1),
|
|
20
|
+
customOffset: PropTypes.arrayOf(PropTypes.number).description("placement offset array").defaultValue([0, 14]),
|
|
21
|
+
modifiers: PropTypes.array.description("modifiers array for full-custom tooltip-js override, https://popper.js.org/docs/v2/modifiers/").defaultValue(1),
|
|
22
|
+
id: PropTypes.string.description("Optional id appended to data-testid").defaultValue(""),
|
|
23
|
+
onOpen: PropTypes.func.description("Optional callback to be invoked when the tooltip opens").defaultValue("() => {}"),
|
|
24
|
+
onClose: PropTypes.func.description("Optional callback to be invoked when the tooltip closes").defaultValue("() => {}")
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
propTypes
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT } 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 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 }\n\n export interface OptionalProps {\n zIndex?: number;\n ariaLabel?: string;\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n boundaryElement?: HTMLElement;\n animationDuration?: number;\n portalDOMContainer?: HTMLElement;\n placementOrderPreference?: Placement[];\n customOffset?: [number, number];\n modifiers?: Record<string, unknown>[];\n showPopover?: boolean;\n }\n\n export interface RequiredProps {\n children: React.ReactNode;\n text: string;\n }\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const propTypes = {\n text: PropTypes.string.description('Tooltip text to be displayed on hover/focus').isRequired,\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\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 boundaryElement: PropTypes.element\n .description(\n 'Bounding element to calculate upon, defaults to \"clippingParents\",' +\n 'which are the scrolling containers that may cause element to be partially or fully cut off',\n )\n .defaultValue(undefined),\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 placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf(PLACEMENT))\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n modifiers: PropTypes.array\n .description('modifiers array for full-custom tooltip-js override, https://popper.js.org/docs/v2/modifiers/')\n .defaultValue(1),\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} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,iBAAiB;AAC1B,SAAS,WAAW,sBAAsB;AA6DnC,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,YAAY,6CAA6C,EAAE;AAAA,EAClF,WAAW,UAAU,MAAM,cAAsC,EAC9D,YAAY,wBAAwB,EACpC,aAAa,MAAM;AAAA,EACtB,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,iBAAiB,UAAU,QACxB;AAAA,IACC;AAAA,EAEF,EACC,aAAa,MAAS;AAAA,EACzB,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,0BAA0B,UAAU,QAAQ,UAAU,MAAM,SAAS,CAAC,EACnE,YAAY,yEAAyE,EACrF,aAAa,oCAAoC;AAAA,EACpD,QAAQ,UAAU,OAAO,YAAY,0BAA0B,EAAE,aAAa,CAAC;AAAA,EAC/E,cAAc,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE,aAAa,CAAC,GAAG,EAAE,CAAC;AAAA,EAC5G,WAAW,UAAU,MAClB,YAAY,+FAA+F,EAC3G,aAAa,CAAC;AAAA,EACjB,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;AAC5B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styled } from "@elliemae/ds-system";
|
|
3
|
+
const StyledTooltipContainer = styled.div`
|
|
4
|
+
text-align: center;
|
|
5
|
+
min-width: ${({ theme }) => theme.space.l};
|
|
6
|
+
max-width: 250px;
|
|
7
|
+
min-height: 30px;
|
|
8
|
+
display: grid;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};
|
|
11
|
+
position: relative;
|
|
12
|
+
background-color: white;
|
|
13
|
+
border-radius: 2px;
|
|
14
|
+
font-size: 13px;
|
|
15
|
+
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
16
|
+
`;
|
|
17
|
+
const StyledTooltipText = styled.div`
|
|
18
|
+
display: inline-block;
|
|
19
|
+
text-align: ${({ textAlign }) => textAlign};
|
|
20
|
+
white-space: ${({ wrapWords }) => wrapWords ? "pre-wrap" : "normal"};
|
|
21
|
+
word-break: ${({ wrapWords }) => wrapWords ? "break-all" : "normal"};
|
|
22
|
+
word-wrap: break-word;
|
|
23
|
+
overflow-wrap: break-word;
|
|
24
|
+
`;
|
|
25
|
+
const StyledMouseOverDetectionBox = styled.div`
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: -15px;
|
|
28
|
+
right: -15px;
|
|
29
|
+
width: calc(100% + 30px);
|
|
30
|
+
height: calc(100% + 30px);
|
|
31
|
+
z-index: -1;
|
|
32
|
+
`;
|
|
33
|
+
const StyledTriggerWrapper = styled.div`
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
width: 100%;
|
|
36
|
+
`;
|
|
37
|
+
export {
|
|
38
|
+
StyledMouseOverDetectionBox,
|
|
39
|
+
StyledTooltipContainer,
|
|
40
|
+
StyledTooltipText,
|
|
41
|
+
StyledTriggerWrapper
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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.div`\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<StyledTooltipTextT>`\n display: inline-block;\n text-align: ${({ textAlign }) => textAlign};\n white-space: ${({ wrapWords }) => (wrapWords ? 'pre-wrap' : 'normal')};\n word-break: ${({ wrapWords }) => (wrapWords ? 'break-all' : 'normal')};\n word-wrap: break-word;\n overflow-wrap: break-word;\n`;\n\nexport const StyledMouseOverDetectionBox = styled.div`\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 display: inline-flex;\n width: 100%;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAQhB,MAAM,yBAAyB,OAAO;AAAA;AAAA,eAE9B,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;AAAA;AAAA,gBAExB,CAAC,EAAE,UAAU,MAAM,SAAS;AAAA,iBAC3B,CAAC,EAAE,UAAU,MAAO,YAAY,aAAa,QAAS;AAAA,gBACvD,CAAC,EAAE,UAAU,MAAO,YAAY,cAAc,QAAS;AAAA;AAAA;AAAA;AAKhE,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS3C,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|