Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+1567
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
@fluentui/react-alert
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
+8
View File
@@ -0,0 +1,8 @@
# @fluentui/react-alert
## DEPRECATED
This component is deprecated please use the following components instead:
- Toast - @fluentui/react-toast
- MessageBar - @fluentui/react-message-bar
+89
View File
@@ -0,0 +1,89 @@
/// <reference types="react" />
import { Avatar } from '@fluentui/react-avatar';
import { Button } from '@fluentui/react-button';
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
/**
* @deprecated please use the Toast or MessageBar component
* An Alert component displays a brief, important message to attract a user's attention
* without interrupting their current task.
*/
export declare const Alert: ForwardRefComponent<AlertProps>;
export declare const alertClassNames: SlotClassNames<AlertSlots>;
/**
* Alert Props
* @deprecated please use the Toast or MessageBar component
*/
export declare type AlertProps = ComponentProps<AlertSlots> & {
/**
* The intent prop, if present, determines the icon to be rendered in the icon slot. The icon prop
* overrides the intent prop
*/
intent?: 'info' | 'success' | 'error' | 'warning';
/**
* The appearance of the Alert.
* @default 'primary'
*/
appearance?: 'primary' | 'inverted';
};
/**
* @deprecated please use the Toast or MessageBar component
*/
export declare type AlertSlots = {
/**
* The root slot is the top level container for the alert component
*/
root: NonNullable<Slot<'div'>>;
/**
* The icon slot renders the icon determined by the `icon` or `intent` prop
*/
icon?: Slot<'span'>;
/**
* The action slot renders a button that prompts the user to take action on the alert
*/
action?: Slot<typeof Button>;
/**
* The avatar slot renders an avatar before the contents of the alert
*/
avatar?: Slot<typeof Avatar>;
};
/**
* State used in rendering Alert
* @deprecated please use the Toast or MessageBar component
*/
export declare type AlertState = ComponentState<AlertSlots> & Pick<AlertProps, 'intent'> & Required<Pick<AlertProps, 'appearance'>>;
/**
* @deprecated please use the Toast or MessageBar component
*/
export declare const renderAlert_unstable: (state: AlertState) => JSX.Element;
/**
* @deprecated please use the Toast or MessageBar component
* Create the state required to render Alert.
*
* The returned state can be modified with hooks such as useAlertStyles_unstable,
* before being passed to renderAlert_unstable.
*
* @param props - props from this instance of Alert
* @param ref - reference to root HTMLElement of Alert
*/
export declare const useAlert_unstable: (props: AlertProps, ref: React_2.Ref<HTMLElement>) => AlertState;
/**
* @deprecated please use the Toast or MessageBar component
* Apply styling to the Alert slots based on the state
*/
export declare const useAlertStyles_unstable: (state: AlertState) => AlertState;
export { }
+6
View File
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _export_star = require("@swc/helpers/_/_export_star");
_export_star._(require("./components/Alert/index"), exports);
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["Alert.js"],"sourcesContent":["export * from './components/Alert/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Alert", {
enumerable: true,
get: function() {
return Alert;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _renderAlert = require("./renderAlert");
const _useAlert = require("./useAlert");
const _useAlertStylesstyles = require("./useAlertStyles.styles");
const Alert = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
// eslint-disable-next-line deprecation/deprecation
const state = (0, _useAlert.useAlert_unstable)(props, ref);
// eslint-disable-next-line deprecation/deprecation
(0, _useAlertStylesstyles.useAlertStyles_unstable)(state);
// eslint-disable-next-line deprecation/deprecation
return (0, _renderAlert.renderAlert_unstable)(state);
// eslint-disable-next-line deprecation/deprecation
});
// eslint-disable-next-line deprecation/deprecation
Alert.displayName = 'Alert';
@@ -0,0 +1 @@
{"version":3,"sources":["Alert.js"],"sourcesContent":["import * as React from 'react';\nimport { renderAlert_unstable } from './renderAlert';\nimport { useAlert_unstable } from './useAlert';\nimport { useAlertStyles_unstable } from './useAlertStyles.styles';\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 */ // eslint-disable-next-line deprecation/deprecation\nexport const Alert = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n // eslint-disable-next-line deprecation/deprecation\n const state = useAlert_unstable(props, ref);\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});\n// eslint-disable-next-line deprecation/deprecation\nAlert.displayName = 'Alert';\n"],"names":["Alert","React","forwardRef","props","ref","state","useAlert_unstable","useAlertStyles_unstable","renderAlert_unstable","displayName"],"mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;6BACc;0BACH;sCACM;AAMjC,MAAMA,QAAQ,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACxD,mDAAmD;IACnD,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvC,mDAAmD;IACnDG,IAAAA,6CAAuB,EAACF;IACxB,mDAAmD;IACnD,OAAOG,IAAAA,iCAAoB,EAACH;AAChC,mDAAmD;AACnD;AACA,mDAAmD;AACnDL,MAAMS,WAAW,GAAG"}
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _export_star = require("@swc/helpers/_/_export_star");
_export_star._(require("./Alert"), exports);
_export_star._(require("./Alert.types"), exports);
_export_star._(require("./renderAlert"), exports);
_export_star._(require("./useAlert"), exports);
_export_star._(require("./useAlertStyles.styles"), exports);
@@ -0,0 +1 @@
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Alert';\nexport * from './Alert.types';\nexport * from './renderAlert';\nexport * from './useAlert';\nexport * from './useAlertStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderAlert_unstable", {
enumerable: true,
get: function() {
return renderAlert_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderAlert_unstable = (state)=>{
// eslint-disable-next-line deprecation/deprecation
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
state.avatar && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.avatar, {}),
state.root.children,
state.action && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.action, {})
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["renderAlert.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * @deprecated please use the Toast or MessageBar component\n */ // eslint-disable-next-line deprecation/deprecation\nexport const renderAlert_unstable = (state)=>{\n // eslint-disable-next-line deprecation/deprecation\n assertSlots(state);\n return /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.icon && /*#__PURE__*/ _jsx(state.icon, {}),\n state.avatar && /*#__PURE__*/ _jsx(state.avatar, {}),\n state.root.children,\n state.action && /*#__PURE__*/ _jsx(state.action, {})\n ]\n });\n};\n"],"names":["renderAlert_unstable","state","assertSlots","_jsxs","root","children","icon","_jsx","avatar","action"],"mappings":";;;;+BAKaA;;;eAAAA;;;4BALgC;gCACjB;AAIrB,MAAMA,uBAAuB,CAACC;IACjC,mDAAmD;IACnDC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,EAAE;QACnCC,UAAU;YACNJ,MAAMK,IAAI,IAAI,WAAW,GAAGC,IAAAA,eAAI,EAACN,MAAMK,IAAI,EAAE,CAAC;YAC9CL,MAAMO,MAAM,IAAI,WAAW,GAAGD,IAAAA,eAAI,EAACN,MAAMO,MAAM,EAAE,CAAC;YAClDP,MAAMG,IAAI,CAACC,QAAQ;YACnBJ,MAAMQ,MAAM,IAAI,WAAW,GAAGF,IAAAA,eAAI,EAACN,MAAMQ,MAAM,EAAE,CAAC;SACrD;IACL;AACJ"}
@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useAlert_unstable", {
enumerable: true,
get: function() {
return useAlert_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactavatar = require("@fluentui/react-avatar");
const _reactbutton = require("@fluentui/react-button");
const _reacticons = require("@fluentui/react-icons");
const _reactutilities = require("@fluentui/react-utilities");
const useAlert_unstable = (props, ref)=>{
const { appearance = 'primary', intent } = props;
/** Determine the role and icon to render based on the intent */ let defaultIcon;
let defaultRole = 'status';
switch(intent){
case 'success':
defaultIcon = /*#__PURE__*/ _react.createElement(_reacticons.CheckmarkCircleFilled, null);
break;
case 'error':
defaultIcon = /*#__PURE__*/ _react.createElement(_reacticons.DismissCircleFilled, null);
defaultRole = 'alert';
break;
case 'warning':
defaultIcon = /*#__PURE__*/ _react.createElement(_reacticons.WarningFilled, null);
defaultRole = 'alert';
break;
case 'info':
defaultIcon = /*#__PURE__*/ _react.createElement(_reacticons.InfoFilled, null);
break;
}
const action = _reactutilities.slot.optional(props.action, {
defaultProps: {
appearance: 'transparent'
},
elementType: _reactbutton.Button
});
const avatar = _reactutilities.slot.optional(props.avatar, {
elementType: _reactavatar.Avatar
});
let icon;
/** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {
icon = _reactutilities.slot.optional(props.icon, {
defaultProps: {
children: defaultIcon
},
renderByDefault: !!props.intent,
elementType: 'span'
});
}
return {
action,
appearance,
avatar,
components: {
root: 'div',
icon: 'span',
action: _reactbutton.Button,
avatar: _reactavatar.Avatar
},
icon,
intent,
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref,
role: defaultRole,
children: props.children,
...props
}), {
elementType: 'div'
})
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["useAlert.js"],"sourcesContent":["import * as React from 'react';\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/**\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 */ // eslint-disable-next-line deprecation/deprecation\nexport const useAlert_unstable = (props, ref)=>{\n const { appearance = 'primary', intent } = props;\n /** Determine the role and icon to render based on the intent */ let defaultIcon;\n let defaultRole = 'status';\n switch(intent){\n case 'success':\n defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);\n break;\n case 'error':\n defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);\n defaultRole = 'alert';\n break;\n case 'warning':\n defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);\n defaultRole = 'alert';\n break;\n case 'info':\n defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);\n break;\n }\n const action = slot.optional(props.action, {\n defaultProps: {\n appearance: 'transparent'\n },\n elementType: Button\n });\n const avatar = slot.optional(props.avatar, {\n elementType: Avatar\n });\n let icon;\n /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {\n icon = slot.optional(props.icon, {\n defaultProps: {\n children: defaultIcon\n },\n renderByDefault: !!props.intent,\n elementType: 'span'\n });\n }\n return {\n action,\n appearance,\n avatar,\n components: {\n root: 'div',\n icon: 'span',\n action: Button,\n avatar: Avatar\n },\n icon,\n intent,\n root: slot.always(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,\n role: defaultRole,\n children: props.children,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useAlert_unstable","props","ref","appearance","intent","defaultIcon","defaultRole","React","createElement","CheckmarkCircleFilled","DismissCircleFilled","WarningFilled","InfoFilled","action","slot","optional","defaultProps","elementType","Button","avatar","Avatar","icon","children","renderByDefault","components","root","always","getIntrinsicElementProps","role"],"mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;6BACA;6BACA;4BAC+D;gCACvC;AAWxC,MAAMA,oBAAoB,CAACC,OAAOC;IACrC,MAAM,EAAEC,aAAa,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAC3C,8DAA8D,GAAG,IAAII;IACrE,IAAIC,cAAc;IAClB,OAAOF;QACH,KAAK;YACDC,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACC,iCAAqB,EAAE;YACvE;QACJ,KAAK;YACDJ,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACE,+BAAmB,EAAE;YACrEJ,cAAc;YACd;QACJ,KAAK;YACDD,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACG,yBAAa,EAAE;YAC/DL,cAAc;YACd;QACJ,KAAK;YACDD,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACI,sBAAU,EAAE;YAC5D;IACR;IACA,MAAMC,SAASC,oBAAI,CAACC,QAAQ,CAACd,MAAMY,MAAM,EAAE;QACvCG,cAAc;YACVb,YAAY;QAChB;QACAc,aAAaC,mBAAM;IACvB;IACA,MAAMC,SAASL,oBAAI,CAACC,QAAQ,CAACd,MAAMkB,MAAM,EAAE;QACvCF,aAAaG,mBAAM;IACvB;IACA,IAAIC;IACJ,8DAA8D,GAAG,IAAI,CAACF,QAAQ;QAC1EE,OAAOP,oBAAI,CAACC,QAAQ,CAACd,MAAMoB,IAAI,EAAE;YAC7BL,cAAc;gBACVM,UAAUjB;YACd;YACAkB,iBAAiB,CAAC,CAACtB,MAAMG,MAAM;YAC/Ba,aAAa;QACjB;IACJ;IACA,OAAO;QACHJ;QACAV;QACAgB;QACAK,YAAY;YACRC,MAAM;YACNJ,MAAM;YACNR,QAAQK,mBAAM;YACdC,QAAQC,mBAAM;QAClB;QACAC;QACAjB;QACAqB,MAAMX,oBAAI,CAACY,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FzB,KAAKA;YACL0B,MAAMtB;YACNgB,UAAUrB,MAAMqB,QAAQ;YACxB,GAAGrB,KAAK;QACZ,IAAI;YACAgB,aAAa;QACjB;IACJ;AACJ"}
@@ -0,0 +1,256 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
alertClassNames: function() {
return alertClassNames;
},
useAlertStyles_unstable: function() {
return useAlertStyles_unstable;
}
});
const _react = require("@griffel/react");
const alertClassNames = {
root: 'fui-Alert',
icon: 'fui-Alert__icon',
action: 'fui-Alert__action',
avatar: 'fui-Alert__avatar'
};
const useStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
mc9l5x: "f22iagw",
Bt984gj: "f122n59",
sshi5w: "f5pgtk9",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1oic3e7",
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ff3glw6",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f9ggezi",
E5pizo: "fz58gqq",
Be2twd7: "fkhj508",
Bhrd7zp: "fl43uef",
sj55zd: "f19n0e5",
De3pzq: "fxugw4r"
},
inverted: {
sj55zd: "f1w7i9ko",
De3pzq: "f5pduvr"
},
icon: {
Bqenvij: "fd461yt",
Be2twd7: "f4ybsrx",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: [
"fhivll6",
"f1cgepy8"
]
},
avatar: {
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: [
"fxal17o",
"ftghr3s"
]
},
action: {
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f4jnnbt",
Bf4jedk: "fy77jfu",
Frg6f3: [
"fcgxt0o",
"f1ujusj6"
],
sj55zd: "f16muhyy"
}
}, {
d: [
".f22iagw{display:flex;}",
".f122n59{align-items:center;}",
".f5pgtk9{min-height:44px;}",
[
".f1oic3e7{padding:0 12px;}",
{
p: -1
}
],
[
".ff3glw6{border-radius:4px;}",
{
p: -1
}
],
[
".f9ggezi{border:1px solid var(--colorTransparentStroke);}",
{
p: -2
}
],
".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;}",
{
p: -1
}
],
[
".f1cgepy8{padding:0 0 0 8px;}",
{
p: -1
}
],
[
".fxal17o{margin:0 8px 0 0;}",
{
p: -1
}
],
[
".ftghr3s{margin:0 0 0 8px;}",
{
p: -1
}
],
[
".f4jnnbt{padding:5px 10px;}",
{
p: -1
}
],
".fy77jfu{min-width:0;}",
".fcgxt0o{margin-left:auto;}",
".f1ujusj6{margin-right:auto;}",
".f16muhyy{color:var(--colorBrandForeground1);}"
]
});
const useIntentIconStyles = /*#__PURE__*/ (0, _react.__styles)({
success: {
sj55zd: "f1m7fhi8"
},
error: {
sj55zd: "f1whyuy6"
},
warning: {
sj55zd: "fpti2h4"
},
info: {
sj55zd: "fkfq4zb"
}
}, {
d: [
".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}",
".f1whyuy6{color:var(--colorPaletteRedForeground3);}",
".fpti2h4{color:var(--colorPaletteYellowForeground2);}",
".fkfq4zb{color:var(--colorNeutralForeground2);}"
]
});
const useIntentIconStylesInverted = /*#__PURE__*/ (0, _react.__styles)({
success: {
sj55zd: "f1pvjcpr"
},
error: {
sj55zd: "fcrp5ll"
},
warning: {
sj55zd: "f1r8f1cl"
},
info: {
sj55zd: "f1w7i9ko"
}
}, {
d: [
".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}",
".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}",
".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}",
".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}"
]
});
const useActionButtonColorInverted = /*#__PURE__*/ (0, _react.__styles)({
action: {
sj55zd: "f1qz2gb0",
B8q5s1w: "fa5e339",
Bci5o5g: [
"fk4svks",
"fqzoz0o"
],
n8qw10: "fw8q0i0",
Bdrgwmp: [
"fqzoz0o",
"fk4svks"
],
Bfpq7zp: "f1dlk4fq"
}
}, {
d: [
".f1qz2gb0{color:var(--colorBrandForegroundInverted);}",
".fa5e339[data-fui-focus-visible]{border-top-color:var(--colorTransparentStrokeInteractive);}",
".fk4svks[data-fui-focus-visible]{border-right-color:var(--colorTransparentStrokeInteractive);}",
".fqzoz0o[data-fui-focus-visible]{border-left-color:var(--colorTransparentStrokeInteractive);}",
".fw8q0i0[data-fui-focus-visible]{border-bottom-color:var(--colorTransparentStrokeInteractive);}",
".f1dlk4fq[data-fui-focus-visible]{outline-color:var(--colorNeutralBackground5Pressed);}"
]
});
const useAlertStyles_unstable = (state)=>{
const inverted = state.appearance === 'inverted';
const styles = useStyles();
const intentIconStylesPrimary = useIntentIconStyles();
const intentIconStylesInverted = useIntentIconStylesInverted();
const actionStylesInverted = useActionButtonColorInverted();
state.root.className = (0, _react.mergeClasses)(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);
if (state.icon) {
state.icon.className = (0, _react.mergeClasses)(alertClassNames.icon, styles.icon, state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]), state.icon.className);
}
if (state.avatar) {
state.avatar.className = (0, _react.mergeClasses)(alertClassNames.avatar, styles.avatar, state.avatar.className);
}
if (state.action) {
// Note: inverted && actionStylesInverted.action has the highest piority and must be merged last
state.action.className = (0, _react.mergeClasses)(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);
}
return state;
}; //# sourceMappingURL=useAlertStyles.styles.js.map
File diff suppressed because one or more lines are too long
+29
View File
@@ -0,0 +1,29 @@
// eslint-disable-next-line deprecation/deprecation
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Alert: function() {
return _Alert.Alert;
},
alertClassNames: function() {
return _Alert.alertClassNames;
},
renderAlert_unstable: function() {
return _Alert.renderAlert_unstable;
},
useAlertStyles_unstable: function() {
return _Alert.useAlertStyles_unstable;
},
useAlert_unstable: function() {
return _Alert.useAlert_unstable;
}
});
const _Alert = require("./Alert");
+1
View File
@@ -0,0 +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"}
+1
View File
@@ -0,0 +1 @@
export * from './components/Alert/index';
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["Alert.ts"],"sourcesContent":["export * from './components/Alert/index';\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B"}
+20
View File
@@ -0,0 +1,20 @@
import * as React from 'react';
import { renderAlert_unstable } from './renderAlert';
import { useAlert_unstable } from './useAlert';
import { useAlertStyles_unstable } from './useAlertStyles.styles';
/**
* @deprecated please use the Toast or MessageBar component
* An Alert component displays a brief, important message to attract a user's attention
* without interrupting their current task.
*/ // eslint-disable-next-line deprecation/deprecation
export const Alert = /*#__PURE__*/ React.forwardRef((props, ref)=>{
// eslint-disable-next-line deprecation/deprecation
const state = useAlert_unstable(props, ref);
// eslint-disable-next-line deprecation/deprecation
useAlertStyles_unstable(state);
// eslint-disable-next-line deprecation/deprecation
return renderAlert_unstable(state);
// eslint-disable-next-line deprecation/deprecation
});
// eslint-disable-next-line deprecation/deprecation
Alert.displayName = 'Alert';
+1
View File
@@ -0,0 +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"}
@@ -0,0 +1 @@
export { };
@@ -0,0 +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"}
+5
View File
@@ -0,0 +1,5 @@
export * from './Alert';
export * from './Alert.types';
export * from './renderAlert';
export * from './useAlert';
export * from './useAlertStyles.styles';
+1
View File
@@ -0,0 +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"}
+17
View File
@@ -0,0 +1,17 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
/**
* @deprecated please use the Toast or MessageBar component
*/ // eslint-disable-next-line deprecation/deprecation
export const renderAlert_unstable = (state)=>{
// eslint-disable-next-line deprecation/deprecation
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
state.avatar && /*#__PURE__*/ _jsx(state.avatar, {}),
state.root.children,
state.action && /*#__PURE__*/ _jsx(state.action, {})
]
});
};
@@ -0,0 +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"}
+79
View File
@@ -0,0 +1,79 @@
import * as React from 'react';
import { Avatar } from '@fluentui/react-avatar';
import { Button } from '@fluentui/react-button';
import { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
/**
* @deprecated please use the Toast or MessageBar component
* Create the state required to render Alert.
*
* The returned state can be modified with hooks such as useAlertStyles_unstable,
* before being passed to renderAlert_unstable.
*
* @param props - props from this instance of Alert
* @param ref - reference to root HTMLElement of Alert
*/ // eslint-disable-next-line deprecation/deprecation
export const useAlert_unstable = (props, ref)=>{
const { appearance = 'primary', intent } = props;
/** Determine the role and icon to render based on the intent */ let defaultIcon;
let defaultRole = 'status';
switch(intent){
case 'success':
defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);
break;
case 'error':
defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);
defaultRole = 'alert';
break;
case 'warning':
defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);
defaultRole = 'alert';
break;
case 'info':
defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);
break;
}
const action = slot.optional(props.action, {
defaultProps: {
appearance: 'transparent'
},
elementType: Button
});
const avatar = slot.optional(props.avatar, {
elementType: Avatar
});
let icon;
/** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {
icon = slot.optional(props.icon, {
defaultProps: {
children: defaultIcon
},
renderByDefault: !!props.intent,
elementType: 'span'
});
}
return {
action,
appearance,
avatar,
components: {
root: 'div',
icon: 'span',
action: Button,
avatar: Avatar
},
icon,
intent,
root: slot.always(getIntrinsicElementProps('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref,
role: defaultRole,
children: props.children,
...props
}), {
elementType: 'div'
})
};
};
@@ -0,0 +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"}
@@ -0,0 +1,165 @@
import { tokens } from '@fluentui/react-theme';
import { __styles, mergeClasses, shorthands } from '@griffel/react';
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
// eslint-disable-next-line deprecation/deprecation
export const alertClassNames = {
root: 'fui-Alert',
icon: 'fui-Alert__icon',
action: 'fui-Alert__action',
avatar: 'fui-Alert__avatar'
};
const useStyles = /*#__PURE__*/__styles({
root: {
mc9l5x: "f22iagw",
Bt984gj: "f122n59",
sshi5w: "f5pgtk9",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1oic3e7",
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ff3glw6",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f9ggezi",
E5pizo: "fz58gqq",
Be2twd7: "fkhj508",
Bhrd7zp: "fl43uef",
sj55zd: "f19n0e5",
De3pzq: "fxugw4r"
},
inverted: {
sj55zd: "f1w7i9ko",
De3pzq: "f5pduvr"
},
icon: {
Bqenvij: "fd461yt",
Be2twd7: "f4ybsrx",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: ["fhivll6", "f1cgepy8"]
},
avatar: {
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: ["fxal17o", "ftghr3s"]
},
action: {
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f4jnnbt",
Bf4jedk: "fy77jfu",
Frg6f3: ["fcgxt0o", "f1ujusj6"],
sj55zd: "f16muhyy"
}
}, {
d: [".f22iagw{display:flex;}", ".f122n59{align-items:center;}", ".f5pgtk9{min-height:44px;}", [".f1oic3e7{padding:0 12px;}", {
p: -1
}], [".ff3glw6{border-radius:4px;}", {
p: -1
}], [".f9ggezi{border:1px solid var(--colorTransparentStroke);}", {
p: -2
}], ".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;}", {
p: -1
}], [".f1cgepy8{padding:0 0 0 8px;}", {
p: -1
}], [".fxal17o{margin:0 8px 0 0;}", {
p: -1
}], [".ftghr3s{margin:0 0 0 8px;}", {
p: -1
}], [".f4jnnbt{padding:5px 10px;}", {
p: -1
}], ".fy77jfu{min-width:0;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".f16muhyy{color:var(--colorBrandForeground1);}"]
});
const useIntentIconStyles = /*#__PURE__*/__styles({
success: {
sj55zd: "f1m7fhi8"
},
error: {
sj55zd: "f1whyuy6"
},
warning: {
sj55zd: "fpti2h4"
},
info: {
sj55zd: "fkfq4zb"
}
}, {
d: [".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
});
const useIntentIconStylesInverted = /*#__PURE__*/__styles({
success: {
sj55zd: "f1pvjcpr"
},
error: {
sj55zd: "fcrp5ll"
},
warning: {
sj55zd: "f1r8f1cl"
},
info: {
sj55zd: "f1w7i9ko"
}
}, {
d: [".f1pvjcpr{color:var(--colorPaletteGreenForegroundInverted);}", ".fcrp5ll{color:var(--colorPaletteRedForegroundInverted);}", ".f1r8f1cl{color:var(--colorPaletteYellowForegroundInverted);}", ".f1w7i9ko{color:var(--colorNeutralForegroundInverted2);}"]
});
const useActionButtonColorInverted = /*#__PURE__*/__styles({
action: {
sj55zd: "f1qz2gb0",
B8q5s1w: "fa5e339",
Bci5o5g: ["fk4svks", "fqzoz0o"],
n8qw10: "fw8q0i0",
Bdrgwmp: ["fqzoz0o", "fk4svks"],
Bfpq7zp: "f1dlk4fq"
}
}, {
d: [".f1qz2gb0{color:var(--colorBrandForegroundInverted);}", ".fa5e339[data-fui-focus-visible]{border-top-color:var(--colorTransparentStrokeInteractive);}", ".fk4svks[data-fui-focus-visible]{border-right-color:var(--colorTransparentStrokeInteractive);}", ".fqzoz0o[data-fui-focus-visible]{border-left-color:var(--colorTransparentStrokeInteractive);}", ".fw8q0i0[data-fui-focus-visible]{border-bottom-color:var(--colorTransparentStrokeInteractive);}", ".f1dlk4fq[data-fui-focus-visible]{outline-color:var(--colorNeutralBackground5Pressed);}"]
});
/**
* @deprecated please use the Toast or MessageBar component
* Apply styling to the Alert slots based on the state
*/ // eslint-disable-next-line deprecation/deprecation
export const useAlertStyles_unstable = state => {
const inverted = state.appearance === 'inverted';
const styles = useStyles();
const intentIconStylesPrimary = useIntentIconStyles();
const intentIconStylesInverted = useIntentIconStylesInverted();
const actionStylesInverted = useActionButtonColorInverted();
state.root.className = mergeClasses(alertClassNames.root, styles.root, inverted && styles.inverted, state.root.className);
if (state.icon) {
state.icon.className = mergeClasses(alertClassNames.icon, styles.icon, state.intent && (inverted ? intentIconStylesInverted[state.intent] : intentIconStylesPrimary[state.intent]), state.icon.className);
}
if (state.avatar) {
state.avatar.className = mergeClasses(alertClassNames.avatar, styles.avatar, state.avatar.className);
}
if (state.action) {
// Note: inverted && actionStylesInverted.action has the highest piority and must be merged last
state.action.className = mergeClasses(alertClassNames.action, styles.action, inverted && actionStylesInverted.action, state.action.className);
}
return state;
};
//# sourceMappingURL=useAlertStyles.styles.js.map
File diff suppressed because one or more lines are too long
+2
View File
@@ -0,0 +1,2 @@
// eslint-disable-next-line deprecation/deprecation
export { Alert, alertClassNames, renderAlert_unstable, useAlertStyles_unstable, useAlert_unstable } from './Alert';
+1
View File
@@ -0,0 +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"}
+74
View File
@@ -0,0 +1,74 @@
{
"name": "@fluentui/react-alert",
"version": "9.0.0-beta.124",
"description": "An alert component to display brief messages",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"scripts": {
"build": "just-scripts build",
"bundle-size": "monosize measure",
"clean": "just-scripts clean",
"code-style": "just-scripts code-style",
"just": "just-scripts",
"lint": "just-scripts lint",
"start": "yarn storybook",
"test": "jest --passWithNoTests",
"storybook": "start-storybook",
"type-check": "tsc -b tsconfig.json",
"generate-api": "just-scripts generate-api",
"test-ssr": "test-ssr \"./stories/**/*.stories.tsx\""
},
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/react-conformance": "*",
"@fluentui/react-conformance-griffel": "*",
"@fluentui/scripts-api-extractor": "*",
"@fluentui/scripts-tasks": "*"
},
"dependencies": {
"@fluentui/react-avatar": "^9.6.29",
"@fluentui/react-button": "^9.3.83",
"@fluentui/react-icons": "^2.0.239",
"@fluentui/react-tabster": "^9.21.5",
"@fluentui/react-theme": "^9.1.19",
"@fluentui/react-utilities": "^9.18.10",
"@fluentui/react-jsx-runtime": "^9.0.39",
"@griffel/react": "^1.5.22",
"@swc/helpers": "^0.5.1"
},
"peerDependencies": {
"@types/react": ">=16.14.0 <19.0.0",
"@types/react-dom": ">=16.9.0 <19.0.0",
"react": ">=16.14.0 <19.0.0",
"react-dom": ">=16.14.0 <19.0.0"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"minor",
"patch"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
]
}