@instructure/ui-pill 8.9.2-snapshot.7 → 8.10.1-snapshot.8
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/Pill/__examples__/Pill.examples.js +1 -1
- package/es/Pill/index.js +2 -1
- package/es/Pill/props.js +0 -6
- package/lib/Pill/__examples__/Pill.examples.js +1 -1
- package/lib/Pill/index.js +3 -2
- package/lib/Pill/props.js +0 -6
- package/package.json +17 -17
- package/src/Pill/__examples__/Pill.examples.ts +1 -2
- package/src/Pill/index.tsx +13 -13
- package/src/Pill/props.ts +27 -10
- package/src/Pill/styles.ts +6 -3
- package/types/Pill/__examples__/Pill.examples.d.ts +1 -1
- package/types/Pill/__examples__/Pill.examples.d.ts.map +1 -1
- package/types/Pill/index.d.ts +9 -7
- package/types/Pill/index.d.ts.map +1 -1
- package/types/Pill/props.d.ts +17 -5
- 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/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/es/Pill/index.js
CHANGED
|
@@ -30,10 +30,10 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
30
30
|
/** @jsx jsx */
|
|
31
31
|
import { Component } from 'react';
|
|
32
32
|
import { View } from '@instructure/ui-view';
|
|
33
|
-
import { Tooltip } from '@instructure/ui-tooltip';
|
|
34
33
|
import { TruncateText } from '@instructure/ui-truncate-text';
|
|
35
34
|
import { passthroughProps } from '@instructure/ui-react-utils';
|
|
36
35
|
import { testable } from '@instructure/ui-testable';
|
|
36
|
+
import { Tooltip } from '@instructure/ui-tooltip';
|
|
37
37
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
38
38
|
import generateStyle from './styles';
|
|
39
39
|
import generateComponentTheme from './theme';
|
|
@@ -42,6 +42,7 @@ import { allowedProps, propTypes } from './props';
|
|
|
42
42
|
---
|
|
43
43
|
category: components
|
|
44
44
|
---
|
|
45
|
+
@tsProps
|
|
45
46
|
**/
|
|
46
47
|
|
|
47
48
|
let Pill = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class Pill extends Component {
|
package/es/Pill/props.js
CHANGED
|
@@ -29,12 +29,6 @@ const propTypes = {
|
|
|
29
29
|
children: PropTypes.node.isRequired,
|
|
30
30
|
color: PropTypes.oneOf(['primary', 'success', 'danger', 'info', 'warning', 'alert']),
|
|
31
31
|
elementRef: PropTypes.func,
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
35
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
36
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
37
|
-
*/
|
|
38
32
|
margin: ThemeablePropTypes.spacing
|
|
39
33
|
};
|
|
40
34
|
const allowedProps = ['as', 'children', 'color', 'elementRef', 'margin'];
|
package/lib/Pill/index.js
CHANGED
|
@@ -13,14 +13,14 @@ var _react = require("react");
|
|
|
13
13
|
|
|
14
14
|
var _View = require("@instructure/ui-view/lib/View");
|
|
15
15
|
|
|
16
|
-
var _Tooltip = require("@instructure/ui-tooltip/lib/Tooltip");
|
|
17
|
-
|
|
18
16
|
var _TruncateText = require("@instructure/ui-truncate-text/lib/TruncateText");
|
|
19
17
|
|
|
20
18
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
21
19
|
|
|
22
20
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
23
21
|
|
|
22
|
+
var _Tooltip = require("@instructure/ui-tooltip/lib/Tooltip");
|
|
23
|
+
|
|
24
24
|
var _emotion = require("@instructure/emotion");
|
|
25
25
|
|
|
26
26
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
@@ -37,6 +37,7 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
37
37
|
---
|
|
38
38
|
category: components
|
|
39
39
|
---
|
|
40
|
+
@tsProps
|
|
40
41
|
**/
|
|
41
42
|
let Pill = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class Pill extends _react.Component {
|
|
42
43
|
constructor(props) {
|
package/lib/Pill/props.js
CHANGED
|
@@ -40,12 +40,6 @@ const propTypes = {
|
|
|
40
40
|
children: _propTypes.default.node.isRequired,
|
|
41
41
|
color: _propTypes.default.oneOf(['primary', 'success', 'danger', 'info', 'warning', 'alert']),
|
|
42
42
|
elementRef: _propTypes.default.func,
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
46
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
47
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
48
|
-
*/
|
|
49
43
|
margin: _emotion.ThemeablePropTypes.spacing
|
|
50
44
|
};
|
|
51
45
|
exports.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pill",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.1-snapshot.8+21f46f4e3",
|
|
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.1-snapshot.8+21f46f4e3",
|
|
29
|
+
"@instructure/emotion": "8.10.1-snapshot.8+21f46f4e3",
|
|
30
|
+
"@instructure/shared-types": "8.10.1-snapshot.8+21f46f4e3",
|
|
31
|
+
"@instructure/ui-react-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
32
|
+
"@instructure/ui-testable": "8.10.1-snapshot.8+21f46f4e3",
|
|
33
|
+
"@instructure/ui-tooltip": "8.10.1-snapshot.8+21f46f4e3",
|
|
34
|
+
"@instructure/ui-truncate-text": "8.10.1-snapshot.8+21f46f4e3",
|
|
35
|
+
"@instructure/ui-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
36
|
+
"@instructure/ui-view": "8.10.1-snapshot.8+21f46f4e3",
|
|
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.1-snapshot.8+21f46f4e3",
|
|
41
|
+
"@instructure/ui-color-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
42
|
+
"@instructure/ui-test-locator": "8.10.1-snapshot.8+21f46f4e3",
|
|
43
|
+
"@instructure/ui-test-queries": "8.10.1-snapshot.8+21f46f4e3",
|
|
44
|
+
"@instructure/ui-test-utils": "8.10.1-snapshot.8+21f46f4e3",
|
|
45
|
+
"@instructure/ui-themes": "8.10.1-snapshot.8+21f46f4e3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=17"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"sideEffects": false,
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "21f46f4e342898b019ab943a7e69a455621d9576"
|
|
55
55
|
}
|
|
@@ -27,8 +27,7 @@ export default {
|
|
|
27
27
|
propValues: {
|
|
28
28
|
children: ['Some really long text that will truncate', 'Missing']
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
getParameters: (page) => {
|
|
30
|
+
getParameters: () => {
|
|
32
31
|
return { disable: true }
|
|
33
32
|
}
|
|
34
33
|
}
|
package/src/Pill/index.tsx
CHANGED
|
@@ -26,26 +26,29 @@
|
|
|
26
26
|
import { Component } from 'react'
|
|
27
27
|
|
|
28
28
|
import { View } from '@instructure/ui-view'
|
|
29
|
-
import { Tooltip } from '@instructure/ui-tooltip'
|
|
30
29
|
import { TruncateText } from '@instructure/ui-truncate-text'
|
|
31
30
|
import { passthroughProps } from '@instructure/ui-react-utils'
|
|
32
31
|
import { testable } from '@instructure/ui-testable'
|
|
32
|
+
import { Tooltip } from '@instructure/ui-tooltip'
|
|
33
|
+
import type { TooltipRenderChildrenArgs } from '@instructure/ui-tooltip'
|
|
33
34
|
|
|
34
35
|
import { withStyle, jsx } from '@instructure/emotion'
|
|
35
36
|
|
|
36
37
|
import generateStyle from './styles'
|
|
37
38
|
import generateComponentTheme from './theme'
|
|
38
|
-
|
|
39
|
+
|
|
40
|
+
import type { PillProps, PillState } from './props'
|
|
39
41
|
import { allowedProps, propTypes } from './props'
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
---
|
|
43
45
|
category: components
|
|
44
46
|
---
|
|
47
|
+
@tsProps
|
|
45
48
|
**/
|
|
46
49
|
@withStyle(generateStyle, generateComponentTheme)
|
|
47
50
|
@testable()
|
|
48
|
-
class Pill extends Component<PillProps> {
|
|
51
|
+
class Pill extends Component<PillProps, PillState> {
|
|
49
52
|
static readonly componentId = 'Pill'
|
|
50
53
|
|
|
51
54
|
static allowedProps = allowedProps
|
|
@@ -55,8 +58,7 @@ class Pill extends Component<PillProps> {
|
|
|
55
58
|
color: 'primary'
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
|
|
59
|
-
constructor(props) {
|
|
61
|
+
constructor(props: PillProps) {
|
|
60
62
|
super(props)
|
|
61
63
|
|
|
62
64
|
this.state = {
|
|
@@ -72,9 +74,7 @@ class Pill extends Component<PillProps> {
|
|
|
72
74
|
this.props.makeStyles?.()
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
handleTruncation(truncated) {
|
|
77
|
-
// @ts-expect-error ts-migrate(2339) FIXME: Property 'truncated' does not exist on type 'Reado... Remove this comment to see the full error message
|
|
77
|
+
handleTruncation(truncated: boolean) {
|
|
78
78
|
if (truncated !== this.state.truncated) {
|
|
79
79
|
this.setState({
|
|
80
80
|
truncated: truncated
|
|
@@ -82,8 +82,10 @@ class Pill extends Component<PillProps> {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
renderPill(
|
|
86
|
+
focused?: TooltipRenderChildrenArgs['focused'],
|
|
87
|
+
getTriggerProps?: TooltipRenderChildrenArgs['getTriggerProps']
|
|
88
|
+
) {
|
|
87
89
|
const {
|
|
88
90
|
margin,
|
|
89
91
|
children,
|
|
@@ -109,7 +111,7 @@ class Pill extends Component<PillProps> {
|
|
|
109
111
|
elementRef={elementRef}
|
|
110
112
|
margin={margin}
|
|
111
113
|
padding="0"
|
|
112
|
-
maxWidth={styles?.maxWidth}
|
|
114
|
+
maxWidth={styles?.maxWidth as string}
|
|
113
115
|
background="transparent"
|
|
114
116
|
borderRadius="pill"
|
|
115
117
|
borderWidth="0"
|
|
@@ -134,7 +136,6 @@ class Pill extends Component<PillProps> {
|
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
render() {
|
|
137
|
-
// @ts-expect-error ts-migrate(2339) FIXME: Property 'truncated' does not exist on type 'Reado... Remove this comment to see the full error message
|
|
138
139
|
if (this.state.truncated) {
|
|
139
140
|
return (
|
|
140
141
|
<Tooltip renderTip={this.props.children}>
|
|
@@ -144,7 +145,6 @@ class Pill extends Component<PillProps> {
|
|
|
144
145
|
</Tooltip>
|
|
145
146
|
)
|
|
146
147
|
} else {
|
|
147
|
-
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 0.
|
|
148
148
|
return this.renderPill()
|
|
149
149
|
}
|
|
150
150
|
}
|
package/src/Pill/props.ts
CHANGED
|
@@ -26,13 +26,29 @@ 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
|
|
34
42
|
color?: 'primary' | 'success' | 'danger' | 'info' | 'warning' | 'alert'
|
|
35
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Provides a reference to the underlying HTML element
|
|
45
|
+
*/
|
|
46
|
+
elementRef?: (element: HTMLElement | null) => void
|
|
47
|
+
/**
|
|
48
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
49
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
50
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
51
|
+
*/
|
|
36
52
|
margin?: Spacing
|
|
37
53
|
children: React.ReactNode
|
|
38
54
|
}
|
|
@@ -40,7 +56,9 @@ type PropKeys = keyof PillOwnProps
|
|
|
40
56
|
|
|
41
57
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
42
58
|
|
|
43
|
-
type PillProps = PillOwnProps & WithStyleProps
|
|
59
|
+
type PillProps = PillOwnProps & WithStyleProps<PillTheme, PillStyle>
|
|
60
|
+
|
|
61
|
+
type PillStyle = ComponentStyle<'pill' | 'text' | 'maxWidth'>
|
|
44
62
|
|
|
45
63
|
const propTypes: PropValidators<PropKeys> = {
|
|
46
64
|
as: PropTypes.elementType, // eslint-disable-line react/require-default-props
|
|
@@ -54,11 +72,6 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
54
72
|
'alert'
|
|
55
73
|
]),
|
|
56
74
|
elementRef: PropTypes.func,
|
|
57
|
-
/**
|
|
58
|
-
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
59
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
60
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
61
|
-
*/
|
|
62
75
|
margin: ThemeablePropTypes.spacing
|
|
63
76
|
}
|
|
64
77
|
|
|
@@ -70,5 +83,9 @@ const allowedProps: AllowedPropKeys = [
|
|
|
70
83
|
'margin'
|
|
71
84
|
]
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
type PillState = {
|
|
87
|
+
truncated: boolean
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type { PillProps, PillStyle, PillState }
|
|
74
91
|
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 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pill.examples.d.ts","sourceRoot":"","sources":["../../../src/Pill/__examples__/Pill.examples.ts"],"names":[],"mappings":";;;;;;;;;AAwBA,
|
|
1
|
+
{"version":3,"file":"Pill.examples.d.ts","sourceRoot":"","sources":["../../../src/Pill/__examples__/Pill.examples.ts"],"names":[],"mappings":";;;;;;;;;AAwBA,wBAQC"}
|
package/types/Pill/index.d.ts
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
+
import type { TooltipRenderChildrenArgs } from '@instructure/ui-tooltip';
|
|
3
4
|
import { jsx } from '@instructure/emotion';
|
|
4
|
-
import type { PillProps } from './props';
|
|
5
|
+
import type { PillProps, PillState } from './props';
|
|
5
6
|
/**
|
|
6
7
|
---
|
|
7
8
|
category: components
|
|
8
9
|
---
|
|
10
|
+
@tsProps
|
|
9
11
|
**/
|
|
10
|
-
declare class Pill extends Component<PillProps> {
|
|
12
|
+
declare class Pill extends Component<PillProps, PillState> {
|
|
11
13
|
static readonly componentId = "Pill";
|
|
12
14
|
static allowedProps: readonly (keyof {
|
|
13
15
|
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
14
16
|
color?: "primary" | "success" | "danger" | "info" | "warning" | "alert" | undefined;
|
|
15
|
-
elementRef?: ((
|
|
17
|
+
elementRef?: ((element: HTMLElement | null) => void) | undefined;
|
|
16
18
|
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
17
19
|
children: import("react").ReactNode;
|
|
18
20
|
})[];
|
|
19
21
|
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
20
22
|
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
21
23
|
color?: "primary" | "success" | "danger" | "info" | "warning" | "alert" | undefined;
|
|
22
|
-
elementRef?: ((
|
|
24
|
+
elementRef?: ((element: HTMLElement | null) => void) | undefined;
|
|
23
25
|
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
24
26
|
children: import("react").ReactNode;
|
|
25
27
|
}>;
|
|
26
28
|
static defaultProps: {
|
|
27
29
|
color: string;
|
|
28
30
|
};
|
|
29
|
-
constructor(props:
|
|
31
|
+
constructor(props: PillProps);
|
|
30
32
|
componentDidMount(): void;
|
|
31
33
|
componentDidUpdate(): void;
|
|
32
|
-
handleTruncation(truncated:
|
|
33
|
-
renderPill(focused
|
|
34
|
+
handleTruncation(truncated: boolean): void;
|
|
35
|
+
renderPill(focused?: TooltipRenderChildrenArgs['focused'], getTriggerProps?: TooltipRenderChildrenArgs['getTriggerProps']): jsx.JSX.Element;
|
|
34
36
|
render(): jsx.JSX.Element;
|
|
35
37
|
}
|
|
36
38
|
export default Pill;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Pill/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Pill/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGnD;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAChD,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,YAAY;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;MAElB;gBAEW,KAAK,EAAE,SAAS;IAQ5B,iBAAiB;IAIjB,kBAAkB;IAIlB,gBAAgB,CAAC,SAAS,EAAE,OAAO;IAQnC,UAAU,CACR,OAAO,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC9C,eAAe,CAAC,EAAE,yBAAyB,CAAC,iBAAiB,CAAC;IAmDhE,MAAM;CAaP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
package/types/Pill/props.d.ts
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
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';
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Provides a reference to the underlying HTML element
|
|
9
|
+
*/
|
|
10
|
+
elementRef?: (element: HTMLElement | null) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
13
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
14
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
15
|
+
*/
|
|
8
16
|
margin?: Spacing;
|
|
9
17
|
children: React.ReactNode;
|
|
10
18
|
};
|
|
11
19
|
declare type PropKeys = keyof PillOwnProps;
|
|
12
20
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
13
|
-
declare type PillProps = PillOwnProps & WithStyleProps
|
|
21
|
+
declare type PillProps = PillOwnProps & WithStyleProps<PillTheme, PillStyle>;
|
|
22
|
+
declare type PillStyle = ComponentStyle<'pill' | 'text' | 'maxWidth'>;
|
|
14
23
|
declare const propTypes: PropValidators<PropKeys>;
|
|
15
24
|
declare const allowedProps: AllowedPropKeys;
|
|
16
|
-
|
|
25
|
+
declare type PillState = {
|
|
26
|
+
truncated: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type { PillProps, PillStyle, PillState };
|
|
17
29
|
export { propTypes, allowedProps };
|
|
18
30
|
//# 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;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAClD;;;;OAIG;IACH,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,CAavC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAMnB,CAAA;AAED,aAAK,SAAS,GAAG;IACf,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AAC/C,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"}
|