@react-spectrum/searchfield 3.8.3 → 3.8.5
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/SearchField.main.js +85 -0
- package/dist/SearchField.main.js.map +1 -0
- package/dist/SearchField.mjs +80 -0
- package/dist/SearchField.module.js +80 -0
- package/dist/SearchField.module.js.map +1 -0
- package/dist/import.mjs +1 -127
- package/dist/main.js +2 -124
- package/dist/main.js.map +1 -1
- package/dist/module.js +1 -127
- package/dist/module.js.map +1 -1
- package/dist/search_vars_css.main.js +53 -0
- package/dist/search_vars_css.main.js.map +1 -0
- package/dist/search_vars_css.mjs +55 -0
- package/dist/search_vars_css.module.js +55 -0
- package/dist/search_vars_css.module.js.map +1 -0
- package/dist/vars.c7787a12.css +223 -0
- package/dist/vars.c7787a12.css.map +1 -0
- package/package.json +12 -12
- package/dist/main.css +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
require("./vars.c7787a12.css");
|
|
2
|
+
var $1e139f06a0a4b696$exports = require("./search_vars_css.main.js");
|
|
3
|
+
var $anRgD$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
+
var $anRgD$reactspectrumbutton = require("@react-spectrum/button");
|
|
5
|
+
var $anRgD$spectrumiconsuiMagnifier = require("@spectrum-icons/ui/Magnifier");
|
|
6
|
+
var $anRgD$react = require("react");
|
|
7
|
+
var $anRgD$reactspectrumtextfield = require("@react-spectrum/textfield");
|
|
8
|
+
var $anRgD$reactspectrumform = require("@react-spectrum/form");
|
|
9
|
+
var $anRgD$reactspectrumprovider = require("@react-spectrum/provider");
|
|
10
|
+
var $anRgD$reactariasearchfield = require("@react-aria/searchfield");
|
|
11
|
+
var $anRgD$reactstatelysearchfield = require("@react-stately/searchfield");
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function $parcel$interopDefault(a) {
|
|
15
|
+
return a && a.__esModule ? a.default : a;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function $parcel$export(e, n, v, s) {
|
|
19
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$parcel$export(module.exports, "SearchField", () => $111fe330b4c1f3ac$export$b94867ecbd698f21);
|
|
23
|
+
/*
|
|
24
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
25
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
26
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
27
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
28
|
+
*
|
|
29
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
30
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
31
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
32
|
+
* governing permissions and limitations under the License.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
function $111fe330b4c1f3ac$var$SearchField(props, ref) {
|
|
44
|
+
props = (0, $anRgD$reactspectrumutils.useSlotProps)(props, "searchfield");
|
|
45
|
+
props = (0, $anRgD$reactspectrumprovider.useProviderProps)(props);
|
|
46
|
+
props = (0, $anRgD$reactspectrumform.useFormProps)(props);
|
|
47
|
+
let defaultIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($anRgD$react))).createElement((0, ($parcel$interopDefault($anRgD$spectrumiconsuiMagnifier))), {
|
|
48
|
+
"data-testid": "searchicon"
|
|
49
|
+
});
|
|
50
|
+
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
51
|
+
if (placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text");
|
|
52
|
+
let state = (0, $anRgD$reactstatelysearchfield.useSearchFieldState)(props);
|
|
53
|
+
let inputRef = (0, $anRgD$react.useRef)(null);
|
|
54
|
+
let { clearButtonProps: clearButtonProps, ...result } = (0, $anRgD$reactariasearchfield.useSearchField)(props, state, inputRef);
|
|
55
|
+
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($anRgD$react))).createElement((0, $anRgD$reactspectrumbutton.ClearButton), {
|
|
56
|
+
...clearButtonProps,
|
|
57
|
+
preventFocus: true,
|
|
58
|
+
UNSAFE_className: (0, $anRgD$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-ClearButton"),
|
|
59
|
+
isDisabled: isDisabled
|
|
60
|
+
});
|
|
61
|
+
let validationState = props.validationState || (result.isInvalid ? "invalid" : undefined);
|
|
62
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($anRgD$react))).createElement((0, $anRgD$reactspectrumtextfield.TextFieldBase), {
|
|
63
|
+
...otherProps,
|
|
64
|
+
...result,
|
|
65
|
+
validationState: validationState,
|
|
66
|
+
UNSAFE_className: (0, $anRgD$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search", "spectrum-Textfield", {
|
|
67
|
+
"is-disabled": isDisabled,
|
|
68
|
+
"is-quiet": props.isQuiet,
|
|
69
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
70
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
71
|
+
}, UNSAFE_className),
|
|
72
|
+
inputClassName: (0, $anRgD$reactspectrumutils.classNames)((0, ($parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search-input"),
|
|
73
|
+
ref: ref,
|
|
74
|
+
inputRef: inputRef,
|
|
75
|
+
isDisabled: isDisabled,
|
|
76
|
+
icon: icon,
|
|
77
|
+
wrapperChildren: state.value !== "" && !props.isReadOnly ? clearButton : undefined
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A SearchField is a text field designed for searches.
|
|
82
|
+
*/ let $111fe330b4c1f3ac$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $anRgD$react.forwardRef)($111fe330b4c1f3ac$var$SearchField);
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=SearchField.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAeD,SAAS,kCAAY,KAA+B,EAAE,GAAsB;IAC1E,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,4BACF,0DAAC,CAAA,GAAA,yDAAQ;QAAE,eAAY;;IAGzB,IAAI,QACF,OAAO,yBACP,UAAU,oBACV,gBAAgB,eAChB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,aACF,QAAQ,IAAI,CAAC;IAGf,IAAI,QAAQ,CAAA,GAAA,kDAAkB,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,oBAAC,gBAAgB,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,0CAAa,EAAE,OAAO,OAAO;IAEjE,IAAI,4BACF,0DAAC,CAAA,GAAA,sCAAU;QACR,GAAG,gBAAgB;QACpB,cAAA;QACA,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAGJ,YAAY;;IAGhB,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,OAAO,SAAS,GAAG,YAAY,SAAQ;IAEvF,qBACE,0DAAC,CAAA,GAAA,2CAAY;QACV,GAAG,UAAU;QACb,GAAG,MAAM;QACV,iBAAiB;QACjB,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,mBACA,sBACA;YACE,eAAe;YACf,YAAY,MAAM,OAAO;YACzB,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA;QAGJ,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACnC,KAAK;QACL,UAAU;QACV,YAAY;QACZ,MAAM;QACN,iBAAiB,AAAC,MAAM,KAAK,KAAK,MAAM,CAAC,MAAM,UAAU,GAAI,cAAc;;AAEjF;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/searchfield/src/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {classNames, useSlotProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport React, {forwardRef, ReactElement, Ref, useRef} from 'react';\nimport {SpectrumSearchFieldProps} from '@react-types/searchfield';\nimport styles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSearchField} from '@react-aria/searchfield';\nimport {useSearchFieldState} from '@react-stately/searchfield';\n\nfunction SearchField(props: SpectrumSearchFieldProps, ref: Ref<TextFieldRef>) {\n props = useSlotProps(props, 'searchfield');\n props = useProviderProps(props);\n props = useFormProps(props);\n let defaultIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = defaultIcon,\n isDisabled,\n UNSAFE_className,\n placeholder,\n ...otherProps\n } = props;\n\n if (placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');\n }\n\n let state = useSearchFieldState(props);\n let inputRef = useRef<HTMLInputElement>(null);\n let {clearButtonProps, ...result} = useSearchField(props, state, inputRef);\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let validationState = props.validationState || (result.isInvalid ? 'invalid' : undefined);\n\n return (\n <TextFieldBase\n {...otherProps}\n {...result}\n validationState={validationState}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Search',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': props.isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n UNSAFE_className\n )\n }\n inputClassName={classNames(styles, 'spectrum-Search-input')}\n ref={ref}\n inputRef={inputRef}\n isDisabled={isDisabled}\n icon={icon}\n wrapperChildren={(state.value !== '' && !props.isReadOnly) ? clearButton : undefined} />\n );\n}\n\n/**\n * A SearchField is a text field designed for searches.\n */\nlet _SearchField = forwardRef(SearchField) as (props: SpectrumSearchFieldProps & {ref?: Ref<TextFieldRef>}) => ReactElement;\nexport {_SearchField as SearchField};\n"],"names":[],"version":3,"file":"SearchField.main.js.map"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import "./vars.c7787a12.css";
|
|
2
|
+
import $kYtTO$search_vars_cssmodulejs from "./search_vars_css.mjs";
|
|
3
|
+
import {useSlotProps as $kYtTO$useSlotProps, classNames as $kYtTO$classNames} from "@react-spectrum/utils";
|
|
4
|
+
import {ClearButton as $kYtTO$ClearButton} from "@react-spectrum/button";
|
|
5
|
+
import $kYtTO$spectrumiconsuiMagnifier from "@spectrum-icons/ui/Magnifier";
|
|
6
|
+
import $kYtTO$react, {useRef as $kYtTO$useRef, forwardRef as $kYtTO$forwardRef} from "react";
|
|
7
|
+
import {TextFieldBase as $kYtTO$TextFieldBase} from "@react-spectrum/textfield";
|
|
8
|
+
import {useFormProps as $kYtTO$useFormProps} from "@react-spectrum/form";
|
|
9
|
+
import {useProviderProps as $kYtTO$useProviderProps} from "@react-spectrum/provider";
|
|
10
|
+
import {useSearchField as $kYtTO$useSearchField} from "@react-aria/searchfield";
|
|
11
|
+
import {useSearchFieldState as $kYtTO$useSearchFieldState} from "@react-stately/searchfield";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function $parcel$interopDefault(a) {
|
|
15
|
+
return a && a.__esModule ? a.default : a;
|
|
16
|
+
}
|
|
17
|
+
/*
|
|
18
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
19
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
21
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
24
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
25
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
26
|
+
* governing permissions and limitations under the License.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
function $a6a4ace9217ce6df$var$SearchField(props, ref) {
|
|
38
|
+
props = (0, $kYtTO$useSlotProps)(props, "searchfield");
|
|
39
|
+
props = (0, $kYtTO$useProviderProps)(props);
|
|
40
|
+
props = (0, $kYtTO$useFormProps)(props);
|
|
41
|
+
let defaultIcon = /*#__PURE__*/ (0, $kYtTO$react).createElement((0, $kYtTO$spectrumiconsuiMagnifier), {
|
|
42
|
+
"data-testid": "searchicon"
|
|
43
|
+
});
|
|
44
|
+
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
45
|
+
if (placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text");
|
|
46
|
+
let state = (0, $kYtTO$useSearchFieldState)(props);
|
|
47
|
+
let inputRef = (0, $kYtTO$useRef)(null);
|
|
48
|
+
let { clearButtonProps: clearButtonProps, ...result } = (0, $kYtTO$useSearchField)(props, state, inputRef);
|
|
49
|
+
let clearButton = /*#__PURE__*/ (0, $kYtTO$react).createElement((0, $kYtTO$ClearButton), {
|
|
50
|
+
...clearButtonProps,
|
|
51
|
+
preventFocus: true,
|
|
52
|
+
UNSAFE_className: (0, $kYtTO$classNames)((0, ($parcel$interopDefault($kYtTO$search_vars_cssmodulejs))), "spectrum-ClearButton"),
|
|
53
|
+
isDisabled: isDisabled
|
|
54
|
+
});
|
|
55
|
+
let validationState = props.validationState || (result.isInvalid ? "invalid" : undefined);
|
|
56
|
+
return /*#__PURE__*/ (0, $kYtTO$react).createElement((0, $kYtTO$TextFieldBase), {
|
|
57
|
+
...otherProps,
|
|
58
|
+
...result,
|
|
59
|
+
validationState: validationState,
|
|
60
|
+
UNSAFE_className: (0, $kYtTO$classNames)((0, ($parcel$interopDefault($kYtTO$search_vars_cssmodulejs))), "spectrum-Search", "spectrum-Textfield", {
|
|
61
|
+
"is-disabled": isDisabled,
|
|
62
|
+
"is-quiet": props.isQuiet,
|
|
63
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
64
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
65
|
+
}, UNSAFE_className),
|
|
66
|
+
inputClassName: (0, $kYtTO$classNames)((0, ($parcel$interopDefault($kYtTO$search_vars_cssmodulejs))), "spectrum-Search-input"),
|
|
67
|
+
ref: ref,
|
|
68
|
+
inputRef: inputRef,
|
|
69
|
+
isDisabled: isDisabled,
|
|
70
|
+
icon: icon,
|
|
71
|
+
wrapperChildren: state.value !== "" && !props.isReadOnly ? clearButton : undefined
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A SearchField is a text field designed for searches.
|
|
76
|
+
*/ let $a6a4ace9217ce6df$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $kYtTO$forwardRef)($a6a4ace9217ce6df$var$SearchField);
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
export {$a6a4ace9217ce6df$export$b94867ecbd698f21 as SearchField};
|
|
80
|
+
//# sourceMappingURL=SearchField.mjs.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import "./vars.c7787a12.css";
|
|
2
|
+
import $kYtTO$search_vars_cssmodulejs from "./search_vars_css.module.js";
|
|
3
|
+
import {useSlotProps as $kYtTO$useSlotProps, classNames as $kYtTO$classNames} from "@react-spectrum/utils";
|
|
4
|
+
import {ClearButton as $kYtTO$ClearButton} from "@react-spectrum/button";
|
|
5
|
+
import $kYtTO$spectrumiconsuiMagnifier from "@spectrum-icons/ui/Magnifier";
|
|
6
|
+
import $kYtTO$react, {useRef as $kYtTO$useRef, forwardRef as $kYtTO$forwardRef} from "react";
|
|
7
|
+
import {TextFieldBase as $kYtTO$TextFieldBase} from "@react-spectrum/textfield";
|
|
8
|
+
import {useFormProps as $kYtTO$useFormProps} from "@react-spectrum/form";
|
|
9
|
+
import {useProviderProps as $kYtTO$useProviderProps} from "@react-spectrum/provider";
|
|
10
|
+
import {useSearchField as $kYtTO$useSearchField} from "@react-aria/searchfield";
|
|
11
|
+
import {useSearchFieldState as $kYtTO$useSearchFieldState} from "@react-stately/searchfield";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function $parcel$interopDefault(a) {
|
|
15
|
+
return a && a.__esModule ? a.default : a;
|
|
16
|
+
}
|
|
17
|
+
/*
|
|
18
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
19
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
21
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
24
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
25
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
26
|
+
* governing permissions and limitations under the License.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
function $a6a4ace9217ce6df$var$SearchField(props, ref) {
|
|
38
|
+
props = (0, $kYtTO$useSlotProps)(props, "searchfield");
|
|
39
|
+
props = (0, $kYtTO$useProviderProps)(props);
|
|
40
|
+
props = (0, $kYtTO$useFormProps)(props);
|
|
41
|
+
let defaultIcon = /*#__PURE__*/ (0, $kYtTO$react).createElement((0, $kYtTO$spectrumiconsuiMagnifier), {
|
|
42
|
+
"data-testid": "searchicon"
|
|
43
|
+
});
|
|
44
|
+
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
45
|
+
if (placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text");
|
|
46
|
+
let state = (0, $kYtTO$useSearchFieldState)(props);
|
|
47
|
+
let inputRef = (0, $kYtTO$useRef)(null);
|
|
48
|
+
let { clearButtonProps: clearButtonProps, ...result } = (0, $kYtTO$useSearchField)(props, state, inputRef);
|
|
49
|
+
let clearButton = /*#__PURE__*/ (0, $kYtTO$react).createElement((0, $kYtTO$ClearButton), {
|
|
50
|
+
...clearButtonProps,
|
|
51
|
+
preventFocus: true,
|
|
52
|
+
UNSAFE_className: (0, $kYtTO$classNames)((0, ($parcel$interopDefault($kYtTO$search_vars_cssmodulejs))), "spectrum-ClearButton"),
|
|
53
|
+
isDisabled: isDisabled
|
|
54
|
+
});
|
|
55
|
+
let validationState = props.validationState || (result.isInvalid ? "invalid" : undefined);
|
|
56
|
+
return /*#__PURE__*/ (0, $kYtTO$react).createElement((0, $kYtTO$TextFieldBase), {
|
|
57
|
+
...otherProps,
|
|
58
|
+
...result,
|
|
59
|
+
validationState: validationState,
|
|
60
|
+
UNSAFE_className: (0, $kYtTO$classNames)((0, ($parcel$interopDefault($kYtTO$search_vars_cssmodulejs))), "spectrum-Search", "spectrum-Textfield", {
|
|
61
|
+
"is-disabled": isDisabled,
|
|
62
|
+
"is-quiet": props.isQuiet,
|
|
63
|
+
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
64
|
+
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
65
|
+
}, UNSAFE_className),
|
|
66
|
+
inputClassName: (0, $kYtTO$classNames)((0, ($parcel$interopDefault($kYtTO$search_vars_cssmodulejs))), "spectrum-Search-input"),
|
|
67
|
+
ref: ref,
|
|
68
|
+
inputRef: inputRef,
|
|
69
|
+
isDisabled: isDisabled,
|
|
70
|
+
icon: icon,
|
|
71
|
+
wrapperChildren: state.value !== "" && !props.isReadOnly ? clearButton : undefined
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A SearchField is a text field designed for searches.
|
|
76
|
+
*/ let $a6a4ace9217ce6df$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $kYtTO$forwardRef)($a6a4ace9217ce6df$var$SearchField);
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
export {$a6a4ace9217ce6df$export$b94867ecbd698f21 as SearchField};
|
|
80
|
+
//# sourceMappingURL=SearchField.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAeD,SAAS,kCAAY,KAA+B,EAAE,GAAsB;IAC1E,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,4BACF,gCAAC,CAAA,GAAA,+BAAQ;QAAE,eAAY;;IAGzB,IAAI,QACF,OAAO,yBACP,UAAU,oBACV,gBAAgB,eAChB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,aACF,QAAQ,IAAI,CAAC;IAGf,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,oBAAC,gBAAgB,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO,OAAO;IAEjE,IAAI,4BACF,gCAAC,CAAA,GAAA,kBAAU;QACR,GAAG,gBAAgB;QACpB,cAAA;QACA,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL;QAGJ,YAAY;;IAGhB,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,OAAO,SAAS,GAAG,YAAY,SAAQ;IAEvF,qBACE,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,UAAU;QACb,GAAG,MAAM;QACV,iBAAiB;QACjB,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL,mBACA,sBACA;YACE,eAAe;YACf,YAAY,MAAM,OAAO;YACzB,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA;QAGJ,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QACnC,KAAK;QACL,UAAU;QACV,YAAY;QACZ,MAAM;QACN,iBAAiB,AAAC,MAAM,KAAK,KAAK,MAAM,CAAC,MAAM,UAAU,GAAI,cAAc;;AAEjF;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/searchfield/src/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {classNames, useSlotProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport React, {forwardRef, ReactElement, Ref, useRef} from 'react';\nimport {SpectrumSearchFieldProps} from '@react-types/searchfield';\nimport styles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSearchField} from '@react-aria/searchfield';\nimport {useSearchFieldState} from '@react-stately/searchfield';\n\nfunction SearchField(props: SpectrumSearchFieldProps, ref: Ref<TextFieldRef>) {\n props = useSlotProps(props, 'searchfield');\n props = useProviderProps(props);\n props = useFormProps(props);\n let defaultIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = defaultIcon,\n isDisabled,\n UNSAFE_className,\n placeholder,\n ...otherProps\n } = props;\n\n if (placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');\n }\n\n let state = useSearchFieldState(props);\n let inputRef = useRef<HTMLInputElement>(null);\n let {clearButtonProps, ...result} = useSearchField(props, state, inputRef);\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let validationState = props.validationState || (result.isInvalid ? 'invalid' : undefined);\n\n return (\n <TextFieldBase\n {...otherProps}\n {...result}\n validationState={validationState}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Search',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': props.isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n UNSAFE_className\n )\n }\n inputClassName={classNames(styles, 'spectrum-Search-input')}\n ref={ref}\n inputRef={inputRef}\n isDisabled={isDisabled}\n icon={icon}\n wrapperChildren={(state.value !== '' && !props.isReadOnly) ? clearButton : undefined} />\n );\n}\n\n/**\n * A SearchField is a text field designed for searches.\n */\nlet _SearchField = forwardRef(SearchField) as (props: SpectrumSearchFieldProps & {ref?: Ref<TextFieldRef>}) => ReactElement;\nexport {_SearchField as SearchField};\n"],"names":[],"version":3,"file":"SearchField.module.js.map"}
|
package/dist/import.mjs
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {useSlotProps as $hlecP$useSlotProps, classNames as $hlecP$classNames} from "@react-spectrum/utils";
|
|
3
|
-
import {ClearButton as $hlecP$ClearButton} from "@react-spectrum/button";
|
|
4
|
-
import $hlecP$spectrumiconsuiMagnifier from "@spectrum-icons/ui/Magnifier";
|
|
5
|
-
import $hlecP$react, {useRef as $hlecP$useRef, forwardRef as $hlecP$forwardRef} from "react";
|
|
6
|
-
import {TextFieldBase as $hlecP$TextFieldBase} from "@react-spectrum/textfield";
|
|
7
|
-
import {useFormProps as $hlecP$useFormProps} from "@react-spectrum/form";
|
|
8
|
-
import {useProviderProps as $hlecP$useProviderProps} from "@react-spectrum/provider";
|
|
9
|
-
import {useSearchField as $hlecP$useSearchField} from "@react-aria/searchfield";
|
|
10
|
-
import {useSearchFieldState as $hlecP$useSearchFieldState} from "@react-stately/searchfield";
|
|
1
|
+
import {SearchField as $a6a4ace9217ce6df$export$b94867ecbd698f21} from "./SearchField.mjs";
|
|
11
2
|
|
|
12
|
-
|
|
13
|
-
function $parcel$interopDefault(a) {
|
|
14
|
-
return a && a.__esModule ? a.default : a;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function $parcel$export(e, n, v, s) {
|
|
18
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
19
|
-
}
|
|
20
3
|
/*
|
|
21
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
22
5
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -28,115 +11,6 @@ function $parcel$export(e, n, v, s) {
|
|
|
28
11
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
29
12
|
* governing permissions and limitations under the License.
|
|
30
13
|
*/ /// <reference types="css-module-types" />
|
|
31
|
-
/*
|
|
32
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
33
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
34
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
35
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
-
*
|
|
37
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
38
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
39
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
40
|
-
* governing permissions and limitations under the License.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var $5589e2270a5c2f51$exports = {};
|
|
46
|
-
|
|
47
|
-
$parcel$export($5589e2270a5c2f51$exports, "focus-ring", () => $5589e2270a5c2f51$export$f39a09f249340e2a, (v) => $5589e2270a5c2f51$export$f39a09f249340e2a = v);
|
|
48
|
-
$parcel$export($5589e2270a5c2f51$exports, "i18nFontFamily", () => $5589e2270a5c2f51$export$8c4ee2c50c22c514, (v) => $5589e2270a5c2f51$export$8c4ee2c50c22c514 = v);
|
|
49
|
-
$parcel$export($5589e2270a5c2f51$exports, "is-quiet", () => $5589e2270a5c2f51$export$6d5c5433f0da4241, (v) => $5589e2270a5c2f51$export$6d5c5433f0da4241 = v);
|
|
50
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-ClearButton", () => $5589e2270a5c2f51$export$b752ce409e5660c, (v) => $5589e2270a5c2f51$export$b752ce409e5660c = v);
|
|
51
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-FocusRing-ring", () => $5589e2270a5c2f51$export$4109102f950813a6, (v) => $5589e2270a5c2f51$export$4109102f950813a6 = v);
|
|
52
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-FocusRing", () => $5589e2270a5c2f51$export$24c7f46a6e3605dd, (v) => $5589e2270a5c2f51$export$24c7f46a6e3605dd = v);
|
|
53
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-FocusRing--quiet", () => $5589e2270a5c2f51$export$2927016961429360, (v) => $5589e2270a5c2f51$export$2927016961429360 = v);
|
|
54
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Search", () => $5589e2270a5c2f51$export$713911d754e1e4ae, (v) => $5589e2270a5c2f51$export$713911d754e1e4ae = v);
|
|
55
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Search--invalid", () => $5589e2270a5c2f51$export$77a6151a0b46a6a3, (v) => $5589e2270a5c2f51$export$77a6151a0b46a6a3 = v);
|
|
56
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Search--loadable", () => $5589e2270a5c2f51$export$9c74d64afae3b2d4, (v) => $5589e2270a5c2f51$export$9c74d64afae3b2d4 = v);
|
|
57
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Search--valid", () => $5589e2270a5c2f51$export$aa81e3ab40f37567, (v) => $5589e2270a5c2f51$export$aa81e3ab40f37567 = v);
|
|
58
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Search-circleLoader", () => $5589e2270a5c2f51$export$70ae4353602451dc, (v) => $5589e2270a5c2f51$export$70ae4353602451dc = v);
|
|
59
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Search-input", () => $5589e2270a5c2f51$export$50e02603f2d97ae1, (v) => $5589e2270a5c2f51$export$50e02603f2d97ae1 = v);
|
|
60
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Search-validationIcon", () => $5589e2270a5c2f51$export$938f0981825eae6e, (v) => $5589e2270a5c2f51$export$938f0981825eae6e = v);
|
|
61
|
-
$parcel$export($5589e2270a5c2f51$exports, "spectrum-Textfield", () => $5589e2270a5c2f51$export$2c8a10299d8b3418, (v) => $5589e2270a5c2f51$export$2c8a10299d8b3418 = v);
|
|
62
|
-
var $5589e2270a5c2f51$export$f39a09f249340e2a;
|
|
63
|
-
var $5589e2270a5c2f51$export$8c4ee2c50c22c514;
|
|
64
|
-
var $5589e2270a5c2f51$export$6d5c5433f0da4241;
|
|
65
|
-
var $5589e2270a5c2f51$export$b752ce409e5660c;
|
|
66
|
-
var $5589e2270a5c2f51$export$4109102f950813a6;
|
|
67
|
-
var $5589e2270a5c2f51$export$24c7f46a6e3605dd;
|
|
68
|
-
var $5589e2270a5c2f51$export$2927016961429360;
|
|
69
|
-
var $5589e2270a5c2f51$export$713911d754e1e4ae;
|
|
70
|
-
var $5589e2270a5c2f51$export$77a6151a0b46a6a3;
|
|
71
|
-
var $5589e2270a5c2f51$export$9c74d64afae3b2d4;
|
|
72
|
-
var $5589e2270a5c2f51$export$aa81e3ab40f37567;
|
|
73
|
-
var $5589e2270a5c2f51$export$70ae4353602451dc;
|
|
74
|
-
var $5589e2270a5c2f51$export$50e02603f2d97ae1;
|
|
75
|
-
var $5589e2270a5c2f51$export$938f0981825eae6e;
|
|
76
|
-
var $5589e2270a5c2f51$export$2c8a10299d8b3418;
|
|
77
|
-
$5589e2270a5c2f51$export$f39a09f249340e2a = `SOkmSG_focus-ring`;
|
|
78
|
-
$5589e2270a5c2f51$export$8c4ee2c50c22c514 = `SOkmSG_i18nFontFamily`;
|
|
79
|
-
$5589e2270a5c2f51$export$6d5c5433f0da4241 = `SOkmSG_is-quiet`;
|
|
80
|
-
$5589e2270a5c2f51$export$b752ce409e5660c = `SOkmSG_spectrum-ClearButton`;
|
|
81
|
-
$5589e2270a5c2f51$export$4109102f950813a6 = `SOkmSG_spectrum-FocusRing-ring`;
|
|
82
|
-
$5589e2270a5c2f51$export$24c7f46a6e3605dd = `SOkmSG_spectrum-FocusRing ${$5589e2270a5c2f51$export$4109102f950813a6}`;
|
|
83
|
-
$5589e2270a5c2f51$export$2927016961429360 = `SOkmSG_spectrum-FocusRing--quiet`;
|
|
84
|
-
$5589e2270a5c2f51$export$713911d754e1e4ae = `SOkmSG_spectrum-Search`;
|
|
85
|
-
$5589e2270a5c2f51$export$77a6151a0b46a6a3 = `SOkmSG_spectrum-Search--invalid`;
|
|
86
|
-
$5589e2270a5c2f51$export$9c74d64afae3b2d4 = `SOkmSG_spectrum-Search--loadable`;
|
|
87
|
-
$5589e2270a5c2f51$export$aa81e3ab40f37567 = `SOkmSG_spectrum-Search--valid`;
|
|
88
|
-
$5589e2270a5c2f51$export$70ae4353602451dc = `SOkmSG_spectrum-Search-circleLoader`;
|
|
89
|
-
$5589e2270a5c2f51$export$50e02603f2d97ae1 = `SOkmSG_spectrum-Search-input`;
|
|
90
|
-
$5589e2270a5c2f51$export$938f0981825eae6e = `SOkmSG_spectrum-Search-validationIcon`;
|
|
91
|
-
$5589e2270a5c2f51$export$2c8a10299d8b3418 = `SOkmSG_spectrum-Textfield`;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
function $a6a4ace9217ce6df$var$SearchField(props, ref) {
|
|
100
|
-
props = (0, $hlecP$useSlotProps)(props, "searchfield");
|
|
101
|
-
props = (0, $hlecP$useProviderProps)(props);
|
|
102
|
-
props = (0, $hlecP$useFormProps)(props);
|
|
103
|
-
let defaultIcon = /*#__PURE__*/ (0, $hlecP$react).createElement((0, $hlecP$spectrumiconsuiMagnifier), {
|
|
104
|
-
"data-testid": "searchicon"
|
|
105
|
-
});
|
|
106
|
-
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
107
|
-
if (placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text");
|
|
108
|
-
let state = (0, $hlecP$useSearchFieldState)(props);
|
|
109
|
-
let inputRef = (0, $hlecP$useRef)(null);
|
|
110
|
-
let { clearButtonProps: clearButtonProps, ...result } = (0, $hlecP$useSearchField)(props, state, inputRef);
|
|
111
|
-
let clearButton = /*#__PURE__*/ (0, $hlecP$react).createElement((0, $hlecP$ClearButton), {
|
|
112
|
-
...clearButtonProps,
|
|
113
|
-
preventFocus: true,
|
|
114
|
-
UNSAFE_className: (0, $hlecP$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-ClearButton"),
|
|
115
|
-
isDisabled: isDisabled
|
|
116
|
-
});
|
|
117
|
-
let validationState = props.validationState || (result.isInvalid ? "invalid" : undefined);
|
|
118
|
-
return /*#__PURE__*/ (0, $hlecP$react).createElement((0, $hlecP$TextFieldBase), {
|
|
119
|
-
...otherProps,
|
|
120
|
-
...result,
|
|
121
|
-
validationState: validationState,
|
|
122
|
-
UNSAFE_className: (0, $hlecP$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search", "spectrum-Textfield", {
|
|
123
|
-
"is-disabled": isDisabled,
|
|
124
|
-
"is-quiet": props.isQuiet,
|
|
125
|
-
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
126
|
-
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
127
|
-
}, UNSAFE_className),
|
|
128
|
-
inputClassName: (0, $hlecP$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($5589e2270a5c2f51$exports))), "spectrum-Search-input"),
|
|
129
|
-
ref: ref,
|
|
130
|
-
inputRef: inputRef,
|
|
131
|
-
isDisabled: isDisabled,
|
|
132
|
-
icon: icon,
|
|
133
|
-
wrapperChildren: state.value !== "" && !props.isReadOnly ? clearButton : undefined
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* A SearchField is a text field designed for searches.
|
|
138
|
-
*/ let $a6a4ace9217ce6df$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $hlecP$forwardRef)($a6a4ace9217ce6df$var$SearchField);
|
|
139
|
-
|
|
140
14
|
|
|
141
15
|
|
|
142
16
|
|
package/dist/main.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
require("./main.
|
|
2
|
-
var $kYnKt$reactspectrumutils = require("@react-spectrum/utils");
|
|
3
|
-
var $kYnKt$reactspectrumbutton = require("@react-spectrum/button");
|
|
4
|
-
var $kYnKt$spectrumiconsuiMagnifier = require("@spectrum-icons/ui/Magnifier");
|
|
5
|
-
var $kYnKt$react = require("react");
|
|
6
|
-
var $kYnKt$reactspectrumtextfield = require("@react-spectrum/textfield");
|
|
7
|
-
var $kYnKt$reactspectrumform = require("@react-spectrum/form");
|
|
8
|
-
var $kYnKt$reactspectrumprovider = require("@react-spectrum/provider");
|
|
9
|
-
var $kYnKt$reactariasearchfield = require("@react-aria/searchfield");
|
|
10
|
-
var $kYnKt$reactstatelysearchfield = require("@react-stately/searchfield");
|
|
1
|
+
var $111fe330b4c1f3ac$exports = require("./SearchField.main.js");
|
|
11
2
|
|
|
12
3
|
|
|
13
4
|
function $parcel$export(e, n, v, s) {
|
|
14
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
6
|
}
|
|
16
7
|
|
|
17
|
-
|
|
18
|
-
return a && a.__esModule ? a.default : a;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
$parcel$export(module.exports, "SearchField", () => $111fe330b4c1f3ac$export$b94867ecbd698f21);
|
|
8
|
+
$parcel$export(module.exports, "SearchField", () => $111fe330b4c1f3ac$exports.SearchField);
|
|
22
9
|
/*
|
|
23
10
|
* Copyright 2020 Adobe. All rights reserved.
|
|
24
11
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -30,115 +17,6 @@ $parcel$export(module.exports, "SearchField", () => $111fe330b4c1f3ac$export$b94
|
|
|
30
17
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
31
18
|
* governing permissions and limitations under the License.
|
|
32
19
|
*/ /// <reference types="css-module-types" />
|
|
33
|
-
/*
|
|
34
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
35
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
36
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
37
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
38
|
-
*
|
|
39
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
40
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
41
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
42
|
-
* governing permissions and limitations under the License.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var $1e139f06a0a4b696$exports = {};
|
|
48
|
-
|
|
49
|
-
$parcel$export($1e139f06a0a4b696$exports, "focus-ring", () => $1e139f06a0a4b696$export$f39a09f249340e2a, (v) => $1e139f06a0a4b696$export$f39a09f249340e2a = v);
|
|
50
|
-
$parcel$export($1e139f06a0a4b696$exports, "i18nFontFamily", () => $1e139f06a0a4b696$export$8c4ee2c50c22c514, (v) => $1e139f06a0a4b696$export$8c4ee2c50c22c514 = v);
|
|
51
|
-
$parcel$export($1e139f06a0a4b696$exports, "is-quiet", () => $1e139f06a0a4b696$export$6d5c5433f0da4241, (v) => $1e139f06a0a4b696$export$6d5c5433f0da4241 = v);
|
|
52
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-ClearButton", () => $1e139f06a0a4b696$export$b752ce409e5660c, (v) => $1e139f06a0a4b696$export$b752ce409e5660c = v);
|
|
53
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-FocusRing-ring", () => $1e139f06a0a4b696$export$4109102f950813a6, (v) => $1e139f06a0a4b696$export$4109102f950813a6 = v);
|
|
54
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-FocusRing", () => $1e139f06a0a4b696$export$24c7f46a6e3605dd, (v) => $1e139f06a0a4b696$export$24c7f46a6e3605dd = v);
|
|
55
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-FocusRing--quiet", () => $1e139f06a0a4b696$export$2927016961429360, (v) => $1e139f06a0a4b696$export$2927016961429360 = v);
|
|
56
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Search", () => $1e139f06a0a4b696$export$713911d754e1e4ae, (v) => $1e139f06a0a4b696$export$713911d754e1e4ae = v);
|
|
57
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Search--invalid", () => $1e139f06a0a4b696$export$77a6151a0b46a6a3, (v) => $1e139f06a0a4b696$export$77a6151a0b46a6a3 = v);
|
|
58
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Search--loadable", () => $1e139f06a0a4b696$export$9c74d64afae3b2d4, (v) => $1e139f06a0a4b696$export$9c74d64afae3b2d4 = v);
|
|
59
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Search--valid", () => $1e139f06a0a4b696$export$aa81e3ab40f37567, (v) => $1e139f06a0a4b696$export$aa81e3ab40f37567 = v);
|
|
60
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Search-circleLoader", () => $1e139f06a0a4b696$export$70ae4353602451dc, (v) => $1e139f06a0a4b696$export$70ae4353602451dc = v);
|
|
61
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Search-input", () => $1e139f06a0a4b696$export$50e02603f2d97ae1, (v) => $1e139f06a0a4b696$export$50e02603f2d97ae1 = v);
|
|
62
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Search-validationIcon", () => $1e139f06a0a4b696$export$938f0981825eae6e, (v) => $1e139f06a0a4b696$export$938f0981825eae6e = v);
|
|
63
|
-
$parcel$export($1e139f06a0a4b696$exports, "spectrum-Textfield", () => $1e139f06a0a4b696$export$2c8a10299d8b3418, (v) => $1e139f06a0a4b696$export$2c8a10299d8b3418 = v);
|
|
64
|
-
var $1e139f06a0a4b696$export$f39a09f249340e2a;
|
|
65
|
-
var $1e139f06a0a4b696$export$8c4ee2c50c22c514;
|
|
66
|
-
var $1e139f06a0a4b696$export$6d5c5433f0da4241;
|
|
67
|
-
var $1e139f06a0a4b696$export$b752ce409e5660c;
|
|
68
|
-
var $1e139f06a0a4b696$export$4109102f950813a6;
|
|
69
|
-
var $1e139f06a0a4b696$export$24c7f46a6e3605dd;
|
|
70
|
-
var $1e139f06a0a4b696$export$2927016961429360;
|
|
71
|
-
var $1e139f06a0a4b696$export$713911d754e1e4ae;
|
|
72
|
-
var $1e139f06a0a4b696$export$77a6151a0b46a6a3;
|
|
73
|
-
var $1e139f06a0a4b696$export$9c74d64afae3b2d4;
|
|
74
|
-
var $1e139f06a0a4b696$export$aa81e3ab40f37567;
|
|
75
|
-
var $1e139f06a0a4b696$export$70ae4353602451dc;
|
|
76
|
-
var $1e139f06a0a4b696$export$50e02603f2d97ae1;
|
|
77
|
-
var $1e139f06a0a4b696$export$938f0981825eae6e;
|
|
78
|
-
var $1e139f06a0a4b696$export$2c8a10299d8b3418;
|
|
79
|
-
$1e139f06a0a4b696$export$f39a09f249340e2a = `SOkmSG_focus-ring`;
|
|
80
|
-
$1e139f06a0a4b696$export$8c4ee2c50c22c514 = `SOkmSG_i18nFontFamily`;
|
|
81
|
-
$1e139f06a0a4b696$export$6d5c5433f0da4241 = `SOkmSG_is-quiet`;
|
|
82
|
-
$1e139f06a0a4b696$export$b752ce409e5660c = `SOkmSG_spectrum-ClearButton`;
|
|
83
|
-
$1e139f06a0a4b696$export$4109102f950813a6 = `SOkmSG_spectrum-FocusRing-ring`;
|
|
84
|
-
$1e139f06a0a4b696$export$24c7f46a6e3605dd = `SOkmSG_spectrum-FocusRing ${$1e139f06a0a4b696$export$4109102f950813a6}`;
|
|
85
|
-
$1e139f06a0a4b696$export$2927016961429360 = `SOkmSG_spectrum-FocusRing--quiet`;
|
|
86
|
-
$1e139f06a0a4b696$export$713911d754e1e4ae = `SOkmSG_spectrum-Search`;
|
|
87
|
-
$1e139f06a0a4b696$export$77a6151a0b46a6a3 = `SOkmSG_spectrum-Search--invalid`;
|
|
88
|
-
$1e139f06a0a4b696$export$9c74d64afae3b2d4 = `SOkmSG_spectrum-Search--loadable`;
|
|
89
|
-
$1e139f06a0a4b696$export$aa81e3ab40f37567 = `SOkmSG_spectrum-Search--valid`;
|
|
90
|
-
$1e139f06a0a4b696$export$70ae4353602451dc = `SOkmSG_spectrum-Search-circleLoader`;
|
|
91
|
-
$1e139f06a0a4b696$export$50e02603f2d97ae1 = `SOkmSG_spectrum-Search-input`;
|
|
92
|
-
$1e139f06a0a4b696$export$938f0981825eae6e = `SOkmSG_spectrum-Search-validationIcon`;
|
|
93
|
-
$1e139f06a0a4b696$export$2c8a10299d8b3418 = `SOkmSG_spectrum-Textfield`;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
function $111fe330b4c1f3ac$var$SearchField(props, ref) {
|
|
102
|
-
props = (0, $kYnKt$reactspectrumutils.useSlotProps)(props, "searchfield");
|
|
103
|
-
props = (0, $kYnKt$reactspectrumprovider.useProviderProps)(props);
|
|
104
|
-
props = (0, $kYnKt$reactspectrumform.useFormProps)(props);
|
|
105
|
-
let defaultIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($kYnKt$react))).createElement((0, ($parcel$interopDefault($kYnKt$spectrumiconsuiMagnifier))), {
|
|
106
|
-
"data-testid": "searchicon"
|
|
107
|
-
});
|
|
108
|
-
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
109
|
-
if (placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text");
|
|
110
|
-
let state = (0, $kYnKt$reactstatelysearchfield.useSearchFieldState)(props);
|
|
111
|
-
let inputRef = (0, $kYnKt$react.useRef)(null);
|
|
112
|
-
let { clearButtonProps: clearButtonProps, ...result } = (0, $kYnKt$reactariasearchfield.useSearchField)(props, state, inputRef);
|
|
113
|
-
let clearButton = /*#__PURE__*/ (0, ($parcel$interopDefault($kYnKt$react))).createElement((0, $kYnKt$reactspectrumbutton.ClearButton), {
|
|
114
|
-
...clearButtonProps,
|
|
115
|
-
preventFocus: true,
|
|
116
|
-
UNSAFE_className: (0, $kYnKt$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-ClearButton"),
|
|
117
|
-
isDisabled: isDisabled
|
|
118
|
-
});
|
|
119
|
-
let validationState = props.validationState || (result.isInvalid ? "invalid" : undefined);
|
|
120
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($kYnKt$react))).createElement((0, $kYnKt$reactspectrumtextfield.TextFieldBase), {
|
|
121
|
-
...otherProps,
|
|
122
|
-
...result,
|
|
123
|
-
validationState: validationState,
|
|
124
|
-
UNSAFE_className: (0, $kYnKt$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search", "spectrum-Textfield", {
|
|
125
|
-
"is-disabled": isDisabled,
|
|
126
|
-
"is-quiet": props.isQuiet,
|
|
127
|
-
"spectrum-Search--invalid": validationState === "invalid" && !isDisabled,
|
|
128
|
-
"spectrum-Search--valid": validationState === "valid" && !isDisabled
|
|
129
|
-
}, UNSAFE_className),
|
|
130
|
-
inputClassName: (0, $kYnKt$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e139f06a0a4b696$exports))), "spectrum-Search-input"),
|
|
131
|
-
ref: ref,
|
|
132
|
-
inputRef: inputRef,
|
|
133
|
-
isDisabled: isDisabled,
|
|
134
|
-
icon: icon,
|
|
135
|
-
wrapperChildren: state.value !== "" && !props.isReadOnly ? clearButton : undefined
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* A SearchField is a text field designed for searches.
|
|
140
|
-
*/ let $111fe330b4c1f3ac$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $kYnKt$react.forwardRef)($111fe330b4c1f3ac$var$SearchField);
|
|
141
|
-
|
|
142
20
|
|
|
143
21
|
|
|
144
22
|
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/searchfield/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport {SearchField} from './SearchField';\nexport type {SpectrumSearchFieldProps} from '@react-types/searchfield';\n"],"names":[],"version":3,"file":"main.js.map"}
|