@instructure/ui-metric 8.8.0 → 8.8.1-snapshot.63
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/LICENSE.md +27 -0
- package/es/Metric/index.js +7 -16
- package/{src/Metric/types.ts → es/Metric/props.js} +9 -15
- package/es/MetricGroup/index.js +5 -15
- package/{src/MetricGroup/types.ts → es/MetricGroup/props.js} +7 -5
- package/lib/Metric/index.js +8 -17
- package/lib/Metric/props.js +43 -0
- package/lib/MetricGroup/index.js +6 -18
- package/lib/MetricGroup/props.js +40 -0
- package/package.json +14 -13
- package/src/Metric/index.tsx +8 -18
- package/src/Metric/props.ts +63 -0
- package/src/Metric/styles.ts +1 -1
- package/src/Metric/theme.ts +1 -1
- package/src/MetricGroup/index.tsx +6 -17
- package/src/MetricGroup/props.ts +51 -0
- package/src/MetricGroup/theme.ts +1 -1
- package/src/index.ts +2 -2
- package/types/Metric/index.d.ts +13 -12
- package/types/Metric/index.d.ts.map +1 -1
- package/types/Metric/props.d.ts +21 -0
- package/types/Metric/props.d.ts.map +1 -0
- package/types/Metric/styles.d.ts +1 -1
- package/types/Metric/theme.d.ts +1 -1
- package/types/Metric/theme.d.ts.map +1 -1
- package/types/MetricGroup/index.d.ts +3 -13
- package/types/MetricGroup/index.d.ts.map +1 -1
- package/types/MetricGroup/props.d.ts +17 -0
- package/types/MetricGroup/props.d.ts.map +1 -0
- package/types/MetricGroup/theme.d.ts +1 -1
- package/types/MetricGroup/theme.d.ts.map +1 -1
- package/types/index.d.ts +2 -2
- package/es/Metric/types.js +0 -1
- package/es/MetricGroup/types.js +0 -1
- package/lib/Metric/types.js +0 -1
- package/lib/MetricGroup/types.js +0 -1
- package/types/Metric/types.d.ts +0 -14
- package/types/Metric/types.d.ts.map +0 -1
- package/types/MetricGroup/types.d.ts +0 -5
- package/types/MetricGroup/types.d.ts.map +0 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
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/Metric/index.js
CHANGED
|
@@ -29,12 +29,12 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
29
29
|
|
|
30
30
|
/** @jsx jsx */
|
|
31
31
|
import { Component } from 'react';
|
|
32
|
-
import PropTypes from 'prop-types';
|
|
33
32
|
import { testable } from '@instructure/ui-testable';
|
|
34
33
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
35
34
|
import { callRenderProp, passthroughProps } from '@instructure/ui-react-utils';
|
|
36
35
|
import generateStyle from './styles';
|
|
37
36
|
import generateComponentTheme from './theme';
|
|
37
|
+
import { propTypes, allowedProps } from './props';
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
---
|
|
@@ -52,6 +52,8 @@ let Metric = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
render() {
|
|
55
|
+
var _this$props$styles, _this$props$styles2, _this$props$styles3;
|
|
56
|
+
|
|
55
57
|
const _this$props = this.props,
|
|
56
58
|
textAlign = _this$props.textAlign,
|
|
57
59
|
renderLabel = _this$props.renderLabel,
|
|
@@ -61,29 +63,18 @@ let Metric = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
61
63
|
|
|
62
64
|
return jsx("div", Object.assign({}, passthroughProps(rest), {
|
|
63
65
|
role: isGroupChild ? 'row' : void 0,
|
|
64
|
-
css: this.props.styles.metric
|
|
66
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.metric
|
|
65
67
|
}), jsx("div", {
|
|
66
68
|
role: isGroupChild ? 'rowheader' : void 0,
|
|
67
|
-
css: this.props.styles.label
|
|
69
|
+
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label
|
|
68
70
|
}, callRenderProp(renderLabel)), jsx("div", {
|
|
69
71
|
role: isGroupChild ? 'gridcell' : void 0,
|
|
70
|
-
css: this.props.styles.value
|
|
72
|
+
css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.value
|
|
71
73
|
}, callRenderProp(renderValue)));
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
}, _class2.displayName = "Metric", _class2.componentId = 'Metric', _class2.propTypes = {
|
|
75
|
-
// eslint-disable-next-line react/require-default-props
|
|
76
|
-
makeStyles: PropTypes.func,
|
|
77
|
-
// eslint-disable-next-line react/require-default-props
|
|
78
|
-
styles: PropTypes.object,
|
|
79
|
-
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
80
|
-
renderLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
81
|
-
renderValue: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
82
|
-
isGroupChild: PropTypes.bool
|
|
83
|
-
}, _class2.defaultProps = {
|
|
76
|
+
}, _class2.displayName = "Metric", _class2.componentId = 'Metric', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
84
77
|
textAlign: 'center',
|
|
85
|
-
renderLabel: void 0,
|
|
86
|
-
renderValue: void 0,
|
|
87
78
|
isGroupChild: false
|
|
88
79
|
}, _temp)) || _class) || _class);
|
|
89
80
|
export default Metric;
|
|
@@ -21,18 +21,12 @@
|
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Set to true when a child of MetricGroup so the appropriate
|
|
35
|
-
* aria labels get set
|
|
36
|
-
*/
|
|
37
|
-
isGroupChild: boolean
|
|
38
|
-
}
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
const propTypes = {
|
|
26
|
+
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
27
|
+
renderLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
28
|
+
renderValue: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
29
|
+
isGroupChild: PropTypes.bool
|
|
30
|
+
};
|
|
31
|
+
const allowedProps = ['textAlign', 'renderLabel', 'renderValue', 'isGroupChild'];
|
|
32
|
+
export { propTypes, allowedProps };
|
package/es/MetricGroup/index.js
CHANGED
|
@@ -26,14 +26,12 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
26
26
|
|
|
27
27
|
/** @jsx jsx */
|
|
28
28
|
import { Children, Component } from 'react';
|
|
29
|
-
import PropTypes from 'prop-types';
|
|
30
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
31
29
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
32
30
|
import { testable } from '@instructure/ui-testable';
|
|
33
31
|
import { passthroughProps, safeCloneElement } from '@instructure/ui-react-utils';
|
|
34
|
-
import { Metric } from '../Metric';
|
|
35
32
|
import generateStyle from './styles';
|
|
36
33
|
import generateComponentTheme from './theme';
|
|
34
|
+
import { propTypes, allowedProps } from './props';
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
37
|
---
|
|
@@ -59,24 +57,16 @@ let MetricGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
render() {
|
|
60
|
+
var _this$props$styles;
|
|
61
|
+
|
|
62
62
|
return jsx("div", Object.assign({}, passthroughProps(this.props), {
|
|
63
|
-
css: this.props.styles.metricGroup,
|
|
63
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.metricGroup,
|
|
64
64
|
role: "grid",
|
|
65
65
|
"aria-readonly": "true"
|
|
66
66
|
}), this.renderChildren());
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
}, _class2.displayName = "MetricGroup", _class2.componentId = 'MetricGroup', _class2.propTypes = {
|
|
70
|
-
// eslint-disable-next-line react/require-default-props
|
|
71
|
-
makeStyles: PropTypes.func,
|
|
72
|
-
// eslint-disable-next-line react/require-default-props
|
|
73
|
-
styles: PropTypes.object,
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* children of type `Metric`
|
|
77
|
-
*/
|
|
78
|
-
children: ChildrenPropTypes.oneOf([Metric])
|
|
79
|
-
}, _class2.defaultProps = {
|
|
69
|
+
}, _class2.displayName = "MetricGroup", _class2.componentId = 'MetricGroup', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
80
70
|
children: null
|
|
81
71
|
}, _temp)) || _class) || _class);
|
|
82
72
|
export default MetricGroup;
|
|
@@ -21,8 +21,10 @@
|
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
24
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
25
|
+
import { Metric } from '../Metric';
|
|
26
|
+
const propTypes = {
|
|
27
|
+
children: ChildrenPropTypes.oneOf([Metric])
|
|
28
|
+
};
|
|
29
|
+
const allowedProps = ['children'];
|
|
30
|
+
export { propTypes, allowedProps };
|
package/lib/Metric/index.js
CHANGED
|
@@ -11,8 +11,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
14
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
17
15
|
|
|
18
16
|
var _emotion = require("@instructure/emotion");
|
|
@@ -25,6 +23,8 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
25
23
|
|
|
26
24
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
27
25
|
|
|
26
|
+
var _props = require("./props");
|
|
27
|
+
|
|
28
28
|
const _excluded = ["textAlign", "renderLabel", "renderValue", "isGroupChild"];
|
|
29
29
|
|
|
30
30
|
var _dec, _dec2, _class, _class2, _temp;
|
|
@@ -45,6 +45,8 @@ let Metric = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
render() {
|
|
48
|
+
var _this$props$styles, _this$props$styles2, _this$props$styles3;
|
|
49
|
+
|
|
48
50
|
const _this$props = this.props,
|
|
49
51
|
textAlign = _this$props.textAlign,
|
|
50
52
|
renderLabel = _this$props.renderLabel,
|
|
@@ -53,29 +55,18 @@ let Metric = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
|
|
|
53
55
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
54
56
|
return (0, _emotion.jsx)("div", Object.assign({}, (0, _passthroughProps.passthroughProps)(rest), {
|
|
55
57
|
role: isGroupChild ? 'row' : void 0,
|
|
56
|
-
css: this.props.styles.metric
|
|
58
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.metric
|
|
57
59
|
}), (0, _emotion.jsx)("div", {
|
|
58
60
|
role: isGroupChild ? 'rowheader' : void 0,
|
|
59
|
-
css: this.props.styles.label
|
|
61
|
+
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label
|
|
60
62
|
}, (0, _callRenderProp.callRenderProp)(renderLabel)), (0, _emotion.jsx)("div", {
|
|
61
63
|
role: isGroupChild ? 'gridcell' : void 0,
|
|
62
|
-
css: this.props.styles.value
|
|
64
|
+
css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.value
|
|
63
65
|
}, (0, _callRenderProp.callRenderProp)(renderValue)));
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
}, _class2.displayName = "Metric", _class2.componentId = 'Metric', _class2.propTypes = {
|
|
67
|
-
// eslint-disable-next-line react/require-default-props
|
|
68
|
-
makeStyles: _propTypes.default.func,
|
|
69
|
-
// eslint-disable-next-line react/require-default-props
|
|
70
|
-
styles: _propTypes.default.object,
|
|
71
|
-
textAlign: _propTypes.default.oneOf(['start', 'center', 'end']),
|
|
72
|
-
renderLabel: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
73
|
-
renderValue: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
74
|
-
isGroupChild: _propTypes.default.bool
|
|
75
|
-
}, _class2.defaultProps = {
|
|
68
|
+
}, _class2.displayName = "Metric", _class2.componentId = 'Metric', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
76
69
|
textAlign: 'center',
|
|
77
|
-
renderLabel: void 0,
|
|
78
|
-
renderValue: void 0,
|
|
79
70
|
isGroupChild: false
|
|
80
71
|
}, _temp)) || _class) || _class);
|
|
81
72
|
exports.Metric = Metric;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* The MIT License (MIT)
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
16
|
+
*
|
|
17
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
* in the Software without restriction, including without limitation the rights
|
|
20
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
* furnished to do so, subject to the following conditions:
|
|
23
|
+
*
|
|
24
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
* copies or substantial portions of the Software.
|
|
26
|
+
*
|
|
27
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
* SOFTWARE.
|
|
34
|
+
*/
|
|
35
|
+
const propTypes = {
|
|
36
|
+
textAlign: _propTypes.default.oneOf(['start', 'center', 'end']),
|
|
37
|
+
renderLabel: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
38
|
+
renderValue: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
39
|
+
isGroupChild: _propTypes.default.bool
|
|
40
|
+
};
|
|
41
|
+
exports.propTypes = propTypes;
|
|
42
|
+
const allowedProps = ['textAlign', 'renderLabel', 'renderValue', 'isGroupChild'];
|
|
43
|
+
exports.allowedProps = allowedProps;
|
package/lib/MetricGroup/index.js
CHANGED
|
@@ -9,10 +9,6 @@ exports.MetricGroup = exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
15
|
-
|
|
16
12
|
var _emotion = require("@instructure/emotion");
|
|
17
13
|
|
|
18
14
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
@@ -21,12 +17,12 @@ var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProp
|
|
|
21
17
|
|
|
22
18
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
23
19
|
|
|
24
|
-
var _Metric = require("../Metric");
|
|
25
|
-
|
|
26
20
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
27
21
|
|
|
28
22
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
29
23
|
|
|
24
|
+
var _props = require("./props");
|
|
25
|
+
|
|
30
26
|
var _dec, _dec2, _class, _class2, _temp;
|
|
31
27
|
|
|
32
28
|
/**
|
|
@@ -53,24 +49,16 @@ let MetricGroup = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
render() {
|
|
52
|
+
var _this$props$styles;
|
|
53
|
+
|
|
56
54
|
return (0, _emotion.jsx)("div", Object.assign({}, (0, _passthroughProps.passthroughProps)(this.props), {
|
|
57
|
-
css: this.props.styles.metricGroup,
|
|
55
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.metricGroup,
|
|
58
56
|
role: "grid",
|
|
59
57
|
"aria-readonly": "true"
|
|
60
58
|
}), this.renderChildren());
|
|
61
59
|
}
|
|
62
60
|
|
|
63
|
-
}, _class2.displayName = "MetricGroup", _class2.componentId = 'MetricGroup', _class2.propTypes = {
|
|
64
|
-
// eslint-disable-next-line react/require-default-props
|
|
65
|
-
makeStyles: _propTypes.default.func,
|
|
66
|
-
// eslint-disable-next-line react/require-default-props
|
|
67
|
-
styles: _propTypes.default.object,
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* children of type `Metric`
|
|
71
|
-
*/
|
|
72
|
-
children: _Children.Children.oneOf([_Metric.Metric])
|
|
73
|
-
}, _class2.defaultProps = {
|
|
61
|
+
}, _class2.displayName = "MetricGroup", _class2.componentId = 'MetricGroup', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
74
62
|
children: null
|
|
75
63
|
}, _temp)) || _class) || _class);
|
|
76
64
|
exports.MetricGroup = MetricGroup;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
7
|
+
|
|
8
|
+
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
9
|
+
|
|
10
|
+
var _Metric = require("../Metric");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* The MIT License (MIT)
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
16
|
+
*
|
|
17
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
* in the Software without restriction, including without limitation the rights
|
|
20
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
* furnished to do so, subject to the following conditions:
|
|
23
|
+
*
|
|
24
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
* copies or substantial portions of the Software.
|
|
26
|
+
*
|
|
27
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
* SOFTWARE.
|
|
34
|
+
*/
|
|
35
|
+
const propTypes = {
|
|
36
|
+
children: _Children.Children.oneOf([_Metric.Metric])
|
|
37
|
+
};
|
|
38
|
+
exports.propTypes = propTypes;
|
|
39
|
+
const allowedProps = ['children'];
|
|
40
|
+
exports.allowedProps = allowedProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-metric",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.1-snapshot.63+ec21bbc1d",
|
|
4
4
|
"description": "A UI component for displaying Metrics",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/console": "8.8.
|
|
29
|
-
"@instructure/emotion": "8.8.
|
|
30
|
-
"@instructure/
|
|
31
|
-
"@instructure/ui-
|
|
32
|
-
"@instructure/ui-
|
|
28
|
+
"@instructure/console": "8.8.1-snapshot.63+ec21bbc1d",
|
|
29
|
+
"@instructure/emotion": "8.8.1-snapshot.63+ec21bbc1d",
|
|
30
|
+
"@instructure/shared-types": "8.8.1-snapshot.63+ec21bbc1d",
|
|
31
|
+
"@instructure/ui-prop-types": "8.8.1-snapshot.63+ec21bbc1d",
|
|
32
|
+
"@instructure/ui-react-utils": "8.8.1-snapshot.63+ec21bbc1d",
|
|
33
|
+
"@instructure/ui-testable": "8.8.1-snapshot.63+ec21bbc1d",
|
|
33
34
|
"prop-types": "^15"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@instructure/
|
|
37
|
-
"@instructure/ui-
|
|
38
|
-
"@instructure/ui-
|
|
39
|
-
"@instructure/ui-test-
|
|
40
|
-
"@instructure/ui-
|
|
41
|
-
"@instructure/ui-themes": "8.8.0"
|
|
37
|
+
"@instructure/ui-babel-preset": "8.8.1-snapshot.63+ec21bbc1d",
|
|
38
|
+
"@instructure/ui-color-utils": "8.8.1-snapshot.63+ec21bbc1d",
|
|
39
|
+
"@instructure/ui-test-locator": "8.8.1-snapshot.63+ec21bbc1d",
|
|
40
|
+
"@instructure/ui-test-utils": "8.8.1-snapshot.63+ec21bbc1d",
|
|
41
|
+
"@instructure/ui-themes": "8.8.1-snapshot.63+ec21bbc1d"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">=16.8 <=17"
|
|
@@ -46,5 +46,6 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"sideEffects": false
|
|
49
|
+
"sideEffects": false,
|
|
50
|
+
"gitHead": "ec21bbc1dcdd8567b11f2c15f5fadd16709d7e3d"
|
|
50
51
|
}
|
package/src/Metric/index.tsx
CHANGED
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
*/
|
|
24
24
|
/** @jsx jsx */
|
|
25
25
|
import { Component } from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
26
|
|
|
28
27
|
import { testable } from '@instructure/ui-testable'
|
|
29
28
|
import { withStyle, jsx } from '@instructure/emotion'
|
|
@@ -32,7 +31,9 @@ import { OtherHTMLAttributes } from '@instructure/shared-types'
|
|
|
32
31
|
|
|
33
32
|
import generateStyle from './styles'
|
|
34
33
|
import generateComponentTheme from './theme'
|
|
35
|
-
|
|
34
|
+
|
|
35
|
+
import { propTypes, allowedProps } from './props'
|
|
36
|
+
import type { MetricProps } from './props'
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
---
|
|
@@ -45,21 +46,10 @@ category: components
|
|
|
45
46
|
class Metric extends Component<MetricProps & OtherHTMLAttributes<MetricProps>> {
|
|
46
47
|
static readonly componentId = 'Metric'
|
|
47
48
|
|
|
48
|
-
static propTypes =
|
|
49
|
-
|
|
50
|
-
makeStyles: PropTypes.func,
|
|
51
|
-
// eslint-disable-next-line react/require-default-props
|
|
52
|
-
styles: PropTypes.object,
|
|
53
|
-
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
54
|
-
renderLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
55
|
-
renderValue: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
56
|
-
isGroupChild: PropTypes.bool
|
|
57
|
-
}
|
|
58
|
-
|
|
49
|
+
static propTypes = propTypes
|
|
50
|
+
static allowedProps = allowedProps
|
|
59
51
|
static defaultProps = {
|
|
60
52
|
textAlign: 'center',
|
|
61
|
-
renderLabel: undefined,
|
|
62
|
-
renderValue: undefined,
|
|
63
53
|
isGroupChild: false
|
|
64
54
|
}
|
|
65
55
|
|
|
@@ -86,17 +76,17 @@ class Metric extends Component<MetricProps & OtherHTMLAttributes<MetricProps>> {
|
|
|
86
76
|
<div
|
|
87
77
|
{...passthroughProps(rest)}
|
|
88
78
|
role={isGroupChild ? 'row' : undefined}
|
|
89
|
-
css={this.props.styles
|
|
79
|
+
css={this.props.styles?.metric}
|
|
90
80
|
>
|
|
91
81
|
<div
|
|
92
82
|
role={isGroupChild ? 'rowheader' : undefined}
|
|
93
|
-
css={this.props.styles
|
|
83
|
+
css={this.props.styles?.label}
|
|
94
84
|
>
|
|
95
85
|
{callRenderProp(renderLabel)}
|
|
96
86
|
</div>
|
|
97
87
|
<div
|
|
98
88
|
role={isGroupChild ? 'gridcell' : undefined}
|
|
99
|
-
css={this.props.styles
|
|
89
|
+
css={this.props.styles?.value}
|
|
100
90
|
>
|
|
101
91
|
{callRenderProp(renderValue)}
|
|
102
92
|
</div>
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { ReactNode } from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
27
|
+
|
|
28
|
+
import type { PropValidators } from '@instructure/shared-types'
|
|
29
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
|
30
|
+
|
|
31
|
+
type MetricOwnProps = {
|
|
32
|
+
textAlign: 'start' | 'center' | 'end'
|
|
33
|
+
renderLabel?: ((props?: any) => ReactNode) | ReactNode
|
|
34
|
+
renderValue?: ((props?: any) => ReactNode) | ReactNode
|
|
35
|
+
/**
|
|
36
|
+
* Set to true when a child of MetricGroup so the appropriate
|
|
37
|
+
* aria labels get set
|
|
38
|
+
*/
|
|
39
|
+
isGroupChild: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type PropKeys = keyof MetricOwnProps
|
|
43
|
+
|
|
44
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
45
|
+
|
|
46
|
+
type MetricProps = MetricOwnProps & WithStyleProps
|
|
47
|
+
|
|
48
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
49
|
+
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
50
|
+
renderLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
51
|
+
renderValue: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
52
|
+
isGroupChild: PropTypes.bool
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const allowedProps: AllowedPropKeys = [
|
|
56
|
+
'textAlign',
|
|
57
|
+
'renderLabel',
|
|
58
|
+
'renderValue',
|
|
59
|
+
'isGroupChild'
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
export type { MetricProps }
|
|
63
|
+
export { propTypes, allowedProps }
|
package/src/Metric/styles.ts
CHANGED
package/src/Metric/theme.ts
CHANGED
|
@@ -24,19 +24,17 @@
|
|
|
24
24
|
|
|
25
25
|
/** @jsx jsx */
|
|
26
26
|
import { Children, Component, ReactElement } from 'react'
|
|
27
|
-
import PropTypes from 'prop-types'
|
|
28
27
|
|
|
29
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
30
28
|
import { withStyle, jsx } from '@instructure/emotion'
|
|
31
29
|
import { testable } from '@instructure/ui-testable'
|
|
32
30
|
import { passthroughProps, safeCloneElement } from '@instructure/ui-react-utils'
|
|
33
31
|
import { OtherHTMLAttributes } from '@instructure/shared-types'
|
|
34
32
|
|
|
35
|
-
import { Metric } from '../Metric'
|
|
36
|
-
|
|
37
33
|
import generateStyle from './styles'
|
|
38
34
|
import generateComponentTheme from './theme'
|
|
39
|
-
|
|
35
|
+
|
|
36
|
+
import { propTypes, allowedProps } from './props'
|
|
37
|
+
import type { MetricGroupProps } from './props'
|
|
40
38
|
|
|
41
39
|
/**
|
|
42
40
|
---
|
|
@@ -51,17 +49,8 @@ class MetricGroup extends Component<
|
|
|
51
49
|
> {
|
|
52
50
|
static readonly componentId = 'MetricGroup'
|
|
53
51
|
|
|
54
|
-
static propTypes =
|
|
55
|
-
|
|
56
|
-
makeStyles: PropTypes.func,
|
|
57
|
-
// eslint-disable-next-line react/require-default-props
|
|
58
|
-
styles: PropTypes.object,
|
|
59
|
-
/**
|
|
60
|
-
* children of type `Metric`
|
|
61
|
-
*/
|
|
62
|
-
children: ChildrenPropTypes.oneOf([Metric])
|
|
63
|
-
}
|
|
64
|
-
|
|
52
|
+
static propTypes = propTypes
|
|
53
|
+
static allowedProps = allowedProps
|
|
65
54
|
static defaultProps = {
|
|
66
55
|
children: null
|
|
67
56
|
}
|
|
@@ -88,7 +77,7 @@ class MetricGroup extends Component<
|
|
|
88
77
|
return (
|
|
89
78
|
<div
|
|
90
79
|
{...passthroughProps(this.props)}
|
|
91
|
-
css={this.props.styles
|
|
80
|
+
css={this.props.styles?.metricGroup}
|
|
92
81
|
role="grid"
|
|
93
82
|
aria-readonly="true"
|
|
94
83
|
>
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
26
|
+
import { Metric } from '../Metric'
|
|
27
|
+
|
|
28
|
+
import type { PropValidators } from '@instructure/shared-types'
|
|
29
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
|
30
|
+
|
|
31
|
+
type MetricGroupOwnProps = {
|
|
32
|
+
/**
|
|
33
|
+
* children of type `Metric`
|
|
34
|
+
*/
|
|
35
|
+
children?: React.ReactNode // TODO: oneOf([Metric])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type PropKeys = keyof MetricGroupOwnProps
|
|
39
|
+
|
|
40
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
41
|
+
|
|
42
|
+
type MetricGroupProps = MetricGroupOwnProps & WithStyleProps
|
|
43
|
+
|
|
44
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
45
|
+
children: ChildrenPropTypes.oneOf([Metric])
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const allowedProps: AllowedPropKeys = ['children']
|
|
49
|
+
|
|
50
|
+
export type { MetricGroupProps }
|
|
51
|
+
export { propTypes, allowedProps }
|
package/src/MetricGroup/theme.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
export { Metric } from './Metric'
|
|
26
26
|
export { MetricGroup } from './MetricGroup'
|
|
27
27
|
|
|
28
|
-
export type { MetricProps } from './Metric/
|
|
29
|
-
export type { MetricGroupProps } from './MetricGroup/
|
|
28
|
+
export type { MetricProps } from './Metric/props'
|
|
29
|
+
export type { MetricGroupProps } from './MetricGroup/props'
|
package/types/Metric/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { jsx } from '@instructure/emotion';
|
|
5
4
|
import { OtherHTMLAttributes } from '@instructure/shared-types';
|
|
6
|
-
import { MetricProps } from './
|
|
5
|
+
import type { MetricProps } from './props';
|
|
7
6
|
/**
|
|
8
7
|
---
|
|
9
8
|
category: components
|
|
@@ -12,18 +11,20 @@ category: components
|
|
|
12
11
|
**/
|
|
13
12
|
declare class Metric extends Component<MetricProps & OtherHTMLAttributes<MetricProps>> {
|
|
14
13
|
static readonly componentId = "Metric";
|
|
15
|
-
static propTypes: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
15
|
+
textAlign: "start" | "center" | "end";
|
|
16
|
+
renderLabel?: import("react").ReactNode | ((props?: any) => import("react").ReactNode);
|
|
17
|
+
renderValue?: import("react").ReactNode | ((props?: any) => import("react").ReactNode);
|
|
18
|
+
isGroupChild: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
static allowedProps: readonly (keyof {
|
|
21
|
+
textAlign: "start" | "center" | "end";
|
|
22
|
+
renderLabel?: import("react").ReactNode | ((props?: any) => import("react").ReactNode);
|
|
23
|
+
renderValue?: import("react").ReactNode | ((props?: any) => import("react").ReactNode);
|
|
24
|
+
isGroupChild: boolean;
|
|
25
|
+
})[];
|
|
23
26
|
static defaultProps: {
|
|
24
27
|
textAlign: string;
|
|
25
|
-
renderLabel: undefined;
|
|
26
|
-
renderValue: undefined;
|
|
27
28
|
isGroupChild: boolean;
|
|
28
29
|
};
|
|
29
30
|
componentDidMount(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Metric/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Metric/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAM/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;GAKG;AACH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC5E,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGlB;IAED,iBAAiB;IAKjB,kBAAkB;IAKlB,MAAM;CA8BP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
4
|
+
declare type MetricOwnProps = {
|
|
5
|
+
textAlign: 'start' | 'center' | 'end';
|
|
6
|
+
renderLabel?: ((props?: any) => ReactNode) | ReactNode;
|
|
7
|
+
renderValue?: ((props?: any) => ReactNode) | ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Set to true when a child of MetricGroup so the appropriate
|
|
10
|
+
* aria labels get set
|
|
11
|
+
*/
|
|
12
|
+
isGroupChild: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare type PropKeys = keyof MetricOwnProps;
|
|
15
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
16
|
+
declare type MetricProps = MetricOwnProps & WithStyleProps;
|
|
17
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
18
|
+
declare const allowedProps: AllowedPropKeys;
|
|
19
|
+
export type { MetricProps };
|
|
20
|
+
export { propTypes, allowedProps };
|
|
21
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Metric/props.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,cAAc,GAAG;IACpB,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACrC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,GAAG,SAAS,CAAA;IACtD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,GAAG,SAAS,CAAA;IACtD;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,WAAW,GAAG,cAAc,GAAG,cAAc,CAAA;AAElD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAKvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAKnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/Metric/styles.d.ts
CHANGED
package/types/Metric/theme.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/Metric/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,KAAK,EAAsB,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/Metric/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAsB,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,UAAW,KAAK,KAAG,WA0B9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component, ReactElement } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { jsx } from '@instructure/emotion';
|
|
5
4
|
import { OtherHTMLAttributes } from '@instructure/shared-types';
|
|
6
|
-
import { MetricGroupProps } from './
|
|
5
|
+
import type { MetricGroupProps } from './props';
|
|
7
6
|
/**
|
|
8
7
|
---
|
|
9
8
|
category: components
|
|
@@ -12,17 +11,8 @@ category: components
|
|
|
12
11
|
**/
|
|
13
12
|
declare class MetricGroup extends Component<MetricGroupProps & OtherHTMLAttributes<MetricGroupProps>> {
|
|
14
13
|
static readonly componentId = "MetricGroup";
|
|
15
|
-
static propTypes:
|
|
16
|
-
|
|
17
|
-
styles: PropTypes.Requireable<object>;
|
|
18
|
-
/**
|
|
19
|
-
* children of type `Metric`
|
|
20
|
-
*/
|
|
21
|
-
children: {
|
|
22
|
-
(props: Record<string, any>, propName: string, componentName: string): Error | null;
|
|
23
|
-
isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
14
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<"children">;
|
|
15
|
+
static allowedProps: readonly "children"[];
|
|
26
16
|
static defaultProps: {
|
|
27
17
|
children: null;
|
|
28
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAM/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C;;;;;GAKG;AACH,cAEM,WAAY,SAAQ,SAAS,CACjC,gBAAgB,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CACzD;IACC,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,SAAS,oFAAY;IAC5B,MAAM,CAAC,YAAY,wBAAe;IAClC,MAAM,CAAC,YAAY;;MAElB;IAED,iBAAiB;IAKjB,kBAAkB;IAKlB,cAAc;IAQd,MAAM;CAYP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
4
|
+
declare type MetricGroupOwnProps = {
|
|
5
|
+
/**
|
|
6
|
+
* children of type `Metric`
|
|
7
|
+
*/
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare type PropKeys = keyof MetricGroupOwnProps;
|
|
11
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
12
|
+
declare type MetricGroupProps = MetricGroupOwnProps & WithStyleProps;
|
|
13
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
14
|
+
declare const allowedProps: AllowedPropKeys;
|
|
15
|
+
export type { MetricGroupProps };
|
|
16
|
+
export { propTypes, allowedProps };
|
|
17
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/props.ts"],"names":[],"mappings":";AA2BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,mBAAmB,CAAA;AAEzC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,gBAAgB,GAAG,mBAAmB,GAAG,cAAc,CAAA;AAE5D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAEvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAA8B,CAAA;AAElD,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme } from '@instructure/ui-themes';
|
|
1
|
+
import type { Theme } from '@instructure/ui-themes';
|
|
2
2
|
import { MetricGroupTheme } from '@instructure/shared-types';
|
|
3
3
|
/**
|
|
4
4
|
* Generates the theme object for the component from the theme and provided additional information
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,UAAW,KAAK,KAAG,gBAU9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Metric } from './Metric';
|
|
2
2
|
export { MetricGroup } from './MetricGroup';
|
|
3
|
-
export type { MetricProps } from './Metric/
|
|
4
|
-
export type { MetricGroupProps } from './MetricGroup/
|
|
3
|
+
export type { MetricProps } from './Metric/props';
|
|
4
|
+
export type { MetricGroupProps } from './MetricGroup/props';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/es/Metric/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/es/MetricGroup/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/Metric/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/lib/MetricGroup/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/types/Metric/types.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export declare type MetricProps = {
|
|
3
|
-
makeStyles?: (...args: any[]) => any;
|
|
4
|
-
styles?: any;
|
|
5
|
-
textAlign: 'start' | 'center' | 'end';
|
|
6
|
-
renderLabel?: ((props?: any) => ReactNode) | ReactNode;
|
|
7
|
-
renderValue?: ((props?: any) => ReactNode) | ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Set to true when a child of MetricGroup so the appropriate
|
|
10
|
-
* aria labels get set
|
|
11
|
-
*/
|
|
12
|
-
isGroupChild: boolean;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Metric/types.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,oBAAY,WAAW,GAAG;IACxB,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACrC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,GAAG,SAAS,CAAA;IACtD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,GAAG,SAAS,CAAA;IACtD;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/types.ts"],"names":[],"mappings":"AAwBA,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,MAAM,CAAC,EAAE,GAAG,CAAA;CACb,CAAA"}
|