@paygreen/pgui 3.0.1 → 3.0.3

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.
@@ -2,6 +2,10 @@
2
2
  * Props for the DatePicker component
3
3
  */
4
4
  export interface DatePickerProps {
5
+ /** ID attribute for the input element */
6
+ id?: string;
7
+ /** Name attribute for form integration */
8
+ name?: string;
5
9
  /** The selected date or date range */
6
10
  value?: Date | [Date | null, Date | null] | null;
7
11
  /** Label text displayed above the input */
@@ -25,9 +29,11 @@ export interface DatePickerProps {
25
29
  /** Callback fired when the input loses focus */
26
30
  onBlur?: () => void;
27
31
  /** Whether the input is disabled */
28
- isDisabled?: boolean;
32
+ disabled?: boolean;
29
33
  /** Whether to show a clear button when there's a value (default: true) */
30
34
  clearable?: boolean;
35
+ /** Whether the input is in invalid state */
36
+ invalid?: boolean;
31
37
  }
32
38
  /**
33
39
  * A reusable date picker component with floating label and range selection support
@@ -64,6 +70,15 @@ export interface DatePickerProps {
64
70
  * onChange={setDate}
65
71
  * clearable={false}
66
72
  * />
73
+ *
74
+ * // With name and id for form integration:
75
+ * <DatePicker
76
+ * id="birthdate-input"
77
+ * name="birthdate"
78
+ * label="Birthdate"
79
+ * value={date}
80
+ * onChange={setDate}
81
+ * />
67
82
  * ```
68
83
  */
69
84
  declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,11 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  interface FieldContextType {
3
3
  /** Whether the field is invalid */
4
- isInvalid?: boolean;
4
+ invalid?: boolean;
5
5
  /** Whether the field is required */
6
- isRequired?: boolean;
6
+ required?: boolean;
7
7
  /** Whether the field is disabled */
8
- isDisabled?: boolean;
8
+ disabled?: boolean;
9
9
  }
10
10
  export interface FieldWrapperProps {
11
11
  /** The field label */
@@ -13,11 +13,11 @@ export interface FieldWrapperProps {
13
13
  /** The error message to display */
14
14
  errorMessage?: string;
15
15
  /** Whether the field is invalid */
16
- isInvalid?: boolean;
16
+ invalid?: boolean;
17
17
  /** Whether the field is required */
18
- isRequired?: boolean;
18
+ required?: boolean;
19
19
  /** Whether the field is disabled */
20
- isDisabled?: boolean;
20
+ disabled?: boolean;
21
21
  /** Helper text to display below the field */
22
22
  helperText?: string;
23
23
  /** The field content (input, select, etc.) */
@@ -35,8 +35,8 @@ export interface FieldWrapperProps {
35
35
  * <FieldWrapper
36
36
  * label="Email"
37
37
  * errorMessage="Please enter a valid email"
38
- * isInvalid={hasError}
39
- * isRequired
38
+ * invalid={hasError}
39
+ * required
40
40
  * >
41
41
  * <Input type="email" />
42
42
  * </FieldWrapper>
@@ -1,12 +1,13 @@
1
+ import { ReactNode } from 'react';
1
2
  import { InputProps as ChakraInputProps } from '@chakra-ui/react';
2
3
  /**
3
4
  * Props for the Input component
4
5
  */
5
6
  export interface InputProps extends ChakraInputProps {
6
7
  /** Label text displayed above the input */
7
- label?: string;
8
+ label?: ReactNode;
8
9
  /** Whether the input is disabled */
9
- isDisabled?: boolean;
10
+ disabled?: boolean;
10
11
  }
11
12
  /**
12
13
  * A reusable input component that extends Chakra UI's Input with floating label and field validation
@@ -16,7 +17,7 @@ export interface InputProps extends ChakraInputProps {
16
17
  * <Input
17
18
  * label="Email"
18
19
  * placeholder="Enter your email"
19
- * isRequired
20
+ * required
20
21
  * />
21
22
  * ```
22
23
  */
@@ -20,7 +20,7 @@ export interface InputMaskProps extends Omit<InputProps, 'onChange'> {
20
20
  * label="Phone"
21
21
  * mask="(999) 999-9999"
22
22
  * placeholder="(555) 555-5555"
23
- * isRequired
23
+ * required
24
24
  * />
25
25
  * ```
26
26
  */
@@ -17,7 +17,7 @@ export interface InputPhoneProps {
17
17
  /** Callback fired when the phone number changes */
18
18
  onChange?: (value: string) => void;
19
19
  /** Whether the input is required */
20
- isRequired?: boolean;
20
+ required?: boolean;
21
21
  /** Whether the input is invalid */
22
22
  invalid?: boolean;
23
23
  /** Error message to display when invalid */
@@ -51,12 +51,12 @@ declare const formatPhoneIntl: (val: string) => string;
51
51
  * <InputPhone
52
52
  * value="+33612345678"
53
53
  * onChange={setPhoneNumber}
54
- * isRequired
54
+ * required
55
55
  * />
56
56
  * ```
57
57
  */
58
58
  declare const InputPhone: {
59
- ({ locale, label, value, placeholder, disabled, inputProps, onChange, isRequired, invalid, errorMessage, searchLabels, ...props }: InputPhoneProps): import("react/jsx-runtime").JSX.Element;
59
+ ({ locale, label, value, placeholder, disabled, inputProps, onChange, required, invalid, errorMessage, searchLabels, ...props }: InputPhoneProps): import("react/jsx-runtime").JSX.Element;
60
60
  displayName: string;
61
61
  };
62
62
  export { formatPhoneIntl, InputPhone, isValidPhone };
@@ -13,7 +13,7 @@ export interface SidebarTheme {
13
13
  /** Box shadow */
14
14
  boxShadow?: string;
15
15
  /** Z-index value */
16
- zIndex?: number;
16
+ zIndex?: number | string;
17
17
  /** Transition duration for animations */
18
18
  transitionDuration?: string;
19
19
  }