@instructure/ui-grid 8.8.1-snapshot.8 → 8.9.1
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 +10 -0
- package/es/Grid/index.js +3 -17
- package/{src/Grid/types.ts → es/Grid/props.js} +15 -13
- package/es/GridCol/index.js +5 -39
- package/es/GridCol/props.js +53 -0
- package/es/GridRow/index.js +3 -21
- package/{src/GridRow/types.ts → es/GridRow/props.js} +16 -14
- package/lib/Grid/index.js +4 -20
- package/lib/Grid/props.js +52 -0
- package/lib/GridCol/index.js +5 -40
- package/lib/GridCol/props.js +64 -0
- package/lib/GridRow/index.js +4 -24
- package/lib/GridRow/props.js +53 -0
- package/package.json +13 -14
- package/src/Grid/index.tsx +6 -25
- package/src/Grid/props.ts +78 -0
- package/src/Grid/styles.ts +1 -1
- package/src/GridCol/index.tsx +6 -51
- package/src/GridCol/{types.ts → props.ts} +73 -4
- package/src/GridCol/styles.ts +1 -1
- package/src/GridRow/index.tsx +6 -28
- package/src/GridRow/props.ts +82 -0
- package/src/GridRow/styles.ts +1 -1
- package/src/index.ts +3 -3
- package/types/Grid/index.d.ts +19 -16
- package/types/Grid/index.d.ts.map +1 -1
- package/types/Grid/props.d.ts +21 -0
- package/types/Grid/props.d.ts.map +1 -0
- package/types/Grid/styles.d.ts +1 -1
- package/types/GridCol/index.d.ts +31 -30
- package/types/GridCol/index.d.ts.map +1 -1
- package/types/GridCol/{types.d.ts → props.d.ts} +14 -5
- package/types/GridCol/props.d.ts.map +1 -0
- package/types/GridCol/styles.d.ts +1 -1
- package/types/GridRow/index.d.ts +21 -17
- package/types/GridRow/index.d.ts.map +1 -1
- package/types/GridRow/props.d.ts +22 -0
- package/types/GridRow/props.d.ts.map +1 -0
- package/types/GridRow/styles.d.ts +1 -1
- package/types/index.d.ts +3 -3
- package/LICENSE.md +0 -27
- package/es/Grid/types.js +0 -1
- package/es/GridCol/types.js +0 -1
- package/es/GridRow/types.js +0 -1
- package/lib/Grid/types.js +0 -1
- package/lib/GridCol/types.js +0 -1
- package/lib/GridRow/types.js +0 -1
- package/types/Grid/types.d.ts +0 -12
- package/types/Grid/types.d.ts.map +0 -1
- package/types/GridCol/types.d.ts.map +0 -1
- package/types/GridRow/types.d.ts +0 -13
- package/types/GridRow/types.d.ts.map +0 -1
|
@@ -22,11 +22,17 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import
|
|
25
|
+
import PropTypes from 'prop-types'
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
|
28
|
+
import type { PropValidators } from '@instructure/shared-types'
|
|
29
|
+
import type { GridBreakpoints } from '../GridTypes'
|
|
30
|
+
|
|
31
|
+
// TODO: get numcols from theme config
|
|
32
|
+
const COL_WIDTHS = ['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
|
33
|
+
|
|
34
|
+
type GridColOwnProps = {
|
|
35
|
+
children?: React.ReactNode
|
|
30
36
|
colSpacing?: 'none' | 'small' | 'medium' | 'large'
|
|
31
37
|
rowSpacing?: 'none' | 'small' | 'medium' | 'large'
|
|
32
38
|
textAlign?: 'start' | 'end' | 'center' | 'inherit'
|
|
@@ -54,3 +60,66 @@ export type GridColProps = {
|
|
|
54
60
|
isLastCol?: boolean
|
|
55
61
|
elementRef?: (...args: any[]) => any
|
|
56
62
|
}
|
|
63
|
+
|
|
64
|
+
type PropKeys = keyof GridColOwnProps
|
|
65
|
+
|
|
66
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
67
|
+
|
|
68
|
+
type GridColProps = GridColOwnProps & WithStyleProps
|
|
69
|
+
|
|
70
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
71
|
+
children: PropTypes.node,
|
|
72
|
+
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
73
|
+
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
74
|
+
textAlign: PropTypes.oneOf(['start', 'end', 'center', 'inherit']),
|
|
75
|
+
hAlign: PropTypes.oneOf([
|
|
76
|
+
'start',
|
|
77
|
+
'center',
|
|
78
|
+
'end',
|
|
79
|
+
'space-around',
|
|
80
|
+
'space-between'
|
|
81
|
+
]),
|
|
82
|
+
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
83
|
+
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
84
|
+
visualDebug: PropTypes.bool,
|
|
85
|
+
width: PropTypes.oneOfType([
|
|
86
|
+
PropTypes.oneOf(COL_WIDTHS),
|
|
87
|
+
PropTypes.shape({
|
|
88
|
+
small: PropTypes.oneOf(COL_WIDTHS),
|
|
89
|
+
medium: PropTypes.oneOf(COL_WIDTHS),
|
|
90
|
+
large: PropTypes.oneOf(COL_WIDTHS),
|
|
91
|
+
xLarge: PropTypes.oneOf(COL_WIDTHS)
|
|
92
|
+
})
|
|
93
|
+
]),
|
|
94
|
+
offset: PropTypes.oneOfType([
|
|
95
|
+
PropTypes.oneOf(COL_WIDTHS),
|
|
96
|
+
PropTypes.shape({
|
|
97
|
+
small: PropTypes.oneOf(COL_WIDTHS),
|
|
98
|
+
medium: PropTypes.oneOf(COL_WIDTHS),
|
|
99
|
+
large: PropTypes.oneOf(COL_WIDTHS),
|
|
100
|
+
xLarge: PropTypes.oneOf(COL_WIDTHS)
|
|
101
|
+
})
|
|
102
|
+
]),
|
|
103
|
+
isLastRow: PropTypes.bool,
|
|
104
|
+
isLastCol: PropTypes.bool,
|
|
105
|
+
elementRef: PropTypes.func
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const allowedProps: AllowedPropKeys = [
|
|
109
|
+
'children',
|
|
110
|
+
'colSpacing',
|
|
111
|
+
'rowSpacing',
|
|
112
|
+
'textAlign',
|
|
113
|
+
'hAlign',
|
|
114
|
+
'vAlign',
|
|
115
|
+
'startAt',
|
|
116
|
+
'visualDebug',
|
|
117
|
+
'width',
|
|
118
|
+
'offset',
|
|
119
|
+
'isLastRow',
|
|
120
|
+
'isLastCol',
|
|
121
|
+
'elementRef'
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
export type { GridColProps }
|
|
125
|
+
export { propTypes, allowedProps }
|
package/src/GridCol/styles.ts
CHANGED
package/src/GridRow/index.tsx
CHANGED
|
@@ -24,16 +24,13 @@
|
|
|
24
24
|
|
|
25
25
|
/** @jsx jsx */
|
|
26
26
|
import { Component, Children, ReactElement } from 'react'
|
|
27
|
-
import PropTypes from 'prop-types'
|
|
28
27
|
|
|
29
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
30
28
|
import {
|
|
31
29
|
safeCloneElement,
|
|
32
30
|
matchComponentTypes,
|
|
33
31
|
omitProps,
|
|
34
32
|
pickProps
|
|
35
33
|
} from '@instructure/ui-react-utils'
|
|
36
|
-
import { ScreenReaderContent } from '@instructure/ui-a11y-content'
|
|
37
34
|
|
|
38
35
|
import { GridCol } from '../GridCol'
|
|
39
36
|
|
|
@@ -41,7 +38,9 @@ import { withStyle, jsx } from '@instructure/emotion'
|
|
|
41
38
|
|
|
42
39
|
import generateStyle from './styles'
|
|
43
40
|
import generateComponentTheme from './theme'
|
|
44
|
-
|
|
41
|
+
|
|
42
|
+
import { propTypes, allowedProps } from './props'
|
|
43
|
+
import type { GridRowProps } from './props'
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
46
|
---
|
|
@@ -53,29 +52,8 @@ id: Grid.Row
|
|
|
53
52
|
class GridRow extends Component<GridRowProps> {
|
|
54
53
|
static readonly componentId = 'Grid.Row'
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
static
|
|
58
|
-
// eslint-disable-next-line react/require-default-props
|
|
59
|
-
makeStyles: PropTypes.func,
|
|
60
|
-
// eslint-disable-next-line react/require-default-props
|
|
61
|
-
styles: PropTypes.object,
|
|
62
|
-
children: ChildrenPropTypes.oneOf([GridCol, ScreenReaderContent]),
|
|
63
|
-
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
64
|
-
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
65
|
-
hAlign: PropTypes.oneOf([
|
|
66
|
-
'start',
|
|
67
|
-
'center',
|
|
68
|
-
'end',
|
|
69
|
-
'space-around',
|
|
70
|
-
'space-between'
|
|
71
|
-
]),
|
|
72
|
-
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
73
|
-
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
74
|
-
visualDebug: PropTypes.bool,
|
|
75
|
-
isLastRow: PropTypes.bool
|
|
76
|
-
}
|
|
77
|
-
/* eslint-enable react/require-default-props */
|
|
78
|
-
|
|
55
|
+
static propTypes = propTypes
|
|
56
|
+
static allowedProps = allowedProps
|
|
79
57
|
static defaultProps = {
|
|
80
58
|
children: null,
|
|
81
59
|
isLastRow: false
|
|
@@ -116,7 +94,7 @@ class GridRow extends Component<GridRowProps> {
|
|
|
116
94
|
const props = omitProps(restProps, GridRow.propTypes)
|
|
117
95
|
|
|
118
96
|
return (
|
|
119
|
-
<span {...props} css={styles
|
|
97
|
+
<span {...props} css={styles?.gridRow}>
|
|
120
98
|
{this.renderChildren()}
|
|
121
99
|
</span>
|
|
122
100
|
)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import React from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
27
|
+
|
|
28
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
29
|
+
import { ScreenReaderContent } from '@instructure/ui-a11y-content'
|
|
30
|
+
import { GridCol } from '../GridCol'
|
|
31
|
+
|
|
32
|
+
import type { PropValidators } from '@instructure/shared-types'
|
|
33
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
|
34
|
+
import type { GridBreakpoints } from '../GridTypes'
|
|
35
|
+
|
|
36
|
+
type GridRowOwnProps = {
|
|
37
|
+
children?: React.ReactNode // TODO: oneOf([GridCol, ScreenReaderContent])
|
|
38
|
+
rowSpacing?: 'none' | 'small' | 'medium' | 'large'
|
|
39
|
+
colSpacing?: 'none' | 'small' | 'medium' | 'large'
|
|
40
|
+
hAlign?: 'start' | 'center' | 'end' | 'space-around' | 'space-between'
|
|
41
|
+
vAlign?: 'top' | 'middle' | 'bottom'
|
|
42
|
+
startAt?: GridBreakpoints
|
|
43
|
+
visualDebug?: boolean
|
|
44
|
+
isLastRow?: boolean
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type PropKeys = keyof GridRowOwnProps
|
|
48
|
+
|
|
49
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
50
|
+
|
|
51
|
+
type GridRowProps = GridRowOwnProps & WithStyleProps
|
|
52
|
+
|
|
53
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
54
|
+
children: ChildrenPropTypes.oneOf([GridCol, ScreenReaderContent]),
|
|
55
|
+
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
56
|
+
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
57
|
+
hAlign: PropTypes.oneOf([
|
|
58
|
+
'start',
|
|
59
|
+
'center',
|
|
60
|
+
'end',
|
|
61
|
+
'space-around',
|
|
62
|
+
'space-between'
|
|
63
|
+
]),
|
|
64
|
+
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
65
|
+
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
66
|
+
visualDebug: PropTypes.bool,
|
|
67
|
+
isLastRow: PropTypes.bool
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const allowedProps: AllowedPropKeys = [
|
|
71
|
+
'children',
|
|
72
|
+
'rowSpacing',
|
|
73
|
+
'colSpacing',
|
|
74
|
+
'hAlign',
|
|
75
|
+
'vAlign',
|
|
76
|
+
'startAt',
|
|
77
|
+
'visualDebug',
|
|
78
|
+
'isLastRow'
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
export type { GridRowProps }
|
|
82
|
+
export { propTypes, allowedProps }
|
package/src/GridRow/styles.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -25,6 +25,6 @@ export { Grid, GridRow, GridCol } from './Grid'
|
|
|
25
25
|
|
|
26
26
|
export type { GridBreakpoints } from './GridTypes'
|
|
27
27
|
|
|
28
|
-
export type { GridProps } from './Grid/
|
|
29
|
-
export type { GridRowProps } from './GridRow/
|
|
30
|
-
export type { GridColProps } from './GridCol/
|
|
28
|
+
export type { GridProps } from './Grid/props'
|
|
29
|
+
export type { GridRowProps } from './GridRow/props'
|
|
30
|
+
export type { GridColProps } from './GridCol/props'
|
package/types/Grid/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { GridRow } from '../GridRow';
|
|
5
4
|
import { GridCol } from '../GridCol';
|
|
6
5
|
import { jsx } from '@instructure/emotion';
|
|
7
|
-
import { GridProps } from './
|
|
6
|
+
import type { GridProps } from './props';
|
|
8
7
|
/**
|
|
9
8
|
---
|
|
10
9
|
category: components
|
|
@@ -12,20 +11,24 @@ category: components
|
|
|
12
11
|
**/
|
|
13
12
|
declare class Grid extends Component<GridProps> {
|
|
14
13
|
static readonly componentId = "Grid";
|
|
15
|
-
static propTypes: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
15
|
+
children?: import("react").ReactNode;
|
|
16
|
+
colSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
17
|
+
rowSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
18
|
+
hAlign?: "start" | "end" | "center" | "space-around" | "space-between" | undefined;
|
|
19
|
+
vAlign?: "top" | "middle" | "bottom" | undefined;
|
|
20
|
+
startAt?: import("..").GridBreakpoints | undefined;
|
|
21
|
+
visualDebug?: boolean | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
static allowedProps: readonly (keyof {
|
|
24
|
+
children?: import("react").ReactNode;
|
|
25
|
+
colSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
26
|
+
rowSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
27
|
+
hAlign?: "start" | "end" | "center" | "space-around" | "space-between" | undefined;
|
|
28
|
+
vAlign?: "top" | "middle" | "bottom" | undefined;
|
|
29
|
+
startAt?: import("..").GridBreakpoints | undefined;
|
|
30
|
+
visualDebug?: boolean | undefined;
|
|
31
|
+
})[];
|
|
29
32
|
static defaultProps: {
|
|
30
33
|
colSpacing: string;
|
|
31
34
|
rowSpacing: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Grid/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Grid/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AASzD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;;GAIG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,SAAS;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;MAQlB;IAED,MAAM,CAAC,GAAG,iBAAU;IACpB,MAAM,CAAC,GAAG,iBAAU;IAEpB,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,cAAc;IAkBd,MAAM;CAWP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
4
|
+
import type { GridBreakpoints } from '../GridTypes';
|
|
5
|
+
declare type GridOwnProps = {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
colSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
8
|
+
rowSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
9
|
+
hAlign?: 'start' | 'center' | 'end' | 'space-around' | 'space-between';
|
|
10
|
+
vAlign?: 'top' | 'middle' | 'bottom';
|
|
11
|
+
startAt?: GridBreakpoints;
|
|
12
|
+
visualDebug?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare type PropKeys = keyof GridOwnProps;
|
|
15
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
16
|
+
declare type GridProps = GridOwnProps & WithStyleProps;
|
|
17
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
18
|
+
declare const allowedProps: AllowedPropKeys;
|
|
19
|
+
export type { GridProps };
|
|
20
|
+
export { propTypes, allowedProps };
|
|
21
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Grid/props.ts"],"names":[],"mappings":";AA8BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,aAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClD,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClD,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,cAAc,GAAG,eAAe,CAAA;IACtE,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACpC,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,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,CAAA;AAE9C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAcvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAQnB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/Grid/styles.d.ts
CHANGED
package/types/GridCol/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { jsx } from '@instructure/emotion';
|
|
5
|
-
import { GridColProps } from './
|
|
4
|
+
import type { GridColProps } from './props';
|
|
6
5
|
/**
|
|
7
6
|
---
|
|
8
7
|
parent: Grid
|
|
@@ -11,39 +10,41 @@ id: Grid.Col
|
|
|
11
10
|
**/
|
|
12
11
|
declare class GridCol extends Component<GridColProps> {
|
|
13
12
|
static readonly componentId = "Grid.Col";
|
|
14
|
-
static propTypes: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
colSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
16
|
+
rowSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
17
|
+
textAlign?: "start" | "end" | "center" | "inherit" | undefined;
|
|
18
|
+
hAlign?: "start" | "end" | "center" | "space-around" | "space-between" | undefined;
|
|
19
|
+
vAlign?: "top" | "middle" | "bottom" | undefined;
|
|
20
|
+
startAt?: import("..").GridBreakpoints | undefined;
|
|
21
|
+
visualDebug?: boolean | undefined;
|
|
22
|
+
width?: any;
|
|
23
|
+
offset?: any;
|
|
24
|
+
isLastRow?: boolean | undefined;
|
|
25
|
+
isLastCol?: boolean | undefined;
|
|
26
|
+
elementRef?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
static allowedProps: readonly (keyof {
|
|
29
|
+
children?: import("react").ReactNode;
|
|
30
|
+
colSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
31
|
+
rowSpacing?: "small" | "medium" | "large" | "none" | undefined;
|
|
32
|
+
textAlign?: "start" | "end" | "center" | "inherit" | undefined;
|
|
33
|
+
hAlign?: "start" | "end" | "center" | "space-around" | "space-between" | undefined;
|
|
34
|
+
vAlign?: "top" | "middle" | "bottom" | undefined;
|
|
35
|
+
startAt?: import("..").GridBreakpoints | undefined;
|
|
36
|
+
visualDebug?: boolean | undefined;
|
|
37
|
+
width?: any;
|
|
38
|
+
offset?: any;
|
|
39
|
+
isLastRow?: boolean | undefined;
|
|
40
|
+
isLastCol?: boolean | undefined;
|
|
41
|
+
elementRef?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
})[];
|
|
41
43
|
static defaultProps: {
|
|
42
44
|
textAlign: string;
|
|
43
45
|
children: null;
|
|
44
46
|
isLastCol: boolean;
|
|
45
47
|
isLastRow: boolean;
|
|
46
|
-
elementRef: undefined;
|
|
47
48
|
};
|
|
48
49
|
componentDidMount(): void;
|
|
49
50
|
componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/GridCol/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/GridCol/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;;;GAKG;AACH,cACM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAExC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CAWP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
3
|
+
import type { PropValidators } from '@instructure/shared-types';
|
|
4
|
+
import type { GridBreakpoints } from '../GridTypes';
|
|
5
|
+
declare type GridColOwnProps = {
|
|
6
|
+
children?: React.ReactNode;
|
|
5
7
|
colSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
6
8
|
rowSpacing?: 'none' | 'small' | 'medium' | 'large';
|
|
7
9
|
textAlign?: 'start' | 'end' | 'center' | 'inherit';
|
|
@@ -25,4 +27,11 @@ export declare type GridColProps = {
|
|
|
25
27
|
isLastCol?: boolean;
|
|
26
28
|
elementRef?: (...args: any[]) => any;
|
|
27
29
|
};
|
|
28
|
-
|
|
30
|
+
declare type PropKeys = keyof GridColOwnProps;
|
|
31
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
32
|
+
declare type GridColProps = GridColOwnProps & WithStyleProps;
|
|
33
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
34
|
+
declare const allowedProps: AllowedPropKeys;
|
|
35
|
+
export type { GridColProps };
|
|
36
|
+
export { propTypes, allowedProps };
|
|
37
|
+
//# sourceMappingURL=props.d.ts.map
|