aravint-sms-form-controls 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.
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ interface CheckboxProps {
3
+ label?: string;
4
+ checked: boolean;
5
+ onChange: (checked: boolean) => void;
6
+ disabled?: boolean;
7
+ id?: string;
8
+ name?: string;
9
+ className?: string;
10
+ labelClassName?: string;
11
+ required?: boolean;
12
+ dataTestId?: string;
13
+ onBlur?: () => void;
14
+ checkColor?: string;
15
+ labelColor?: string;
16
+ borderColor?: string;
17
+ }
18
+ declare const Checkbox: React.FC<CheckboxProps>;
19
+ export default Checkbox;
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import "react-datepicker/dist/react-datepicker.css";
3
+ interface DisabledDateRange {
4
+ start: Date;
5
+ end: Date;
6
+ }
7
+ type DayName = "sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday";
8
+ interface CustomDatePickerProps {
9
+ mode: "date" | "dateTime" | "range" | "dateTimeRange";
10
+ value?: Date | null;
11
+ onChangeSingle?: (date: Date | null) => void;
12
+ fromDate?: Date | null;
13
+ endDate?: Date | null;
14
+ onRangeChange?: (startDate: Date | null, endDate: Date | null) => void;
15
+ placeholderText?: string;
16
+ maxRangeYears?: number;
17
+ minDate?: Date;
18
+ maxDate?: Date;
19
+ disabled?: boolean;
20
+ filterDate?: (date: Date) => boolean;
21
+ primaryColor?: string;
22
+ rangeColor?: string;
23
+ rangeTextColor?: string;
24
+ className?: string;
25
+ disablePastDates?: boolean;
26
+ disableFutureDates?: boolean;
27
+ disableCurrentDate?: boolean;
28
+ disabledDateRange?: DisabledDateRange[];
29
+ disabledDays?: DayName[];
30
+ yearRangeStart?: number;
31
+ yearRangeEnd?: number;
32
+ }
33
+ declare const CustomDatePicker: React.ForwardRefExoticComponent<CustomDatePickerProps & React.RefAttributes<any>>;
34
+ export default CustomDatePicker;
@@ -0,0 +1,26 @@
1
+ import React, { DragEvent } from "react";
2
+ export interface DragDropUploadProps {
3
+ onFilesChange: (files: FileList | null) => void;
4
+ onDrop?: (e: DragEvent<HTMLDivElement>) => void;
5
+ onDragOver?: (e: DragEvent<HTMLDivElement>) => void;
6
+ onDragLeave?: (e: DragEvent<HTMLDivElement>) => void;
7
+ onClick?: () => void;
8
+ inputRef?: React.RefObject<HTMLInputElement>;
9
+ isDragging?: boolean;
10
+ isUploading?: boolean;
11
+ disabled?: boolean;
12
+ accept?: string;
13
+ multiple?: boolean;
14
+ title?: string;
15
+ subtitle?: string;
16
+ buttonText?: string;
17
+ uploadingText?: string;
18
+ footerText?: string;
19
+ icon?: React.ReactNode;
20
+ containerClassName?: string;
21
+ dropZoneClassName?: string;
22
+ buttonClassName?: string;
23
+ inputId?: string;
24
+ }
25
+ declare const DragDropUpload: ({ onFilesChange, onDrop, onDragOver, onDragLeave, onClick, inputRef, isDragging, isUploading, disabled, accept, multiple, title, subtitle, buttonText, uploadingText, footerText, icon, containerClassName, dropZoneClassName, buttonClassName, inputId, }: DragDropUploadProps) => React.JSX.Element;
26
+ export default DragDropUpload;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
3
+ error?: string;
4
+ hint?: string;
5
+ label?: string;
6
+ required?: boolean;
7
+ inputSize?: "sm" | "md" | "lg";
8
+ leadingIcon?: React.ReactNode;
9
+ trailingIcon?: React.ReactNode;
10
+ regex?: RegExp;
11
+ onRegexFail?: (value: string) => void;
12
+ }
13
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
14
+ export { Input };
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ export interface Option {
3
+ label: string;
4
+ value: string;
5
+ }
6
+ export interface MultiSelectProps {
7
+ options: Option[];
8
+ value: string[];
9
+ onChange: (value: string[]) => void;
10
+ placeholder?: string;
11
+ error?: string;
12
+ disabled?: boolean;
13
+ borderColor?: string;
14
+ selectedBgColor?: string;
15
+ selectedBorderColor?: string;
16
+ checkColor?: string;
17
+ backgroundColor?: string;
18
+ errorBorderColor?: string;
19
+ errorTextColor?: string;
20
+ }
21
+ export declare function MultiSelect({ options, value, onChange, placeholder, error, disabled, borderColor, selectedBgColor, selectedBorderColor, checkColor, backgroundColor, errorBorderColor, errorTextColor, }: MultiSelectProps): React.JSX.Element;
22
+ export default MultiSelect;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface RadioProps {
3
+ label: string;
4
+ name: string;
5
+ value: string;
6
+ checked: boolean;
7
+ onChange: (value: string) => void;
8
+ disabled?: boolean;
9
+ accentColor?: string;
10
+ labelColor?: string;
11
+ className?: string;
12
+ labelClassName?: string;
13
+ }
14
+ declare const Radio: React.FC<RadioProps>;
15
+ export default Radio;
@@ -0,0 +1,41 @@
1
+ import { type FC, type CSSProperties } from "react";
2
+ export interface SelectOption {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface SelectGroup {
8
+ groupLabel?: string;
9
+ options: SelectOption[];
10
+ }
11
+ type SelectStatus = "default" | "error" | "success";
12
+ type SelectSize = "sm" | "default";
13
+ export interface SelectFieldProps {
14
+ options: SelectOption[] | SelectGroup[];
15
+ value?: string;
16
+ onChange?: (value: string) => void;
17
+ label?: string;
18
+ placeholder?: string;
19
+ hint?: string;
20
+ status?: SelectStatus;
21
+ size?: SelectSize;
22
+ disabled?: boolean;
23
+ required?: boolean;
24
+ className?: string;
25
+ wrapperStyle?: CSSProperties;
26
+ borderColor?: string;
27
+ focusBorderColor?: string;
28
+ backgroundColor?: string;
29
+ textColor?: string;
30
+ placeholderColor?: string;
31
+ labelColor?: string;
32
+ hintColor?: string;
33
+ errorColor?: string;
34
+ successColor?: string;
35
+ dropdownBg?: string;
36
+ itemHoverBg?: string;
37
+ itemHoverColor?: string;
38
+ selectedColor?: string;
39
+ }
40
+ export declare const Select: FC<SelectFieldProps>;
41
+ export default Select;
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ export interface Option {
3
+ label: string;
4
+ value: string;
5
+ }
6
+ interface SingleSelectProps {
7
+ label?: string;
8
+ options: Option[];
9
+ value?: string;
10
+ placeholder?: string;
11
+ searchPlaceholder?: string;
12
+ onChange: (value: string) => void;
13
+ disabled?: boolean;
14
+ selectedOptionStyle?: React.CSSProperties;
15
+ hoverOptionStyle?: React.CSSProperties;
16
+ error?: boolean;
17
+ errorMessage?: string;
18
+ showSearch?: boolean;
19
+ ArrowDownIcon?: React.ComponentType<{
20
+ className?: string;
21
+ }>;
22
+ ArrowUpIcon?: React.ComponentType<{
23
+ className?: string;
24
+ }>;
25
+ }
26
+ declare const SingleSelect: ({ label, options, value, placeholder, onChange, disabled, error, errorMessage, hoverOptionStyle, selectedOptionStyle, searchPlaceholder, showSearch, ArrowDownIcon, ArrowUpIcon, }: SingleSelectProps) => React.JSX.Element;
27
+ export default SingleSelect;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
3
+ error?: string;
4
+ }
5
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
6
+ export { Textarea };
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ interface ToggleSwitchProps {
3
+ checked: boolean;
4
+ onChange: (checked: boolean) => void;
5
+ disabled?: boolean;
6
+ label?: string;
7
+ labelPosition?: string;
8
+ activeColor?: string;
9
+ inactiveColor?: string;
10
+ disabledColor?: string;
11
+ thumbColor?: string;
12
+ labelColor?: string;
13
+ className?: string;
14
+ }
15
+ declare const ToggleSwitch: React.FC<ToggleSwitchProps>;
16
+ export default ToggleSwitch;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface TooltipProps {
3
+ value: string;
4
+ icon?: React.ReactNode;
5
+ }
6
+ declare const Tooltip: React.FC<TooltipProps>;
7
+ export default Tooltip;
@@ -0,0 +1,4 @@
1
+ import CalenderIcon from './calendar.svg?react';
2
+ import ArrowDownIcon from './arrow-down.svg?react';
3
+ import SearchIcon from './search-icon.svg?react';
4
+ export { CalenderIcon, ArrowDownIcon, SearchIcon };
@@ -0,0 +1,13 @@
1
+ import "./index.css";
2
+ export { default as Radio } from "./components/RadioButton/RadioButton";
3
+ export { default as ToggleSwitch } from "./components/ToggleButton/ToggleSwitch";
4
+ export { default as Checkbox } from "./components/Checkbox/Checkbox";
5
+ export { Textarea } from "./components/TextArea/textarea";
6
+ export { MultiSelect } from "./components/MultiSelect/MultiSelect";
7
+ export { default as DragDropUpload } from "./components/DragDropUpload/DragDropUpload";
8
+ export { Select } from "./components/Select/Select";
9
+ export type { SelectFieldProps, SelectOption } from "./components/Select/Select";
10
+ export { Input } from "./components/InputFields/Input";
11
+ export { default as CustomDatePicker } from "./components/DatePicker/DatePicker";
12
+ export { default as SingleSelect } from "./components/SingleSelect/SingleSelect";
13
+ export { default as Tooltip } from "./components/Tooltip/Tooltip";
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "aravint-sms-form-controls",
3
+ "version": "1.0.0",
4
+ "main": "dist/form-controls.cjs.js",
5
+ "module": "dist/form-controls.es.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/form-controls.es.js",
10
+ "require": "./dist/form-controls.cjs.js"
11
+ },
12
+ "./dist/form-controls.css": "./dist/form-controls.css",
13
+ "./style.css": "./dist/form-controls.css"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "vite build && npx tsc --emitDeclarationOnly",
20
+ "dev": "vite build --watch",
21
+ "test": "vite"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/digitus-git/AFCI_OffAuto/tree/develop_rel_phase1/packages"
26
+ },
27
+ "devDependencies": {
28
+ "@types/react": "^18.3.1",
29
+ "@types/react-dom": "18.3.1",
30
+ "@vitejs/plugin-react": "^4.0.0",
31
+ "typescript": "^4.9.5",
32
+ "vite": "^6.0.0",
33
+ "vite-plugin-svgr": "^5.2.0"
34
+ },
35
+ "peerDependencies": {
36
+ "react": "^18.3.1",
37
+ "react-dom": "^18.3.1"
38
+ },
39
+ "dependencies": {
40
+ "@radix-ui/react-select": "^2.2.6",
41
+ "@tailwindcss/postcss": "^4.3.0",
42
+ "autoprefixer": "^10.5.0",
43
+ "class-variance-authority": "^0.7.0",
44
+ "clsx": "2.1.1",
45
+ "lucide-react": "^1.16.0",
46
+ "postcss": "^8.5.15",
47
+ "react-datepicker": "^8.7.0",
48
+ "react-icons": "^5.6.0",
49
+ "@react-icons/all-files": "^4.1.0",
50
+ "tailwind-merge": "3.2.0",
51
+ "tailwindcss": "^4.3.0"
52
+ }
53
+ }