@instructure/ui-tag 8.13.1-snapshot.9 → 8.14.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 +4 -0
- package/es/Tag/TagLocator.js +2 -1
- package/es/Tag/__examples__/Tag.examples.js +1 -1
- package/es/Tag/index.js +13 -8
- package/es/Tag/props.js +0 -22
- package/lib/Tag/TagLocator.js +1 -0
- package/lib/Tag/__examples__/Tag.examples.js +1 -1
- package/lib/Tag/index.js +15 -8
- package/lib/Tag/props.js +0 -22
- package/package.json +15 -16
- package/src/Tag/__examples__/Tag.examples.ts +6 -3
- package/src/Tag/index.tsx +16 -15
- package/src/Tag/props.ts +21 -18
- package/tsconfig.build.json +19 -2
- package/tsconfig.build.tsbuildinfo +1 -0
- package/types/Tag/TagLocator.d.ts +52 -52
- package/types/Tag/__examples__/Tag.examples.d.ts +3 -9
- package/types/Tag/__examples__/Tag.examples.d.ts.map +1 -1
- package/types/Tag/index.d.ts +11 -8
- package/types/Tag/index.d.ts.map +1 -1
- package/types/Tag/props.d.ts +20 -2
- package/types/Tag/props.d.ts.map +1 -1
- package/LICENSE.md +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.14.0](https://github.com/instructure/instructure-ui/compare/v8.13.0...v8.14.0) (2021-12-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-tag
|
|
9
|
+
|
|
6
10
|
# [8.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @instructure/ui-tag
|
package/es/Tag/TagLocator.js
CHANGED
|
@@ -22,5 +22,6 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import { locator } from '@instructure/ui-test-locator';
|
|
25
|
-
import { Tag } from './index';
|
|
25
|
+
import { Tag } from './index'; // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
26
|
+
|
|
26
27
|
export const TagLocator = locator(Tag.selector);
|
package/es/Tag/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
/** @jsx jsx */
|
|
28
|
-
import { Component } from 'react';
|
|
28
|
+
import React, { Component } from 'react';
|
|
29
29
|
import { IconXSolid } from '@instructure/ui-icons';
|
|
30
30
|
import { View } from '@instructure/ui-view';
|
|
31
31
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
@@ -39,14 +39,16 @@ import { allowedProps, propTypes } from './props';
|
|
|
39
39
|
---
|
|
40
40
|
category: components
|
|
41
41
|
---
|
|
42
|
+
@tsProps
|
|
42
43
|
**/
|
|
43
44
|
|
|
44
45
|
let Tag = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class Tag extends Component {
|
|
45
46
|
constructor() {
|
|
46
47
|
super(...arguments);
|
|
48
|
+
this.ref = null;
|
|
47
49
|
|
|
48
50
|
this.focus = () => {
|
|
49
|
-
this.
|
|
51
|
+
this.ref && this.ref.focus();
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
this.handleClick = e => {
|
|
@@ -63,8 +65,12 @@ let Tag = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = test
|
|
|
63
65
|
}
|
|
64
66
|
};
|
|
65
67
|
|
|
66
|
-
this.handleRef =
|
|
67
|
-
this.
|
|
68
|
+
this.handleRef = element => {
|
|
69
|
+
this.ref = element;
|
|
70
|
+
|
|
71
|
+
if (typeof this.props.elementRef === 'function') {
|
|
72
|
+
this.props.elementRef(element);
|
|
73
|
+
}
|
|
68
74
|
};
|
|
69
75
|
}
|
|
70
76
|
|
|
@@ -74,14 +80,14 @@ let Tag = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = test
|
|
|
74
80
|
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
75
81
|
}
|
|
76
82
|
|
|
77
|
-
componentDidUpdate(
|
|
83
|
+
componentDidUpdate() {
|
|
78
84
|
var _this$props$makeStyle2, _this$props3;
|
|
79
85
|
|
|
80
86
|
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
get focused() {
|
|
84
|
-
return isActiveElement(this.
|
|
90
|
+
return isActiveElement(this.ref);
|
|
85
91
|
}
|
|
86
92
|
|
|
87
93
|
render() {
|
|
@@ -97,8 +103,7 @@ let Tag = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = test
|
|
|
97
103
|
styles = _this$props4.styles;
|
|
98
104
|
const passthroughProps = View.omitViewProps(omitProps(this.props, Tag.allowedProps), Tag);
|
|
99
105
|
return jsx(View, Object.assign({}, passthroughProps, {
|
|
100
|
-
|
|
101
|
-
elementRef: this.props.elementRef,
|
|
106
|
+
elementRef: this.handleRef,
|
|
102
107
|
css: styles === null || styles === void 0 ? void 0 : styles.tag,
|
|
103
108
|
className: className,
|
|
104
109
|
as: onClick ? 'button' : 'span',
|
package/es/Tag/props.js
CHANGED
|
@@ -27,33 +27,11 @@ const propTypes = {
|
|
|
27
27
|
className: PropTypes.string,
|
|
28
28
|
text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
29
29
|
title: PropTypes.string,
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Whether or not to disable the tag
|
|
33
|
-
*/
|
|
34
30
|
disabled: PropTypes.bool,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Works just like disabled but keeps the same styles as if it were active
|
|
38
|
-
*/
|
|
39
31
|
readOnly: PropTypes.bool,
|
|
40
32
|
dismissible: PropTypes.bool,
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Valid values are `0`, `none`, `auto`, `xxxx-small`, `xx-small`, `x-small`,
|
|
44
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
45
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
46
|
-
*/
|
|
47
33
|
margin: ThemeablePropTypes.spacing,
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* If you add an onClick prop, Tag renders as a clickable button
|
|
51
|
-
*/
|
|
52
34
|
onClick: PropTypes.func,
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Provides a reference to the underlying html root element
|
|
56
|
-
*/
|
|
57
35
|
elementRef: PropTypes.func,
|
|
58
36
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
59
37
|
variant: PropTypes.oneOf(['default', 'inline'])
|
package/lib/Tag/TagLocator.js
CHANGED
|
@@ -32,5 +32,6 @@ var _index = require("./index");
|
|
|
32
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
33
|
* SOFTWARE.
|
|
34
34
|
*/
|
|
35
|
+
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
35
36
|
const TagLocator = (0, _locator.locator)(_index.Tag.selector);
|
|
36
37
|
exports.TagLocator = TagLocator;
|
package/lib/Tag/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -7,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
9
|
});
|
|
8
10
|
exports.default = exports.Tag = void 0;
|
|
9
11
|
|
|
10
|
-
var _react = require("react");
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _IconXSolid = require("@instructure/ui-icons/lib/IconXSolid.js");
|
|
13
15
|
|
|
@@ -33,13 +35,15 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
33
35
|
---
|
|
34
36
|
category: components
|
|
35
37
|
---
|
|
38
|
+
@tsProps
|
|
36
39
|
**/
|
|
37
40
|
let Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class Tag extends _react.Component {
|
|
38
41
|
constructor() {
|
|
39
42
|
super(...arguments);
|
|
43
|
+
this.ref = null;
|
|
40
44
|
|
|
41
45
|
this.focus = () => {
|
|
42
|
-
this.
|
|
46
|
+
this.ref && this.ref.focus();
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
this.handleClick = e => {
|
|
@@ -56,8 +60,12 @@ let Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec
|
|
|
56
60
|
}
|
|
57
61
|
};
|
|
58
62
|
|
|
59
|
-
this.handleRef =
|
|
60
|
-
this.
|
|
63
|
+
this.handleRef = element => {
|
|
64
|
+
this.ref = element;
|
|
65
|
+
|
|
66
|
+
if (typeof this.props.elementRef === 'function') {
|
|
67
|
+
this.props.elementRef(element);
|
|
68
|
+
}
|
|
61
69
|
};
|
|
62
70
|
}
|
|
63
71
|
|
|
@@ -67,14 +75,14 @@ let Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec
|
|
|
67
75
|
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
68
76
|
}
|
|
69
77
|
|
|
70
|
-
componentDidUpdate(
|
|
78
|
+
componentDidUpdate() {
|
|
71
79
|
var _this$props$makeStyle2, _this$props3;
|
|
72
80
|
|
|
73
81
|
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
74
82
|
}
|
|
75
83
|
|
|
76
84
|
get focused() {
|
|
77
|
-
return (0, _isActiveElement.isActiveElement)(this.
|
|
85
|
+
return (0, _isActiveElement.isActiveElement)(this.ref);
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
render() {
|
|
@@ -92,8 +100,7 @@ let Tag = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec
|
|
|
92
100
|
const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, Tag.allowedProps), Tag);
|
|
93
101
|
|
|
94
102
|
return (0, _emotion.jsx)(_View.View, Object.assign({}, passthroughProps, {
|
|
95
|
-
|
|
96
|
-
elementRef: this.props.elementRef,
|
|
103
|
+
elementRef: this.handleRef,
|
|
97
104
|
css: styles === null || styles === void 0 ? void 0 : styles.tag,
|
|
98
105
|
className: className,
|
|
99
106
|
as: onClick ? 'button' : 'span',
|
package/lib/Tag/props.js
CHANGED
|
@@ -38,33 +38,11 @@ const propTypes = {
|
|
|
38
38
|
className: _propTypes.default.string,
|
|
39
39
|
text: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired,
|
|
40
40
|
title: _propTypes.default.string,
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Whether or not to disable the tag
|
|
44
|
-
*/
|
|
45
41
|
disabled: _propTypes.default.bool,
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Works just like disabled but keeps the same styles as if it were active
|
|
49
|
-
*/
|
|
50
42
|
readOnly: _propTypes.default.bool,
|
|
51
43
|
dismissible: _propTypes.default.bool,
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Valid values are `0`, `none`, `auto`, `xxxx-small`, `xx-small`, `x-small`,
|
|
55
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
56
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
57
|
-
*/
|
|
58
44
|
margin: _emotion.ThemeablePropTypes.spacing,
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* If you add an onClick prop, Tag renders as a clickable button
|
|
62
|
-
*/
|
|
63
45
|
onClick: _propTypes.default.func,
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Provides a reference to the underlying html root element
|
|
67
|
-
*/
|
|
68
46
|
elementRef: _propTypes.default.func,
|
|
69
47
|
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
70
48
|
variant: _propTypes.default.oneOf(['default', 'inline'])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tag",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.14.0",
|
|
4
4
|
"description": "A tag component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/console": "8.
|
|
29
|
-
"@instructure/emotion": "8.
|
|
30
|
-
"@instructure/shared-types": "8.
|
|
31
|
-
"@instructure/ui-color-utils": "8.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.
|
|
33
|
-
"@instructure/ui-icons": "8.
|
|
34
|
-
"@instructure/ui-react-utils": "8.
|
|
35
|
-
"@instructure/ui-testable": "8.
|
|
36
|
-
"@instructure/ui-view": "8.
|
|
28
|
+
"@instructure/console": "8.14.0",
|
|
29
|
+
"@instructure/emotion": "8.14.0",
|
|
30
|
+
"@instructure/shared-types": "8.14.0",
|
|
31
|
+
"@instructure/ui-color-utils": "8.14.0",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.14.0",
|
|
33
|
+
"@instructure/ui-icons": "8.14.0",
|
|
34
|
+
"@instructure/ui-react-utils": "8.14.0",
|
|
35
|
+
"@instructure/ui-testable": "8.14.0",
|
|
36
|
+
"@instructure/ui-view": "8.14.0",
|
|
37
37
|
"prop-types": "^15"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@instructure/ui-babel-preset": "8.
|
|
41
|
-
"@instructure/ui-test-locator": "8.
|
|
42
|
-
"@instructure/ui-test-utils": "8.
|
|
43
|
-
"@instructure/ui-themes": "8.
|
|
40
|
+
"@instructure/ui-babel-preset": "8.14.0",
|
|
41
|
+
"@instructure/ui-test-locator": "8.14.0",
|
|
42
|
+
"@instructure/ui-test-utils": "8.14.0",
|
|
43
|
+
"@instructure/ui-themes": "8.14.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.8 <=17"
|
|
@@ -48,6 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"sideEffects": false
|
|
52
|
-
"gitHead": "f32ba918e4d3ce76c6ee95c856584d00a9d80958"
|
|
51
|
+
"sideEffects": false
|
|
53
52
|
}
|
|
@@ -21,15 +21,18 @@
|
|
|
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 type { StoryConfig } from '@instructure/ui-test-utils'
|
|
26
|
+
import type { TagProps } from '../props'
|
|
27
|
+
|
|
24
28
|
export default {
|
|
25
29
|
sectionProp: 'variant',
|
|
26
30
|
propValues: {
|
|
27
31
|
text: ['Some tag', 'A lot of content which will truncate']
|
|
28
32
|
},
|
|
29
|
-
|
|
30
|
-
getComponentProps: (props) => {
|
|
33
|
+
getComponentProps: () => {
|
|
31
34
|
return {
|
|
32
35
|
onClick: () => {}
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
|
-
}
|
|
38
|
+
} as StoryConfig<TagProps>
|
package/src/Tag/index.tsx
CHANGED
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
/** @jsx jsx */
|
|
25
|
-
import { Component } from 'react'
|
|
25
|
+
import React, { Component } from 'react'
|
|
26
26
|
|
|
27
27
|
import { IconXSolid } from '@instructure/ui-icons'
|
|
28
28
|
import { View } from '@instructure/ui-view'
|
|
29
|
+
import type { ViewProps } from '@instructure/ui-view'
|
|
29
30
|
import { omitProps } from '@instructure/ui-react-utils'
|
|
30
31
|
import { isActiveElement } from '@instructure/ui-dom-utils'
|
|
31
32
|
import { testable } from '@instructure/ui-testable'
|
|
@@ -40,6 +41,7 @@ import { allowedProps, propTypes } from './props'
|
|
|
40
41
|
---
|
|
41
42
|
category: components
|
|
42
43
|
---
|
|
44
|
+
@tsProps
|
|
43
45
|
**/
|
|
44
46
|
|
|
45
47
|
@withStyle(generateStyle, generateComponentTheme)
|
|
@@ -57,27 +59,25 @@ class Tag extends Component<TagProps> {
|
|
|
57
59
|
readOnly: false
|
|
58
60
|
}
|
|
59
61
|
|
|
62
|
+
ref: Element | null = null
|
|
63
|
+
|
|
60
64
|
componentDidMount() {
|
|
61
65
|
this.props.makeStyles?.()
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
|
|
65
|
-
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
68
|
+
componentDidUpdate() {
|
|
66
69
|
this.props.makeStyles?.()
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
get focused() {
|
|
70
|
-
|
|
71
|
-
return isActiveElement(this._container)
|
|
73
|
+
return isActiveElement(this.ref)
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
focus = () => {
|
|
75
|
-
|
|
76
|
-
this._container && this._container.focus()
|
|
77
|
+
this.ref && (this.ref as HTMLElement).focus()
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
handleClick = (e) => {
|
|
80
|
+
handleClick = (e: React.MouseEvent<ViewProps>) => {
|
|
81
81
|
const { disabled, readOnly, onClick } = this.props
|
|
82
82
|
|
|
83
83
|
if (disabled || readOnly) {
|
|
@@ -88,10 +88,12 @@ class Tag extends Component<TagProps> {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.
|
|
91
|
+
handleRef = (element: Element | null) => {
|
|
92
|
+
this.ref = element
|
|
93
|
+
|
|
94
|
+
if (typeof this.props.elementRef === 'function') {
|
|
95
|
+
this.props.elementRef(element)
|
|
96
|
+
}
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
render() {
|
|
@@ -115,8 +117,7 @@ class Tag extends Component<TagProps> {
|
|
|
115
117
|
return (
|
|
116
118
|
<View
|
|
117
119
|
{...passthroughProps}
|
|
118
|
-
|
|
119
|
-
elementRef={this.props.elementRef}
|
|
120
|
+
elementRef={this.handleRef}
|
|
120
121
|
css={styles?.tag}
|
|
121
122
|
className={className}
|
|
122
123
|
as={onClick ? 'button' : 'span'}
|
package/src/Tag/props.ts
CHANGED
|
@@ -21,10 +21,13 @@
|
|
|
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'
|
|
25
27
|
|
|
26
28
|
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
27
29
|
|
|
30
|
+
import type { ViewProps } from '@instructure/ui-view'
|
|
28
31
|
import type {
|
|
29
32
|
Spacing,
|
|
30
33
|
WithStyleProps,
|
|
@@ -40,11 +43,28 @@ type TagOwnProps = {
|
|
|
40
43
|
className?: string
|
|
41
44
|
text: string | React.ReactNode
|
|
42
45
|
title?: string
|
|
46
|
+
/**
|
|
47
|
+
* Whether or not to disable the tag
|
|
48
|
+
*/
|
|
43
49
|
disabled?: boolean
|
|
50
|
+
/**
|
|
51
|
+
* Works just like disabled but keeps the same styles as if it were active
|
|
52
|
+
*/
|
|
44
53
|
readOnly?: boolean
|
|
45
54
|
dismissible?: boolean
|
|
55
|
+
/**
|
|
56
|
+
* Valid values are `0`, `none`, `auto`, `xxxx-small`, `xx-small`, `x-small`,
|
|
57
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
58
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
59
|
+
*/
|
|
46
60
|
margin?: Spacing
|
|
47
|
-
|
|
61
|
+
/**
|
|
62
|
+
* If you add an onClick prop, Tag renders as a clickable button
|
|
63
|
+
*/
|
|
64
|
+
onClick?: (event: React.MouseEvent<ViewProps>) => void
|
|
65
|
+
/**
|
|
66
|
+
* Provides a reference to the underlying html root element
|
|
67
|
+
*/
|
|
48
68
|
elementRef?: (element: Element | null) => void
|
|
49
69
|
size?: 'small' | 'medium' | 'large'
|
|
50
70
|
variant?: 'default' | 'inline'
|
|
@@ -64,28 +84,11 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
64
84
|
className: PropTypes.string,
|
|
65
85
|
text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
66
86
|
title: PropTypes.string,
|
|
67
|
-
/**
|
|
68
|
-
* Whether or not to disable the tag
|
|
69
|
-
*/
|
|
70
87
|
disabled: PropTypes.bool,
|
|
71
|
-
/**
|
|
72
|
-
* Works just like disabled but keeps the same styles as if it were active
|
|
73
|
-
*/
|
|
74
88
|
readOnly: PropTypes.bool,
|
|
75
89
|
dismissible: PropTypes.bool,
|
|
76
|
-
/**
|
|
77
|
-
* Valid values are `0`, `none`, `auto`, `xxxx-small`, `xx-small`, `x-small`,
|
|
78
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
79
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
80
|
-
*/
|
|
81
90
|
margin: ThemeablePropTypes.spacing,
|
|
82
|
-
/**
|
|
83
|
-
* If you add an onClick prop, Tag renders as a clickable button
|
|
84
|
-
*/
|
|
85
91
|
onClick: PropTypes.func,
|
|
86
|
-
/**
|
|
87
|
-
* Provides a reference to the underlying html root element
|
|
88
|
-
*/
|
|
89
92
|
elementRef: PropTypes.func,
|
|
90
93
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
91
94
|
variant: PropTypes.oneOf(['default', 'inline'])
|
package/tsconfig.build.json
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.build.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"outDir": "./types"
|
|
4
|
+
"outDir": "./types",
|
|
5
|
+
"composite": true,
|
|
6
|
+
"rootDir": "./src"
|
|
5
7
|
},
|
|
6
|
-
"include": ["src
|
|
8
|
+
"include": ["src"],
|
|
9
|
+
"references": [
|
|
10
|
+
{ "path": "../console/tsconfig.build.json" },
|
|
11
|
+
{ "path": "../emotion/tsconfig.build.json" },
|
|
12
|
+
{ "path": "../shared-types/tsconfig.build.json" },
|
|
13
|
+
{ "path": "../ui-color-utils/tsconfig.build.json" },
|
|
14
|
+
{ "path": "../ui-dom-utils/tsconfig.build.json" },
|
|
15
|
+
{ "path": "../ui-icons/tsconfig.build.json" },
|
|
16
|
+
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
17
|
+
{ "path": "../ui-testable/tsconfig.build.json" },
|
|
18
|
+
{ "path": "../ui-view/tsconfig.build.json" },
|
|
19
|
+
{ "path": "../ui-babel-preset/tsconfig.build.json" },
|
|
20
|
+
{ "path": "../ui-test-locator/tsconfig.build.json" },
|
|
21
|
+
{ "path": "../ui-test-utils/tsconfig.build.json" },
|
|
22
|
+
{ "path": "../ui-themes/tsconfig.build.json" }
|
|
23
|
+
]
|
|
7
24
|
}
|