@react-spectrum/searchfield 3.0.0-nightly.1349 → 3.0.0-nightly.1356
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/main.css +1 -2
- package/dist/main.js +112 -108
- package/dist/main.js.map +1 -1
- package/dist/module.js +94 -75
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/dist/main.css.map +0 -1
package/dist/main.css
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
._spectrum-
|
|
2
|
-
/*# sourceMappingURL=main.css.map */
|
|
1
|
+
._spectrum-Search_d3c0f3{display:inline-block;position:relative}[dir=ltr] ._spectrum-Search_d3c0f3 ._spectrum-ClearButton_d3c0f3{right:0}[dir=rtl] ._spectrum-Search_d3c0f3 ._spectrum-ClearButton_d3c0f3{left:0}._spectrum-Search_d3c0f3 ._spectrum-ClearButton_d3c0f3{position:absolute;top:0}[dir=ltr] ._spectrum-Search_d3c0f3._is-quiet_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-left:var(--spectrum-global-dimension-size-300)}[dir=rtl] ._spectrum-Search_d3c0f3._is-quiet_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-right:var(--spectrum-global-dimension-size-300)}[dir=ltr] ._spectrum-Search_d3c0f3._is-quiet_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-right:var(--spectrum-global-dimension-size-350)}[dir=rtl] ._spectrum-Search_d3c0f3._is-quiet_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-left:var(--spectrum-global-dimension-size-350)}[dir=ltr] ._spectrum-Search_d3c0f3._spectrum-Search--invalid_d3c0f3 ._spectrum-ClearButton_d3c0f3{right:calc(var(--spectrum-icon-alert-medium-width, var(--spectrum-global-dimension-size-225)) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)))}[dir=rtl] ._spectrum-Search_d3c0f3._spectrum-Search--invalid_d3c0f3 ._spectrum-ClearButton_d3c0f3{left:calc(var(--spectrum-icon-alert-medium-width, var(--spectrum-global-dimension-size-225)) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)))}[dir=ltr] ._spectrum-Search_d3c0f3._spectrum-Search--valid_d3c0f3 ._spectrum-ClearButton_d3c0f3{right:calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) / 2 + var(--spectrum-global-dimension-size-150))}[dir=rtl] ._spectrum-Search_d3c0f3._spectrum-Search--valid_d3c0f3 ._spectrum-ClearButton_d3c0f3{left:calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) / 2 + var(--spectrum-global-dimension-size-150))}[dir=ltr] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-ClearButton_d3c0f3{right:0}[dir=rtl] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-ClearButton_d3c0f3{left:0}[dir=ltr] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-circleLoader_d3c0f3{right:calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) / 2 + var(--spectrum-global-dimension-size-150))}[dir=rtl] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-circleLoader_d3c0f3{left:calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) / 2 + var(--spectrum-global-dimension-size-150))}[dir=ltr] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-validationIcon_d3c0f3{right:calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) / 2 + var(--spectrum-global-dimension-size-150))}[dir=rtl] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-validationIcon_d3c0f3{left:calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) / 2 + var(--spectrum-global-dimension-size-150))}[dir=ltr] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-validationIcon_d3c0f3{padding-right:0}[dir=rtl] ._spectrum-Search_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-validationIcon_d3c0f3{padding-left:0}[dir=ltr] ._spectrum-Search-input_d3c0f3{padding-right:var(--spectrum-global-dimension-size-350)}[dir=rtl] ._spectrum-Search-input_d3c0f3{padding-left:var(--spectrum-global-dimension-size-350)}._spectrum-Search-input_d3c0f3{-webkit-appearance:none;display:block;outline-offset:-2px;text-indent:0}._spectrum-Search-input_d3c0f3::-webkit-search-cancel-button,._spectrum-Search-input_d3c0f3::-webkit-search-decoration{-webkit-appearance:none}[dir=ltr] ._spectrum-Textfield_d3c0f3._spectrum-Search--invalid_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-right:calc(var(--spectrum-global-dimension-size-350) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) + var(--spectrum-icon-alert-medium-width, var(--spectrum-global-dimension-size-225)) + var(--spectrum-textfield-icon-margin-left, var(--spectrum-global-dimension-size-150)))}[dir=rtl] ._spectrum-Textfield_d3c0f3._spectrum-Search--invalid_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-left:calc(var(--spectrum-global-dimension-size-350) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) + var(--spectrum-icon-alert-medium-width, var(--spectrum-global-dimension-size-225)) + var(--spectrum-textfield-icon-margin-left, var(--spectrum-global-dimension-size-150)))}[dir=ltr] ._spectrum-Textfield_d3c0f3._spectrum-Search--valid_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-right:calc(var(--spectrum-global-dimension-size-350) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-icon-margin-left, var(--spectrum-global-dimension-size-150)))}[dir=rtl] ._spectrum-Textfield_d3c0f3._spectrum-Search--valid_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-left:calc(var(--spectrum-global-dimension-size-350) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-icon-margin-left, var(--spectrum-global-dimension-size-150)))}[dir=ltr] ._spectrum-Textfield_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-right:calc(var(--spectrum-global-dimension-size-350) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-icon-margin-left, var(--spectrum-global-dimension-size-150)))}[dir=rtl] ._spectrum-Textfield_d3c0f3._spectrum-Search--loadable_d3c0f3 ._spectrum-Search-input_d3c0f3{padding-left:calc(var(--spectrum-global-dimension-size-350) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-icon-margin-left, var(--spectrum-global-dimension-size-150)))}
|
package/dist/main.js
CHANGED
|
@@ -1,118 +1,122 @@
|
|
|
1
|
-
var {
|
|
2
|
-
useSearchFieldState
|
|
3
|
-
} = require("@react-stately/searchfield");
|
|
4
|
-
|
|
5
|
-
var {
|
|
6
|
-
useSearchField
|
|
7
|
-
} = require("@react-aria/searchfield");
|
|
8
|
-
|
|
9
|
-
var {
|
|
10
|
-
useProviderProps
|
|
11
|
-
} = require("@react-spectrum/provider");
|
|
12
|
-
|
|
13
|
-
var {
|
|
14
|
-
TextFieldBase
|
|
15
|
-
} = require("@react-spectrum/textfield");
|
|
16
|
-
|
|
17
|
-
var _react2 = require("react");
|
|
18
|
-
|
|
19
|
-
var _react = $parcel$interopDefault(_react2);
|
|
20
|
-
|
|
21
|
-
var {
|
|
22
|
-
forwardRef,
|
|
23
|
-
useRef
|
|
24
|
-
} = _react2;
|
|
25
|
-
|
|
26
|
-
var _spectrumIconsUiMagnifier = $parcel$interopDefault(require("@spectrum-icons/ui/Magnifier"));
|
|
27
|
-
|
|
28
|
-
var {
|
|
29
|
-
ClearButton
|
|
30
|
-
} = require("@react-spectrum/button");
|
|
31
|
-
|
|
32
|
-
var {
|
|
33
|
-
classNames,
|
|
34
|
-
useSlotProps
|
|
35
|
-
} = require("@react-spectrum/utils");
|
|
36
|
-
|
|
37
|
-
var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
38
|
-
|
|
39
|
-
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
|
|
40
|
-
|
|
41
1
|
require("./main.css");
|
|
42
|
-
|
|
2
|
+
var $iDe9y$reactspectrumutils = require("@react-spectrum/utils");
|
|
3
|
+
var $iDe9y$reactspectrumbutton = require("@react-spectrum/button");
|
|
4
|
+
var $iDe9y$spectrumiconsuiMagnifier = require("@spectrum-icons/ui/Magnifier");
|
|
5
|
+
var $iDe9y$react = require("react");
|
|
6
|
+
var $iDe9y$reactspectrumtextfield = require("@react-spectrum/textfield");
|
|
7
|
+
var $iDe9y$reactspectrumprovider = require("@react-spectrum/provider");
|
|
8
|
+
var $iDe9y$reactariasearchfield = require("@react-aria/searchfield");
|
|
9
|
+
var $iDe9y$reactstatelysearchfield = require("@react-stately/searchfield");
|
|
10
|
+
|
|
11
|
+
function $parcel$exportWildcard(dest, source) {
|
|
12
|
+
Object.keys(source).forEach(function(key) {
|
|
13
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(dest, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return source[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return dest;
|
|
26
|
+
}
|
|
43
27
|
function $parcel$interopDefault(a) {
|
|
44
28
|
return a && a.__esModule ? a.default : a;
|
|
45
29
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
$
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
30
|
+
function $parcel$export(e, n, v, s) {
|
|
31
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
32
|
+
}
|
|
33
|
+
var $816344e6b5821b5d$exports = {};
|
|
34
|
+
|
|
35
|
+
$parcel$export($816344e6b5821b5d$exports, "SearchField", () => $816344e6b5821b5d$export$b94867ecbd698f21);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
var $70e964570b1e0fa9$exports = {};
|
|
41
|
+
|
|
42
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Search", () => $70e964570b1e0fa9$export$713911d754e1e4ae, (v) => $70e964570b1e0fa9$export$713911d754e1e4ae = v);
|
|
43
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-ClearButton", () => $70e964570b1e0fa9$export$b752ce409e5660c, (v) => $70e964570b1e0fa9$export$b752ce409e5660c = v);
|
|
44
|
+
$parcel$export($70e964570b1e0fa9$exports, "is-quiet", () => $70e964570b1e0fa9$export$6d5c5433f0da4241, (v) => $70e964570b1e0fa9$export$6d5c5433f0da4241 = v);
|
|
45
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Search-input", () => $70e964570b1e0fa9$export$50e02603f2d97ae1, (v) => $70e964570b1e0fa9$export$50e02603f2d97ae1 = v);
|
|
46
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Search--invalid", () => $70e964570b1e0fa9$export$77a6151a0b46a6a3, (v) => $70e964570b1e0fa9$export$77a6151a0b46a6a3 = v);
|
|
47
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Search--valid", () => $70e964570b1e0fa9$export$aa81e3ab40f37567, (v) => $70e964570b1e0fa9$export$aa81e3ab40f37567 = v);
|
|
48
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Search--loadable", () => $70e964570b1e0fa9$export$9c74d64afae3b2d4, (v) => $70e964570b1e0fa9$export$9c74d64afae3b2d4 = v);
|
|
49
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Search-circleLoader", () => $70e964570b1e0fa9$export$70ae4353602451dc, (v) => $70e964570b1e0fa9$export$70ae4353602451dc = v);
|
|
50
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Search-validationIcon", () => $70e964570b1e0fa9$export$938f0981825eae6e, (v) => $70e964570b1e0fa9$export$938f0981825eae6e = v);
|
|
51
|
+
$parcel$export($70e964570b1e0fa9$exports, "spectrum-Textfield", () => $70e964570b1e0fa9$export$2c8a10299d8b3418, (v) => $70e964570b1e0fa9$export$2c8a10299d8b3418 = v);
|
|
52
|
+
var $70e964570b1e0fa9$export$713911d754e1e4ae;
|
|
53
|
+
var $70e964570b1e0fa9$export$b752ce409e5660c;
|
|
54
|
+
var $70e964570b1e0fa9$export$6d5c5433f0da4241;
|
|
55
|
+
var $70e964570b1e0fa9$export$50e02603f2d97ae1;
|
|
56
|
+
var $70e964570b1e0fa9$export$77a6151a0b46a6a3;
|
|
57
|
+
var $70e964570b1e0fa9$export$aa81e3ab40f37567;
|
|
58
|
+
var $70e964570b1e0fa9$export$9c74d64afae3b2d4;
|
|
59
|
+
var $70e964570b1e0fa9$export$70ae4353602451dc;
|
|
60
|
+
var $70e964570b1e0fa9$export$938f0981825eae6e;
|
|
61
|
+
var $70e964570b1e0fa9$export$2c8a10299d8b3418;
|
|
62
|
+
$70e964570b1e0fa9$export$713911d754e1e4ae = "_spectrum-Search_d3c0f3";
|
|
63
|
+
$70e964570b1e0fa9$export$b752ce409e5660c = "_spectrum-ClearButton_d3c0f3";
|
|
64
|
+
$70e964570b1e0fa9$export$6d5c5433f0da4241 = "_is-quiet_d3c0f3";
|
|
65
|
+
$70e964570b1e0fa9$export$50e02603f2d97ae1 = "_spectrum-Search-input_d3c0f3";
|
|
66
|
+
$70e964570b1e0fa9$export$77a6151a0b46a6a3 = "_spectrum-Search--invalid_d3c0f3";
|
|
67
|
+
$70e964570b1e0fa9$export$aa81e3ab40f37567 = "_spectrum-Search--valid_d3c0f3";
|
|
68
|
+
$70e964570b1e0fa9$export$9c74d64afae3b2d4 = "_spectrum-Search--loadable_d3c0f3";
|
|
69
|
+
$70e964570b1e0fa9$export$70ae4353602451dc = "_spectrum-Search-circleLoader_d3c0f3";
|
|
70
|
+
$70e964570b1e0fa9$export$938f0981825eae6e = "_spectrum-Search-validationIcon_d3c0f3";
|
|
71
|
+
$70e964570b1e0fa9$export$2c8a10299d8b3418 = "_spectrum-Textfield_d3c0f3";
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
function $816344e6b5821b5d$var$SearchField(props, ref) {
|
|
79
|
+
props = $iDe9y$reactspectrumutils.useSlotProps(props, 'searchfield');
|
|
80
|
+
props = $iDe9y$reactspectrumprovider.useProviderProps(props);
|
|
81
|
+
let defaultIcon = /*#__PURE__*/ ($parcel$interopDefault($iDe9y$react)).createElement(($parcel$interopDefault($iDe9y$spectrumiconsuiMagnifier)), {
|
|
82
|
+
"data-testid": "searchicon"
|
|
83
|
+
});
|
|
84
|
+
let { icon: icon = defaultIcon , isDisabled: isDisabled , UNSAFE_className: UNSAFE_className , ...otherProps } = props;
|
|
85
|
+
let state = $iDe9y$reactstatelysearchfield.useSearchFieldState(props);
|
|
86
|
+
let inputRef = $iDe9y$react.useRef();
|
|
87
|
+
let { labelProps: labelProps , inputProps: inputProps , clearButtonProps: clearButtonProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $iDe9y$reactariasearchfield.useSearchField(props, state, inputRef);
|
|
88
|
+
let clearButton = /*#__PURE__*/ ($parcel$interopDefault($iDe9y$react)).createElement($iDe9y$reactspectrumbutton.ClearButton, {
|
|
89
|
+
...clearButtonProps,
|
|
90
|
+
preventFocus: true,
|
|
91
|
+
UNSAFE_className: $iDe9y$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($70e964570b1e0fa9$exports)), 'spectrum-ClearButton'),
|
|
92
|
+
isDisabled: isDisabled
|
|
93
|
+
});
|
|
94
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($iDe9y$react)).createElement($iDe9y$reactspectrumtextfield.TextFieldBase, {
|
|
95
|
+
...otherProps,
|
|
96
|
+
labelProps: labelProps,
|
|
97
|
+
inputProps: inputProps,
|
|
98
|
+
descriptionProps: descriptionProps,
|
|
99
|
+
errorMessageProps: errorMessageProps,
|
|
100
|
+
UNSAFE_className: $iDe9y$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($70e964570b1e0fa9$exports)), 'spectrum-Search', 'spectrum-Textfield', {
|
|
101
|
+
'is-disabled': isDisabled,
|
|
102
|
+
'is-quiet': props.isQuiet,
|
|
103
|
+
'spectrum-Search--invalid': props.validationState === 'invalid',
|
|
104
|
+
'spectrum-Search--valid': props.validationState === 'valid'
|
|
105
|
+
}, UNSAFE_className),
|
|
106
|
+
inputClassName: $iDe9y$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($70e964570b1e0fa9$exports)), 'spectrum-Search-input'),
|
|
107
|
+
ref: ref,
|
|
108
|
+
inputRef: inputRef,
|
|
109
|
+
isDisabled: isDisabled,
|
|
110
|
+
icon: icon,
|
|
111
|
+
wrapperChildren: state.value !== '' && !props.isReadOnly && clearButton
|
|
112
|
+
}));
|
|
110
113
|
}
|
|
111
114
|
/**
|
|
112
115
|
* A SearchField is a text field designed for searches.
|
|
113
|
-
*/
|
|
116
|
+
*/ let $816344e6b5821b5d$export$b94867ecbd698f21 = /*#__PURE__*/ $iDe9y$react.forwardRef($816344e6b5821b5d$var$SearchField);
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
$parcel$exportWildcard(module.exports, $816344e6b5821b5d$exports);
|
|
114
120
|
|
|
115
121
|
|
|
116
|
-
let SearchField = /*#__PURE__*/forwardRef($c7bd01575afa7bea7ba1694646$var$SearchField);
|
|
117
|
-
exports.SearchField = SearchField;
|
|
118
122
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAiC;AACjC,GAAsC;AACtC,GAA0B;AAC1B,GAAuC;AACvC,GAA0C;AAC1C,GAAwC;AACxC,GAA2C;AAC3C,GAA8C;AAC9C,GAAgD;AAChD,GAAoC;AATpC,yCAAiC,GAAG,CAAyB;AAC7D,wCAAsC,GAAG,CAA8B;AACvE,yCAA0B,GAAG,CAAkB;AAC/C,yCAAuC,GAAG,CAA+B;AACzE,yCAA0C,GAAG,CAAkC;AAC/E,yCAAwC,GAAG,CAAgC;AAC3E,yCAA2C,GAAG,CAAmC;AACjF,yCAA8C,GAAG,CAAsC;AACvF,yCAAgD,GAAG,CAAwC;AAC3F,yCAAoC,GAAG,CAA4B;;;;;;;SDe1D,iCAAW,CAAC,KAA+B,EAAE,GAA4B,EAAE,CAAC;IACnF,KAAK,GAAG,sCAAY,CAAC,KAAK,EAAE,CAAa;IACzC,KAAK,GAAG,6CAAgB,CAAC,KAAK;IAC9B,GAAG,CAAC,WAAW,sEACZ,yDAAS;QAAC,CAAW,cAAC,CAAY;;IAGrC,GAAG,CAAC,CAAC,OACH,IAAI,GAAG,WAAW,eAClB,UAAU,qBACV,gBAAgB,MACb,UAAU,CACf,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,KAAK,GAAG,kDAAmB,CAAC,KAAK;IACrC,GAAG,CAAC,QAAQ,GAAG,mBAAM;IACrB,GAAG,CAAC,CAAC,aAAA,UAAU,eAAE,UAAU,qBAAE,gBAAgB,qBAAE,gBAAgB,sBAAE,iBAAiB,EAAA,CAAC,GAAG,0CAAc,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ;IAE3H,GAAG,CAAC,WAAW,sEACZ,sCAAW;WACN,gBAAgB;QACpB,YAAY,EAAZ,IAAY;QACZ,gBAAgB,EACd,oCAAU,CACR,gEAAM,EACN,CAAsB;QAG1B,UAAU,EAAE,UAAU;;IAG1B,MAAM,oEACH,2CAAa;WACR,UAAU;QACd,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;QACtB,gBAAgB,EAAE,gBAAgB;QAClC,iBAAiB,EAAE,iBAAiB;QACpC,gBAAgB,EACd,oCAAU,CACR,gEAAM,EACN,CAAiB,kBACjB,CAAoB,qBACpB,CAAC;YACC,CAAa,cAAE,UAAU;YACzB,CAAU,WAAE,KAAK,CAAC,OAAO;YACzB,CAA0B,2BAAE,KAAK,CAAC,eAAe,KAAK,CAAS;YAC/D,CAAwB,yBAAE,KAAK,CAAC,eAAe,KAAK,CAAO;QAC7D,CAAC,EACD,gBAAgB;QAGpB,cAAc,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAAuB;QAC1D,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,IAAI;QACV,eAAe,EAAG,KAAK,CAAC,KAAK,KAAK,CAAE,MAAK,KAAK,CAAC,UAAU,IAAK,WAAW;;AAE/E,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAY,iBAAG,uBAAU,CAAC,iCAAW","sources":["packages/@react-spectrum/searchfield/src/index.ts","packages/@react-spectrum/searchfield/src/SearchField.tsx","packages/@adobe/spectrum-css-temp/components/search/vars.css"],"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 * from './SearchField';\n","/*\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, RefObject, 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 {useProviderProps} from '@react-spectrum/provider';\nimport {useSearchField} from '@react-aria/searchfield';\nimport {useSearchFieldState} from '@react-stately/searchfield';\n\nfunction SearchField(props: SpectrumSearchFieldProps, ref: RefObject<TextFieldRef>) {\n props = useSlotProps(props, 'searchfield');\n props = useProviderProps(props);\n let defaultIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = defaultIcon,\n isDisabled,\n UNSAFE_className,\n ...otherProps\n } = props;\n\n let state = useSearchFieldState(props);\n let inputRef = useRef<HTMLInputElement>();\n let {labelProps, inputProps, clearButtonProps, descriptionProps, errorMessageProps} = 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 return (\n <TextFieldBase\n {...otherProps}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\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': props.validationState === 'invalid',\n 'spectrum-Search--valid': props.validationState === 'valid'\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} />\n );\n}\n\n/**\n * A SearchField is a text field designed for searches.\n */\nlet _SearchField = forwardRef(SearchField);\nexport {_SearchField as SearchField};\n","/*\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@import './index.css';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,87 +1,106 @@
|
|
|
1
|
-
import { useSearchFieldState } from "@react-stately/searchfield";
|
|
2
|
-
import { useSearchField } from "@react-aria/searchfield";
|
|
3
|
-
import { useProviderProps } from "@react-spectrum/provider";
|
|
4
|
-
import { TextFieldBase } from "@react-spectrum/textfield";
|
|
5
|
-
import _react, { forwardRef, useRef } from "react";
|
|
6
|
-
import _spectrumIconsUiMagnifier from "@spectrum-icons/ui/Magnifier";
|
|
7
|
-
import { ClearButton } from "@react-spectrum/button";
|
|
8
|
-
import { classNames, useSlotProps } from "@react-spectrum/utils";
|
|
9
|
-
import _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
10
|
-
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
|
|
11
1
|
import "./main.css";
|
|
2
|
+
import {useSlotProps as $3YaaK$useSlotProps, classNames as $3YaaK$classNames} from "@react-spectrum/utils";
|
|
3
|
+
import {ClearButton as $3YaaK$ClearButton} from "@react-spectrum/button";
|
|
4
|
+
import $3YaaK$spectrumiconsuiMagnifier from "@spectrum-icons/ui/Magnifier";
|
|
5
|
+
import $3YaaK$react, {useRef as $3YaaK$useRef, forwardRef as $3YaaK$forwardRef} from "react";
|
|
6
|
+
import {TextFieldBase as $3YaaK$TextFieldBase} from "@react-spectrum/textfield";
|
|
7
|
+
import {useProviderProps as $3YaaK$useProviderProps} from "@react-spectrum/provider";
|
|
8
|
+
import {useSearchField as $3YaaK$useSearchField} from "@react-aria/searchfield";
|
|
9
|
+
import {useSearchFieldState as $3YaaK$useSearchFieldState} from "@react-stately/searchfield";
|
|
12
10
|
|
|
13
11
|
function $parcel$interopDefault(a) {
|
|
14
12
|
return a && a.__esModule ? a.default : a;
|
|
15
13
|
}
|
|
14
|
+
function $parcel$export(e, n, v, s) {
|
|
15
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
16
|
+
}
|
|
17
|
+
var $5876695ae3d8c732$exports = {};
|
|
18
|
+
|
|
19
|
+
$parcel$export($5876695ae3d8c732$exports, "SearchField", () => $5876695ae3d8c732$export$b94867ecbd698f21);
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var $f3224a2f471fe717$exports = {};
|
|
25
|
+
|
|
26
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Search", () => $f3224a2f471fe717$export$713911d754e1e4ae, (v) => $f3224a2f471fe717$export$713911d754e1e4ae = v);
|
|
27
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-ClearButton", () => $f3224a2f471fe717$export$b752ce409e5660c, (v) => $f3224a2f471fe717$export$b752ce409e5660c = v);
|
|
28
|
+
$parcel$export($f3224a2f471fe717$exports, "is-quiet", () => $f3224a2f471fe717$export$6d5c5433f0da4241, (v) => $f3224a2f471fe717$export$6d5c5433f0da4241 = v);
|
|
29
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Search-input", () => $f3224a2f471fe717$export$50e02603f2d97ae1, (v) => $f3224a2f471fe717$export$50e02603f2d97ae1 = v);
|
|
30
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Search--invalid", () => $f3224a2f471fe717$export$77a6151a0b46a6a3, (v) => $f3224a2f471fe717$export$77a6151a0b46a6a3 = v);
|
|
31
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Search--valid", () => $f3224a2f471fe717$export$aa81e3ab40f37567, (v) => $f3224a2f471fe717$export$aa81e3ab40f37567 = v);
|
|
32
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Search--loadable", () => $f3224a2f471fe717$export$9c74d64afae3b2d4, (v) => $f3224a2f471fe717$export$9c74d64afae3b2d4 = v);
|
|
33
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Search-circleLoader", () => $f3224a2f471fe717$export$70ae4353602451dc, (v) => $f3224a2f471fe717$export$70ae4353602451dc = v);
|
|
34
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Search-validationIcon", () => $f3224a2f471fe717$export$938f0981825eae6e, (v) => $f3224a2f471fe717$export$938f0981825eae6e = v);
|
|
35
|
+
$parcel$export($f3224a2f471fe717$exports, "spectrum-Textfield", () => $f3224a2f471fe717$export$2c8a10299d8b3418, (v) => $f3224a2f471fe717$export$2c8a10299d8b3418 = v);
|
|
36
|
+
var $f3224a2f471fe717$export$713911d754e1e4ae;
|
|
37
|
+
var $f3224a2f471fe717$export$b752ce409e5660c;
|
|
38
|
+
var $f3224a2f471fe717$export$6d5c5433f0da4241;
|
|
39
|
+
var $f3224a2f471fe717$export$50e02603f2d97ae1;
|
|
40
|
+
var $f3224a2f471fe717$export$77a6151a0b46a6a3;
|
|
41
|
+
var $f3224a2f471fe717$export$aa81e3ab40f37567;
|
|
42
|
+
var $f3224a2f471fe717$export$9c74d64afae3b2d4;
|
|
43
|
+
var $f3224a2f471fe717$export$70ae4353602451dc;
|
|
44
|
+
var $f3224a2f471fe717$export$938f0981825eae6e;
|
|
45
|
+
var $f3224a2f471fe717$export$2c8a10299d8b3418;
|
|
46
|
+
$f3224a2f471fe717$export$713911d754e1e4ae = "_spectrum-Search_d3c0f3";
|
|
47
|
+
$f3224a2f471fe717$export$b752ce409e5660c = "_spectrum-ClearButton_d3c0f3";
|
|
48
|
+
$f3224a2f471fe717$export$6d5c5433f0da4241 = "_is-quiet_d3c0f3";
|
|
49
|
+
$f3224a2f471fe717$export$50e02603f2d97ae1 = "_spectrum-Search-input_d3c0f3";
|
|
50
|
+
$f3224a2f471fe717$export$77a6151a0b46a6a3 = "_spectrum-Search--invalid_d3c0f3";
|
|
51
|
+
$f3224a2f471fe717$export$aa81e3ab40f37567 = "_spectrum-Search--valid_d3c0f3";
|
|
52
|
+
$f3224a2f471fe717$export$9c74d64afae3b2d4 = "_spectrum-Search--loadable_d3c0f3";
|
|
53
|
+
$f3224a2f471fe717$export$70ae4353602451dc = "_spectrum-Search-circleLoader_d3c0f3";
|
|
54
|
+
$f3224a2f471fe717$export$938f0981825eae6e = "_spectrum-Search-validationIcon_d3c0f3";
|
|
55
|
+
$f3224a2f471fe717$export$2c8a10299d8b3418 = "_spectrum-Textfield_d3c0f3";
|
|
16
56
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
preventFocus: true,
|
|
58
|
-
UNSAFE_className: classNames($f7ba17202ccc7135cfe7128957b$$interop$default, 'spectrum-ClearButton'),
|
|
59
|
-
isDisabled: isDisabled
|
|
60
|
-
}));
|
|
61
|
-
|
|
62
|
-
return /*#__PURE__*/_react.createElement(TextFieldBase, _babelRuntimeHelpersEsmExtends({}, otherProps, {
|
|
63
|
-
labelProps: labelProps,
|
|
64
|
-
inputProps: inputProps,
|
|
65
|
-
descriptionProps: descriptionProps,
|
|
66
|
-
errorMessageProps: errorMessageProps,
|
|
67
|
-
UNSAFE_className: classNames($f7ba17202ccc7135cfe7128957b$$interop$default, 'spectrum-Search', 'spectrum-Textfield', {
|
|
68
|
-
'is-disabled': isDisabled,
|
|
69
|
-
'is-quiet': props.isQuiet,
|
|
70
|
-
'spectrum-Search--invalid': props.validationState === 'invalid',
|
|
71
|
-
'spectrum-Search--valid': props.validationState === 'valid'
|
|
72
|
-
}, UNSAFE_className),
|
|
73
|
-
inputClassName: classNames($f7ba17202ccc7135cfe7128957b$$interop$default, 'spectrum-Search-input'),
|
|
74
|
-
ref: ref,
|
|
75
|
-
inputRef: inputRef,
|
|
76
|
-
isDisabled: isDisabled,
|
|
77
|
-
icon: icon,
|
|
78
|
-
wrapperChildren: state.value !== '' && !props.isReadOnly && clearButton
|
|
79
|
-
}));
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
function $5876695ae3d8c732$var$SearchField(props, ref) {
|
|
63
|
+
props = $3YaaK$useSlotProps(props, 'searchfield');
|
|
64
|
+
props = $3YaaK$useProviderProps(props);
|
|
65
|
+
let defaultIcon = /*#__PURE__*/ $3YaaK$react.createElement($3YaaK$spectrumiconsuiMagnifier, {
|
|
66
|
+
"data-testid": "searchicon"
|
|
67
|
+
});
|
|
68
|
+
let { icon: icon = defaultIcon , isDisabled: isDisabled , UNSAFE_className: UNSAFE_className , ...otherProps } = props;
|
|
69
|
+
let state = $3YaaK$useSearchFieldState(props);
|
|
70
|
+
let inputRef = $3YaaK$useRef();
|
|
71
|
+
let { labelProps: labelProps , inputProps: inputProps , clearButtonProps: clearButtonProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $3YaaK$useSearchField(props, state, inputRef);
|
|
72
|
+
let clearButton = /*#__PURE__*/ $3YaaK$react.createElement($3YaaK$ClearButton, {
|
|
73
|
+
...clearButtonProps,
|
|
74
|
+
preventFocus: true,
|
|
75
|
+
UNSAFE_className: $3YaaK$classNames((/*@__PURE__*/$parcel$interopDefault($f3224a2f471fe717$exports)), 'spectrum-ClearButton'),
|
|
76
|
+
isDisabled: isDisabled
|
|
77
|
+
});
|
|
78
|
+
return(/*#__PURE__*/ $3YaaK$react.createElement($3YaaK$TextFieldBase, {
|
|
79
|
+
...otherProps,
|
|
80
|
+
labelProps: labelProps,
|
|
81
|
+
inputProps: inputProps,
|
|
82
|
+
descriptionProps: descriptionProps,
|
|
83
|
+
errorMessageProps: errorMessageProps,
|
|
84
|
+
UNSAFE_className: $3YaaK$classNames((/*@__PURE__*/$parcel$interopDefault($f3224a2f471fe717$exports)), 'spectrum-Search', 'spectrum-Textfield', {
|
|
85
|
+
'is-disabled': isDisabled,
|
|
86
|
+
'is-quiet': props.isQuiet,
|
|
87
|
+
'spectrum-Search--invalid': props.validationState === 'invalid',
|
|
88
|
+
'spectrum-Search--valid': props.validationState === 'valid'
|
|
89
|
+
}, UNSAFE_className),
|
|
90
|
+
inputClassName: $3YaaK$classNames((/*@__PURE__*/$parcel$interopDefault($f3224a2f471fe717$exports)), 'spectrum-Search-input'),
|
|
91
|
+
ref: ref,
|
|
92
|
+
inputRef: inputRef,
|
|
93
|
+
isDisabled: isDisabled,
|
|
94
|
+
icon: icon,
|
|
95
|
+
wrapperChildren: state.value !== '' && !props.isReadOnly && clearButton
|
|
96
|
+
}));
|
|
80
97
|
}
|
|
81
98
|
/**
|
|
82
99
|
* A SearchField is a text field designed for searches.
|
|
83
|
-
*/
|
|
100
|
+
*/ let $5876695ae3d8c732$export$b94867ecbd698f21 = /*#__PURE__*/ $3YaaK$forwardRef($5876695ae3d8c732$var$SearchField);
|
|
101
|
+
|
|
102
|
+
|
|
84
103
|
|
|
85
104
|
|
|
86
|
-
export
|
|
105
|
+
export {$5876695ae3d8c732$export$b94867ecbd698f21 as SearchField};
|
|
87
106
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAiC;AACjC,GAAsC;AACtC,GAA0B;AAC1B,GAAuC;AACvC,GAA0C;AAC1C,GAAwC;AACxC,GAA2C;AAC3C,GAA8C;AAC9C,GAAgD;AAChD,GAAoC;AATpC,yCAAiC,GAAG,CAAyB;AAC7D,wCAAsC,GAAG,CAA8B;AACvE,yCAA0B,GAAG,CAAkB;AAC/C,yCAAuC,GAAG,CAA+B;AACzE,yCAA0C,GAAG,CAAkC;AAC/E,yCAAwC,GAAG,CAAgC;AAC3E,yCAA2C,GAAG,CAAmC;AACjF,yCAA8C,GAAG,CAAsC;AACvF,yCAAgD,GAAG,CAAwC;AAC3F,yCAAoC,GAAG,CAA4B;;;;;;;SDe1D,iCAAW,CAAC,KAA+B,EAAE,GAA4B,EAAE,CAAC;IACnF,KAAK,GAAG,mBAAY,CAAC,KAAK,EAAE,CAAa;IACzC,KAAK,GAAG,uBAAgB,CAAC,KAAK;IAC9B,GAAG,CAAC,WAAW,4CACZ,+BAAS;QAAC,CAAW,cAAC,CAAY;;IAGrC,GAAG,CAAC,CAAC,OACH,IAAI,GAAG,WAAW,eAClB,UAAU,qBACV,gBAAgB,MACb,UAAU,CACf,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,KAAK,GAAG,0BAAmB,CAAC,KAAK;IACrC,GAAG,CAAC,QAAQ,GAAG,aAAM;IACrB,GAAG,CAAC,CAAC,aAAA,UAAU,eAAE,UAAU,qBAAE,gBAAgB,qBAAE,gBAAgB,sBAAE,iBAAiB,EAAA,CAAC,GAAG,qBAAc,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ;IAE3H,GAAG,CAAC,WAAW,4CACZ,kBAAW;WACN,gBAAgB;QACpB,YAAY,EAAZ,IAAY;QACZ,gBAAgB,EACd,iBAAU,CACR,gEAAM,EACN,CAAsB;QAG1B,UAAU,EAAE,UAAU;;IAG1B,MAAM,0CACH,oBAAa;WACR,UAAU;QACd,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;QACtB,gBAAgB,EAAE,gBAAgB;QAClC,iBAAiB,EAAE,iBAAiB;QACpC,gBAAgB,EACd,iBAAU,CACR,gEAAM,EACN,CAAiB,kBACjB,CAAoB,qBACpB,CAAC;YACC,CAAa,cAAE,UAAU;YACzB,CAAU,WAAE,KAAK,CAAC,OAAO;YACzB,CAA0B,2BAAE,KAAK,CAAC,eAAe,KAAK,CAAS;YAC/D,CAAwB,yBAAE,KAAK,CAAC,eAAe,KAAK,CAAO;QAC7D,CAAC,EACD,gBAAgB;QAGpB,cAAc,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAuB;QAC1D,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,IAAI;QACV,eAAe,EAAG,KAAK,CAAC,KAAK,KAAK,CAAE,MAAK,KAAK,CAAC,UAAU,IAAK,WAAW;;AAE/E,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAY,iBAAG,iBAAU,CAAC,iCAAW","sources":["packages/@react-spectrum/searchfield/src/index.ts","packages/@react-spectrum/searchfield/src/SearchField.tsx","packages/@adobe/spectrum-css-temp/components/search/vars.css"],"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 * from './SearchField';\n","/*\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, RefObject, 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 {useProviderProps} from '@react-spectrum/provider';\nimport {useSearchField} from '@react-aria/searchfield';\nimport {useSearchFieldState} from '@react-stately/searchfield';\n\nfunction SearchField(props: SpectrumSearchFieldProps, ref: RefObject<TextFieldRef>) {\n props = useSlotProps(props, 'searchfield');\n props = useProviderProps(props);\n let defaultIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = defaultIcon,\n isDisabled,\n UNSAFE_className,\n ...otherProps\n } = props;\n\n let state = useSearchFieldState(props);\n let inputRef = useRef<HTMLInputElement>();\n let {labelProps, inputProps, clearButtonProps, descriptionProps, errorMessageProps} = 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 return (\n <TextFieldBase\n {...otherProps}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\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': props.validationState === 'invalid',\n 'spectrum-Search--valid': props.validationState === 'valid'\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} />\n );\n}\n\n/**\n * A SearchField is a text field designed for searches.\n */\nlet _SearchField = forwardRef(SearchField);\nexport {_SearchField as SearchField};\n","/*\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@import './index.css';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;AAqFA;;GAEG;AACH,OAAA,IAAI,0GAAsC,CAAC","sources":["packages/@react-spectrum/searchfield/src/packages/@react-spectrum/searchfield/src/SearchField.tsx","packages/@react-spectrum/searchfield/src/packages/@react-spectrum/searchfield/src/index.ts","packages/@react-spectrum/searchfield/src/index.ts"],"sourcesContent":[null,null,"/*\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 * from './SearchField';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/searchfield",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1356+87960ad25",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.6.2",
|
|
35
|
-
"@react-aria/searchfield": "3.0.0-nightly.
|
|
36
|
-
"@react-spectrum/button": "3.0.0-nightly.
|
|
37
|
-
"@react-spectrum/textfield": "3.0.0-nightly.
|
|
38
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
|
39
|
-
"@react-stately/searchfield": "3.0.0-nightly.
|
|
40
|
-
"@react-types/searchfield": "3.0.0-nightly.
|
|
41
|
-
"@react-types/textfield": "3.0.0-nightly.
|
|
42
|
-
"@spectrum-icons/ui": "3.0.0-nightly.
|
|
35
|
+
"@react-aria/searchfield": "3.0.0-nightly.1356+87960ad25",
|
|
36
|
+
"@react-spectrum/button": "3.0.0-nightly.1356+87960ad25",
|
|
37
|
+
"@react-spectrum/textfield": "3.0.0-nightly.1356+87960ad25",
|
|
38
|
+
"@react-spectrum/utils": "3.0.0-nightly.1356+87960ad25",
|
|
39
|
+
"@react-stately/searchfield": "3.0.0-nightly.1356+87960ad25",
|
|
40
|
+
"@react-types/searchfield": "3.0.0-nightly.1356+87960ad25",
|
|
41
|
+
"@react-types/textfield": "3.0.0-nightly.1356+87960ad25",
|
|
42
|
+
"@spectrum-icons/ui": "3.0.0-nightly.1356+87960ad25"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
|
46
|
-
"@react-spectrum/test-utils": "3.0.0-nightly.
|
|
45
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.1356+87960ad25",
|
|
46
|
+
"@react-spectrum/test-utils": "3.0.0-nightly.1356+87960ad25"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@react-spectrum/provider": "^3.0.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "87960ad25c26bc4cd6af506bb5e7e0f06621556c"
|
|
56
56
|
}
|
package/dist/main.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAsBA,wBACE,oBAAqB,CACrB,iBAoCF,CAlCE,+DAEE,OAEF,CAJA,+DAEE,MAEF,CAJA,qDACE,iBAAkB,CAElB,KACF,CAEA,gFACE,sDAEF,CAHA,gFACE,uDAEF,CAHA,gFAEE,uDACF,CAHA,gFAEE,sDACF,CAEA,+FACE,iGACF,CAFA,+FACE,gGACF,CAEA,6FACE,mJACF,CAFA,6FACE,kJACF,CAGA,gGACE,OACF,CAFA,gGACE,MACF,CAGA,wGACE,mJACF,CAFA,wGACE,kJACF,CAGA,0GACE,mJAEF,CAHA,0GACE,kJAEF,CAHA,0GAEE,eACF,CAHA,0GAEE,cACF,CAGF,wCAaE,uDAmBF,CAhCA,wCAaE,sDAmBF,CAhCA,8BACE,aAAc,CAId,uBAAwB,CAGxB,mBAAoB,CAEpB,aAsBF,CAhBE,qHAEE,uBACF,CAEA,mGACE,iMACF,CAFA,mGACE,gMACF,CAEA,iGACE,mMACF,CAFA,iGACE,kMACF,CAEA,oGACE,mMACF,CAFA,oGACE,kMACF","sources":["./node_modules/@adobe/spectrum-css-temp/components/search/index.css"],"sourcesContent":["/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n@import '../commons/index.css';\n\n/* override DNA variables to use ones that change in large scale instead of staying static */\n:root {\n --spectrum-search-padding-left: var(--spectrum-global-dimension-size-450);\n --spectrum-search-padding-right: var(--spectrum-global-dimension-size-350);\n --spectrum-search-quiet-padding-left: var(--spectrum-global-dimension-size-300);\n --spectrum-search-quiet-padding-right: var(--spectrum-global-dimension-size-350);\n}\n\n.spectrum-Search {\n display: inline-block;\n position: relative;\n\n .spectrum-ClearButton {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n }\n\n &.is-quiet .spectrum-Search-input {\n padding-inline-start: var(--spectrum-search-quiet-padding-left);\n padding-inline-end: var(--spectrum-search-quiet-padding-right);\n }\n\n &.spectrum-Search--invalid .spectrum-ClearButton {\n inset-inline-end: calc(var(--spectrum-icon-alert-medium-width) + var(--spectrum-textfield-padding-x));\n }\n\n &.spectrum-Search--valid .spectrum-ClearButton {\n inset-inline-end: calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x) / 2 + var(--spectrum-global-dimension-size-150));\n }\n\n /* Flip clear button and circle loader position so circle loader is to the left of the clear button */\n &.spectrum-Search--loadable .spectrum-ClearButton {\n inset-inline-end: 0\n }\n\n /* Flip clear button and circle loader position so circle loader is to the left of the clear button */\n &.spectrum-Search--loadable .spectrum-Search-circleLoader {\n inset-inline-end: calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x) / 2 + var(--spectrum-global-dimension-size-150));\n }\n\n /* Move validation icons so that they sit to the left of the clear button (for async loading combobox tray, same position as loading indicator) */\n &.spectrum-Search--loadable .spectrum-Search-validationIcon {\n inset-inline-end: calc(var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-padding-x) / 2 + var(--spectrum-global-dimension-size-150));\n padding-inline-end: 0;\n }\n}\n\n.spectrum-Search-input {\n display: block;\n\n /* Correct the odd appearance of input[type=\"search\"] in Chrome and Safari.*/\n /* This gets overridden by .spectrum-Textfield */\n -webkit-appearance: none;\n\n /* Correct the outline for input[type=\"search\"] style in Safari. */\n outline-offset: -2px;\n\n text-indent: 0;\n\n /* Don't let long strings overlap the close icon */\n padding-inline-end: var(--spectrum-search-padding-right);\n\n /* Remove the inner padding and cancel buttons for input[type=\"search\"] in Chrome and Safari on macOS. */\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n .spectrum-Textfield.spectrum-Search--invalid & {\n padding-inline-end: calc(var(--spectrum-search-padding-right) + var(--spectrum-textfield-padding-x) + var(--spectrum-icon-alert-medium-width) + var(--spectrum-textfield-icon-margin-left));\n }\n\n .spectrum-Textfield.spectrum-Search--valid & {\n padding-inline-end: calc(var(--spectrum-search-padding-right) + var(--spectrum-textfield-padding-x) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-icon-margin-left));\n }\n\n .spectrum-Textfield.spectrum-Search--loadable & {\n padding-inline-end: calc(var(--spectrum-search-padding-right) + var(--spectrum-textfield-padding-x) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-icon-margin-left));\n }\n}\n\n"],"names":[],"version":3,"file":"main.css.map"}
|