@instructure/ui-tooltip 8.9.2-snapshot.1 → 8.9.2-snapshot.12
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/es/Tooltip/index.js +1 -1
- package/lib/Tooltip/index.js +1 -1
- package/package.json +16 -16
- package/src/Tooltip/index.tsx +1 -1
- package/src/Tooltip/props.ts +13 -5
- package/src/Tooltip/styles.ts +3 -2
- package/types/Tooltip/props.d.ts +6 -5
- package/types/Tooltip/props.d.ts.map +1 -1
- package/types/Tooltip/styles.d.ts +3 -12
- package/types/Tooltip/styles.d.ts.map +1 -1
package/es/Tooltip/index.js
CHANGED
|
@@ -87,7 +87,7 @@ let Tooltip = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
87
87
|
|
|
88
88
|
if (as) {
|
|
89
89
|
const Trigger = getElementType(Tooltip, this.props);
|
|
90
|
-
const props = omitProps(this.props, Tooltip.
|
|
90
|
+
const props = omitProps(this.props, Tooltip.allowedProps);
|
|
91
91
|
return jsx(Trigger, Object.assign({}, props, triggerProps), children);
|
|
92
92
|
} else if (typeof children === 'function') {
|
|
93
93
|
return children({
|
package/lib/Tooltip/index.js
CHANGED
|
@@ -88,7 +88,7 @@ let Tooltip = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
88
88
|
|
|
89
89
|
if (as) {
|
|
90
90
|
const Trigger = (0, _getElementType.getElementType)(Tooltip, this.props);
|
|
91
|
-
const props = (0, _omitProps.omitProps)(this.props, Tooltip.
|
|
91
|
+
const props = (0, _omitProps.omitProps)(this.props, Tooltip.allowedProps);
|
|
92
92
|
return (0, _emotion.jsx)(Trigger, Object.assign({}, props, triggerProps), children);
|
|
93
93
|
} else if (typeof children === 'function') {
|
|
94
94
|
return children({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tooltip",
|
|
3
|
-
"version": "8.9.2-snapshot.
|
|
3
|
+
"version": "8.9.2-snapshot.12+6231ada93",
|
|
4
4
|
"description": "A component for showing small text-only overlays on hover/focus.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/emotion": "8.9.2-snapshot.
|
|
29
|
-
"@instructure/shared-types": "8.9.2-snapshot.
|
|
30
|
-
"@instructure/ui-popover": "8.9.2-snapshot.
|
|
31
|
-
"@instructure/ui-position": "8.9.2-snapshot.
|
|
32
|
-
"@instructure/ui-prop-types": "8.9.2-snapshot.
|
|
33
|
-
"@instructure/ui-react-utils": "8.9.2-snapshot.
|
|
34
|
-
"@instructure/ui-testable": "8.9.2-snapshot.
|
|
35
|
-
"@instructure/uid": "8.9.2-snapshot.
|
|
28
|
+
"@instructure/emotion": "8.9.2-snapshot.12+6231ada93",
|
|
29
|
+
"@instructure/shared-types": "8.9.2-snapshot.12+6231ada93",
|
|
30
|
+
"@instructure/ui-popover": "8.9.2-snapshot.12+6231ada93",
|
|
31
|
+
"@instructure/ui-position": "8.9.2-snapshot.12+6231ada93",
|
|
32
|
+
"@instructure/ui-prop-types": "8.9.2-snapshot.12+6231ada93",
|
|
33
|
+
"@instructure/ui-react-utils": "8.9.2-snapshot.12+6231ada93",
|
|
34
|
+
"@instructure/ui-testable": "8.9.2-snapshot.12+6231ada93",
|
|
35
|
+
"@instructure/uid": "8.9.2-snapshot.12+6231ada93",
|
|
36
36
|
"prop-types": "^15"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@instructure/ui-babel-preset": "8.9.2-snapshot.
|
|
40
|
-
"@instructure/ui-color-utils": "8.9.2-snapshot.
|
|
41
|
-
"@instructure/ui-test-locator": "8.9.2-snapshot.
|
|
42
|
-
"@instructure/ui-test-queries": "8.9.2-snapshot.
|
|
43
|
-
"@instructure/ui-test-utils": "8.9.2-snapshot.
|
|
44
|
-
"@instructure/ui-themes": "8.9.2-snapshot.
|
|
39
|
+
"@instructure/ui-babel-preset": "8.9.2-snapshot.12+6231ada93",
|
|
40
|
+
"@instructure/ui-color-utils": "8.9.2-snapshot.12+6231ada93",
|
|
41
|
+
"@instructure/ui-test-locator": "8.9.2-snapshot.12+6231ada93",
|
|
42
|
+
"@instructure/ui-test-queries": "8.9.2-snapshot.12+6231ada93",
|
|
43
|
+
"@instructure/ui-test-utils": "8.9.2-snapshot.12+6231ada93",
|
|
44
|
+
"@instructure/ui-themes": "8.9.2-snapshot.12+6231ada93"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=16.8 <=17"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"sideEffects": false,
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "6231ada93bd4299d640b5d39d7e44b0f54852b2a"
|
|
54
54
|
}
|
package/src/Tooltip/index.tsx
CHANGED
|
@@ -100,7 +100,7 @@ class Tooltip extends Component<TooltipProps> {
|
|
|
100
100
|
|
|
101
101
|
if (as) {
|
|
102
102
|
const Trigger = getElementType(Tooltip, this.props)
|
|
103
|
-
const props = omitProps(this.props, Tooltip.
|
|
103
|
+
const props = omitProps(this.props, Tooltip.allowedProps)
|
|
104
104
|
return (
|
|
105
105
|
<Trigger {...props} {...triggerProps}>
|
|
106
106
|
{children}
|
package/src/Tooltip/props.ts
CHANGED
|
@@ -21,18 +21,24 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
+
|
|
25
|
+
import React from 'react'
|
|
24
26
|
import PropTypes from 'prop-types'
|
|
27
|
+
|
|
25
28
|
import { PositionPropTypes } from '@instructure/ui-position'
|
|
26
29
|
import { element } from '@instructure/ui-prop-types'
|
|
27
30
|
|
|
28
|
-
import type {
|
|
31
|
+
import type {
|
|
32
|
+
PropValidators,
|
|
33
|
+
AsElementType,
|
|
34
|
+
TooltipTheme
|
|
35
|
+
} from '@instructure/shared-types'
|
|
29
36
|
import type {
|
|
30
37
|
PlacementPropValues,
|
|
31
38
|
PositionConstraint,
|
|
32
39
|
PositionMountNode
|
|
33
40
|
} from '@instructure/ui-position'
|
|
34
|
-
import
|
|
35
|
-
import type { WithStyleProps } from '@instructure/emotion'
|
|
41
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
36
42
|
|
|
37
43
|
type TooltipOwnProps = {
|
|
38
44
|
renderTip: React.ReactNode | ((...args: any[]) => any)
|
|
@@ -56,7 +62,9 @@ type PropKeys = keyof TooltipOwnProps
|
|
|
56
62
|
|
|
57
63
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
58
64
|
|
|
59
|
-
type TooltipProps = TooltipOwnProps & WithStyleProps
|
|
65
|
+
type TooltipProps = TooltipOwnProps & WithStyleProps<TooltipTheme, TooltipStyle>
|
|
66
|
+
|
|
67
|
+
type TooltipStyle = ComponentStyle<'tooltip'>
|
|
60
68
|
|
|
61
69
|
const propTypes: PropValidators<PropKeys> = {
|
|
62
70
|
/**
|
|
@@ -152,5 +160,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
152
160
|
'onHideContent'
|
|
153
161
|
]
|
|
154
162
|
|
|
155
|
-
export type { TooltipProps }
|
|
163
|
+
export type { TooltipProps, TooltipStyle }
|
|
156
164
|
export { propTypes, allowedProps }
|
package/src/Tooltip/styles.ts
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { TooltipTheme } from '@instructure/shared-types'
|
|
25
|
+
import type { TooltipTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { TooltipStyle } from './props'
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* ---
|
|
@@ -34,7 +35,7 @@ import { TooltipTheme } from '@instructure/shared-types'
|
|
|
34
35
|
* @param {Object} state the state of the component, the style is applied to
|
|
35
36
|
* @return {Object} The final style object, which will be used in the component
|
|
36
37
|
*/
|
|
37
|
-
const generateStyle = (componentTheme: TooltipTheme) => {
|
|
38
|
+
const generateStyle = (componentTheme: TooltipTheme): TooltipStyle => {
|
|
38
39
|
return {
|
|
39
40
|
tooltip: {
|
|
40
41
|
label: 'tooltip',
|
package/types/Tooltip/props.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PropValidators, AsElementType } from '@instructure/shared-types';
|
|
2
|
-
import type { PlacementPropValues, PositionConstraint, PositionMountNode } from '@instructure/ui-position';
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import type {
|
|
2
|
+
import type { PropValidators, AsElementType, TooltipTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { PlacementPropValues, PositionConstraint, PositionMountNode } from '@instructure/ui-position';
|
|
4
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
5
5
|
declare type TooltipOwnProps = {
|
|
6
6
|
renderTip: React.ReactNode | ((...args: any[]) => any);
|
|
7
7
|
children: React.ReactNode | ((...args: any[]) => React.ReactNode);
|
|
@@ -21,9 +21,10 @@ declare type TooltipOwnProps = {
|
|
|
21
21
|
};
|
|
22
22
|
declare type PropKeys = keyof TooltipOwnProps;
|
|
23
23
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
24
|
-
declare type TooltipProps = TooltipOwnProps & WithStyleProps
|
|
24
|
+
declare type TooltipProps = TooltipOwnProps & WithStyleProps<TooltipTheme, TooltipStyle>;
|
|
25
|
+
declare type TooltipStyle = ComponentStyle<'tooltip'>;
|
|
25
26
|
declare const propTypes: PropValidators<PropKeys>;
|
|
26
27
|
declare const allowedProps: AllowedPropKeys;
|
|
27
|
-
export type { TooltipProps };
|
|
28
|
+
export type { TooltipProps, TooltipStyle };
|
|
28
29
|
export { propTypes, allowedProps };
|
|
29
30
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Tooltip/props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Tooltip/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,eAAe,GAAG;IACrB,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACtD,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,EAAE,CAAC,EAAE,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,CAAA;IACpE,KAAK,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAAA;IACrC,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,SAAS,CAAC,EAAE,kBAAkB,CAAA;IAC9B,cAAc,CAAC,EAAE,iBAAiB,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACvC,aAAa,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CACxC,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,eAAe,CAAA;AAErC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,YAAY,GAAG,eAAe,GAAG,cAAc,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;AAEhF,aAAK,YAAY,GAAG,cAAc,CAAC,SAAS,CAAC,CAAA;AAE7C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA0EvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAgBnB,CAAA;AAED,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TooltipTheme } from '@instructure/shared-types';
|
|
1
|
+
import type { TooltipTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { TooltipStyle } from './props';
|
|
2
3
|
/**
|
|
3
4
|
* ---
|
|
4
5
|
* private: true
|
|
@@ -9,16 +10,6 @@ import { TooltipTheme } from '@instructure/shared-types';
|
|
|
9
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
10
11
|
* @return {Object} The final style object, which will be used in the component
|
|
11
12
|
*/
|
|
12
|
-
declare const generateStyle: (componentTheme: TooltipTheme) =>
|
|
13
|
-
tooltip: {
|
|
14
|
-
label: string;
|
|
15
|
-
fontFamily: string;
|
|
16
|
-
fontWeight: number;
|
|
17
|
-
boxSizing: string;
|
|
18
|
-
display: string;
|
|
19
|
-
fontSize: string | 0;
|
|
20
|
-
padding: string | 0;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: TooltipTheme) => TooltipStyle;
|
|
23
14
|
export default generateStyle;
|
|
24
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Tooltip/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Tooltip/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBAAoB,YAAY,KAAG,YAYrD,CAAA;AAED,eAAe,aAAa,CAAA"}
|