@fluentui/react-alert 9.0.0-beta.99 → 9.74.3-experimental.esm.20260709-49ee7a20cf.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +532 -2
  2. package/dist/index.d.cts +87 -0
  3. package/dist/index.d.ts +3 -5
  4. package/lib/Alert.js +1 -1
  5. package/lib/Alert.js.map +1 -1
  6. package/lib/components/Alert/Alert.js +11 -10
  7. package/lib/components/Alert/Alert.js.map +1 -1
  8. package/lib/components/Alert/Alert.types.js +4 -0
  9. package/lib/components/Alert/Alert.types.js.map +1 -1
  10. package/lib/components/Alert/index.js +4 -5
  11. package/lib/components/Alert/index.js.map +1 -1
  12. package/lib/components/Alert/renderAlert.js +3 -3
  13. package/lib/components/Alert/renderAlert.js.map +1 -1
  14. package/lib/components/Alert/useAlert.js +6 -6
  15. package/lib/components/Alert/useAlert.js.map +1 -1
  16. package/lib/components/Alert/useAlertStyles.styles.js +71 -40
  17. package/lib/components/Alert/useAlertStyles.styles.js.map +1 -1
  18. package/lib/components/Alert/useAlertStyles.styles.raw.js +110 -0
  19. package/lib/components/Alert/useAlertStyles.styles.raw.js.map +1 -0
  20. package/lib/index.js +2 -2
  21. package/lib/index.js.map +1 -1
  22. package/lib-commonjs/Alert.cjs +28 -0
  23. package/lib-commonjs/Alert.cjs.map +1 -0
  24. package/lib-commonjs/components/Alert/{Alert.js → Alert.cjs} +9 -8
  25. package/lib-commonjs/components/Alert/Alert.cjs.map +1 -0
  26. package/lib-commonjs/components/Alert/Alert.types.cjs +8 -0
  27. package/lib-commonjs/components/Alert/Alert.types.cjs.map +1 -0
  28. package/lib-commonjs/components/Alert/index.cjs +31 -0
  29. package/lib-commonjs/components/Alert/index.cjs.map +1 -0
  30. package/lib-commonjs/components/Alert/{renderAlert.js → renderAlert.cjs} +1 -1
  31. package/lib-commonjs/components/Alert/renderAlert.cjs.map +1 -0
  32. package/lib-commonjs/components/Alert/useAlert.cjs.map +1 -0
  33. package/lib-commonjs/components/Alert/{useAlertStyles.styles.js → useAlertStyles.styles.cjs} +100 -119
  34. package/lib-commonjs/components/Alert/useAlertStyles.styles.cjs.map +1 -0
  35. package/lib-commonjs/components/Alert/useAlertStyles.styles.raw.cjs +123 -0
  36. package/lib-commonjs/components/Alert/useAlertStyles.styles.raw.cjs.map +1 -0
  37. package/lib-commonjs/{index.js → index.cjs} +2 -2
  38. package/lib-commonjs/index.cjs.map +1 -0
  39. package/package.json +26 -47
  40. package/lib-commonjs/Alert.js +0 -6
  41. package/lib-commonjs/Alert.js.map +0 -1
  42. package/lib-commonjs/components/Alert/Alert.js.map +0 -1
  43. package/lib-commonjs/components/Alert/Alert.types.js +0 -4
  44. package/lib-commonjs/components/Alert/Alert.types.js.map +0 -1
  45. package/lib-commonjs/components/Alert/index.js +0 -10
  46. package/lib-commonjs/components/Alert/index.js.map +0 -1
  47. package/lib-commonjs/components/Alert/renderAlert.js.map +0 -1
  48. package/lib-commonjs/components/Alert/useAlert.js.map +0 -1
  49. package/lib-commonjs/components/Alert/useAlertStyles.styles.js.map +0 -1
  50. package/lib-commonjs/index.js.map +0 -1
  51. /package/lib-commonjs/components/Alert/{useAlert.js → useAlert.cjs} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- /// <reference types="react" />
2
-
3
- import { Avatar } from '@fluentui/react-avatar';
4
- import { Button } from '@fluentui/react-button';
1
+ import type { Avatar } from '@fluentui/react-avatar';
2
+ import type { Button } from '@fluentui/react-button';
5
3
  import type { ComponentProps } from '@fluentui/react-utilities';
6
4
  import type { ComponentState } from '@fluentui/react-utilities';
7
5
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
@@ -66,7 +64,7 @@ export declare type AlertState = ComponentState<AlertSlots> & Pick<AlertProps, '
66
64
  /**
67
65
  * @deprecated please use the Toast or MessageBar component
68
66
  */
69
- export declare const renderAlert_unstable: (state: AlertState) => JSX.Element;
67
+ export declare const renderAlert_unstable: (state: AlertState) => React_2.ReactElement;
70
68
 
71
69
  /**
72
70
  * @deprecated please use the Toast or MessageBar component
package/lib/Alert.js CHANGED
@@ -1 +1 @@
1
- export * from './components/Alert/index';
1
+ /* eslint-disable @typescript-eslint/no-deprecated */ export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from "./components/Alert/index.js";
package/lib/Alert.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["Alert.ts"],"sourcesContent":["export * from './components/Alert/index';\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B"}
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,8BAA2B"}
@@ -1,20 +1,21 @@
1
- import * as React from 'react';
2
- import { renderAlert_unstable } from './renderAlert';
3
- import { useAlert_unstable } from './useAlert';
4
- import { useAlertStyles_unstable } from './useAlertStyles.styles';
1
+ 'use client';
2
+ import * as React from "react";
3
+ import { renderAlert_unstable } from "./renderAlert.js";
4
+ import { useAlert_unstable } from "./useAlert.js";
5
+ import { useAlertStyles_unstable } from "./useAlertStyles.styles.js";
5
6
  /**
6
7
  * @deprecated please use the Toast or MessageBar component
7
8
  * An Alert component displays a brief, important message to attract a user's attention
8
9
  * without interrupting their current task.
9
- */ // eslint-disable-next-line deprecation/deprecation
10
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
10
11
  export const Alert = /*#__PURE__*/ React.forwardRef((props, ref)=>{
11
- // eslint-disable-next-line deprecation/deprecation
12
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
12
13
  const state = useAlert_unstable(props, ref);
13
- // eslint-disable-next-line deprecation/deprecation
14
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
14
15
  useAlertStyles_unstable(state);
15
- // eslint-disable-next-line deprecation/deprecation
16
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
16
17
  return renderAlert_unstable(state);
17
- // eslint-disable-next-line deprecation/deprecation
18
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
18
19
  });
19
- // eslint-disable-next-line deprecation/deprecation
20
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
20
21
  Alert.displayName = 'Alert';
@@ -1 +1 @@
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 * @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 deprecation/deprecation\nexport const Alert: ForwardRefComponent<AlertProps> = React.forwardRef((props, ref) => {\n // eslint-disable-next-line deprecation/deprecation\n const state = useAlert_unstable(props, ref);\n\n // eslint-disable-next-line deprecation/deprecation\n useAlertStyles_unstable(state);\n // eslint-disable-next-line deprecation/deprecation\n return renderAlert_unstable(state);\n // eslint-disable-next-line deprecation/deprecation\n}) as ForwardRefComponent<AlertProps>;\n\n// eslint-disable-next-line deprecation/deprecation\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;;;;CAIC,GACD,mDAAmD;AACnD,OAAO,MAAMC,sBAAyCJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC7E,mDAAmD;IACnD,MAAMC,QAAQN,kBAAkBI,OAAOC;IAEvC,mDAAmD;IACnDJ,wBAAwBK;IACxB,mDAAmD;IACnD,OAAOP,qBAAqBO;AAC5B,mDAAmD;AACrD,GAAsC;AAEtC,mDAAmD;AACnDJ,MAAMK,WAAW,GAAG"}
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,mBAAgB;AACrD,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,uBAAuB,QAAQ,6BAA0B;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 +1,5 @@
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
1
5
  export { };
@@ -1 +1 @@
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\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 deprecation/deprecation\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 deprecation/deprecation\nexport type AlertState = ComponentState<AlertSlots> &\n // eslint-disable-next-line deprecation/deprecation\n Pick<AlertProps, 'intent'> &\n // eslint-disable-next-line deprecation/deprecation\n Required<Pick<AlertProps, 'appearance'>>;\n"],"names":[],"mappings":"AAAA,WAsD2C"}
1
+ {"version":3,"sources":["../src/components/Alert/Alert.types.ts"],"sourcesContent":["import type { Avatar } from '@fluentui/react-avatar';\nimport type { 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,5 +1,4 @@
1
- export * from './Alert';
2
- export * from './Alert.types';
3
- export * from './renderAlert';
4
- export * from './useAlert';
5
- export * from './useAlertStyles.styles';
1
+ /* eslint-disable @typescript-eslint/no-deprecated */ export { Alert } from "./Alert.js";
2
+ export { renderAlert_unstable } from "./renderAlert.js";
3
+ export { useAlert_unstable } from "./useAlert.js";
4
+ export { alertClassNames, useAlertStyles_unstable } from "./useAlertStyles.styles.js";
@@ -1 +1 @@
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
+ {"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,aAAU;AAEhC,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,6BAA0B"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from '@fluentui/react-utilities';
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * @deprecated please use the Toast or MessageBar component
5
- */ // eslint-disable-next-line deprecation/deprecation
5
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
6
6
  export const renderAlert_unstable = (state)=>{
7
- // eslint-disable-next-line deprecation/deprecation
7
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
8
8
  assertSlots(state);
9
9
  return /*#__PURE__*/ _jsxs(state.root, {
10
10
  children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["renderAlert.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\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 deprecation/deprecation\nexport const renderAlert_unstable = (state: AlertState) => {\n // eslint-disable-next-line deprecation/deprecation\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;AAIxD;;CAEC,GACD,mDAAmD;AACnD,OAAO,MAAMC,uBAAuB,CAACC;IACnC,mDAAmD;IACnDF,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"}
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"}
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
- import { Avatar } from '@fluentui/react-avatar';
3
- import { Button } from '@fluentui/react-button';
4
- import { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';
5
- import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
1
+ import * as React from "react";
2
+ import { Avatar } from "@fluentui/react-avatar";
3
+ import { Button } from "@fluentui/react-button";
4
+ import { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from "@fluentui/react-icons";
5
+ import { getIntrinsicElementProps, slot } from "@fluentui/react-utilities";
6
6
  /**
7
7
  * @deprecated please use the Toast or MessageBar component
8
8
  * Create the state required to render Alert.
@@ -12,7 +12,7 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
12
12
  *
13
13
  * @param props - props from this instance of Alert
14
14
  * @param ref - reference to root HTMLElement of Alert
15
- */ // eslint-disable-next-line deprecation/deprecation
15
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
16
16
  export const useAlert_unstable = (props, ref)=>{
17
17
  const { appearance = 'primary', intent } = props;
18
18
  /** Determine the role and icon to render based on the intent */ let defaultIcon;
@@ -1 +1 @@
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 { 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 deprecation/deprecation\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,SAASC,qBAAqB,EAAEC,mBAAmB,EAAEC,UAAU,EAAEC,aAAa,QAAQ,wBAAwB;AAC9G,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAI3E;;;;;;;;;CASC,GACD,mDAAmD;AACnD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,aAAa,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAE3C,8DAA8D,GAC9D,IAAII;IACJ,IAAIC,cAAc;IAClB,OAAQF;QACN,KAAK;YACHC,4BAAc,oBAACX;YACf;QACF,KAAK;YACHW,4BAAc,oBAACV;YACfW,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACR;YACfS,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACT;YACf;IACJ;IAEA,MAAMW,SAASR,KAAKS,QAAQ,CAACP,MAAMM,MAAM,EAAE;QAAEE,cAAc;YAAEN,YAAY;QAAc;QAAGO,aAAajB;IAAO;IAC9G,MAAMkB,SAASZ,KAAKS,QAAQ,CAACP,MAAMU,MAAM,EAAE;QAAED,aAAalB;IAAO;IACjE,IAAIoB;IACJ,8DAA8D,GAAG,IAAI,CAACD,QAAQ;QAC5EC,OAAOb,KAAKS,QAAQ,CAACP,MAAMW,IAAI,EAAE;YAC/BH,cAAc;gBAAEI,UAAUR;YAAY;YACtCS,iBAAiB,CAAC,CAACb,MAAMG,MAAM;YAC/BM,aAAa;QACf;IACF;IACA,OAAO;QACLH;QACAJ;QACAQ;QACAI,YAAY;YAAEC,MAAM;YAAOJ,MAAM;YAAQL,QAAQd;YAAQkB,QAAQnB;QAAO;QACxEoB;QACAR;QACAY,MAAMjB,KAAKkB,MAAM,CACfnB,yBAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FI,KAAKA;YACLgB,MAAMZ;YACNO,UAAUZ,MAAMY,QAAQ;YACxB,GAAGZ,KAAK;QACV,IACA;YAAES,aAAa;QAAM;IAEzB;AACF,EAAE"}
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,SAASC,qBAAqB,EAAEC,mBAAmB,EAAEC,UAAU,EAAEC,aAAa,QAAQ,wBAAwB;AAC9G,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAI3E;;;;;;;;;CASC,GACD,4DAA4D;AAC5D,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,aAAa,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAE3C,8DAA8D,GAC9D,IAAII;IACJ,IAAIC,cAAc;IAClB,OAAQF;QACN,KAAK;YACHC,4BAAc,oBAACX;YACf;QACF,KAAK;YACHW,4BAAc,oBAACV;YACfW,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACR;YACfS,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACT;YACf;IACJ;IAEA,MAAMW,SAASR,KAAKS,QAAQ,CAACP,MAAMM,MAAM,EAAE;QAAEE,cAAc;YAAEN,YAAY;QAAc;QAAGO,aAAajB;IAAO;IAC9G,MAAMkB,SAASZ,KAAKS,QAAQ,CAACP,MAAMU,MAAM,EAAE;QAAED,aAAalB;IAAO;IACjE,IAAIoB;IACJ,8DAA8D,GAAG,IAAI,CAACD,QAAQ;QAC5EC,OAAOb,KAAKS,QAAQ,CAACP,MAAMW,IAAI,EAAE;YAC/BH,cAAc;gBAAEI,UAAUR;YAAY;YACtCS,iBAAiB,CAAC,CAACb,MAAMG,MAAM;YAC/BM,aAAa;QACf;IACF;IACA,OAAO;QACLH;QACAJ;QACAQ;QACAI,YAAY;YAAEC,MAAM;YAAOJ,MAAM;YAAQL,QAAQd;YAAQkB,QAAQnB;QAAO;QACxEoB;QACAR;QACAY,MAAMjB,KAAKkB,MAAM,CACfnB,yBAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FI,KAAKA;YACLgB,MAAMZ;YACNO,UAAUZ,MAAMY,QAAQ;YACxB,GAAGZ,KAAK;QACV,IACA;YAAES,aAAa;QAAM;IAEzB;AACF,EAAE"}
@@ -1,7 +1,9 @@
1
- import { tokens } from '@fluentui/react-theme';
2
- import { __styles, mergeClasses, shorthands } from '@griffel/react';
3
- import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
4
- // eslint-disable-next-line deprecation/deprecation
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
5
7
  export const alertClassNames = {
6
8
  root: 'fui-Alert',
7
9
  icon: 'fui-Alert__icon',
@@ -13,26 +15,33 @@ const useStyles = /*#__PURE__*/__styles({
13
15
  mc9l5x: "f22iagw",
14
16
  Bt984gj: "f122n59",
15
17
  sshi5w: "f5pgtk9",
16
- z8tnut: "f1g0x7ka",
17
- z189sj: ["f11qrl6u", "fjlbh76"],
18
- Byoj8tv: "f1qch9an",
19
- uwmqm3: ["fjlbh76", "f11qrl6u"],
20
- Bbmb7ep: ["fff7au0", "f1bjk9e1"],
21
- Beyfa6y: ["f1bjk9e1", "fff7au0"],
22
- B7oj6ja: ["fwsfkhu", "f8wkphi"],
23
- Btl43ni: ["f8wkphi", "fwsfkhu"],
24
- B4j52fo: "f5ogflp",
25
- Bekrc4i: ["f1hqa2wf", "finvdd3"],
26
- Bn0qgzm: "f1f09k3d",
27
- ibv6hh: ["finvdd3", "f1hqa2wf"],
28
- icvyot: "fzkkow9",
29
- vrafjx: ["fcdblym", "fjik90z"],
30
- oivjwe: "fg706s2",
31
- wvpqe5: ["fjik90z", "fcdblym"],
32
- g2u3we: "fghlq4f",
33
- h3c5rm: ["f1gn591s", "fjscplz"],
34
- B9xav0g: "fb073pr",
35
- zhjwy3: ["fjscplz", "f1gn591s"],
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",
36
45
  E5pizo: "fz58gqq",
37
46
  Be2twd7: "fkhj508",
38
47
  Bhrd7zp: "fl43uef",
@@ -46,28 +55,47 @@ const useStyles = /*#__PURE__*/__styles({
46
55
  icon: {
47
56
  Bqenvij: "fd461yt",
48
57
  Be2twd7: "f4ybsrx",
49
- z8tnut: "f1g0x7ka",
50
- z189sj: ["f19lj068", "f177v4lu"],
51
- Byoj8tv: "f1qch9an",
52
- uwmqm3: ["f1cnd47f", "fhxju0i"]
58
+ Byoj8tv: 0,
59
+ uwmqm3: 0,
60
+ z189sj: 0,
61
+ z8tnut: 0,
62
+ B0ocmuz: ["fhivll6", "f1cgepy8"]
53
63
  },
54
64
  avatar: {
55
- B6of3ja: "f1hu3pq6",
56
- t21cq0: ["f1phki43", "ff9s3yw"],
57
- jrapky: "f19f4twv",
58
- Frg6f3: ["f1tyq0we", "f11qmguv"]
65
+ jrapky: 0,
66
+ Frg6f3: 0,
67
+ t21cq0: 0,
68
+ B6of3ja: 0,
69
+ B74szlk: ["fxal17o", "ftghr3s"]
59
70
  },
60
71
  action: {
61
- z8tnut: "f1sbtcvk",
62
- z189sj: ["f81rol6", "frdkuqy"],
63
- Byoj8tv: "fdghr9",
64
- uwmqm3: ["frdkuqy", "f81rol6"],
72
+ Byoj8tv: 0,
73
+ uwmqm3: 0,
74
+ z189sj: 0,
75
+ z8tnut: 0,
76
+ B0ocmuz: "f4jnnbt",
65
77
  Bf4jedk: "fy77jfu",
66
78
  Frg6f3: ["fcgxt0o", "f1ujusj6"],
67
79
  sj55zd: "f16muhyy"
68
80
  }
69
81
  }, {
70
- 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);}"]
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);}"]
71
99
  });
72
100
  const useIntentIconStyles = /*#__PURE__*/__styles({
73
101
  success: {
@@ -116,24 +144,27 @@ const useActionButtonColorInverted = /*#__PURE__*/__styles({
116
144
  /**
117
145
  * @deprecated please use the Toast or MessageBar component
118
146
  * Apply styling to the Alert slots based on the state
119
- */ // eslint-disable-next-line deprecation/deprecation
147
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
120
148
  export const useAlertStyles_unstable = state => {
121
149
  const inverted = state.appearance === 'inverted';
122
150
  const styles = useStyles();
123
151
  const intentIconStylesPrimary = useIntentIconStyles();
124
152
  const intentIconStylesInverted = useIntentIconStylesInverted();
125
153
  const actionStylesInverted = useActionButtonColorInverted();
154
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
126
155
  state.root.className = mergeClasses(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);
127
156
  if (state.icon) {
157
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
128
158
  state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]), state.icon.className);
129
159
  }
130
160
  if (state.avatar) {
161
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
131
162
  state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);
132
163
  }
133
164
  if (state.action) {
134
165
  // Note: inverted && actionStylesInverted.action has the highest piority and must be merged last
166
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
135
167
  state.action.className = mergeClasses(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);
136
168
  }
137
169
  return state;
138
- };
139
- //# sourceMappingURL=useAlertStyles.styles.js.map
170
+ };
@@ -1 +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';\n// eslint-disable-next-line deprecation/deprecation\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 * @deprecated please use the Toast or MessageBar component\n * Apply styling to the Alert slots based on the state\n */ // eslint-disable-next-line deprecation/deprecation\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 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;AACA,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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CAACtD,IAAI,CAAC4D,SAAS,GAAGhE,YAAY,CAACG,eAAe,CAACC,IAAI,EAAEwD,MAAM,CAACxD,IAAI,EAAEiC,QAAQ,IAAIuB,MAAM,CAACvB,QAAQ,EAAEqB,KAAK,CAACtD,IAAI,CAAC4D,SAAS,CAAC;EACzH,IAAIN,KAAK,CAACrD,IAAI,EAAE;IACZqD,KAAK,CAACrD,IAAI,CAAC2D,SAAS,GAAGhE,YAAY,CAACG,eAAe,CAACE,IAAI,EAAEuD,MAAM,CAACvD,IAAI,EAAEqD,KAAK,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"}
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-hooks/immutability -- deprecated component, not worth refactoring\n state.root.className = mergeClasses(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring\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 // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring\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 // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring\n state.action.className = mergeClasses(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);\n }\n return state;\n};\n"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AM,CAACzB,QAAQ,EAAEuB,KAAK,CAAC/D,IAAI,CAACqE,SAAS,CAAC;EACzH,IAAIN,KAAK,CAAC9D,IAAI,EAAE;IACZ;IACA8D,KAAK,CAAC9D,IAAI,CAACoE,SAAS,GAAGzE,YAAY,CAACG,eAAe,CAACE,IAAI,EAAEgE,MAAM,CAAChE,IAAI,EAAE8D,KAAK,CAACO,MAAM,KAAK9B,QAAQ,GAAG2B,wBAAwB,CAACJ,KAAK,CAACO,MAAM,CAAC,GAAGJ,uBAAuB,CAACH,KAAK,CAACO,MAAM,CAAC,CAAC,EAAEP,KAAK,CAAC9D,IAAI,CAACoE,SAAS,CAAC;EAC7M;EACA,IAAIN,KAAK,CAAC5D,MAAM,EAAE;IACd;IACA4D,KAAK,CAAC5D,MAAM,CAACkE,SAAS,GAAGzE,YAAY,CAACG,eAAe,CAACI,MAAM,EAAE8D,MAAM,CAAC9D,MAAM,EAAE4D,KAAK,CAAC5D,MAAM,CAACkE,SAAS,CAAC;EACxG;EACA,IAAIN,KAAK,CAAC7D,MAAM,EAAE;IACd;IACA;IACA6D,KAAK,CAAC7D,MAAM,CAACmE,SAAS,GAAGzE,YAAY,CAACG,eAAe,CAACG,MAAM,EAAE+D,MAAM,CAAC/D,MAAM,EAAEsC,QAAQ,IAAI4B,oBAAoB,CAAClE,MAAM,EAAE6D,KAAK,CAAC7D,MAAM,CAACmE,SAAS,CAAC;EACjJ;EACA,OAAON,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,110 @@
1
+ 'use client';
2
+ import { tokens } from "@fluentui/react-theme";
3
+ import { makeStyles, mergeClasses, shorthands } from "@griffel/react";
4
+ import { createCustomFocusIndicatorStyle } from "@fluentui/react-tabster";
5
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
6
+ export const alertClassNames = {
7
+ root: 'fui-Alert',
8
+ icon: 'fui-Alert__icon',
9
+ action: 'fui-Alert__action',
10
+ avatar: 'fui-Alert__avatar'
11
+ };
12
+ const useStyles = makeStyles({
13
+ root: {
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ minHeight: '44px',
17
+ padding: '0 12px',
18
+ borderRadius: '4px',
19
+ border: `1px solid ${tokens.colorTransparentStroke}`,
20
+ boxShadow: tokens.shadow8,
21
+ fontSize: tokens.fontSizeBase300,
22
+ fontWeight: tokens.fontWeightSemibold,
23
+ color: tokens.colorNeutralForeground1,
24
+ backgroundColor: tokens.colorNeutralBackground1
25
+ },
26
+ inverted: {
27
+ color: tokens.colorNeutralForegroundInverted2,
28
+ backgroundColor: tokens.colorNeutralBackgroundInverted
29
+ },
30
+ icon: {
31
+ height: '16px',
32
+ fontSize: '16px',
33
+ padding: '0 8px 0 0'
34
+ },
35
+ avatar: {
36
+ margin: '0 8px 0 0'
37
+ },
38
+ action: {
39
+ padding: '5px 10px',
40
+ minWidth: 0,
41
+ marginLeft: 'auto',
42
+ color: tokens.colorBrandForeground1
43
+ }
44
+ });
45
+ const useIntentIconStyles = makeStyles({
46
+ success: {
47
+ color: tokens.colorPaletteGreenForeground3
48
+ },
49
+ error: {
50
+ color: tokens.colorPaletteRedForeground3
51
+ },
52
+ warning: {
53
+ color: tokens.colorPaletteYellowForeground2
54
+ },
55
+ info: {
56
+ color: tokens.colorNeutralForeground2
57
+ }
58
+ });
59
+ const useIntentIconStylesInverted = makeStyles({
60
+ success: {
61
+ color: tokens.colorPaletteGreenForegroundInverted
62
+ },
63
+ error: {
64
+ color: tokens.colorPaletteRedForegroundInverted
65
+ },
66
+ warning: {
67
+ color: tokens.colorPaletteYellowForegroundInverted
68
+ },
69
+ info: {
70
+ color: tokens.colorNeutralForegroundInverted2
71
+ }
72
+ });
73
+ const useActionButtonColorInverted = makeStyles({
74
+ action: {
75
+ color: tokens.colorBrandForegroundInverted,
76
+ ...createCustomFocusIndicatorStyle({
77
+ ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),
78
+ outlineColor: tokens.colorNeutralBackground5Pressed
79
+ }, {
80
+ enableOutline: true
81
+ })
82
+ }
83
+ });
84
+ /**
85
+ * @deprecated please use the Toast or MessageBar component
86
+ * Apply styling to the Alert slots based on the state
87
+ */ // eslint-disable-next-line @typescript-eslint/no-deprecated
88
+ export const useAlertStyles_unstable = (state)=>{
89
+ const inverted = state.appearance === 'inverted';
90
+ const styles = useStyles();
91
+ const intentIconStylesPrimary = useIntentIconStyles();
92
+ const intentIconStylesInverted = useIntentIconStylesInverted();
93
+ const actionStylesInverted = useActionButtonColorInverted();
94
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
95
+ state.root.className = mergeClasses(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);
96
+ if (state.icon) {
97
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
98
+ state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]), state.icon.className);
99
+ }
100
+ if (state.avatar) {
101
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
102
+ state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);
103
+ }
104
+ if (state.action) {
105
+ // Note: inverted && actionStylesInverted.action has the highest piority and must be merged last
106
+ // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring
107
+ state.action.className = mergeClasses(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);
108
+ }
109
+ return state;
110
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Alert/useAlertStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport type { AlertSlots, AlertState } from './Alert.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const alertClassNames: SlotClassNames<AlertSlots> = {\n root: 'fui-Alert',\n icon: 'fui-Alert__icon',\n action: 'fui-Alert__action',\n avatar: 'fui-Alert__avatar',\n};\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: { margin: '0 8px 0 0' },\n action: {\n padding: '5px 10px',\n minWidth: 0,\n marginLeft: 'auto',\n color: tokens.colorBrandForeground1,\n },\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});\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});\n\nconst useActionButtonColorInverted = makeStyles({\n action: {\n color: tokens.colorBrandForegroundInverted,\n ...createCustomFocusIndicatorStyle(\n {\n ...shorthands.borderColor(tokens.colorTransparentStrokeInteractive),\n outlineColor: tokens.colorNeutralBackground5Pressed,\n },\n { enableOutline: true },\n ),\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 */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const useAlertStyles_unstable = (state: AlertState): AlertState => {\n const inverted = state.appearance === 'inverted';\n const styles = useStyles();\n const intentIconStylesPrimary = useIntentIconStyles();\n const intentIconStylesInverted = useIntentIconStylesInverted();\n const actionStylesInverted = useActionButtonColorInverted();\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring\n state.root.className = mergeClasses(\n alertClassNames.root,\n styles.root,\n inverted && styles.inverted,\n state.root.className,\n );\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring\n state.icon.className = mergeClasses(\n alertClassNames.icon,\n styles.icon,\n state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]),\n state.icon.className,\n );\n }\n\n if (state.avatar) {\n // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring\n state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);\n }\n\n if (state.action) {\n // Note: inverted && actionStylesInverted.action has the highest piority and must be merged last\n // eslint-disable-next-line react-hooks/immutability -- deprecated component, not worth refactoring\n state.action.className = mergeClasses(\n alertClassNames.action,\n styles.action,\n inverted && actionStylesInverted.action,\n state.action.className,\n );\n }\n\n return state;\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","createCustomFocusIndicatorStyle","alertClassNames","root","icon","action","avatar","useStyles","display","alignItems","minHeight","padding","borderRadius","border","colorTransparentStroke","boxShadow","shadow8","fontSize","fontSizeBase300","fontWeight","fontWeightSemibold","color","colorNeutralForeground1","backgroundColor","colorNeutralBackground1","inverted","colorNeutralForegroundInverted2","colorNeutralBackgroundInverted","height","margin","minWidth","marginLeft","colorBrandForeground1","useIntentIconStyles","success","colorPaletteGreenForeground3","error","colorPaletteRedForeground3","warning","colorPaletteYellowForeground2","info","colorNeutralForeground2","useIntentIconStylesInverted","colorPaletteGreenForegroundInverted","colorPaletteRedForegroundInverted","colorPaletteYellowForegroundInverted","useActionButtonColorInverted","colorBrandForegroundInverted","borderColor","colorTransparentStrokeInteractive","outlineColor","colorNeutralBackground5Pressed","enableOutline","useAlertStyles_unstable","state","appearance","styles","intentIconStylesPrimary","intentIconStylesInverted","actionStylesInverted","className","intent"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACtE,SAASC,+BAA+B,QAAQ,0BAA0B;AAI1E,4DAA4D;AAC5D,OAAO,MAAMC,kBAA8C;IACzDC,MAAM;IACNC,MAAM;IACNC,QAAQ;IACRC,QAAQ;AACV,EAAE;AAEF,MAAMC,YAAYT,WAAW;IAC3BK,MAAM;QACJK,SAAS;QACTC,YAAY;QACZC,WAAW;QACXC,SAAS;QACTC,cAAc;QACdC,QAAQ,CAAC,UAAU,EAAEhB,OAAOiB,sBAAsB,EAAE;QACpDC,WAAWlB,OAAOmB,OAAO;QACzBC,UAAUpB,OAAOqB,eAAe;QAChCC,YAAYtB,OAAOuB,kBAAkB;QACrCC,OAAOxB,OAAOyB,uBAAuB;QACrCC,iBAAiB1B,OAAO2B,uBAAuB;IACjD;IACAC,UAAU;QACRJ,OAAOxB,OAAO6B,+BAA+B;QAC7CH,iBAAiB1B,OAAO8B,8BAA8B;IACxD;IACAvB,MAAM;QACJwB,QAAQ;QACRX,UAAU;QACVN,SAAS;IACX;IACAL,QAAQ;QAAEuB,QAAQ;IAAY;IAC9BxB,QAAQ;QACNM,SAAS;QACTmB,UAAU;QACVC,YAAY;QACZV,OAAOxB,OAAOmC,qBAAqB;IACrC;AACF;AAEA,MAAMC,sBAAsBnC,WAAW;IACrCoC,SAAS;QACPb,OAAOxB,OAAOsC,4BAA4B;IAC5C;IACAC,OAAO;QACLf,OAAOxB,OAAOwC,0BAA0B;IAC1C;IACAC,SAAS;QACPjB,OAAOxB,OAAO0C,6BAA6B;IAC7C;IACAC,MAAM;QACJnB,OAAOxB,OAAO4C,uBAAuB;IACvC;AACF;AAEA,MAAMC,8BAA8B5C,WAAW;IAC7CoC,SAAS;QACPb,OAA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MAAM,EAAEgD,MAAMhD,MAAM,CAACsD,SAAS;IACrG;IAEA,IAAIN,MAAMjD,MAAM,EAAE;QAChB,gGAAgG;QAChG,mGAAmG;QACnGiD,MAAMjD,MAAM,CAACuD,SAAS,GAAG7D,aACvBG,gBAAgBG,MAAM,EACtBmD,OAAOnD,MAAM,EACboB,YAAYkC,qBAAqBtD,MAAM,EACvCiD,MAAMjD,MAAM,CAACuD,SAAS;IAE1B;IAEA,OAAON;AACT,EAAE"}
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- // eslint-disable-next-line deprecation/deprecation
2
- export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';
1
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
2
+ export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from "./Alert.js";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["// eslint-disable-next-line deprecation/deprecation\nexport { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';\n// eslint-disable-next-line deprecation/deprecation\nexport type { AlertProps, AlertSlots, AlertState } from './Alert';\n"],"names":["Alert","alertClassNames","renderAlert_unstable","useAlertStyles_unstable","useAlert_unstable"],"mappings":"AAAA,mDAAmD;AACnD,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,UAAU"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport type { AlertProps, AlertSlots, AlertState } from './Alert';\n"],"names":["Alert","alertClassNames","renderAlert_unstable","useAlertStyles_unstable","useAlert_unstable"],"mappings":"AAAA,4DAA4D;AAC5D,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,aAAU"}
@@ -0,0 +1,28 @@
1
+ /* eslint-disable @typescript-eslint/no-deprecated */ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ Alert: function() {
13
+ return _index.Alert;
14
+ },
15
+ alertClassNames: function() {
16
+ return _index.alertClassNames;
17
+ },
18
+ renderAlert_unstable: function() {
19
+ return _index.renderAlert_unstable;
20
+ },
21
+ useAlertStyles_unstable: function() {
22
+ return _index.useAlertStyles_unstable;
23
+ },
24
+ useAlert_unstable: function() {
25
+ return _index.useAlert_unstable;
26
+ }
27
+ });
28
+ const _index = require("./components/Alert/index.cjs");
@@ -0,0 +1 @@
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;;;;;;;;;;;;eACEA,YAAK;;;eACLC,sBAAe;;;eACfC,2BAAoB;;;eACpBC,8BAAuB;;;eACvBC,wBAAiB;;;uBACZ,8BAA2B"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -10,17 +11,17 @@ Object.defineProperty(exports, "Alert", {
10
11
  });
11
12
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
13
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
- const _renderAlert = require("./renderAlert");
14
- const _useAlert = require("./useAlert");
15
- const _useAlertStylesstyles = require("./useAlertStyles.styles");
14
+ const _renderAlert = require("./renderAlert.cjs");
15
+ const _useAlert = require("./useAlert.cjs");
16
+ const _useAlertStylesstyles = require("./useAlertStyles.styles.cjs");
16
17
  const Alert = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
17
- // eslint-disable-next-line deprecation/deprecation
18
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
18
19
  const state = (0, _useAlert.useAlert_unstable)(props, ref);
19
- // eslint-disable-next-line deprecation/deprecation
20
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
20
21
  (0, _useAlertStylesstyles.useAlertStyles_unstable)(state);
21
- // eslint-disable-next-line deprecation/deprecation
22
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
22
23
  return (0, _renderAlert.renderAlert_unstable)(state);
23
- // eslint-disable-next-line deprecation/deprecation
24
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
24
25
  });
25
- // eslint-disable-next-line deprecation/deprecation
26
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
26
27
  Alert.displayName = 'Alert';