@fluentui/react-alert 9.0.0-beta.8 → 9.0.0-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.json +2642 -4
  2. package/CHANGELOG.md +900 -5
  3. package/README.md +1 -1
  4. package/dist/index.d.ts +6 -1
  5. package/lib/Alert.js +0 -1
  6. package/lib/Alert.js.map +1 -1
  7. package/lib/components/Alert/Alert.js +5 -8
  8. package/lib/components/Alert/Alert.js.map +1 -1
  9. package/lib/components/Alert/Alert.types.js +1 -2
  10. package/lib/components/Alert/Alert.types.js.map +1 -1
  11. package/lib/components/Alert/index.js +1 -2
  12. package/lib/components/Alert/index.js.map +1 -1
  13. package/lib/components/Alert/renderAlert.js +12 -13
  14. package/lib/components/Alert/renderAlert.js.map +1 -1
  15. package/lib/components/Alert/useAlert.js +60 -67
  16. package/lib/components/Alert/useAlert.js.map +1 -1
  17. package/lib/components/Alert/useAlertStyles.styles.js +137 -0
  18. package/lib/components/Alert/useAlertStyles.styles.js.map +1 -0
  19. package/lib/index.js +0 -1
  20. package/lib/index.js.map +1 -1
  21. package/lib-commonjs/Alert.js +3 -7
  22. package/lib-commonjs/Alert.js.map +1 -1
  23. package/lib-commonjs/components/Alert/Alert.js +17 -23
  24. package/lib-commonjs/components/Alert/Alert.js.map +1 -1
  25. package/lib-commonjs/components/Alert/Alert.types.js +1 -3
  26. package/lib-commonjs/components/Alert/Alert.types.js.map +1 -1
  27. package/lib-commonjs/components/Alert/index.js +7 -15
  28. package/lib-commonjs/components/Alert/index.js.map +1 -1
  29. package/lib-commonjs/components/Alert/renderAlert.js +19 -21
  30. package/lib-commonjs/components/Alert/renderAlert.js.map +1 -1
  31. package/lib-commonjs/components/Alert/useAlert.js +72 -90
  32. package/lib-commonjs/components/Alert/useAlert.js.map +1 -1
  33. package/lib-commonjs/components/Alert/useAlertStyles.styles.js +280 -0
  34. package/lib-commonjs/components/Alert/useAlertStyles.styles.js.map +1 -0
  35. package/lib-commonjs/index.js +24 -36
  36. package/lib-commonjs/index.js.map +1 -1
  37. package/package.json +32 -20
  38. package/Migration.md +0 -0
  39. package/Spec.md +0 -97
  40. package/dist/tsdoc-metadata.json +0 -11
  41. package/lib/components/Alert/useAlertStyles.js +0 -99
  42. package/lib/components/Alert/useAlertStyles.js.map +0 -1
  43. package/lib-commonjs/components/Alert/useAlertStyles.js +0 -110
  44. package/lib-commonjs/components/Alert/useAlertStyles.js.map +0 -1
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-alert",
3
- "version": "9.0.0-beta.8",
3
+ "version": "9.0.0-beta.81",
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": "bundle-size measure",
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/packages/react-components/react-alert/src && yarn docs",
25
- "storybook": "node ../../../scripts/storybook/runner",
26
- "type-check": "tsc -b tsconfig.json"
23
+ "storybook": "start-storybook",
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": "9.0.0-beta.12",
32
- "@fluentui/scripts": "^1.0.0"
31
+ "@fluentui/react-conformance-griffel": "*",
32
+ "@fluentui/scripts-api-extractor": "*",
33
+ "@fluentui/scripts-tasks": "*"
33
34
  },
34
35
  "dependencies": {
35
- "@fluentui/react-avatar": "^9.0.4",
36
- "@fluentui/react-button": "^9.1.0",
37
- "@fluentui/react-icons": "^2.0.175",
38
- "@fluentui/react-theme": "^9.0.0",
39
- "@fluentui/react-utilities": "^9.0.2",
40
- "@griffel/react": "^1.2.3",
41
- "tslib": "^2.1.0"
36
+ "@fluentui/react-avatar": "^9.5.35",
37
+ "@fluentui/react-button": "^9.3.44",
38
+ "@fluentui/react-icons": "^2.0.217",
39
+ "@fluentui/react-tabster": "^9.13.2",
40
+ "@fluentui/react-theme": "^9.1.14",
41
+ "@fluentui/react-utilities": "^9.13.5",
42
+ "@fluentui/react-jsx-runtime": "^9.0.12",
43
+ "@griffel/react": "^1.5.14",
44
+ "@swc/helpers": "^0.5.1"
42
45
  },
43
46
  "peerDependencies": {
44
- "@types/react": ">=16.8.0 <18.0.0",
45
- "@types/react-dom": ">=16.8.0 <18.0.0",
46
- "react": ">=16.8.0 <18.0.0",
47
- "react-dom": ">=16.8.0 <18.0.0"
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,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.18.1"
9
- }
10
- ]
11
- }
@@ -1,99 +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
- "De3pzq": "fxugw4r",
20
- "g2u3we": "f1p3nwhy",
21
- "h3c5rm": ["f11589ue", "f1pdflbu"],
22
- "B9xav0g": "f1q5o8ev",
23
- "zhjwy3": ["f1pdflbu", "f11589ue"],
24
- "Bbmb7ep": ["fff7au0", "f1bjk9e1"],
25
- "Beyfa6y": ["f1bjk9e1", "fff7au0"],
26
- "B7oj6ja": ["fwsfkhu", "f8wkphi"],
27
- "Btl43ni": ["f8wkphi", "fwsfkhu"],
28
- "E5pizo": "fz58gqq",
29
- "Be2twd7": "fkhj508",
30
- "Bhrd7zp": "fl43uef"
31
- },
32
- "icon": {
33
- "Bqenvij": "fd461yt",
34
- "Be2twd7": "f4ybsrx",
35
- "z8tnut": "f1g0x7ka",
36
- "z189sj": ["f19lj068", "f177v4lu"],
37
- "Byoj8tv": "f1qch9an",
38
- "uwmqm3": ["f1cnd47f", "fhxju0i"]
39
- },
40
- "avatar": {
41
- "B6of3ja": "f1hu3pq6",
42
- "t21cq0": ["f1phki43", "ff9s3yw"],
43
- "jrapky": "f19f4twv",
44
- "Frg6f3": ["f1tyq0we", "f11qmguv"]
45
- },
46
- "action": {
47
- "z8tnut": "f1g0x7ka",
48
- "z189sj": ["fhxju0i", "f1cnd47f"],
49
- "Byoj8tv": "f1qch9an",
50
- "uwmqm3": ["f1cnd47f", "fhxju0i"],
51
- "Bf4jedk": "fy77jfu",
52
- "Frg6f3": ["fcgxt0o", "f1ujusj6"],
53
- "sj55zd": "faj9fo0"
54
- }
55
- }, {
56
- "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;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".fff7au0{border-bottom-right-radius:4px;}", ".f1bjk9e1{border-bottom-left-radius:4px;}", ".fwsfkhu{border-top-right-radius:4px;}", ".f8wkphi{border-top-left-radius:4px;}", ".fz58gqq{box-shadow:var(--shadow8);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".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;}", ".faj9fo0{color:var(--colorBrandForeground2);}"]
57
- });
58
-
59
- const useIntentIconStyles = /*#__PURE__*/__styles({
60
- "success": {
61
- "sj55zd": "ffb3rxr"
62
- },
63
- "error": {
64
- "sj55zd": "fvi85wt"
65
- },
66
- "warning": {
67
- "sj55zd": "fpti2h4"
68
- },
69
- "info": {
70
- "sj55zd": "fkfq4zb"
71
- }
72
- }, {
73
- "d": [".ffb3rxr{color:var(--colorPaletteGreenBackground3);}", ".fvi85wt{color:var(--colorPaletteRedBackground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
74
- });
75
- /**
76
- * Apply styling to the Alert slots based on the state
77
- */
78
-
79
-
80
- export const useAlertStyles_unstable = state => {
81
- const styles = useStyles();
82
- const intentIconStyles = useIntentIconStyles();
83
- state.root.className = mergeClasses(alertClassNames.root, styles.root, state.root.className);
84
-
85
- if (state.icon) {
86
- state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && intentIconStyles[state.intent], state.icon.className);
87
- }
88
-
89
- if (state.avatar) {
90
- state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);
91
- }
92
-
93
- if (state.action) {
94
- state.action.className = mergeClasses(alertClassNames.action, styles.action, state.action.className);
95
- }
96
-
97
- return state;
98
- };
99
- //# 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;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;;AA6BA,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,CAAC,eAAe,CAAC,IAAjB,EAAuB,MAAM,CAAC,IAA9B,EAAoC,KAAK,CAAC,IAAN,CAAW,SAA/C,CAAnC;;EAEA,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,CAxBM","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 backgroundColor: tokens.colorNeutralBackground1, // todo - there is no bg10, used bg1\n ...shorthands.borderColor('transparent'),\n ...shorthands.borderRadius('4px'),\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300, // todo - lineheight in tokens\n fontWeight: tokens.fontWeightSemibold,\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.colorBrandForeground2, // todo - foreground3 doesn't exist\n },\n});\n\nconst useIntentIconStyles = makeStyles({\n success: {\n color: tokens.colorPaletteGreenBackground3,\n },\n error: {\n color: tokens.colorPaletteRedBackground3,\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(alertClassNames.root, styles.root, state.root.className);\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,110 +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
- "De3pzq": "fxugw4r",
29
- "g2u3we": "f1p3nwhy",
30
- "h3c5rm": ["f11589ue", "f1pdflbu"],
31
- "B9xav0g": "f1q5o8ev",
32
- "zhjwy3": ["f1pdflbu", "f11589ue"],
33
- "Bbmb7ep": ["fff7au0", "f1bjk9e1"],
34
- "Beyfa6y": ["f1bjk9e1", "fff7au0"],
35
- "B7oj6ja": ["fwsfkhu", "f8wkphi"],
36
- "Btl43ni": ["f8wkphi", "fwsfkhu"],
37
- "E5pizo": "fz58gqq",
38
- "Be2twd7": "fkhj508",
39
- "Bhrd7zp": "fl43uef"
40
- },
41
- "icon": {
42
- "Bqenvij": "fd461yt",
43
- "Be2twd7": "f4ybsrx",
44
- "z8tnut": "f1g0x7ka",
45
- "z189sj": ["f19lj068", "f177v4lu"],
46
- "Byoj8tv": "f1qch9an",
47
- "uwmqm3": ["f1cnd47f", "fhxju0i"]
48
- },
49
- "avatar": {
50
- "B6of3ja": "f1hu3pq6",
51
- "t21cq0": ["f1phki43", "ff9s3yw"],
52
- "jrapky": "f19f4twv",
53
- "Frg6f3": ["f1tyq0we", "f11qmguv"]
54
- },
55
- "action": {
56
- "z8tnut": "f1g0x7ka",
57
- "z189sj": ["fhxju0i", "f1cnd47f"],
58
- "Byoj8tv": "f1qch9an",
59
- "uwmqm3": ["f1cnd47f", "fhxju0i"],
60
- "Bf4jedk": "fy77jfu",
61
- "Frg6f3": ["fcgxt0o", "f1ujusj6"],
62
- "sj55zd": "faj9fo0"
63
- }
64
- }, {
65
- "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;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".fff7au0{border-bottom-right-radius:4px;}", ".f1bjk9e1{border-bottom-left-radius:4px;}", ".fwsfkhu{border-top-right-radius:4px;}", ".f8wkphi{border-top-left-radius:4px;}", ".fz58gqq{box-shadow:var(--shadow8);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".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;}", ".faj9fo0{color:var(--colorBrandForeground2);}"]
66
- });
67
-
68
- const useIntentIconStyles = /*#__PURE__*/react_1.__styles({
69
- "success": {
70
- "sj55zd": "ffb3rxr"
71
- },
72
- "error": {
73
- "sj55zd": "fvi85wt"
74
- },
75
- "warning": {
76
- "sj55zd": "fpti2h4"
77
- },
78
- "info": {
79
- "sj55zd": "fkfq4zb"
80
- }
81
- }, {
82
- "d": [".ffb3rxr{color:var(--colorPaletteGreenBackground3);}", ".fvi85wt{color:var(--colorPaletteRedBackground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
83
- });
84
- /**
85
- * Apply styling to the Alert slots based on the state
86
- */
87
-
88
-
89
- const useAlertStyles_unstable = state => {
90
- const styles = useStyles();
91
- const intentIconStyles = useIntentIconStyles();
92
- state.root.className = react_1.mergeClasses(exports.alertClassNames.root, styles.root, state.root.className);
93
-
94
- if (state.icon) {
95
- state.icon.className = react_1.mergeClasses(exports.alertClassNames.icon, styles.icon, state.intent && intentIconStyles[state.intent], state.icon.className);
96
- }
97
-
98
- if (state.avatar) {
99
- state.avatar.className = react_1.mergeClasses(exports.alertClassNames.avatar, styles.avatar, state.avatar.className);
100
- }
101
-
102
- if (state.action) {
103
- state.action.className = react_1.mergeClasses(exports.alertClassNames.action, styles.action, state.action.className);
104
- }
105
-
106
- return state;
107
- };
108
-
109
- exports.useAlertStyles_unstable = useAlertStyles_unstable;
110
- //# 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;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;;AA6BA,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,CAAa,OAAA,CAAA,eAAA,CAAgB,IAA7B,EAAmC,MAAM,CAAC,IAA1C,EAAgD,KAAK,CAAC,IAAN,CAAW,SAA3D,CAAvB;;EAEA,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,CAxBM;;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 backgroundColor: tokens.colorNeutralBackground1, // todo - there is no bg10, used bg1\n ...shorthands.borderColor('transparent'),\n ...shorthands.borderRadius('4px'),\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300, // todo - lineheight in tokens\n fontWeight: tokens.fontWeightSemibold,\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.colorBrandForeground2, // todo - foreground3 doesn't exist\n },\n});\n\nconst useIntentIconStyles = makeStyles({\n success: {\n color: tokens.colorPaletteGreenBackground3,\n },\n error: {\n color: tokens.colorPaletteRedBackground3,\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(alertClassNames.root, styles.root, state.root.className);\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/"}