@fluentui/react-alert 9.0.0-beta.13 → 9.0.0-beta.131

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 (47) hide show
  1. package/CHANGELOG.md +1455 -3
  2. package/README.md +5 -3
  3. package/dist/index.d.ts +12 -3
  4. package/lib/Alert.js +1 -2
  5. package/lib/Alert.js.map +1 -1
  6. package/lib/components/Alert/Alert.js +13 -8
  7. package/lib/components/Alert/Alert.js.map +1 -1
  8. package/lib/components/Alert/Alert.types.js +5 -2
  9. package/lib/components/Alert/Alert.types.js.map +1 -1
  10. package/lib/components/Alert/index.js +4 -6
  11. package/lib/components/Alert/index.js.map +1 -1
  12. package/lib/components/Alert/renderAlert.js +16 -13
  13. package/lib/components/Alert/renderAlert.js.map +1 -1
  14. package/lib/components/Alert/useAlert.js +64 -69
  15. package/lib/components/Alert/useAlert.js.map +1 -1
  16. package/lib/components/Alert/useAlertStyles.styles.js +167 -0
  17. package/lib/components/Alert/useAlertStyles.styles.js.map +1 -0
  18. package/lib/components/Alert/useAlertStyles.styles.raw.js +107 -0
  19. package/lib/components/Alert/useAlertStyles.styles.raw.js.map +1 -0
  20. package/lib/index.js +1 -1
  21. package/lib/index.js.map +1 -1
  22. package/lib-commonjs/Alert.js +26 -8
  23. package/lib-commonjs/Alert.js.map +1 -1
  24. package/lib-commonjs/components/Alert/Alert.js +23 -23
  25. package/lib-commonjs/components/Alert/Alert.js.map +1 -1
  26. package/lib-commonjs/components/Alert/Alert.types.js +5 -3
  27. package/lib-commonjs/components/Alert/Alert.types.js.map +1 -1
  28. package/lib-commonjs/components/Alert/index.js +29 -16
  29. package/lib-commonjs/components/Alert/index.js.map +1 -1
  30. package/lib-commonjs/components/Alert/renderAlert.js +20 -21
  31. package/lib-commonjs/components/Alert/renderAlert.js.map +1 -1
  32. package/lib-commonjs/components/Alert/useAlert.js +74 -92
  33. package/lib-commonjs/components/Alert/useAlert.js.map +1 -1
  34. package/lib-commonjs/components/Alert/useAlertStyles.styles.js +258 -0
  35. package/lib-commonjs/components/Alert/useAlertStyles.styles.js.map +1 -0
  36. package/lib-commonjs/components/Alert/useAlertStyles.styles.raw.js +120 -0
  37. package/lib-commonjs/components/Alert/useAlertStyles.styles.raw.js.map +1 -0
  38. package/lib-commonjs/index.js +25 -36
  39. package/lib-commonjs/index.js.map +1 -1
  40. package/package.json +33 -30
  41. package/CHANGELOG.json +0 -552
  42. package/Migration.md +0 -0
  43. package/Spec.md +0 -97
  44. package/lib/components/Alert/useAlertStyles.js +0 -112
  45. package/lib/components/Alert/useAlertStyles.js.map +0 -1
  46. package/lib-commonjs/components/Alert/useAlertStyles.js +0 -123
  47. package/lib-commonjs/components/Alert/useAlertStyles.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @fluentui/react-alert
2
2
 
3
- **React Alert component for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
3
+ ## DEPRECATED
4
4
 
5
- > WIP 🚧 - These are not production-ready components as we are still in a Beta phase.
6
- > See the [spec.md](./Spec.md) for usage and component API details
5
+ This component is deprecated please use the following components instead:
6
+
7
+ - Toast - @fluentui/react-toast
8
+ - MessageBar - @fluentui/react-message-bar
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
-
3
1
  import { Avatar } from '@fluentui/react-avatar';
4
2
  import { Button } from '@fluentui/react-button';
5
3
  import type { ComponentProps } from '@fluentui/react-utilities';
@@ -10,6 +8,7 @@ import type { Slot } from '@fluentui/react-utilities';
10
8
  import type { SlotClassNames } from '@fluentui/react-utilities';
11
9
 
12
10
  /**
11
+ * @deprecated please use the Toast or MessageBar component
13
12
  * An Alert component displays a brief, important message to attract a user's attention
14
13
  * without interrupting their current task.
15
14
  */
@@ -19,6 +18,7 @@ export declare const alertClassNames: SlotClassNames<AlertSlots>;
19
18
 
20
19
  /**
21
20
  * Alert Props
21
+ * @deprecated please use the Toast or MessageBar component
22
22
  */
23
23
  export declare type AlertProps = ComponentProps<AlertSlots> & {
24
24
  /**
@@ -33,6 +33,9 @@ export declare type AlertProps = ComponentProps<AlertSlots> & {
33
33
  appearance?: 'primary' | 'inverted';
34
34
  };
35
35
 
36
+ /**
37
+ * @deprecated please use the Toast or MessageBar component
38
+ */
36
39
  export declare type AlertSlots = {
37
40
  /**
38
41
  * The root slot is the top level container for the alert component
@@ -54,12 +57,17 @@ export declare type AlertSlots = {
54
57
 
55
58
  /**
56
59
  * State used in rendering Alert
60
+ * @deprecated please use the Toast or MessageBar component
57
61
  */
58
62
  export declare type AlertState = ComponentState<AlertSlots> & Pick<AlertProps, 'intent'> & Required<Pick<AlertProps, 'appearance'>>;
59
63
 
60
- export declare const renderAlert_unstable: (state: AlertState) => JSX.Element;
64
+ /**
65
+ * @deprecated please use the Toast or MessageBar component
66
+ */
67
+ export declare const renderAlert_unstable: (state: AlertState) => React_2.ReactElement;
61
68
 
62
69
  /**
70
+ * @deprecated please use the Toast or MessageBar component
63
71
  * Create the state required to render Alert.
64
72
  *
65
73
  * The returned state can be modified with hooks such as useAlertStyles_unstable,
@@ -71,6 +79,7 @@ export declare const renderAlert_unstable: (state: AlertState) => JSX.Element;
71
79
  export declare const useAlert_unstable: (props: AlertProps, ref: React_2.Ref<HTMLElement>) => AlertState;
72
80
 
73
81
  /**
82
+ * @deprecated please use the Toast or MessageBar component
74
83
  * Apply styling to the Alert slots based on the state
75
84
  */
76
85
  export declare const useAlertStyles_unstable: (state: AlertState) => AlertState;
package/lib/Alert.js CHANGED
@@ -1,2 +1 @@
1
- export * from './components/Alert/index';
2
- //# sourceMappingURL=Alert.js.map
1
+ /* eslint-disable @typescript-eslint/no-deprecated */ export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './components/Alert/index';
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":["../src/Alert.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\nexport type { AlertProps, AlertSlots, AlertState } from './components/Alert/index';\nexport {\n Alert,\n alertClassNames,\n renderAlert_unstable,\n useAlertStyles_unstable,\n useAlert_unstable,\n} from './components/Alert/index';\n"],"names":["Alert","alertClassNames","renderAlert_unstable","useAlertStyles_unstable","useAlert_unstable"],"mappings":"AAAA,mDAAmD,GAEnD,SACEA,KAAK,EACLC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,QACZ,2BAA2B"}
@@ -1,16 +1,21 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { renderAlert_unstable } from './renderAlert';
3
4
  import { useAlert_unstable } from './useAlert';
4
- import { useAlertStyles_unstable } from './useAlertStyles';
5
+ import { useAlertStyles_unstable } from './useAlertStyles.styles';
5
6
  /**
7
+ * @deprecated please use the Toast or MessageBar component
6
8
  * An Alert component displays a brief, important message to attract a user's attention
7
9
  * 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);
10
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
11
+ export const Alert = /*#__PURE__*/ React.forwardRef((props, ref)=>{
12
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
13
+ const state = useAlert_unstable(props, ref);
14
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
15
+ useAlertStyles_unstable(state);
16
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
17
+ return renderAlert_unstable(state);
18
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
14
19
  });
20
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
15
21
  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":["../src/components/Alert/Alert.tsx"],"sourcesContent":["'use client';\n\nimport * 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 * @deprecated please use the Toast or MessageBar component\n * An Alert component displays a brief, important message to attract a user's attention\n * without interrupting their current task.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const Alert: ForwardRefComponent<AlertProps> = React.forwardRef((props, ref) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const state = useAlert_unstable(props, ref);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n useAlertStyles_unstable(state);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return renderAlert_unstable(state);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n}) as ForwardRefComponent<AlertProps>;\n\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nAlert.displayName = 'Alert';\n"],"names":["React","renderAlert_unstable","useAlert_unstable","useAlertStyles_unstable","Alert","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,uBAAuB,QAAQ,0BAA0B;AAKlE;;;;CAIC,GACD,4DAA4D;AAC5D,OAAO,MAAMC,sBAAyCJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC7E,4DAA4D;IAC5D,MAAMC,QAAQN,kBAAkBI,OAAOC;IAEvC,4DAA4D;IAC5DJ,wBAAwBK;IACxB,4DAA4D;IAC5D,OAAOP,qBAAqBO;AAC5B,4DAA4D;AAC9D,GAAsC;AAEtC,4DAA4D;AAC5DJ,MAAMK,WAAW,GAAG"}
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=Alert.types.js.map
1
+ /**
2
+ * State used in rendering Alert
3
+ * @deprecated please use the Toast or MessageBar component
4
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
5
+ 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 * 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"]}
1
+ {"version":3,"sources":["../src/components/Alert/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\n/**\n * @deprecated please use the Toast or MessageBar component\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 * @deprecated please use the Toast or MessageBar component\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\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 * @deprecated please use the Toast or MessageBar component\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport type AlertState = ComponentState<AlertSlots> &\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n Pick<AlertProps, 'intent'> &\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n Required<Pick<AlertProps, 'appearance'>>;\n"],"names":[],"mappings":"AA6CA;;;CAGC,GACD,4DAA4D;AAC5D,WAI2C"}
@@ -1,6 +1,4 @@
1
- export * from './Alert';
2
- export * from './Alert.types';
3
- export * from './renderAlert';
4
- export * from './useAlert';
5
- export * from './useAlertStyles';
6
- //# sourceMappingURL=index.js.map
1
+ /* eslint-disable @typescript-eslint/no-deprecated */ export { Alert } from './Alert';
2
+ export { renderAlert_unstable } from './renderAlert';
3
+ export { useAlert_unstable } from './useAlert';
4
+ export { alertClassNames, useAlertStyles_unstable } 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":["../src/components/Alert/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated */\nexport { Alert } from './Alert';\nexport type { AlertProps, AlertSlots, AlertState } from './Alert.types';\nexport { renderAlert_unstable } from './renderAlert';\nexport { useAlert_unstable } from './useAlert';\nexport { alertClassNames, useAlertStyles_unstable } from './useAlertStyles.styles';\n"],"names":["Alert","renderAlert_unstable","useAlert_unstable","alertClassNames","useAlertStyles_unstable"],"mappings":"AAAA,mDAAmD,GACnD,SAASA,KAAK,QAAQ,UAAU;AAEhC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,0BAA0B"}
@@ -1,14 +1,17 @@
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
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * @deprecated please use the Toast or MessageBar component
5
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
6
+ export const renderAlert_unstable = (state)=>{
7
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
8
+ assertSlots(state);
9
+ return /*#__PURE__*/ _jsxs(state.root, {
10
+ children: [
11
+ state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
12
+ state.avatar && /*#__PURE__*/ _jsx(state.avatar, {}),
13
+ state.root.children,
14
+ state.action && /*#__PURE__*/ _jsx(state.action, {})
15
+ ]
16
+ });
13
17
  };
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":["../src/components/Alert/renderAlert.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type * as React from 'react';\n\nimport type { AlertState, AlertSlots } from './Alert.types';\n\n/**\n * @deprecated please use the Toast or MessageBar component\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const renderAlert_unstable = (state: AlertState): React.ReactElement => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\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":["assertSlots","renderAlert_unstable","state","root","icon","avatar","children","action"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAKxD;;CAEC,GACD,4DAA4D;AAC5D,OAAO,MAAMC,uBAAuB,CAACC;IACnC,4DAA4D;IAC5DF,YAAwBE;IAExB,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,IAAI,kBAAI,KAACF,MAAME,IAAI;YACzBF,MAAMG,MAAM,kBAAI,KAACH,MAAMG,MAAM;YAC7BH,MAAMC,IAAI,CAACG,QAAQ;YACnBJ,MAAMK,MAAM,kBAAI,KAACL,MAAMK,MAAM;;;AAGpC,EAAE"}
@@ -2,8 +2,9 @@ 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 { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
6
6
  /**
7
+ * @deprecated please use the Toast or MessageBar component
7
8
  * Create the state required to render Alert.
8
9
  *
9
10
  * The returned state can be modified with hooks such as useAlertStyles_unstable,
@@ -11,74 +12,68 @@ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utiliti
11
12
  *
12
13
  * @param props - props from this instance of Alert
13
14
  * @param ref - reference to root HTMLElement of Alert
14
- */
15
-
16
- export const useAlert_unstable = (props, ref) => {
17
- const {
18
- appearance = 'primary',
19
- intent
20
- } = props;
21
- /** Determine the role and icon to render based on the intent */
22
-
23
- let defaultIcon;
24
- let defaultRole = 'status';
25
-
26
- switch (intent) {
27
- case 'success':
28
- defaultIcon = /*#__PURE__*/React.createElement(CheckmarkCircleFilled, null);
29
- break;
30
-
31
- case 'error':
32
- defaultIcon = /*#__PURE__*/React.createElement(DismissCircleFilled, null);
33
- defaultRole = 'alert';
34
- break;
35
-
36
- case 'warning':
37
- defaultIcon = /*#__PURE__*/React.createElement(WarningFilled, null);
38
- defaultRole = 'alert';
39
- break;
40
-
41
- case 'info':
42
- defaultIcon = /*#__PURE__*/React.createElement(InfoFilled, null);
43
- break;
44
- }
45
-
46
- const action = resolveShorthand(props.action, {
47
- defaultProps: {
48
- appearance: 'transparent'
15
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
16
+ export const useAlert_unstable = (props, ref)=>{
17
+ const { appearance = 'primary', intent } = props;
18
+ /** Determine the role and icon to render based on the intent */ let defaultIcon;
19
+ let defaultRole = 'status';
20
+ switch(intent){
21
+ case 'success':
22
+ defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);
23
+ break;
24
+ case 'error':
25
+ defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);
26
+ defaultRole = 'alert';
27
+ break;
28
+ case 'warning':
29
+ defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);
30
+ defaultRole = 'alert';
31
+ break;
32
+ case 'info':
33
+ defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);
34
+ break;
49
35
  }
50
- });
51
- const avatar = resolveShorthand(props.avatar);
52
- let icon;
53
- /** Avatar prop takes precedence over the icon or intent prop */
54
-
55
- if (!avatar) {
56
- icon = resolveShorthand(props.icon, {
57
- defaultProps: {
58
- children: defaultIcon
59
- },
60
- required: !!props.intent
36
+ const action = slot.optional(props.action, {
37
+ defaultProps: {
38
+ appearance: 'transparent'
39
+ },
40
+ elementType: Button
61
41
  });
62
- }
63
-
64
- return {
65
- action,
66
- appearance,
67
- avatar,
68
- components: {
69
- root: 'div',
70
- icon: 'span',
71
- action: Button,
72
- avatar: Avatar
73
- },
74
- icon,
75
- intent,
76
- root: getNativeElementProps('div', {
77
- ref,
78
- role: defaultRole,
79
- children: props.children,
80
- ...props
81
- })
82
- };
42
+ const avatar = slot.optional(props.avatar, {
43
+ elementType: Avatar
44
+ });
45
+ let icon;
46
+ /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {
47
+ icon = slot.optional(props.icon, {
48
+ defaultProps: {
49
+ children: defaultIcon
50
+ },
51
+ renderByDefault: !!props.intent,
52
+ elementType: 'span'
53
+ });
54
+ }
55
+ return {
56
+ action,
57
+ appearance,
58
+ avatar,
59
+ components: {
60
+ root: 'div',
61
+ icon: 'span',
62
+ action: Button,
63
+ avatar: Avatar
64
+ },
65
+ icon,
66
+ intent,
67
+ root: slot.always(getIntrinsicElementProps('div', {
68
+ // FIXME:
69
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
70
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
71
+ ref: ref,
72
+ role: defaultRole,
73
+ children: props.children,
74
+ ...props
75
+ }), {
76
+ elementType: 'div'
77
+ })
78
+ };
83
79
  };
84
- //# 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,CAAC,KAAD,EAAoB,GAApB,KAA+D;EAC9F,MAAM;IAAE,UAAU,GAAG,SAAf;IAA0B;EAA1B,IAAqC,KAA3C;EAEA;;EACA,IAAI,WAAJ;EACA,IAAI,WAAW,GAAG,QAAlB;;EACA,QAAQ,MAAR;IACE,KAAK,SAAL;MACE,WAAW,gBAAG,KAAA,CAAA,aAAA,CAAC,qBAAD,EAAsB,IAAtB,CAAd;MACA;;IACF,KAAK,OAAL;MACE,WAAW,gBAAG,KAAA,CAAA,aAAA,CAAC,mBAAD,EAAoB,IAApB,CAAd;MACA,WAAW,GAAG,OAAd;MACA;;IACF,KAAK,SAAL;MACE,WAAW,gBAAG,KAAA,CAAA,aAAA,CAAC,aAAD,EAAc,IAAd,CAAd;MACA,WAAW,GAAG,OAAd;MACA;;IACF,KAAK,MAAL;MACE,WAAW,gBAAG,KAAA,CAAA,aAAA,CAAC,UAAD,EAAW,IAAX,CAAd;MACA;EAdJ;;EAiBA,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAP,EAAe;IAAE,YAAY,EAAE;MAAE,UAAU,EAAE;IAAd;EAAhB,CAAf,CAA/B;EACA,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAP,CAA/B;EACA,IAAI,IAAJ;EACA;;EACA,IAAI,CAAC,MAAL,EAAa;IACX,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAP,EAAa;MAClC,YAAY,EAAE;QACZ,QAAQ,EAAE;MADE,CADoB;MAIlC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;IAJgB,CAAb,CAAvB;EAMD;;EAED,OAAO;IACL,MADK;IAEL,UAFK;IAGL,MAHK;IAIL,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,IAAI,EAAE,MAFI;MAGV,MAAM,EAAE,MAHE;MAIV,MAAM,EAAE;IAJE,CAJP;IAUL,IAVK;IAWL,MAXK;IAYL,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;MACjC,GADiC;MAEjC,IAAI,EAAE,WAF2B;MAGjC,QAAQ,EAAE,KAAK,CAAC,QAHiB;MAIjC,GAAG;IAJ8B,CAAR;EAZtB,CAAP;AAmBD,CAvDM","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 { 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 = resolveShorthand(props.action, { defaultProps: { appearance: 'transparent' } });\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 action,\n appearance,\n avatar,\n components: {\n root: 'div',\n icon: 'span',\n action: Button,\n avatar: Avatar,\n },\n icon,\n intent,\n root: getNativeElementProps('div', {\n ref,\n role: defaultRole,\n children: props.children,\n ...props,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["../src/components/Alert/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 { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n\nimport type { AlertProps, AlertState } from './Alert.types';\n\n/**\n * @deprecated please use the Toast or MessageBar component\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 */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\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 getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\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","getIntrinsicElementProps","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,MAAM,QAAQ,yBAAyB;AAChD,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F,EAAE"}
@@ -0,0 +1,167 @@
1
+ 'use client';
2
+
3
+ import { tokens } from '@fluentui/react-theme';
4
+ import { __styles, mergeClasses, shorthands } from '@griffel/react';
5
+ import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
6
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
7
+ export const alertClassNames = {
8
+ root: 'fui-Alert',
9
+ icon: 'fui-Alert__icon',
10
+ action: 'fui-Alert__action',
11
+ avatar: 'fui-Alert__avatar'
12
+ };
13
+ const useStyles = /*#__PURE__*/__styles({
14
+ root: {
15
+ mc9l5x: "f22iagw",
16
+ Bt984gj: "f122n59",
17
+ sshi5w: "f5pgtk9",
18
+ Byoj8tv: 0,
19
+ uwmqm3: 0,
20
+ z189sj: 0,
21
+ z8tnut: 0,
22
+ B0ocmuz: "f1oic3e7",
23
+ Beyfa6y: 0,
24
+ Bbmb7ep: 0,
25
+ Btl43ni: 0,
26
+ B7oj6ja: 0,
27
+ Dimara: "ff3glw6",
28
+ Bgfg5da: 0,
29
+ B9xav0g: 0,
30
+ oivjwe: 0,
31
+ Bn0qgzm: 0,
32
+ B4g9neb: 0,
33
+ zhjwy3: 0,
34
+ wvpqe5: 0,
35
+ ibv6hh: 0,
36
+ u1mtju: 0,
37
+ h3c5rm: 0,
38
+ vrafjx: 0,
39
+ Bekrc4i: 0,
40
+ i8vvqc: 0,
41
+ g2u3we: 0,
42
+ icvyot: 0,
43
+ B4j52fo: 0,
44
+ irswps: "f9ggezi",
45
+ E5pizo: "fz58gqq",
46
+ Be2twd7: "fkhj508",
47
+ Bhrd7zp: "fl43uef",
48
+ sj55zd: "f19n0e5",
49
+ De3pzq: "fxugw4r"
50
+ },
51
+ inverted: {
52
+ sj55zd: "f1w7i9ko",
53
+ De3pzq: "f5pduvr"
54
+ },
55
+ icon: {
56
+ Bqenvij: "fd461yt",
57
+ Be2twd7: "f4ybsrx",
58
+ Byoj8tv: 0,
59
+ uwmqm3: 0,
60
+ z189sj: 0,
61
+ z8tnut: 0,
62
+ B0ocmuz: ["fhivll6", "f1cgepy8"]
63
+ },
64
+ avatar: {
65
+ jrapky: 0,
66
+ Frg6f3: 0,
67
+ t21cq0: 0,
68
+ B6of3ja: 0,
69
+ B74szlk: ["fxal17o", "ftghr3s"]
70
+ },
71
+ action: {
72
+ Byoj8tv: 0,
73
+ uwmqm3: 0,
74
+ z189sj: 0,
75
+ z8tnut: 0,
76
+ B0ocmuz: "f4jnnbt",
77
+ Bf4jedk: "fy77jfu",
78
+ Frg6f3: ["fcgxt0o", "f1ujusj6"],
79
+ sj55zd: "f16muhyy"
80
+ }
81
+ }, {
82
+ d: [".f22iagw{display:flex;}", ".f122n59{align-items:center;}", ".f5pgtk9{min-height:44px;}", [".f1oic3e7{padding:0 12px;}", {
83
+ p: -1
84
+ }], [".ff3glw6{border-radius:4px;}", {
85
+ p: -1
86
+ }], [".f9ggezi{border:1px solid var(--colorTransparentStroke);}", {
87
+ p: -2
88
+ }], ".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;}", [".fhivll6{padding:0 8px 0 0;}", {
89
+ p: -1
90
+ }], [".f1cgepy8{padding:0 0 0 8px;}", {
91
+ p: -1
92
+ }], [".fxal17o{margin:0 8px 0 0;}", {
93
+ p: -1
94
+ }], [".ftghr3s{margin:0 0 0 8px;}", {
95
+ p: -1
96
+ }], [".f4jnnbt{padding:5px 10px;}", {
97
+ p: -1
98
+ }], ".fy77jfu{min-width:0;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".f16muhyy{color:var(--colorBrandForeground1);}"]
99
+ });
100
+ const useIntentIconStyles = /*#__PURE__*/__styles({
101
+ success: {
102
+ sj55zd: "f1m7fhi8"
103
+ },
104
+ error: {
105
+ sj55zd: "f1whyuy6"
106
+ },
107
+ warning: {
108
+ sj55zd: "fpti2h4"
109
+ },
110
+ info: {
111
+ sj55zd: "fkfq4zb"
112
+ }
113
+ }, {
114
+ d: [".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
115
+ });
116
+ const useIntentIconStylesInverted = /*#__PURE__*/__styles({
117
+ success: {
118
+ sj55zd: "f1pvjcpr"
119
+ },
120
+ error: {
121
+ sj55zd: "fcrp5ll"
122
+ },
123
+ warning: {
124
+ sj55zd: "f1r8f1cl"
125
+ },
126
+ info: {
127
+ sj55zd: "f1w7i9ko"
128
+ }
129
+ }, {
130
+ d: [".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}", ".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}", ".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}", ".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}"]
131
+ });
132
+ const useActionButtonColorInverted = /*#__PURE__*/__styles({
133
+ action: {
134
+ sj55zd: "f1qz2gb0",
135
+ B8q5s1w: "fa5e339",
136
+ Bci5o5g: ["fk4svks", "fqzoz0o"],
137
+ n8qw10: "fw8q0i0",
138
+ Bdrgwmp: ["fqzoz0o", "fk4svks"],
139
+ Bfpq7zp: "f1dlk4fq"
140
+ }
141
+ }, {
142
+ 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);}"]
143
+ });
144
+ /**
145
+ * @deprecated please use the Toast or MessageBar component
146
+ * Apply styling to the Alert slots based on the state
147
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
148
+ export const useAlertStyles_unstable = state => {
149
+ const inverted = state.appearance === 'inverted';
150
+ const styles = useStyles();
151
+ const intentIconStylesPrimary = useIntentIconStyles();
152
+ const intentIconStylesInverted = useIntentIconStylesInverted();
153
+ const actionStylesInverted = useActionButtonColorInverted();
154
+ // eslint-disable-next-line react-compiler/react-compiler
155
+ state.root.className = mergeClasses(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);
156
+ if (state.icon) {
157
+ state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]), state.icon.className);
158
+ }
159
+ if (state.avatar) {
160
+ state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);
161
+ }
162
+ if (state.action) {
163
+ // Note: inverted && actionStylesInverted.action has the highest piority and must be merged last
164
+ state.action.className = mergeClasses(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);
165
+ }
166
+ return state;
167
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"names":["tokens","__styles","mergeClasses","shorthands","createCustomFocusIndicatorStyle","alertClassNames","root","icon","action","avatar","useStyles","mc9l5x","Bt984gj","sshi5w","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","Be2twd7","Bhrd7zp","sj55zd","De3pzq","inverted","Bqenvij","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","Bf4jedk","d","p","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":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\n// eslint-disable-next-line @typescript-eslint/no-deprecated\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 padding: '0 12px',\n borderRadius: '4px',\n 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 padding: '0 8px 0 0'\n },\n avatar: {\n margin: '0 8px 0 0'\n },\n action: {\n 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 * @deprecated please use the Toast or MessageBar component\n * Apply styling to the Alert slots based on the state\n */ // eslint-disable-next-line @typescript-eslint/no-deprecated\nexport 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 // eslint-disable-next-line react-compiler/react-compiler\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,YAAY;;AACZ,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE;AACA,OAAO,MAAMC,eAAe,GAAG;EAC3BC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,iBAAiB;EACvBC,MAAM,EAAE,mBAAmB;EAC3BC,MAAM,EAAE;AACZ,CAAC;AACD,M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