@instructure/ui-billboard 8.14.0 → 8.14.1-snapshot.5

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,39 +1,41 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
2
+ import { Component, MouseEvent } from 'react';
3
3
  import { jsx } from '@instructure/emotion';
4
- import type { BillboardProps } from './props';
4
+ import type { BillboardProps, HeroIconSize } from './props';
5
+ import type { ViewProps } from '@instructure/ui-view';
5
6
  /**
6
7
  ---
7
8
  category: components
8
9
  ---
10
+ @tsProps
9
11
  **/
10
12
  declare class Billboard extends Component<BillboardProps> {
11
13
  static readonly componentId = "Billboard";
12
14
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
13
- hero?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((...args: any[]) => any) | undefined;
14
- size?: "small" | "medium" | "large" | undefined;
15
+ hero?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((iconSize: HeroIconSize) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | undefined;
16
+ size?: "medium" | "large" | "small" | undefined;
15
17
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
16
18
  elementRef?: ((element: Element | null) => void) | undefined;
17
19
  heading?: string | undefined;
18
20
  headingAs?: "h1" | "h2" | "h3" | "span" | undefined;
19
21
  headingLevel?: "h1" | "h2" | "h3" | "h4" | undefined;
20
- message?: import("react").ReactNode | ((...args: any[]) => any);
21
- onClick?: ((...args: any[]) => any) | undefined;
22
+ message?: import("react").ReactNode | (() => import("react").ReactNode);
23
+ onClick?: ((e: MouseEvent<ViewProps, globalThis.MouseEvent>) => void) | undefined;
22
24
  href?: string | undefined;
23
25
  disabled?: boolean | undefined;
24
26
  readOnly?: boolean | undefined;
25
27
  margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
26
28
  }>;
27
29
  static allowedProps: readonly (keyof {
28
- hero?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((...args: any[]) => any) | undefined;
29
- size?: "small" | "medium" | "large" | undefined;
30
+ hero?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((iconSize: HeroIconSize) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | undefined;
31
+ size?: "medium" | "large" | "small" | undefined;
30
32
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
31
33
  elementRef?: ((element: Element | null) => void) | undefined;
32
34
  heading?: string | undefined;
33
35
  headingAs?: "h1" | "h2" | "h3" | "span" | undefined;
34
36
  headingLevel?: "h1" | "h2" | "h3" | "h4" | undefined;
35
- message?: import("react").ReactNode | ((...args: any[]) => any);
36
- onClick?: ((...args: any[]) => any) | undefined;
37
+ message?: import("react").ReactNode | (() => import("react").ReactNode);
38
+ onClick?: ((e: MouseEvent<ViewProps, globalThis.MouseEvent>) => void) | undefined;
37
39
  href?: string | undefined;
38
40
  disabled?: boolean | undefined;
39
41
  readOnly?: boolean | undefined;
@@ -51,13 +53,12 @@ declare class Billboard extends Component<BillboardProps> {
51
53
  ref: Element | null;
52
54
  handleRef: (el: Element | null) => void;
53
55
  componentDidMount(): void;
54
- componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
56
+ componentDidUpdate(): void;
55
57
  renderHeading(): jsx.JSX.Element;
56
- get heroIsFunction(): boolean;
57
- get SVGIconSize(): "medium" | "large" | "x-large";
58
- renderHero(): any;
58
+ get SVGIconSize(): HeroIconSize;
59
+ renderHero(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
59
60
  renderContent(): jsx.JSX.Element;
60
- handleClick: (e: any) => void;
61
+ handleClick: (e: MouseEvent<ViewProps>) => void;
61
62
  render(): jsx.JSX.Element;
62
63
  }
63
64
  export default Billboard;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Billboard/index.tsx"],"names":[],"mappings":"AA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OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;MAQT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,aAAa;IAYb,IAAI,WAAW,IAAI,YAAY,CAW9B;IAED,UAAU;IAQV,aAAa;IAcb,WAAW,MAAO,WAAW,SAAS,CAAC,KAAG,IAAI,CAS7C;IAED,MAAM;CA0BP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,19 +1,66 @@
1
- /// <reference types="react" />
2
1
  import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
3
2
  import type { AsElementType, BillboardTheme, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
3
+ import type { ViewProps } from '@instructure/ui-view';
4
+ import React, { MouseEvent } from 'react';
5
+ declare type HeroIconSize = 'medium' | 'x-large' | 'large';
4
6
  declare type BillboardOwnProps = {
5
- hero?: React.ReactElement | ((...args: any[]) => any);
7
+ /**
8
+ * Provide an <Img> component or Instructure Icon for the hero image
9
+ */
10
+ hero?: React.ReactElement | ((iconSize: HeroIconSize) => React.ReactElement);
11
+ /**
12
+ * If you're using an icon, this prop will size it. Also sets the font-size
13
+ * of the headline and message.
14
+ */
6
15
  size?: 'small' | 'medium' | 'large';
16
+ /**
17
+ * the element type to render as
18
+ */
7
19
  as?: AsElementType;
20
+ /**
21
+ * provides a reference to the underlying html root element
22
+ */
8
23
  elementRef?: (element: Element | null) => void;
24
+ /**
25
+ * The headline for the Billboard. Is styled as an h1 element by default
26
+ */
9
27
  heading?: string;
28
+ /**
29
+ * Choose the appropriately semantic tag for the heading
30
+ */
10
31
  headingAs?: 'h1' | 'h2' | 'h3' | 'span';
32
+ /**
33
+ * Choose the font-size for the heading (see the Heading component)
34
+ */
11
35
  headingLevel?: 'h1' | 'h2' | 'h3' | 'h4';
12
- message?: React.ReactNode | ((...args: any[]) => any);
13
- onClick?: (...args: any[]) => any;
36
+ /**
37
+ * Instructions or information for the Billboard. Note: you should not pass
38
+ * interactive content to this prop if you are also providing an `href` or
39
+ * `onClick`. That would cause the Billboard to render as a button or link
40
+ * and would result in nested interactive content.
41
+ */
42
+ message?: React.ReactNode | (() => React.ReactNode);
43
+ /**
44
+ * If you add an onClick prop, the Billboard renders as a clickable button
45
+ */
46
+ onClick?: (e: MouseEvent<ViewProps>) => void;
47
+ /**
48
+ * If `href` is provided, Billboard will render as a link
49
+ */
14
50
  href?: string;
51
+ /**
52
+ * Whether or not to disable the billboard
53
+ */
15
54
  disabled?: boolean;
55
+ /**
56
+ * Works just like disabled but keeps the same styles as if it were active
57
+ */
16
58
  readOnly?: boolean;
59
+ /**
60
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
61
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
62
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
63
+ */
17
64
  margin?: Spacing;
18
65
  };
19
66
  declare type PropKeys = keyof BillboardOwnProps;
@@ -22,6 +69,6 @@ declare type BillboardProps = BillboardOwnProps & WithStyleProps<BillboardTheme,
22
69
  declare type BillboardStyle = ComponentStyle<'billboard' | 'content' | 'hero' | 'heading' | 'message'>;
23
70
  declare const propTypes: PropValidators<PropKeys>;
24
71
  declare const allowedProps: AllowedPropKeys;
25
- export type { BillboardProps, BillboardStyle };
72
+ export type { BillboardProps, BillboardStyle, HeroIconSize };
26
73
  export { propTypes, allowedProps };
27
74
  //# sourceMappingURL=props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Billboard/props.ts"],"names":[],"mappings":";AA4BA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,aA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