@dfds-ui/react-components 1.0.0 → 1.0.1-alpha.b9b3748c

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,7 @@
1
- import React from 'react';
1
+ import React, { ElementType, FunctionComponent, ReactNode } from 'react';
2
2
  import { Intent } from '../../common/intent';
3
+ export declare type BannerVariant = 'lowEmphasis' | 'mediumEmphasis' | 'highEmphasis' | 'default' | 'inverted';
4
+ export declare type BannerStickyPosition = 'top' | 'bottom';
3
5
  export declare type BannerProps = {
4
6
  /**
5
7
  * Specifies the intent of the Banner (change the color of the banner icon to match intended status)
@@ -8,7 +10,7 @@ export declare type BannerProps = {
8
10
  /**
9
11
  * Actions to be displayed inside the banner
10
12
  */
11
- actions?: React.ReactNode;
13
+ actions?: ReactNode;
12
14
  /**
13
15
  * Class name to be added to the banner
14
16
  */
@@ -23,8 +25,10 @@ export declare type BannerProps = {
23
25
  closeLabel?: string;
24
26
  /**
25
27
  * Specifies the variation of the banner.
28
+ *
29
+ * `default` and `inverted` variants are deprecated
26
30
  */
27
- variant?: 'default' | 'inverted';
31
+ variant?: BannerVariant;
28
32
  /**
29
33
  * Specifies if the Banner should be displayed with `position: fixed;`
30
34
  *
@@ -34,19 +38,33 @@ export declare type BannerProps = {
34
38
  /**
35
39
  * Specifies the position of the Sticky Banner.
36
40
  */
37
- stickyPosition?: 'top' | 'bottom';
41
+ stickyPosition?: BannerStickyPosition;
38
42
  /**
39
- * Specifies if the Banner should have a border/divider at the bottom`
43
+ * Specifies if the Banner should have a border/divider at the bottom.
40
44
  */
41
45
  divider?: boolean;
42
46
  /**
43
47
  * Specify a custom icon to replace the one derived from `intent`
44
48
  *
45
- * @type {React.ElementType<{ className?: string }>}
49
+ * @type {ElementType<{ className?: string }>}
46
50
  */
47
- icon?: React.ElementType<{
51
+ icon?: ElementType<{
48
52
  className?: string;
49
53
  }>;
54
+ /**
55
+ * Specifies if the actions should always appear below the content
56
+ */
57
+ wrapActions?: boolean;
58
+ /**
59
+ * Content of the Banner
60
+ */
61
+ children?: ReactNode;
50
62
  };
51
- declare const Banner: React.FunctionComponent<BannerProps>;
63
+ interface BannerContextInterface {
64
+ intent: NonNullable<BannerProps['intent']>;
65
+ variant: NonNullable<BannerProps['variant']>;
66
+ }
67
+ export declare const BannerContext: React.Context<BannerContextInterface | undefined>;
68
+ export declare const useBannerContext: () => BannerContextInterface;
69
+ export declare const Banner: FunctionComponent<BannerProps>;
52
70
  export default Banner;