pf-common-components 1.0.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/components.json +17 -0
- package/dist/assets/Arrow.d.ts +7 -0
- package/dist/assets/Arrow.js +5 -0
- package/dist/assets/CalenderIcon.d.ts +2 -0
- package/dist/assets/CalenderIcon.js +5 -0
- package/dist/assets/ClearAll.d.ts +2 -0
- package/dist/assets/ClearAll.js +5 -0
- package/dist/assets/CrossIcon.d.ts +8 -0
- package/dist/assets/CrossIcon.js +7 -0
- package/dist/assets/DropDown.d.ts +4 -0
- package/dist/assets/DropDown.js +5 -0
- package/dist/global.css +3213 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +25 -0
- package/dist/lib/CommonComponentsUtil.d.ts +7 -0
- package/dist/lib/CommonComponentsUtil.js +22 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/ui/BaseTable.d.ts +132 -0
- package/dist/ui/BaseTable.js +330 -0
- package/dist/ui/DateCalendar.d.ts +10 -0
- package/dist/ui/DateCalendar.js +47 -0
- package/dist/ui/DateField.d.ts +35 -0
- package/dist/ui/DateField.js +37 -0
- package/dist/ui/DateOfBirthSelector.d.ts +16 -0
- package/dist/ui/DateOfBirthSelector.js +42 -0
- package/dist/ui/DateRangePicker.d.ts +8 -0
- package/dist/ui/DateRangePicker.js +73 -0
- package/dist/ui/DobCalendar.d.ts +17 -0
- package/dist/ui/DobCalendar.js +86 -0
- package/dist/ui/Formfield.d.ts +12 -0
- package/dist/ui/Formfield.js +36 -0
- package/dist/ui/GetScrollAlert.d.ts +9 -0
- package/dist/ui/GetScrollAlert.js +37 -0
- package/dist/ui/RadioGroupContext/RadioGroupContext.d.ts +8 -0
- package/dist/ui/RadioGroupContext/RadioGroupContext.js +11 -0
- package/dist/ui/SelectCommand.d.ts +69 -0
- package/dist/ui/SelectCommand.js +260 -0
- package/dist/ui/SlashIcon.d.ts +2 -0
- package/dist/ui/SlashIcon.js +5 -0
- package/dist/ui/SortingArrows.d.ts +11 -0
- package/dist/ui/SortingArrows.js +11 -0
- package/dist/ui/TextTags.d.ts +39 -0
- package/dist/ui/TextTags.js +73 -0
- package/dist/ui/accordion.d.ts +10 -0
- package/dist/ui/accordion.js +77 -0
- package/dist/ui/alert-dialog.d.ts +20 -0
- package/dist/ui/alert-dialog.js +62 -0
- package/dist/ui/alert.d.ts +8 -0
- package/dist/ui/alert.js +42 -0
- package/dist/ui/avatar.d.ts +6 -0
- package/dist/ui/avatar.js +32 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.js +58 -0
- package/dist/ui/button.d.ts +12 -0
- package/dist/ui/button.js +54 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +45 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.js +45 -0
- package/dist/ui/checkbox.d.ts +12 -0
- package/dist/ui/checkbox.js +44 -0
- package/dist/ui/command.d.ts +47 -0
- package/dist/ui/command.js +67 -0
- package/dist/ui/dialog.d.ts +31 -0
- package/dist/ui/dialog.js +57 -0
- package/dist/ui/dropdown-menu.d.ts +27 -0
- package/dist/ui/dropdown-menu.js +72 -0
- package/dist/ui/form.d.ts +23 -0
- package/dist/ui/form.js +72 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.js +29 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +20 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.js +24 -0
- package/dist/ui/multi-select.d.ts +44 -0
- package/dist/ui/multi-select.js +191 -0
- package/dist/ui/navigation-menu.d.ts +11 -0
- package/dist/ui/navigation-menu.js +69 -0
- package/dist/ui/popover.d.ts +6 -0
- package/dist/ui/popover.js +24 -0
- package/dist/ui/radio-group.d.ts +7 -0
- package/dist/ui/radio-group.js +40 -0
- package/dist/ui/radioButtonCard.d.ts +9 -0
- package/dist/ui/radioButtonCard.js +23 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +29 -0
- package/dist/ui/select.d.ts +57 -0
- package/dist/ui/select.js +148 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +22 -0
- package/dist/ui/sheet.d.ts +25 -0
- package/dist/ui/sheet.js +65 -0
- package/dist/ui/switch.d.ts +10 -0
- package/dist/ui/switch.js +47 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +55 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +33 -0
- package/dist/ui/text.d.ts +11 -0
- package/dist/ui/text.js +45 -0
- package/dist/ui/textarea.d.ts +7 -0
- package/dist/ui/textarea.js +21 -0
- package/dist/ui/tooltip.d.ts +11 -0
- package/dist/ui/tooltip.js +26 -0
- package/package.json +123 -0
- package/postcss.config.js +6 -0
- package/src/assets/Arrow.js +5 -0
- package/src/assets/Arrow.tsx +25 -0
- package/src/assets/CalenderIcon.js +5 -0
- package/src/assets/CalenderIcon.tsx +28 -0
- package/src/assets/ClearAll.js +5 -0
- package/src/assets/ClearAll.tsx +20 -0
- package/src/assets/CrossIcon.js +7 -0
- package/src/assets/CrossIcon.tsx +34 -0
- package/src/assets/DropDown.js +5 -0
- package/src/assets/DropDown.tsx +23 -0
- package/src/global.css +560 -0
- package/src/index.ts +34 -0
- package/src/lib/CommonComponentsUtil.js +22 -0
- package/src/lib/CommonComponentsUtil.ts +30 -0
- package/src/lib/utils.js +5 -0
- package/src/lib/utils.ts +6 -0
- package/src/ui/BaseTable.js +330 -0
- package/src/ui/BaseTable.tsx +987 -0
- package/src/ui/DateCalendar.js +47 -0
- package/src/ui/DateCalendar.tsx +111 -0
- package/src/ui/DateField.js +37 -0
- package/src/ui/DateField.tsx +142 -0
- package/src/ui/DateOfBirthSelector.js +42 -0
- package/src/ui/DateOfBirthSelector.tsx +114 -0
- package/src/ui/DateRangePicker.js +73 -0
- package/src/ui/DateRangePicker.tsx +174 -0
- package/src/ui/DobCalendar.js +86 -0
- package/src/ui/DobCalendar.tsx +172 -0
- package/src/ui/Formfield.js +36 -0
- package/src/ui/Formfield.tsx +55 -0
- package/src/ui/GetScrollAlert.js +37 -0
- package/src/ui/GetScrollAlert.tsx +59 -0
- package/src/ui/RadioGroupContext/RadioGroupContext.js +11 -0
- package/src/ui/RadioGroupContext/RadioGroupContext.tsx +21 -0
- package/src/ui/SelectCommand.js +260 -0
- package/src/ui/SelectCommand.tsx +587 -0
- package/src/ui/SlashIcon.js +5 -0
- package/src/ui/SlashIcon.tsx +22 -0
- package/src/ui/SortingArrows.js +11 -0
- package/src/ui/SortingArrows.tsx +29 -0
- package/src/ui/TextTags.js +73 -0
- package/src/ui/TextTags.tsx +149 -0
- package/src/ui/accordion.js +77 -0
- package/src/ui/accordion.tsx +129 -0
- package/src/ui/alert-dialog.js +62 -0
- package/src/ui/alert-dialog.tsx +141 -0
- package/src/ui/alert.js +42 -0
- package/src/ui/alert.tsx +59 -0
- package/src/ui/avatar.js +32 -0
- package/src/ui/avatar.tsx +50 -0
- package/src/ui/badge.js +58 -0
- package/src/ui/badge.tsx +66 -0
- package/src/ui/button.js +54 -0
- package/src/ui/button.tsx +89 -0
- package/src/ui/calendar.js +45 -0
- package/src/ui/calendar.tsx +88 -0
- package/src/ui/card.js +45 -0
- package/src/ui/card.tsx +83 -0
- package/src/ui/checkbox.js +44 -0
- package/src/ui/checkbox.tsx +56 -0
- package/src/ui/command.js +67 -0
- package/src/ui/command.tsx +166 -0
- package/src/ui/dialog.js +57 -0
- package/src/ui/dialog.tsx +154 -0
- package/src/ui/dropdown-menu.js +72 -0
- package/src/ui/dropdown-menu.tsx +200 -0
- package/src/ui/form.js +72 -0
- package/src/ui/form.tsx +177 -0
- package/src/ui/hover-card.js +29 -0
- package/src/ui/hover-card.tsx +63 -0
- package/src/ui/input.js +20 -0
- package/src/ui/input.tsx +22 -0
- package/src/ui/label.js +24 -0
- package/src/ui/label.tsx +26 -0
- package/src/ui/multi-select.js +191 -0
- package/src/ui/multi-select.tsx +518 -0
- package/src/ui/navigation-menu.js +69 -0
- package/src/ui/navigation-menu.tsx +139 -0
- package/src/ui/popover.js +24 -0
- package/src/ui/popover.tsx +31 -0
- package/src/ui/radio-group.js +40 -0
- package/src/ui/radio-group.tsx +97 -0
- package/src/ui/radioButtonCard.js +23 -0
- package/src/ui/radioButtonCard.tsx +57 -0
- package/src/ui/scroll-area.js +29 -0
- package/src/ui/scroll-area.tsx +48 -0
- package/src/ui/select.js +148 -0
- package/src/ui/select.tsx +343 -0
- package/src/ui/separator.js +22 -0
- package/src/ui/separator.tsx +31 -0
- package/src/ui/sheet.js +65 -0
- package/src/ui/sheet.tsx +136 -0
- package/src/ui/switch.js +47 -0
- package/src/ui/switch.tsx +60 -0
- package/src/ui/table.js +55 -0
- package/src/ui/table.tsx +112 -0
- package/src/ui/tabs.js +33 -0
- package/src/ui/tabs.tsx +55 -0
- package/src/ui/text.js +45 -0
- package/src/ui/text.tsx +49 -0
- package/src/ui/textarea.js +21 -0
- package/src/ui/textarea.tsx +28 -0
- package/src/ui/tooltip.js +26 -0
- package/src/ui/tooltip.tsx +54 -0
- package/tailwind.config.js +214 -0
- package/tsconfig.json +35 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface DateFieldProps {
|
|
3
|
+
/**
|
|
4
|
+
* The selected date to be displayed in the calendar.
|
|
5
|
+
*/
|
|
6
|
+
value?: Date;
|
|
7
|
+
/**
|
|
8
|
+
* Function to set the selected date.
|
|
9
|
+
* @param value - The date to set as the selected date.
|
|
10
|
+
*/
|
|
11
|
+
onChange: (value: Date) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Placeholder text to display when no date is selected.
|
|
14
|
+
*/
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/**
|
|
17
|
+
* className to change stylings of the calendar.
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
fromDate?: Date;
|
|
22
|
+
toDate?: Date;
|
|
23
|
+
/**
|
|
24
|
+
* This is to define the format to be displayed in input when we select the date
|
|
25
|
+
*/
|
|
26
|
+
formatType?: string;
|
|
27
|
+
/**
|
|
28
|
+
* If error is true, then make border will be red
|
|
29
|
+
*/
|
|
30
|
+
error?: boolean;
|
|
31
|
+
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
32
|
+
onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const DateField: ({ value, onChange, placeholder, className, disabled, fromDate, toDate, error, formatType, onBlur, onFocus, }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import CalenderIcon from "../assets/CalenderIcon";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { Button, buttonVariants } from "./button";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
7
|
+
import dayjs from "dayjs";
|
|
8
|
+
import { DateRangePicker } from "./DateRangePicker";
|
|
9
|
+
export const DateField = ({ value, onChange, placeholder, className, disabled, fromDate, toDate, error = false, formatType = "DD MMM, YYYY", onBlur, onFocus, }) => {
|
|
10
|
+
// State to manage the visibility of the popover
|
|
11
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
12
|
+
const fromYear = fromDate ? fromDate.getFullYear() : 1900;
|
|
13
|
+
const toYear = toDate ? toDate.getFullYear() : 2030;
|
|
14
|
+
/**
|
|
15
|
+
* Function to handle the selected date
|
|
16
|
+
*/
|
|
17
|
+
const handleSelectDate = (value) => {
|
|
18
|
+
if (value)
|
|
19
|
+
onChange(value);
|
|
20
|
+
setIsOpen(false);
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs(Popover, Object.assign({ open: isOpen, onOpenChange: setIsOpen }, { children: [_jsx(PopoverTrigger, Object.assign({ asChild: true }, { children: _jsxs(Button, Object.assign({ variant: "outline", className: cn(`flex flex-row justify-start gap-2 px-3`, error && "border border-red", className, value ? "text-grey" : "font-normal text-grey2"), onClick: () => setIsOpen(!isOpen), disabled: disabled ? true : false, onBlur: onBlur, onFocus: onFocus }, { children: [_jsx(CalenderIcon, { color: "#666666", className: "mr-2 h-4 w-4" }), value ? (_jsx("div", Object.assign({ className: "capitalize" }, { children: value && dayjs(value).format(formatType) }))) : (_jsx("span", { children: placeholder ? placeholder : "Pick a date" }))] })) })), _jsx(PopoverContent, Object.assign({ className: "w-[320px] rounded-3xl p-0" }, { children: _jsx(DateRangePicker, { mode: "single", selected: value, onSelect: (val) => {
|
|
23
|
+
handleSelectDate(val);
|
|
24
|
+
}, captionLayout: "dropdown-buttons", fromYear: fromYear, toYear: toYear, fromDate: fromDate, toDate: toDate, yearMonthDropdownClassName: "!w-[80px]", classNames: {
|
|
25
|
+
month: "border-none border border-stroke min-w-[320px] rounded-3xl",
|
|
26
|
+
cell: "h-10 w-10 text-center rounded-full text-xs p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-primary [&:has([aria-selected])]:bg-primary-light first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 flex justify-center items-center",
|
|
27
|
+
day: cn(buttonVariants({ variant: "ghost" }), "h-10 w-10 text-xs px-2 !rounded-full text-grey font-semibold aria-selected:opacity-100"),
|
|
28
|
+
head_cell: "text-grey2 rounded-md w-10 font-normal text-xs",
|
|
29
|
+
head_row: "flex capitalize text-grey2 items-center justify-center text-xs h-[44px]",
|
|
30
|
+
nav_button: cn(buttonVariants({ variant: "outline" }), "h-8 w-8 p-2 border border-grey-light-hover"),
|
|
31
|
+
table: "w-full border-collapse space-y-2 min-h-[250px]",
|
|
32
|
+
}, disabled: (date) => {
|
|
33
|
+
const isAfterDisableDate = toDate ? date > toDate : false;
|
|
34
|
+
const isBeforeEnableDate = fromDate ? date < fromDate : false;
|
|
35
|
+
return isAfterDisableDate || isBeforeEnableDate;
|
|
36
|
+
}, defaultMonth: value }) }))] })));
|
|
37
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the function of complete date picker,Which contains a button and a calendar
|
|
3
|
+
* @returns complete date picker
|
|
4
|
+
*/
|
|
5
|
+
export declare function DateOfBirthSelector({ onChange, value, onBlur, onFocus, error, className, placeholder, fromDate, toDate, disabled, }: {
|
|
6
|
+
onChange: any;
|
|
7
|
+
value: any;
|
|
8
|
+
onBlur?: any;
|
|
9
|
+
onFocus?: any;
|
|
10
|
+
error?: any;
|
|
11
|
+
className?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
fromDate: Date;
|
|
14
|
+
toDate: Date;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { format } from "date-fns";
|
|
3
|
+
import { useTranslation } from "next-i18next";
|
|
4
|
+
import CalenderIcon from "../assets/CalenderIcon";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { Button } from "./button";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
8
|
+
import { cn } from "../lib/utils";
|
|
9
|
+
import { Calendar } from "./DobCalendar";
|
|
10
|
+
/**
|
|
11
|
+
* This is the function of complete date picker,Which contains a button and a calendar
|
|
12
|
+
* @returns complete date picker
|
|
13
|
+
*/
|
|
14
|
+
export function DateOfBirthSelector({ onChange, value, onBlur, onFocus, error, className, placeholder, fromDate, toDate, disabled, }) {
|
|
15
|
+
const { t } = useTranslation("common");
|
|
16
|
+
const [date, setDate] = React.useState(value);
|
|
17
|
+
const [calendarOpen, setCalendarOpen] = React.useState(false);
|
|
18
|
+
const thisYear = new Date().getFullYear(); //present year
|
|
19
|
+
const handleDateChange = (newDate) => {
|
|
20
|
+
setDate(newDate);
|
|
21
|
+
if (newDate)
|
|
22
|
+
onChange(format(newDate, "yyyy/MM/dd"));
|
|
23
|
+
else
|
|
24
|
+
onChange("");
|
|
25
|
+
setCalendarOpen(false);
|
|
26
|
+
};
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
setDate(value ? new Date(value) : value);
|
|
29
|
+
}, [value]);
|
|
30
|
+
return (_jsxs(Popover, Object.assign({ open: disabled ? false : calendarOpen, onOpenChange: setCalendarOpen }, { children: [_jsx(PopoverTrigger, Object.assign({ asChild: true }, { children: _jsxs(Button, Object.assign({ className: cn("border border-input bg-[white] text-left font-normal sm:h-[40px] sm:w-full", className, error && "border-[#FF6D6D]", disabled && "cursor-not-allowed"), onBlur: onBlur, onFocus: onFocus }, { children: [_jsx("div", Object.assign({ className: `flex w-full flex-col ${date ? "text-[#333333]" : "text-[#999999]"}` }, { children: date ? format(date, "dd-MM-yyyy") : placeholder })), _jsx("div", { children: _jsx(CalenderIcon, { color: "#666666", className: "mr-2 h-4 w-4" }) })] })) })), _jsx(PopoverContent, Object.assign({ align: "center", className: "h-auto w-[270px] rounded-[21px] border-[#D7D7D7] p-0" }, { children: _jsx(Calendar, { mode: "single" // Here single mode represents that we can pick a single date from calendar
|
|
31
|
+
, captionLayout: "dropdown-buttons" //The calendar contains both dropdowns of months, years and previous, next buttons
|
|
32
|
+
, selected: date, showOutsideDays: false, weekStartsOn: 1, onSelect: handleDateChange, fromDate: fromDate, toDate: toDate, disabled: (date) => {
|
|
33
|
+
const todayDate = new Date();
|
|
34
|
+
todayDate.setHours(0, 0, 0, 0);
|
|
35
|
+
const selectDate = new Date(date);
|
|
36
|
+
return fromDate && toDate
|
|
37
|
+
? false
|
|
38
|
+
: fromDate
|
|
39
|
+
? selectDate < todayDate
|
|
40
|
+
: selectDate > todayDate;
|
|
41
|
+
}, defaultMonth: date }) }))] })));
|
|
42
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DayPicker } from "react-day-picker";
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
export type ExtendedCalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
5
|
+
yearMonthDropdownClassName?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare function DateRangePicker({ className, classNames, showOutsideDays, yearMonthDropdownClassName, ...props }: ExtendedCalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { DateRangePicker };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { DayPicker } from "react-day-picker";
|
|
16
|
+
import { cn } from "../lib/utils";
|
|
17
|
+
import { buttonVariants } from "./button";
|
|
18
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "./select";
|
|
19
|
+
import { useState } from "react";
|
|
20
|
+
import dayjs from "dayjs";
|
|
21
|
+
import * as loc from "date-fns/locale";
|
|
22
|
+
function DateRangePicker(_a) {
|
|
23
|
+
var { className, classNames, showOutsideDays = false, yearMonthDropdownClassName } = _a, props = __rest(_a, ["className", "classNames", "showOutsideDays", "yearMonthDropdownClassName"]);
|
|
24
|
+
const handleCalendarChange = (_value, _e) => {
|
|
25
|
+
const _event = {
|
|
26
|
+
target: {
|
|
27
|
+
value: String(_value),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
_e(_event);
|
|
31
|
+
};
|
|
32
|
+
const languageCode = 'en';
|
|
33
|
+
const locale = languageCode === "en"
|
|
34
|
+
? loc["enUS"]
|
|
35
|
+
: Object.values(loc).find((language) => language.code === languageCode);
|
|
36
|
+
return (_jsx(DayPicker, Object.assign({ locale: locale, formatters: {
|
|
37
|
+
formatWeekdayName: (date, options) => {
|
|
38
|
+
return dayjs(date).format("ddd");
|
|
39
|
+
},
|
|
40
|
+
}, showOutsideDays: showOutsideDays, className: cn("", className), classNames: Object.assign({ months: "flex flex-col justify-center sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0", month: "space-y-4 border border-stroke min-w-[374px] rounded-3xl", caption: "flex flex-row relative items-center border-b border-grey-light-hover h-[60px]", caption_dropdowns: "flex flex-row-reverse justify-center gap-2 grow dropdowns", nav: "space-x-1 flex items-center", nav_button: cn(buttonVariants({ variant: "outline" }), "h-8 w-8 p-2 border border-grey-light-hover"), nav_button_previous: "absolute left-5 !text-grey1 w-6 h-6", nav_button_next: "absolute right-5 !text-grey1 w-6 h-6", table: "w-full border-collapse space-y-2 min-h-[284px]", head_row: "flex capitalize gap-6 text-grey2 items-center justify-center text-xs h-[44px]", head_cell: "text-grey2 rounded-md w-6 font-normal text-xs", row: "flex flex-row w-full px-4", cell: "h-11 w-12 text-center text-xs p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-primary [&:has([aria-selected])]:bg-primary-light first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 flex justify-center items-center", day: cn(buttonVariants({ variant: "ghost" }), "h-11 w-12 text-xs !rounded-full text-grey font-semibold aria-selected:opacity-100"), day_range_end: "day-range-end", day_selected: "aria-selected:bg-primary text-white hover:bg-primary focus:bg-primary focus:text-white hover:text-white", day_today: "bg-primary-light text-accent-foreground", day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-primary aria-selected:text-muted-foreground aria-selected:opacity-30", day_disabled: "text-muted-foreground opacity-50", day_range_middle: "aria-selected:bg-primary-light aria-selected:text-accent-foreground", day_hidden: "invisible" }, classNames), components: {
|
|
41
|
+
// IconLeft: ({ ...props }) => <ChevronLeft className="h-5 !w-6" />,
|
|
42
|
+
// IconRight: ({ ...props }) => <ChevronRight className="h-5 !w-6" />,
|
|
43
|
+
Dropdown: (_a) => {
|
|
44
|
+
var props = __rest(_a, []);
|
|
45
|
+
const [selectedValue, setSelectedValue] = useState(props.value);
|
|
46
|
+
const handleValueChange = (value) => {
|
|
47
|
+
setSelectedValue(value);
|
|
48
|
+
if (props.onChange) {
|
|
49
|
+
handleCalendarChange(value, props.onChange);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const selectedYearOrMOnth = (props === null || props === void 0 ? void 0 : props.name) == "months"
|
|
53
|
+
? dayjs()
|
|
54
|
+
.month(props.value)
|
|
55
|
+
.format("MMM")
|
|
56
|
+
: props === null || props === void 0 ? void 0 : props.caption;
|
|
57
|
+
return (_jsx("div", Object.assign({ className: "dropdowns-dob" }, { children: _jsxs(Select, Object.assign({}, props, { onValueChange: (value) => {
|
|
58
|
+
handleValueChange(value);
|
|
59
|
+
}, value: selectedValue !== null && selectedValue !== void 0 ? selectedValue : props.value }, { children: [_jsx(SelectTrigger, Object.assign({ className: cn(`${yearMonthDropdownClassName} h-10 w-[105px] rounded-xl font-medium capitalize [.is-between_&]:hidden [.is-end_&]:hidden [.is-start.is-end_&]:flex`) }, { children: _jsx(SelectValue, Object.assign({ placeholder: selectedYearOrMOnth, className: "capitalize" }, { children: selectedYearOrMOnth })) })), _jsx(SelectContent, Object.assign({ className: "max-h-[269px] min-w-[109px] p-1" }, { children: _jsx("div", Object.assign({ className: "scrollbar max-h-[var(--radix-popper-available-height);] overflow-y-auto capitalize" }, { children: props.children &&
|
|
60
|
+
React.Children.map(props.children, (child) => {
|
|
61
|
+
var _a, _b, _c;
|
|
62
|
+
return (_jsx(SelectItem, Object.assign({ value: (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.value, className: cn({
|
|
63
|
+
"bg-[#7677F4]/10 capitalize text-[#7677F4] hover:!bg-[#7677F4]/10": selectedValue ===
|
|
64
|
+
((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.value),
|
|
65
|
+
}) }, { children: (_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.children })));
|
|
66
|
+
}) })) }))] })) })));
|
|
67
|
+
},
|
|
68
|
+
CaptionLabel: () => {
|
|
69
|
+
return null;
|
|
70
|
+
},
|
|
71
|
+
} }, props)));
|
|
72
|
+
}
|
|
73
|
+
export { DateRangePicker };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DayPicker, DropdownProps } from "react-day-picker";
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
/**
|
|
5
|
+
* This is the function,contains a select dropdowns of list of months and year, a previous and next buttons
|
|
6
|
+
* @param showOutsideDays boolean which represents whether to show outside month days or not
|
|
7
|
+
* @param formatters represents format of displaying the week days
|
|
8
|
+
* @param classnames represents the stylings of complete calendar
|
|
9
|
+
* @param components we can add extra components if needed into the calender
|
|
10
|
+
* @returns the calender to select the date with month and year dropdowns
|
|
11
|
+
*/
|
|
12
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare namespace Calendar {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const YearsAndMonthsDropdown: ({ value, onChange, children, ...props }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { Calendar };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import classNames from "classnames";
|
|
14
|
+
import dayjs from "dayjs";
|
|
15
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
16
|
+
import * as React from "react";
|
|
17
|
+
import { DayPicker, } from "react-day-picker";
|
|
18
|
+
import { buttonVariants } from "./button";
|
|
19
|
+
import * as loc from "date-fns/locale";
|
|
20
|
+
import { Select, SelectContent, SelectItem, SelectItems, SelectTrigger, SelectValue, } from "./select";
|
|
21
|
+
import { cn } from "../lib/utils";
|
|
22
|
+
/**
|
|
23
|
+
* This is the function,contains a select dropdowns of list of months and year, a previous and next buttons
|
|
24
|
+
* @param showOutsideDays boolean which represents whether to show outside month days or not
|
|
25
|
+
* @param formatters represents format of displaying the week days
|
|
26
|
+
* @param classnames represents the stylings of complete calendar
|
|
27
|
+
* @param components we can add extra components if needed into the calender
|
|
28
|
+
* @returns the calender to select the date with month and year dropdowns
|
|
29
|
+
*/
|
|
30
|
+
function Calendar(_a) {
|
|
31
|
+
var { className, classNames, showOutsideDays = true } = _a, props = __rest(_a, ["className", "classNames", "showOutsideDays"]);
|
|
32
|
+
const languageCode = 'en';
|
|
33
|
+
const localeObject = languageCode === "en"
|
|
34
|
+
? loc["enUS"]
|
|
35
|
+
: Object.values(loc).find((language) => language.code === languageCode);
|
|
36
|
+
const formatWeekdayName = (date) => {
|
|
37
|
+
return dayjs(date).format("ddd").charAt(0);
|
|
38
|
+
};
|
|
39
|
+
const handleDayKeyDown = (day, modifiers, event) => {
|
|
40
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
const customEvent = new MouseEvent("click", {
|
|
43
|
+
bubbles: true,
|
|
44
|
+
cancelable: true,
|
|
45
|
+
view: window,
|
|
46
|
+
});
|
|
47
|
+
const dayElement = event.target;
|
|
48
|
+
dayElement.dispatchEvent(customEvent);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return (_jsx(DayPicker, Object.assign({ locale: localeObject, showOutsideDays: showOutsideDays, className: cn("p-3", className), formatters: { formatWeekdayName }, classNames: Object.assign({ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0", month: "space-y-4", caption: "flex justify-center relative items-center", caption_label: "hidden", caption_dropdowns: "flex justify-center gap-2", nav: "space-x-1 flex items-center", nav_button: cn(buttonVariants({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-100 !size-[30px] border rounded-[10px]"), nav_button_previous: "absolute left-1", nav_button_next: "absolute right-1", table: "w-full border-collapse space-y-1", head_row: "flex w-1 gap-[25px] px-3 ", head_cell: "text-foreground rounded-full w-9 font-semibold text-sm", cell: "h-9 w-9 text-center text-sm !rounded-full p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20", day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100 hover:bg-accent disabled:bg-transparent rounded-full"), day_selected: "!bg-primary !rounded-full !size-[33px] text-white hover:!bg-primary", day_today: "bg-accent text-accent-foreground !rounded-full !size-[33px] " }, classNames), components: {
|
|
52
|
+
Dropdown: (_a) => {
|
|
53
|
+
var { value, onChange, children } = _a, props = __rest(_a, ["value", "onChange", "children"]);
|
|
54
|
+
return (_jsx(YearsAndMonthsDropdown, Object.assign({}, props, { value: value, onChange: onChange }, { children: children })));
|
|
55
|
+
},
|
|
56
|
+
IconLeft: () => _jsx(ChevronLeft, { className: "size-4 text-foreground" }),
|
|
57
|
+
IconRight: () => _jsx(ChevronRight, { className: "size-4 text-foreground" }),
|
|
58
|
+
}, onDayKeyDown: handleDayKeyDown }, props)));
|
|
59
|
+
}
|
|
60
|
+
Calendar.displayName = "Calendar";
|
|
61
|
+
export const YearsAndMonthsDropdown = (_a) => {
|
|
62
|
+
var _b, _c, _d, _e;
|
|
63
|
+
var { value, onChange, children } = _a, props = __rest(_a, ["value", "onChange", "children"]);
|
|
64
|
+
const selectClasses = classNames("pr-1.5 h-[30px] text-sm font-semibold focus:border-transparent focus:bg-primary/10 focus:text-primary outline-none border-secondary/20 text-foreground", {
|
|
65
|
+
"rounded-l-[10px] rounded-r-none": (props === null || props === void 0 ? void 0 : props.name) === "months",
|
|
66
|
+
}, { "rounded-l-none rounded-r-[10px]": (props === null || props === void 0 ? void 0 : props.name) === "years" });
|
|
67
|
+
const options = React.Children.toArray(children);
|
|
68
|
+
const selected = options.find((child) => child.props.value === value);
|
|
69
|
+
const handleChange = (value) => {
|
|
70
|
+
const changeEvent = {
|
|
71
|
+
target: { value },
|
|
72
|
+
};
|
|
73
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(changeEvent);
|
|
74
|
+
};
|
|
75
|
+
return (_jsx("div", Object.assign({ className: "border-1 rounded-lg border" }, { children: _jsxs(Select, Object.assign({ value: value === null || value === void 0 ? void 0 : value.toString(), onValueChange: (value) => {
|
|
76
|
+
handleChange(value);
|
|
77
|
+
} }, { children: [_jsx(SelectTrigger, Object.assign({ className: selectClasses }, { children: _jsx(SelectValue, { children: props.name === "months"
|
|
78
|
+
? (_c = (_b = selected === null || selected === void 0 ? void 0 : selected.props) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c.toString().substring(0, 3)
|
|
79
|
+
: (_e = (_d = selected === null || selected === void 0 ? void 0 : selected.props) === null || _d === void 0 ? void 0 : _d.children) === null || _e === void 0 ? void 0 : _e.toString() }) })), _jsx(SelectContent, Object.assign({ position: "popper", className: "scrollbar max-h-[400px] max-h-[var(--radix-popper-available-height);] overflow-y-auto capitalize" }, { children: _jsx(SelectItems, { children: options.map((option, id) => {
|
|
80
|
+
var _a, _b, _c, _d;
|
|
81
|
+
return (_jsx(SelectItem, Object.assign({ value: (_b = (_a = option.props.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "" }, { children: props.name === "months"
|
|
82
|
+
? (_c = option.props.children) === null || _c === void 0 ? void 0 : _c.toString().substring(0, 3)
|
|
83
|
+
: (_d = option.props.children) === null || _d === void 0 ? void 0 : _d.toString() }), `${option.props.value}-${id}`));
|
|
84
|
+
}) }) }))] })) })));
|
|
85
|
+
};
|
|
86
|
+
export { Calendar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { ZodSchema } from "zod";
|
|
3
|
+
interface FormProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onSubmit: (data: any) => void;
|
|
6
|
+
defaultValues?: Record<string, any>;
|
|
7
|
+
schema?: ZodSchema<any, any, any>;
|
|
8
|
+
mode?: "all" | "onBlur" | "onChange" | "onSubmit" | "onTouched" | undefined;
|
|
9
|
+
useFormMethodsRef?: React.MutableRefObject<any>;
|
|
10
|
+
}
|
|
11
|
+
declare const Form: React.FC<FormProps>;
|
|
12
|
+
export default Form;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
14
|
+
import { useEffect } from "react";
|
|
15
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
const Form = (_a) => {
|
|
18
|
+
var { children, onSubmit, schema = z.object({}), defaultValues, mode = "all", useFormMethodsRef } = _a, props = __rest(_a, ["children", "onSubmit", "schema", "defaultValues", "mode", "useFormMethodsRef"]);
|
|
19
|
+
const methods = useForm({
|
|
20
|
+
resolver: zodResolver(schema),
|
|
21
|
+
mode: mode,
|
|
22
|
+
defaultValues,
|
|
23
|
+
});
|
|
24
|
+
if (useFormMethodsRef)
|
|
25
|
+
useFormMethodsRef.current = methods;
|
|
26
|
+
const { handleSubmit, watch } = methods;
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
watch();
|
|
29
|
+
}, [watch]);
|
|
30
|
+
const checkKeyDown = (e) => {
|
|
31
|
+
if (e.key === "Enter")
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
};
|
|
34
|
+
return (_jsx(FormProvider, Object.assign({}, methods, { children: _jsx("form", Object.assign({ onSubmit: onSubmit != undefined ? handleSubmit(onSubmit) : () => { }, onKeyDown: (e) => checkKeyDown(e) }, props, { children: children })) })));
|
|
35
|
+
};
|
|
36
|
+
export default Form;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface GetScrollTypesAlertProps {
|
|
3
|
+
id: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
onBottom: () => void;
|
|
6
|
+
onTop?: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const GetScrollTypesAlert: React.FC<GetScrollTypesAlertProps>;
|
|
9
|
+
export default GetScrollTypesAlert;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { debounce } from "lodash";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
const GetScrollTypesAlert = ({ id, children, onBottom, onTop, }) => {
|
|
5
|
+
const [onBottomReach, setOnBottomReach] = useState(false);
|
|
6
|
+
const [onTopReach, setOnTopReach] = useState(false);
|
|
7
|
+
const handleScroll = debounce(() => {
|
|
8
|
+
let scrollContainer = document.getElementById(id);
|
|
9
|
+
const scrollDifferenceTop = Math.abs((scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTop) || 0);
|
|
10
|
+
const scrollDifferenceBottom = Math.abs(((scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollHeight) || 0) -
|
|
11
|
+
((scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTop) || 0) -
|
|
12
|
+
((scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.clientHeight) || 0));
|
|
13
|
+
if (scrollDifferenceBottom <= 2) {
|
|
14
|
+
onBottom();
|
|
15
|
+
setOnBottomReach(true);
|
|
16
|
+
}
|
|
17
|
+
else if (onTop && scrollDifferenceTop <= 2) {
|
|
18
|
+
onTop();
|
|
19
|
+
setOnTopReach(true);
|
|
20
|
+
}
|
|
21
|
+
}, 100); // Adjust the debounce delay as needed
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
let scrollContainer = document.getElementById(id);
|
|
24
|
+
if (scrollContainer) {
|
|
25
|
+
scrollContainer.addEventListener("scroll", handleScroll);
|
|
26
|
+
}
|
|
27
|
+
return () => {
|
|
28
|
+
setOnBottomReach(false);
|
|
29
|
+
setOnTopReach(false);
|
|
30
|
+
if (scrollContainer) {
|
|
31
|
+
scrollContainer.removeEventListener("scroll", handleScroll);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, [onBottomReach, onTopReach, id, handleScroll]);
|
|
35
|
+
return _jsx("div", { children: children });
|
|
36
|
+
};
|
|
37
|
+
export default GetScrollTypesAlert;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RadioGroupContextType {
|
|
3
|
+
value?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const RadioGroupContext: import("react").Context<RadioGroupContextType | undefined>;
|
|
7
|
+
export declare const useRadioGroupContext: () => RadioGroupContextType;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
// Create the context
|
|
3
|
+
export const RadioGroupContext = createContext(undefined);
|
|
4
|
+
// Custom hook to use the context
|
|
5
|
+
export const useRadioGroupContext = () => {
|
|
6
|
+
const context = useContext(RadioGroupContext);
|
|
7
|
+
if (context === undefined) {
|
|
8
|
+
throw new Error("useRadioGroupContext must be used within a MyProvider");
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
11
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const MVPSelect: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverProps & {
|
|
4
|
+
value?: any;
|
|
5
|
+
onChange?: ((value: string) => void) | undefined;
|
|
6
|
+
isFiltering?: boolean | undefined;
|
|
7
|
+
isLoading?: boolean | undefined;
|
|
8
|
+
defaultOptions?: any;
|
|
9
|
+
secured?: boolean | undefined;
|
|
10
|
+
showSeparator?: boolean | undefined;
|
|
11
|
+
} & React.RefAttributes<never>>;
|
|
12
|
+
declare const MVPSelectTrigger: React.ForwardRefExoticComponent<{
|
|
13
|
+
placeholder: string;
|
|
14
|
+
error?: boolean | undefined;
|
|
15
|
+
disable?: boolean | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
crossIcon?: boolean | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* endIcon is optional Field, so that any one can send the component whatever they want to show beside the cross icon
|
|
20
|
+
*/
|
|
21
|
+
endIcon?: React.ReactNode;
|
|
22
|
+
} & Omit<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
declare const MVPSelectContent: React.ForwardRefExoticComponent<Omit<{
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
} & React.HTMLAttributes<HTMLDivElement> & {
|
|
26
|
+
label?: string | undefined;
|
|
27
|
+
shouldFilter?: boolean | undefined;
|
|
28
|
+
filter?: ((value: string, search: string) => number) | undefined;
|
|
29
|
+
defaultValue?: string | undefined;
|
|
30
|
+
value?: string | undefined;
|
|
31
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
32
|
+
loop?: boolean | undefined;
|
|
33
|
+
vimBindings?: boolean | undefined;
|
|
34
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const MVPSelectLoading: React.ForwardRefExoticComponent<Omit<{
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
} & React.HTMLAttributes<HTMLDivElement> & {
|
|
38
|
+
progress?: number | undefined;
|
|
39
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
declare const MVPSelectInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & {
|
|
41
|
+
onValueChange?: ((val: string) => void) | undefined;
|
|
42
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
43
|
+
declare const MVPSelectItems: React.ForwardRefExoticComponent<Omit<{
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
46
|
+
onBottomReached?: (() => void) | undefined;
|
|
47
|
+
minLenToSearch?: number | undefined;
|
|
48
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
declare const MVPSelectEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
declare const MVPSelectSeparator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & {
|
|
53
|
+
alwaysRender?: boolean | undefined;
|
|
54
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare const MVPSelectItem: React.ForwardRefExoticComponent<Omit<{
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect" | "disabled" | "value"> & {
|
|
58
|
+
disabled?: boolean | undefined;
|
|
59
|
+
onSelect?: ((value: string) => void) | undefined;
|
|
60
|
+
value?: string | undefined;
|
|
61
|
+
forceMount?: boolean | undefined;
|
|
62
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
63
|
+
label: string;
|
|
64
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
+
declare const CommandShortcut: {
|
|
66
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
export { CommandShortcut, MVPSelect, MVPSelectContent, MVPSelectEmpty, MVPSelectInput, MVPSelectItem, MVPSelectItems, MVPSelectLoading, MVPSelectSeparator, MVPSelectTrigger, };
|