@instructure/ui-flex 8.12.1-snapshot.52 → 8.13.1-snapshot.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-flex",
3
- "version": "8.12.1-snapshot.52+07b0037b0",
3
+ "version": "8.13.1-snapshot.10+0ceb70745",
4
4
  "description": "A component that makes it easy to align content using flexbox CSS",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,17 +25,17 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/console": "8.12.1-snapshot.52+07b0037b0",
29
- "@instructure/emotion": "8.12.1-snapshot.52+07b0037b0",
30
- "@instructure/shared-types": "8.12.1-snapshot.52+07b0037b0",
31
- "@instructure/ui-react-utils": "8.12.1-snapshot.52+07b0037b0",
32
- "@instructure/ui-view": "8.12.1-snapshot.52+07b0037b0",
28
+ "@instructure/console": "8.13.1-snapshot.10+0ceb70745",
29
+ "@instructure/emotion": "8.13.1-snapshot.10+0ceb70745",
30
+ "@instructure/shared-types": "8.13.1-snapshot.10+0ceb70745",
31
+ "@instructure/ui-react-utils": "8.13.1-snapshot.10+0ceb70745",
32
+ "@instructure/ui-view": "8.13.1-snapshot.10+0ceb70745",
33
33
  "prop-types": "^15"
34
34
  },
35
35
  "devDependencies": {
36
- "@instructure/ui-babel-preset": "8.12.1-snapshot.52+07b0037b0",
37
- "@instructure/ui-test-utils": "8.12.1-snapshot.52+07b0037b0",
38
- "@instructure/ui-themes": "8.12.1-snapshot.52+07b0037b0"
36
+ "@instructure/ui-babel-preset": "8.13.1-snapshot.10+0ceb70745",
37
+ "@instructure/ui-test-utils": "8.13.1-snapshot.10+0ceb70745",
38
+ "@instructure/ui-themes": "8.13.1-snapshot.10+0ceb70745"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": ">=16.8 <=17"
@@ -44,5 +44,5 @@
44
44
  "access": "public"
45
45
  },
46
46
  "sideEffects": false,
47
- "gitHead": "07b0037b0ddaf6d4f19cca140fc82fc9a2f1efc9"
47
+ "gitHead": "0ceb7074574b9c3a7249eecab3d1ac0e7175a5dd"
48
48
  }
@@ -39,27 +39,24 @@ import type { FlexItemProps } from './props'
39
39
  parent: Flex
40
40
  id: Flex.Item
41
41
  ---
42
+ @tsProps
42
43
  **/
43
44
  @withStyle(generateStyle, null)
44
45
  class Item extends Component<FlexItemProps> {
45
46
  static readonly componentId = 'Flex.Item'
46
47
 
47
48
  componentDidMount() {
48
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
49
- this.props.makeStyles()
49
+ this.props.makeStyles?.()
50
50
  }
51
51
 
52
52
  componentDidUpdate() {
53
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
54
- this.props.makeStyles()
53
+ this.props.makeStyles?.()
55
54
  }
56
55
 
57
56
  static propTypes = propTypes
58
57
  static allowedProps = allowedProps
59
58
  static defaultProps = {
60
59
  as: 'span',
61
- // @ts-expect-error ts-migrate(6133) FIXME: 'el' is declared but its value is never read.
62
- elementRef: (el: any) => {},
63
60
  shouldGrow: false,
64
61
  shouldShrink: false
65
62
  }
@@ -39,92 +39,105 @@ import type {
39
39
  } from '@instructure/emotion'
40
40
 
41
41
  type FlexItemOwnProps = {
42
- children?: React.ReactNode
43
- as?: AsElementType
44
- elementRef?: (element: Element | null) => void
45
- margin?: Spacing
46
- padding?: Spacing
47
- align?: 'center' | 'start' | 'end' | 'stretch'
48
- direction?: 'row' | 'column'
49
- textAlign?: 'start' | 'center' | 'end'
50
- overflowX?: 'auto' | 'hidden' | 'visible'
51
- overflowY?: 'auto' | 'hidden' | 'visible'
52
- shouldGrow?: boolean
53
- shouldShrink?: boolean
54
- size?: string
55
- withVisualDebug?: boolean
56
- }
57
-
58
- type PropKeys = keyof FlexItemOwnProps
59
-
60
- type AllowedPropKeys = Readonly<Array<PropKeys>>
61
-
62
- type FlexItemProps = FlexItemOwnProps &
63
- WithStyleProps<null, FlexItemStyle> &
64
- OtherHTMLAttributes<FlexItemOwnProps>
65
-
66
- type FlexItemStyle = ComponentStyle<'flexItem'>
67
-
68
- const propTypes: PropValidators<PropKeys> = {
69
42
  /**
70
- * The children to render inside the Item`
43
+ * The children to render inside the Item
71
44
  */
72
- children: PropTypes.node,
45
+ children?: React.ReactNode
46
+
73
47
  /**
74
48
  * the element type to render as
75
49
  */
76
- as: PropTypes.elementType,
50
+ as?: AsElementType
51
+
77
52
  /**
78
53
  * provides a reference to the underlying html root element
79
54
  */
80
- elementRef: PropTypes.func,
55
+ elementRef?: (element: Element | null) => void
56
+
81
57
  /**
82
58
  * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
83
59
  * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
84
60
  * familiar CSS-like shorthand. For example: `margin="small auto large"`.
85
61
  */
86
- margin: ThemeablePropTypes.spacing,
62
+ margin?: Spacing
63
+
87
64
  /**
88
65
  * Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
89
66
  * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
90
67
  * familiar CSS-like shorthand. For example: `padding="small x-large large"`.
91
68
  */
92
- padding: ThemeablePropTypes.spacing,
69
+ padding?: Spacing
70
+
93
71
  /**
94
72
  * overrides the parent Flex's alignItems prop, if needed
95
73
  */
96
- align: PropTypes.oneOf(['center', 'start', 'end', 'stretch']),
74
+ align?: 'center' | 'start' | 'end' | 'stretch'
75
+
97
76
  /**
98
77
  * Inherits from the parent Flex component
99
78
  */
100
- direction: PropTypes.oneOf(['row', 'column']),
79
+ direction?: 'row' | 'column'
80
+
101
81
  /**
102
82
  * Designates the text alignment inside the Item
103
83
  */
104
- textAlign: PropTypes.oneOf(['start', 'center', 'end']),
84
+ textAlign?: 'start' | 'center' | 'end'
85
+
105
86
  /**
106
87
  * Handles horizontal overflow
107
88
  */
108
- overflowX: PropTypes.oneOf(['auto', 'hidden', 'visible']),
89
+ overflowX?: 'auto' | 'hidden' | 'visible'
90
+
109
91
  /**
110
92
  * Handles vertical overflow
111
93
  */
112
- overflowY: PropTypes.oneOf(['auto', 'hidden', 'visible']),
94
+ overflowY?: 'auto' | 'hidden' | 'visible'
95
+
113
96
  /**
114
97
  * Should the FlexItem grow to fill any available space?
115
98
  */
116
- shouldGrow: PropTypes.bool,
99
+ shouldGrow?: boolean
100
+
117
101
  /**
118
102
  * Should the FlexItem shrink (stopping at its `size`)?
119
103
  */
120
- shouldShrink: PropTypes.bool,
104
+ shouldShrink?: boolean
105
+
121
106
  /**
122
107
  * Sets the base size of the FlexItem (width if direction is `row`; height if direction is `column`)
123
108
  */
124
- size: PropTypes.string,
109
+ size?: string
110
+
125
111
  /**
126
112
  * Places dashed lines around the component's borders to help debug your layout
127
113
  */
114
+ withVisualDebug?: boolean
115
+ }
116
+
117
+ type PropKeys = keyof FlexItemOwnProps
118
+
119
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
120
+
121
+ type FlexItemProps = FlexItemOwnProps &
122
+ WithStyleProps<null, FlexItemStyle> &
123
+ OtherHTMLAttributes<FlexItemOwnProps>
124
+
125
+ type FlexItemStyle = ComponentStyle<'flexItem'>
126
+
127
+ const propTypes: PropValidators<PropKeys> = {
128
+ children: PropTypes.node,
129
+ as: PropTypes.elementType,
130
+ elementRef: PropTypes.func,
131
+ margin: ThemeablePropTypes.spacing,
132
+ padding: ThemeablePropTypes.spacing,
133
+ align: PropTypes.oneOf(['center', 'start', 'end', 'stretch']),
134
+ direction: PropTypes.oneOf(['row', 'column']),
135
+ textAlign: PropTypes.oneOf(['start', 'center', 'end']),
136
+ overflowX: PropTypes.oneOf(['auto', 'hidden', 'visible']),
137
+ overflowY: PropTypes.oneOf(['auto', 'hidden', 'visible']),
138
+ shouldGrow: PropTypes.bool,
139
+ shouldShrink: PropTypes.bool,
140
+ size: PropTypes.string,
128
141
  withVisualDebug: PropTypes.bool
129
142
  }
130
143
 
@@ -35,8 +35,7 @@ import type { FlexItemProps, FlexItemStyle } from './props'
35
35
  * @return {Object} The final style object, which will be used in the component
36
36
  */
37
37
  const generateStyle = (
38
- // @ts-expect-error no theme is used here
39
- componentTheme,
38
+ _componentTheme: null,
40
39
  props: FlexItemProps
41
40
  ): FlexItemStyle => {
42
41
  const { shouldGrow, shouldShrink, align, size } = props
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  /** @jsx jsx */
26
- import { Children, Component } from 'react'
26
+ import React, { Children, Component } from 'react'
27
27
 
28
28
  import {
29
29
  safeCloneElement,
@@ -35,6 +35,7 @@ import { View } from '@instructure/ui-view'
35
35
  import { withStyle, jsx } from '@instructure/emotion'
36
36
 
37
37
  import { Item } from './Item'
38
+ import type { FlexItemProps } from './Item/props'
38
39
 
39
40
  import generateStyle from './styles'
40
41
  import generateComponentTheme from './theme'
@@ -47,20 +48,18 @@ import type { FlexProps } from './props'
47
48
  category: components
48
49
  ---
49
50
  @module Flex
51
+ @tsProps
50
52
  **/
51
53
  @withStyle(generateStyle, generateComponentTheme)
52
54
  class Flex extends Component<FlexProps> {
53
55
  static readonly componentId = 'Flex'
54
56
 
55
- constructor(props: FlexProps) {
56
- super(props)
57
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
58
- props.makeStyles()
57
+ componentDidMount() {
58
+ this.props.makeStyles?.()
59
59
  }
60
60
 
61
61
  componentDidUpdate() {
62
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
63
- this.props.makeStyles()
62
+ this.props.makeStyles?.()
64
63
  }
65
64
 
66
65
  static Item = Item
@@ -68,10 +67,7 @@ class Flex extends Component<FlexProps> {
68
67
  static propTypes = propTypes
69
68
  static allowedProps = allowedProps
70
69
  static defaultProps = {
71
- children: null,
72
70
  as: 'span',
73
- // @ts-expect-error ts-migrate(6133) FIXME: 'el' is declared but its value is never read.
74
- elementRef: (el: any) => {},
75
71
  direction: 'row',
76
72
  justifyItems: 'start',
77
73
  display: 'flex',
@@ -91,18 +87,21 @@ class Flex extends Component<FlexProps> {
91
87
  }
92
88
  }
93
89
 
94
- renderChildren(children: any) {
90
+ renderChildren(children: FlexProps['children']) {
95
91
  return Children.map(children, (child) => {
96
92
  if (!child) {
97
93
  return null
98
94
  }
99
95
 
100
96
  return matchComponentTypes(child, ['Item'])
101
- ? safeCloneElement(child, {
97
+ ? safeCloneElement(child as React.ReactElement<FlexItemProps>, {
98
+ // child withVisualDebug prop should override parent
102
99
  withVisualDebug: this.props.withVisualDebug,
103
- ...child.props /* child withVisualDebug prop should override parent */,
104
- //@ts-expect-error FIXME:
105
- direction: this.props.direction.replace(/-reverse/, '')
100
+ ...(child as React.ReactElement<FlexItemProps>).props,
101
+ direction: this.props.direction!.replace(
102
+ /-reverse/,
103
+ ''
104
+ ) as FlexItemProps['direction']
106
105
  })
107
106
  : child
108
107
  })
package/src/Flex/props.ts CHANGED
@@ -22,6 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
+ import React from 'react'
25
26
  import PropTypes from 'prop-types'
26
27
 
27
28
  import { ThemeablePropTypes } from '@instructure/emotion'
@@ -39,19 +40,83 @@ import type {
39
40
  } from '@instructure/emotion'
40
41
 
41
42
  type FlexOwnProps = {
42
- children?: React.ReactNode | ((...args: any[]) => React.ReactNode)
43
+ /**
44
+ * It's recommended that you use `Flex.Item` for children, but you can also
45
+ * pass any markup or a function returning markup.
46
+ *
47
+ * Note that if you do not use `Flex.Item`, the `withVisualDebug` and
48
+ * `direction` props will not automatically be set on the children.
49
+ */
50
+ children?: React.ReactNode | (() => React.ReactNode)
51
+
52
+ /**
53
+ * the element type to render as
54
+ */
43
55
  as?: AsElementType
56
+
57
+ /**
58
+ * provides a reference to the underlying html root element
59
+ */
44
60
  elementRef?: (element: Element | null) => void
61
+
62
+ /**
63
+ * Sets the height of the component's container (optional)
64
+ */
45
65
  height?: string | number
66
+
67
+ /**
68
+ * Sets the width of the component's container (optional)
69
+ */
46
70
  width?: string | number
71
+
72
+ /**
73
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
74
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
75
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
76
+ */
47
77
  margin?: Spacing
78
+
79
+ /**
80
+ * Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
81
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
82
+ * familiar CSS-like shorthand. For example: `padding="small x-large large"`.
83
+ */
48
84
  padding?: Spacing
85
+
86
+ /**
87
+ * Sets the CSS display rule for the component's container
88
+ */
49
89
  display?: 'flex' | 'inline-flex'
90
+
91
+ /**
92
+ * Designates the text alignment
93
+ */
50
94
  textAlign?: 'start' | 'center' | 'end'
95
+
96
+ /**
97
+ * Sets the flex-direction to row (horizontal) or column (vertical)
98
+ */
51
99
  direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'
100
+
101
+ /**
102
+ * Aligns Flex.Items on the vertical axis (horizontal if direction is column)
103
+ */
52
104
  alignItems?: 'center' | 'start' | 'end' | 'stretch'
105
+
106
+ /**
107
+ * Aligns Flex.Items on the horizontal axis (vertical if direction is column)
108
+ */
53
109
  justifyItems?: 'center' | 'start' | 'end' | 'space-around' | 'space-between'
110
+
111
+ /**
112
+ * Determines if the Flex.Items should wrap when they exceed their container's width
113
+ */
54
114
  wrap?: 'wrap' | 'no-wrap' | 'wrap-reverse'
115
+
116
+ /**
117
+ * Activate a dotted outline around the component to make building your
118
+ * layout easier
119
+ */
55
120
  withVisualDebug?: boolean
56
121
  }
57
122
 
@@ -66,64 +131,22 @@ type FlexProps = FlexOwnProps &
66
131
  type FlexStyle = ComponentStyle<'flex'>
67
132
 
68
133
  const propTypes: PropValidators<PropKeys> = {
69
- /**
70
- * It's recommended that you use `Flex.Item` for children, but you can also pass any markup or a function
71
- * returning markup. Note that if you do not use `Flex.Item`, the `withVisualDebug` and `direction` props
72
- * will not automatically be set on the children.
73
- */
74
134
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
75
- /**
76
- * the element type to render as
77
- */
78
135
  as: PropTypes.elementType,
79
- /**
80
- * provides a reference to the underlying html root element
81
- */
82
136
  elementRef: PropTypes.func,
83
- /**
84
- * Sets the height of the component's container (optional)
85
- */
86
137
  height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
87
- /**
88
- * Sets the width of the component's container (optional)
89
- */
90
138
  width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
91
- /**
92
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
93
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
94
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
95
- */
96
139
  margin: ThemeablePropTypes.spacing,
97
- /**
98
- * Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
99
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
100
- * familiar CSS-like shorthand. For example: `padding="small x-large large"`.
101
- */
102
140
  padding: ThemeablePropTypes.spacing,
103
- /**
104
- * Sets the CSS display rule for the component's container
105
- */
106
141
  display: PropTypes.oneOf(['flex', 'inline-flex']),
107
- /**
108
- * Designates the text alignment
109
- */
110
142
  textAlign: PropTypes.oneOf(['start', 'center', 'end']),
111
- /**
112
- * Sets the flex-direction to row (horizontal) or column (vertical)
113
- */
114
143
  direction: PropTypes.oneOf([
115
144
  'row',
116
145
  'column',
117
146
  'row-reverse',
118
147
  'column-reverse'
119
148
  ]),
120
- /**
121
- * Aligns Flex.Items on the vertical axis (horizontal if direction is column)
122
- */
123
149
  alignItems: PropTypes.oneOf(['center', 'start', 'end', 'stretch']),
124
- /**
125
- * Aligns Flex.Items on the horizontal axis (vertical if direction is column)
126
- */
127
150
  justifyItems: PropTypes.oneOf([
128
151
  'center',
129
152
  'start',
@@ -131,14 +154,7 @@ const propTypes: PropValidators<PropKeys> = {
131
154
  'space-around',
132
155
  'space-between'
133
156
  ]),
134
- /**
135
- * Determines if the Flex.Items should wrap when they exceed their container's width
136
- */
137
157
  wrap: PropTypes.oneOf(['wrap', 'no-wrap', 'wrap-reverse']),
138
- /**
139
- * Activate a dotted outline around the component to make building your
140
- * layout easier
141
- */
142
158
  withVisualDebug: PropTypes.bool
143
159
  }
144
160
 
@@ -7,6 +7,7 @@ import type { FlexItemProps } from './props';
7
7
  parent: Flex
8
8
  id: Flex.Item
9
9
  ---
10
+ @tsProps
10
11
  **/
11
12
  declare class Item extends Component<FlexItemProps> {
12
13
  static readonly componentId = "Flex.Item";
@@ -46,7 +47,6 @@ declare class Item extends Component<FlexItemProps> {
46
47
  })[];
47
48
  static defaultProps: {
48
49
  as: string;
49
- elementRef: (el: any) => void;
50
50
  shouldGrow: boolean;
51
51
  shouldShrink: boolean;
52
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Flex/Item/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,iBAAiB;IAKjB,kBAAkB;IAKlB,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;yBAGA,GAAG;;;MAGrB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,MAAM;CAuCP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Flex/Item/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;;GAMG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;MAIlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,MAAM;CAuCP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -2,19 +2,65 @@ import React from 'react';
2
2
  import type { AsElementType, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
3
3
  import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  declare type FlexItemOwnProps = {
5
+ /**
6
+ * The children to render inside the Item
7
+ */
5
8
  children?: React.ReactNode;
9
+ /**
10
+ * the element type to render as
11
+ */
6
12
  as?: AsElementType;
13
+ /**
14
+ * provides a reference to the underlying html root element
15
+ */
7
16
  elementRef?: (element: Element | null) => void;
17
+ /**
18
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
19
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
20
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
21
+ */
8
22
  margin?: Spacing;
23
+ /**
24
+ * Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
25
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
26
+ * familiar CSS-like shorthand. For example: `padding="small x-large large"`.
27
+ */
9
28
  padding?: Spacing;
29
+ /**
30
+ * overrides the parent Flex's alignItems prop, if needed
31
+ */
10
32
  align?: 'center' | 'start' | 'end' | 'stretch';
33
+ /**
34
+ * Inherits from the parent Flex component
35
+ */
11
36
  direction?: 'row' | 'column';
37
+ /**
38
+ * Designates the text alignment inside the Item
39
+ */
12
40
  textAlign?: 'start' | 'center' | 'end';
41
+ /**
42
+ * Handles horizontal overflow
43
+ */
13
44
  overflowX?: 'auto' | 'hidden' | 'visible';
45
+ /**
46
+ * Handles vertical overflow
47
+ */
14
48
  overflowY?: 'auto' | 'hidden' | 'visible';
49
+ /**
50
+ * Should the FlexItem grow to fill any available space?
51
+ */
15
52
  shouldGrow?: boolean;
53
+ /**
54
+ * Should the FlexItem shrink (stopping at its `size`)?
55
+ */
16
56
  shouldShrink?: boolean;
57
+ /**
58
+ * Sets the base size of the FlexItem (width if direction is `row`; height if direction is `column`)
59
+ */
17
60
  size?: string;
61
+ /**
62
+ * Places dashed lines around the component's borders to help debug your layout
63
+ */
18
64
  withVisualDebug?: boolean;
19
65
  };
20
66
  declare type PropKeys = keyof FlexItemOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Flex/Item/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,aAAK,gBAAgB,GA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,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,aAAa,GAAG,gBAAgB,GACnC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,GACnC,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;AAEvC,aAAK,aAAa,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAE/C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAevC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -9,6 +9,6 @@ import type { FlexItemProps, FlexItemStyle } from './props';
9
9
  * @param {Object} state the state of the component, the style is applied to
10
10
  * @return {Object} The final style object, which will be used in the component
11
11
  */
12
- declare const generateStyle: (componentTheme: any, props: FlexItemProps) => FlexItemStyle;
12
+ declare const generateStyle: (_componentTheme: null, props: FlexItemProps) => FlexItemStyle;
13
13
  export default generateStyle;
14
14
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Flex/Item/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE3D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,+BAGV,aAAa,KACnB,aAuBF,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Flex/Item/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE3D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,oBACA,IAAI,SACd,aAAa,KACnB,aAuBF,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
2
+ import React, { Component } from 'react';
3
3
  import { jsx } from '@instructure/emotion';
4
4
  import { Item } from './Item';
5
5
  import type { FlexProps } from './props';
@@ -8,22 +8,18 @@ import type { FlexProps } from './props';
8
8
  category: components
9
9
  ---
10
10
  @module Flex
11
+ @tsProps
11
12
  **/
12
13
  declare class Flex extends Component<FlexProps> {
13
14
  static readonly componentId = "Flex";
14
- constructor(props: FlexProps);
15
+ componentDidMount(): void;
15
16
  componentDidUpdate(): void;
16
17
  static Item: typeof Item;
17
18
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
18
- children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
19
+ children?: React.ReactNode | (() => React.ReactNode);
19
20
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
20
21
  elementRef?: ((element: Element | null) => void) | undefined;
21
- height?: string | number | undefined; /**
22
- ---
23
- category: components
24
- ---
25
- @module Flex
26
- **/
22
+ height?: string | number | undefined;
27
23
  width?: string | number | undefined;
28
24
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
29
25
  padding?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
@@ -36,15 +32,10 @@ declare class Flex extends Component<FlexProps> {
36
32
  withVisualDebug?: boolean | undefined;
37
33
  }>;
38
34
  static allowedProps: readonly (keyof {
39
- children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
35
+ children?: React.ReactNode | (() => React.ReactNode);
40
36
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
41
37
  elementRef?: ((element: Element | null) => void) | undefined;
42
- height?: string | number | undefined; /**
43
- ---
44
- category: components
45
- ---
46
- @module Flex
47
- **/
38
+ height?: string | number | undefined;
48
39
  width?: string | number | undefined;
49
40
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
50
41
  padding?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
@@ -57,9 +48,7 @@ declare class Flex extends Component<FlexProps> {
57
48
  withVisualDebug?: boolean | undefined;
58
49
  })[];
59
50
  static defaultProps: {
60
- children: null;
61
51
  as: string;
62
- elementRef: (el: any) => void;
63
52
  direction: string;
64
53
  justifyItems: string;
65
54
  display: string;
@@ -68,7 +57,7 @@ declare class Flex extends Component<FlexProps> {
68
57
  };
69
58
  ref: Element | null;
70
59
  handleRef: (el: Element | null) => void;
71
- renderChildren(children: any): any;
60
+ renderChildren(children: FlexProps['children']): {}[] | null | undefined;
72
61
  render(): jsx.JSX.Element | null;
73
62
  }
74
63
  export default Flex;