zaravand-ui 1.2.0 → 1.4.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.
@@ -4,5 +4,5 @@ type DatePickerValue = Date | DateRange | undefined;
4
4
  export declare function formatDatePickerOnChangeValue<TOutput extends DatePickerDateOutputType>(nextValue: DatePickerValue, mode: "single" | "range", typeDateExport: DatePickerDateExportType, typeDateOutput: TOutput): DatePickerOnChangeValue<TOutput>;
5
5
  export declare function formatPersianDate(date: Date): string;
6
6
  export declare function formatPersianDateRangeLabel(dateRange: DateRange | undefined): string | null;
7
- declare function DatePicker<TOutput extends DatePickerDateOutputType = "object">({ className, size, title, required, placeholder, mode, allowManualInput, value, defaultValue, onChange, typeDateExport, typeDateOutput, fromDate, toDate, disabledDates, numberOfMonths, calendarSystem, defaultCalendarSystem, onCalendarSystemChange, open, onOpenChange, onInvalid, disabled, id, }: DatePickerProps<TOutput>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DatePicker<TOutput extends DatePickerDateOutputType = "object">({ className, size, title, required, showRequiredMessage, placeholder, mode, allowManualInput, value, defaultValue, onChange, typeDateExport, typeDateOutput, fromDate, toDate, disabledDates, numberOfMonths, calendarSystem, defaultCalendarSystem, onCalendarSystemChange, open, onOpenChange, onInvalid, disabled, id, }: DatePickerProps<TOutput>): import("react/jsx-runtime").JSX.Element;
8
8
  export default DatePicker;
@@ -22,11 +22,16 @@ export interface DatePickerProps<TOutput extends DatePickerDateOutputType = Date
22
22
  size?: "sm" | "default" | "lg";
23
23
  title?: string;
24
24
  required?: boolean;
25
+ /**
26
+ * When true and `required` is true, shows a "این فیلد اجباری است" hint next to the required star.
27
+ * @default false
28
+ */
29
+ showRequiredMessage?: boolean;
25
30
  placeholder?: string;
26
31
  mode?: "single" | "range";
27
32
  /**
28
33
  * When true, allows the user to manually type the date (single mode only)
29
- * using the `day/month/year` format, in addition to picking it from the calendar.
34
+ * using the `year/month/day` format, in addition to picking it from the calendar.
30
35
  * @default false
31
36
  */
32
37
  allowManualInput?: boolean;
@@ -1,3 +1,3 @@
1
1
  import type { InputProps } from "./Input.interface";
2
- declare function Input({ className, size, type, title, required, characterLimit, placeholder, onChange, onBlur, onFocus, onInvalid, id, name, disabled, readOnly, autoComplete, "aria-label": ariaLabel, value, defaultValue, maxLength, }: InputProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function Input({ className, size, type, title, required, showRequiredMessage, characterLimit, placeholder, onChange, onBlur, onFocus, onInvalid, id, name, disabled, readOnly, autoComplete, "aria-label": ariaLabel, value, defaultValue, maxLength, }: InputProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default Input;
@@ -2,9 +2,14 @@ import type * as React from "react";
2
2
  import type { VariantProps } from "class-variance-authority";
3
3
  import { inputVariants } from "./Input.variant";
4
4
  export interface InputProps extends VariantProps<typeof inputVariants> {
5
- type?: "number" | "password" | "text" | "search" | "money";
5
+ type?: "number" | "password" | "text" | "search" | "money" | "username";
6
6
  title?: string;
7
7
  required?: boolean;
8
+ /**
9
+ * When true and `required` is true, shows a "این فیلد اجباری است" hint next to the required star.
10
+ * @default false
11
+ */
12
+ showRequiredMessage?: boolean;
8
13
  characterLimit?: number;
9
14
  placeholder?: string;
10
15
  id?: string;
@@ -8,7 +8,7 @@ type SelectValueProps = React.ComponentProps<typeof SelectPrimitive.Value>;
8
8
  type SelectContentProps = React.ComponentProps<typeof SelectPrimitive.Content> & {
9
9
  position?: "item-aligned" | "popper";
10
10
  };
11
- declare function Select({ type: selectType, title, required, placeholder, options, remoteOptions, isSearch, size, disabled, disable, onValueChange, onChange, onInvalid, onOpenChange, open, defaultOpen, id, value, defaultValue, children, selectAllLabel, selectedCountLabel, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function Select({ type: selectType, title, required, showRequiredMessage, placeholder, options, remoteOptions, isSearch, size, disabled, disable, onValueChange, onChange, onInvalid, onOpenChange, open, defaultOpen, id, value, defaultValue, children, selectAllLabel, selectedCountLabel, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
12
12
  declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
13
13
  declare function SelectValue({ className, placeholder, children, ...props }: SelectValueProps): import("react/jsx-runtime").JSX.Element;
14
14
  declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -11,6 +11,11 @@ export interface SelectProps extends Omit<React.ComponentProps<typeof SelectPrim
11
11
  onInvalid?: React.FormEventHandler<HTMLInputElement>;
12
12
  title?: string;
13
13
  required?: boolean;
14
+ /**
15
+ * When true and `required` is true, shows a "این فیلد اجباری است" hint next to the required star.
16
+ * @default false
17
+ */
18
+ showRequiredMessage?: boolean;
14
19
  placeholder?: string;
15
20
  options?: Array<{
16
21
  value: string;
@@ -1,3 +1,3 @@
1
1
  import type { TextareaProps } from "./Textarea.interface";
2
- declare function Textarea({ className, resize, title, required, placeholder, onChange, onBlur, onFocus, onInvalid, id, name, disabled, readOnly, autoComplete, rows, maxLength, "aria-label": ariaLabel, value, defaultValue, }: TextareaProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function Textarea({ className, resize, title, required, showRequiredMessage, placeholder, onChange, onBlur, onFocus, onInvalid, id, name, disabled, readOnly, autoComplete, rows, maxLength, "aria-label": ariaLabel, value, defaultValue, }: TextareaProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default Textarea;
@@ -4,6 +4,11 @@ import { textareaVariants } from "./Textarea.variant";
4
4
  export interface TextareaProps extends VariantProps<typeof textareaVariants> {
5
5
  title?: string;
6
6
  required?: boolean;
7
+ /**
8
+ * When true and `required` is true, shows a "این فیلد اجباری است" hint next to the required star.
9
+ * @default false
10
+ */
11
+ showRequiredMessage?: boolean;
7
12
  placeholder?: string;
8
13
  id?: string;
9
14
  name?: string;