@instructure/ui-link 8.9.2-snapshot.1 → 8.9.2-snapshot.12
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/package.json +18 -18
- package/src/Link/props.ts +14 -4
- package/src/Link/styles.ts +3 -3
- package/types/Link/props.d.ts +5 -4
- package/types/Link/props.d.ts.map +1 -1
- package/types/Link/styles.d.ts +3 -143
- package/types/Link/styles.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-link",
|
|
3
|
-
"version": "8.9.2-snapshot.
|
|
3
|
+
"version": "8.9.2-snapshot.12+6231ada93",
|
|
4
4
|
"description": "A component for creating links",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,25 +25,25 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/console": "8.9.2-snapshot.
|
|
29
|
-
"@instructure/emotion": "8.9.2-snapshot.
|
|
30
|
-
"@instructure/shared-types": "8.9.2-snapshot.
|
|
31
|
-
"@instructure/ui-a11y-utils": "8.9.2-snapshot.
|
|
32
|
-
"@instructure/ui-color-utils": "8.9.2-snapshot.
|
|
33
|
-
"@instructure/ui-dom-utils": "8.9.2-snapshot.
|
|
34
|
-
"@instructure/ui-icons": "8.9.2-snapshot.
|
|
35
|
-
"@instructure/ui-prop-types": "8.9.2-snapshot.
|
|
36
|
-
"@instructure/ui-react-utils": "8.9.2-snapshot.
|
|
37
|
-
"@instructure/ui-testable": "8.9.2-snapshot.
|
|
38
|
-
"@instructure/ui-view": "8.9.2-snapshot.
|
|
28
|
+
"@instructure/console": "8.9.2-snapshot.12+6231ada93",
|
|
29
|
+
"@instructure/emotion": "8.9.2-snapshot.12+6231ada93",
|
|
30
|
+
"@instructure/shared-types": "8.9.2-snapshot.12+6231ada93",
|
|
31
|
+
"@instructure/ui-a11y-utils": "8.9.2-snapshot.12+6231ada93",
|
|
32
|
+
"@instructure/ui-color-utils": "8.9.2-snapshot.12+6231ada93",
|
|
33
|
+
"@instructure/ui-dom-utils": "8.9.2-snapshot.12+6231ada93",
|
|
34
|
+
"@instructure/ui-icons": "8.9.2-snapshot.12+6231ada93",
|
|
35
|
+
"@instructure/ui-prop-types": "8.9.2-snapshot.12+6231ada93",
|
|
36
|
+
"@instructure/ui-react-utils": "8.9.2-snapshot.12+6231ada93",
|
|
37
|
+
"@instructure/ui-testable": "8.9.2-snapshot.12+6231ada93",
|
|
38
|
+
"@instructure/ui-view": "8.9.2-snapshot.12+6231ada93",
|
|
39
39
|
"prop-types": "^15"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@instructure/ui-babel-preset": "8.9.2-snapshot.
|
|
43
|
-
"@instructure/ui-test-locator": "8.9.2-snapshot.
|
|
44
|
-
"@instructure/ui-test-queries": "8.9.2-snapshot.
|
|
45
|
-
"@instructure/ui-test-utils": "8.9.2-snapshot.
|
|
46
|
-
"@instructure/ui-themes": "8.9.2-snapshot.
|
|
42
|
+
"@instructure/ui-babel-preset": "8.9.2-snapshot.12+6231ada93",
|
|
43
|
+
"@instructure/ui-test-locator": "8.9.2-snapshot.12+6231ada93",
|
|
44
|
+
"@instructure/ui-test-queries": "8.9.2-snapshot.12+6231ada93",
|
|
45
|
+
"@instructure/ui-test-utils": "8.9.2-snapshot.12+6231ada93",
|
|
46
|
+
"@instructure/ui-themes": "8.9.2-snapshot.12+6231ada93"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": ">=16.8 <=17"
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6231ada93bd4299d640b5d39d7e44b0f54852b2a"
|
|
56
56
|
}
|
package/src/Link/props.ts
CHANGED
|
@@ -27,8 +27,16 @@ import PropTypes from 'prop-types'
|
|
|
27
27
|
|
|
28
28
|
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
29
29
|
|
|
30
|
-
import type {
|
|
31
|
-
|
|
30
|
+
import type {
|
|
31
|
+
AsElementType,
|
|
32
|
+
PropValidators,
|
|
33
|
+
LinkTheme
|
|
34
|
+
} from '@instructure/shared-types'
|
|
35
|
+
import type {
|
|
36
|
+
Spacing,
|
|
37
|
+
WithStyleProps,
|
|
38
|
+
ComponentStyle
|
|
39
|
+
} from '@instructure/emotion'
|
|
32
40
|
|
|
33
41
|
type LinkOwnProps = {
|
|
34
42
|
children: React.ReactNode
|
|
@@ -56,7 +64,9 @@ type PropKeys = keyof LinkOwnProps
|
|
|
56
64
|
|
|
57
65
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
58
66
|
|
|
59
|
-
type LinkProps = LinkOwnProps & WithStyleProps
|
|
67
|
+
type LinkProps = LinkOwnProps & WithStyleProps<LinkTheme, LinkStyle>
|
|
68
|
+
|
|
69
|
+
type LinkStyle = ComponentStyle<'link' | 'icon'>
|
|
60
70
|
|
|
61
71
|
const propTypes: PropValidators<PropKeys> = {
|
|
62
72
|
/**
|
|
@@ -143,5 +153,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
143
153
|
'onBlur'
|
|
144
154
|
]
|
|
145
155
|
|
|
146
|
-
export type { LinkProps }
|
|
156
|
+
export type { LinkProps, LinkStyle }
|
|
147
157
|
export { propTypes, allowedProps }
|
package/src/Link/styles.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { LinkTheme } from '@instructure/shared-types'
|
|
26
|
-
import { LinkProps, LinkStyleProps } from './props'
|
|
25
|
+
import type { LinkTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { LinkProps, LinkStyleProps, LinkStyle } from './props'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* ---
|
|
@@ -39,7 +39,7 @@ const generateStyle = (
|
|
|
39
39
|
componentTheme: LinkTheme,
|
|
40
40
|
props: LinkProps,
|
|
41
41
|
state: LinkStyleProps
|
|
42
|
-
) => {
|
|
42
|
+
): LinkStyle => {
|
|
43
43
|
const { isWithinText, renderIcon, iconPlacement, color } = props
|
|
44
44
|
const { containsTruncateText, hasVisibleChildren } = state
|
|
45
45
|
const inverseStyle = color === 'link-inverse'
|
package/types/Link/props.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AsElementType, PropValidators } from '@instructure/shared-types';
|
|
3
|
-
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
2
|
+
import type { AsElementType, PropValidators, LinkTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
declare type LinkOwnProps = {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
href?: string;
|
|
@@ -23,9 +23,10 @@ export declare type LinkStyleProps = {
|
|
|
23
23
|
};
|
|
24
24
|
declare type PropKeys = keyof LinkOwnProps;
|
|
25
25
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
26
|
-
declare type LinkProps = LinkOwnProps & WithStyleProps
|
|
26
|
+
declare type LinkProps = LinkOwnProps & WithStyleProps<LinkTheme, LinkStyle>;
|
|
27
|
+
declare type LinkStyle = ComponentStyle<'link' | 'icon'>;
|
|
27
28
|
declare const propTypes: PropValidators<PropKeys>;
|
|
28
29
|
declare const allowedProps: AllowedPropKeys;
|
|
29
|
-
export type { LinkProps };
|
|
30
|
+
export type { LinkProps, LinkStyle };
|
|
30
31
|
export { propTypes, allowedProps };
|
|
31
32
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Link/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Link/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACV,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,aAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc,CAAA;IAC/B,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,WAAW,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACpC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;IACxD,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,aAAa,CAAA;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CACjC,CAAA;AAED,oBAAY,cAAc,GAAG;IAC3B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,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,CAAC,CAAA;AAEhD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAkEvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/Link/styles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LinkTheme } from '@instructure/shared-types';
|
|
2
|
-
import { LinkProps, LinkStyleProps } from './props';
|
|
1
|
+
import type { LinkTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { LinkProps, LinkStyleProps, LinkStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,146 +10,6 @@ import { LinkProps, LinkStyleProps } 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: LinkTheme, props: LinkProps, state: LinkStyleProps) =>
|
|
14
|
-
link: {
|
|
15
|
-
'&:is(a):link, &:is(a):visited, &:is(button)'?: {
|
|
16
|
-
color: string;
|
|
17
|
-
'&:focus': {
|
|
18
|
-
outlineColor: string;
|
|
19
|
-
};
|
|
20
|
-
'&:hover, &:focus, &:active': {
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
} | undefined;
|
|
24
|
-
'&:-webkit-any(a):link, &:-webkit-any(a):visited, &:-webkit-any(button)'?: {
|
|
25
|
-
color: string;
|
|
26
|
-
'&:focus': {
|
|
27
|
-
outlineColor: string;
|
|
28
|
-
};
|
|
29
|
-
'&:hover, &:focus, &:active': {
|
|
30
|
-
color: string;
|
|
31
|
-
};
|
|
32
|
-
} | undefined;
|
|
33
|
-
color?: string | undefined;
|
|
34
|
-
'&:focus': {
|
|
35
|
-
outlineColor: string;
|
|
36
|
-
} | {
|
|
37
|
-
outlineColor: string;
|
|
38
|
-
};
|
|
39
|
-
'&:hover, &:focus, &:active'?: {
|
|
40
|
-
color: string;
|
|
41
|
-
} | undefined;
|
|
42
|
-
'&:is(a), &:is(button)': {
|
|
43
|
-
cursor: string;
|
|
44
|
-
color: string;
|
|
45
|
-
textDecoration: string;
|
|
46
|
-
'&:focus': {
|
|
47
|
-
color: string;
|
|
48
|
-
outlineColor: string;
|
|
49
|
-
};
|
|
50
|
-
'&:hover, &:active': {
|
|
51
|
-
color: string;
|
|
52
|
-
textDecoration: string;
|
|
53
|
-
};
|
|
54
|
-
'&[aria-disabled]': {
|
|
55
|
-
cursor: string;
|
|
56
|
-
pointerEvents: string;
|
|
57
|
-
opacity: string;
|
|
58
|
-
};
|
|
59
|
-
'&::-moz-focus-inner': {
|
|
60
|
-
border: number;
|
|
61
|
-
};
|
|
62
|
-
alignItems?: string | undefined;
|
|
63
|
-
boxSizing: string;
|
|
64
|
-
fontFamily: string;
|
|
65
|
-
fontWeight: number;
|
|
66
|
-
transition: string;
|
|
67
|
-
verticalAlign: string;
|
|
68
|
-
outlineColor: string;
|
|
69
|
-
outlineWidth: string | 0;
|
|
70
|
-
outlineStyle: string;
|
|
71
|
-
outlineOffset: string;
|
|
72
|
-
};
|
|
73
|
-
'&:-webkit-any(a), &:-webkit-any(button)': {
|
|
74
|
-
cursor: string;
|
|
75
|
-
color: string;
|
|
76
|
-
textDecoration: string;
|
|
77
|
-
'&:focus': {
|
|
78
|
-
color: string;
|
|
79
|
-
outlineColor: string;
|
|
80
|
-
};
|
|
81
|
-
'&:hover, &:active': {
|
|
82
|
-
color: string;
|
|
83
|
-
textDecoration: string;
|
|
84
|
-
};
|
|
85
|
-
'&[aria-disabled]': {
|
|
86
|
-
cursor: string;
|
|
87
|
-
pointerEvents: string;
|
|
88
|
-
opacity: string;
|
|
89
|
-
};
|
|
90
|
-
'&::-moz-focus-inner': {
|
|
91
|
-
border: number;
|
|
92
|
-
};
|
|
93
|
-
alignItems?: string | undefined;
|
|
94
|
-
boxSizing: string;
|
|
95
|
-
fontFamily: string;
|
|
96
|
-
fontWeight: number;
|
|
97
|
-
transition: string;
|
|
98
|
-
verticalAlign: string;
|
|
99
|
-
outlineColor: string;
|
|
100
|
-
outlineWidth: string | 0;
|
|
101
|
-
outlineStyle: string;
|
|
102
|
-
outlineOffset: string;
|
|
103
|
-
};
|
|
104
|
-
'&:is(button)': {
|
|
105
|
-
appearance: string;
|
|
106
|
-
userSelect: string;
|
|
107
|
-
background: string;
|
|
108
|
-
border: string;
|
|
109
|
-
cursor: string;
|
|
110
|
-
fontSize: string;
|
|
111
|
-
margin: number;
|
|
112
|
-
padding: number;
|
|
113
|
-
textAlign: string;
|
|
114
|
-
};
|
|
115
|
-
'&:-webkit-any(button)': {
|
|
116
|
-
appearance: string;
|
|
117
|
-
userSelect: string;
|
|
118
|
-
background: string;
|
|
119
|
-
border: string;
|
|
120
|
-
cursor: string;
|
|
121
|
-
fontSize: string;
|
|
122
|
-
margin: number;
|
|
123
|
-
padding: number;
|
|
124
|
-
textAlign: string;
|
|
125
|
-
};
|
|
126
|
-
'&[aria-disabled]': {
|
|
127
|
-
cursor: string;
|
|
128
|
-
pointerEvents: string;
|
|
129
|
-
opacity: string;
|
|
130
|
-
};
|
|
131
|
-
'&::-moz-focus-inner': {
|
|
132
|
-
border: number;
|
|
133
|
-
};
|
|
134
|
-
alignItems?: string | undefined;
|
|
135
|
-
boxSizing: string;
|
|
136
|
-
fontFamily: string;
|
|
137
|
-
fontWeight: number;
|
|
138
|
-
transition: string;
|
|
139
|
-
verticalAlign: string;
|
|
140
|
-
outlineColor: string;
|
|
141
|
-
outlineWidth: string | 0;
|
|
142
|
-
outlineStyle: string;
|
|
143
|
-
outlineOffset: string;
|
|
144
|
-
label: string;
|
|
145
|
-
};
|
|
146
|
-
icon: {
|
|
147
|
-
fontSize?: string | undefined;
|
|
148
|
-
boxSizing?: string | undefined;
|
|
149
|
-
paddingInlineStart?: string | 0 | undefined;
|
|
150
|
-
paddingInlineEnd?: string | 0 | undefined;
|
|
151
|
-
label: string;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: LinkTheme, props: LinkProps, state: LinkStyleProps) => LinkStyle;
|
|
154
14
|
export default generateStyle;
|
|
155
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Link/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Link/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnE;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,SAAS,SAClB,SAAS,SACT,cAAc,KACpB,SA8GF,CAAA;AAED,eAAe,aAAa,CAAA"}
|