@moser-inc/moser-labs-react 1.16.5 → 1.17.0

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.
Files changed (56) hide show
  1. package/dist/moser-labs-react.cjs +2018 -88
  2. package/dist/moser-labs-react.d.ts +1 -0
  3. package/dist/moser-labs-react.js +38130 -22371
  4. package/dist/src/_dev/components/DevDirectoryLink.d.ts +0 -1
  5. package/dist/src/_dev/components/DevLink.d.ts +1 -2
  6. package/dist/src/_dev/lib/directory.d.ts +0 -1
  7. package/dist/src/_dev/sandbox.d.ts +0 -1
  8. package/dist/src/_dev/views/Base.view.d.ts +0 -1
  9. package/dist/src/_dev/views/Inputs.view.d.ts +38 -39
  10. package/dist/src/_dev/views/Presentation.view.d.ts +0 -1
  11. package/dist/src/components/FieldContainer/FieldContainer.d.ts +0 -1
  12. package/dist/src/components/FieldContainer/FieldContainerInput.d.ts +0 -1
  13. package/dist/src/components/FieldContainer/FieldContainerLabel.d.ts +0 -1
  14. package/dist/src/components/FieldContainer/FieldContainerMessage.d.ts +0 -1
  15. package/dist/src/components/LabsAuthGate.d.ts +0 -1
  16. package/dist/src/components/LabsButton.d.ts +0 -1
  17. package/dist/src/components/LabsCalendar.d.ts +0 -1
  18. package/dist/src/components/LabsCheckbox.d.ts +1 -2
  19. package/dist/src/components/LabsCount.d.ts +0 -1
  20. package/dist/src/components/LabsDate.d.ts +3 -3
  21. package/dist/src/components/LabsIcon.d.ts +0 -1
  22. package/dist/src/components/LabsLoader.d.ts +0 -1
  23. package/dist/src/components/LabsLogoutTimer.d.ts +0 -1
  24. package/dist/src/components/LabsMain.d.ts +0 -1
  25. package/dist/src/components/LabsMainDesktopNav.d.ts +0 -1
  26. package/dist/src/components/LabsMainHeaderActions.d.ts +10 -0
  27. package/dist/src/components/LabsMainMobileNav.d.ts +0 -1
  28. package/dist/src/components/LabsMenuNav.d.ts +0 -1
  29. package/dist/src/components/LabsPlaceholder.d.ts +0 -1
  30. package/dist/src/components/LabsSelect.d.ts +1 -2
  31. package/dist/src/components/LabsSpeedDialNav.d.ts +0 -1
  32. package/dist/src/components/LabsText.d.ts +1 -2
  33. package/dist/src/components/LabsTextCurrency.d.ts +1 -2
  34. package/dist/src/components/LabsTextSearch.d.ts +1 -2
  35. package/dist/src/components/LabsTextarea.d.ts +1 -2
  36. package/dist/src/components/LabsToggle.d.ts +0 -1
  37. package/dist/src/components/LabsTypeahead.d.ts +2 -3
  38. package/dist/src/components/LabsUser.d.ts +0 -1
  39. package/dist/src/hooks/useAnalytics.d.ts +7 -8
  40. package/dist/src/layouts/Base.layout.d.ts +0 -1
  41. package/dist/src/layouts/Centered.layout.d.ts +0 -1
  42. package/dist/src/layouts/Main.layout.d.ts +0 -1
  43. package/dist/src/lib/analytics/analyticsContext.d.ts +0 -1
  44. package/dist/src/lib/analytics/createAnalytics.d.ts +0 -1
  45. package/dist/src/lib/auth/authContext.d.ts +4 -3
  46. package/dist/src/lib/auth/authUtils.d.ts +22 -21
  47. package/dist/src/lib/auth/index.d.ts +0 -1
  48. package/dist/src/lib/dayjs.d.ts +0 -1
  49. package/dist/src/main.d.ts +1 -1
  50. package/dist/src/types/DirectoryValue.type.d.ts +0 -1
  51. package/dist/src/types/ReactHookForm.type.d.ts +0 -1
  52. package/dist/src/utils/animations.d.ts +0 -1
  53. package/dist/src/utils/fieldHelpers.d.ts +0 -1
  54. package/dist/src/utils/forwardRefInferGenerics.d.ts +0 -1
  55. package/package.json +35 -40
  56. package/dist/src/_dev/components/DevLabsUser.d.ts +0 -2
@@ -1,7 +1,6 @@
1
1
  import { AnalyticsInstance } from 'analytics';
2
2
  import { ReactNode } from 'react';
3
3
  import { CreateAnalyticsProps } from './createAnalytics';
4
-
5
4
  export declare const LabsAnalyticsContext: import('react').Context<AnalyticsInstance | null>;
6
5
  export interface LabsAnalyticsProviderProps extends CreateAnalyticsProps {
7
6
  children: ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="analytics" />
2
1
  export interface CreateAnalyticsProps {
3
2
  appName: string;
4
3
  options?: {
@@ -1,7 +1,7 @@
1
- import { User, refreshToken } from '.';
2
-
1
+ import { User, auth, refreshToken } from '.';
3
2
  export type Role = string;
4
3
  export type LabsAuthContextValue = {
4
+ keycloak: typeof auth;
5
5
  user: User | null;
6
6
  hasAllRoles: (roles: Role | readonly Role[] | undefined) => boolean;
7
7
  hasRole: (roles: Role | readonly Role[] | undefined) => boolean;
@@ -13,6 +13,7 @@ export type LabsAuthContextValue = {
13
13
  export declare const LabsAuthContext: import('react').Context<LabsAuthContextValue | null>;
14
14
  export interface LabsAuthProviderProps {
15
15
  appIdentifier: string;
16
+ labsApiUri?: string;
16
17
  children: React.ReactNode;
17
18
  }
18
- export declare const LabsAuthProvider: ({ appIdentifier, children, }: LabsAuthProviderProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const LabsAuthProvider: ({ appIdentifier, labsApiUri, children, }: LabsAuthProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -15,45 +15,46 @@ export declare const withAuthHeader: (headers?: HeadersInit) => [string, string]
15
15
  length: number;
16
16
  toString(): string;
17
17
  toLocaleString(): string;
18
+ toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
18
19
  pop(): [string, string] | undefined;
19
20
  push(...items: [string, string][]): number;
20
21
  concat(...items: ConcatArray<[string, string]>[]): [string, string][];
21
22
  concat(...items: ([string, string] | ConcatArray<[string, string]>)[]): [string, string][];
22
- join(separator?: string | undefined): string;
23
+ join(separator?: string): string;
23
24
  reverse(): [string, string][];
24
25
  shift(): [string, string] | undefined;
25
- slice(start?: number | undefined, end?: number | undefined): [string, string][];
26
+ slice(start?: number, end?: number): [string, string][];
26
27
  sort(compareFn?: ((a: [string, string], b: [string, string]) => number) | undefined): [string, string][];
27
- splice(start: number, deleteCount?: number | undefined): [string, string][];
28
+ splice(start: number, deleteCount?: number): [string, string][];
28
29
  splice(start: number, deleteCount: number, ...items: [string, string][]): [string, string][];
29
30
  unshift(...items: [string, string][]): number;
30
- indexOf(searchElement: [string, string], fromIndex?: number | undefined): number;
31
- lastIndexOf(searchElement: [string, string], fromIndex?: number | undefined): number;
31
+ indexOf(searchElement: [string, string], fromIndex?: number): number;
32
+ lastIndexOf(searchElement: [string, string], fromIndex?: number): number;
32
33
  every<S extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S, thisArg?: any): this is S[];
33
34
  every(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): boolean;
34
35
  some(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): boolean;
35
36
  forEach(callbackfn: (value: [string, string], index: number, array: [string, string][]) => void, thisArg?: any): void;
36
37
  map<U>(callbackfn: (value: [string, string], index: number, array: [string, string][]) => U, thisArg?: any): U[];
37
- filter<S_1 extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S_1, thisArg?: any): S_1[];
38
+ filter<S extends [string, string]>(predicate: (value: [string, string], index: number, array: [string, string][]) => value is S, thisArg?: any): S[];
38
39
  filter(predicate: (value: [string, string], index: number, array: [string, string][]) => unknown, thisArg?: any): [string, string][];
39
40
  reduce(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string]): [string, string];
40
41
  reduce(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string], initialValue: [string, string]): [string, string];
41
- reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U_1, initialValue: U_1): U_1;
42
+ reduce<U>(callbackfn: (previousValue: U, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U, initialValue: U): U;
42
43
  reduceRight(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string]): [string, string];
43
44
  reduceRight(callbackfn: (previousValue: [string, string], currentValue: [string, string], currentIndex: number, array: [string, string][]) => [string, string], initialValue: [string, string]): [string, string];
44
- reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U_2, initialValue: U_2): U_2;
45
- find<S_2 extends [string, string]>(predicate: (value: [string, string], index: number, obj: [string, string][]) => value is S_2, thisArg?: any): S_2 | undefined;
45
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: [string, string], currentIndex: number, array: [string, string][]) => U, initialValue: U): U;
46
+ find<S extends [string, string]>(predicate: (value: [string, string], index: number, obj: [string, string][]) => value is S, thisArg?: any): S | undefined;
46
47
  find(predicate: (value: [string, string], index: number, obj: [string, string][]) => unknown, thisArg?: any): [string, string] | undefined;
47
48
  findIndex(predicate: (value: [string, string], index: number, obj: [string, string][]) => unknown, thisArg?: any): number;
48
- fill(value: [string, string], start?: number | undefined, end?: number | undefined): [string, string][];
49
- copyWithin(target: number, start: number, end?: number | undefined): [string, string][];
50
- entries(): IterableIterator<[number, [string, string]]>;
51
- keys(): IterableIterator<number>;
52
- values(): IterableIterator<[string, string]>;
53
- includes(searchElement: [string, string], fromIndex?: number | undefined): boolean;
54
- flatMap<U_3, This = undefined>(callback: (this: This, value: [string, string], index: number, array: [string, string][]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
49
+ fill(value: [string, string], start?: number, end?: number): [string, string][];
50
+ copyWithin(target: number, start: number, end?: number): [string, string][];
51
+ entries(): ArrayIterator<[number, [string, string]]>;
52
+ keys(): ArrayIterator<number>;
53
+ values(): ArrayIterator<[string, string]>;
54
+ includes(searchElement: [string, string], fromIndex?: number): boolean;
55
+ flatMap<U, This = undefined>(callback: (this: This, value: [string, string], index: number, array: [string, string][]) => U | readonly U[], thisArg?: This | undefined): U[];
55
56
  flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
56
- [Symbol.iterator](): IterableIterator<[string, string]>;
57
+ [Symbol.iterator](): ArrayIterator<[string, string]>;
57
58
  [Symbol.unscopables]: {
58
59
  [x: number]: boolean | undefined;
59
60
  length?: boolean | undefined;
@@ -102,9 +103,9 @@ export declare const withAuthHeader: (headers?: HeadersInit) => [string, string]
102
103
  has(name: string): boolean;
103
104
  set(name: string, value: string): void;
104
105
  forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
105
- entries(): IterableIterator<[string, string]>;
106
- keys(): IterableIterator<string>;
107
- values(): IterableIterator<string>;
108
- [Symbol.iterator](): IterableIterator<[string, string]>;
106
+ entries(): HeadersIterator<[string, string]>;
107
+ keys(): HeadersIterator<string>;
108
+ values(): HeadersIterator<string>;
109
+ [Symbol.iterator](): HeadersIterator<[string, string]>;
109
110
  } | undefined;
110
111
  export declare const refreshToken: () => Promise<boolean>;
@@ -1,5 +1,4 @@
1
1
  import { default as Keycloak } from 'keycloak-js';
2
-
3
2
  export declare const auth: Keycloak;
4
3
  export * from './authContext';
5
4
  export * from './authUtils';
@@ -1,3 +1,2 @@
1
1
  import { default as dayjs } from 'dayjs';
2
-
3
2
  export default dayjs;
@@ -1,4 +1,3 @@
1
-
2
1
  export * from './constants/app';
3
2
  export * from './components/LabsAuthGate';
4
3
  export * from './components/LabsButton';
@@ -12,6 +11,7 @@ export * from './components/LabsLogoutTimer';
12
11
  export * from './components/LabsMain';
13
12
  export * from './components/LabsMainDesktopNav';
14
13
  export * from './components/LabsMainMobileNav';
14
+ export * from './components/LabsMainHeaderActions';
15
15
  export * from './components/LabsMenuNav';
16
16
  export * from './components/LabsPlaceholder';
17
17
  export * from './components/LabsSelect';
@@ -1,5 +1,4 @@
1
1
  import { Role } from '../main';
2
-
3
2
  export type DirectoryValue = {
4
3
  EXACT?: boolean;
5
4
  ICON: string;
@@ -1,5 +1,4 @@
1
1
  import { ControllerFieldState, ControllerRenderProps, FieldPath, FieldValues, UseFormStateReturn } from 'react-hook-form';
2
-
3
2
  export type ControllerRenderParams<TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>> = {
4
3
  field: ControllerRenderProps<TValues, TName>;
5
4
  fieldState: ControllerFieldState;
@@ -1,3 +1,2 @@
1
1
  import { MotionProps } from 'framer-motion';
2
-
3
2
  export declare const slideYFadeAnimation: MotionProps;
@@ -1,5 +1,4 @@
1
1
  import { FieldContainerInputProps } from '../components/FieldContainer/FieldContainerInput';
2
-
3
2
  export declare const toFieldInputProps: (fieldProps: Partial<FieldContainerInputProps>) => Partial<Partial<FieldContainerInputProps>>;
4
3
  export declare const toFieldSharedProps: (fieldProps: FieldContainerInputProps) => {
5
4
  className: string;
@@ -1,3 +1,2 @@
1
1
  import { RefAttributes } from 'react';
2
-
3
2
  export declare const forwardRefInferGenerics: <T, P = Record<string, unknown>>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null) => (props: P & RefAttributes<T>) => React.ReactElement | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moser-inc/moser-labs-react",
3
- "version": "1.16.5",
3
+ "version": "1.17.0",
4
4
  "description": "React components for the Moser Labs suite of applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "dev": "vite",
30
- "build": "tsc && vite build",
31
- "lint": "eslint src --max-warnings 0 --report-unused-disable-directives",
30
+ "build": "vite build",
31
+ "lint": "eslint . --max-warnings 0",
32
32
  "preview": "vite preview",
33
33
  "test": "echo \"Error: no test specified\" && exit 1",
34
34
  "type-check": "tsc --noEmit",
@@ -37,53 +37,48 @@
37
37
  "peerDependencies": {
38
38
  "@types/react": ">= 18.2.14 < 19",
39
39
  "@types/react-dom": ">= 18.2.6 < 19",
40
- "primereact": ">= 9.6.0 < 10",
40
+ "primereact": ">= 9.6.0 <= 10.4.0",
41
41
  "react": ">= 18.2.0 < 19",
42
42
  "react-dom": ">= 18.2.0 < 19",
43
43
  "react-router-dom": ">= 6 < 7"
44
44
  },
45
45
  "dependencies": {
46
46
  "@analytics/mixpanel": "^0.4.0",
47
- "@hookform/resolvers": "^3.2.0",
48
- "@react-hookz/web": "^23.1.0",
49
- "analytics": "^0.8.9",
50
- "clsx": "^2.0.0",
51
- "dayjs": "^1.11.9",
52
- "framer-motion": "^10.16.1",
53
- "keycloak-js": "^22.0.1",
47
+ "@hookform/resolvers": "^3.9.1",
48
+ "@moser-inc/moser-labs-custom-elements": "2.3.3",
49
+ "@react-hookz/web": "^24.0.4",
50
+ "analytics": "^0.8.14",
51
+ "clsx": "^2.1.1",
52
+ "dayjs": "^1.11.13",
53
+ "framer-motion": "^11.13.5",
54
+ "js-sha256": "^0.10.1",
55
+ "keycloak-js": "23.0.3",
54
56
  "lodash": "^4.17.21",
55
- "mixpanel-browser": "^2.47.0",
56
- "primereact": ">= 9.6.0 < 10",
57
- "react": ">= 18.2.0 < 19",
58
- "react-dom": ">= 18.2.0 < 19",
59
- "react-helmet-async": "^1.3.0",
60
- "react-hook-form": "^7.45.4",
57
+ "mixpanel-browser": "^2.56.0",
58
+ "react-helmet-async": "^2.0.5",
59
+ "react-hook-form": "^7.54.0",
61
60
  "react-idle-timer": "^5.7.2",
62
- "react-router-dom": ">= 6 < 7",
63
- "react-select": "^5.7.4",
64
- "styled-components": "^6.0.7",
65
- "zod": "^3.22.2"
61
+ "react-select": "^5.8.3",
62
+ "styled-components": "^6.1.13",
63
+ "zod": "^3.24.0"
66
64
  },
67
65
  "devDependencies": {
68
- "@iconify-json/mdi": "^1.1.54",
69
- "@iconify-json/mingcute": "^1.1.9",
70
- "@iconify-json/ph": "^1.1.6",
71
- "@iconify-json/solar": "^1.1.2",
72
- "@moser-inc/eslint-config-react": "^2.0.1",
66
+ "@iconify-json/mdi": "^1.2.1",
67
+ "@iconify-json/mingcute": "^1.2.1",
68
+ "@iconify-json/ph": "^1.2.1",
69
+ "@iconify-json/solar": "^1.2.1",
70
+ "@moser-inc/eslint-config-react": "^2.3.2",
73
71
  "@moser-inc/unocss-preset-moser-labs": "^1.18.0",
74
- "@rushstack/eslint-patch": "^1.10.4",
75
- "@types/lodash": "^4.14.197",
76
- "@types/react": "^18.2.20",
77
- "@types/react-dom": "^18.2.7",
78
- "@types/react-helmet": "^6.1.6",
79
- "@unocss/eslint-config": "^0.64.1",
80
- "@vitejs/plugin-basic-ssl": "^1.0.1",
81
- "@vitejs/plugin-react-swc": "^3.3.2",
82
- "eslint": "^8.57.0",
83
- "prettier": "^3.3.2",
84
- "typescript": "^5.1.6",
85
- "unocss": "^0.64.1",
86
- "vite": "^5.2.12",
87
- "vite-plugin-dts": "^3.9.1"
72
+ "@types/lodash": "^4.17.13",
73
+ "@types/react-helmet": "^6.1.11",
74
+ "@unocss/eslint-config": "^0.65.1",
75
+ "@vitejs/plugin-basic-ssl": "^1.2.0",
76
+ "@vitejs/plugin-react-swc": "^3.7.2",
77
+ "eslint": "^9.16.0",
78
+ "prettier": "^3.4.2",
79
+ "typescript": "^5.7.2",
80
+ "unocss": "^0.65.1",
81
+ "vite": "^5.4.11",
82
+ "vite-plugin-dts": "^4.3.0"
88
83
  }
89
84
  }
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const DevLabsUser: React.FC;