@instructure/ui-flex 8.13.0 → 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.
@@ -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;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Flex/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAS3C,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAM7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;gBAExB,KAAK,EAAE,SAAS;IAM5B,kBAAkB;IAKlB,MAAM,CAAC,IAAI,cAAO;IAElB,MAAM,CAAC,SAAS;;;;8CAvBlB;;;;;WAKG;;;;;;;;;;;OAkB2B;IAC5B,MAAM,CAAC,YAAY;;;;8CAxBrB;;;;;WAKG;;;;;;;;;;;SAmBiC;IAClC,MAAM,CAAC,YAAY;;;yBAIA,GAAG;;;;;;MAMrB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,cAAc,CAAC,QAAQ,EAAE,GAAG;IAiB5B,MAAM;CAqCP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Flex/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AASlD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAO7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;;GAMG;AACH,cACM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM,CAAC,IAAI,cAAO;IAElB,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;MAOlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC;IAoB9C,MAAM;CAqCP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,CAAA"}
@@ -1,20 +1,71 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { AsElementType, PropValidators, FlexTheme, OtherHTMLAttributes } from '@instructure/shared-types';
3
3
  import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  declare type FlexOwnProps = {
5
- children?: React.ReactNode | ((...args: any[]) => React.ReactNode);
5
+ /**
6
+ * It's recommended that you use `Flex.Item` for children, but you can also
7
+ * pass any markup or a function returning markup.
8
+ *
9
+ * Note that if you do not use `Flex.Item`, the `withVisualDebug` and
10
+ * `direction` props will not automatically be set on the children.
11
+ */
12
+ children?: React.ReactNode | (() => React.ReactNode);
13
+ /**
14
+ * the element type to render as
15
+ */
6
16
  as?: AsElementType;
17
+ /**
18
+ * provides a reference to the underlying html root element
19
+ */
7
20
  elementRef?: (element: Element | null) => void;
21
+ /**
22
+ * Sets the height of the component's container (optional)
23
+ */
8
24
  height?: string | number;
25
+ /**
26
+ * Sets the width of the component's container (optional)
27
+ */
9
28
  width?: string | number;
29
+ /**
30
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
31
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
32
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
33
+ */
10
34
  margin?: Spacing;
35
+ /**
36
+ * Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
37
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
38
+ * familiar CSS-like shorthand. For example: `padding="small x-large large"`.
39
+ */
11
40
  padding?: Spacing;
41
+ /**
42
+ * Sets the CSS display rule for the component's container
43
+ */
12
44
  display?: 'flex' | 'inline-flex';
45
+ /**
46
+ * Designates the text alignment
47
+ */
13
48
  textAlign?: 'start' | 'center' | 'end';
49
+ /**
50
+ * Sets the flex-direction to row (horizontal) or column (vertical)
51
+ */
14
52
  direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
53
+ /**
54
+ * Aligns Flex.Items on the vertical axis (horizontal if direction is column)
55
+ */
15
56
  alignItems?: 'center' | 'start' | 'end' | 'stretch';
57
+ /**
58
+ * Aligns Flex.Items on the horizontal axis (vertical if direction is column)
59
+ */
16
60
  justifyItems?: 'center' | 'start' | 'end' | 'space-around' | 'space-between';
61
+ /**
62
+ * Determines if the Flex.Items should wrap when they exceed their container's width
63
+ */
17
64
  wrap?: 'wrap' | 'no-wrap' | 'wrap-reverse';
65
+ /**
66
+ * Activate a dotted outline around the component to make building your
67
+ * layout easier
68
+ */
18
69
  withVisualDebug?: boolean;
19
70
  };
20
71
  declare type PropKeys = keyof FlexOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Flex/props.ts"],"names":[],"mappings":";AA4BA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,aAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAClE,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;IAChC,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAA;IAC/D,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAA;IACnD,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK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