@instructure/ui-badge 8.9.2-snapshot.3 → 8.10.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/package.json +15 -16
- package/src/Badge/props.ts +14 -4
- package/src/Badge/styles.ts +7 -3
- package/types/Badge/props.d.ts +5 -4
- package/types/Badge/props.d.ts.map +1 -1
- package/types/Badge/styles.d.ts +3 -3
- package/types/Badge/styles.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.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-badge
|
|
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-badge
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-badge",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0",
|
|
4
4
|
"description": "A badge 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-position": "8.
|
|
33
|
-
"@instructure/ui-react-utils": "8.
|
|
34
|
-
"@instructure/ui-testable": "8.
|
|
35
|
-
"@instructure/ui-view": "8.
|
|
36
|
-
"@instructure/uid": "8.
|
|
28
|
+
"@instructure/console": "8.10.0",
|
|
29
|
+
"@instructure/emotion": "8.10.0",
|
|
30
|
+
"@instructure/shared-types": "8.10.0",
|
|
31
|
+
"@instructure/ui-color-utils": "8.10.0",
|
|
32
|
+
"@instructure/ui-position": "8.10.0",
|
|
33
|
+
"@instructure/ui-react-utils": "8.10.0",
|
|
34
|
+
"@instructure/ui-testable": "8.10.0",
|
|
35
|
+
"@instructure/ui-view": "8.10.0",
|
|
36
|
+
"@instructure/uid": "8.10.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.10.0",
|
|
41
|
+
"@instructure/ui-test-locator": "8.10.0",
|
|
42
|
+
"@instructure/ui-test-utils": "8.10.0",
|
|
43
|
+
"@instructure/ui-themes": "8.10.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": "ddc7880d5a2f7d4d0596332e8d49cb9b1de68024"
|
|
51
|
+
"sideEffects": false
|
|
53
52
|
}
|
package/src/Badge/props.ts
CHANGED
|
@@ -27,8 +27,16 @@ import PropTypes from 'prop-types'
|
|
|
27
27
|
import { PositionPropTypes } from '@instructure/ui-position'
|
|
28
28
|
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
29
29
|
|
|
30
|
-
import type {
|
|
31
|
-
|
|
30
|
+
import type {
|
|
31
|
+
AsElementType,
|
|
32
|
+
BadgeTheme,
|
|
33
|
+
PropValidators
|
|
34
|
+
} from '@instructure/shared-types'
|
|
35
|
+
import type {
|
|
36
|
+
Spacing,
|
|
37
|
+
WithStyleProps,
|
|
38
|
+
ComponentStyle
|
|
39
|
+
} from '@instructure/emotion'
|
|
32
40
|
import type { PlacementPropValues } from '@instructure/ui-position'
|
|
33
41
|
|
|
34
42
|
type BadgeOwnProps = {
|
|
@@ -79,7 +87,9 @@ type PropKeys = keyof BadgeOwnProps
|
|
|
79
87
|
|
|
80
88
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
81
89
|
|
|
82
|
-
type BadgeProps = BadgeOwnProps & WithStyleProps
|
|
90
|
+
type BadgeProps = BadgeOwnProps & WithStyleProps<BadgeTheme, BadgeStyle>
|
|
91
|
+
|
|
92
|
+
type BadgeStyle = ComponentStyle<'badge' | 'wrapper'>
|
|
83
93
|
|
|
84
94
|
const propTypes: PropValidators<PropKeys> = {
|
|
85
95
|
count: PropTypes.number,
|
|
@@ -113,5 +123,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
113
123
|
'as'
|
|
114
124
|
]
|
|
115
125
|
|
|
116
|
-
export type { BadgeProps }
|
|
126
|
+
export type { BadgeProps, BadgeStyle }
|
|
117
127
|
export { propTypes, allowedProps }
|
package/src/Badge/styles.ts
CHANGED
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { keyframes } from '@instructure/emotion'
|
|
26
|
-
|
|
27
|
-
import {
|
|
26
|
+
|
|
27
|
+
import type { BadgeTheme } from '@instructure/shared-types'
|
|
28
|
+
import type { BadgeProps, BadgeStyle } from './props'
|
|
28
29
|
|
|
29
30
|
// keyframes have to be outside of 'generateStyle',
|
|
30
31
|
// since it is causing problems in style recalculation
|
|
@@ -44,7 +45,10 @@ const pulseAnimation = keyframes`
|
|
|
44
45
|
* @param {Object} state the state of the component, the style is applied to
|
|
45
46
|
* @return {Object} The final style object, which will be used in the component
|
|
46
47
|
*/
|
|
47
|
-
const generateStyle = (
|
|
48
|
+
const generateStyle = (
|
|
49
|
+
componentTheme: BadgeTheme,
|
|
50
|
+
props: BadgeProps
|
|
51
|
+
): BadgeStyle => {
|
|
48
52
|
const { type, variant, placement, standalone, pulse } = props
|
|
49
53
|
|
|
50
54
|
const top = placement.indexOf('top') > -1
|
package/types/Badge/props.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { AsElementType, PropValidators } from '@instructure/shared-types';
|
|
3
|
-
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
2
|
+
import type { AsElementType, BadgeTheme, PropValidators } from '@instructure/shared-types';
|
|
3
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
import type { PlacementPropValues } from '@instructure/ui-position';
|
|
5
5
|
declare type BadgeOwnProps = {
|
|
6
6
|
count?: number;
|
|
@@ -47,9 +47,10 @@ declare type BadgeOwnProps = {
|
|
|
47
47
|
};
|
|
48
48
|
declare type PropKeys = keyof BadgeOwnProps;
|
|
49
49
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
50
|
-
declare type BadgeProps = BadgeOwnProps & WithStyleProps
|
|
50
|
+
declare type BadgeProps = BadgeOwnProps & WithStyleProps<BadgeTheme, BadgeStyle>;
|
|
51
|
+
declare type BadgeStyle = ComponentStyle<'badge' | 'wrapper'>;
|
|
51
52
|
declare const propTypes: PropValidators<PropKeys>;
|
|
52
53
|
declare const allowedProps: AllowedPropKeys;
|
|
53
|
-
export type { BadgeProps };
|
|
54
|
+
export type { BadgeProps, BadgeStyle };
|
|
54
55
|
export { propTypes, allowedProps };
|
|
55
56
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Badge/props.ts"],"names":[],"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AC,CAAA;AAEhD,aAAK,UAAU,GAAG,aAAa,GAAG,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAExE,aAAK,UAAU,GAAG,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;AAErD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAcvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAcnB,CAAA;AAED,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/Badge/styles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BadgeTheme } from '@instructure/shared-types';
|
|
2
|
-
import { BadgeProps } from './props';
|
|
1
|
+
import type { BadgeTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { BadgeProps, BadgeStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,6 +10,6 @@ import { BadgeProps } from './props';
|
|
|
10
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
|
12
12
|
*/
|
|
13
|
-
declare const generateStyle: (componentTheme: BadgeTheme, props: BadgeProps) =>
|
|
13
|
+
declare const generateStyle: (componentTheme: BadgeTheme, props: BadgeProps) => BadgeStyle;
|
|
14
14
|
export default generateStyle;
|
|
15
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Badge/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Badge/styles.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAUrD;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,UAAU,SACnB,UAAU,KAChB,UAkJF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
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.
|