@instructure/ui-tooltip 8.8.1-snapshot.8 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/es/Tooltip/index.js +29 -121
- package/es/Tooltip/props.js +115 -0
- package/lib/Tooltip/index.js +29 -123
- package/lib/Tooltip/props.js +128 -0
- package/package.json +16 -17
- package/src/Tooltip/index.tsx +8 -91
- package/src/Tooltip/props.ts +156 -0
- package/src/index.ts +1 -1
- package/types/Tooltip/index.d.ts +35 -79
- package/types/Tooltip/index.d.ts.map +1 -1
- package/types/Tooltip/{types.d.ts → props.d.ts} +13 -6
- package/types/Tooltip/props.d.ts.map +1 -0
- package/types/index.d.ts +1 -1
- package/LICENSE.md +0 -27
- package/es/Tooltip/types.js +0 -1
- package/lib/Tooltip/types.js +0 -1
- package/src/Tooltip/types.ts +0 -49
- package/types/Tooltip/types.d.ts.map +0 -1
package/src/index.ts
CHANGED
package/types/Tooltip/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { jsx } from '@instructure/emotion';
|
|
5
|
-
import { TooltipProps } from './
|
|
4
|
+
import type { TooltipProps } from './props';
|
|
6
5
|
/**
|
|
7
6
|
---
|
|
8
7
|
category: components
|
|
@@ -10,91 +9,48 @@ category: components
|
|
|
10
9
|
**/
|
|
11
10
|
declare class Tooltip extends Component<TooltipProps> {
|
|
12
11
|
static readonly componentId = "Tooltip";
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* Specifies where the Tooltip will be placed in relation to the target element.
|
|
48
|
-
* Ex. placement="bottom" will render the Tooltip below the triggering element
|
|
49
|
-
* (Note: if there is not room, it will position opposite. Ex. "top" will
|
|
50
|
-
* automatically switch to "bottom")
|
|
51
|
-
*/
|
|
52
|
-
readonly placement: PropTypes.Requireable<string>;
|
|
53
|
-
/**
|
|
54
|
-
* An element or a function returning an element to use as the mount node
|
|
55
|
-
* for the `<Tooltip />` (defaults to `document.body`)
|
|
56
|
-
*/
|
|
57
|
-
readonly mountNode: PropTypes.Requireable<Element | PropTypes.ReactElementLike | ((...args: any[]) => any)>;
|
|
58
|
-
/**
|
|
59
|
-
* The parent in which to constrain the tooltip.
|
|
60
|
-
* One of: 'window', 'scroll-parent', 'parent', 'none', an element,
|
|
61
|
-
* or a function returning an element
|
|
62
|
-
*/
|
|
63
|
-
readonly constrain: PropTypes.Requireable<string | Element | PropTypes.ReactElementLike | ((...args: any[]) => any)>;
|
|
64
|
-
/**
|
|
65
|
-
* The horizontal offset for the positioned content
|
|
66
|
-
*/
|
|
67
|
-
readonly offsetX: PropTypes.Requireable<string | number>;
|
|
68
|
-
/**
|
|
69
|
-
* The vertical offset for the positioned content
|
|
70
|
-
*/
|
|
71
|
-
readonly offsetY: PropTypes.Requireable<string | number>;
|
|
72
|
-
/**
|
|
73
|
-
* Target element for positioning the Tooltip (if it differs from children/trigger)
|
|
74
|
-
*/
|
|
75
|
-
readonly positionTarget: PropTypes.Requireable<Element | ((...args: any[]) => any) | PropTypes.ReactElementLike>;
|
|
76
|
-
/**
|
|
77
|
-
* Callback fired when content is shown. When controlled, this callback is
|
|
78
|
-
* fired when the tooltip expects to be shown
|
|
79
|
-
*/
|
|
80
|
-
readonly onShowContent: PropTypes.Requireable<(...args: any[]) => any>;
|
|
81
|
-
/**
|
|
82
|
-
* Callback fired when content is hidden. When controlled, this callback is
|
|
83
|
-
* fired when the tooltip expects to be hidden
|
|
84
|
-
*/
|
|
85
|
-
readonly onHideContent: PropTypes.Requireable<(...args: any[]) => any>;
|
|
86
|
-
};
|
|
12
|
+
static allowedProps: readonly (keyof {
|
|
13
|
+
renderTip: import("react").ReactNode | ((...args: any[]) => any);
|
|
14
|
+
children: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
|
15
|
+
isShowingContent?: boolean | undefined;
|
|
16
|
+
defaultIsShowingContent?: boolean | undefined;
|
|
17
|
+
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
18
|
+
on?: "click" | "hover" | "focus" | ("click" | "hover" | "focus")[] | undefined;
|
|
19
|
+
color?: "primary" | "primary-inverse" | undefined;
|
|
20
|
+
placement?: import("@instructure/ui-position").PlacementPropValues | undefined;
|
|
21
|
+
mountNode?: import("@instructure/ui-position").PositionMountNode | undefined;
|
|
22
|
+
constrain?: import("@instructure/ui-position").PositionConstraint | undefined;
|
|
23
|
+
positionTarget?: import("@instructure/ui-position").PositionMountNode | undefined;
|
|
24
|
+
offsetX?: string | number | undefined;
|
|
25
|
+
offsetY?: string | number | undefined;
|
|
26
|
+
onShowContent?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
onHideContent?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
})[];
|
|
29
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
30
|
+
renderTip: import("react").ReactNode | ((...args: any[]) => any);
|
|
31
|
+
children: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
|
|
32
|
+
isShowingContent?: boolean | undefined;
|
|
33
|
+
defaultIsShowingContent?: boolean | undefined;
|
|
34
|
+
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
35
|
+
on?: "click" | "hover" | "focus" | ("click" | "hover" | "focus")[] | undefined;
|
|
36
|
+
color?: "primary" | "primary-inverse" | undefined;
|
|
37
|
+
placement?: import("@instructure/ui-position").PlacementPropValues | undefined;
|
|
38
|
+
mountNode?: import("@instructure/ui-position").PositionMountNode | undefined;
|
|
39
|
+
constrain?: import("@instructure/ui-position").PositionConstraint | undefined;
|
|
40
|
+
positionTarget?: import("@instructure/ui-position").PositionMountNode | undefined;
|
|
41
|
+
offsetX?: string | number | undefined;
|
|
42
|
+
offsetY?: string | number | undefined;
|
|
43
|
+
onShowContent?: ((...args: any[]) => any) | undefined;
|
|
44
|
+
onHideContent?: ((...args: any[]) => any) | undefined;
|
|
45
|
+
}>;
|
|
87
46
|
static defaultProps: {
|
|
88
|
-
readonly isShowingContent: undefined;
|
|
89
47
|
readonly defaultIsShowingContent: false;
|
|
90
|
-
readonly on: undefined;
|
|
91
48
|
readonly color: "primary";
|
|
92
49
|
readonly placement: "top";
|
|
93
50
|
readonly mountNode: null;
|
|
94
51
|
readonly constrain: "window";
|
|
95
52
|
readonly offsetX: 0;
|
|
96
53
|
readonly offsetY: 0;
|
|
97
|
-
readonly positionTarget: undefined;
|
|
98
54
|
readonly onShowContent: (event: any) => void;
|
|
99
55
|
readonly onHideContent: (event: any, { documentClick }: {
|
|
100
56
|
documentClick: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tooltip/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tooltip/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C;;;;GAIG;AACH,cAEM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,aAAY;IAEvC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;;;MAYT;IAEV,GAAG,SAAiB;IACpB,KAAK;;MAAsB;IAE3B,iBAAiB;IAKjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,WAAW,uBAEV;IAGD,UAAU,uBAET;IAED,aAAa;IAgCb,MAAM;CA+CP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { AsElementType } from '@instructure/shared-types';
|
|
1
|
+
import type { PropValidators, AsElementType } from '@instructure/shared-types';
|
|
3
2
|
import type { PlacementPropValues, PositionConstraint, PositionMountNode } from '@instructure/ui-position';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
5
|
+
declare type TooltipOwnProps = {
|
|
7
6
|
renderTip: React.ReactNode | ((...args: any[]) => any);
|
|
7
|
+
children: React.ReactNode | ((...args: any[]) => React.ReactNode);
|
|
8
8
|
isShowingContent?: boolean;
|
|
9
9
|
defaultIsShowingContent?: boolean;
|
|
10
10
|
as?: AsElementType;
|
|
@@ -19,4 +19,11 @@ export declare type TooltipProps = {
|
|
|
19
19
|
onShowContent?: (...args: any[]) => any;
|
|
20
20
|
onHideContent?: (...args: any[]) => any;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
declare type PropKeys = keyof TooltipOwnProps;
|
|
23
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
24
|
+
declare type TooltipProps = TooltipOwnProps & WithStyleProps;
|
|
25
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
26
|
+
declare const allowedProps: AllowedPropKeys;
|
|
27
|
+
export type { TooltipProps };
|
|
28
|
+
export { propTypes, allowedProps };
|
|
29
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Tooltip/props.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,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,CAAA;AAEpD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA0EvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAgBnB,CAAA;AAED,YAAY,EAAE,YAAY,EAAE,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/index.d.ts
CHANGED
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|
package/es/Tooltip/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/Tooltip/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/src/Tooltip/types.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* The MIT License (MIT)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import { AsElementType } from '@instructure/shared-types'
|
|
26
|
-
import type {
|
|
27
|
-
PlacementPropValues,
|
|
28
|
-
PositionConstraint,
|
|
29
|
-
PositionMountNode
|
|
30
|
-
} from '@instructure/ui-position'
|
|
31
|
-
|
|
32
|
-
export type TooltipProps = {
|
|
33
|
-
makeStyles?: (...args: any[]) => any
|
|
34
|
-
styles?: any
|
|
35
|
-
renderTip: React.ReactNode | ((...args: any[]) => any)
|
|
36
|
-
isShowingContent?: boolean
|
|
37
|
-
defaultIsShowingContent?: boolean
|
|
38
|
-
as?: AsElementType
|
|
39
|
-
on?: ('click' | 'hover' | 'focus') | ('click' | 'hover' | 'focus')[]
|
|
40
|
-
color?: 'primary' | 'primary-inverse'
|
|
41
|
-
placement?: PlacementPropValues
|
|
42
|
-
mountNode?: PositionMountNode
|
|
43
|
-
constrain?: PositionConstraint
|
|
44
|
-
positionTarget?: PositionMountNode
|
|
45
|
-
offsetX?: string | number
|
|
46
|
-
offsetY?: string | number
|
|
47
|
-
onShowContent?: (...args: any[]) => any
|
|
48
|
-
onHideContent?: (...args: any[]) => any
|
|
49
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Tooltip/types.ts"],"names":[],"mappings":";AAwBA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAEjC,oBAAY,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACtD,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"}
|