@star-insure/sdk 3.2.0 → 3.2.2
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/sdk.cjs.development.js +26 -3
- 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 +26 -3
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/api/auth.d.ts +1 -0
- package/dist/types/models/auth/User.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/filter/PageHeader.tsx +9 -2
- package/src/components/filter/SearchBar.tsx +18 -1
- package/src/types/api/auth.ts +1 -0
- package/src/types/models/auth/User.ts +1 -0
package/dist/types/api/auth.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@star-insure/sdk",
|
|
3
3
|
"description": "The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.",
|
|
4
4
|
"author": "alexclark_nz",
|
|
5
|
-
"version": "3.2.
|
|
5
|
+
"version": "3.2.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -144,11 +144,18 @@ export default function PageHeader({
|
|
|
144
144
|
)}
|
|
145
145
|
|
|
146
146
|
<div className={cn('w-full grid grid-cols-[auto_1fr_auto] h-[60px] rounded bg-gray-100 p-3 gap-4', innerClassName)}>
|
|
147
|
-
<
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
disabled={!search}
|
|
150
|
+
onClick={() => setSearchActive(true)}
|
|
151
|
+
className={cn('mr-auto flex items-center gap-4 transition-colors pr-6 pl-1 disabled:opacity-100', {
|
|
152
|
+
'hover:text-teal': search && !isSearchActive,
|
|
153
|
+
}
|
|
154
|
+
)}>
|
|
148
155
|
{search && <SearchBar search={search} active={isSearchActive} onActive={setSearchActive} placeholder={`Search ${title}...`} />}
|
|
149
156
|
|
|
150
157
|
{!isSearchActive && <h1 className="text-base font-bold">{title}</h1>}
|
|
151
|
-
</
|
|
158
|
+
</button>
|
|
152
159
|
|
|
153
160
|
<div className="flex items-center ml-auto gap-2 h-full min-w-0 max-w-full">
|
|
154
161
|
{filterOptions.length > 0 && (
|
|
@@ -24,6 +24,23 @@ export default function SearchBar({ search, active, onActive, placeholder }: { s
|
|
|
24
24
|
onActive(true);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
const listener = (e: KeyboardEvent) => {
|
|
29
|
+
if (e.key === '/') {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
onActive(true);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (e.key === 'Escape') {
|
|
35
|
+
onActive(false);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
window.addEventListener('keydown', listener);
|
|
40
|
+
|
|
41
|
+
return () => {
|
|
42
|
+
window.removeEventListener('keydown', listener);
|
|
43
|
+
};
|
|
27
44
|
}, []);
|
|
28
45
|
|
|
29
46
|
/**
|
|
@@ -62,7 +79,7 @@ export default function SearchBar({ search, active, onActive, placeholder }: { s
|
|
|
62
79
|
title="Open Search Bar"
|
|
63
80
|
type="button"
|
|
64
81
|
onClick={() => onActive(true)}
|
|
65
|
-
className="flex items-center justify-center rounded-full hover:text-teal p-1
|
|
82
|
+
className="flex items-center justify-center rounded-full hover:text-teal p-1 hover:bg-gray-100"
|
|
66
83
|
>
|
|
67
84
|
<HiMagnifyingGlass className="h-5 w-5 stroke-[1.25]" />
|
|
68
85
|
</button>
|
package/src/types/api/auth.ts
CHANGED