@instructure/ui-view 8.9.2-snapshot.7 → 8.9.2-snapshot.9
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 +14 -14
- package/src/ContextView/props.ts +18 -4
- package/src/ContextView/styles.ts +4 -3
- package/src/View/props.ts +7 -4
- package/src/View/styles.ts +8 -3
- package/types/ContextView/props.d.ts +5 -4
- package/types/ContextView/props.d.ts.map +1 -1
- package/types/ContextView/styles.d.ts +3 -2174
- package/types/ContextView/styles.d.ts.map +1 -1
- package/types/View/props.d.ts +5 -4
- package/types/View/props.d.ts.map +1 -1
- package/types/View/styles.d.ts +3 -3
- package/types/View/styles.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-view",
|
|
3
|
-
"version": "8.9.2-snapshot.
|
|
3
|
+
"version": "8.9.2-snapshot.9+e92f12dda",
|
|
4
4
|
"description": "A component for basic styles including spacing, sizing, borders, display, positioning, and focus states.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,21 +25,21 @@
|
|
|
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-color-utils": "8.9.2-snapshot.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.9.2-snapshot.
|
|
33
|
-
"@instructure/ui-i18n": "8.9.2-snapshot.
|
|
34
|
-
"@instructure/ui-position": "8.9.2-snapshot.
|
|
35
|
-
"@instructure/ui-prop-types": "8.9.2-snapshot.
|
|
36
|
-
"@instructure/ui-react-utils": "8.9.2-snapshot.
|
|
28
|
+
"@instructure/console": "8.9.2-snapshot.9+e92f12dda",
|
|
29
|
+
"@instructure/emotion": "8.9.2-snapshot.9+e92f12dda",
|
|
30
|
+
"@instructure/shared-types": "8.9.2-snapshot.9+e92f12dda",
|
|
31
|
+
"@instructure/ui-color-utils": "8.9.2-snapshot.9+e92f12dda",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.9.2-snapshot.9+e92f12dda",
|
|
33
|
+
"@instructure/ui-i18n": "8.9.2-snapshot.9+e92f12dda",
|
|
34
|
+
"@instructure/ui-position": "8.9.2-snapshot.9+e92f12dda",
|
|
35
|
+
"@instructure/ui-prop-types": "8.9.2-snapshot.9+e92f12dda",
|
|
36
|
+
"@instructure/ui-react-utils": "8.9.2-snapshot.9+e92f12dda",
|
|
37
37
|
"prop-types": "^15"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@instructure/ui-babel-preset": "8.9.2-snapshot.
|
|
41
|
-
"@instructure/ui-test-utils": "8.9.2-snapshot.
|
|
42
|
-
"@instructure/ui-themes": "8.9.2-snapshot.
|
|
40
|
+
"@instructure/ui-babel-preset": "8.9.2-snapshot.9+e92f12dda",
|
|
41
|
+
"@instructure/ui-test-utils": "8.9.2-snapshot.9+e92f12dda",
|
|
42
|
+
"@instructure/ui-themes": "8.9.2-snapshot.9+e92f12dda"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.8 <=17"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "e92f12dda2e003c834e8728072d6ab60e4212c89"
|
|
52
52
|
}
|
package/src/ContextView/props.ts
CHANGED
|
@@ -28,13 +28,18 @@ import PropTypes from 'prop-types'
|
|
|
28
28
|
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
29
29
|
import { PositionPropTypes } from '@instructure/ui-position'
|
|
30
30
|
|
|
31
|
-
import type {
|
|
31
|
+
import type {
|
|
32
|
+
AsElementType,
|
|
33
|
+
PropValidators,
|
|
34
|
+
ContextViewTheme
|
|
35
|
+
} from '@instructure/shared-types'
|
|
32
36
|
import type { PlacementPropValues } from '@instructure/ui-position'
|
|
33
37
|
import type {
|
|
34
38
|
Shadow,
|
|
35
39
|
Spacing,
|
|
36
40
|
Stacking,
|
|
37
|
-
WithStyleProps
|
|
41
|
+
WithStyleProps,
|
|
42
|
+
ComponentStyle
|
|
38
43
|
} from '@instructure/emotion'
|
|
39
44
|
|
|
40
45
|
type ContextViewOwnProps = {
|
|
@@ -61,7 +66,16 @@ type PropKeys = keyof ContextViewOwnProps
|
|
|
61
66
|
|
|
62
67
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
63
68
|
|
|
64
|
-
type ContextViewProps = ContextViewOwnProps &
|
|
69
|
+
type ContextViewProps = ContextViewOwnProps &
|
|
70
|
+
WithStyleProps<ContextViewTheme, ContextViewStyle>
|
|
71
|
+
|
|
72
|
+
type ContextViewStyle = ComponentStyle<
|
|
73
|
+
| 'contextView'
|
|
74
|
+
| 'contextView__content'
|
|
75
|
+
| 'contextView__arrow'
|
|
76
|
+
| 'arrowSize'
|
|
77
|
+
| 'arrowBorderWidth'
|
|
78
|
+
>
|
|
65
79
|
|
|
66
80
|
const propTypes: PropValidators<PropKeys> = {
|
|
67
81
|
/**
|
|
@@ -152,5 +166,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
152
166
|
'debug'
|
|
153
167
|
]
|
|
154
168
|
|
|
155
|
-
export type { ContextViewProps }
|
|
169
|
+
export type { ContextViewProps, ContextViewStyle }
|
|
156
170
|
export { propTypes, allowedProps }
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { mirrorPlacement } from '@instructure/ui-position'
|
|
26
|
+
|
|
26
27
|
import type { PlacementPropValues } from '@instructure/ui-position'
|
|
27
|
-
import { ContextViewTheme } from '@instructure/shared-types'
|
|
28
|
-
import { ContextViewProps } from './props'
|
|
28
|
+
import type { ContextViewTheme } from '@instructure/shared-types'
|
|
29
|
+
import type { ContextViewProps, ContextViewStyle } from './props'
|
|
29
30
|
|
|
30
31
|
type PlacementArray = PlacementPropValues[]
|
|
31
32
|
|
|
@@ -259,7 +260,7 @@ const getArrowPlacementVariant = (
|
|
|
259
260
|
const generateStyle = (
|
|
260
261
|
componentTheme: ContextViewTheme,
|
|
261
262
|
props: ContextViewProps
|
|
262
|
-
) => {
|
|
263
|
+
): ContextViewStyle => {
|
|
263
264
|
const { placement, background } = props
|
|
264
265
|
|
|
265
266
|
const arrowBaseStyles = {
|
package/src/View/props.ts
CHANGED
|
@@ -29,14 +29,15 @@ import { cursor as cursorPropTypes } from '@instructure/ui-prop-types'
|
|
|
29
29
|
import { bidirectional } from '@instructure/ui-i18n'
|
|
30
30
|
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
31
31
|
|
|
32
|
-
import type { AsElementType, PropValidators } from '@instructure/shared-types'
|
|
32
|
+
import type { AsElementType, PropValidators, ViewTheme } from '@instructure/shared-types'
|
|
33
33
|
import type {
|
|
34
34
|
WithStyleProps,
|
|
35
35
|
Spacing,
|
|
36
36
|
BorderWidth,
|
|
37
37
|
BorderRadii,
|
|
38
38
|
Shadow,
|
|
39
|
-
Stacking
|
|
39
|
+
Stacking,
|
|
40
|
+
ComponentStyle
|
|
40
41
|
} from '@instructure/emotion'
|
|
41
42
|
|
|
42
43
|
type ViewOwnProps = {
|
|
@@ -180,10 +181,12 @@ type ViewOwnProps = {
|
|
|
180
181
|
|
|
181
182
|
type PropKeys = keyof ViewOwnProps
|
|
182
183
|
|
|
183
|
-
type ViewProps = ViewOwnProps & WithStyleProps
|
|
184
|
+
type ViewProps = ViewOwnProps & WithStyleProps<ViewTheme, ViewStyle>
|
|
184
185
|
|
|
185
186
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
186
187
|
|
|
188
|
+
type ViewStyle = ComponentStyle<'view' | 'inlineStyles'>
|
|
189
|
+
|
|
187
190
|
const propTypes: PropValidators<PropKeys> = {
|
|
188
191
|
as: PropTypes.elementType,
|
|
189
192
|
elementRef: PropTypes.func,
|
|
@@ -294,4 +297,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
294
297
|
]
|
|
295
298
|
|
|
296
299
|
export { propTypes, allowedProps }
|
|
297
|
-
export type { ViewProps }
|
|
300
|
+
export type { ViewProps, ViewStyle }
|
package/src/View/styles.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
+
|
|
24
25
|
import { DIRECTION } from '@instructure/ui-i18n'
|
|
25
26
|
import {
|
|
26
27
|
getShorthandPropValue,
|
|
@@ -29,12 +30,13 @@ import {
|
|
|
29
30
|
} from '@instructure/emotion'
|
|
30
31
|
import { pickProps } from '@instructure/ui-react-utils'
|
|
31
32
|
import { logError as error } from '@instructure/console'
|
|
32
|
-
|
|
33
|
+
|
|
34
|
+
import type {
|
|
33
35
|
OtherHTMLAttributes,
|
|
34
36
|
PartialRecord,
|
|
35
37
|
ViewTheme
|
|
36
38
|
} from '@instructure/shared-types'
|
|
37
|
-
import { ViewProps } from './props'
|
|
39
|
+
import type { ViewProps, ViewStyle } from './props'
|
|
38
40
|
|
|
39
41
|
const getBorderStyle = ({
|
|
40
42
|
borderRadius,
|
|
@@ -374,7 +376,10 @@ const getFocusStyles = (props: ViewProps, componentTheme: ViewTheme) => {
|
|
|
374
376
|
* @param {Object} extraArgs
|
|
375
377
|
* @return {Object} The final style object, which will be used in the component
|
|
376
378
|
*/
|
|
377
|
-
const generateStyle = (
|
|
379
|
+
const generateStyle = (
|
|
380
|
+
componentTheme: ViewTheme,
|
|
381
|
+
props: ViewProps
|
|
382
|
+
): ViewStyle => {
|
|
378
383
|
const {
|
|
379
384
|
borderRadius,
|
|
380
385
|
borderWidth,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AsElementType, PropValidators } from '@instructure/shared-types';
|
|
2
|
+
import type { AsElementType, PropValidators, ContextViewTheme } from '@instructure/shared-types';
|
|
3
3
|
import type { PlacementPropValues } from '@instructure/ui-position';
|
|
4
|
-
import type { Shadow, Spacing, Stacking, WithStyleProps } from '@instructure/emotion';
|
|
4
|
+
import type { Shadow, Spacing, Stacking, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
5
5
|
declare type ContextViewOwnProps = {
|
|
6
6
|
as?: AsElementType;
|
|
7
7
|
elementRef?: (...args: any[]) => any;
|
|
@@ -23,9 +23,10 @@ declare type ContextViewOwnProps = {
|
|
|
23
23
|
};
|
|
24
24
|
declare type PropKeys = keyof ContextViewOwnProps;
|
|
25
25
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
26
|
-
declare type ContextViewProps = ContextViewOwnProps & WithStyleProps
|
|
26
|
+
declare type ContextViewProps = ContextViewOwnProps & WithStyleProps<ContextViewTheme, ContextViewStyle>;
|
|
27
|
+
declare type ContextViewStyle = ComponentStyle<'contextView' | 'contextView__content' | 'contextView__arrow' | 'arrowSize' | 'arrowBorderWidth'>;
|
|
27
28
|
declare const propTypes: PropValidators<PropKeys>;
|
|
28
29
|
declare const allowedProps: AllowedPropKeys;
|
|
29
|
-
export type { ContextViewProps };
|
|
30
|
+
export type { ContextViewProps, ContextViewStyle };
|
|
30
31
|
export { propTypes, allowedProps };
|
|
31
32
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ContextView/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ContextView/props.ts"],"names":[],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