@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.
@@ -7,6 +7,7 @@ declare type AuthUser = {
7
7
  umbrella_filter?: string;
8
8
  oracle_user_id?: string;
9
9
  groups: AuthGroup[];
10
+ phone_extension?: number;
10
11
  };
11
12
  declare type AuthGroup = {
12
13
  id: number;
@@ -11,4 +11,5 @@ export interface User {
11
11
  umbrella_filter?: string;
12
12
  groups?: Group[];
13
13
  permissions?: string[];
14
+ phone_extension?: number;
14
15
  }
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.0",
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
- <div className="mr-auto flex items-center gap-4 ml-1">
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
- </div>
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 transition-colors hover:bg-gray-100"
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>
@@ -14,6 +14,7 @@ type AuthUser = {
14
14
  umbrella_filter?: string;
15
15
  oracle_user_id?: string;
16
16
  groups: AuthGroup[];
17
+ phone_extension?: number;
17
18
  };
18
19
 
19
20
  type AuthGroup = {
@@ -12,4 +12,5 @@ export interface User {
12
12
  umbrella_filter?: string;
13
13
  groups?: Group[];
14
14
  permissions?: string[];
15
+ phone_extension?: number;
15
16
  }