UNPKG

@sjsf/daisyui5-theme

Version:

The daisyUI v5 based theme for svelte-jsonschema-form

38 lines (37 loc) 1.42 kB
import type { ClassValue, HTMLButtonAttributes } from 'svelte/elements'; import type { CalendarRangeProps, CalendarMonthProps, CalendarDateProps } from 'cally'; import type { WidgetCommonProps } from '@sjsf/form/fields/widgets'; type MapEvents<T> = { [K in keyof T as K extends `on${infer E}` ? `on:${Lowercase<E>}` : K]: T[K]; }; export type CalendarProps = MapEvents<CalendarDateProps> & { class?: ClassValue | null; placeholder?: string; }; declare module 'svelte/elements' { interface SvelteHTMLElements { 'calendar-range': MapEvents<CalendarRangeProps>; 'calendar-month': MapEvents<CalendarMonthProps>; 'calendar-date': CalendarProps; } interface SVGAttributes<T extends EventTarget> { slot?: string | null; } } declare module '@sjsf/form' { interface ComponentProps { daisyui5CallyDatePickerWidget: WidgetCommonProps<string>; } interface ComponentBindings { daisyui5CallyDatePickerWidget: 'value'; } interface UiOptions { daisyui5CallyCalendarDateFormatter?: (date: string) => string; daisyui5CallyCalendarTrigger?: HTMLButtonAttributes; daisyui5CallyCalendar?: CalendarProps; } } import 'cally'; declare const CallyDatePicker: import("svelte").Component<WidgetCommonProps<string>, {}, "value">; type CallyDatePicker = ReturnType<typeof CallyDatePicker>; export default CallyDatePicker;