@mnbsolutions/framework-frontend 0.0.0-stage → 4.0.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.
Files changed (126) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +88 -2
  3. package/dist/esm/types/MuiClassNameSetup.d.ts +1 -0
  4. package/dist/esm/types/components/AdminLoginForm/AdminLoginForm.d.ts +89 -0
  5. package/dist/esm/types/components/AdminLoginForm/AdminLoginForm.stories.d.ts +11 -0
  6. package/dist/esm/types/components/AdminLoginForm/index.d.ts +3 -0
  7. package/dist/esm/types/components/Autocomplete/Autocomplete.d.ts +8 -0
  8. package/dist/esm/types/components/Autocomplete/Autocomplete.stories.d.ts +17 -0
  9. package/dist/esm/types/components/Autocomplete/AutocompleteOld.d.ts +7 -0
  10. package/dist/esm/types/components/Button/Button.d.ts +10 -0
  11. package/dist/esm/types/components/Button/Button.stories.d.ts +10 -0
  12. package/dist/esm/types/components/Captcha/CaptchaAccessibilityTest.d.ts +1 -0
  13. package/dist/esm/types/components/Captcha/CaptchaClientTest.d.ts +1 -0
  14. package/dist/esm/types/components/Captcha/CaptchaDebugTest.d.ts +1 -0
  15. package/dist/esm/types/components/Captcha/CaptchaDebugger.d.ts +1 -0
  16. package/dist/esm/types/components/Captcha/CaptchaExample.d.ts +1 -0
  17. package/dist/esm/types/components/Captcha/CaptchaStatusDebugger.d.ts +1 -0
  18. package/dist/esm/types/components/Captcha/CaptchaTest.d.ts +1 -0
  19. package/dist/esm/types/components/Captcha/CaptchaTroubleshoot.d.ts +2 -0
  20. package/dist/esm/types/components/Captcha/CaptchaWidget.d.ts +27 -0
  21. package/dist/esm/types/components/Captcha/CaptchaWidget.stories.d.ts +31 -0
  22. package/dist/esm/types/components/Captcha/CaptchaWidgetTest.d.ts +4 -0
  23. package/dist/esm/types/components/Captcha/ComprehensiveTest.d.ts +1 -0
  24. package/dist/esm/types/components/Captcha/FinalValidationTest.d.ts +1 -0
  25. package/dist/esm/types/components/Captcha/SimpleValidationTest.d.ts +1 -0
  26. package/dist/esm/types/components/Captcha/SubmitOnlyValidationTest.d.ts +1 -0
  27. package/dist/esm/types/components/Captcha/ValidationTest.d.ts +1 -0
  28. package/dist/esm/types/components/Captcha/hooks/useCaptchaForm.d.ts +14 -0
  29. package/dist/esm/types/components/Captcha/hooks/useCaptchaToken.d.ts +9 -0
  30. package/dist/esm/types/components/Captcha/hooks/useCaptchaValidation.d.ts +11 -0
  31. package/dist/esm/types/components/Captcha/types/captcha.d.ts +52 -0
  32. package/dist/esm/types/components/Checkbox/Checkbox.d.ts +18 -0
  33. package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +12 -0
  34. package/dist/esm/types/components/ConfigContext/ConfigContext.d.ts +10 -0
  35. package/dist/esm/types/components/ConfigContext/ConfigContext.types.d.ts +8 -0
  36. package/dist/esm/types/components/ConfigContext/index.d.ts +2 -0
  37. package/dist/esm/types/components/ContactLink/ContactLink.d.ts +7 -0
  38. package/dist/esm/types/components/ContactLink/ContactLink.stories.d.ts +7 -0
  39. package/dist/esm/types/components/ContactLink/index.d.ts +2 -0
  40. package/dist/esm/types/components/DataTable/DataTable.d.ts +14 -0
  41. package/dist/esm/types/components/DataTable/DataTable.stories.d.ts +16 -0
  42. package/dist/esm/types/components/DataTable/index.d.ts +3 -0
  43. package/dist/esm/types/components/DataTable/locales/deDE.d.ts +6 -0
  44. package/dist/esm/types/components/DataTable/locales/index.d.ts +7 -0
  45. package/dist/esm/types/components/DataTable/types.d.ts +127 -0
  46. package/dist/esm/types/components/DatePicker/DatePicker.d.ts +12 -0
  47. package/dist/esm/types/components/DatePicker/DatePicker.stories.d.ts +15 -0
  48. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +14 -0
  49. package/dist/esm/types/components/Experimental/UrlField/UrlField.d.ts +34 -0
  50. package/dist/esm/types/components/Experimental/UrlField/UrlField.stories.d.ts +6 -0
  51. package/dist/esm/types/components/Experimental/UrlField/index.d.ts +3 -0
  52. package/dist/esm/types/components/Fields/makeCustomAddressAutocompleteRHF.d.ts +40 -0
  53. package/dist/esm/types/components/Fields/makeCustomAutocompleteRHF.d.ts +40 -0
  54. package/dist/esm/types/components/Fields/makeCustomCheckboxRHF.d.ts +53 -0
  55. package/dist/esm/types/components/Fields/makeCustomDatePickerRHF.d.ts +22 -0
  56. package/dist/esm/types/components/Fields/makeCustomInputRHF.d.ts +25 -0
  57. package/dist/esm/types/components/Fields/makeCustomRadioRHF.d.ts +41 -0
  58. package/dist/esm/types/components/FieldsetLegend/FieldsetLegend.d.ts +58 -0
  59. package/dist/esm/types/components/FileUpload/FileUpload.d.ts +23 -0
  60. package/dist/esm/types/components/FileUpload/FileUpload.stories.d.ts +16 -0
  61. package/dist/esm/types/components/FileUpload/FileUpload2.d.ts +18 -0
  62. package/dist/esm/types/components/FileUpload/ShowUploadFiles.d.ts +20 -0
  63. package/dist/esm/types/components/FileUpload/ShowUploadFiles2.d.ts +19 -0
  64. package/dist/esm/types/components/FileUpload/UploadField.d.ts +28 -0
  65. package/dist/esm/types/components/FileUpload/UploadField.stories.d.ts +8 -0
  66. package/dist/esm/types/components/FileUpload/UploadField2.d.ts +33 -0
  67. package/dist/esm/types/components/FileUpload/UploadField2.stories.d.ts +10 -0
  68. package/dist/esm/types/components/FileUpload/types.d.ts +8 -0
  69. package/dist/esm/types/components/FormControlLabel/FormControlLabel.d.ts +7 -0
  70. package/dist/esm/types/components/ImageUploadCrop/ImageUploadCrop.d.ts +34 -0
  71. package/dist/esm/types/components/ImageUploadCrop/ImageUploadCrop.stories.d.ts +6 -0
  72. package/dist/esm/types/components/ImageUploadCrop/index.d.ts +3 -0
  73. package/dist/esm/types/components/InfoTooltipIcon/InfoTooltipIcon.d.ts +18 -0
  74. package/dist/esm/types/components/InfoTooltipIcon/InfoTooltipIcon.stories.d.ts +7 -0
  75. package/dist/esm/types/components/InfoTooltipIcon/TooltipWrapper.d.ts +35 -0
  76. package/dist/esm/types/components/InfoTooltipIcon/TooltipWrapper.stories.d.ts +7 -0
  77. package/dist/esm/types/components/LinkButton/LinkButton.d.ts +16 -0
  78. package/dist/esm/types/components/LinkButton/LinkButton.stories.d.ts +16 -0
  79. package/dist/esm/types/components/LocalizationProvider/LocalizationProvider.d.ts +8 -0
  80. package/dist/esm/types/components/Modal/MnbModal.d.ts +31 -0
  81. package/dist/esm/types/components/Modal/MnbModal.stories.d.ts +9 -0
  82. package/dist/esm/types/components/Notification/NotificationExample.d.ts +1 -0
  83. package/dist/esm/types/components/Notification/NotificationSystem.d.ts +81 -0
  84. package/dist/esm/types/components/Notification/NotificationTest.d.ts +1 -0
  85. package/dist/esm/types/components/Notification/ToastContainer.d.ts +182 -0
  86. package/dist/esm/types/components/PrivacyLink/PrivacyLink.d.ts +13 -0
  87. package/dist/esm/types/components/PrivacyLink/PrivacyLink.stories.d.ts +6 -0
  88. package/dist/esm/types/components/Radio/Radio.d.ts +31 -0
  89. package/dist/esm/types/components/Radio/Radio.stories.d.ts +13 -0
  90. package/dist/esm/types/components/Radio/RadioWCAG.d.ts +35 -0
  91. package/dist/esm/types/components/RequiredFieldsInfo/RequiredFieldsInfo.d.ts +34 -0
  92. package/dist/esm/types/components/RequiredFieldsInfo/RequiredFieldsInfo.stories.d.ts +7 -0
  93. package/dist/esm/types/components/RichTextEditor/RichTextEditor.d.ts +13 -0
  94. package/dist/esm/types/components/RichTextEditor/RichTextEditor.stories.d.ts +6 -0
  95. package/dist/esm/types/components/RichTextEditor/index.d.ts +3 -0
  96. package/dist/esm/types/components/Select/Select.d.ts +19 -0
  97. package/dist/esm/types/components/Select/Select.stories.d.ts +14 -0
  98. package/dist/esm/types/components/StatusTimeline/StatusTimeline.d.ts +38 -0
  99. package/dist/esm/types/components/StatusTimeline/StatusTimeline.stories.d.ts +7 -0
  100. package/dist/esm/types/components/StatusTimeline/index.d.ts +3 -0
  101. package/dist/esm/types/components/SvgIcon/SvgIcon.d.ts +27 -0
  102. package/dist/esm/types/components/SvgIcon/SvgIcon.stories.d.ts +7 -0
  103. package/dist/esm/types/components/TextField/TextField.d.ts +6 -0
  104. package/dist/esm/types/components/TextField/TextField.stories.d.ts +14 -0
  105. package/dist/esm/types/components/ThemeWrapper/ThemeWrapper.d.ts +9 -0
  106. package/dist/esm/types/components/UsercentricsAllowScreen/UsercentricsAllowScreen.d.ts +8 -0
  107. package/dist/esm/types/components/Wizard/NavigateItem.d.ts +28 -0
  108. package/dist/esm/types/components/Wizard/Wizard.d.ts +30 -0
  109. package/dist/esm/types/components/Wizard/Wizard.stories.d.ts +7 -0
  110. package/dist/esm/types/components/Wizard/Wizard.types.d.ts +17 -0
  111. package/dist/esm/types/components/Wizard/WizardAccessibilityTest.d.ts +1 -0
  112. package/dist/esm/types/components/Wizard/WizardTest.d.ts +1 -0
  113. package/dist/esm/types/hooks/useUserCentrics.d.ts +42 -0
  114. package/dist/esm/types/index.d.ts +95 -0
  115. package/dist/esm/types/stories/ThemeViewer.stories.d.ts +7 -0
  116. package/dist/esm/types/stories/decorators.d.ts +2 -0
  117. package/dist/esm/types/utils/accessibility.d.ts +94 -0
  118. package/dist/esm/types/utils/createFormField.d.ts +19 -0
  119. package/dist/esm/types/utils/pdfAccessibilityUtils.d.ts +213 -0
  120. package/dist/esm/types/utils/utils.d.ts +6 -0
  121. package/dist/index.d.ts +1777 -0
  122. package/dist/index.esm.js +29 -0
  123. package/dist/index.esm.js.map +1 -0
  124. package/dist/index.js +29 -0
  125. package/dist/index.js.map +1 -0
  126. package/package.json +112 -4
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ export interface MTCaptchaConfig {
3
+ sitekey: string;
4
+ lang?: string;
5
+ renderQueue?: any[];
6
+ text?: {
7
+ instruction?: string;
8
+ };
9
+ [key: string]: any;
10
+ }
11
+ export interface MTCaptchaStatus {
12
+ domId: string;
13
+ element: HTMLDivElement;
14
+ isVerified: boolean;
15
+ isVisible: boolean;
16
+ statusCode: number;
17
+ statusDesc: string;
18
+ verifiedToken: string;
19
+ }
20
+ export interface MTCaptchaAPI {
21
+ enableTestMode: () => void;
22
+ focus: () => void;
23
+ getConfiguration: () => void;
24
+ getStatus: () => MTCaptchaStatus;
25
+ getVerifiedToken: () => string | null;
26
+ remove: () => void;
27
+ renderUI: () => void;
28
+ resetUI: () => void;
29
+ showMandatory: () => void;
30
+ }
31
+ export interface CaptchaProviderProps {
32
+ sitekey: string;
33
+ lang?: string;
34
+ children: React.ReactNode;
35
+ onVerificationChange?: (isVerified: boolean, token?: string) => void;
36
+ checkInterval?: number;
37
+ }
38
+ export interface UseCaptchaReturn {
39
+ isVerified: boolean;
40
+ isLoading: boolean;
41
+ verifiedToken: string | null;
42
+ reset: () => void;
43
+ getStatus: () => MTCaptchaStatus | null;
44
+ }
45
+ declare global {
46
+ interface Window {
47
+ mtcaptcha?: MTCaptchaAPI;
48
+ mtcaptchaConfig?: MTCaptchaConfig;
49
+ debugMTCaptcha?: () => void;
50
+ testCaptchaRender?: () => void;
51
+ }
52
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { CheckboxProps } from '@mui/material/Checkbox/Checkbox';
3
+ interface ICheckboxProps extends CheckboxProps {
4
+ clr?: string;
5
+ hoverclr?: string;
6
+ label?: string;
7
+ required?: boolean;
8
+ }
9
+ export declare const CheckboxIcon: ({ clr, hoverclr }: {
10
+ clr: string;
11
+ hoverclr: string;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const CheckboxCheckedIcon: ({ clr, hoverclr }: {
14
+ clr: string;
15
+ hoverclr: string;
16
+ }) => import("react/jsx-runtime").JSX.Element;
17
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<ICheckboxProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
18
+ export default Checkbox;
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import MnbCheckbox from "./Checkbox";
3
+ declare const meta: Meta<typeof MnbCheckbox>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MnbCheckbox>;
6
+ export declare const Default: Story;
7
+ export declare const Checked: Story;
8
+ export declare const Disabled: Story;
9
+ export declare const DisabledChecked: Story;
10
+ export declare const Required: Story;
11
+ export declare const WithoutLabel: Story;
12
+ export declare const WithClickHandler: Story;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ConfigProviderProps } from './ConfigContext.types';
3
+ declare const PassConfigContext: {
4
+ config: any;
5
+ };
6
+ declare const ConfigProvider: <T extends object>({ children, fallback, projectName, configFileName, defaultConfig }: ConfigProviderProps<T>) => string | number | true | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null;
7
+ declare const useConfigContext: <T>() => T;
8
+ export default ConfigProvider;
9
+ export { PassConfigContext, useConfigContext };
10
+ export declare const isConfigReady: () => boolean;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ export type ConfigProviderProps<T> = {
3
+ children: ReactNode;
4
+ fallback?: ReactNode;
5
+ projectName: string;
6
+ configFileName: string;
7
+ defaultConfig?: T;
8
+ };
@@ -0,0 +1,2 @@
1
+ export { default as ConfigProvider, PassConfigContext, isConfigReady, useConfigContext } from './ConfigContext';
2
+ export * from './ConfigContext.types';
@@ -0,0 +1,7 @@
1
+ export interface ContactLinkProps {
2
+ type: 'email' | 'phone' | 'website';
3
+ value: string;
4
+ className?: string;
5
+ }
6
+ declare const ContactLink: ({ type, value, className }: ContactLinkProps) => JSX.Element;
7
+ export default ContactLink;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import ContactLink from "./ContactLink";
3
+ declare const meta: Meta<typeof ContactLink>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ContactLink>;
6
+ export declare const Default: Story;
7
+ export declare const AllTypes: Story;
@@ -0,0 +1,2 @@
1
+ export { default } from './ContactLink';
2
+ export type { ContactLinkProps } from './ContactLink';
@@ -0,0 +1,14 @@
1
+ import { GridValidRowModel } from '@mui/x-data-grid-pro';
2
+ import { IDataTableProps } from './types';
3
+ /**
4
+ * WCAG-compliant DataTable component
5
+ *
6
+ * Accessibility features:
7
+ * - Full keyboard navigation support
8
+ * - Screen reader optimized with German locale
9
+ * - ARIA labels and descriptions
10
+ * - High contrast focus indicators
11
+ * - Semantic table structure
12
+ */
13
+ declare const DataTable: <T extends GridValidRowModel>({ rows, columns, isLoading, totalRowCount, config, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...dataGridProps }: IDataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
14
+ export default DataTable;
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import MnbDataTable from "./DataTable";
3
+ declare const meta: Meta<typeof MnbDataTable>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MnbDataTable>;
6
+ export declare const Default: Story;
7
+ export declare const WithPagination: Story;
8
+ export declare const WithRowSelection: Story;
9
+ export declare const WithFilters: Story;
10
+ export declare const WithExport: Story;
11
+ export declare const LoadingState: Story;
12
+ export declare const EmptyState: Story;
13
+ export declare const AutoHeight: Story;
14
+ export declare const FixedHeight: Story;
15
+ export declare const WithAllFeatures: Story;
16
+ export declare const ProductTable: Story;
@@ -0,0 +1,3 @@
1
+ export { default } from './DataTable';
2
+ export { default as DataTable } from './DataTable';
3
+ export type { IDataTableProps, IDataTableConfig } from './types';
@@ -0,0 +1,6 @@
1
+ import { GridLocaleText } from '@mui/x-data-grid';
2
+ /**
3
+ * German locale text for MUI DataGrid - WCAG compliant
4
+ * All strings are optimized for screen readers (NVDA, JAWS, VoiceOver)
5
+ */
6
+ export declare const deDE: Partial<GridLocaleText>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * DataTable Locales
3
+ *
4
+ * Pre-configured locale texts for MUI DataGrid
5
+ * All locales are WCAG compliant with screen reader optimized strings
6
+ */
7
+ export { deDE } from './deDE';
@@ -0,0 +1,127 @@
1
+ import { DataGridProProps, GridValidRowModel, GridLocaleText } from '@mui/x-data-grid-pro';
2
+ export interface IDataTableConfig {
3
+ /**
4
+ * Page size options for pagination
5
+ * @default [10, 20, 50, 100]
6
+ */
7
+ pageSizeOptions?: number[];
8
+ /**
9
+ * Default page size
10
+ * @default 10
11
+ */
12
+ defaultPageSize?: number;
13
+ /**
14
+ * Always show pagination controls, even when all rows fit on one page
15
+ * @default true
16
+ */
17
+ showPagination?: boolean;
18
+ /**
19
+ * Locale text configuration for the data grid
20
+ * If not provided, uses German locale by default
21
+ */
22
+ localeText?: Partial<GridLocaleText>;
23
+ /**
24
+ * Enable auto height (table adjusts to content)
25
+ * @default false
26
+ */
27
+ autoHeight?: boolean;
28
+ /**
29
+ * Fixed height for the table
30
+ * If not provided, table will use 100% of container
31
+ */
32
+ height?: string | number;
33
+ /**
34
+ * Minimum height for the table
35
+ */
36
+ minHeight?: string | number;
37
+ /**
38
+ * Maximum height for the table
39
+ */
40
+ maxHeight?: string | number;
41
+ /**
42
+ * Show column menu
43
+ * @default true
44
+ */
45
+ showColumnMenu?: boolean;
46
+ /**
47
+ * Show toolbar
48
+ * @default true
49
+ */
50
+ showToolbar?: boolean;
51
+ /**
52
+ * Enable row selection
53
+ * @default false
54
+ */
55
+ enableRowSelection?: boolean;
56
+ /**
57
+ * Selection mode: 'single' or 'multiple'
58
+ * @default 'multiple'
59
+ */
60
+ selectionMode?: 'single' | 'multiple';
61
+ /**
62
+ * Enable density selector
63
+ * @default false
64
+ */
65
+ enableDensitySelector?: boolean;
66
+ /**
67
+ * Enable column filter
68
+ * @default false
69
+ */
70
+ enableColumnFilter?: boolean;
71
+ /**
72
+ * Enable column visibility toggle
73
+ * @default false
74
+ */
75
+ enableColumnVisibility?: boolean;
76
+ /**
77
+ * Enable export functionality
78
+ * @default false
79
+ */
80
+ enableExport?: boolean;
81
+ /**
82
+ * Custom CSS class name for the table container
83
+ */
84
+ containerClassName?: string;
85
+ /**
86
+ * Custom CSS class name for the table
87
+ */
88
+ tableClassName?: string;
89
+ }
90
+ export interface IDataTableProps<T extends GridValidRowModel> extends Omit<DataGridProProps<T>, 'rows' | 'columns'> {
91
+ /**
92
+ * Table rows data
93
+ */
94
+ rows: T[];
95
+ /**
96
+ * Table column definitions
97
+ */
98
+ columns: DataGridProProps<T>['columns'];
99
+ /**
100
+ * Loading state
101
+ * @default false
102
+ */
103
+ isLoading?: boolean;
104
+ /**
105
+ * Total row count (for server-side pagination)
106
+ */
107
+ totalRowCount?: number;
108
+ /**
109
+ * Table configuration options
110
+ */
111
+ config?: IDataTableConfig;
112
+ /**
113
+ * WCAG: Accessible label for the table region
114
+ * Announced by screen readers when the table receives focus
115
+ */
116
+ 'aria-label'?: string;
117
+ /**
118
+ * WCAG: ID of an element that labels the table
119
+ * Use when a visible heading describes the table
120
+ */
121
+ 'aria-labelledby'?: string;
122
+ /**
123
+ * WCAG: ID of an element that describes the table
124
+ * Use for additional context about the table's content
125
+ */
126
+ 'aria-describedby'?: string;
127
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { DatePickerProps } from '@mui/x-date-pickers';
3
+ import type { Moment } from 'moment';
4
+ /**
5
+ * MnbDatePicker – A themed wrapper around MUI X DatePicker that
6
+ * - uses the library TextField for consistent labeling and a11y
7
+ * - applies consistent calendar styling using theme colors
8
+ * - forwards all DatePicker props to MUI
9
+ */
10
+ declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps<Moment, any> & React.RefAttributes<HTMLDivElement>>;
11
+ export type { DatePickerProps } from '@mui/x-date-pickers';
12
+ export default DatePicker;
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import MnbDatePicker from "./DatePicker";
3
+ declare const meta: Meta<typeof MnbDatePicker>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MnbDatePicker>;
6
+ export declare const Default: Story;
7
+ export declare const WithValue: Story;
8
+ export declare const Required: Story;
9
+ export declare const WithError: Story;
10
+ export declare const Disabled: Story;
11
+ export declare const ReadOnly: Story;
12
+ export declare const YearMonthOnly: Story;
13
+ export declare const YearOnly: Story;
14
+ export declare const WithCustomHandler: Story;
15
+ export declare const WithRHF: Story;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { AutocompleteProps } from '@mui/material';
3
+ interface IDropdownProps extends AutocompleteProps<any, any, any, any> {
4
+ children?: React.ReactNode;
5
+ theme?: any;
6
+ items: {
7
+ id: string;
8
+ name: string;
9
+ }[];
10
+ isCreatable?: boolean;
11
+ placeholder?: string;
12
+ }
13
+ declare const Dropdown: React.FC<IDropdownProps>;
14
+ export default Dropdown;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { TextFieldProps } from '@mui/material/TextField';
3
+ export interface UrlFieldProps extends Omit<TextFieldProps, 'type' | 'InputProps'> {
4
+ /** Current URL value */
5
+ value?: string;
6
+ /** Callback when URL changes */
7
+ onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
8
+ /** Callback when URL is blurred */
9
+ onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
10
+ /** Custom URL validation regex pattern */
11
+ urlPattern?: RegExp;
12
+ /** Whether to show the "open in new tab" button */
13
+ showOpenButton?: boolean;
14
+ /** Custom error message */
15
+ error?: boolean;
16
+ /** Error message text */
17
+ errorMessage?: string;
18
+ /** Helper text */
19
+ helperText?: string;
20
+ /** Label text */
21
+ label?: string;
22
+ /** Placeholder text */
23
+ placeholder?: string;
24
+ /** Whether field is required */
25
+ required?: boolean;
26
+ /** Disabled state */
27
+ disabled?: boolean;
28
+ /** ARIA describedby */
29
+ 'aria-describedby'?: string;
30
+ /** Custom className */
31
+ className?: string;
32
+ }
33
+ declare const UrlField: React.FC<UrlFieldProps>;
34
+ export default UrlField;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import UrlField from './UrlField';
3
+ declare const meta: Meta<typeof UrlField>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof UrlField>;
6
+ export declare const Default: Story;
@@ -0,0 +1,3 @@
1
+ export { default } from './UrlField';
2
+ export { default as UrlField } from './UrlField';
3
+ export type { UrlFieldProps } from './UrlField';
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Control, FieldValues, Path, RegisterOptions, UseFormSetValue } from 'react-hook-form';
3
+ export type AutoCompleteMode = 'PLZ' | 'CITY' | 'STREET';
4
+ export type CustomAddressAutocompleteProps<T extends FieldValues = FieldValues> = {
5
+ name: Path<T>;
6
+ label: string;
7
+ url: string;
8
+ autoCompleteFor: AutoCompleteMode;
9
+ city?: string;
10
+ postalNumber?: string;
11
+ disabled?: boolean;
12
+ autoload?: boolean;
13
+ placeholder?: string;
14
+ autoComplete?: string;
15
+ rules?: RegisterOptions<T, Path<T>>;
16
+ config?: RegisterOptions<T, Path<T>>;
17
+ control?: Control<T>;
18
+ onOptionSelected?: (selected: any, api: {
19
+ setValue: UseFormSetValue<T>;
20
+ name: Path<T>;
21
+ }) => void;
22
+ setValue?: UseFormSetValue<T>;
23
+ onClear?: (api: {
24
+ setValue: UseFormSetValue<T>;
25
+ name: Path<T>;
26
+ }) => void;
27
+ minChars?: number;
28
+ debounceMs?: number;
29
+ getOptionLabel?: (option: any) => string;
30
+ buildQuery?: (args: {
31
+ mode: AutoCompleteMode;
32
+ search: string;
33
+ city?: string;
34
+ postalNumber?: string;
35
+ }) => string;
36
+ clearOptionsSignal?: unknown;
37
+ /** Allow user to create a new option from free text input */
38
+ creatable?: boolean;
39
+ };
40
+ export declare function makeCustomAddressAutocompleteRHF<T extends FieldValues = FieldValues>(): React.FC<CustomAddressAutocompleteProps<T>>;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Control, FieldValues, Path, RegisterOptions } from 'react-hook-form';
3
+ import { AutocompleteChangeReason } from '@mui/material';
4
+ /**
5
+ * A generic RHF wrapper for MnbAutocomplete WITHOUT address fetching.
6
+ * - Uses provided `items` only
7
+ * - Adds WCAG aids (instructions + live results count)
8
+ * - Works with FormProvider or with explicit `control`
9
+ */
10
+ export type CustomAutocompleteItem = {
11
+ id?: string | number;
12
+ name?: string;
13
+ label?: string;
14
+ value?: string;
15
+ [key: string]: any;
16
+ };
17
+ export type CustomAutocompleteRHFProps<T extends FieldValues = FieldValues> = {
18
+ name: Path<T>;
19
+ label: string;
20
+ items: CustomAutocompleteItem[];
21
+ disabled?: boolean;
22
+ fullWidth?: boolean;
23
+ multiple?: boolean;
24
+ isLoading?: boolean;
25
+ isCreatable?: boolean;
26
+ placeholder?: string;
27
+ /** Validation */
28
+ rules?: RegisterOptions<T, Path<T>>;
29
+ config?: RegisterOptions<T, Path<T>>;
30
+ /** If NOT using <FormProvider>, pass control here */
31
+ control?: Control<T>;
32
+ /**
33
+ * Custom label/value resolvers
34
+ */
35
+ getOptionLabel?: (option: CustomAutocompleteItem) => string;
36
+ isOptionEqualToValue?: (option: CustomAutocompleteItem, value: CustomAutocompleteItem) => boolean;
37
+ /** Optional external onChange tap */
38
+ onChanged?: (value: CustomAutocompleteItem | CustomAutocompleteItem[] | null, reason: AutocompleteChangeReason) => void;
39
+ };
40
+ export declare function makeCustomAutocompleteRHF<T extends FieldValues = FieldValues>(): React.FC<CustomAutocompleteRHFProps<T>>;
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { Control, FieldValues, Path, RegisterOptions } from 'react-hook-form';
3
+ /** Optional ARIA props like in your legacy CustomCheckbox */
4
+ export type ItemAriaProps = Partial<{
5
+ 'aria-expanded': boolean;
6
+ 'aria-controls': string;
7
+ 'aria-describedby': string;
8
+ 'aria-invalid': boolean;
9
+ }>;
10
+ /** Per-item config for per-field mode (boolean fields) */
11
+ export type CheckboxItemPerField<T extends FieldValues> = ItemAriaProps & {
12
+ name: Path<T>;
13
+ label: string | React.ReactNode;
14
+ labelBold?: boolean;
15
+ rules?: RegisterOptions<T, Path<T>>;
16
+ config?: RegisterOptions<T, Path<T>>;
17
+ };
18
+ /** Per-item config for field-array mode (single array field collecting values) */
19
+ export type CheckboxItemArray = ItemAriaProps & {
20
+ value: string;
21
+ label: string | React.ReactNode;
22
+ labelBold?: boolean;
23
+ };
24
+ export type CustomCheckboxProps<T extends FieldValues = FieldValues> = {
25
+ /** Items; meaning depends on isFieldArray */
26
+ checkboxValues: (CheckboxItemPerField<T> | CheckboxItemArray)[];
27
+ /** Layout / styling */
28
+ className?: string;
29
+ errorClassName?: string;
30
+ row?: boolean;
31
+ disabled?: boolean;
32
+ /** RHF interop */
33
+ control?: Control<T>;
34
+ /** If true, this group controls a single array field (string[]) using props.name */
35
+ isFieldArray?: boolean;
36
+ /** Required when isFieldArray is true: the array field name */
37
+ name?: Path<T>;
38
+ /** Group-level rules when isFieldArray is true (e.g., min selection) */
39
+ groupRules?: RegisterOptions<T, Path<T>>;
40
+ /** Optional helper text under the group (string or function) */
41
+ helperText?: React.ReactNode | ((ctx: {
42
+ errors: any;
43
+ hasError: boolean;
44
+ }) => React.ReactNode);
45
+ hasCustomErrorMessage?: boolean;
46
+ };
47
+ /**
48
+ * Generic, RHF-aware Checkbox Group that mirrors your CustomCheckbox behavior and adds:
49
+ * - isFieldArray mode (single string[] field)
50
+ * - helper text under the group
51
+ * - works with FormProvider or explicit control
52
+ */
53
+ export declare function makeCustomCheckboxRHF<T extends FieldValues = FieldValues>(): React.FC<CustomCheckboxProps<T>>;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { Control, FieldValues, Path, RegisterOptions } from 'react-hook-form';
3
+ import { MnbTextField } from '../../index';
4
+ import type { Moment } from 'moment';
5
+ import type { DatePickerProps } from '@mui/x-date-pickers-pro';
6
+ export type CustomDatePickerRHFProps<T extends FieldValues = FieldValues> = {
7
+ name: Path<T>;
8
+ label: string;
9
+ disabled?: boolean;
10
+ fullWidth?: boolean;
11
+ isLoading?: boolean;
12
+ /** Validation */
13
+ rules?: RegisterOptions<T, Path<T>>;
14
+ config?: RegisterOptions<T, Path<T>>;
15
+ /** If NOT using <FormProvider>, pass control here */
16
+ control?: Control<T>;
17
+ /** Additional props to pass to the underlying TextField */
18
+ textFieldProps?: React.ComponentProps<typeof MnbTextField>;
19
+ /** MUI DatePicker props */
20
+ datePickerProps?: DatePickerProps<Moment, any>;
21
+ };
22
+ export declare function makeCustomDatePickerRHF<T extends FieldValues = FieldValues>(): React.FC<CustomDatePickerRHFProps<T>>;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { Control, FieldValues, Path, RegisterOptions } from 'react-hook-form';
3
+ import { MnbTextField } from '../../index';
4
+ type MnbTextFieldProps = React.ComponentProps<typeof MnbTextField>;
5
+ export type CustomInputRHFProps<T extends FieldValues = FieldValues> = {
6
+ name: Path<T>;
7
+ label: string;
8
+ disabled?: boolean;
9
+ fullWidth?: boolean;
10
+ isLoading?: boolean;
11
+ /** Prefer `rules`; `config` kept for backwards compatibility */
12
+ rules?: RegisterOptions<T, Path<T>>;
13
+ config?: RegisterOptions<T, Path<T>>;
14
+ /** Pass when NOT using <FormProvider> */
15
+ control?: Control<T>;
16
+ } & Omit<MnbTextFieldProps, 'name' | 'defaultValue' | 'value' | 'onChange' | 'onBlur' | 'ref' | 'label'>;
17
+ export type MakeOptions<T extends FieldValues> = {
18
+ /** Optional: compute variant dynamically (e.g., based on theme) */
19
+ getVariant?: (ctx: {
20
+ props: CustomInputRHFProps<T>;
21
+ value: any;
22
+ }) => MnbTextFieldProps['variant'];
23
+ };
24
+ export declare function makeCustomInputRHF<T extends FieldValues = FieldValues>(opts?: MakeOptions<T>): React.FC<CustomInputRHFProps<T>>;
25
+ export {};
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { Control, FieldValues, Path, RegisterOptions } from 'react-hook-form';
3
+ import { GridDirection } from '@mui/material';
4
+ export type RadioItem = {
5
+ value: string;
6
+ label: string;
7
+ disabled?: boolean;
8
+ };
9
+ export type CustomRadioProps<T extends FieldValues = FieldValues> = {
10
+ /** RHF field name (type-safe) */
11
+ name: Path<T>;
12
+ /** Optional group label */
13
+ label?: string | React.ReactNode;
14
+ /** Options */
15
+ radioValues: RadioItem[];
16
+ /** Optional: externally controlled selection override */
17
+ selectedValue?: string;
18
+ /** Layout/styling */
19
+ className?: string;
20
+ errorClassName?: string;
21
+ row?: boolean;
22
+ disabled?: boolean;
23
+ /** Validation */
24
+ rules?: RegisterOptions<T, Path<T>>;
25
+ config?: RegisterOptions<T, Path<T>>;
26
+ /** If NOT using <FormProvider>, pass control here */
27
+ control?: Control<T>;
28
+ /** Intercept onChange; call provided onChange when done */
29
+ onChangeOverride?: (e: React.ChangeEvent<HTMLInputElement>, value: string, onChange: (value: any) => void) => void;
30
+ /** If you need to mimic preventDefault() behavior */
31
+ preventDefaultOnChange?: boolean;
32
+ direction?: GridDirection;
33
+ /** ARIA accessibility props */
34
+ 'aria-label'?: string;
35
+ 'aria-labelledby'?: string;
36
+ 'aria-describedby'?: string;
37
+ 'aria-invalid'?: boolean;
38
+ 'aria-required'?: boolean;
39
+ role?: string;
40
+ };
41
+ export declare function makeCustomRadioRHF<T extends FieldValues = FieldValues>(): React.FC<CustomRadioProps<T>>;