@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.
- package/dist/components/date-picker/date-picker.d.ts +16 -1
- package/dist/components/field-wrapper/field-wrapper.d.ts +8 -8
- package/dist/components/input/input.d.ts +4 -3
- package/dist/components/input-mask/input-mask.d.ts +1 -1
- package/dist/components/input-phone/input-phone.d.ts +3 -3
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/index.mjs +2405 -2309
- package/dist/pgui.css +1 -1
- package/dist/theme/tokens/index.d.ts +53 -0
- package/dist/theme/tokens/z-index.d.ts +54 -0
- package/package.json +3 -2
- package/src/components/date-picker/date-picker.css +28 -1
- package/src/components/select/select.css +1 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
4
|
+
invalid?: boolean;
|
|
5
5
|
/** Whether the field is required */
|
|
6
|
-
|
|
6
|
+
required?: boolean;
|
|
7
7
|
/** Whether the field is disabled */
|
|
8
|
-
|
|
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
|
-
|
|
16
|
+
invalid?: boolean;
|
|
17
17
|
/** Whether the field is required */
|
|
18
|
-
|
|
18
|
+
required?: boolean;
|
|
19
19
|
/** Whether the field is disabled */
|
|
20
|
-
|
|
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
|
-
*
|
|
39
|
-
*
|
|
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?:
|
|
8
|
+
label?: ReactNode;
|
|
8
9
|
/** Whether the input is disabled */
|
|
9
|
-
|
|
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
|
-
*
|
|
20
|
+
* required
|
|
20
21
|
* />
|
|
21
22
|
* ```
|
|
22
23
|
*/
|
|
@@ -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
|
-
|
|
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
|
-
*
|
|
54
|
+
* required
|
|
55
55
|
* />
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
declare const InputPhone: {
|
|
59
|
-
({ locale, label, value, placeholder, disabled, inputProps, onChange,
|
|
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 };
|