@moser-inc/moser-labs-react 7.2.3 → 7.3.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.
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,8 +55,8 @@ 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/FieldContainer/FieldContainer.d.ts
59
- interface FieldContainerProps {
58
+ //#region src/components/LabsFieldContainer.d.ts
59
+ interface LabsFieldContainerProps {
60
60
  id: string;
61
61
  containerId?: string;
62
62
  labelId?: string;
@@ -69,34 +69,55 @@ interface FieldContainerProps {
69
69
  className?: string;
70
70
  children?: ReactNode;
71
71
  }
72
+ declare const LabsFieldContainer: ({
73
+ id,
74
+ containerId,
75
+ labelId,
76
+ messageId,
77
+ hintId,
78
+ label,
79
+ message,
80
+ hint,
81
+ animation,
82
+ children,
83
+ ...rest
84
+ }: LabsFieldContainerProps) => react_jsx_runtime0.JSX.Element;
72
85
  //#endregion
73
86
  //#region src/components/LabsCheckbox.d.ts
74
- type FieldProps$6 = Partial<CheckboxProps> & FieldContainerProps;
87
+ type FieldProps$6 = Partial<CheckboxProps> & LabsFieldContainerProps;
75
88
  type LabsCheckboxProps = FieldProps$6;
76
89
  declare const LabsCheckbox: {
77
90
  (props: LabsCheckboxProps): react_jsx_runtime0.JSX.Element;
78
91
  displayName: string;
79
92
  };
80
93
  //#endregion
81
- //#region src/components/LabsCount.d.ts
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
91
- interface FieldContainerInputProps extends FieldContainerProps {
94
+ //#region src/components/LabsFieldContainerInput.d.ts
95
+ interface LabsFieldContainerInputProps extends LabsFieldContainerProps {
92
96
  solo?: boolean;
93
97
  floatLabel?: boolean;
94
98
  prependIcon?: string;
95
99
  appendIcon?: string;
96
100
  }
101
+ declare const LabsFieldContainerInput: ({
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
+ }: LabsFieldContainerInputProps) => react_jsx_runtime0.JSX.Element;
97
118
  //#endregion
98
119
  //#region src/components/LabsDate.d.ts
99
- type FieldProps$5<TMode extends CalendarSelectionMode = 'single', TValue = (TMode extends 'multiple' ? Date[] : TMode extends 'range' ? (Date | null)[] : Date)> = LabsCalendarProps<TMode, TValue> & FieldContainerInputProps;
120
+ type FieldProps$5<TMode extends CalendarSelectionMode = 'single', TValue = (TMode extends 'multiple' ? Date[] : TMode extends 'range' ? (Date | null)[] : Date)> = LabsCalendarProps<TMode, TValue> & LabsFieldContainerInputProps;
100
121
  type LabsDateProps<TMode extends CalendarSelectionMode = 'single', TValue = (TMode extends 'multiple' ? Date[] : TMode extends 'range' ? (Date | null)[] : Date)> = FieldProps$5<TMode, TValue>;
101
122
  declare const LabsDate: <TMode extends CalendarSelectionMode = "single", TValue = (TMode extends "multiple" ? Date[] : TMode extends "range" ? (Date | null)[] : Date)>(props: LabsDateProps<TMode, TValue>) => react_jsx_runtime0.JSX.Element;
102
123
  //#endregion
@@ -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 LabsFieldContainerHintProps extends BaseProps {
140
+ id: string;
141
+ hintId?: string;
142
+ hint?: string;
143
+ solo?: boolean;
144
+ children?: ReactNode;
145
+ }
146
+ declare const LabsFieldContainerHint: ({
147
+ id,
148
+ hintId,
149
+ hint,
150
+ solo,
151
+ children,
152
+ className,
153
+ ...rest
154
+ }: LabsFieldContainerHintProps) => react_jsx_runtime0.JSX.Element | null;
155
+ //#endregion
156
+ //#region src/components/LabsFieldContainerLabel.d.ts
157
+ interface LabsFieldContainerLabelProps extends ComponentProps<typeof motion.label> {
158
+ id: string;
159
+ labelId?: string;
160
+ label?: string;
161
+ solo?: boolean;
162
+ }
163
+ declare const LabsFieldContainerLabel: ({
164
+ id,
165
+ labelId,
166
+ label,
167
+ solo,
168
+ children,
169
+ className,
170
+ ...rest
171
+ }: LabsFieldContainerLabelProps) => react_jsx_runtime0.JSX.Element | null;
172
+ //#endregion
173
+ //#region src/components/LabsFieldContainerMessage.d.ts
174
+ interface LabsFieldContainerMessageProps extends ComponentProps<typeof motion.span> {
175
+ id: string;
176
+ messageId?: string;
177
+ message?: string;
178
+ solo?: boolean;
179
+ }
180
+ declare const LabsFieldContainerMessage: ({
181
+ id,
182
+ messageId,
183
+ message,
184
+ solo,
185
+ children,
186
+ className,
187
+ ...rest
188
+ }: LabsFieldContainerMessageProps) => 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;
@@ -260,7 +334,7 @@ interface LabsMultiSelectOption<T = unknown> {
260
334
  disabled?: boolean;
261
335
  items?: LabsMultiSelectOption<T>[];
262
336
  }
263
- type FieldProps$4 = Partial<MultiSelectProps> & FieldContainerInputProps;
337
+ type FieldProps$4 = Partial<MultiSelectProps> & LabsFieldContainerInputProps;
264
338
  type LabsMultiSelectChangeEvent<TValue> = Omit<MultiSelectChangeEvent, 'value' | 'selectedOption'> & {
265
339
  value: TValue[];
266
340
  selectedOption: LabsMultiSelectOption<TValue>;
@@ -282,7 +356,7 @@ interface LabsSelectOption<T = unknown> {
282
356
  disabled?: boolean;
283
357
  items?: LabsSelectOption<T>[];
284
358
  }
285
- type FieldProps$3 = Partial<DropdownProps> & FieldContainerInputProps;
359
+ type FieldProps$3 = Partial<DropdownProps> & LabsFieldContainerInputProps;
286
360
  interface LabsSelectProps<TValue extends string | number> extends FieldProps$3 {
287
361
  value?: TValue;
288
362
  options?: LabsSelectOption<TValue>[];
@@ -300,7 +374,7 @@ interface LabsSelectCascadeOption<T = unknown> {
300
374
  disabled?: boolean;
301
375
  items?: LabsSelectCascadeOption<T>[];
302
376
  }
303
- type FieldProps$2 = Partial<CascadeSelectProps> & FieldContainerInputProps;
377
+ type FieldProps$2 = Partial<CascadeSelectProps> & LabsFieldContainerInputProps;
304
378
  type LabsSelectCascadeChangeEvent<TValue> = Omit<CascadeSelectChangeEvent, 'value'> & {
305
379
  value: TValue;
306
380
  };
@@ -312,24 +386,24 @@ interface LabsSelectCascadeProps<TValue extends string | number> extends FieldPr
312
386
  declare const LabsSelectCascade: <TValue extends string | number>(props: LabsSelectCascadeProps<TValue>) => react_jsx_runtime0.JSX.Element;
313
387
  //#endregion
314
388
  //#region src/components/LabsText.d.ts
315
- type FieldProps$1 = Partial<InputTextProps> & FieldContainerInputProps;
389
+ type FieldProps$1 = Partial<InputTextProps> & LabsFieldContainerInputProps;
316
390
  type LabsTextProps = FieldProps$1;
317
391
  type LabsTextElement = HTMLInputElement;
318
- declare const LabsText: react.ForwardRefExoticComponent<Partial<InputTextProps> & FieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
392
+ declare const LabsText: react.ForwardRefExoticComponent<Partial<InputTextProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
319
393
  //#endregion
320
394
  //#region src/components/LabsTextCurrency.d.ts
321
395
  type LabsTextCurrencyProps = LabsTextProps;
322
- declare const LabsTextCurrency: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> & FieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
396
+ declare const LabsTextCurrency: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
323
397
  //#endregion
324
398
  //#region src/components/LabsTextSearch.d.ts
325
399
  type LabsTextSearchProps = LabsTextProps;
326
- declare const LabsTextSearch: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> & FieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
400
+ declare const LabsTextSearch: react.ForwardRefExoticComponent<Partial<primereact_inputtext0.InputTextProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLInputElement>>;
327
401
  //#endregion
328
402
  //#region src/components/LabsTextarea.d.ts
329
- type FieldProps = Partial<InputTextareaProps> & FieldContainerInputProps;
403
+ type FieldProps = Partial<InputTextareaProps> & LabsFieldContainerInputProps;
330
404
  type LabsTextareaProps = FieldProps;
331
405
  type LabsTextareaElement = HTMLTextAreaElement;
332
- declare const LabsTextarea: react.ForwardRefExoticComponent<Partial<InputTextareaProps> & FieldContainerInputProps & react.RefAttributes<HTMLTextAreaElement>>;
406
+ declare const LabsTextarea: react.ForwardRefExoticComponent<Partial<InputTextareaProps> & LabsFieldContainerInputProps & react.RefAttributes<HTMLTextAreaElement>>;
333
407
  //#endregion
334
408
  //#region src/components/LabsToggle.d.ts
335
409
  interface LabsToggleProps {
@@ -20967,4 +21041,4 @@ declare const toLabsTextareaProps: <TValues extends FieldValues = FieldValues, T
20967
21041
  name: TName;
20968
21042
  };
20969
21043
  //#endregion
20970
- 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, LabsCount, 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 };
21044
+ 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, LabsDate, LabsDateProps, LabsEmpty, LabsEmptyProps, LabsFieldContainer, LabsFieldContainerHint, LabsFieldContainerHintProps, LabsFieldContainerInput, LabsFieldContainerInputProps, LabsFieldContainerLabel, LabsFieldContainerLabelProps, LabsFieldContainerMessage, LabsFieldContainerMessageProps, LabsFieldContainerProps, 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.2.3";
32
+ const VERSION = "7.3.1";
33
33
  //#endregion
34
34
  //#region src/lib/head/headContext.tsx
35
35
  const head = createHead();
@@ -352,8 +352,8 @@ const toFieldSharedProps = (fieldProps) => {
352
352
  return { className: clsx("w-full", { "p-invalid": !!fieldProps.message }) };
353
353
  };
354
354
  //#endregion
355
- //#region src/components/FieldContainer/FieldContainerHint.tsx
356
- const FieldContainerHint = ({ id, hintId = `${id}-hint`, hint, solo = false, children = hint, className, ...rest }) => {
355
+ //#region src/components/LabsFieldContainerHint.tsx
356
+ const LabsFieldContainerHint = ({ id, hintId = `${id}-hint`, hint, solo = false, children = hint, className, ...rest }) => {
357
357
  if (!children) return null;
358
358
  return /* @__PURE__ */ jsx(motion.span, {
359
359
  id: hintId,
@@ -363,8 +363,8 @@ const FieldContainerHint = ({ id, hintId = `${id}-hint`, hint, solo = false, chi
363
363
  });
364
364
  };
365
365
  //#endregion
366
- //#region src/components/FieldContainer/FieldContainerLabel.tsx
367
- const FieldContainerLabel = ({ id, labelId = `${id}-label`, label, solo = false, children = label, className, ...rest }) => {
366
+ //#region src/components/LabsFieldContainerLabel.tsx
367
+ const LabsFieldContainerLabel = ({ id, labelId = `${id}-label`, label, solo = false, children = label, className, ...rest }) => {
368
368
  if (!children) return null;
369
369
  return /* @__PURE__ */ jsx(motion.label, {
370
370
  id: labelId,
@@ -498,8 +498,8 @@ const scaleFadeSubtleAnimation = {
498
498
  exit: "exit"
499
499
  };
500
500
  //#endregion
501
- //#region src/components/FieldContainer/FieldContainerMessage.tsx
502
- const FieldContainerMessage = ({ id, messageId = `${id}-message`, message, solo = false, children = message, className, ...rest }) => {
501
+ //#region src/components/LabsFieldContainerMessage.tsx
502
+ const LabsFieldContainerMessage = ({ id, messageId = `${id}-message`, message, solo = false, children = message, className, ...rest }) => {
503
503
  return /* @__PURE__ */ jsx(AnimatePresence, {
504
504
  mode: "wait",
505
505
  children: children ? /* @__PURE__ */ jsx(motion.span, {
@@ -514,27 +514,27 @@ const FieldContainerMessage = ({ id, messageId = `${id}-message`, message, solo
514
514
  });
515
515
  };
516
516
  //#endregion
517
- //#region src/components/FieldContainer/FieldContainer.tsx
518
- const FieldContainer = ({ id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, children, ...rest }) => {
517
+ //#region src/components/LabsFieldContainer.tsx
518
+ const LabsFieldContainer = ({ 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,
521
521
  ...animation,
522
522
  ...rest,
523
523
  children: [
524
- /* @__PURE__ */ jsx(FieldContainerLabel, {
524
+ /* @__PURE__ */ jsx(LabsFieldContainerLabel, {
525
525
  id,
526
526
  labelId,
527
527
  label,
528
528
  className: "text-xs block"
529
529
  }),
530
530
  children,
531
- /* @__PURE__ */ jsx(FieldContainerMessage, {
531
+ /* @__PURE__ */ jsx(LabsFieldContainerMessage, {
532
532
  id,
533
533
  messageId,
534
534
  message,
535
535
  className: "text-xs block"
536
536
  }),
537
- !message && /* @__PURE__ */ jsx(FieldContainerHint, {
537
+ !message && /* @__PURE__ */ jsx(LabsFieldContainerHint, {
538
538
  id,
539
539
  hintId,
540
540
  hint,
@@ -547,7 +547,7 @@ const FieldContainer = ({ id, containerId = `${id}-container`, labelId = `${id}-
547
547
  //#region src/components/LabsCheckbox.tsx
548
548
  const LabsCheckbox = (props) => {
549
549
  const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, className, checked = false, ...rest } = props;
550
- return /* @__PURE__ */ jsxs(FieldContainer, {
550
+ return /* @__PURE__ */ jsxs(LabsFieldContainer, {
551
551
  id,
552
552
  containerId,
553
553
  labelId,
@@ -564,7 +564,7 @@ const LabsCheckbox = (props) => {
564
564
  inputId: id,
565
565
  "aria-describedby": messageId,
566
566
  className: "shrink"
567
- }), /* @__PURE__ */ jsx(FieldContainerLabel, {
567
+ }), /* @__PURE__ */ jsx(LabsFieldContainerLabel, {
568
568
  id,
569
569
  labelId,
570
570
  label,
@@ -574,21 +574,9 @@ const LabsCheckbox = (props) => {
574
574
  };
575
575
  LabsCheckbox.displayName = "LabsCheckbox";
576
576
  //#endregion
577
- //#region src/utils/pluralize.ts
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
590
- 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
- return /* @__PURE__ */ jsxs(FieldContainer, {
577
+ //#region src/components/LabsFieldContainerInput.tsx
578
+ const LabsFieldContainerInput = ({ 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 }) => {
579
+ return /* @__PURE__ */ jsxs(LabsFieldContainer, {
592
580
  id,
593
581
  containerId,
594
582
  labelId,
@@ -597,7 +585,7 @@ const FieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `$
597
585
  className: clsx(className, "flex flex-col gap-1"),
598
586
  ...rest,
599
587
  children: [
600
- !floatLabel && /* @__PURE__ */ jsx(FieldContainerLabel, {
588
+ !floatLabel && /* @__PURE__ */ jsx(LabsFieldContainerLabel, {
601
589
  id,
602
590
  labelId,
603
591
  label,
@@ -615,21 +603,21 @@ const FieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `$
615
603
  prependIcon && /* @__PURE__ */ jsx("i", { className: `${prependIcon} p-input-icon` }),
616
604
  appendIcon && /* @__PURE__ */ jsx("i", { className: `${appendIcon} p-input-icon` }),
617
605
  children,
618
- floatLabel && /* @__PURE__ */ jsx(FieldContainerLabel, {
606
+ floatLabel && /* @__PURE__ */ jsx(LabsFieldContainerLabel, {
619
607
  id,
620
608
  labelId,
621
609
  label
622
610
  })
623
611
  ]
624
612
  }),
625
- /* @__PURE__ */ jsx(FieldContainerMessage, {
613
+ /* @__PURE__ */ jsx(LabsFieldContainerMessage, {
626
614
  id,
627
615
  messageId,
628
616
  message,
629
617
  solo,
630
618
  className: "text-xs"
631
619
  }),
632
- !message && /* @__PURE__ */ jsx(FieldContainerHint, {
620
+ !message && /* @__PURE__ */ jsx(LabsFieldContainerHint, {
633
621
  id,
634
622
  hintId,
635
623
  hint,
@@ -643,7 +631,7 @@ const FieldContainerInput = ({ id, containerId = `${id}-container`, labelId = `$
643
631
  //#region src/components/LabsDate.tsx
644
632
  const LabsDate = (props) => {
645
633
  const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
646
- return /* @__PURE__ */ jsx(FieldContainerInput, {
634
+ return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
647
635
  id,
648
636
  containerId,
649
637
  labelId,
@@ -829,7 +817,7 @@ const LabsMainHeaderActions = () => {
829
817
  //#region src/components/LabsMultiSelect.tsx
830
818
  const LabsMultiSelect = (props) => {
831
819
  const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
832
- return /* @__PURE__ */ jsx(FieldContainerInput, {
820
+ return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
833
821
  id,
834
822
  containerId,
835
823
  labelId,
@@ -857,7 +845,7 @@ const LabsMultiSelect = (props) => {
857
845
  //#region src/components/LabsSelect.tsx
858
846
  const LabsSelect = (props) => {
859
847
  const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
860
- return /* @__PURE__ */ jsx(FieldContainerInput, {
848
+ return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
861
849
  id,
862
850
  containerId,
863
851
  labelId,
@@ -885,7 +873,7 @@ const LabsSelect = (props) => {
885
873
  //#region src/components/LabsSelectCascade.tsx
886
874
  const LabsSelectCascade = (props) => {
887
875
  const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
888
- return /* @__PURE__ */ jsx(FieldContainerInput, {
876
+ return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
889
877
  id,
890
878
  containerId,
891
879
  labelId,
@@ -913,7 +901,7 @@ const LabsSelectCascade = (props) => {
913
901
  //#region src/components/LabsText.tsx
914
902
  const LabsText = forwardRef((props, ref) => {
915
903
  const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
916
- return /* @__PURE__ */ jsx(FieldContainerInput, {
904
+ return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
917
905
  id,
918
906
  containerId,
919
907
  labelId,
@@ -966,7 +954,7 @@ LabsTextSearch.displayName = "LabsTextSearch";
966
954
  //#region src/components/LabsTextarea.tsx
967
955
  const LabsTextarea = forwardRef((props, ref) => {
968
956
  const { id, containerId = `${id}-container`, labelId = `${id}-label`, messageId = `${id}-message`, hintId = `${id}-hint`, label, message, hint, animation, solo, floatLabel, prependIcon, appendIcon, className, ...rest } = props;
969
- return /* @__PURE__ */ jsx(FieldContainerInput, {
957
+ return /* @__PURE__ */ jsx(LabsFieldContainerInput, {
970
958
  id,
971
959
  containerId,
972
960
  labelId,
@@ -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, LabsCount, 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 };
1175
+ export { DEFAULT_TRANSITION, DEFAULT_TRANSITION_MS, DEFAULT_TRANSITION_SECONDS, LABS_MAIN_ID, LabsAnalyticsContext, LabsAnalyticsProvider, LabsAuthContext, LabsAuthGate, LabsAuthProvider, LabsButton, LabsCalendar, LabsCalendarBase, LabsCheckbox, LabsContext, LabsDate, LabsEmpty, LabsFieldContainer, LabsFieldContainerHint, LabsFieldContainerInput, LabsFieldContainerLabel, LabsFieldContainerMessage, 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.2.3",
3
+ "version": "7.3.1",
4
4
  "description": "React components for the Moser Labs suite of applications.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Moser Consulting",