@moser-inc/moser-labs-react 7.2.2 → 7.3.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/index.d.ts +89 -14
- package/dist/index.js +14 -19
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { ButtonProps } from "primereact/button";
|
|
|
9
9
|
import { Calendar, CalendarProps, CalendarSelectionMode } from "primereact/calendar";
|
|
10
10
|
import * as primereact_checkbox0 from "primereact/checkbox";
|
|
11
11
|
import { CheckboxProps } from "primereact/checkbox";
|
|
12
|
-
import { MotionProps } from "motion/react";
|
|
12
|
+
import { MotionProps, motion } from "motion/react";
|
|
13
13
|
import { MenuProps } from "primereact/menu";
|
|
14
14
|
import { SpeedDialProps } from "primereact/speeddial";
|
|
15
15
|
import { MultiSelectChangeEvent, MultiSelectProps } from "primereact/multiselect";
|
|
@@ -55,7 +55,7 @@ declare const LabsCalendarBase: {
|
|
|
55
55
|
};
|
|
56
56
|
declare const LabsCalendar: <TMode extends CalendarSelectionMode = "single", TValue = (TMode extends "multiple" ? Date[] : TMode extends "range" ? (Date | null)[] : Date)>(props: LabsCalendarProps<TMode, TValue> & react.RefAttributes<Calendar<TMode, TValue>>) => React.ReactElement | null;
|
|
57
57
|
//#endregion
|
|
58
|
-
//#region src/components/
|
|
58
|
+
//#region src/components/LabsFieldContainer.d.ts
|
|
59
59
|
interface FieldContainerProps {
|
|
60
60
|
id: string;
|
|
61
61
|
containerId?: string;
|
|
@@ -69,6 +69,19 @@ interface FieldContainerProps {
|
|
|
69
69
|
className?: string;
|
|
70
70
|
children?: ReactNode;
|
|
71
71
|
}
|
|
72
|
+
declare const FieldContainer: ({
|
|
73
|
+
id,
|
|
74
|
+
containerId,
|
|
75
|
+
labelId,
|
|
76
|
+
messageId,
|
|
77
|
+
hintId,
|
|
78
|
+
label,
|
|
79
|
+
message,
|
|
80
|
+
hint,
|
|
81
|
+
animation,
|
|
82
|
+
children,
|
|
83
|
+
...rest
|
|
84
|
+
}: FieldContainerProps) => react_jsx_runtime0.JSX.Element;
|
|
72
85
|
//#endregion
|
|
73
86
|
//#region src/components/LabsCheckbox.d.ts
|
|
74
87
|
type FieldProps$6 = Partial<CheckboxProps> & FieldContainerProps;
|
|
@@ -78,22 +91,30 @@ declare const LabsCheckbox: {
|
|
|
78
91
|
displayName: string;
|
|
79
92
|
};
|
|
80
93
|
//#endregion
|
|
81
|
-
//#region src/components/
|
|
82
|
-
interface LabsCountProps {
|
|
83
|
-
count: number | string;
|
|
84
|
-
plural: string;
|
|
85
|
-
singular: string;
|
|
86
|
-
showCount?: boolean;
|
|
87
|
-
}
|
|
88
|
-
declare const LabsCount: React.FC<LabsCountProps>;
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/components/FieldContainer/FieldContainerInput.d.ts
|
|
94
|
+
//#region src/components/LabsFieldContainerInput.d.ts
|
|
91
95
|
interface FieldContainerInputProps extends FieldContainerProps {
|
|
92
96
|
solo?: boolean;
|
|
93
97
|
floatLabel?: boolean;
|
|
94
98
|
prependIcon?: string;
|
|
95
99
|
appendIcon?: string;
|
|
96
100
|
}
|
|
101
|
+
declare const FieldContainerInput: ({
|
|
102
|
+
id,
|
|
103
|
+
containerId,
|
|
104
|
+
labelId,
|
|
105
|
+
messageId,
|
|
106
|
+
hintId,
|
|
107
|
+
label,
|
|
108
|
+
message,
|
|
109
|
+
hint,
|
|
110
|
+
solo,
|
|
111
|
+
floatLabel,
|
|
112
|
+
prependIcon,
|
|
113
|
+
appendIcon,
|
|
114
|
+
className,
|
|
115
|
+
children,
|
|
116
|
+
...rest
|
|
117
|
+
}: FieldContainerInputProps) => react_jsx_runtime0.JSX.Element;
|
|
97
118
|
//#endregion
|
|
98
119
|
//#region src/components/LabsDate.d.ts
|
|
99
120
|
type FieldProps$5<TMode extends CalendarSelectionMode = 'single', TValue = (TMode extends 'multiple' ? Date[] : TMode extends 'range' ? (Date | null)[] : Date)> = LabsCalendarProps<TMode, TValue> & FieldContainerInputProps;
|
|
@@ -113,6 +134,59 @@ declare const LabsEmpty: ({
|
|
|
113
134
|
...rest
|
|
114
135
|
}: LabsEmptyProps) => react_jsx_runtime0.JSX.Element;
|
|
115
136
|
//#endregion
|
|
137
|
+
//#region src/components/LabsFieldContainerHint.d.ts
|
|
138
|
+
type BaseProps = Omit<ComponentProps<typeof motion.span>, 'children'>;
|
|
139
|
+
interface FieldContainerHintProps extends BaseProps {
|
|
140
|
+
id: string;
|
|
141
|
+
hintId?: string;
|
|
142
|
+
hint?: string;
|
|
143
|
+
solo?: boolean;
|
|
144
|
+
children?: ReactNode;
|
|
145
|
+
}
|
|
146
|
+
declare const FieldContainerHint: ({
|
|
147
|
+
id,
|
|
148
|
+
hintId,
|
|
149
|
+
hint,
|
|
150
|
+
solo,
|
|
151
|
+
children,
|
|
152
|
+
className,
|
|
153
|
+
...rest
|
|
154
|
+
}: FieldContainerHintProps) => react_jsx_runtime0.JSX.Element | null;
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/components/LabsFieldContainerLabel.d.ts
|
|
157
|
+
interface FieldContainerLabelProps extends ComponentProps<typeof motion.label> {
|
|
158
|
+
id: string;
|
|
159
|
+
labelId?: string;
|
|
160
|
+
label?: string;
|
|
161
|
+
solo?: boolean;
|
|
162
|
+
}
|
|
163
|
+
declare const FieldContainerLabel: ({
|
|
164
|
+
id,
|
|
165
|
+
labelId,
|
|
166
|
+
label,
|
|
167
|
+
solo,
|
|
168
|
+
children,
|
|
169
|
+
className,
|
|
170
|
+
...rest
|
|
171
|
+
}: FieldContainerLabelProps) => react_jsx_runtime0.JSX.Element | null;
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/components/LabsFieldContainerMessage.d.ts
|
|
174
|
+
interface FieldContainerMessageProps extends ComponentProps<typeof motion.span> {
|
|
175
|
+
id: string;
|
|
176
|
+
messageId?: string;
|
|
177
|
+
message?: string;
|
|
178
|
+
solo?: boolean;
|
|
179
|
+
}
|
|
180
|
+
declare const FieldContainerMessage: ({
|
|
181
|
+
id,
|
|
182
|
+
messageId,
|
|
183
|
+
message,
|
|
184
|
+
solo,
|
|
185
|
+
children,
|
|
186
|
+
className,
|
|
187
|
+
...rest
|
|
188
|
+
}: FieldContainerMessageProps) => react_jsx_runtime0.JSX.Element;
|
|
189
|
+
//#endregion
|
|
116
190
|
//#region src/components/LabsLoader.d.ts
|
|
117
191
|
interface LabsLoaderProps extends ProgressSpinnerProps {
|
|
118
192
|
label?: string;
|
|
@@ -242,8 +316,9 @@ declare const LabsMainMobileNav: <TDirectoryValue extends DirectoryValueBase = D
|
|
|
242
316
|
declare module 'react/jsx-runtime' {
|
|
243
317
|
namespace JSX {
|
|
244
318
|
interface IntrinsicElements {
|
|
245
|
-
'labs-app-switcher': HTMLAttributes<HTMLElement>;
|
|
246
319
|
'labs-account': HTMLAttributes<HTMLElement>;
|
|
320
|
+
'labs-app-switcher': HTMLAttributes<HTMLElement>;
|
|
321
|
+
'labs-avatar': HTMLAttributes<HTMLElement>;
|
|
247
322
|
}
|
|
248
323
|
}
|
|
249
324
|
}
|
|
@@ -20966,4 +21041,4 @@ declare const toLabsTextareaProps: <TValues extends FieldValues = FieldValues, T
|
|
|
20966
21041
|
name: TName;
|
|
20967
21042
|
};
|
|
20968
21043
|
//#endregion
|
|
20969
|
-
export { ControllerRenderParams, DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, DirectoryValueBase, KeycloakUser, LABS_MAIN_ID, LabsAnalyticsContext, LabsAnalyticsInstance, LabsAnalyticsProvider, LabsAnalyticsProviderProps, LabsAuthContext, LabsAuthContextValue, LabsAuthGate, LabsAuthGateProps, LabsAuthProvider, LabsAuthProviderProps, LabsButton, LabsButtonProps, LabsCalendar, LabsCalendarBase, LabsCalendarProps, LabsCheckbox, LabsCheckboxProps, LabsContext, LabsContextValue,
|
|
21044
|
+
export { ControllerRenderParams, DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, DirectoryValueBase, FieldContainer, FieldContainerHint, FieldContainerHintProps, FieldContainerInput, FieldContainerInputProps, FieldContainerLabel, FieldContainerLabelProps, FieldContainerMessage, FieldContainerMessageProps, FieldContainerProps, KeycloakUser, LABS_MAIN_ID, LabsAnalyticsContext, LabsAnalyticsInstance, LabsAnalyticsProvider, LabsAnalyticsProviderProps, LabsAuthContext, LabsAuthContextValue, LabsAuthGate, LabsAuthGateProps, LabsAuthProvider, LabsAuthProviderProps, LabsButton, LabsButtonProps, LabsCalendar, LabsCalendarBase, LabsCalendarProps, LabsCheckbox, LabsCheckboxProps, LabsContext, LabsContextValue, LabsDate, LabsDateProps, LabsEmpty, LabsEmptyProps, LabsHeadProvider, LabsHeadProviderProps, LabsLoader, LabsLoaderProps, LabsLogoutTimer, LabsLogoutTimerProps, LabsMain, LabsMainDesktopNav, LabsMainDesktopNavProps, LabsMainHeader, LabsMainHeaderActions, LabsMainHeaderProps, LabsMainMobileNav, LabsMainMobileNavProps, LabsMainProps, LabsMenuNav, LabsMenuNavProps, LabsMultiSelect, LabsMultiSelectChangeEvent, LabsMultiSelectOption, LabsMultiSelectProps, LabsPrimeProvider, LabsPrimeProviderProps, LabsProvider, LabsProviderProps, LabsSelect, LabsSelectCascade, LabsSelectCascadeOption, LabsSelectCascadeProps, LabsSelectOption, LabsSelectProps, LabsSpeedDialNav, LabsSpeedDialNavProps, LabsText, LabsTextCurrency, LabsTextCurrencyProps, LabsTextElement, LabsTextProps, LabsTextSearch, LabsTextSearchProps, LabsTextarea, LabsTextareaElement, LabsTextareaProps, LabsToggle, LabsToggleProps, LayoutBase, LayoutBaseProps, LayoutCentered, LayoutCenteredProps, LayoutMain, LayoutMainProps, Role, VERSION, auth, fadeAnimation, getParsedUserInfo, pluralize, refreshToken, scaleFadeAnimation, scaleFadeSubtleAnimation, slideYFadeAnimation, slideYFadeReverseAnimation, toCurrency, toFieldContainerProps, toLabsCheckboxProps, toLabsDateProps, toLabsMultiSelectProps, toLabsSelectCascadeProps, toLabsSelectProps, toLabsTextCurrencyProps, toLabsTextProps, toLabsTextSearchProps, toLabsTextareaProps, toPrecision, useAnalytics, useAuth, useBreakpoints, useLabs, withAuthHeader };
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import { InputTextarea } from "primereact/inputtextarea";
|
|
|
29
29
|
import { Panel } from "primereact/panel";
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/constants/app.ts
|
|
32
|
-
const VERSION = "7.
|
|
32
|
+
const VERSION = "7.3.0";
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/lib/head/headContext.tsx
|
|
35
35
|
const head = createHead();
|
|
@@ -352,7 +352,7 @@ const toFieldSharedProps = (fieldProps) => {
|
|
|
352
352
|
return { className: clsx("w-full", { "p-invalid": !!fieldProps.message }) };
|
|
353
353
|
};
|
|
354
354
|
//#endregion
|
|
355
|
-
//#region src/components/
|
|
355
|
+
//#region src/components/LabsFieldContainerHint.tsx
|
|
356
356
|
const FieldContainerHint = ({ id, hintId = `${id}-hint`, hint, solo = false, children = hint, className, ...rest }) => {
|
|
357
357
|
if (!children) return null;
|
|
358
358
|
return /* @__PURE__ */ jsx(motion.span, {
|
|
@@ -363,7 +363,7 @@ const FieldContainerHint = ({ id, hintId = `${id}-hint`, hint, solo = false, chi
|
|
|
363
363
|
});
|
|
364
364
|
};
|
|
365
365
|
//#endregion
|
|
366
|
-
//#region src/components/
|
|
366
|
+
//#region src/components/LabsFieldContainerLabel.tsx
|
|
367
367
|
const FieldContainerLabel = ({ id, labelId = `${id}-label`, label, solo = false, children = label, className, ...rest }) => {
|
|
368
368
|
if (!children) return null;
|
|
369
369
|
return /* @__PURE__ */ jsx(motion.label, {
|
|
@@ -498,7 +498,7 @@ const scaleFadeSubtleAnimation = {
|
|
|
498
498
|
exit: "exit"
|
|
499
499
|
};
|
|
500
500
|
//#endregion
|
|
501
|
-
//#region src/components/
|
|
501
|
+
//#region src/components/LabsFieldContainerMessage.tsx
|
|
502
502
|
const FieldContainerMessage = ({ id, messageId = `${id}-message`, message, solo = false, children = message, className, ...rest }) => {
|
|
503
503
|
return /* @__PURE__ */ jsx(AnimatePresence, {
|
|
504
504
|
mode: "wait",
|
|
@@ -514,7 +514,7 @@ const FieldContainerMessage = ({ id, messageId = `${id}-message`, message, solo
|
|
|
514
514
|
});
|
|
515
515
|
};
|
|
516
516
|
//#endregion
|
|
517
|
-
//#region src/components/
|
|
517
|
+
//#region src/components/LabsFieldContainer.tsx
|
|
518
518
|
const FieldContainer = ({ id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, children, ...rest }) => {
|
|
519
519
|
return /* @__PURE__ */ jsxs(motion.div, {
|
|
520
520
|
id: containerId,
|
|
@@ -574,19 +574,7 @@ const LabsCheckbox = (props) => {
|
|
|
574
574
|
};
|
|
575
575
|
LabsCheckbox.displayName = "LabsCheckbox";
|
|
576
576
|
//#endregion
|
|
577
|
-
//#region src/
|
|
578
|
-
const pluralize = (count, singular, plural, inclusive = false) => {
|
|
579
|
-
const parsedCount = !isNaN(Number(count)) ? Number(count) : 0;
|
|
580
|
-
if (!inclusive) return parsedCount === 1 ? singular : plural;
|
|
581
|
-
return `${parsedCount} ${parsedCount === 1 ? singular : plural}`;
|
|
582
|
-
};
|
|
583
|
-
//#endregion
|
|
584
|
-
//#region src/components/LabsCount.tsx
|
|
585
|
-
const LabsCount = ({ count, plural, singular, showCount = true }) => {
|
|
586
|
-
return /* @__PURE__ */ jsx("span", { children: pluralize(count, singular, plural, showCount) });
|
|
587
|
-
};
|
|
588
|
-
//#endregion
|
|
589
|
-
//#region src/components/FieldContainer/FieldContainerInput.tsx
|
|
577
|
+
//#region src/components/LabsFieldContainerInput.tsx
|
|
590
578
|
const FieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, solo = false, floatLabel = false, prependIcon, appendIcon, className, children, ...rest }) => {
|
|
591
579
|
return /* @__PURE__ */ jsxs(FieldContainer, {
|
|
592
580
|
id,
|
|
@@ -1125,6 +1113,13 @@ const toPrecision = (number = 0, precision = 2) => {
|
|
|
1125
1113
|
return round(isFinite(parsedNumber) ? parsedNumber : 0, precision).toFixed(precision);
|
|
1126
1114
|
};
|
|
1127
1115
|
//#endregion
|
|
1116
|
+
//#region src/utils/pluralize.ts
|
|
1117
|
+
const pluralize = (count, singular, plural, inclusive = false) => {
|
|
1118
|
+
const parsedCount = !isNaN(Number(count)) ? Number(count) : 0;
|
|
1119
|
+
if (!inclusive) return parsedCount === 1 ? singular : plural;
|
|
1120
|
+
return `${parsedCount} ${parsedCount === 1 ? singular : plural}`;
|
|
1121
|
+
};
|
|
1122
|
+
//#endregion
|
|
1128
1123
|
//#region src/utils/reactHookFormHelpers.ts
|
|
1129
1124
|
const toFieldContainerProps = (fieldState) => ({ message: fieldState.error?.message });
|
|
1130
1125
|
const toLabsCheckboxProps = ({ field: { ref, value, ...field }, fieldState }) => ({
|
|
@@ -1177,4 +1172,4 @@ const toLabsTextareaProps = ({ field: { ref, value, ...field }, fieldState }) =>
|
|
|
1177
1172
|
value
|
|
1178
1173
|
});
|
|
1179
1174
|
//#endregion
|
|
1180
|
-
export { DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, LABS_MAIN_ID, LabsAnalyticsContext, LabsAnalyticsProvider, LabsAuthContext, LabsAuthGate, LabsAuthProvider, LabsButton, LabsCalendar, LabsCalendarBase, LabsCheckbox, LabsContext,
|
|
1175
|
+
export { DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, FieldContainer, FieldContainerHint, FieldContainerInput, FieldContainerLabel, FieldContainerMessage, LABS_MAIN_ID, LabsAnalyticsContext, LabsAnalyticsProvider, LabsAuthContext, LabsAuthGate, LabsAuthProvider, LabsButton, LabsCalendar, LabsCalendarBase, LabsCheckbox, LabsContext, LabsDate, LabsEmpty, LabsHeadProvider, LabsLoader, LabsLogoutTimer, LabsMain, LabsMainDesktopNav, LabsMainHeader, LabsMainHeaderActions, LabsMainMobileNav, LabsMenuNav, LabsMultiSelect, LabsPrimeProvider, LabsProvider, LabsSelect, LabsSelectCascade, LabsSpeedDialNav, LabsText, LabsTextCurrency, LabsTextSearch, LabsTextarea, LabsToggle, LayoutBase, LayoutCentered, LayoutMain, VERSION, auth, fadeAnimation, getParsedUserInfo, pluralize, refreshToken, scaleFadeAnimation, scaleFadeSubtleAnimation, slideYFadeAnimation, slideYFadeReverseAnimation, toCurrency, toFieldContainerProps, toLabsCheckboxProps, toLabsDateProps, toLabsMultiSelectProps, toLabsSelectCascadeProps, toLabsSelectProps, toLabsTextCurrencyProps, toLabsTextProps, toLabsTextSearchProps, toLabsTextareaProps, toPrecision, useAnalytics, useAuth, useBreakpoints, useLabs, withAuthHeader };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moser-inc/moser-labs-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "React components for the Moser Labs suite of applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Moser Consulting",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@hookform/resolvers": "^5.2.2",
|
|
50
50
|
"@moser-inc/eslint-config-react": "^5.1.5",
|
|
51
|
-
"@moser-inc/moser-labs-themes": "1.4.
|
|
52
|
-
"@moser-inc/unocss-preset-moser-labs": "6.4.
|
|
51
|
+
"@moser-inc/moser-labs-themes": "1.4.4",
|
|
52
|
+
"@moser-inc/unocss-preset-moser-labs": "6.4.2",
|
|
53
53
|
"@tsconfig/node24": "^24.0.4",
|
|
54
54
|
"@tsconfig/vite-react": "^7.0.2",
|
|
55
55
|
"@types/node": "~24.10.15",
|