@react-spectrum/inlinealert 3.2.4-nightly.4555 → 3.2.4-nightly.4560
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/dist/InlineAlert.main.js +105 -0
- package/dist/InlineAlert.main.js.map +1 -0
- package/dist/InlineAlert.mjs +100 -0
- package/dist/InlineAlert.module.js +100 -0
- package/dist/InlineAlert.module.js.map +1 -0
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +1 -261
- package/dist/inlinealert_vars_css.main.js +62 -0
- package/dist/inlinealert_vars_css.main.js.map +1 -0
- package/dist/inlinealert_vars_css.mjs +64 -0
- package/dist/inlinealert_vars_css.module.js +64 -0
- package/dist/inlinealert_vars_css.module.js.map +1 -0
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +2 -258
- package/dist/main.js.map +1 -1
- package/dist/module.js +1 -261
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/{main.css → vars.7182e6d0.css} +1 -1
- package/dist/{main.css.map → vars.7182e6d0.css.map} +1 -1
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +10 -10
- package/dist/module.css +0 -199
- package/dist/module.css.map +0 -1
@@ -0,0 +1,105 @@
|
|
1
|
+
var $cf1d087b199fc7c5$exports = require("./intlStrings.main.js");
|
2
|
+
require("./vars.7182e6d0.css");
|
3
|
+
var $8d976ce4ebad141b$exports = require("./inlinealert_vars_css.main.js");
|
4
|
+
var $9SIjx$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
|
5
|
+
var $9SIjx$reactspectrumutils = require("@react-spectrum/utils");
|
6
|
+
var $9SIjx$reactariautils = require("@react-aria/utils");
|
7
|
+
var $9SIjx$reactariafocus = require("@react-aria/focus");
|
8
|
+
var $9SIjx$reactspectrumlayout = require("@react-spectrum/layout");
|
9
|
+
var $9SIjx$spectrumiconsuiInfoMedium = require("@spectrum-icons/ui/InfoMedium");
|
10
|
+
var $9SIjx$react = require("react");
|
11
|
+
var $9SIjx$spectrumiconsuiSuccessMedium = require("@spectrum-icons/ui/SuccessMedium");
|
12
|
+
var $9SIjx$reactariai18n = require("@react-aria/i18n");
|
13
|
+
var $9SIjx$reactspectrumprovider = require("@react-spectrum/provider");
|
14
|
+
|
15
|
+
|
16
|
+
function $parcel$interopDefault(a) {
|
17
|
+
return a && a.__esModule ? a.default : a;
|
18
|
+
}
|
19
|
+
|
20
|
+
function $parcel$export(e, n, v, s) {
|
21
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
22
|
+
}
|
23
|
+
|
24
|
+
$parcel$export(module.exports, "InlineAlert", () => $5de8c6729f05c665$export$a3b2c96db9b0eb71);
|
25
|
+
/*
|
26
|
+
* Copyright 2023 Adobe. All rights reserved.
|
27
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
28
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
29
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
30
|
+
*
|
31
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
32
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
33
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
34
|
+
* governing permissions and limitations under the License.
|
35
|
+
*/
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
let $5de8c6729f05c665$var$ICONS = {
|
48
|
+
info: (0, ($parcel$interopDefault($9SIjx$spectrumiconsuiInfoMedium))),
|
49
|
+
positive: (0, ($parcel$interopDefault($9SIjx$spectrumiconsuiSuccessMedium))),
|
50
|
+
notice: (0, ($parcel$interopDefault($9SIjx$spectrumiconsuiAlertMedium))),
|
51
|
+
negative: (0, ($parcel$interopDefault($9SIjx$spectrumiconsuiAlertMedium)))
|
52
|
+
};
|
53
|
+
function $5de8c6729f05c665$var$InlineAlert(props, ref) {
|
54
|
+
props = (0, $9SIjx$reactspectrumprovider.useProviderProps)(props);
|
55
|
+
let { children: children, variant: variant = "neutral", autoFocus: autoFocus, ...otherProps } = props;
|
56
|
+
let { styleProps: styleProps } = (0, $9SIjx$reactspectrumutils.useStyleProps)(otherProps);
|
57
|
+
let domRef = (0, $9SIjx$reactspectrumutils.useDOMRef)(ref);
|
58
|
+
let slots = {
|
59
|
+
heading: {
|
60
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8d976ce4ebad141b$exports)))["spectrum-InLineAlert-heading"]
|
61
|
+
},
|
62
|
+
content: {
|
63
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8d976ce4ebad141b$exports)))["spectrum-InLineAlert-content"]
|
64
|
+
}
|
65
|
+
};
|
66
|
+
let stringFormatter = (0, $9SIjx$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($cf1d087b199fc7c5$exports))), "@react-spectrum/inlinealert");
|
67
|
+
let Icon = null;
|
68
|
+
let iconAlt = "";
|
69
|
+
if (variant in $5de8c6729f05c665$var$ICONS) {
|
70
|
+
Icon = $5de8c6729f05c665$var$ICONS[variant];
|
71
|
+
iconAlt = stringFormatter.format(variant);
|
72
|
+
}
|
73
|
+
let autoFocusRef = (0, $9SIjx$react.useRef)(props.autoFocus);
|
74
|
+
(0, $9SIjx$react.useEffect)(()=>{
|
75
|
+
if (autoFocusRef.current && domRef.current) domRef.current.focus();
|
76
|
+
autoFocusRef.current = false;
|
77
|
+
}, [
|
78
|
+
domRef
|
79
|
+
]);
|
80
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($9SIjx$react))).createElement((0, $9SIjx$reactariafocus.FocusRing), {
|
81
|
+
focusRingClass: (0, ($parcel$interopDefault($8d976ce4ebad141b$exports)))["focus-ring"]
|
82
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($9SIjx$react))).createElement("div", {
|
83
|
+
...(0, $9SIjx$reactariautils.filterDOMProps)(props),
|
84
|
+
...styleProps,
|
85
|
+
ref: domRef,
|
86
|
+
tabIndex: autoFocus ? -1 : undefined,
|
87
|
+
autoFocus: autoFocus,
|
88
|
+
className: (0, $9SIjx$reactspectrumutils.classNames)((0, ($parcel$interopDefault($8d976ce4ebad141b$exports))), "spectrum-InLineAlert", `spectrum-InLineAlert--${variant}`, styleProps.className),
|
89
|
+
role: "alert"
|
90
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($9SIjx$react))).createElement((0, $9SIjx$reactspectrumlayout.Grid), {
|
91
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8d976ce4ebad141b$exports)))["spectrum-InLineAlert-grid"]
|
92
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($9SIjx$react))).createElement((0, $9SIjx$reactspectrumutils.SlotProvider), {
|
93
|
+
slots: slots
|
94
|
+
}, Icon && /*#__PURE__*/ (0, ($parcel$interopDefault($9SIjx$react))).createElement(Icon, {
|
95
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8d976ce4ebad141b$exports)))["spectrum-InLineAlert-icon"],
|
96
|
+
"aria-label": iconAlt
|
97
|
+
}), children))));
|
98
|
+
}
|
99
|
+
/**
|
100
|
+
* Inline alerts display a non-modal message associated with objects in a view.
|
101
|
+
* These are often used in form validation, providing a place to aggregate feedback related to multiple fields.
|
102
|
+
*/ const $5de8c6729f05c665$export$a3b2c96db9b0eb71 = /*#__PURE__*/ (0, ($parcel$interopDefault($9SIjx$react))).forwardRef($5de8c6729f05c665$var$InlineAlert);
|
103
|
+
|
104
|
+
|
105
|
+
//# sourceMappingURL=InlineAlert.main.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiCD,IAAI,8BAAQ;IACV,MAAM,CAAA,GAAA,0DAAS;IACf,UAAU,CAAA,GAAA,6DAAY;IACtB,QAAQ,CAAA,GAAA,2DAAU;IAClB,UAAU,CAAA,GAAA,2DAAU;AACtB;AAEA,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,YACF,QAAQ,WACR,UAAU,sBACV,SAAS,EACT,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,QAAQ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/inlinealert/src/InlineAlert.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Grid} from '@react-spectrum/layout';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {ReactNode, useEffect, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inlinealert/vars.css';\nimport SuccessMedium from '@spectrum-icons/ui/SuccessMedium';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nexport interface SpectrumInlineAlertProps extends DOMProps, StyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/in-line-alert/#Options) of the Inline Alert.\n * @default 'neutral'\n */\n variant?: 'neutral' | 'info' | 'positive' | 'notice' | 'negative',\n /**\n * The contents of the Inline Alert.\n */\n children: ReactNode,\n /**\n * Whether to automatically focus the Inline Alert when it first renders.\n */\n autoFocus?: boolean\n}\n\nlet ICONS = {\n info: InfoMedium,\n positive: SuccessMedium,\n notice: AlertMedium,\n negative: AlertMedium\n};\n\nfunction InlineAlert(props: SpectrumInlineAlertProps, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n children,\n variant = 'neutral',\n autoFocus,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let slots = {\n heading: {UNSAFE_className: styles['spectrum-InLineAlert-heading']},\n content: {UNSAFE_className: styles['spectrum-InLineAlert-content']}\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/inlinealert');\n let Icon: typeof React.Component | null = null;\n let iconAlt: string = '';\n if (variant in ICONS) {\n Icon = ICONS[variant];\n iconAlt = stringFormatter.format(variant);\n }\n\n let autoFocusRef = useRef(props.autoFocus);\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n domRef.current.focus();\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n return (\n <FocusRing focusRingClass={styles['focus-ring']}>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n ref={domRef}\n tabIndex={autoFocus ? -1 : undefined}\n autoFocus={autoFocus}\n className={classNames(\n styles,\n 'spectrum-InLineAlert',\n `spectrum-InLineAlert--${variant}`,\n styleProps.className\n )}\n role=\"alert\">\n <Grid UNSAFE_className={styles['spectrum-InLineAlert-grid']}>\n <SlotProvider slots={slots}>\n {Icon && <Icon UNSAFE_className={styles['spectrum-InLineAlert-icon']} aria-label={iconAlt} />}\n {children}\n </SlotProvider>\n </Grid>\n </div>\n </FocusRing>\n );\n}\n\n/**\n * Inline alerts display a non-modal message associated with objects in a view.\n * These are often used in form validation, providing a place to aggregate feedback related to multiple fields.\n */\nconst _InlineAlert = React.forwardRef(InlineAlert);\nexport {_InlineAlert as InlineAlert};\n"],"names":[],"version":3,"file":"InlineAlert.main.js.map"}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import $8S3NB$intlStringsmodulejs from "./intlStrings.mjs";
|
2
|
+
import "./vars.7182e6d0.css";
|
3
|
+
import $8S3NB$inlinealert_vars_cssmodulejs from "./inlinealert_vars_css.mjs";
|
4
|
+
import $8S3NB$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
5
|
+
import {useStyleProps as $8S3NB$useStyleProps, useDOMRef as $8S3NB$useDOMRef, classNames as $8S3NB$classNames, SlotProvider as $8S3NB$SlotProvider} from "@react-spectrum/utils";
|
6
|
+
import {filterDOMProps as $8S3NB$filterDOMProps} from "@react-aria/utils";
|
7
|
+
import {FocusRing as $8S3NB$FocusRing} from "@react-aria/focus";
|
8
|
+
import {Grid as $8S3NB$Grid} from "@react-spectrum/layout";
|
9
|
+
import $8S3NB$spectrumiconsuiInfoMedium from "@spectrum-icons/ui/InfoMedium";
|
10
|
+
import $8S3NB$react, {useRef as $8S3NB$useRef, useEffect as $8S3NB$useEffect} from "react";
|
11
|
+
import $8S3NB$spectrumiconsuiSuccessMedium from "@spectrum-icons/ui/SuccessMedium";
|
12
|
+
import {useLocalizedStringFormatter as $8S3NB$useLocalizedStringFormatter} from "@react-aria/i18n";
|
13
|
+
import {useProviderProps as $8S3NB$useProviderProps} from "@react-spectrum/provider";
|
14
|
+
|
15
|
+
|
16
|
+
function $parcel$interopDefault(a) {
|
17
|
+
return a && a.__esModule ? a.default : a;
|
18
|
+
}
|
19
|
+
/*
|
20
|
+
* Copyright 2023 Adobe. All rights reserved.
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
24
|
+
*
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
28
|
+
* governing permissions and limitations under the License.
|
29
|
+
*/
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
let $abf1e6290496dda5$var$ICONS = {
|
42
|
+
info: (0, $8S3NB$spectrumiconsuiInfoMedium),
|
43
|
+
positive: (0, $8S3NB$spectrumiconsuiSuccessMedium),
|
44
|
+
notice: (0, $8S3NB$spectrumiconsuiAlertMedium),
|
45
|
+
negative: (0, $8S3NB$spectrumiconsuiAlertMedium)
|
46
|
+
};
|
47
|
+
function $abf1e6290496dda5$var$InlineAlert(props, ref) {
|
48
|
+
props = (0, $8S3NB$useProviderProps)(props);
|
49
|
+
let { children: children, variant: variant = "neutral", autoFocus: autoFocus, ...otherProps } = props;
|
50
|
+
let { styleProps: styleProps } = (0, $8S3NB$useStyleProps)(otherProps);
|
51
|
+
let domRef = (0, $8S3NB$useDOMRef)(ref);
|
52
|
+
let slots = {
|
53
|
+
heading: {
|
54
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-heading"]
|
55
|
+
},
|
56
|
+
content: {
|
57
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-content"]
|
58
|
+
}
|
59
|
+
};
|
60
|
+
let stringFormatter = (0, $8S3NB$useLocalizedStringFormatter)((0, ($parcel$interopDefault($8S3NB$intlStringsmodulejs))), "@react-spectrum/inlinealert");
|
61
|
+
let Icon = null;
|
62
|
+
let iconAlt = "";
|
63
|
+
if (variant in $abf1e6290496dda5$var$ICONS) {
|
64
|
+
Icon = $abf1e6290496dda5$var$ICONS[variant];
|
65
|
+
iconAlt = stringFormatter.format(variant);
|
66
|
+
}
|
67
|
+
let autoFocusRef = (0, $8S3NB$useRef)(props.autoFocus);
|
68
|
+
(0, $8S3NB$useEffect)(()=>{
|
69
|
+
if (autoFocusRef.current && domRef.current) domRef.current.focus();
|
70
|
+
autoFocusRef.current = false;
|
71
|
+
}, [
|
72
|
+
domRef
|
73
|
+
]);
|
74
|
+
return /*#__PURE__*/ (0, $8S3NB$react).createElement((0, $8S3NB$FocusRing), {
|
75
|
+
focusRingClass: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["focus-ring"]
|
76
|
+
}, /*#__PURE__*/ (0, $8S3NB$react).createElement("div", {
|
77
|
+
...(0, $8S3NB$filterDOMProps)(props),
|
78
|
+
...styleProps,
|
79
|
+
ref: domRef,
|
80
|
+
tabIndex: autoFocus ? -1 : undefined,
|
81
|
+
autoFocus: autoFocus,
|
82
|
+
className: (0, $8S3NB$classNames)((0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs))), "spectrum-InLineAlert", `spectrum-InLineAlert--${variant}`, styleProps.className),
|
83
|
+
role: "alert"
|
84
|
+
}, /*#__PURE__*/ (0, $8S3NB$react).createElement((0, $8S3NB$Grid), {
|
85
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-grid"]
|
86
|
+
}, /*#__PURE__*/ (0, $8S3NB$react).createElement((0, $8S3NB$SlotProvider), {
|
87
|
+
slots: slots
|
88
|
+
}, Icon && /*#__PURE__*/ (0, $8S3NB$react).createElement(Icon, {
|
89
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-icon"],
|
90
|
+
"aria-label": iconAlt
|
91
|
+
}), children))));
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* Inline alerts display a non-modal message associated with objects in a view.
|
95
|
+
* These are often used in form validation, providing a place to aggregate feedback related to multiple fields.
|
96
|
+
*/ const $abf1e6290496dda5$export$a3b2c96db9b0eb71 = /*#__PURE__*/ (0, $8S3NB$react).forwardRef($abf1e6290496dda5$var$InlineAlert);
|
97
|
+
|
98
|
+
|
99
|
+
export {$abf1e6290496dda5$export$a3b2c96db9b0eb71 as InlineAlert};
|
100
|
+
//# sourceMappingURL=InlineAlert.mjs.map
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import $8S3NB$intlStringsmodulejs from "./intlStrings.module.js";
|
2
|
+
import "./vars.7182e6d0.css";
|
3
|
+
import $8S3NB$inlinealert_vars_cssmodulejs from "./inlinealert_vars_css.module.js";
|
4
|
+
import $8S3NB$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
5
|
+
import {useStyleProps as $8S3NB$useStyleProps, useDOMRef as $8S3NB$useDOMRef, classNames as $8S3NB$classNames, SlotProvider as $8S3NB$SlotProvider} from "@react-spectrum/utils";
|
6
|
+
import {filterDOMProps as $8S3NB$filterDOMProps} from "@react-aria/utils";
|
7
|
+
import {FocusRing as $8S3NB$FocusRing} from "@react-aria/focus";
|
8
|
+
import {Grid as $8S3NB$Grid} from "@react-spectrum/layout";
|
9
|
+
import $8S3NB$spectrumiconsuiInfoMedium from "@spectrum-icons/ui/InfoMedium";
|
10
|
+
import $8S3NB$react, {useRef as $8S3NB$useRef, useEffect as $8S3NB$useEffect} from "react";
|
11
|
+
import $8S3NB$spectrumiconsuiSuccessMedium from "@spectrum-icons/ui/SuccessMedium";
|
12
|
+
import {useLocalizedStringFormatter as $8S3NB$useLocalizedStringFormatter} from "@react-aria/i18n";
|
13
|
+
import {useProviderProps as $8S3NB$useProviderProps} from "@react-spectrum/provider";
|
14
|
+
|
15
|
+
|
16
|
+
function $parcel$interopDefault(a) {
|
17
|
+
return a && a.__esModule ? a.default : a;
|
18
|
+
}
|
19
|
+
/*
|
20
|
+
* Copyright 2023 Adobe. All rights reserved.
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
24
|
+
*
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
28
|
+
* governing permissions and limitations under the License.
|
29
|
+
*/
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
let $abf1e6290496dda5$var$ICONS = {
|
42
|
+
info: (0, $8S3NB$spectrumiconsuiInfoMedium),
|
43
|
+
positive: (0, $8S3NB$spectrumiconsuiSuccessMedium),
|
44
|
+
notice: (0, $8S3NB$spectrumiconsuiAlertMedium),
|
45
|
+
negative: (0, $8S3NB$spectrumiconsuiAlertMedium)
|
46
|
+
};
|
47
|
+
function $abf1e6290496dda5$var$InlineAlert(props, ref) {
|
48
|
+
props = (0, $8S3NB$useProviderProps)(props);
|
49
|
+
let { children: children, variant: variant = "neutral", autoFocus: autoFocus, ...otherProps } = props;
|
50
|
+
let { styleProps: styleProps } = (0, $8S3NB$useStyleProps)(otherProps);
|
51
|
+
let domRef = (0, $8S3NB$useDOMRef)(ref);
|
52
|
+
let slots = {
|
53
|
+
heading: {
|
54
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-heading"]
|
55
|
+
},
|
56
|
+
content: {
|
57
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-content"]
|
58
|
+
}
|
59
|
+
};
|
60
|
+
let stringFormatter = (0, $8S3NB$useLocalizedStringFormatter)((0, ($parcel$interopDefault($8S3NB$intlStringsmodulejs))), "@react-spectrum/inlinealert");
|
61
|
+
let Icon = null;
|
62
|
+
let iconAlt = "";
|
63
|
+
if (variant in $abf1e6290496dda5$var$ICONS) {
|
64
|
+
Icon = $abf1e6290496dda5$var$ICONS[variant];
|
65
|
+
iconAlt = stringFormatter.format(variant);
|
66
|
+
}
|
67
|
+
let autoFocusRef = (0, $8S3NB$useRef)(props.autoFocus);
|
68
|
+
(0, $8S3NB$useEffect)(()=>{
|
69
|
+
if (autoFocusRef.current && domRef.current) domRef.current.focus();
|
70
|
+
autoFocusRef.current = false;
|
71
|
+
}, [
|
72
|
+
domRef
|
73
|
+
]);
|
74
|
+
return /*#__PURE__*/ (0, $8S3NB$react).createElement((0, $8S3NB$FocusRing), {
|
75
|
+
focusRingClass: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["focus-ring"]
|
76
|
+
}, /*#__PURE__*/ (0, $8S3NB$react).createElement("div", {
|
77
|
+
...(0, $8S3NB$filterDOMProps)(props),
|
78
|
+
...styleProps,
|
79
|
+
ref: domRef,
|
80
|
+
tabIndex: autoFocus ? -1 : undefined,
|
81
|
+
autoFocus: autoFocus,
|
82
|
+
className: (0, $8S3NB$classNames)((0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs))), "spectrum-InLineAlert", `spectrum-InLineAlert--${variant}`, styleProps.className),
|
83
|
+
role: "alert"
|
84
|
+
}, /*#__PURE__*/ (0, $8S3NB$react).createElement((0, $8S3NB$Grid), {
|
85
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-grid"]
|
86
|
+
}, /*#__PURE__*/ (0, $8S3NB$react).createElement((0, $8S3NB$SlotProvider), {
|
87
|
+
slots: slots
|
88
|
+
}, Icon && /*#__PURE__*/ (0, $8S3NB$react).createElement(Icon, {
|
89
|
+
UNSAFE_className: (0, ($parcel$interopDefault($8S3NB$inlinealert_vars_cssmodulejs)))["spectrum-InLineAlert-icon"],
|
90
|
+
"aria-label": iconAlt
|
91
|
+
}), children))));
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* Inline alerts display a non-modal message associated with objects in a view.
|
95
|
+
* These are often used in form validation, providing a place to aggregate feedback related to multiple fields.
|
96
|
+
*/ const $abf1e6290496dda5$export$a3b2c96db9b0eb71 = /*#__PURE__*/ (0, $8S3NB$react).forwardRef($abf1e6290496dda5$var$InlineAlert);
|
97
|
+
|
98
|
+
|
99
|
+
export {$abf1e6290496dda5$export$a3b2c96db9b0eb71 as InlineAlert};
|
100
|
+
//# sourceMappingURL=InlineAlert.module.js.map
|
@@ -0,0 +1 @@
|
|
1
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d,KAAK;QACL,UAAU,YAAY,KAAK;QAC3B,WAAW;QACX,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,6DAAK,GACL,wBACA,CAAC,sBAAsB,EAAE,QAAQ,CAAC,EAClC,WAAW,SAAS;QAEtB,MAAK;qBACL,gCAAC,CAAA,GAAA,WAAG;QAAE,kBAAkB,CAAA,GAAA,6DAAK,CAAC,CAAC,4BAA4B;qBACzD,gCAAC,CAAA,GAAA,mBAAW;QAAE,OAAO;OAClB,sBAAQ,gCAAC;QAAK,kBAAkB,CAAA,GAAA,6DAAK,CAAC,CAAC,4BAA4B;QAAE,cAAY;QACjF;AAMb;AAEA;;;CAGC,GACD,MAAM,0DAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/inlinealert/src/InlineAlert.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {Grid} from '@react-spectrum/layout';\nimport InfoMedium from '@spectrum-icons/ui/InfoMedium';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {ReactNode, useEffect, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inlinealert/vars.css';\nimport SuccessMedium from '@spectrum-icons/ui/SuccessMedium';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nexport interface SpectrumInlineAlertProps extends DOMProps, StyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/in-line-alert/#Options) of the Inline Alert.\n * @default 'neutral'\n */\n variant?: 'neutral' | 'info' | 'positive' | 'notice' | 'negative',\n /**\n * The contents of the Inline Alert.\n */\n children: ReactNode,\n /**\n * Whether to automatically focus the Inline Alert when it first renders.\n */\n autoFocus?: boolean\n}\n\nlet ICONS = {\n info: InfoMedium,\n positive: SuccessMedium,\n notice: AlertMedium,\n negative: AlertMedium\n};\n\nfunction InlineAlert(props: SpectrumInlineAlertProps, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n children,\n variant = 'neutral',\n autoFocus,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let slots = {\n heading: {UNSAFE_className: styles['spectrum-InLineAlert-heading']},\n content: {UNSAFE_className: styles['spectrum-InLineAlert-content']}\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/inlinealert');\n let Icon: typeof React.Component | null = null;\n let iconAlt: string = '';\n if (variant in ICONS) {\n Icon = ICONS[variant];\n iconAlt = stringFormatter.format(variant);\n }\n\n let autoFocusRef = useRef(props.autoFocus);\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n domRef.current.focus();\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n return (\n <FocusRing focusRingClass={styles['focus-ring']}>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n ref={domRef}\n tabIndex={autoFocus ? -1 : undefined}\n autoFocus={autoFocus}\n className={classNames(\n styles,\n 'spectrum-InLineAlert',\n `spectrum-InLineAlert--${variant}`,\n styleProps.className\n )}\n role=\"alert\">\n <Grid UNSAFE_className={styles['spectrum-InLineAlert-grid']}>\n <SlotProvider slots={slots}>\n {Icon && <Icon UNSAFE_className={styles['spectrum-InLineAlert-icon']} aria-label={iconAlt} />}\n {children}\n </SlotProvider>\n </Grid>\n </div>\n </FocusRing>\n );\n}\n\n/**\n * Inline alerts display a non-modal message associated with objects in a view.\n * These are often used in form validation, providing a place to aggregate feedback related to multiple fields.\n */\nconst _InlineAlert = React.forwardRef(InlineAlert);\nexport {_InlineAlert as InlineAlert};\n"],"names":[],"version":3,"file":"InlineAlert.module.js.map"}
|
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED