@instructure/ui-metric 8.9.2-snapshot.4 → 8.10.1-snapshot.4

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 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.10.0](https://github.com/instructure/instructure-ui/compare/v8.9.1...v8.10.0) (2021-09-28)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-metric
9
+
6
10
  ## [8.9.1](https://github.com/instructure/instructure-ui/compare/v8.9.0...v8.9.1) (2021-09-16)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-metric
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-metric",
3
- "version": "8.9.2-snapshot.4+bf1e82efc",
3
+ "version": "8.10.1-snapshot.4+6c5c9e653",
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.9.2-snapshot.4+bf1e82efc",
29
- "@instructure/emotion": "8.9.2-snapshot.4+bf1e82efc",
30
- "@instructure/shared-types": "8.9.2-snapshot.4+bf1e82efc",
31
- "@instructure/ui-prop-types": "8.9.2-snapshot.4+bf1e82efc",
32
- "@instructure/ui-react-utils": "8.9.2-snapshot.4+bf1e82efc",
33
- "@instructure/ui-testable": "8.9.2-snapshot.4+bf1e82efc",
28
+ "@instructure/console": "8.10.1-snapshot.4+6c5c9e653",
29
+ "@instructure/emotion": "8.10.1-snapshot.4+6c5c9e653",
30
+ "@instructure/shared-types": "8.10.1-snapshot.4+6c5c9e653",
31
+ "@instructure/ui-prop-types": "8.10.1-snapshot.4+6c5c9e653",
32
+ "@instructure/ui-react-utils": "8.10.1-snapshot.4+6c5c9e653",
33
+ "@instructure/ui-testable": "8.10.1-snapshot.4+6c5c9e653",
34
34
  "prop-types": "^15"
35
35
  },
36
36
  "devDependencies": {
37
- "@instructure/ui-babel-preset": "8.9.2-snapshot.4+bf1e82efc",
38
- "@instructure/ui-color-utils": "8.9.2-snapshot.4+bf1e82efc",
39
- "@instructure/ui-test-locator": "8.9.2-snapshot.4+bf1e82efc",
40
- "@instructure/ui-test-utils": "8.9.2-snapshot.4+bf1e82efc",
41
- "@instructure/ui-themes": "8.9.2-snapshot.4+bf1e82efc"
37
+ "@instructure/ui-babel-preset": "8.10.1-snapshot.4+6c5c9e653",
38
+ "@instructure/ui-color-utils": "8.10.1-snapshot.4+6c5c9e653",
39
+ "@instructure/ui-test-locator": "8.10.1-snapshot.4+6c5c9e653",
40
+ "@instructure/ui-test-utils": "8.10.1-snapshot.4+6c5c9e653",
41
+ "@instructure/ui-themes": "8.10.1-snapshot.4+6c5c9e653"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.8 <=17"
@@ -47,5 +47,5 @@
47
47
  "access": "public"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "bf1e82efccb682510708448efd369eddaa24f74b"
50
+ "gitHead": "6c5c9e653f7ce3d239296f4ed19c5679fdddcd5b"
51
51
  }
@@ -25,8 +25,8 @@
25
25
  import { ReactNode } from 'react'
26
26
  import PropTypes from 'prop-types'
27
27
 
28
- import type { PropValidators } from '@instructure/shared-types'
29
- import type { WithStyleProps } from '@instructure/emotion'
28
+ import type { PropValidators, MetricTheme } from '@instructure/shared-types'
29
+ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
30
30
 
31
31
  type MetricOwnProps = {
32
32
  textAlign: 'start' | 'center' | 'end'
@@ -43,7 +43,9 @@ type PropKeys = keyof MetricOwnProps
43
43
 
44
44
  type AllowedPropKeys = Readonly<Array<PropKeys>>
45
45
 
46
- type MetricProps = MetricOwnProps & WithStyleProps
46
+ type MetricProps = MetricOwnProps & WithStyleProps<MetricTheme, MetricStyle>
47
+
48
+ type MetricStyle = ComponentStyle<'metric' | 'label' | 'value'>
47
49
 
48
50
  const propTypes: PropValidators<PropKeys> = {
49
51
  textAlign: PropTypes.oneOf(['start', 'center', 'end']),
@@ -59,5 +61,5 @@ const allowedProps: AllowedPropKeys = [
59
61
  'isGroupChild'
60
62
  ]
61
63
 
62
- export type { MetricProps }
64
+ export type { MetricProps, MetricStyle }
63
65
  export { propTypes, allowedProps }
@@ -22,8 +22,8 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { MetricTheme } from '@instructure/shared-types'
26
- import { MetricProps } from './props'
25
+ import type { MetricTheme } from '@instructure/shared-types'
26
+ import type { MetricProps, MetricStyle } from './props'
27
27
 
28
28
  /**
29
29
  * ---
@@ -34,7 +34,10 @@ import { MetricProps } from './props'
34
34
  * @param {Object} props the props of the component, the style is applied to
35
35
  * @return {Object} The final style object, which will be used in the component
36
36
  */
37
- const generateStyle = (componentTheme: MetricTheme, props: MetricProps) => {
37
+ const generateStyle = (
38
+ componentTheme: MetricTheme,
39
+ props: MetricProps
40
+ ): MetricStyle => {
38
41
  const { textAlign } = props
39
42
 
40
43
  return {
@@ -25,8 +25,11 @@
25
25
  import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
26
26
  import { Metric } from '../Metric'
27
27
 
28
- import type { PropValidators } from '@instructure/shared-types'
29
- import type { WithStyleProps } from '@instructure/emotion'
28
+ import type {
29
+ PropValidators,
30
+ MetricGroupTheme
31
+ } from '@instructure/shared-types'
32
+ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
30
33
 
31
34
  type MetricGroupOwnProps = {
32
35
  /**
@@ -39,7 +42,10 @@ type PropKeys = keyof MetricGroupOwnProps
39
42
 
40
43
  type AllowedPropKeys = Readonly<Array<PropKeys>>
41
44
 
42
- type MetricGroupProps = MetricGroupOwnProps & WithStyleProps
45
+ type MetricGroupProps = MetricGroupOwnProps &
46
+ WithStyleProps<MetricGroupTheme, MetricGrouStyle>
47
+
48
+ type MetricGrouStyle = ComponentStyle<'metricGroup'>
43
49
 
44
50
  const propTypes: PropValidators<PropKeys> = {
45
51
  children: ChildrenPropTypes.oneOf([Metric])
@@ -47,5 +53,5 @@ const propTypes: PropValidators<PropKeys> = {
47
53
 
48
54
  const allowedProps: AllowedPropKeys = ['children']
49
55
 
50
- export type { MetricGroupProps }
56
+ export type { MetricGroupProps, MetricGrouStyle }
51
57
  export { propTypes, allowedProps }
@@ -22,7 +22,8 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { MetricGroupTheme } from '@instructure/shared-types'
25
+ import type { MetricGroupTheme } from '@instructure/shared-types'
26
+ import type { MetricGrouStyle } from './props'
26
27
 
27
28
  /**
28
29
  * ---
@@ -32,7 +33,7 @@ import { MetricGroupTheme } from '@instructure/shared-types'
32
33
  * @param {Object} componentTheme The theme variable object.
33
34
  * @return {Object} The final style object, which will be used in the component
34
35
  */
35
- const generateStyle = (componentTheme: MetricGroupTheme) => {
36
+ const generateStyle = (componentTheme: MetricGroupTheme): MetricGrouStyle => {
36
37
  return {
37
38
  metricGroup: {
38
39
  label: 'metricGroup',
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import type { PropValidators } from '@instructure/shared-types';
3
- import type { WithStyleProps } from '@instructure/emotion';
2
+ import type { PropValidators, MetricTheme } from '@instructure/shared-types';
3
+ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  declare type MetricOwnProps = {
5
5
  textAlign: 'start' | 'center' | 'end';
6
6
  renderLabel?: ((props?: any) => ReactNode) | ReactNode;
@@ -13,9 +13,10 @@ declare type MetricOwnProps = {
13
13
  };
14
14
  declare type PropKeys = keyof MetricOwnProps;
15
15
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
16
- declare type MetricProps = MetricOwnProps & WithStyleProps;
16
+ declare type MetricProps = MetricOwnProps & WithStyleProps<MetricTheme, MetricStyle>;
17
+ declare type MetricStyle = ComponentStyle<'metric' | 'label' | 'value'>;
17
18
  declare const propTypes: PropValidators<PropKeys>;
18
19
  declare const allowedProps: AllowedPropKeys;
19
- export type { MetricProps };
20
+ export type { MetricProps, MetricStyle };
20
21
  export { propTypes, allowedProps };
21
22
  //# sourceMappingURL=props.d.ts.map
@@ -1 +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"}
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,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,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,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;AAE5E,aAAK,WAAW,GAAG,cAAc,CAAC,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,CAAA;AAE/D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAKvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAKnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
- import { MetricTheme } from '@instructure/shared-types';
2
- import { MetricProps } from './props';
1
+ import type { MetricTheme } from '@instructure/shared-types';
2
+ import type { MetricProps, MetricStyle } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
@@ -9,27 +9,6 @@ import { MetricProps } from './props';
9
9
  * @param {Object} props the props of the component, the style is applied to
10
10
  * @return {Object} The final style object, which will be used in the component
11
11
  */
12
- declare const generateStyle: (componentTheme: MetricTheme, props: MetricProps) => {
13
- metric: {
14
- label: string;
15
- display: string;
16
- flexDirection: string;
17
- boxSizing: string;
18
- padding: string | 0;
19
- fontFamily: string;
20
- textAlign: "start" | "center" | "end";
21
- };
22
- label: {
23
- label: string;
24
- fontSize: string | 0;
25
- color: string;
26
- };
27
- value: {
28
- label: string;
29
- fontWeight: number;
30
- fontSize: string | 0;
31
- color: string;
32
- };
33
- };
12
+ declare const generateStyle: (componentTheme: MetricTheme, props: MetricProps) => MetricStyle;
34
13
  export default generateStyle;
35
14
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Metric/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,mBAAoB,WAAW,SAAS,WAAW;;;;;;;;;;;;;;;;;;;;;CAyBrE,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Metric/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEvD;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,mBACD,WAAW,SACpB,WAAW,KACjB,WAyBF,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { PropValidators } from '@instructure/shared-types';
3
- import type { WithStyleProps } from '@instructure/emotion';
2
+ import type { PropValidators, MetricGroupTheme } from '@instructure/shared-types';
3
+ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  declare type MetricGroupOwnProps = {
5
5
  /**
6
6
  * children of type `Metric`
@@ -9,9 +9,10 @@ declare type MetricGroupOwnProps = {
9
9
  };
10
10
  declare type PropKeys = keyof MetricGroupOwnProps;
11
11
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
12
- declare type MetricGroupProps = MetricGroupOwnProps & WithStyleProps;
12
+ declare type MetricGroupProps = MetricGroupOwnProps & WithStyleProps<MetricGroupTheme, MetricGrouStyle>;
13
+ declare type MetricGrouStyle = ComponentStyle<'metricGroup'>;
13
14
  declare const propTypes: PropValidators<PropKeys>;
14
15
  declare const allowedProps: AllowedPropKeys;
15
- export type { MetricGroupProps };
16
+ export type { MetricGroupProps, MetricGrouStyle };
16
17
  export { propTypes, allowedProps };
17
18
  //# sourceMappingURL=props.d.ts.map
@@ -1 +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
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/props.ts"],"names":[],"mappings":";AA2BA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,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,GACzC,cAAc,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAA;AAEnD,aAAK,eAAe,GAAG,cAAc,CAAC,aAAa,CAAC,CAAA;AAEpD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAEvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAA8B,CAAA;AAElD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,4 +1,5 @@
1
- import { MetricGroupTheme } from '@instructure/shared-types';
1
+ import type { MetricGroupTheme } from '@instructure/shared-types';
2
+ import type { MetricGrouStyle } from './props';
2
3
  /**
3
4
  * ---
4
5
  * private: true
@@ -7,16 +8,6 @@ import { MetricGroupTheme } from '@instructure/shared-types';
7
8
  * @param {Object} componentTheme The theme variable object.
8
9
  * @return {Object} The final style object, which will be used in the component
9
10
  */
10
- declare const generateStyle: (componentTheme: MetricGroupTheme) => {
11
- metricGroup: {
12
- label: string;
13
- boxSizing: string;
14
- display: string;
15
- flexWrap: string;
16
- alignItems: string;
17
- justifyContent: string;
18
- lineHeight: string | number;
19
- };
20
- };
11
+ declare const generateStyle: (componentTheme: MetricGroupTheme) => MetricGrouStyle;
21
12
  export default generateStyle;
22
13
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,mBAAoB,gBAAgB;;;;;;;;;;CAYtD,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/MetricGroup/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,mBAAoB,gBAAgB,KAAG,eAYzD,CAAA;AAED,eAAe,aAAa,CAAA"}