@instructure/ui-pill 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 +17 -18
- package/src/Pill/props.ts +14 -4
- package/src/Pill/styles.ts +6 -3
- package/types/Pill/props.d.ts +5 -4
- package/types/Pill/props.d.ts.map +1 -1
- package/types/Pill/styles.d.ts +3 -92
- package/types/Pill/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-pill
|
|
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-pill
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pill",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0",
|
|
4
4
|
"description": "A UI component to communicate concise status.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,24 +25,24 @@
|
|
|
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-react-utils": "8.
|
|
32
|
-
"@instructure/ui-testable": "8.
|
|
33
|
-
"@instructure/ui-tooltip": "8.
|
|
34
|
-
"@instructure/ui-truncate-text": "8.
|
|
35
|
-
"@instructure/ui-utils": "8.
|
|
36
|
-
"@instructure/ui-view": "8.
|
|
28
|
+
"@instructure/console": "8.10.0",
|
|
29
|
+
"@instructure/emotion": "8.10.0",
|
|
30
|
+
"@instructure/shared-types": "8.10.0",
|
|
31
|
+
"@instructure/ui-react-utils": "8.10.0",
|
|
32
|
+
"@instructure/ui-testable": "8.10.0",
|
|
33
|
+
"@instructure/ui-tooltip": "8.10.0",
|
|
34
|
+
"@instructure/ui-truncate-text": "8.10.0",
|
|
35
|
+
"@instructure/ui-utils": "8.10.0",
|
|
36
|
+
"@instructure/ui-view": "8.10.0",
|
|
37
37
|
"prop-types": "^15"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@instructure/ui-babel-preset": "8.
|
|
41
|
-
"@instructure/ui-color-utils": "8.
|
|
42
|
-
"@instructure/ui-test-locator": "8.
|
|
43
|
-
"@instructure/ui-test-queries": "8.
|
|
44
|
-
"@instructure/ui-test-utils": "8.
|
|
45
|
-
"@instructure/ui-themes": "8.
|
|
40
|
+
"@instructure/ui-babel-preset": "8.10.0",
|
|
41
|
+
"@instructure/ui-color-utils": "8.10.0",
|
|
42
|
+
"@instructure/ui-test-locator": "8.10.0",
|
|
43
|
+
"@instructure/ui-test-queries": "8.10.0",
|
|
44
|
+
"@instructure/ui-test-utils": "8.10.0",
|
|
45
|
+
"@instructure/ui-themes": "8.10.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=17"
|
|
@@ -50,6 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"sideEffects": false
|
|
54
|
-
"gitHead": "ddc7880d5a2f7d4d0596332e8d49cb9b1de68024"
|
|
53
|
+
"sideEffects": false
|
|
55
54
|
}
|
package/src/Pill/props.ts
CHANGED
|
@@ -26,8 +26,16 @@ import PropTypes from 'prop-types'
|
|
|
26
26
|
|
|
27
27
|
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
28
28
|
|
|
29
|
-
import type {
|
|
30
|
-
|
|
29
|
+
import type {
|
|
30
|
+
Spacing,
|
|
31
|
+
WithStyleProps,
|
|
32
|
+
ComponentStyle
|
|
33
|
+
} from '@instructure/emotion'
|
|
34
|
+
import type {
|
|
35
|
+
PropValidators,
|
|
36
|
+
AsElementType,
|
|
37
|
+
PillTheme
|
|
38
|
+
} from '@instructure/shared-types'
|
|
31
39
|
|
|
32
40
|
type PillOwnProps = {
|
|
33
41
|
as?: AsElementType
|
|
@@ -40,7 +48,9 @@ type PropKeys = keyof PillOwnProps
|
|
|
40
48
|
|
|
41
49
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
42
50
|
|
|
43
|
-
type PillProps = PillOwnProps & WithStyleProps
|
|
51
|
+
type PillProps = PillOwnProps & WithStyleProps<PillTheme, PillStyle>
|
|
52
|
+
|
|
53
|
+
type PillStyle = ComponentStyle<'pill' | 'text' | 'maxWidth'>
|
|
44
54
|
|
|
45
55
|
const propTypes: PropValidators<PropKeys> = {
|
|
46
56
|
as: PropTypes.elementType, // eslint-disable-line react/require-default-props
|
|
@@ -70,5 +80,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
70
80
|
'margin'
|
|
71
81
|
]
|
|
72
82
|
|
|
73
|
-
export type { PillProps }
|
|
83
|
+
export type { PillProps, PillStyle }
|
|
74
84
|
export { propTypes, allowedProps }
|
package/src/Pill/styles.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { PillTheme } from '@instructure/shared-types'
|
|
26
|
-
import { PillProps } from './props'
|
|
25
|
+
import type { PillTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { PillProps, PillStyle } from './props'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* ---
|
|
@@ -35,7 +35,10 @@ import { PillProps } from './props'
|
|
|
35
35
|
* @param {Object} state the state of the component, the style is applied to
|
|
36
36
|
* @return {Object} The final style object, which will be used in the component
|
|
37
37
|
*/
|
|
38
|
-
const generateStyle = (
|
|
38
|
+
const generateStyle = (
|
|
39
|
+
componentTheme: PillTheme,
|
|
40
|
+
props: PillProps
|
|
41
|
+
): PillStyle => {
|
|
39
42
|
const { color } = props
|
|
40
43
|
|
|
41
44
|
const pillColorVariants = {
|
package/types/Pill/props.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
3
|
-
import type { PropValidators, AsElementType } from '@instructure/shared-types';
|
|
2
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
|
+
import type { PropValidators, AsElementType, PillTheme } from '@instructure/shared-types';
|
|
4
4
|
declare type PillOwnProps = {
|
|
5
5
|
as?: AsElementType;
|
|
6
6
|
color?: 'primary' | 'success' | 'danger' | 'info' | 'warning' | 'alert';
|
|
@@ -10,9 +10,10 @@ declare type PillOwnProps = {
|
|
|
10
10
|
};
|
|
11
11
|
declare type PropKeys = keyof PillOwnProps;
|
|
12
12
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
13
|
-
declare type PillProps = PillOwnProps & WithStyleProps
|
|
13
|
+
declare type PillProps = PillOwnProps & WithStyleProps<PillTheme, PillStyle>;
|
|
14
|
+
declare type PillStyle = ComponentStyle<'pill' | 'text' | 'maxWidth'>;
|
|
14
15
|
declare const propTypes: PropValidators<PropKeys>;
|
|
15
16
|
declare const allowedProps: AllowedPropKeys;
|
|
16
|
-
export type { PillProps };
|
|
17
|
+
export type { PillProps, PillStyle };
|
|
17
18
|
export { propTypes, allowedProps };
|
|
18
19
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Pill/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Pill/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,SAAS,EACV,MAAM,2BAA2B,CAAA;AAElC,aAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACvE,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AACD,aAAK,QAAQ,GAAG,MAAM,YAAY,CAAA;AAElC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,SAAS,GAAG,YAAY,GAAG,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAEpE,aAAK,SAAS,GAAG,cAAc,CAAC,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,CAAA;AAE7D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAkBvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAMnB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/Pill/styles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PillTheme } from '@instructure/shared-types';
|
|
2
|
-
import { PillProps } from './props';
|
|
1
|
+
import type { PillTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { PillProps, PillStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,95 +10,6 @@ import { PillProps } 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: PillTheme, props: PillProps) =>
|
|
14
|
-
pill: {
|
|
15
|
-
color: string;
|
|
16
|
-
borderColor: string;
|
|
17
|
-
label: string;
|
|
18
|
-
display: string;
|
|
19
|
-
fontFamily: string;
|
|
20
|
-
boxSizing: string;
|
|
21
|
-
padding: string | 0;
|
|
22
|
-
background: string;
|
|
23
|
-
borderWidth: string | 0;
|
|
24
|
-
borderStyle: string;
|
|
25
|
-
borderRadius: string | 0;
|
|
26
|
-
lineHeight: string;
|
|
27
|
-
} | {
|
|
28
|
-
color: string;
|
|
29
|
-
borderColor: string;
|
|
30
|
-
label: string;
|
|
31
|
-
display: string;
|
|
32
|
-
fontFamily: string;
|
|
33
|
-
boxSizing: string;
|
|
34
|
-
padding: string | 0;
|
|
35
|
-
background: string;
|
|
36
|
-
borderWidth: string | 0;
|
|
37
|
-
borderStyle: string;
|
|
38
|
-
borderRadius: string | 0;
|
|
39
|
-
lineHeight: string;
|
|
40
|
-
} | {
|
|
41
|
-
color: string;
|
|
42
|
-
borderColor: string;
|
|
43
|
-
label: string;
|
|
44
|
-
display: string;
|
|
45
|
-
fontFamily: string;
|
|
46
|
-
boxSizing: string;
|
|
47
|
-
padding: string | 0;
|
|
48
|
-
background: string;
|
|
49
|
-
borderWidth: string | 0;
|
|
50
|
-
borderStyle: string;
|
|
51
|
-
borderRadius: string | 0;
|
|
52
|
-
lineHeight: string;
|
|
53
|
-
} | {
|
|
54
|
-
color: string;
|
|
55
|
-
borderColor: string;
|
|
56
|
-
label: string;
|
|
57
|
-
display: string;
|
|
58
|
-
fontFamily: string;
|
|
59
|
-
boxSizing: string;
|
|
60
|
-
padding: string | 0;
|
|
61
|
-
background: string;
|
|
62
|
-
borderWidth: string | 0;
|
|
63
|
-
borderStyle: string;
|
|
64
|
-
borderRadius: string | 0;
|
|
65
|
-
lineHeight: string;
|
|
66
|
-
} | {
|
|
67
|
-
color: string;
|
|
68
|
-
borderColor: string;
|
|
69
|
-
label: string;
|
|
70
|
-
display: string;
|
|
71
|
-
fontFamily: string;
|
|
72
|
-
boxSizing: string;
|
|
73
|
-
padding: string | 0;
|
|
74
|
-
background: string;
|
|
75
|
-
borderWidth: string | 0;
|
|
76
|
-
borderStyle: string;
|
|
77
|
-
borderRadius: string | 0;
|
|
78
|
-
lineHeight: string;
|
|
79
|
-
} | {
|
|
80
|
-
color: string;
|
|
81
|
-
borderColor: string;
|
|
82
|
-
label: string;
|
|
83
|
-
display: string;
|
|
84
|
-
fontFamily: string;
|
|
85
|
-
boxSizing: string;
|
|
86
|
-
padding: string | 0;
|
|
87
|
-
background: string;
|
|
88
|
-
borderWidth: string | 0;
|
|
89
|
-
borderStyle: string;
|
|
90
|
-
borderRadius: string | 0;
|
|
91
|
-
lineHeight: string;
|
|
92
|
-
};
|
|
93
|
-
text: {
|
|
94
|
-
label: string;
|
|
95
|
-
boxSizing: string;
|
|
96
|
-
textTransform: string;
|
|
97
|
-
fontSize: string | 0;
|
|
98
|
-
fontWeight: number;
|
|
99
|
-
letterSpacing: string;
|
|
100
|
-
};
|
|
101
|
-
maxWidth: string | 0;
|
|
102
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: PillTheme, props: PillProps) => PillStyle;
|
|
103
14
|
export default generateStyle;
|
|
104
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Pill/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Pill/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,SAAS,SAClB,SAAS,KACf,SAuDF,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.
|