@react-spectrum/inlinealert 3.0.0-rc.0 → 3.0.0

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.
@@ -12,19 +12,30 @@
12
12
 
13
13
  import AlertMedium from '@spectrum-icons/ui/AlertMedium';
14
14
  import {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';
15
- import {DOMRef} from '@react-types/shared';
15
+ import {DOMProps, DOMRef, StyleProps} from '@react-types/shared';
16
16
  import {filterDOMProps} from '@react-aria/utils';
17
17
  import {Grid} from '@react-spectrum/layout';
18
18
  import InfoMedium from '@spectrum-icons/ui/InfoMedium';
19
19
  // @ts-ignore
20
20
  import intlMessages from '../intl/*.json';
21
- import React from 'react';
22
- import {SpectrumInlineAlertProps} from '@react-types/inlinealert';
21
+ import React, {ReactNode} from 'react';
23
22
  import styles from '@adobe/spectrum-css-temp/components/inlinealert/vars.css';
24
23
  import SuccessMedium from '@spectrum-icons/ui/SuccessMedium';
25
24
  import {useLocalizedStringFormatter} from '@react-aria/i18n';
26
25
  import {useProviderProps} from '@react-spectrum/provider';
27
26
 
27
+ export interface SpectrumInlineAlertProps extends DOMProps, StyleProps {
28
+ /**
29
+ * The [visual style](https://spectrum.adobe.com/page/in-line-alert/#Options) of the Inline Alert.
30
+ * @default 'neutral'
31
+ */
32
+ variant?: 'neutral' | 'info' | 'positive' | 'notice' | 'negative',
33
+ /**
34
+ * The contents of the Inline Alert.
35
+ */
36
+ children: ReactNode
37
+ }
38
+
28
39
  let ICONS = {
29
40
  info: InfoMedium,
30
41
  positive: SuccessMedium,
@@ -44,7 +55,7 @@ function InlineAlert(props: SpectrumInlineAlertProps, ref: DOMRef<HTMLDivElement
44
55
  let domRef = useDOMRef(ref);
45
56
 
46
57
  let slots = {
47
- header: {UNSAFE_className: styles['spectrum-InLineAlert-header']},
58
+ heading: {UNSAFE_className: styles['spectrum-InLineAlert-heading']},
48
59
  content: {UNSAFE_className: styles['spectrum-InLineAlert-content']}
49
60
  };
50
61
 
package/src/index.ts CHANGED
@@ -13,3 +13,4 @@
13
13
  /// <reference types="css-module-types" />
14
14
 
15
15
  export {InlineAlert} from './InlineAlert';
16
+ export type {SpectrumInlineAlertProps} from './InlineAlert';