@moser-inc/moser-labs-react 4.1.0 → 5.0.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.
- package/dist/moser-labs-react.css +1 -1
- package/dist/moser-labs-react.js +2121 -2029
- package/dist/package.json.d.ts +4 -5
- package/dist/src/components/FieldContainer/FieldContainer.d.ts +4 -3
- package/dist/src/components/FieldContainer/FieldContainerHint.d.ts +12 -0
- package/dist/src/components/FieldContainer/FieldContainerInput.d.ts +2 -1
- package/dist/src/components/FieldContainer/FieldContainerLabel.d.ts +2 -1
- package/dist/src/components/FieldContainer/FieldContainerMessage.d.ts +2 -1
- package/dist/src/components/LabsSelect.d.ts +2 -2
- package/dist/src/utils/fieldHelpers.d.ts +1 -14
- package/dist/src/utils/reactHookFormHelpers.d.ts +0 -8
- package/package.json +4 -5
package/dist/package.json.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"name": "@moser-inc/moser-labs-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "React components for the Moser Labs suite of applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,9 +38,7 @@ declare const _default: {
|
|
|
38
38
|
"@types/react-dom": ">= 18.2.6 < 19",
|
|
39
39
|
"primereact": ">= 9.6.0 <= 10.4.0",
|
|
40
40
|
"react": ">= 18.2.0 < 19",
|
|
41
|
-
"react-dom": ">= 18.2.0 < 19"
|
|
42
|
-
"react-router": ">= 6 < 8",
|
|
43
|
-
"react-router-dom": ">= 6 < 8"
|
|
41
|
+
"react-dom": ">= 18.2.0 < 19"
|
|
44
42
|
},
|
|
45
43
|
"dependencies": {
|
|
46
44
|
"@analytics/mixpanel": "^0.4.0",
|
|
@@ -50,7 +48,6 @@ declare const _default: {
|
|
|
50
48
|
"analytics": "^0.8.16",
|
|
51
49
|
"clsx": "^2.1.1",
|
|
52
50
|
"dayjs": "^1.11.13",
|
|
53
|
-
"js-sha256": "^0.11.1",
|
|
54
51
|
"keycloak-js": "23.0.3",
|
|
55
52
|
"mixpanel-browser": "^2.65.0",
|
|
56
53
|
"motion": "^12.16.0",
|
|
@@ -68,6 +65,8 @@ declare const _default: {
|
|
|
68
65
|
"eslint": "^9.28.0",
|
|
69
66
|
"prettier": "^3.5.3",
|
|
70
67
|
"react-hook-form": "^7.57.0",
|
|
68
|
+
"react-router": "^7.6.2",
|
|
69
|
+
"react-router-dom": "^7.6.2",
|
|
71
70
|
"typescript": "^5.8.3",
|
|
72
71
|
"unocss": "^66.1.3",
|
|
73
72
|
"vite": "^6.3.5",
|
|
@@ -2,14 +2,15 @@ import { MotionProps } from 'motion/react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export interface FieldContainerProps {
|
|
4
4
|
id: string;
|
|
5
|
+
containerId?: string;
|
|
5
6
|
labelId?: string;
|
|
6
7
|
messageId?: string;
|
|
7
|
-
|
|
8
|
-
hasError?: boolean;
|
|
8
|
+
hintId?: string;
|
|
9
9
|
label?: string;
|
|
10
10
|
message?: string;
|
|
11
|
+
hint?: string;
|
|
11
12
|
animation?: MotionProps;
|
|
12
13
|
className?: string;
|
|
13
14
|
children?: ReactNode;
|
|
14
15
|
}
|
|
15
|
-
export declare const FieldContainer: ({ id, labelId, messageId,
|
|
16
|
+
export declare const FieldContainer: ({ id, containerId, labelId, messageId, hintId, label, message, hint, animation, children, ...rest }: FieldContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { motion } from 'motion/react';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
type BaseProps = Omit<ComponentProps<typeof motion.span>, 'children'>;
|
|
4
|
+
export interface FieldContainerHintProps extends BaseProps {
|
|
5
|
+
id: string;
|
|
6
|
+
hintId?: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
solo?: boolean;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const FieldContainerHint: ({ id, hintId, hint, solo, children, className, ...rest }: FieldContainerHintProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FieldContainerProps } from './FieldContainer';
|
|
2
2
|
export interface FieldContainerInputProps extends FieldContainerProps {
|
|
3
|
+
solo?: boolean;
|
|
3
4
|
floatLabel?: boolean;
|
|
4
5
|
prependIcon?: string;
|
|
5
6
|
appendIcon?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const FieldContainerInput: ({ id, labelId, messageId,
|
|
8
|
+
export declare const FieldContainerInput: ({ id, containerId, labelId, messageId, hintId, label, message, hint, solo, floatLabel, prependIcon, appendIcon, className, children, ...rest }: FieldContainerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,5 +4,6 @@ export interface FieldContainerLabelProps extends ComponentProps<typeof motion.l
|
|
|
4
4
|
id: string;
|
|
5
5
|
labelId?: string;
|
|
6
6
|
label?: string;
|
|
7
|
+
solo?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const FieldContainerLabel: ({ id, labelId, label, children, className, ...rest }: FieldContainerLabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare const FieldContainerLabel: ({ id, labelId, label, solo, children, className, ...rest }: FieldContainerLabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,5 +4,6 @@ export interface FieldContainerMessageProps extends ComponentProps<typeof motion
|
|
|
4
4
|
id: string;
|
|
5
5
|
messageId?: string;
|
|
6
6
|
message?: string;
|
|
7
|
+
solo?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const FieldContainerMessage: ({ id, messageId, message, children, className, ...rest }: FieldContainerMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const FieldContainerMessage: ({ id, messageId, message, solo, children, className, ...rest }: FieldContainerMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,10 +12,10 @@ export interface LabsSelectOption<T = unknown> {
|
|
|
12
12
|
items?: LabsSelectOption<T>[];
|
|
13
13
|
}
|
|
14
14
|
type FieldProps = Partial<DropdownProps> & FieldContainerInputProps;
|
|
15
|
-
export interface LabsSelectProps<TValue extends string> extends FieldProps {
|
|
15
|
+
export interface LabsSelectProps<TValue extends string | number> extends FieldProps {
|
|
16
16
|
value?: TValue;
|
|
17
17
|
options?: LabsSelectOption<TValue>[];
|
|
18
18
|
onChange?: (event: FormEvent<TValue>) => void;
|
|
19
19
|
}
|
|
20
|
-
export declare const LabsSelect: <TValue extends string>(props: LabsSelectProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const LabsSelect: <TValue extends string | number>(props: LabsSelectProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { FieldContainerInputProps } from '../components/FieldContainer/FieldContainerInput';
|
|
2
|
-
export declare const toFieldInputProps: (fieldProps: Partial<FieldContainerInputProps>) =>
|
|
3
|
-
floatLabel?: boolean | undefined;
|
|
4
|
-
prependIcon?: string | undefined;
|
|
5
|
-
appendIcon?: string | undefined;
|
|
6
|
-
id?: string | undefined;
|
|
7
|
-
labelId?: string | undefined;
|
|
8
|
-
messageId?: string | undefined;
|
|
9
|
-
containerId?: string | undefined;
|
|
10
|
-
label?: string | undefined;
|
|
11
|
-
message?: string | undefined;
|
|
12
|
-
animation?: import('framer-motion').MotionProps | undefined;
|
|
13
|
-
className?: string | undefined;
|
|
14
|
-
children?: import('react').ReactNode;
|
|
15
|
-
};
|
|
2
|
+
export declare const toFieldInputProps: (fieldProps: Partial<FieldContainerInputProps>) => Partial<FieldContainerInputProps>;
|
|
16
3
|
export declare const toFieldSharedProps: (fieldProps: FieldContainerInputProps) => {
|
|
17
4
|
className: string;
|
|
18
5
|
};
|
|
@@ -2,14 +2,12 @@ import { FormEvent } from 'primereact/ts-helpers';
|
|
|
2
2
|
import { ControllerFieldState, FieldPath, FieldValues } from 'react-hook-form';
|
|
3
3
|
import { ControllerRenderParams } from '../types/ReactHookForm.type';
|
|
4
4
|
export declare const toFieldContainerProps: (fieldState: ControllerFieldState) => {
|
|
5
|
-
hasError: boolean;
|
|
6
5
|
message: string | undefined;
|
|
7
6
|
};
|
|
8
7
|
export declare const toLabsCheckboxProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
9
8
|
inputRef: import('react-hook-form').RefCallBack;
|
|
10
9
|
checked: TValues[TName];
|
|
11
10
|
onChange: (event: import('primereact/checkbox').CheckboxChangeEvent) => void;
|
|
12
|
-
hasError: boolean;
|
|
13
11
|
message: string | undefined;
|
|
14
12
|
onBlur: import('react-hook-form').Noop;
|
|
15
13
|
disabled?: boolean;
|
|
@@ -19,7 +17,6 @@ export declare const toLabsDateProps: <TValues extends FieldValues = FieldValues
|
|
|
19
17
|
inputRef: import('react-hook-form').RefCallBack;
|
|
20
18
|
value: TValues[TName];
|
|
21
19
|
onChange: (event: FormEvent<Date>) => void;
|
|
22
|
-
hasError: boolean;
|
|
23
20
|
message: string | undefined;
|
|
24
21
|
onBlur: import('react-hook-form').Noop;
|
|
25
22
|
disabled?: boolean;
|
|
@@ -29,7 +26,6 @@ export declare const toLabsSelectProps: <TValues extends FieldValues = FieldValu
|
|
|
29
26
|
inputRef: import('react-hook-form').RefCallBack;
|
|
30
27
|
value: TValues[TName];
|
|
31
28
|
onChange: (event: FormEvent<TValues[TName], import('react').SyntheticEvent<Element, Event>>) => void;
|
|
32
|
-
hasError: boolean;
|
|
33
29
|
message: string | undefined;
|
|
34
30
|
onBlur: import('react-hook-form').Noop;
|
|
35
31
|
disabled?: boolean;
|
|
@@ -38,7 +34,6 @@ export declare const toLabsSelectProps: <TValues extends FieldValues = FieldValu
|
|
|
38
34
|
export declare const toLabsTextProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
39
35
|
ref: import('react-hook-form').RefCallBack;
|
|
40
36
|
value: TValues[TName];
|
|
41
|
-
hasError: boolean;
|
|
42
37
|
message: string | undefined;
|
|
43
38
|
onChange: (...event: any[]) => void;
|
|
44
39
|
onBlur: import('react-hook-form').Noop;
|
|
@@ -48,7 +43,6 @@ export declare const toLabsTextProps: <TValues extends FieldValues = FieldValues
|
|
|
48
43
|
export declare const toLabsTextCurrencyProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
49
44
|
ref: import('react-hook-form').RefCallBack;
|
|
50
45
|
value: TValues[TName];
|
|
51
|
-
hasError: boolean;
|
|
52
46
|
message: string | undefined;
|
|
53
47
|
onChange: (...event: any[]) => void;
|
|
54
48
|
onBlur: import('react-hook-form').Noop;
|
|
@@ -58,7 +52,6 @@ export declare const toLabsTextCurrencyProps: <TValues extends FieldValues = Fie
|
|
|
58
52
|
export declare const toLabsTextSearchProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
59
53
|
ref: import('react-hook-form').RefCallBack;
|
|
60
54
|
value: TValues[TName];
|
|
61
|
-
hasError: boolean;
|
|
62
55
|
message: string | undefined;
|
|
63
56
|
onChange: (...event: any[]) => void;
|
|
64
57
|
onBlur: import('react-hook-form').Noop;
|
|
@@ -68,7 +61,6 @@ export declare const toLabsTextSearchProps: <TValues extends FieldValues = Field
|
|
|
68
61
|
export declare const toLabsTextareaProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, value, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
69
62
|
ref: import('react-hook-form').RefCallBack;
|
|
70
63
|
value: TValues[TName];
|
|
71
|
-
hasError: boolean;
|
|
72
64
|
message: string | undefined;
|
|
73
65
|
onChange: (...event: any[]) => void;
|
|
74
66
|
onBlur: import('react-hook-form').Noop;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moser-inc/moser-labs-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "React components for the Moser Labs suite of applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,9 +38,7 @@
|
|
|
38
38
|
"@types/react-dom": ">= 18.2.6 < 19",
|
|
39
39
|
"primereact": ">= 9.6.0 <= 10.4.0",
|
|
40
40
|
"react": ">= 18.2.0 < 19",
|
|
41
|
-
"react-dom": ">= 18.2.0 < 19"
|
|
42
|
-
"react-router": ">= 6 < 8",
|
|
43
|
-
"react-router-dom": ">= 6 < 8"
|
|
41
|
+
"react-dom": ">= 18.2.0 < 19"
|
|
44
42
|
},
|
|
45
43
|
"dependencies": {
|
|
46
44
|
"@analytics/mixpanel": "^0.4.0",
|
|
@@ -50,7 +48,6 @@
|
|
|
50
48
|
"analytics": "^0.8.16",
|
|
51
49
|
"clsx": "^2.1.1",
|
|
52
50
|
"dayjs": "^1.11.13",
|
|
53
|
-
"js-sha256": "^0.11.1",
|
|
54
51
|
"keycloak-js": "23.0.3",
|
|
55
52
|
"mixpanel-browser": "^2.65.0",
|
|
56
53
|
"motion": "^12.16.0",
|
|
@@ -68,6 +65,8 @@
|
|
|
68
65
|
"eslint": "^9.28.0",
|
|
69
66
|
"prettier": "^3.5.3",
|
|
70
67
|
"react-hook-form": "^7.57.0",
|
|
68
|
+
"react-router": "^7.6.2",
|
|
69
|
+
"react-router-dom": "^7.6.2",
|
|
71
70
|
"typescript": "^5.8.3",
|
|
72
71
|
"unocss": "^66.1.3",
|
|
73
72
|
"vite": "^6.3.5",
|