feat: implement comprehensive Form UI library with React Hook Form integration, Zod validation, and i18n support.

This commit is contained in:
Firman Ramdhani
2026-06-15 18:40:22 +07:00
parent 00a2f218cc
commit a72b73bac4
45 changed files with 2064 additions and 10 deletions
+38
View File
@@ -0,0 +1,38 @@
import '@testing-library/jest-dom/vitest';
// ---------------------------------------------------------------------------
// Polyfill: window.matchMedia
// ---------------------------------------------------------------------------
// Mantine v8's MantineProvider calls window.matchMedia internally for
// color scheme detection. jsdom does not implement matchMedia, so we
// provide a minimal stub to prevent TypeError during test rendering.
// ---------------------------------------------------------------------------
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: (query: string) => ({
matches: false,
media: query,
onchange: null,
addListener: () => {},
removeListener: () => {},
addEventListener: () => {},
removeEventListener: () => {},
dispatchEvent: () => false,
}),
});
// ---------------------------------------------------------------------------
// Polyfill: ResizeObserver
// ---------------------------------------------------------------------------
// Some Mantine components (Popover, Select dropdown) use ResizeObserver
// which is also not available in jsdom.
// ---------------------------------------------------------------------------
class ResizeObserverStub {
observe() {}
unobserve() {}
disconnect() {}
}
window.ResizeObserver = ResizeObserverStub as unknown as typeof ResizeObserver;