@fluentui/react-alert 9.0.0-beta.7 → 9.0.0-beta.71

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.
Files changed (44) hide show
  1. package/CHANGELOG.json +2273 -4
  2. package/CHANGELOG.md +780 -5
  3. package/README.md +1 -1
  4. package/dist/index.d.ts +6 -1
  5. package/lib/Alert.js +0 -1
  6. package/lib/Alert.js.map +1 -1
  7. package/lib/components/Alert/Alert.js +5 -8
  8. package/lib/components/Alert/Alert.js.map +1 -1
  9. package/lib/components/Alert/Alert.types.js +1 -2
  10. package/lib/components/Alert/Alert.types.js.map +1 -1
  11. package/lib/components/Alert/index.js +1 -2
  12. package/lib/components/Alert/index.js.map +1 -1
  13. package/lib/components/Alert/renderAlert.js +5 -13
  14. package/lib/components/Alert/renderAlert.js.map +1 -1
  15. package/lib/components/Alert/useAlert.js +60 -67
  16. package/lib/components/Alert/useAlert.js.map +1 -1
  17. package/lib/components/Alert/useAlertStyles.styles.js +137 -0
  18. package/lib/components/Alert/useAlertStyles.styles.js.map +1 -0
  19. package/lib/index.js +0 -1
  20. package/lib/index.js.map +1 -1
  21. package/lib-commonjs/Alert.js +3 -7
  22. package/lib-commonjs/Alert.js.map +1 -1
  23. package/lib-commonjs/components/Alert/Alert.js +15 -23
  24. package/lib-commonjs/components/Alert/Alert.js.map +1 -1
  25. package/lib-commonjs/components/Alert/Alert.types.js +1 -3
  26. package/lib-commonjs/components/Alert/Alert.types.js.map +1 -1
  27. package/lib-commonjs/components/Alert/index.js +7 -15
  28. package/lib-commonjs/components/Alert/index.js.map +1 -1
  29. package/lib-commonjs/components/Alert/renderAlert.js +11 -22
  30. package/lib-commonjs/components/Alert/renderAlert.js.map +1 -1
  31. package/lib-commonjs/components/Alert/useAlert.js +70 -90
  32. package/lib-commonjs/components/Alert/useAlert.js.map +1 -1
  33. package/lib-commonjs/components/Alert/useAlertStyles.styles.js +276 -0
  34. package/lib-commonjs/components/Alert/useAlertStyles.styles.js.map +1 -0
  35. package/lib-commonjs/index.js +14 -36
  36. package/lib-commonjs/index.js.map +1 -1
  37. package/package.json +32 -20
  38. package/Migration.md +0 -0
  39. package/Spec.md +0 -97
  40. package/dist/tsdoc-metadata.json +0 -11
  41. package/lib/components/Alert/useAlertStyles.js +0 -99
  42. package/lib/components/Alert/useAlertStyles.js.map +0 -1
  43. package/lib-commonjs/components/Alert/useAlertStyles.js +0 -110
  44. package/lib-commonjs/components/Alert/useAlertStyles.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @fluentui/react-alert
2
2
 
3
- **React Alert component for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
3
+ **React Alert component for [Fluent UI React](https://react.fluentui.dev)**
4
4
 
5
5
  > WIP 🚧 - These are not production-ready components as we are still in a Beta phase.
6
6
  > See the [spec.md](./Spec.md) for usage and component API details
package/dist/index.d.ts CHANGED
@@ -26,6 +26,11 @@ export declare type AlertProps = ComponentProps<AlertSlots> & {
26
26
  * overrides the intent prop
27
27
  */
28
28
  intent?: 'info' | 'success' | 'error' | 'warning';
29
+ /**
30
+ * The appearance of the Alert.
31
+ * @default 'primary'
32
+ */
33
+ appearance?: 'primary' | 'inverted';
29
34
  };
30
35
 
31
36
  export declare type AlertSlots = {
@@ -50,7 +55,7 @@ export declare type AlertSlots = {
50
55
  /**
51
56
  * State used in rendering Alert
52
57
  */
53
- export declare type AlertState = ComponentState<AlertSlots> & Pick<AlertProps, 'intent'>;
58
+ export declare type AlertState = ComponentState<AlertSlots> & Pick<AlertProps, 'intent'> & Required<Pick<AlertProps, 'appearance'>>;
54
59
 
55
60
  export declare const renderAlert_unstable: (state: AlertState) => JSX.Element;
56
61
 
package/lib/Alert.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from './components/Alert/index';
2
- //# sourceMappingURL=Alert.js.map
package/lib/Alert.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sourceRoot":"../src/","sources":["Alert.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './components/Alert/index';\n"]}
1
+ {"version":3,"sources":["Alert.ts"],"sourcesContent":["export * from './components/Alert/index';\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B"}
@@ -1,16 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { renderAlert_unstable } from './renderAlert';
3
3
  import { useAlert_unstable } from './useAlert';
4
- import { useAlertStyles_unstable } from './useAlertStyles';
4
+ import { useAlertStyles_unstable } from './useAlertStyles.styles';
5
5
  /**
6
6
  * An Alert component displays a brief, important message to attract a user's attention
7
7
  * without interrupting their current task.
8
- */
9
-
10
- export const Alert = /*#__PURE__*/React.forwardRef((props, ref) => {
11
- const state = useAlert_unstable(props, ref);
12
- useAlertStyles_unstable(state);
13
- return renderAlert_unstable(state);
8
+ */ export const Alert = /*#__PURE__*/ React.forwardRef((props, ref)=>{
9
+ const state = useAlert_unstable(props, ref);
10
+ useAlertStyles_unstable(state);
11
+ return renderAlert_unstable(state);
14
12
  });
15
13
  Alert.displayName = 'Alert';
16
- //# sourceMappingURL=Alert.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,oBAAT,QAAqC,eAArC;AACA,SAAS,iBAAT,QAAkC,YAAlC;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AAKA;;;AAGG;;AACH,OAAO,MAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpF,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,CAA/B;EAEA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourcesContent":["import * as React from 'react';\n\nimport { renderAlert_unstable } from './renderAlert';\nimport { useAlert_unstable } from './useAlert';\nimport { useAlertStyles_unstable } from './useAlertStyles';\n\nimport type { AlertProps } from './Alert.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * An Alert component displays a brief, important message to attract a user's attention\n * without interrupting their current task.\n */\nexport const Alert: ForwardRefComponent<AlertProps> = React.forwardRef((props, ref) => {\n const state = useAlert_unstable(props, ref);\n\n useAlertStyles_unstable(state);\n return renderAlert_unstable(state);\n}) as ForwardRefComponent<AlertProps>;\n\nAlert.displayName = 'Alert';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["Alert.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { renderAlert_unstable } from './renderAlert';\nimport { useAlert_unstable } from './useAlert';\nimport { useAlertStyles_unstable } from './useAlertStyles.styles';\n\nimport type { AlertProps } from './Alert.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * An Alert component displays a brief, important message to attract a user's attention\n * without interrupting their current task.\n */\nexport const Alert: ForwardRefComponent<AlertProps> = React.forwardRef((props, ref) => {\n const state = useAlert_unstable(props, ref);\n\n useAlertStyles_unstable(state);\n return renderAlert_unstable(state);\n}) as ForwardRefComponent<AlertProps>;\n\nAlert.displayName = 'Alert';\n"],"names":["React","renderAlert_unstable","useAlert_unstable","useAlertStyles_unstable","Alert","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,uBAAuB,QAAQ,0BAA0B;AAKlE;;;CAGC,GACD,OAAO,MAAMC,sBAAyCJ,MAAMK,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACrF,MAAMC,QAAQN,kBAAkBI,OAAOC;IAEvCJ,wBAAwBK;IACxB,OAAOP,qBAAqBO;AAC9B,GAAsC;AAEtCJ,MAAMK,WAAW,GAAG"}
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=Alert.types.js.map
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.types.js","sourceRoot":"../src/","sources":["components/Alert/Alert.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\n\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AlertSlots = {\n /**\n * The root slot is the top level container for the alert component\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The icon slot renders the icon determined by the `icon` or `intent` prop\n */\n icon?: Slot<'span'>;\n /**\n * The action slot renders a button that prompts the user to take action on the alert\n */\n action?: Slot<typeof Button>;\n /**\n * The avatar slot renders an avatar before the contents of the alert\n */\n avatar?: Slot<typeof Avatar>;\n};\n\n/**\n * Alert Props\n */\nexport type AlertProps = ComponentProps<AlertSlots> & {\n /**\n * The intent prop, if present, determines the icon to be rendered in the icon slot. The icon prop\n * overrides the intent prop\n */\n intent?: 'info' | 'success' | 'error' | 'warning';\n};\n\n/**\n * State used in rendering Alert\n */\nexport type AlertState = ComponentState<AlertSlots> & Pick<AlertProps, 'intent'>;\n"]}
1
+ {"version":3,"sources":["Alert.types.ts"],"sourcesContent":["import { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\n\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AlertSlots = {\n /**\n * The root slot is the top level container for the alert component\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The icon slot renders the icon determined by the `icon` or `intent` prop\n */\n icon?: Slot<'span'>;\n /**\n * The action slot renders a button that prompts the user to take action on the alert\n */\n action?: Slot<typeof Button>;\n /**\n * The avatar slot renders an avatar before the contents of the alert\n */\n avatar?: Slot<typeof Avatar>;\n};\n\n/**\n * Alert Props\n */\nexport type AlertProps = ComponentProps<AlertSlots> & {\n /**\n * The intent prop, if present, determines the icon to be rendered in the icon slot. The icon prop\n * overrides the intent prop\n */\n intent?: 'info' | 'success' | 'error' | 'warning';\n /**\n * The appearance of the Alert.\n * @default 'primary'\n */\n appearance?: 'primary' | 'inverted';\n};\n\n/**\n * State used in rendering Alert\n */\nexport type AlertState = ComponentState<AlertSlots> &\n Pick<AlertProps, 'intent'> &\n Required<Pick<AlertProps, 'appearance'>>;\n"],"names":[],"mappings":"AAAA,WA6C2C"}
@@ -2,5 +2,4 @@ export * from './Alert';
2
2
  export * from './Alert.types';
3
3
  export * from './renderAlert';
4
4
  export * from './useAlert';
5
- export * from './useAlertStyles';
6
- //# sourceMappingURL=index.js.map
5
+ export * from './useAlertStyles.styles';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Alert/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './Alert';\nexport * from './Alert.types';\nexport * from './renderAlert';\nexport * from './useAlert';\nexport * from './useAlertStyles';\n"]}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Alert';\nexport * from './Alert.types';\nexport * from './renderAlert';\nexport * from './useAlert';\nexport * from './useAlertStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,aAAa;AAC3B,cAAc,0BAA0B"}
@@ -1,14 +1,6 @@
1
- import * as React from 'react';
2
- import { getSlots } from '@fluentui/react-utilities';
3
- export const renderAlert_unstable = state => {
4
- const {
5
- slots,
6
- slotProps
7
- } = getSlots(state);
8
- return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
9
- }, slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
10
- }), slots.avatar && /*#__PURE__*/React.createElement(slots.avatar, { ...slotProps.avatar
11
- }), slotProps.root.children, slots.action && /*#__PURE__*/React.createElement(slots.action, { ...slotProps.action
12
- }));
1
+ /** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
2
+ import { assertSlots } from '@fluentui/react-utilities';
3
+ export const renderAlert_unstable = (state)=>{
4
+ assertSlots(state);
5
+ return /*#__PURE__*/ createElement(state.root, null, state.icon && /*#__PURE__*/ createElement(state.icon, null), state.avatar && /*#__PURE__*/ createElement(state.avatar, null), state.root.children, state.action && /*#__PURE__*/ createElement(state.action, null));
13
6
  };
14
- //# sourceMappingURL=renderAlert.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Alert/renderAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,QAAT,QAAyB,2BAAzB;AAIA,OAAO,MAAM,oBAAoB,GAAI,KAAD,IAAsB;EACxD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAa,KAAb,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADjB,EAEG,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAFnB,EAGG,SAAS,CAAC,IAAV,CAAe,QAHlB,EAIG,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAJnB,CADF;AAQD,CAXM","sourcesContent":["import * as React from 'react';\n\nimport { getSlots } from '@fluentui/react-utilities';\n\nimport type { AlertState, AlertSlots } from './Alert.types';\n\nexport const renderAlert_unstable = (state: AlertState) => {\n const { slots, slotProps } = getSlots<AlertSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slots.avatar && <slots.avatar {...slotProps.avatar} />}\n {slotProps.root.children}\n {slots.action && <slots.action {...slotProps.action} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["renderAlert.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport type { AlertState, AlertSlots } from './Alert.types';\n\nexport const renderAlert_unstable = (state: AlertState) => {\n assertSlots<AlertSlots>(state);\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {state.avatar && <state.avatar />}\n {state.root.children}\n {state.action && <state.action />}\n </state.root>\n );\n};\n"],"names":["createElement","assertSlots","renderAlert_unstable","state","root","icon","avatar","children","action"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,WAAW,QAAQ,4BAA4B;AAIxD,OAAO,MAAMC,uBAAuB,CAACC,QAAsB;IACzDF,YAAwBE;IAExB,qBACE,AAXJ,cAWKA,MAAMC,IAAI,QACRD,MAAME,IAAI,kBAAI,AAZrB,cAYsBF,MAAME,IAAI,SACzBF,MAAMG,MAAM,kBAAI,AAbvB,cAawBH,MAAMG,MAAM,SAC7BH,MAAMC,IAAI,CAACG,QAAQ,EACnBJ,MAAMK,MAAM,kBAAI,AAfvB,cAewBL,MAAMK,MAAM;AAGpC,EAAE"}
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { Avatar } from '@fluentui/react-avatar';
3
3
  import { Button } from '@fluentui/react-button';
4
4
  import { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';
5
- import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
5
+ import { getNativeElementProps, slot } from '@fluentui/react-utilities';
6
6
  /**
7
7
  * Create the state required to render Alert.
8
8
  *
@@ -11,71 +11,64 @@ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utiliti
11
11
  *
12
12
  * @param props - props from this instance of Alert
13
13
  * @param ref - reference to root HTMLElement of Alert
14
- */
15
-
16
- export const useAlert_unstable = (props, ref) => {
17
- const {
18
- intent
19
- } = props;
20
- /** Determine the role and icon to render based on the intent */
21
-
22
- let defaultIcon;
23
- let defaultRole = 'status';
24
-
25
- switch (intent) {
26
- case 'success':
27
- defaultIcon = /*#__PURE__*/React.createElement(CheckmarkCircleFilled, null);
28
- break;
29
-
30
- case 'error':
31
- defaultIcon = /*#__PURE__*/React.createElement(DismissCircleFilled, null);
32
- defaultRole = 'alert';
33
- break;
34
-
35
- case 'warning':
36
- defaultIcon = /*#__PURE__*/React.createElement(WarningFilled, null);
37
- defaultRole = 'alert';
38
- break;
39
-
40
- case 'info':
41
- defaultIcon = /*#__PURE__*/React.createElement(InfoFilled, null);
42
- break;
43
- }
44
-
45
- const avatar = resolveShorthand(props.avatar);
46
- let icon;
47
- /** Avatar prop takes precedence over the icon or intent prop */
48
-
49
- if (!avatar) {
50
- icon = resolveShorthand(props.icon, {
51
- defaultProps: {
52
- children: defaultIcon
53
- },
54
- required: !!props.intent
14
+ */ export const useAlert_unstable = (props, ref)=>{
15
+ const { appearance ='primary' , intent } = props;
16
+ /** Determine the role and icon to render based on the intent */ let defaultIcon;
17
+ let defaultRole = 'status';
18
+ switch(intent){
19
+ case 'success':
20
+ defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);
21
+ break;
22
+ case 'error':
23
+ defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);
24
+ defaultRole = 'alert';
25
+ break;
26
+ case 'warning':
27
+ defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);
28
+ defaultRole = 'alert';
29
+ break;
30
+ case 'info':
31
+ defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);
32
+ break;
33
+ }
34
+ const action = slot.optional(props.action, {
35
+ defaultProps: {
36
+ appearance: 'transparent'
37
+ },
38
+ elementType: Button
55
39
  });
56
- }
57
-
58
- return {
59
- components: {
60
- root: 'div',
61
- icon: 'span',
62
- action: Button,
63
- avatar: Avatar
64
- },
65
- root: getNativeElementProps('div', {
66
- ref,
67
- role: defaultRole,
68
- children: props.children,
69
- ...props
70
- }),
71
- icon,
72
- avatar,
73
- action: resolveShorthand(props.action, {
74
- defaultProps: {
75
- appearance: 'transparent'
76
- }
77
- }),
78
- intent
79
- };
40
+ const avatar = slot.optional(props.avatar, {
41
+ elementType: Avatar
42
+ });
43
+ let icon;
44
+ /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {
45
+ icon = slot.optional(props.icon, {
46
+ defaultProps: {
47
+ children: defaultIcon
48
+ },
49
+ renderByDefault: !!props.intent,
50
+ elementType: 'span'
51
+ });
52
+ }
53
+ return {
54
+ action,
55
+ appearance,
56
+ avatar,
57
+ components: {
58
+ root: 'div',
59
+ icon: 'span',
60
+ action: Button,
61
+ avatar: Avatar
62
+ },
63
+ icon,
64
+ intent,
65
+ root: slot.always(getNativeElementProps('div', {
66
+ ref,
67
+ role: defaultRole,
68
+ children: props.children,
69
+ ...props
70
+ }), {
71
+ elementType: 'div'
72
+ })
73
+ };
80
74
  };
81
- //# sourceMappingURL=useAlert.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Alert/useAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,MAAT,QAAuB,wBAAvB;AACA,SAAS,MAAT,QAAuB,wBAAvB;AACA,SAAS,qBAAT,EAAgC,mBAAhC,EAAqD,UAArD,EAAiE,aAAjE,QAAsF,uBAAtF;AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAIA;;;;;;;;AAQG;;AACH,OAAO,MAAM,iBAAiB,GAAG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,EAAE;QAAE,UAAU,EAAE;MAAd;IAAhB,CAAf,CAfnB;IAgBL;EAhBK,CAAP;AAkBD,CArDM","sourcesContent":["import * as React from 'react';\n\nimport { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\n\nimport type { AlertProps, AlertState } from './Alert.types';\n\n/**\n * Create the state required to render Alert.\n *\n * The returned state can be modified with hooks such as useAlertStyles_unstable,\n * before being passed to renderAlert_unstable.\n *\n * @param props - props from this instance of Alert\n * @param ref - reference to root HTMLElement of Alert\n */\nexport const useAlert_unstable = (props: AlertProps, ref: React.Ref<HTMLElement>): AlertState => {\n const { intent } = props;\n\n /** Determine the role and icon to render based on the intent */\n let defaultIcon;\n let defaultRole = 'status';\n switch (intent) {\n case 'success':\n defaultIcon = <CheckmarkCircleFilled />;\n break;\n case 'error':\n defaultIcon = <DismissCircleFilled />;\n defaultRole = 'alert';\n break;\n case 'warning':\n defaultIcon = <WarningFilled />;\n defaultRole = 'alert';\n break;\n case 'info':\n defaultIcon = <InfoFilled />;\n break;\n }\n\n const avatar = resolveShorthand(props.avatar);\n let icon;\n /** Avatar prop takes precedence over the icon or intent prop */\n if (!avatar) {\n icon = resolveShorthand(props.icon, {\n defaultProps: {\n children: defaultIcon,\n },\n required: !!props.intent,\n });\n }\n\n return {\n components: {\n root: 'div',\n icon: 'span',\n action: Button,\n avatar: Avatar,\n },\n root: getNativeElementProps('div', {\n ref,\n role: defaultRole,\n children: props.children,\n ...props,\n }),\n icon,\n avatar,\n action: resolveShorthand(props.action, { defaultProps: { appearance: 'transparent' } }),\n intent,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["useAlert.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\n\nimport type { AlertProps, AlertState } from './Alert.types';\n\n/**\n * Create the state required to render Alert.\n *\n * The returned state can be modified with hooks such as useAlertStyles_unstable,\n * before being passed to renderAlert_unstable.\n *\n * @param props - props from this instance of Alert\n * @param ref - reference to root HTMLElement of Alert\n */\nexport const useAlert_unstable = (props: AlertProps, ref: React.Ref<HTMLElement>): AlertState => {\n const { appearance = 'primary', intent } = props;\n\n /** Determine the role and icon to render based on the intent */\n let defaultIcon;\n let defaultRole = 'status';\n switch (intent) {\n case 'success':\n defaultIcon = <CheckmarkCircleFilled />;\n break;\n case 'error':\n defaultIcon = <DismissCircleFilled />;\n defaultRole = 'alert';\n break;\n case 'warning':\n defaultIcon = <WarningFilled />;\n defaultRole = 'alert';\n break;\n case 'info':\n defaultIcon = <InfoFilled />;\n break;\n }\n\n const action = slot.optional(props.action, { defaultProps: { appearance: 'transparent' }, elementType: Button });\n const avatar = slot.optional(props.avatar, { elementType: Avatar });\n let icon;\n /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {\n icon = slot.optional(props.icon, {\n defaultProps: { children: defaultIcon },\n renderByDefault: !!props.intent,\n elementType: 'span',\n });\n }\n return {\n action,\n appearance,\n avatar,\n components: { root: 'div', icon: 'span', action: Button, avatar: Avatar },\n icon,\n intent,\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n role: defaultRole,\n children: props.children,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","Avatar","Button","CheckmarkCircleFilled","DismissCircleFilled","InfoFilled","WarningFilled","getNativeElementProps","slot","useAlert_unstable","props","ref","appearance","intent","defaultIcon","defaultRole","action","optional","defaultProps","elementType","avatar","icon","children","renderByDefault","components","root","always","role"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,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F,EAAE"}
@@ -0,0 +1,137 @@
1
+ import { tokens } from '@fluentui/react-theme';
2
+ import { __styles, mergeClasses, shorthands } from '@griffel/react';
3
+ import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
4
+ export const alertClassNames = {
5
+ root: 'fui-Alert',
6
+ icon: 'fui-Alert__icon',
7
+ action: 'fui-Alert__action',
8
+ avatar: 'fui-Alert__avatar'
9
+ };
10
+ const useStyles = /*#__PURE__*/__styles({
11
+ root: {
12
+ mc9l5x: "f22iagw",
13
+ Bt984gj: "f122n59",
14
+ sshi5w: "f5pgtk9",
15
+ z8tnut: "f1g0x7ka",
16
+ z189sj: ["f11qrl6u", "fjlbh76"],
17
+ Byoj8tv: "f1qch9an",
18
+ uwmqm3: ["fjlbh76", "f11qrl6u"],
19
+ Bbmb7ep: ["fff7au0", "f1bjk9e1"],
20
+ Beyfa6y: ["f1bjk9e1", "fff7au0"],
21
+ B7oj6ja: ["fwsfkhu", "f8wkphi"],
22
+ Btl43ni: ["f8wkphi", "fwsfkhu"],
23
+ B4j52fo: "f5ogflp",
24
+ Bekrc4i: ["f1hqa2wf", "finvdd3"],
25
+ Bn0qgzm: "f1f09k3d",
26
+ ibv6hh: ["finvdd3", "f1hqa2wf"],
27
+ icvyot: "fzkkow9",
28
+ vrafjx: ["fcdblym", "fjik90z"],
29
+ oivjwe: "fg706s2",
30
+ wvpqe5: ["fjik90z", "fcdblym"],
31
+ g2u3we: "fghlq4f",
32
+ h3c5rm: ["f1gn591s", "fjscplz"],
33
+ B9xav0g: "fb073pr",
34
+ zhjwy3: ["fjscplz", "f1gn591s"],
35
+ E5pizo: "fz58gqq",
36
+ Be2twd7: "fkhj508",
37
+ Bhrd7zp: "fl43uef",
38
+ sj55zd: "f19n0e5",
39
+ De3pzq: "fxugw4r"
40
+ },
41
+ inverted: {
42
+ sj55zd: "f1w7i9ko",
43
+ De3pzq: "f5pduvr"
44
+ },
45
+ icon: {
46
+ Bqenvij: "fd461yt",
47
+ Be2twd7: "f4ybsrx",
48
+ z8tnut: "f1g0x7ka",
49
+ z189sj: ["f19lj068", "f177v4lu"],
50
+ Byoj8tv: "f1qch9an",
51
+ uwmqm3: ["f1cnd47f", "fhxju0i"]
52
+ },
53
+ avatar: {
54
+ B6of3ja: "f1hu3pq6",
55
+ t21cq0: ["f1phki43", "ff9s3yw"],
56
+ jrapky: "f19f4twv",
57
+ Frg6f3: ["f1tyq0we", "f11qmguv"]
58
+ },
59
+ action: {
60
+ z8tnut: "f1sbtcvk",
61
+ z189sj: ["f81rol6", "frdkuqy"],
62
+ Byoj8tv: "fdghr9",
63
+ uwmqm3: ["frdkuqy", "f81rol6"],
64
+ Bf4jedk: "fy77jfu",
65
+ Frg6f3: ["fcgxt0o", "f1ujusj6"],
66
+ sj55zd: "f16muhyy"
67
+ }
68
+ }, {
69
+ d: [".f22iagw{display:flex;}", ".f122n59{align-items:center;}", ".f5pgtk9{min-height:44px;}", ".f1g0x7ka{padding-top:0;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".f1qch9an{padding-bottom:0;}", ".fff7au0{border-bottom-right-radius:4px;}", ".f1bjk9e1{border-bottom-left-radius:4px;}", ".fwsfkhu{border-top-right-radius:4px;}", ".f8wkphi{border-top-left-radius:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".fz58gqq{box-shadow:var(--shadow8);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}", ".f5pduvr{background-color:var(--colorNeutralBackgroundInverted);}", ".fd461yt{height:16px;}", ".f4ybsrx{font-size:16px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1cnd47f{padding-left:0;}", ".fhxju0i{padding-right:0;}", ".f1hu3pq6{margin-top:0;}", ".f1phki43{margin-right:8px;}", ".ff9s3yw{margin-left:8px;}", ".f19f4twv{margin-bottom:0;}", ".f1tyq0we{margin-left:0;}", ".f11qmguv{margin-right:0;}", ".f1sbtcvk{padding-top:5px;}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".fdghr9{padding-bottom:5px;}", ".fy77jfu{min-width:0;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".f16muhyy{color:var(--colorBrandForeground1);}"]
70
+ });
71
+ const useIntentIconStyles = /*#__PURE__*/__styles({
72
+ success: {
73
+ sj55zd: "f1m7fhi8"
74
+ },
75
+ error: {
76
+ sj55zd: "f1whyuy6"
77
+ },
78
+ warning: {
79
+ sj55zd: "fpti2h4"
80
+ },
81
+ info: {
82
+ sj55zd: "fkfq4zb"
83
+ }
84
+ }, {
85
+ d: [".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
86
+ });
87
+ const useIntentIconStylesInverted = /*#__PURE__*/__styles({
88
+ success: {
89
+ sj55zd: "f1pvjcpr"
90
+ },
91
+ error: {
92
+ sj55zd: "fcrp5ll"
93
+ },
94
+ warning: {
95
+ sj55zd: "f1r8f1cl"
96
+ },
97
+ info: {
98
+ sj55zd: "f1w7i9ko"
99
+ }
100
+ }, {
101
+ d: [".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}", ".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}", ".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}", ".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}"]
102
+ });
103
+ const useActionButtonColorInverted = /*#__PURE__*/__styles({
104
+ action: {
105
+ sj55zd: "f1qz2gb0",
106
+ B8q5s1w: "fa5e339",
107
+ Bci5o5g: ["fk4svks", "fqzoz0o"],
108
+ n8qw10: "fw8q0i0",
109
+ Bdrgwmp: ["fqzoz0o", "fk4svks"],
110
+ Bfpq7zp: "f1dlk4fq"
111
+ }
112
+ }, {
113
+ d: [".f1qz2gb0{color:var(--colorBrandForegroundInverted);}", ".fa5e339[data-fui-focus-visible]{border-top-color:var(--colorTransparentStrokeInteractive);}", ".fk4svks[data-fui-focus-visible]{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fqzoz0o[data-fui-focus-visible]{border-left-color:var(--colorTransparentStrokeInteractive);}", ".fw8q0i0[data-fui-focus-visible]{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".f1dlk4fq[data-fui-focus-visible]{outline-color:var(--colorNeutralBackground5Pressed);}"]
114
+ });
115
+ /**
116
+ * Apply styling to the Alert slots based on the state
117
+ */
118
+ export const useAlertStyles_unstable = state => {
119
+ const inverted = state.appearance === 'inverted';
120
+ const styles = useStyles();
121
+ const intentIconStylesPrimary = useIntentIconStyles();
122
+ const intentIconStylesInverted = useIntentIconStylesInverted();
123
+ const actionStylesInverted = useActionButtonColorInverted();
124
+ state.root.className = mergeClasses(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);
125
+ if (state.icon) {
126
+ state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]), state.icon.className);
127
+ }
128
+ if (state.avatar) {
129
+ state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);
130
+ }
131
+ if (state.action) {
132
+ // Note: inverted && actionStylesInverted.action has the highest piority and must be merged last
133
+ state.action.className = mergeClasses(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);
134
+ }
135
+ return state;
136
+ };
137
+ //# sourceMappingURL=useAlertStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["tokens","__styles","mergeClasses","shorthands","createCustomFocusIndicatorStyle","alertClassNames","root","icon","action","avatar","useStyles","mc9l5x","Bt984gj","sshi5w","z8tnut","z189sj","Byoj8tv","uwmqm3","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","E5pizo","Be2twd7","Bhrd7zp","sj55zd","De3pzq","inverted","Bqenvij","B6of3ja","t21cq0","jrapky","Frg6f3","Bf4jedk","d","useIntentIconStyles","success","error","warning","info","useIntentIconStylesInverted","useActionButtonColorInverted","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bfpq7zp","useAlertStyles_unstable","state","appearance","styles","intentIconStylesPrimary","intentIconStylesInverted","actionStylesInverted","className","intent"],"sources":["useAlertStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nexport const alertClassNames = {\n root: 'fui-Alert',\n icon: 'fui-Alert__icon',\n action: 'fui-Alert__action',\n avatar: 'fui-Alert__avatar'\n};\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n minHeight: '44px',\n ...shorthands.padding('0', '12px'),\n ...shorthands.borderRadius('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1\n },\n inverted: {\n color: tokens.colorNeutralForegroundInverted2,\n backgroundColor: tokens.colorNeutralBackgroundInverted\n },\n icon: {\n height: '16px',\n fontSize: '16px',\n ...shorthands.padding('0', '8px', '0', '0')\n },\n avatar: {\n ...shorthands.margin('0', '8px', '0', '0')\n },\n action: {\n ...shorthands.padding('5px', '10px'),\n minWidth: 0,\n marginLeft: 'auto',\n color: tokens.colorBrandForeground1\n }\n});\nconst useIntentIconStyles = makeStyles({\n success: {\n color: tokens.colorPaletteGreenForeground3\n },\n error: {\n color: tokens.colorPaletteRedForeground3\n },\n warning: {\n color: tokens.colorPaletteYellowForeground2\n },\n info: {\n color: tokens.colorNeutralForeground2\n }\n});\nconst useIntentIconStylesInverted = makeStyles({\n success: {\n color: tokens.colorPaletteGreenForegroundInverted\n },\n error: {\n color: tokens.colorPaletteRedForegroundInverted\n },\n warning: {\n color: tokens.colorPaletteYellowForegroundInverted\n },\n info: {\n color: tokens.colorNeutralForegroundInverted2\n }\n});\nconst useActionButtonColorInverted = makeStyles({\n action: {\n color: tokens.colorBrandForegroundInverted,\n ...createCustomFocusIndicatorStyle({\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n outlineColor: tokens.colorNeutralBackground5Pressed\n }, {\n enableOutline: true\n })\n }\n});\n/**\n * Apply styling to the Alert slots based on the state\n */ export const useAlertStyles_unstable = (state)=>{\n const inverted = state.appearance === 'inverted';\n const styles = useStyles();\n const intentIconStylesPrimary = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const actionStylesInverted = useActionButtonColorInverted();\n state.root.className = mergeClasses(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]), state.icon.className);\n }\n if (state.avatar) {\n state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);\n }\n if (state.action) {\n // Note: inverted && actionStylesInverted.action has the highest piority and must be merged last\n state.action.className = mergeClasses(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,OAAO,MAAMC,eAAe,GAAG;EAC3BC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,iBAAiB;EACvBC,MAAM,EAAE,mBAAmB;EAC3BC,MAAM,EAAE;AACZ,CAAC;AACD,MAAMC,SAAS,gBAAGT,QAAA;EAAAK,IAAA;IAAAK,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAF,MAAA;IAAAC,MAAA;EAAA;EAAA/B,IAAA;IAAAiC,OAAA;IAAAL,OAAA;IAAArB,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAR,MAAA;IAAAgC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAApC,MAAA;IAAAM,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAA4B,OAAA;IAAAD,MAAA;IAAAP,MAAA;EAAA;AAAA;EAAAS,CAAA;AAAA,CAgCjB,CAAC;AACF,MAAMC,mBAAmB,gBAAG9C,QAAA;EA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AK,CAACO,MAAM,KAAK5B,QAAQ,GAAGyB,wBAAwB,CAACJ,KAAK,CAACO,MAAM,CAAC,GAAGJ,uBAAuB,CAACH,KAAK,CAACO,MAAM,CAAC,CAAC,EAAEP,KAAK,CAACrD,IAAI,CAAC2D,SAAS,CAAC;EAC7M;EACA,IAAIN,KAAK,CAACnD,MAAM,EAAE;IACdmD,KAAK,CAACnD,MAAM,CAACyD,SAAS,GAAGhE,YAAY,CAACG,eAAe,CAACI,MAAM,EAAEqD,MAAM,CAACrD,MAAM,EAAEmD,KAAK,CAACnD,MAAM,CAACyD,SAAS,CAAC;EACxG;EACA,IAAIN,KAAK,CAACpD,MAAM,EAAE;IACd;IACAoD,KAAK,CAACpD,MAAM,CAAC0D,SAAS,GAAGhE,YAAY,CAACG,eAAe,CAACG,MAAM,EAAEsD,MAAM,CAACtD,MAAM,EAAE+B,QAAQ,IAAI0B,oBAAoB,CAACzD,MAAM,EAAEoD,KAAK,CAACpD,MAAM,CAAC0D,SAAS,CAAC;EACjJ;EACA,OAAON,KAAK;AAChB,CAAC"}
package/lib/index.js CHANGED
@@ -1,2 +1 @@
1
1
  export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';
2
- //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';\nexport type { AlertProps, AlertSlots, AlertState } from './Alert';\n"]}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';\nexport type { AlertProps, AlertSlots, AlertState } from './Alert';\n"],"names":["Alert","alertClassNames","renderAlert_unstable","useAlertStyles_unstable","useAlert_unstable"],"mappings":"AAAA,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,UAAU"}
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
-
7
- const tslib_1 = /*#__PURE__*/require("tslib");
8
-
9
- tslib_1.__exportStar(require("./components/Alert/index"), exports);
10
- //# sourceMappingURL=Alert.js.map
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/Alert/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["Alert.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Alert/index';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["Alert.js"],"sourcesContent":["export * from './components/Alert/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
@@ -1,27 +1,19 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.Alert = void 0;
7
-
8
- const React = /*#__PURE__*/require("react");
9
-
10
- const renderAlert_1 = /*#__PURE__*/require("./renderAlert");
11
-
12
- const useAlert_1 = /*#__PURE__*/require("./useAlert");
13
-
14
- const useAlertStyles_1 = /*#__PURE__*/require("./useAlertStyles");
15
- /**
16
- * An Alert component displays a brief, important message to attract a user's attention
17
- * without interrupting their current task.
18
- */
19
-
20
-
21
- exports.Alert = /*#__PURE__*/React.forwardRef((props, ref) => {
22
- const state = useAlert_1.useAlert_unstable(props, ref);
23
- useAlertStyles_1.useAlertStyles_unstable(state);
24
- return renderAlert_1.renderAlert_unstable(state);
5
+ Object.defineProperty(exports, "Alert", {
6
+ enumerable: true,
7
+ get: ()=>Alert
25
8
  });
26
- exports.Alert.displayName = 'Alert';
27
- //# sourceMappingURL=Alert.js.map
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _renderAlert = require("./renderAlert");
12
+ const _useAlert = require("./useAlert");
13
+ const _useAlertStylesStyles = require("./useAlertStyles.styles");
14
+ const Alert = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
15
+ const state = (0, _useAlert.useAlert_unstable)(props, ref);
16
+ (0, _useAlertStylesStyles.useAlertStyles_unstable)(state);
17
+ return (0, _renderAlert.renderAlert_unstable)(state);
18
+ });
19
+ Alert.displayName = 'Alert';
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Alert/Alert.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAKA;;;AAGG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpF,MAAM,KAAK,GAAG,UAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;EAEA,gBAAA,CAAA,uBAAA,CAAwB,KAAxB;EACA,OAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourcesContent":["import * as React from 'react';\n\nimport { renderAlert_unstable } from './renderAlert';\nimport { useAlert_unstable } from './useAlert';\nimport { useAlertStyles_unstable } from './useAlertStyles';\n\nimport type { AlertProps } from './Alert.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * An Alert component displays a brief, important message to attract a user's attention\n * without interrupting their current task.\n */\nexport const Alert: ForwardRefComponent<AlertProps> = React.forwardRef((props, ref) => {\n const state = useAlert_unstable(props, ref);\n\n useAlertStyles_unstable(state);\n return renderAlert_unstable(state);\n}) as ForwardRefComponent<AlertProps>;\n\nAlert.displayName = 'Alert';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["Alert.js"],"sourcesContent":["import * as React from 'react';\nimport { renderAlert_unstable } from './renderAlert';\nimport { useAlert_unstable } from './useAlert';\nimport { useAlertStyles_unstable } from './useAlertStyles.styles';\n/**\n * An Alert component displays a brief, important message to attract a user's attention\n * without interrupting their current task.\n */ export const Alert = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useAlert_unstable(props, ref);\n useAlertStyles_unstable(state);\n return renderAlert_unstable(state);\n});\nAlert.displayName = 'Alert';\n"],"names":["Alert","React","forwardRef","props","ref","state","useAlert_unstable","useAlertStyles_unstable","renderAlert_unstable","displayName"],"mappings":";;;;+BAOiBA;;aAAAA;;;6DAPM;6BACc;0BACH;sCACM;AAI7B,MAAMA,QAAQ,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IAClE,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,6CAAuB,EAACF;IACxB,OAAOG,IAAAA,iCAAoB,EAACH;AAChC;AACAL,MAAMS,WAAW,GAAG"}
@@ -1,6 +1,4 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- //# sourceMappingURL=Alert.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,18 +1,10 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
-
7
- const tslib_1 = /*#__PURE__*/require("tslib");
8
-
9
- tslib_1.__exportStar(require("./Alert"), exports);
10
-
11
- tslib_1.__exportStar(require("./Alert.types"), exports);
12
-
13
- tslib_1.__exportStar(require("./renderAlert"), exports);
14
-
15
- tslib_1.__exportStar(require("./useAlert"), exports);
16
-
17
- tslib_1.__exportStar(require("./useAlertStyles"), exports);
18
- //# sourceMappingURL=index.js.map
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Alert"), exports);
7
+ _exportStar(require("./Alert.types"), exports);
8
+ _exportStar(require("./renderAlert"), exports);
9
+ _exportStar(require("./useAlert"), exports);
10
+ _exportStar(require("./useAlertStyles.styles"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Alert/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Alert';\nexport * from './Alert.types';\nexport * from './renderAlert';\nexport * from './useAlert';\nexport * from './useAlertStyles';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Alert';\nexport * from './Alert.types';\nexport * from './renderAlert';\nexport * from './useAlert';\nexport * from './useAlertStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
@@ -1,25 +1,14 @@
1
- "use strict";
2
-
1
+ /** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.renderAlert_unstable = void 0;
7
-
8
- const React = /*#__PURE__*/require("react");
9
-
10
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
-
12
- const renderAlert_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- return React.createElement(slots.root, { ...slotProps.root
18
- }, slots.icon && React.createElement(slots.icon, { ...slotProps.icon
19
- }), slots.avatar && React.createElement(slots.avatar, { ...slotProps.avatar
20
- }), slotProps.root.children, slots.action && React.createElement(slots.action, { ...slotProps.action
21
- }));
5
+ Object.defineProperty(exports, "renderAlert_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderAlert_unstable
8
+ });
9
+ const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
10
+ const _reactUtilities = require("@fluentui/react-utilities");
11
+ const renderAlert_unstable = (state)=>{
12
+ (0, _reactUtilities.assertSlots)(state);
13
+ return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.root, null, state.icon && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.icon, null), state.avatar && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.avatar, null), state.root.children, state.action && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.action, null));
22
14
  };
23
-
24
- exports.renderAlert_unstable = renderAlert_unstable;
25
- //# sourceMappingURL=renderAlert.js.map