@star-insure/sdk 3.2.7 → 3.2.9
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/components/filter/PageHeader.d.ts +2 -1
- package/dist/components/filter/SearchBar.d.ts +5 -2
- package/dist/sdk.cjs.development.js +12 -7
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +12 -7
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/filter/Action.tsx +1 -1
- package/src/components/filter/PageHeader.tsx +7 -5
- package/src/components/filter/SearchBar.tsx +10 -4
package/dist/sdk.esm.js
CHANGED
|
@@ -2284,7 +2284,9 @@ function SearchBar(_ref) {
|
|
|
2284
2284
|
var search = _ref.search,
|
|
2285
2285
|
active = _ref.active,
|
|
2286
2286
|
onActive = _ref.onActive,
|
|
2287
|
-
placeholder = _ref.placeholder
|
|
2287
|
+
placeholder = _ref.placeholder,
|
|
2288
|
+
_ref$focusSearchShort = _ref.focusSearchShortcut,
|
|
2289
|
+
focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort;
|
|
2288
2290
|
|
|
2289
2291
|
var _React$useState = React__default.useState(''),
|
|
2290
2292
|
query = _React$useState[0],
|
|
@@ -2309,7 +2311,7 @@ function SearchBar(_ref) {
|
|
|
2309
2311
|
}
|
|
2310
2312
|
|
|
2311
2313
|
var listener = function listener(e) {
|
|
2312
|
-
if (e.key === '/') {
|
|
2314
|
+
if (focusSearchShortcut && e.key === '/') {
|
|
2313
2315
|
e.preventDefault();
|
|
2314
2316
|
onActive(true);
|
|
2315
2317
|
}
|
|
@@ -2323,7 +2325,7 @@ function SearchBar(_ref) {
|
|
|
2323
2325
|
return function () {
|
|
2324
2326
|
window.removeEventListener('keydown', listener);
|
|
2325
2327
|
};
|
|
2326
|
-
}, []);
|
|
2328
|
+
}, [focusSearchShortcut]);
|
|
2327
2329
|
/**
|
|
2328
2330
|
* Minimise the search bar on click outside if there's no search query
|
|
2329
2331
|
*/
|
|
@@ -2407,7 +2409,7 @@ function Action(_ref) {
|
|
|
2407
2409
|
_ref$onClick = _ref.onClick,
|
|
2408
2410
|
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick;
|
|
2409
2411
|
|
|
2410
|
-
var className = 'bg-white rounded-full font-bold px-
|
|
2412
|
+
var className = 'bg-white rounded-full font-bold px-4 py-1.5 text-sm whitespace-nowrap hover:bg-gray-100 hover:border-gray-300 transition-colors border border-gray-200';
|
|
2411
2413
|
|
|
2412
2414
|
if (as === 'Link' && href) {
|
|
2413
2415
|
return React__default.createElement(Link, {
|
|
@@ -2802,7 +2804,9 @@ function PageHeader(_ref) {
|
|
|
2802
2804
|
_ref$actions = _ref.actions,
|
|
2803
2805
|
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
2804
2806
|
_ref$filterOptions = _ref.filterOptions,
|
|
2805
|
-
filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions
|
|
2807
|
+
filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions,
|
|
2808
|
+
_ref$focusSearchShort = _ref.focusSearchShortcut,
|
|
2809
|
+
focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort;
|
|
2806
2810
|
|
|
2807
2811
|
var _React$useState = React__default.useState(false),
|
|
2808
2812
|
isSearchActive = _React$useState[0],
|
|
@@ -2947,9 +2951,10 @@ function PageHeader(_ref) {
|
|
|
2947
2951
|
search: search,
|
|
2948
2952
|
active: isSearchActive,
|
|
2949
2953
|
onActive: setSearchActive,
|
|
2950
|
-
placeholder: "Search " + title + "..."
|
|
2954
|
+
placeholder: "Search " + title + "...",
|
|
2955
|
+
focusSearchShortcut: focusSearchShortcut
|
|
2951
2956
|
}), !isSearchActive && React__default.createElement("h1", {
|
|
2952
|
-
className: "text-base font-
|
|
2957
|
+
className: "text-base font-black"
|
|
2953
2958
|
}, title)), React__default.createElement("div", {
|
|
2954
2959
|
className: "flex items-center ml-auto gap-2 h-full min-w-0 max-w-full"
|
|
2955
2960
|
}, filterOptions.length > 0 && React__default.createElement(React__default.Fragment, null, React__default.createElement("button", {
|