@moser-inc/moser-labs-react 6.5.0 → 6.6.1

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.
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@moser-inc/moser-labs-react",
3
- "version": "6.5.0",
3
+ "version": "6.6.1",
4
4
  "description": "React components for the Moser Labs suite of applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,7 +51,7 @@ declare const _default: {
51
51
  "dayjs": "^1.11.13",
52
52
  "keycloak-js": "23.0.3",
53
53
  "mixpanel-browser": "^2.66.0",
54
- "motion": "^12.23.0",
54
+ "motion": "^12.23.6",
55
55
  "react-idle-timer": "^5.7.2"
56
56
  },
57
57
  "devDependencies": {
@@ -59,21 +59,21 @@ declare const _default: {
59
59
  "@moser-inc/eslint-config-react": "^4.1.0",
60
60
  "@moser-inc/unocss-preset-moser-labs": "^3.0.1",
61
61
  "@tsconfig/node22": "^22.0.2",
62
- "@tsconfig/vite-react": "^6.3.6",
62
+ "@tsconfig/vite-react": "^7.0.0",
63
63
  "@unocss/eslint-config": "^66.3.3",
64
64
  "@vitejs/plugin-basic-ssl": "^2.1.0",
65
- "@vitejs/plugin-react-swc": "^3.10.2",
66
- "eslint": "^9.30.1",
65
+ "@vitejs/plugin-react-swc": "^3.11.0",
66
+ "eslint": "^9.31.0",
67
67
  "prettier": "^3.6.2",
68
68
  "react-hook-form": "^7.60.0",
69
- "react-router": "^7.6.3",
70
- "react-router-dom": "^7.6.3",
69
+ "react-router": "^7.7.0",
70
+ "react-router-dom": "^7.7.0",
71
71
  "sass": "^1.89.2",
72
72
  "typescript": "^5.8.3",
73
73
  "unocss": "^66.3.3",
74
- "vite": "^7.0.3",
74
+ "vite": "^7.0.5",
75
75
  "vite-plugin-dts": "^4.5.4",
76
- "zod": "^3.25.76"
76
+ "zod": "^4.0.5"
77
77
  }
78
78
  }
79
79
  ;
@@ -2,212 +2,180 @@ import { UseFormProps } from 'react-hook-form';
2
2
  import { z } from 'zod';
3
3
  export declare const SampleFormSchema: z.ZodObject<{
4
4
  checkbox: z.ZodBoolean;
5
- date: z.ZodEffects<z.ZodNullable<z.ZodDate>, Date | null, Date | null>;
5
+ date: z.ZodPipe<z.ZodNullable<z.ZodDate>, z.ZodTransform<Date | null, Date | null>>;
6
6
  select: z.ZodString;
7
7
  text: z.ZodString;
8
8
  textCurrency: z.ZodString;
9
9
  textSearch: z.ZodString;
10
10
  textArea: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- select: string;
13
- text: string;
14
- checkbox: boolean;
15
- date: Date | null;
16
- textCurrency: string;
17
- textSearch: string;
18
- textArea: string;
19
- }, {
20
- select: string;
21
- text: string;
22
- checkbox: boolean;
23
- date: Date | null;
24
- textCurrency: string;
25
- textSearch: string;
26
- textArea: string;
27
- }>;
11
+ }, z.core.$strip>;
28
12
  export type SampleFormValues = z.infer<typeof SampleFormSchema>;
29
13
  export declare const useSampleForm: ({ resolver, defaultValues, ...rest }?: UseFormProps<SampleFormValues>) => {
30
14
  readonly schema: z.ZodObject<{
31
15
  checkbox: z.ZodBoolean;
32
- date: z.ZodEffects<z.ZodNullable<z.ZodDate>, Date | null, Date | null>;
16
+ date: z.ZodPipe<z.ZodNullable<z.ZodDate>, z.ZodTransform<Date | null, Date | null>>;
33
17
  select: z.ZodString;
34
18
  text: z.ZodString;
35
19
  textCurrency: z.ZodString;
36
20
  textSearch: z.ZodString;
37
21
  textArea: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- select: string;
40
- text: string;
22
+ }, z.core.$strip>;
23
+ readonly watch: import('react-hook-form').UseFormWatch<{
41
24
  checkbox: boolean;
42
25
  date: Date | null;
43
- textCurrency: string;
44
- textSearch: string;
45
- textArea: string;
46
- }, {
47
26
  select: string;
48
27
  text: string;
49
- checkbox: boolean;
50
- date: Date | null;
51
28
  textCurrency: string;
52
29
  textSearch: string;
53
30
  textArea: string;
54
31
  }>;
55
- readonly watch: import('react-hook-form').UseFormWatch<{
56
- select: string;
57
- text: string;
32
+ readonly getValues: import('react-hook-form').UseFormGetValues<{
58
33
  checkbox: boolean;
59
34
  date: Date | null;
60
- textCurrency: string;
61
- textSearch: string;
62
- textArea: string;
63
- }>;
64
- readonly getValues: import('react-hook-form').UseFormGetValues<{
65
35
  select: string;
66
36
  text: string;
67
- checkbox: boolean;
68
- date: Date | null;
69
37
  textCurrency: string;
70
38
  textSearch: string;
71
39
  textArea: string;
72
40
  }>;
73
41
  readonly getFieldState: import('react-hook-form').UseFormGetFieldState<{
74
- select: string;
75
- text: string;
76
42
  checkbox: boolean;
77
43
  date: Date | null;
44
+ select: string;
45
+ text: string;
78
46
  textCurrency: string;
79
47
  textSearch: string;
80
48
  textArea: string;
81
49
  }>;
82
50
  readonly setError: import('react-hook-form').UseFormSetError<{
83
- select: string;
84
- text: string;
85
51
  checkbox: boolean;
86
52
  date: Date | null;
53
+ select: string;
54
+ text: string;
87
55
  textCurrency: string;
88
56
  textSearch: string;
89
57
  textArea: string;
90
58
  }>;
91
59
  readonly clearErrors: import('react-hook-form').UseFormClearErrors<{
92
- select: string;
93
- text: string;
94
60
  checkbox: boolean;
95
61
  date: Date | null;
62
+ select: string;
63
+ text: string;
96
64
  textCurrency: string;
97
65
  textSearch: string;
98
66
  textArea: string;
99
67
  }>;
100
68
  readonly setValue: import('react-hook-form').UseFormSetValue<{
101
- select: string;
102
- text: string;
103
69
  checkbox: boolean;
104
70
  date: Date | null;
71
+ select: string;
72
+ text: string;
105
73
  textCurrency: string;
106
74
  textSearch: string;
107
75
  textArea: string;
108
76
  }>;
109
77
  readonly trigger: import('react-hook-form').UseFormTrigger<{
110
- select: string;
111
- text: string;
112
78
  checkbox: boolean;
113
79
  date: Date | null;
80
+ select: string;
81
+ text: string;
114
82
  textCurrency: string;
115
83
  textSearch: string;
116
84
  textArea: string;
117
85
  }>;
118
86
  readonly formState: import('react-hook-form').FormState<{
119
- select: string;
120
- text: string;
121
87
  checkbox: boolean;
122
88
  date: Date | null;
89
+ select: string;
90
+ text: string;
123
91
  textCurrency: string;
124
92
  textSearch: string;
125
93
  textArea: string;
126
94
  }>;
127
95
  readonly resetField: import('react-hook-form').UseFormResetField<{
128
- select: string;
129
- text: string;
130
96
  checkbox: boolean;
131
97
  date: Date | null;
98
+ select: string;
99
+ text: string;
132
100
  textCurrency: string;
133
101
  textSearch: string;
134
102
  textArea: string;
135
103
  }>;
136
104
  readonly reset: import('react-hook-form').UseFormReset<{
137
- select: string;
138
- text: string;
139
105
  checkbox: boolean;
140
106
  date: Date | null;
107
+ select: string;
108
+ text: string;
141
109
  textCurrency: string;
142
110
  textSearch: string;
143
111
  textArea: string;
144
112
  }>;
145
113
  readonly handleSubmit: import('react-hook-form').UseFormHandleSubmit<{
146
- select: string;
147
- text: string;
148
114
  checkbox: boolean;
149
115
  date: Date | null;
116
+ select: string;
117
+ text: string;
150
118
  textCurrency: string;
151
119
  textSearch: string;
152
120
  textArea: string;
153
121
  }, {
154
- select: string;
155
- text: string;
156
122
  checkbox: boolean;
157
123
  date: Date | null;
124
+ select: string;
125
+ text: string;
158
126
  textCurrency: string;
159
127
  textSearch: string;
160
128
  textArea: string;
161
129
  }>;
162
130
  readonly unregister: import('react-hook-form').UseFormUnregister<{
163
- select: string;
164
- text: string;
165
131
  checkbox: boolean;
166
132
  date: Date | null;
133
+ select: string;
134
+ text: string;
167
135
  textCurrency: string;
168
136
  textSearch: string;
169
137
  textArea: string;
170
138
  }>;
171
139
  readonly control: import('react-hook-form').Control<{
172
- select: string;
173
- text: string;
174
140
  checkbox: boolean;
175
141
  date: Date | null;
142
+ select: string;
143
+ text: string;
176
144
  textCurrency: string;
177
145
  textSearch: string;
178
146
  textArea: string;
179
147
  }, any, {
180
- select: string;
181
- text: string;
182
148
  checkbox: boolean;
183
149
  date: Date | null;
150
+ select: string;
151
+ text: string;
184
152
  textCurrency: string;
185
153
  textSearch: string;
186
154
  textArea: string;
187
155
  }>;
188
156
  readonly register: import('react-hook-form').UseFormRegister<{
189
- select: string;
190
- text: string;
191
157
  checkbox: boolean;
192
158
  date: Date | null;
159
+ select: string;
160
+ text: string;
193
161
  textCurrency: string;
194
162
  textSearch: string;
195
163
  textArea: string;
196
164
  }>;
197
165
  readonly setFocus: import('react-hook-form').UseFormSetFocus<{
198
- select: string;
199
- text: string;
200
166
  checkbox: boolean;
201
167
  date: Date | null;
168
+ select: string;
169
+ text: string;
202
170
  textCurrency: string;
203
171
  textSearch: string;
204
172
  textArea: string;
205
173
  }>;
206
174
  readonly subscribe: import('react-hook-form').UseFormSubscribe<{
207
- select: string;
208
- text: string;
209
175
  checkbox: boolean;
210
176
  date: Date | null;
177
+ select: string;
178
+ text: string;
211
179
  textCurrency: string;
212
180
  textSearch: string;
213
181
  textArea: string;
@@ -1,23 +1,7 @@
1
1
  import { KeycloakUser } from '../lib/auth';
2
2
  export declare const useAnalytics: () => {
3
+ readonly analytics: import('analytics').AnalyticsInstance;
4
+ readonly identifyUser: (user: KeycloakUser) => void;
3
5
  readonly trackEntity: (eventName: string, entityName?: string, entityId?: string, payload?: Record<string, unknown>) => void;
4
- readonly trackUser: (user: KeycloakUser) => void;
5
- readonly identify: (userId: string, traits?: any, options?: any, callback?: (...params: any[]) => any) => Promise<any>;
6
- readonly track: (eventName: string, payload?: any, options?: any, callback?: (...params: any[]) => any) => Promise<any>;
7
- readonly page: (data?: import('analytics').PageData, options?: any, callback?: (...params: any[]) => any) => Promise<any>;
8
- readonly user: (key?: string) => string & any;
9
- readonly reset: (callback?: (...params: any[]) => any) => Promise<any>;
10
- readonly ready: (callback: (...params: any[]) => any) => import('analytics').DetachListeners;
11
- readonly on: (name: string, callback: (...params: any[]) => any) => import('analytics').DetachListeners;
12
- readonly once: (name: string, callback: (...params: any[]) => any) => import('analytics').DetachListeners;
13
- readonly getState: (key?: string) => any;
14
- readonly storage: {
15
- getItem: (key: string, options?: any) => any;
16
- setItem: (key: string, value: any, options?: any) => void;
17
- removeItem: (key: string, options?: any) => void;
18
- };
19
- readonly plugins: {
20
- enable: (plugins: string | string[], callback?: (...params: any[]) => any) => Promise<any>;
21
- disable: (plugins: string | string[], callback?: (...params: any[]) => any) => Promise<any>;
22
- };
6
+ readonly trackPageView: () => void;
23
7
  };
@@ -1,6 +1,7 @@
1
1
  import { AnalyticsInstance } from 'analytics';
2
2
  import { ReactNode } from 'react';
3
3
  import { CreateAnalyticsProps } from './createAnalytics';
4
+ export type LabsAnalyticsInstance = AnalyticsInstance;
4
5
  export declare const LabsAnalyticsContext: import('react').Context<AnalyticsInstance | null>;
5
6
  export interface LabsAnalyticsProviderProps extends CreateAnalyticsProps {
6
7
  children: ReactNode;
@@ -54,6 +54,7 @@ export declare const withAuthHeader: (headers?: HeadersInit) => [string, string]
54
54
  includes(searchElement: [string, string], fromIndex?: number): boolean;
55
55
  flatMap<U, This = undefined>(callback: (this: This, value: [string, string], index: number, array: [string, string][]) => U | readonly U[], thisArg?: This | undefined): U[];
56
56
  flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
57
+ at(index: number): [string, string] | undefined;
57
58
  [Symbol.iterator](): ArrayIterator<[string, string]>;
58
59
  [Symbol.unscopables]: {
59
60
  [x: number]: boolean | undefined;
@@ -89,6 +90,7 @@ export declare const withAuthHeader: (headers?: HeadersInit) => [string, string]
89
90
  includes?: boolean | undefined;
90
91
  flatMap?: boolean | undefined;
91
92
  flat?: boolean | undefined;
93
+ at?: boolean | undefined;
92
94
  [Symbol.iterator]?: boolean | undefined;
93
95
  readonly [Symbol.unscopables]?: boolean | undefined;
94
96
  };
@@ -21,6 +21,7 @@ export * from './components/LabsTextCurrency';
21
21
  export * from './components/LabsTextSearch';
22
22
  export * from './components/LabsTextarea';
23
23
  export * from './components/LabsToggle';
24
+ export * from './hooks/useAnalytics';
24
25
  export * from './hooks/useAuth';
25
26
  export * from './hooks/useBreakpoints';
26
27
  export * from './hooks/useLabs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moser-inc/moser-labs-react",
3
- "version": "6.5.0",
3
+ "version": "6.6.1",
4
4
  "description": "React components for the Moser Labs suite of applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,7 +51,7 @@
51
51
  "dayjs": "^1.11.13",
52
52
  "keycloak-js": "23.0.3",
53
53
  "mixpanel-browser": "^2.66.0",
54
- "motion": "^12.23.0",
54
+ "motion": "^12.23.6",
55
55
  "react-idle-timer": "^5.7.2"
56
56
  },
57
57
  "devDependencies": {
@@ -59,20 +59,20 @@
59
59
  "@moser-inc/eslint-config-react": "^4.1.0",
60
60
  "@moser-inc/unocss-preset-moser-labs": "^3.0.1",
61
61
  "@tsconfig/node22": "^22.0.2",
62
- "@tsconfig/vite-react": "^6.3.6",
62
+ "@tsconfig/vite-react": "^7.0.0",
63
63
  "@unocss/eslint-config": "^66.3.3",
64
64
  "@vitejs/plugin-basic-ssl": "^2.1.0",
65
- "@vitejs/plugin-react-swc": "^3.10.2",
66
- "eslint": "^9.30.1",
65
+ "@vitejs/plugin-react-swc": "^3.11.0",
66
+ "eslint": "^9.31.0",
67
67
  "prettier": "^3.6.2",
68
68
  "react-hook-form": "^7.60.0",
69
- "react-router": "^7.6.3",
70
- "react-router-dom": "^7.6.3",
69
+ "react-router": "^7.7.0",
70
+ "react-router-dom": "^7.7.0",
71
71
  "sass": "^1.89.2",
72
72
  "typescript": "^5.8.3",
73
73
  "unocss": "^66.3.3",
74
- "vite": "^7.0.3",
74
+ "vite": "^7.0.5",
75
75
  "vite-plugin-dts": "^4.5.4",
76
- "zod": "^3.25.76"
76
+ "zod": "^4.0.5"
77
77
  }
78
78
  }