@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
@@ -1,112 +0,0 @@
1
- import { tokens } from '@fluentui/react-theme';
2
- import { __styles, mergeClasses, shorthands } from '@griffel/react';
3
- export const alertClassNames = {
4
- root: 'fui-Alert',
5
- icon: 'fui-Alert__icon',
6
- action: 'fui-Alert__action',
7
- avatar: 'fui-Alert__avatar'
8
- };
9
-
10
- const useStyles = /*#__PURE__*/__styles({
11
- "root": {
12
- "mc9l5x": "f22iagw",
13
- "Bt984gj": "f122n59",
14
- "sshi5w": "f5pgtk9",
15
- "z8tnut": "f1g0x7ka",
16
- "z189sj": ["f11qrl6u", "fjlbh76"],
17
- "Byoj8tv": "f1qch9an",
18
- "uwmqm3": ["fjlbh76", "f11qrl6u"],
19
- "Bbmb7ep": ["fff7au0", "f1bjk9e1"],
20
- "Beyfa6y": ["f1bjk9e1", "fff7au0"],
21
- "B7oj6ja": ["fwsfkhu", "f8wkphi"],
22
- "Btl43ni": ["f8wkphi", "fwsfkhu"],
23
- "B4j52fo": "f5ogflp",
24
- "Bekrc4i": ["f1hqa2wf", "finvdd3"],
25
- "Bn0qgzm": "f1f09k3d",
26
- "ibv6hh": ["finvdd3", "f1hqa2wf"],
27
- "icvyot": "fzkkow9",
28
- "vrafjx": ["fcdblym", "fjik90z"],
29
- "oivjwe": "fg706s2",
30
- "wvpqe5": ["fjik90z", "fcdblym"],
31
- "g2u3we": "f1bh3yvw",
32
- "h3c5rm": ["fmi79ni", "f11fozsx"],
33
- "B9xav0g": "fnzw4c6",
34
- "zhjwy3": ["f11fozsx", "fmi79ni"],
35
- "E5pizo": "fz58gqq",
36
- "Be2twd7": "fkhj508",
37
- "Bhrd7zp": "fl43uef",
38
- "sj55zd": "f19n0e5",
39
- "De3pzq": "fxugw4r"
40
- },
41
- "inverted": {
42
- "sj55zd": "fqpbvvt",
43
- "De3pzq": "f5pduvr"
44
- },
45
- "icon": {
46
- "Bqenvij": "fd461yt",
47
- "Be2twd7": "f4ybsrx",
48
- "z8tnut": "f1g0x7ka",
49
- "z189sj": ["f19lj068", "f177v4lu"],
50
- "Byoj8tv": "f1qch9an",
51
- "uwmqm3": ["f1cnd47f", "fhxju0i"]
52
- },
53
- "avatar": {
54
- "B6of3ja": "f1hu3pq6",
55
- "t21cq0": ["f1phki43", "ff9s3yw"],
56
- "jrapky": "f19f4twv",
57
- "Frg6f3": ["f1tyq0we", "f11qmguv"]
58
- },
59
- "action": {
60
- "z8tnut": "f1g0x7ka",
61
- "z189sj": ["fhxju0i", "f1cnd47f"],
62
- "Byoj8tv": "f1qch9an",
63
- "uwmqm3": ["f1cnd47f", "fhxju0i"],
64
- "Bf4jedk": "fy77jfu",
65
- "Frg6f3": ["fcgxt0o", "f1ujusj6"],
66
- "sj55zd": "fyind8e"
67
- }
68
- }, {
69
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;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;}", ".f1bh3yvw{border-top-color:var(--colorTransparentStrokeInteractive);}", ".fmi79ni{border-right-color:var(--colorTransparentStrokeInteractive);}", ".f11fozsx{border-left-color:var(--colorTransparentStrokeInteractive);}", ".fnzw4c6{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".fz58gqq{box-shadow:var(--shadow8);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".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;}", ".fy77jfu{min-width:0;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".fyind8e{color:var(--colorBrandForegroundLink);}"]
70
- });
71
-
72
- const useIntentIconStyles = /*#__PURE__*/__styles({
73
- "success": {
74
- "sj55zd": "f1m7fhi8"
75
- },
76
- "error": {
77
- "sj55zd": "f1whyuy6"
78
- },
79
- "warning": {
80
- "sj55zd": "fpti2h4"
81
- },
82
- "info": {
83
- "sj55zd": "fkfq4zb"
84
- }
85
- }, {
86
- "d": [".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
87
- });
88
- /**
89
- * Apply styling to the Alert slots based on the state
90
- */
91
-
92
-
93
- export const useAlertStyles_unstable = state => {
94
- const styles = useStyles();
95
- const intentIconStyles = useIntentIconStyles();
96
- state.root.className = mergeClasses(alertClassNames.root, styles.root, state.appearance !== 'primary' && styles.inverted, state.root.className);
97
-
98
- if (state.icon) {
99
- state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && intentIconStyles[state.intent], state.icon.className);
100
- }
101
-
102
- if (state.avatar) {
103
- state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);
104
- }
105
-
106
- if (state.action) {
107
- state.action.className = mergeClasses(alertClassNames.action, styles.action, state.action.className);
108
- }
109
-
110
- return state;
111
- };
112
- //# sourceMappingURL=useAlertStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["components/Alert/useAlertStyles.ts"],"names":[],"mappings":"AAAA,SAAS,MAAT,QAAuB,uBAAvB;AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAKA,OAAO,MAAM,eAAe,GAA+B;EACzD,IAAI,EAAE,WADmD;EAEzD,IAAI,EAAE,iBAFmD;EAGzD,MAAM,EAAE,mBAHiD;EAIzD,MAAM,EAAE;AAJiD,CAApD;;AAOP,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;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AP;AACD,CA7BM","sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n\nimport type { AlertSlots, AlertState } from './Alert.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\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 ...shorthands.padding('0', '12px'),\n ...shorthands.borderRadius('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStrokeInteractive),\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.colorNeutralForegroundInverted,\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('0'),\n minWidth: 0,\n marginLeft: 'auto',\n color: tokens.colorBrandForegroundLink,\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\n/**\n * Apply styling to the Alert slots based on the state\n */\nexport const useAlertStyles_unstable = (state: AlertState): AlertState => {\n const styles = useStyles();\n const intentIconStyles = useIntentIconStyles();\n\n state.root.className = mergeClasses(\n alertClassNames.root,\n styles.root,\n state.appearance !== 'primary' && styles.inverted,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n alertClassNames.icon,\n styles.icon,\n state.intent && intentIconStyles[state.intent],\n state.icon.className,\n );\n }\n\n if (state.avatar) {\n state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);\n }\n\n if (state.action) {\n state.action.className = mergeClasses(alertClassNames.action, styles.action, state.action.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,123 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useAlertStyles_unstable = exports.alertClassNames = void 0;
7
-
8
- const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
-
10
- const react_1 = /*#__PURE__*/require("@griffel/react");
11
-
12
- exports.alertClassNames = {
13
- root: 'fui-Alert',
14
- icon: 'fui-Alert__icon',
15
- action: 'fui-Alert__action',
16
- avatar: 'fui-Alert__avatar'
17
- };
18
-
19
- const useStyles = /*#__PURE__*/react_1.__styles({
20
- "root": {
21
- "mc9l5x": "f22iagw",
22
- "Bt984gj": "f122n59",
23
- "sshi5w": "f5pgtk9",
24
- "z8tnut": "f1g0x7ka",
25
- "z189sj": ["f11qrl6u", "fjlbh76"],
26
- "Byoj8tv": "f1qch9an",
27
- "uwmqm3": ["fjlbh76", "f11qrl6u"],
28
- "Bbmb7ep": ["fff7au0", "f1bjk9e1"],
29
- "Beyfa6y": ["f1bjk9e1", "fff7au0"],
30
- "B7oj6ja": ["fwsfkhu", "f8wkphi"],
31
- "Btl43ni": ["f8wkphi", "fwsfkhu"],
32
- "B4j52fo": "f5ogflp",
33
- "Bekrc4i": ["f1hqa2wf", "finvdd3"],
34
- "Bn0qgzm": "f1f09k3d",
35
- "ibv6hh": ["finvdd3", "f1hqa2wf"],
36
- "icvyot": "fzkkow9",
37
- "vrafjx": ["fcdblym", "fjik90z"],
38
- "oivjwe": "fg706s2",
39
- "wvpqe5": ["fjik90z", "fcdblym"],
40
- "g2u3we": "f1bh3yvw",
41
- "h3c5rm": ["fmi79ni", "f11fozsx"],
42
- "B9xav0g": "fnzw4c6",
43
- "zhjwy3": ["f11fozsx", "fmi79ni"],
44
- "E5pizo": "fz58gqq",
45
- "Be2twd7": "fkhj508",
46
- "Bhrd7zp": "fl43uef",
47
- "sj55zd": "f19n0e5",
48
- "De3pzq": "fxugw4r"
49
- },
50
- "inverted": {
51
- "sj55zd": "fqpbvvt",
52
- "De3pzq": "f5pduvr"
53
- },
54
- "icon": {
55
- "Bqenvij": "fd461yt",
56
- "Be2twd7": "f4ybsrx",
57
- "z8tnut": "f1g0x7ka",
58
- "z189sj": ["f19lj068", "f177v4lu"],
59
- "Byoj8tv": "f1qch9an",
60
- "uwmqm3": ["f1cnd47f", "fhxju0i"]
61
- },
62
- "avatar": {
63
- "B6of3ja": "f1hu3pq6",
64
- "t21cq0": ["f1phki43", "ff9s3yw"],
65
- "jrapky": "f19f4twv",
66
- "Frg6f3": ["f1tyq0we", "f11qmguv"]
67
- },
68
- "action": {
69
- "z8tnut": "f1g0x7ka",
70
- "z189sj": ["fhxju0i", "f1cnd47f"],
71
- "Byoj8tv": "f1qch9an",
72
- "uwmqm3": ["f1cnd47f", "fhxju0i"],
73
- "Bf4jedk": "fy77jfu",
74
- "Frg6f3": ["fcgxt0o", "f1ujusj6"],
75
- "sj55zd": "fyind8e"
76
- }
77
- }, {
78
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;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;}", ".f1bh3yvw{border-top-color:var(--colorTransparentStrokeInteractive);}", ".fmi79ni{border-right-color:var(--colorTransparentStrokeInteractive);}", ".f11fozsx{border-left-color:var(--colorTransparentStrokeInteractive);}", ".fnzw4c6{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".fz58gqq{box-shadow:var(--shadow8);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".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;}", ".fy77jfu{min-width:0;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".fyind8e{color:var(--colorBrandForegroundLink);}"]
79
- });
80
-
81
- const useIntentIconStyles = /*#__PURE__*/react_1.__styles({
82
- "success": {
83
- "sj55zd": "f1m7fhi8"
84
- },
85
- "error": {
86
- "sj55zd": "f1whyuy6"
87
- },
88
- "warning": {
89
- "sj55zd": "fpti2h4"
90
- },
91
- "info": {
92
- "sj55zd": "fkfq4zb"
93
- }
94
- }, {
95
- "d": [".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
96
- });
97
- /**
98
- * Apply styling to the Alert slots based on the state
99
- */
100
-
101
-
102
- const useAlertStyles_unstable = state => {
103
- const styles = useStyles();
104
- const intentIconStyles = useIntentIconStyles();
105
- state.root.className = react_1.mergeClasses(exports.alertClassNames.root, styles.root, state.appearance !== 'primary' && styles.inverted, state.root.className);
106
-
107
- if (state.icon) {
108
- state.icon.className = react_1.mergeClasses(exports.alertClassNames.icon, styles.icon, state.intent && intentIconStyles[state.intent], state.icon.className);
109
- }
110
-
111
- if (state.avatar) {
112
- state.avatar.className = react_1.mergeClasses(exports.alertClassNames.avatar, styles.avatar, state.avatar.className);
113
- }
114
-
115
- if (state.action) {
116
- state.action.className = react_1.mergeClasses(exports.alertClassNames.action, styles.action, state.action.className);
117
- }
118
-
119
- return state;
120
- };
121
-
122
- exports.useAlertStyles_unstable = useAlertStyles_unstable;
123
- //# sourceMappingURL=useAlertStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["components/Alert/useAlertStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAKa,OAAA,CAAA,eAAA,GAA8C;EACzD,IAAI,EAAE,WADmD;EAEzD,IAAI,EAAE,iBAFmD;EAGzD,MAAM,EAAE,mBAHiD;EAIzD,MAAM,EAAE;AAJiD,CAA9C;;AAOb,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA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,EAAqC,MAAM,CAAC,MAA5C,EAAoD,KAAK,CAAC,MAAN,CAAa,SAAjE,CAAzB;EACD;;EAED,OAAO,KAAP;AACD,CA7BM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n\nimport type { AlertSlots, AlertState } from './Alert.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\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 ...shorthands.padding('0', '12px'),\n ...shorthands.borderRadius('4px'),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStrokeInteractive),\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.colorNeutralForegroundInverted,\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('0'),\n minWidth: 0,\n marginLeft: 'auto',\n color: tokens.colorBrandForegroundLink,\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\n/**\n * Apply styling to the Alert slots based on the state\n */\nexport const useAlertStyles_unstable = (state: AlertState): AlertState => {\n const styles = useStyles();\n const intentIconStyles = useIntentIconStyles();\n\n state.root.className = mergeClasses(\n alertClassNames.root,\n styles.root,\n state.appearance !== 'primary' && styles.inverted,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n alertClassNames.icon,\n styles.icon,\n state.intent && intentIconStyles[state.intent],\n state.icon.className,\n );\n }\n\n if (state.avatar) {\n state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);\n }\n\n if (state.action) {\n state.action.className = mergeClasses(alertClassNames.action, styles.action, state.action.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}