@fluentui/react-alert 9.0.0-beta.9 → 9.0.0-beta.90
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.
- package/CHANGELOG.json +2901 -1
- package/CHANGELOG.md +995 -2
- package/README.md +5 -3
- package/dist/index.d.ts +11 -0
- package/lib/Alert.js +0 -1
- package/lib/Alert.js.map +1 -1
- package/lib/components/Alert/Alert.js +12 -8
- package/lib/components/Alert/Alert.js.map +1 -1
- package/lib/components/Alert/Alert.types.js +1 -2
- package/lib/components/Alert/Alert.types.js.map +1 -1
- package/lib/components/Alert/index.js +1 -2
- package/lib/components/Alert/index.js.map +1 -1
- package/lib/components/Alert/renderAlert.js +16 -13
- package/lib/components/Alert/renderAlert.js.map +1 -1
- package/lib/components/Alert/useAlert.js +64 -69
- package/lib/components/Alert/useAlert.js.map +1 -1
- package/lib/components/Alert/useAlertStyles.styles.js +139 -0
- package/lib/components/Alert/useAlertStyles.styles.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Alert.js +3 -7
- package/lib-commonjs/Alert.js.map +1 -1
- package/lib-commonjs/components/Alert/Alert.js +22 -23
- package/lib-commonjs/components/Alert/Alert.js.map +1 -1
- package/lib-commonjs/components/Alert/Alert.types.js +1 -3
- package/lib-commonjs/components/Alert/Alert.types.js.map +1 -1
- package/lib-commonjs/components/Alert/index.js +7 -15
- package/lib-commonjs/components/Alert/index.js.map +1 -1
- package/lib-commonjs/components/Alert/renderAlert.js +20 -21
- package/lib-commonjs/components/Alert/renderAlert.js.map +1 -1
- package/lib-commonjs/components/Alert/useAlert.js +74 -92
- package/lib-commonjs/components/Alert/useAlert.js.map +1 -1
- package/lib-commonjs/components/Alert/useAlertStyles.styles.js +280 -0
- package/lib-commonjs/components/Alert/useAlertStyles.styles.js.map +1 -0
- package/lib-commonjs/index.js +25 -36
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +31 -19
- package/Migration.md +0 -0
- package/Spec.md +0 -97
- package/lib/components/Alert/useAlertStyles.js +0 -112
- package/lib/components/Alert/useAlertStyles.js.map +0 -1
- package/lib-commonjs/components/Alert/useAlertStyles.js +0 -123
- package/lib-commonjs/components/Alert/useAlertStyles.js.map +0 -1
package/lib-commonjs/index.js
CHANGED
|
@@ -1,40 +1,29 @@
|
|
|
1
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
1
2
|
"use strict";
|
|
2
|
-
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
Alert: function() {
|
|
14
|
+
return _Alert.Alert;
|
|
15
|
+
},
|
|
16
|
+
alertClassNames: function() {
|
|
17
|
+
return _Alert.alertClassNames;
|
|
18
|
+
},
|
|
19
|
+
renderAlert_unstable: function() {
|
|
20
|
+
return _Alert.renderAlert_unstable;
|
|
21
|
+
},
|
|
22
|
+
useAlertStyles_unstable: function() {
|
|
23
|
+
return _Alert.useAlertStyles_unstable;
|
|
24
|
+
},
|
|
25
|
+
useAlert_unstable: function() {
|
|
26
|
+
return _Alert.useAlert_unstable;
|
|
27
|
+
}
|
|
15
28
|
});
|
|
16
|
-
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return Alert_1.alertClassNames;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(exports, "renderAlert_unstable", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function () {
|
|
25
|
-
return Alert_1.renderAlert_unstable;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "useAlertStyles_unstable", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return Alert_1.useAlertStyles_unstable;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(exports, "useAlert_unstable", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function () {
|
|
37
|
-
return Alert_1.useAlert_unstable;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
29
|
+
const _Alert = require("./Alert");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["// eslint-disable-next-line deprecation/deprecation\nexport { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';\n"],"names":["Alert","alertClassNames","renderAlert_unstable","useAlertStyles_unstable","useAlert_unstable"],"mappings":"AAAA,mDAAmD;;;;;;;;;;;;IAC1CA,KAAK;eAALA,YAAK;;IAAEC,eAAe;eAAfA,sBAAe;;IAAEC,oBAAoB;eAApBA,2BAAoB;;IAAEC,uBAAuB;eAAvBA,8BAAuB;;IAAEC,iBAAiB;eAAjBA,wBAAiB;;;uBAAQ"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-alert",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.90",
|
|
4
4
|
"description": "An alert component to display brief messages",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
|
-
"typings": "dist/index.d.ts",
|
|
7
|
+
"typings": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -13,38 +13,41 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "just-scripts build",
|
|
16
|
-
"bundle-size": "
|
|
16
|
+
"bundle-size": "monosize measure",
|
|
17
17
|
"clean": "just-scripts clean",
|
|
18
18
|
"code-style": "just-scripts code-style",
|
|
19
19
|
"just": "just-scripts",
|
|
20
20
|
"lint": "just-scripts lint",
|
|
21
21
|
"start": "yarn storybook",
|
|
22
22
|
"test": "jest --passWithNoTests",
|
|
23
|
-
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
24
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-alert/src && yarn docs",
|
|
25
23
|
"storybook": "start-storybook",
|
|
26
|
-
"type-check": "tsc -b tsconfig.json"
|
|
24
|
+
"type-check": "tsc -b tsconfig.json",
|
|
25
|
+
"generate-api": "just-scripts generate-api",
|
|
26
|
+
"test-ssr": "test-ssr \"./stories/**/*.stories.tsx\""
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
|
30
30
|
"@fluentui/react-conformance": "*",
|
|
31
|
-
"@fluentui/react-conformance-griffel": "
|
|
32
|
-
"@fluentui/scripts": "
|
|
31
|
+
"@fluentui/react-conformance-griffel": "*",
|
|
32
|
+
"@fluentui/scripts-api-extractor": "*",
|
|
33
|
+
"@fluentui/scripts-tasks": "*"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@fluentui/react-avatar": "^9.
|
|
36
|
-
"@fluentui/react-button": "^9.
|
|
37
|
-
"@fluentui/react-icons": "^2.0.
|
|
38
|
-
"@fluentui/react-
|
|
39
|
-
"@fluentui/react-
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
36
|
+
"@fluentui/react-avatar": "^9.5.44",
|
|
37
|
+
"@fluentui/react-button": "^9.3.53",
|
|
38
|
+
"@fluentui/react-icons": "^2.0.217",
|
|
39
|
+
"@fluentui/react-tabster": "^9.14.3",
|
|
40
|
+
"@fluentui/react-theme": "^9.1.15",
|
|
41
|
+
"@fluentui/react-utilities": "^9.15.1",
|
|
42
|
+
"@fluentui/react-jsx-runtime": "^9.0.18",
|
|
43
|
+
"@griffel/react": "^1.5.14",
|
|
44
|
+
"@swc/helpers": "^0.5.1"
|
|
42
45
|
},
|
|
43
46
|
"peerDependencies": {
|
|
44
|
-
"@types/react": ">=16.
|
|
45
|
-
"@types/react-dom": ">=16.
|
|
46
|
-
"react": ">=16.
|
|
47
|
-
"react-dom": ">=16.
|
|
47
|
+
"@types/react": ">=16.14.0 <19.0.0",
|
|
48
|
+
"@types/react-dom": ">=16.14.0 <19.0.0",
|
|
49
|
+
"react": ">=16.14.0 <19.0.0",
|
|
50
|
+
"react-dom": ">=16.14.0 <19.0.0"
|
|
48
51
|
},
|
|
49
52
|
"beachball": {
|
|
50
53
|
"disallowedChangeTypes": [
|
|
@@ -52,5 +55,14 @@
|
|
|
52
55
|
"minor",
|
|
53
56
|
"patch"
|
|
54
57
|
]
|
|
58
|
+
},
|
|
59
|
+
"exports": {
|
|
60
|
+
".": {
|
|
61
|
+
"types": "./dist/index.d.ts",
|
|
62
|
+
"node": "./lib-commonjs/index.js",
|
|
63
|
+
"import": "./lib/index.js",
|
|
64
|
+
"require": "./lib-commonjs/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./package.json": "./package.json"
|
|
55
67
|
}
|
|
56
68
|
}
|
package/Migration.md
DELETED
|
File without changes
|
package/Spec.md
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# Alert
|
|
2
|
-
|
|
3
|
-
## Background
|
|
4
|
-
|
|
5
|
-
An Alert displays a brief, important message to attract a user's attention without interrupting their current task.
|
|
6
|
-
|
|
7
|
-
## Prior Art
|
|
8
|
-
|
|
9
|
-
- [Alert - Open UI](https://open-ui.org/components/toast.research)
|
|
10
|
-
- [Convergence epic issue #22579](https://github.com/microsoft/fluentui/issues/22579)
|
|
11
|
-
|
|
12
|
-
## Sample Code
|
|
13
|
-
|
|
14
|
-
Default Alert
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
import { Alert } from '@fluentui/react-alert'
|
|
18
|
-
|
|
19
|
-
const AlertExample = () => <Alert>This is a default alert</Alert>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Success Alert
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
import { Alert } from '@fluentui/react-alert'
|
|
26
|
-
|
|
27
|
-
const AlertExample = () =><Alert intent="success">This is a success alert</Alert>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## API
|
|
31
|
-
|
|
32
|
-
See [Alert.types.ts](./src/components/Alert/Alert.types.ts)
|
|
33
|
-
|
|
34
|
-
## Structure
|
|
35
|
-
|
|
36
|
-
### Slots
|
|
37
|
-
|
|
38
|
-
- `root`: The outermost `<div>` that contains the rest of the slots
|
|
39
|
-
- `icon`: (optional) A `<span>` that renders an icon and is inferred by the `intent` prop or passed in via the `icon` prop
|
|
40
|
-
- `action`: (optional) A `<button>` that prompts users to act on it
|
|
41
|
-
- `avatar`: (optional) A slot that renders an `Avatar` component passed in via the `avatar` prop
|
|
42
|
-
|
|
43
|
-
### **Public**
|
|
44
|
-
|
|
45
|
-
```jsx
|
|
46
|
-
<Alert>This is a default alert</Alert>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### **Internal**
|
|
50
|
-
|
|
51
|
-
```tsx
|
|
52
|
-
<slots.root {...slotProps.root}>
|
|
53
|
-
{slots.icon && <slots.icon {...slotProps.icon} />}
|
|
54
|
-
{slots.avatar && <slots.avatar {...slotProps.avatar} />}
|
|
55
|
-
{slotProps.root.children}
|
|
56
|
-
{slots.action && <slots.action {...slotProps.action} />}
|
|
57
|
-
</slots.root>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### **DOM**
|
|
61
|
-
|
|
62
|
-
```html
|
|
63
|
-
<div class="fui-Alert">
|
|
64
|
-
<span class="fui-Alert__icon">DeletedFilled</span>
|
|
65
|
-
Chat deleted
|
|
66
|
-
<button type="button" class="fui-Button fui-Alert__action">Undo</button>
|
|
67
|
-
</div>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Migration
|
|
71
|
-
|
|
72
|
-
See [Migration.md](./Migration.md)
|
|
73
|
-
|
|
74
|
-
## Behaviors
|
|
75
|
-
|
|
76
|
-
_Explain how the component will behave in use, including:_
|
|
77
|
-
|
|
78
|
-
- _Component States_
|
|
79
|
-
- _Interaction_
|
|
80
|
-
- _Keyboard_
|
|
81
|
-
- _Cursor_
|
|
82
|
-
- _Touch_
|
|
83
|
-
- _Screen readers_
|
|
84
|
-
|
|
85
|
-
## Accessibility
|
|
86
|
-
|
|
87
|
-
Base accessibility information is included in the design document. After the spec is filled and review, outcomes from it need to be communicated to design and incorporated in the design document.
|
|
88
|
-
|
|
89
|
-
- Decide whether to use **native element** or folow **ARIA** and provide reasons
|
|
90
|
-
- Identify the **[ARIA](https://www.w3.org/TR/wai-aria-practices-1.2/) pattern** and, if the component is listed there, follow its specification as possible.
|
|
91
|
-
- Identify accessibility **variants**, the `role` ([ARIA roles](https://www.w3.org/TR/wai-aria-1.1/#role_definitions)) of the component, its `slots` and `aria-*` props.
|
|
92
|
-
- Describe the **keyboard navigation**: Tab Oder and Arrow Key Navigation. Describe any other keyboard **shortcuts** used
|
|
93
|
-
- Specify texts for **state change announcements** - [ARIA live regions
|
|
94
|
-
](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) (number of available items in dropdown, error messages, confirmations, ...)
|
|
95
|
-
- Identify UI parts that appear on **hover or focus** and specify keyboard and screen reader interaction with them
|
|
96
|
-
- List cases when **focus** needs to be **trapped** in sections of the UI (for dialogs and popups or for hierarchical navigation)
|
|
97
|
-
- List cases when **focus** needs to be **moved programatically** (if parts of the UI are appearing/disappearing or other cases)
|
|
@@ -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;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;;AAkCA,MAAM,mBAAmB,gBAAG;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAeA;;AAEG;;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAkC;EACvE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,gBAAgB,GAAG,mBAAmB,EAA5C;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,eAAe,CAAC,IADiB,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,UAAN,KAAqB,SAArB,IAAkC,MAAM,CAAC,QAHR,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;;EAOA,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,eAAe,CAAC,IADiB,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,MAAN,IAAgB,gBAAgB,CAAC,KAAK,CAAC,MAAP,CAHC,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;EAMD;;EAED,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,eAAe,CAAC,MAAjB,EAAyB,MAAM,CAAC,MAAhC,EAAwC,KAAK,CAAC,MAAN,CAAa,SAArD,CAArC;EACD;;EAED,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,eAAe,CAAC,MAAjB,EAAyB,MAAM,CAAC,MAAhC,EAAwC,KAAK,CAAC,MAAN,CAAa,SAArD,CAArC;EACD;;EAED,OAAO,KAAP;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;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;;AAkCA,MAAM,mBAAmB,gBAAG,OAAA,SAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAeA;;AAEG;;;AACI,MAAM,uBAAuB,GAAI,KAAD,IAAkC;EACvE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,gBAAgB,GAAG,mBAAmB,EAA5C;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,eAAA,CAAgB,IADK,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,UAAN,KAAqB,SAArB,IAAkC,MAAM,CAAC,QAHpB,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;;EAOA,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,eAAA,CAAgB,IADK,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,MAAN,IAAgB,gBAAgB,CAAC,KAAK,CAAC,MAAP,CAHX,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;EAMD;;EAED,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,eAAA,CAAgB,MAA7B,EAAqC,MAAM,CAAC,MAA5C,EAAoD,KAAK,CAAC,MAAN,CAAa,SAAjE,CAAzB;EACD;;EAED,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,eAAA,CAAgB,MAA7B,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/"}
|