@paygreen/pgui 2.14.10 → 3.0.1-beta
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/README.md +128 -59
- package/dist/components/actions-button/actions-button.d.ts +21 -0
- package/dist/components/data-list/datalist.d.ts +87 -0
- package/dist/components/data-table/data-table.d.ts +67 -0
- package/dist/components/date-picker/date-picker.d.ts +44 -0
- package/dist/components/field-wrapper/field-wrapper.d.ts +50 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/input/input.d.ts +24 -0
- package/dist/components/input-mask/input-mask.d.ts +28 -0
- package/dist/components/input-password/input-password.d.ts +34 -0
- package/dist/components/input-phone/input-phone.d.ts +62 -0
- package/dist/components/input-phone/partials/search-on-list.d.ts +61 -0
- package/dist/components/input-search/input-search.d.ts +14 -0
- package/dist/components/loader/loader.d.ts +25 -0
- package/dist/components/logos/logoPaygreenByLemonway.d.ts +25 -0
- package/dist/components/modal/modal.d.ts +79 -0
- package/dist/components/pagination/pagination.d.ts +36 -0
- package/dist/components/select/select.d.ts +49 -0
- package/dist/components/sidebar/sidebar.d.ts +117 -0
- package/dist/components/tooltip/tooltip.d.ts +11 -0
- package/dist/components/ui/color-mode.d.ts +21 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/hooks/scroll-shadow.d.ts +7 -0
- package/dist/hooks/use-data-table.d.ts +12 -0
- package/dist/index.d.ts +2 -352
- package/dist/index.js +48 -0
- package/dist/index.mjs +9024 -0
- package/dist/pgui.css +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/recipes/card-recipe.d.ts +15 -0
- package/dist/theme/recipes/index.d.ts +18 -0
- package/dist/theme/recipes/text-recipe.d.ts +2 -0
- package/dist/theme/semanticTokens/colors.d.ts +399 -0
- package/dist/theme/semanticTokens/index.d.ts +401 -0
- package/dist/theme/tokens/colors.d.ts +317 -0
- package/dist/theme/tokens/font-sizes.d.ts +42 -0
- package/dist/theme/tokens/fonts.d.ts +12 -0
- package/dist/theme/tokens/index.d.ts +465 -0
- package/dist/theme/tokens/radii.d.ts +39 -0
- package/dist/theme/tokens/sizes.d.ts +57 -0
- package/package.json +92 -103
- package/src/components/date-picker/date-picker.css +203 -0
- package/src/components/select/select.css +97 -0
- package/src/styles/index.css +12 -0
- package/dist/cjs/index.js +0 -60887
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types/components/ActionsButton/index.d.ts +0 -6
- package/dist/cjs/types/components/Card/index.d.ts +0 -3
- package/dist/cjs/types/components/ConfirmMenuItem/index.d.ts +0 -13
- package/dist/cjs/types/components/DataList/index.d.ts +0 -42
- package/dist/cjs/types/components/FormGroup/index.d.ts +0 -12
- package/dist/cjs/types/components/InputDayPicker/index.d.ts +0 -20
- package/dist/cjs/types/components/InputPhone/SearchOnList.d.ts +0 -19
- package/dist/cjs/types/components/InputPhone/index.d.ts +0 -12
- package/dist/cjs/types/components/InputRangePicker/index.d.ts +0 -25
- package/dist/cjs/types/components/ModalResponsive/index.d.ts +0 -5
- package/dist/cjs/types/components/Pagination/index.d.ts +0 -43
- package/dist/cjs/types/components/SearchInput/index.d.ts +0 -12
- package/dist/cjs/types/components/Select/index.d.ts +0 -120
- package/dist/cjs/types/components/Textarea/index.d.ts +0 -8
- package/dist/cjs/types/components/index.d.ts +0 -12
- package/dist/cjs/types/hooks/useClickOutside.d.ts +0 -3
- package/dist/cjs/types/index.d.ts +0 -4
- package/dist/cjs/types/layout/BottomBar/index.d.ts +0 -3
- package/dist/cjs/types/layout/LayoutContainer/index.d.ts +0 -3
- package/dist/cjs/types/layout/SideNav/index.d.ts +0 -21
- package/dist/cjs/types/layout/TopBar/index.d.ts +0 -10
- package/dist/cjs/types/layout/index.d.ts +0 -4
- package/dist/cjs/types/theme/components/alert.d.ts +0 -9
- package/dist/cjs/types/theme/components/badge.d.ts +0 -9
- package/dist/cjs/types/theme/components/button.d.ts +0 -163
- package/dist/cjs/types/theme/components/checkbox.d.ts +0 -11
- package/dist/cjs/types/theme/components/drawer.d.ts +0 -6
- package/dist/cjs/types/theme/components/form.d.ts +0 -8
- package/dist/cjs/types/theme/components/index.d.ts +0 -16
- package/dist/cjs/types/theme/components/input.d.ts +0 -58
- package/dist/cjs/types/theme/components/menu.d.ts +0 -9
- package/dist/cjs/types/theme/components/number-input.d.ts +0 -54
- package/dist/cjs/types/theme/components/pin-input.d.ts +0 -42
- package/dist/cjs/types/theme/components/radio.d.ts +0 -6
- package/dist/cjs/types/theme/components/slider.d.ts +0 -6
- package/dist/cjs/types/theme/components/switch.d.ts +0 -6
- package/dist/cjs/types/theme/components/tag.d.ts +0 -14
- package/dist/cjs/types/theme/components/textarea.d.ts +0 -54
- package/dist/cjs/types/theme/components/tooltip.d.ts +0 -8
- package/dist/cjs/types/theme/foundations/colors.d.ts +0 -66
- package/dist/cjs/types/theme/foundations/index.d.ts +0 -129
- package/dist/cjs/types/theme/foundations/radius.d.ts +0 -11
- package/dist/cjs/types/theme/foundations/shadows.d.ts +0 -10
- package/dist/cjs/types/theme/foundations/sizes.d.ts +0 -21
- package/dist/cjs/types/theme/foundations/typography.d.ts +0 -21
- package/dist/cjs/types/theme/index.d.ts +0 -1
- package/dist/cjs/types/theme/rawStyle/chakraStyle.d.ts +0 -2
- package/dist/cjs/types/theme/rawStyle/index.d.ts +0 -3
- package/dist/cjs/types/theme/rawStyle/reactDayPicker.d.ts +0 -23
- package/dist/cjs/types/theme/rawStyle/scrollbarStyles.d.ts +0 -11
- package/dist/cjs/types/theme/styles.d.ts +0 -2
- package/dist/cjs/types/theme/theme.d.ts +0 -1
- package/dist/cjs/types/utils/date.d.ts +0 -1
- package/dist/cjs/types/utils/index.d.ts +0 -2
- package/dist/cjs/types/utils/responsive.d.ts +0 -1
- package/dist/esm/index.js +0 -60814
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/ActionsButton/index.d.ts +0 -6
- package/dist/esm/types/components/Card/index.d.ts +0 -3
- package/dist/esm/types/components/ConfirmMenuItem/index.d.ts +0 -13
- package/dist/esm/types/components/DataList/index.d.ts +0 -42
- package/dist/esm/types/components/FormGroup/index.d.ts +0 -12
- package/dist/esm/types/components/InputDayPicker/index.d.ts +0 -20
- package/dist/esm/types/components/InputPhone/SearchOnList.d.ts +0 -19
- package/dist/esm/types/components/InputPhone/index.d.ts +0 -12
- package/dist/esm/types/components/InputRangePicker/index.d.ts +0 -25
- package/dist/esm/types/components/ModalResponsive/index.d.ts +0 -5
- package/dist/esm/types/components/Pagination/index.d.ts +0 -43
- package/dist/esm/types/components/SearchInput/index.d.ts +0 -12
- package/dist/esm/types/components/Select/index.d.ts +0 -120
- package/dist/esm/types/components/Textarea/index.d.ts +0 -8
- package/dist/esm/types/components/index.d.ts +0 -12
- package/dist/esm/types/hooks/useClickOutside.d.ts +0 -3
- package/dist/esm/types/index.d.ts +0 -4
- package/dist/esm/types/layout/BottomBar/index.d.ts +0 -3
- package/dist/esm/types/layout/LayoutContainer/index.d.ts +0 -3
- package/dist/esm/types/layout/SideNav/index.d.ts +0 -21
- package/dist/esm/types/layout/TopBar/index.d.ts +0 -10
- package/dist/esm/types/layout/index.d.ts +0 -4
- package/dist/esm/types/theme/components/alert.d.ts +0 -9
- package/dist/esm/types/theme/components/badge.d.ts +0 -9
- package/dist/esm/types/theme/components/button.d.ts +0 -163
- package/dist/esm/types/theme/components/checkbox.d.ts +0 -11
- package/dist/esm/types/theme/components/drawer.d.ts +0 -6
- package/dist/esm/types/theme/components/form.d.ts +0 -8
- package/dist/esm/types/theme/components/index.d.ts +0 -16
- package/dist/esm/types/theme/components/input.d.ts +0 -58
- package/dist/esm/types/theme/components/menu.d.ts +0 -9
- package/dist/esm/types/theme/components/number-input.d.ts +0 -54
- package/dist/esm/types/theme/components/pin-input.d.ts +0 -42
- package/dist/esm/types/theme/components/radio.d.ts +0 -6
- package/dist/esm/types/theme/components/slider.d.ts +0 -6
- package/dist/esm/types/theme/components/switch.d.ts +0 -6
- package/dist/esm/types/theme/components/tag.d.ts +0 -14
- package/dist/esm/types/theme/components/textarea.d.ts +0 -54
- package/dist/esm/types/theme/components/tooltip.d.ts +0 -8
- package/dist/esm/types/theme/foundations/colors.d.ts +0 -66
- package/dist/esm/types/theme/foundations/index.d.ts +0 -129
- package/dist/esm/types/theme/foundations/radius.d.ts +0 -11
- package/dist/esm/types/theme/foundations/shadows.d.ts +0 -10
- package/dist/esm/types/theme/foundations/sizes.d.ts +0 -21
- package/dist/esm/types/theme/foundations/typography.d.ts +0 -21
- package/dist/esm/types/theme/index.d.ts +0 -1
- package/dist/esm/types/theme/rawStyle/chakraStyle.d.ts +0 -2
- package/dist/esm/types/theme/rawStyle/index.d.ts +0 -3
- package/dist/esm/types/theme/rawStyle/reactDayPicker.d.ts +0 -23
- package/dist/esm/types/theme/rawStyle/scrollbarStyles.d.ts +0 -11
- package/dist/esm/types/theme/styles.d.ts +0 -2
- package/dist/esm/types/theme/theme.d.ts +0 -1
- package/dist/esm/types/utils/date.d.ts +0 -1
- package/dist/esm/types/utils/index.d.ts +0 -2
- package/dist/esm/types/utils/responsive.d.ts +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the InputPhone component
|
|
3
|
+
*/
|
|
4
|
+
export interface InputPhoneProps {
|
|
5
|
+
/** The locale to use for translations ('fr' or 'en') */
|
|
6
|
+
locale?: 'fr' | 'en';
|
|
7
|
+
/** The phone number value in E.164 format */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** The label to display above the input */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Placeholder text for the input */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Whether the input is disabled */
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
/** Additional props to pass to the input element */
|
|
16
|
+
inputProps?: Record<string, unknown>;
|
|
17
|
+
/** Callback fired when the phone number changes */
|
|
18
|
+
onChange?: (value: string) => void;
|
|
19
|
+
/** Whether the input is required */
|
|
20
|
+
isRequired?: boolean;
|
|
21
|
+
/** Whether the input is invalid */
|
|
22
|
+
isInvalid?: boolean;
|
|
23
|
+
/** Error message to display when invalid */
|
|
24
|
+
errorMessage?: string;
|
|
25
|
+
/** Custom labels for the country search component */
|
|
26
|
+
searchLabels?: {
|
|
27
|
+
/** Placeholder text for the search input */
|
|
28
|
+
search?: string;
|
|
29
|
+
/** Text shown when no results are found */
|
|
30
|
+
noResults?: string;
|
|
31
|
+
/** Text shown while loading */
|
|
32
|
+
loading?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Validates if a phone number is valid
|
|
37
|
+
*/
|
|
38
|
+
declare const isValidPhone: (val: string) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Formats a phone number to international format
|
|
41
|
+
*/
|
|
42
|
+
declare const formatPhoneIntl: (val: string) => string;
|
|
43
|
+
/**
|
|
44
|
+
* A reusable phone input component with international formatting and country selection
|
|
45
|
+
*
|
|
46
|
+
* Note: This component does NOT use forwardRef intentionally, as react-phone-number-input
|
|
47
|
+
* manages its own ref system for proper focus management and country selection.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <InputPhone
|
|
52
|
+
* value="+33612345678"
|
|
53
|
+
* onChange={setPhoneNumber}
|
|
54
|
+
* isRequired
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const InputPhone: {
|
|
59
|
+
({ locale, label, value, placeholder, isDisabled, inputProps, onChange, isRequired, isInvalid, errorMessage, searchLabels, ...props }: InputPhoneProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
displayName: string;
|
|
61
|
+
};
|
|
62
|
+
export { formatPhoneIntl, InputPhone, isValidPhone };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a selectable option in the search list
|
|
4
|
+
*/
|
|
5
|
+
export interface SearchOption {
|
|
6
|
+
/** Display text for the option */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Unique value identifier for the option */
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Props for the SearchOnList component
|
|
13
|
+
*/
|
|
14
|
+
export interface SearchOnListProps {
|
|
15
|
+
/** Array of options to display and search through */
|
|
16
|
+
options: SearchOption[];
|
|
17
|
+
/** Callback fired when an option is selected */
|
|
18
|
+
onChange: (value: string) => void;
|
|
19
|
+
/** Component to render icons for each option (typically country flags) */
|
|
20
|
+
iconComponent: ComponentType<{
|
|
21
|
+
country: string;
|
|
22
|
+
label: string;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
/** Locale for default labels and formatting */
|
|
26
|
+
locale?: 'fr' | 'en';
|
|
27
|
+
/** Currently selected value */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Whether the component is disabled */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Placeholder text for the search input */
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
/** Maximum height of the dropdown list */
|
|
34
|
+
maxHeight?: string;
|
|
35
|
+
/** Maximum width of the dropdown container */
|
|
36
|
+
maxWidth?: string;
|
|
37
|
+
/** Custom labels to override default translations */
|
|
38
|
+
labels?: {
|
|
39
|
+
/** Label for the search input placeholder */
|
|
40
|
+
search?: string;
|
|
41
|
+
/** Message shown when no results are found */
|
|
42
|
+
noResults?: string;
|
|
43
|
+
/** Message shown during search loading */
|
|
44
|
+
loading?: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* SearchOnList component - A searchable dropdown list with keyboard navigation
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <SearchOnList
|
|
53
|
+
* options={countries}
|
|
54
|
+
* onChange={setSelectedCountry}
|
|
55
|
+
* iconComponent={CountryFlag}
|
|
56
|
+
* locale="fr"
|
|
57
|
+
* />
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare const SearchOnList: ({ options, onChange, iconComponent: IconComponent, locale, labels: customLabels, ...props }: SearchOnListProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export { SearchOnList };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputProps } from '@chakra-ui/react';
|
|
3
|
+
type CustomProps = {
|
|
4
|
+
value?: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onChange?(value?: string): void;
|
|
7
|
+
delay?: number;
|
|
8
|
+
clearLabel?: string;
|
|
9
|
+
inputProps?: object;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
customEndElement?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare const InputSearch: React.ForwardRefExoticComponent<Omit<InputProps, keyof CustomProps> & CustomProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SpinnerProps } from '@chakra-ui/react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Loader component
|
|
4
|
+
*/
|
|
5
|
+
export interface LoaderProps extends SpinnerProps {
|
|
6
|
+
/** Whether the loader should be visible and spinning */
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
/** Size of the spinner */
|
|
9
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
10
|
+
/** Custom color for the spinner (overrides theme colors) */
|
|
11
|
+
color?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Loader component - A reusable loading spinner with theme-aware styling
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Loader size="lg" loading={false} />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const Loader: {
|
|
22
|
+
({ loading, size, color, ...rest }: LoaderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
export { Loader };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the LogoPayGreenByLemonway component
|
|
3
|
+
*/
|
|
4
|
+
export interface LogoPayGreenByLemonwayProps {
|
|
5
|
+
/** Color of the logo - accepts any valid CSS color value or CSS variable */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** Width of the logo - accepts CSS units as string or number (pixels) */
|
|
8
|
+
width?: string | number;
|
|
9
|
+
/** Height of the logo - accepts CSS units as string or number (pixels) */
|
|
10
|
+
height?: string | number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* PayGreen by LemonWay logo component
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <LogoPayGreenByLemonway
|
|
18
|
+
* color="#00B956"
|
|
19
|
+
* width={200}
|
|
20
|
+
* height={80}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const LogoPayGreenByLemonway: ({ color, width, height, ...rest }: LogoPayGreenByLemonwayProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { LogoPayGreenByLemonway };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DialogRootProps, DrawerRootProps } from '@chakra-ui/react';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Modal component
|
|
5
|
+
*/
|
|
6
|
+
export interface ModalProps {
|
|
7
|
+
/** Whether the modal is open or closed */
|
|
8
|
+
open: boolean;
|
|
9
|
+
/** Function to control the modal open/closed state */
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
/** Content to be rendered inside the modal */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export type ModalPropsWithExtensions = ModalProps & Partial<DrawerRootProps> & Partial<DialogRootProps>;
|
|
15
|
+
/**
|
|
16
|
+
* Responsive Modal component that adapts to screen size
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Modal.Root open={isOpen} setOpen={setIsOpen}>
|
|
21
|
+
* <Modal.Trigger asChild>
|
|
22
|
+
* <Button>Open Modal</Button>
|
|
23
|
+
* </Modal.Trigger>
|
|
24
|
+
* <Modal.Content>
|
|
25
|
+
* <Modal.Header>Title</Modal.Header>
|
|
26
|
+
* <Modal.Body>Content goes here</Modal.Body>
|
|
27
|
+
* <Modal.Footer>
|
|
28
|
+
* <Modal.ActionTrigger asChild>
|
|
29
|
+
* <Button onClick={() => setIsOpen(false)}>Close</Button>
|
|
30
|
+
* </Modal.ActionTrigger>
|
|
31
|
+
* </Modal.Footer>
|
|
32
|
+
* </Modal.Content>
|
|
33
|
+
* </Modal.Root>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const ModalRoot: {
|
|
37
|
+
({ open, setOpen, children, ...rest }: ModalPropsWithExtensions): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
Trigger({ children, ...rest }: {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
Header({ children, ...rest }: {
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
Body({ children, ...rest }: {
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
Footer({ children, ...rest }: {
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
ActionTrigger({ children, ...rest }: {
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
Backdrop(props: any): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
Positioner(props: any): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
Portal({ children, ...rest }: {
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
ContentWrapper({ children, ...rest }: {
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
displayName: string;
|
|
66
|
+
};
|
|
67
|
+
declare const Modal: typeof ModalRoot & {
|
|
68
|
+
Root: typeof ModalRoot;
|
|
69
|
+
Trigger: typeof ModalRoot.Trigger;
|
|
70
|
+
Header: typeof ModalRoot.Header;
|
|
71
|
+
Body: typeof ModalRoot.Body;
|
|
72
|
+
Footer: typeof ModalRoot.Footer;
|
|
73
|
+
Backdrop: typeof ModalRoot.Backdrop;
|
|
74
|
+
Positioner: typeof ModalRoot.Positioner;
|
|
75
|
+
ContentWrapper: typeof ModalRoot.ContentWrapper;
|
|
76
|
+
ActionTrigger: typeof ModalRoot.ActionTrigger;
|
|
77
|
+
Portal: typeof ModalRoot.Portal;
|
|
78
|
+
};
|
|
79
|
+
export { Modal };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ColorPalette } from '@chakra-ui/react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Pagination component
|
|
4
|
+
*/
|
|
5
|
+
export interface PaginationProps {
|
|
6
|
+
/** Current active page number (1-based) */
|
|
7
|
+
page: number;
|
|
8
|
+
/** Function to update the current page */
|
|
9
|
+
setPage: (page: number) => void;
|
|
10
|
+
/** Number of items displayed per page */
|
|
11
|
+
pageSize: number;
|
|
12
|
+
/** Total number of items across all pages */
|
|
13
|
+
totalItems: number;
|
|
14
|
+
/** Whether a page is currently loading - disables all interactions when true */
|
|
15
|
+
isLoadingPage?: boolean;
|
|
16
|
+
/** Color palette for the pagination */
|
|
17
|
+
colorPalette?: ColorPalette;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Pagination component for navigating through paginated data
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Pagination
|
|
25
|
+
* page={currentPage}
|
|
26
|
+
* setPage={setCurrentPage}
|
|
27
|
+
* pageSize={10}
|
|
28
|
+
* totalItems={250}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const Pagination: {
|
|
33
|
+
({ page, setPage, pageSize, totalItems, isLoadingPage, colorPalette, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
export { Pagination };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ActionMeta, MultiValue, Props as ReactSelectProps, SingleValue } from 'react-select';
|
|
2
|
+
/**
|
|
3
|
+
* Option interface for Select component
|
|
4
|
+
*/
|
|
5
|
+
export interface SelectOptionType {
|
|
6
|
+
/** The value of the option */
|
|
7
|
+
value: string;
|
|
8
|
+
/** The label displayed for the option */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Whether the option is disabled */
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Props for Select component extending react-select props
|
|
15
|
+
*/
|
|
16
|
+
export interface SelectProps extends Omit<ReactSelectProps<SelectOptionType, boolean>, 'options' | 'isMulti' | 'onChange' | 'value'> {
|
|
17
|
+
/** Array of options to display */
|
|
18
|
+
options?: SelectOptionType[];
|
|
19
|
+
/** Enable multi-selection */
|
|
20
|
+
isMulti?: boolean;
|
|
21
|
+
/** Enable async loading of options */
|
|
22
|
+
isAsync?: boolean;
|
|
23
|
+
/** Enable creating new options */
|
|
24
|
+
isCreatable?: boolean;
|
|
25
|
+
/** Function to load options asynchronously */
|
|
26
|
+
loadOptions?: (inputValue: string) => Promise<SelectOptionType[]>;
|
|
27
|
+
/** Current value for controlled component */
|
|
28
|
+
value?: SingleValue<SelectOptionType> | MultiValue<SelectOptionType> | null;
|
|
29
|
+
/** onChange handler for controlled component */
|
|
30
|
+
onChange?: (value: SingleValue<SelectOptionType> | MultiValue<SelectOptionType> | null, actionMeta: ActionMeta<SelectOptionType>) => void;
|
|
31
|
+
/** Name attribute for form integration */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** Whether the select is in invalid state */
|
|
34
|
+
invalid?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A flexible Select component built on react-select
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <Select
|
|
42
|
+
* options={[{value: 'option1', label: 'Option 1'}]}
|
|
43
|
+
* placeholder="Choose an option..."
|
|
44
|
+
* isClearable
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare const Select: import('react').ForwardRefExoticComponent<SelectProps & import('react').RefAttributes<any>>;
|
|
49
|
+
export { Select };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { BoxProps, DrawerRootProps } from '@chakra-ui/react';
|
|
3
|
+
/**
|
|
4
|
+
* Theme configuration for sidebar styling
|
|
5
|
+
*/
|
|
6
|
+
interface SidebarTheme {
|
|
7
|
+
/** Width of the sidebar in desktop mode */
|
|
8
|
+
width?: string;
|
|
9
|
+
/** Background color */
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
/** Border color */
|
|
12
|
+
borderColor?: string;
|
|
13
|
+
/** Box shadow */
|
|
14
|
+
boxShadow?: string;
|
|
15
|
+
/** Z-index value */
|
|
16
|
+
zIndex?: number;
|
|
17
|
+
/** Transition duration for animations */
|
|
18
|
+
transitionDuration?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Props for individual navigation items in the sidebar
|
|
22
|
+
*/
|
|
23
|
+
interface NavItemProps {
|
|
24
|
+
/** Icon component to display before the label */
|
|
25
|
+
icon?: React.ElementType;
|
|
26
|
+
/** Text label for the navigation item */
|
|
27
|
+
label: string;
|
|
28
|
+
/** Whether the navigation item is currently active/selected */
|
|
29
|
+
hidden?: boolean;
|
|
30
|
+
/** Whether the item has a submenu (shows chevron down icon) */
|
|
31
|
+
hasSubmenu?: boolean;
|
|
32
|
+
/** Number to display in a badge (for notifications or counts) */
|
|
33
|
+
badge?: number;
|
|
34
|
+
/** Whether this is a sub-item (applies additional left padding) */
|
|
35
|
+
isSubItem?: boolean;
|
|
36
|
+
/** Child elements to render inside the navigation item */
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
/** Callback function when the navigation item is clicked */
|
|
39
|
+
onClick?: () => void;
|
|
40
|
+
/** Whether the item is disabled */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Link to navigate to when the item is clicked */
|
|
43
|
+
link?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Props for navigation sections that group related navigation items
|
|
47
|
+
*/
|
|
48
|
+
interface NavSectionProps {
|
|
49
|
+
/** Optional title for the navigation section */
|
|
50
|
+
title?: string;
|
|
51
|
+
/** Array of navigation items to display in this section */
|
|
52
|
+
items: NavItemProps[];
|
|
53
|
+
/** Whether the section is hidden */
|
|
54
|
+
hidden?: boolean;
|
|
55
|
+
/** Optional icon to display next to the section title */
|
|
56
|
+
icon?: React.ElementType;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Props for the sidebar body component that contains navigation sections
|
|
60
|
+
*/
|
|
61
|
+
interface SidebarBodyProps {
|
|
62
|
+
navSections: NavSectionProps[] | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Props for the sidebar root component
|
|
66
|
+
*/
|
|
67
|
+
interface SidebarRootProps extends SidebarProps {
|
|
68
|
+
pathname: string;
|
|
69
|
+
navItemsAs?: React.ElementType;
|
|
70
|
+
navItemsProps?: (item: NavItemProps) => Record<string, any>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Main props for the Sidebar component
|
|
74
|
+
*/
|
|
75
|
+
export interface SidebarProps extends Omit<DrawerRootProps, 'open'> {
|
|
76
|
+
/** Custom breakpoint configuration for responsive behavior */
|
|
77
|
+
breakpoints?: any[] | Partial<Record<string, any>>;
|
|
78
|
+
/** Whether the sidebar is currently open/visible */
|
|
79
|
+
open: boolean;
|
|
80
|
+
/** Function to control the sidebar open/close state */
|
|
81
|
+
setOpen: (val: boolean) => void;
|
|
82
|
+
/** Reference to the container element where the drawer portal should be rendered */
|
|
83
|
+
containerRef: RefObject<HTMLElement | null> | undefined;
|
|
84
|
+
/** Path to the active item */
|
|
85
|
+
activePath?: string;
|
|
86
|
+
/** Child components (Header, Body, Footer) to render inside the sidebar */
|
|
87
|
+
children: ReactNode;
|
|
88
|
+
/** Custom theme configuration for styling */
|
|
89
|
+
theme?: SidebarTheme;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Sidebar component - A responsive sidebar with navigation sections
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <Sidebar open={isOpen} setOpen={setIsOpen} containerRef={containerRef}>
|
|
97
|
+
* <Sidebar.Header>
|
|
98
|
+
* <Logo />
|
|
99
|
+
* </Sidebar.Header>
|
|
100
|
+
* <Sidebar.Body navSections={navigationSections} />
|
|
101
|
+
* </Sidebar>
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
declare const Sidebar: {
|
|
105
|
+
({ breakpoints, open, setOpen, containerRef, children, theme, ...props }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
NavItem: import('react').NamedExoticComponent<NavItemProps>;
|
|
107
|
+
NavSection: import('react').NamedExoticComponent<NavSectionProps>;
|
|
108
|
+
Body: import('react').NamedExoticComponent<SidebarBodyProps>;
|
|
109
|
+
Header({ children, ...props }: {
|
|
110
|
+
children: ReactNode;
|
|
111
|
+
} & Partial<BoxProps>): import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
Footer({ children, ...props }: {
|
|
113
|
+
children: ReactNode;
|
|
114
|
+
} & Partial<BoxProps>): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
Root: ({ pathname, navItemsAs, navItemsProps, ...props }: SidebarRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
116
|
+
};
|
|
117
|
+
export { Sidebar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tooltip as ChakraTooltip } from '@chakra-ui/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface TooltipProps extends ChakraTooltip.RootProps {
|
|
4
|
+
showArrow?: boolean;
|
|
5
|
+
portalled?: boolean;
|
|
6
|
+
portalRef?: React.RefObject<HTMLElement>;
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
contentProps?: ChakraTooltip.ContentProps;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IconButtonProps, SpanProps } from '@chakra-ui/react';
|
|
3
|
+
import { ThemeProviderProps } from 'next-themes';
|
|
4
|
+
export interface ColorModeProviderProps extends ThemeProviderProps {
|
|
5
|
+
}
|
|
6
|
+
export declare function ColorModeProvider(props: ColorModeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export type ColorMode = 'light' | 'dark';
|
|
8
|
+
export interface UseColorModeReturn {
|
|
9
|
+
colorMode: ColorMode;
|
|
10
|
+
setColorMode: (colorMode: ColorMode) => void;
|
|
11
|
+
toggleColorMode: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function useColorMode(): UseColorModeReturn;
|
|
14
|
+
export declare function useColorModeValue<T>(light: T, dark: T): T;
|
|
15
|
+
export declare function ColorModeIcon(): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface ColorModeButtonProps extends Omit<IconButtonProps, 'aria-label'> {
|
|
17
|
+
}
|
|
18
|
+
export declare const ColorModeButton: React.ForwardRefExoticComponent<ColorModeButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
export declare const LightMode: React.ForwardRefExoticComponent<SpanProps & React.RefAttributes<HTMLSpanElement>>;
|
|
20
|
+
export declare const DarkMode: React.ForwardRefExoticComponent<SpanProps & React.RefAttributes<HTMLSpanElement>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColumnFiltersState, SortingState } from '@tanstack/react-table';
|
|
2
|
+
import { DataTableProps } from '../components';
|
|
3
|
+
/**
|
|
4
|
+
* Custom hook for managing DataTable state and configuration
|
|
5
|
+
*/
|
|
6
|
+
export declare function useDataTable<TData>({ data, columns, pagination, enableFiltering, enableSorting, onFilterChange, onSortingChange, }: Pick<DataTableProps<TData>, 'data' | 'columns' | 'pagination' | 'enableFiltering' | 'enableSorting' | 'onFilterChange' | 'onSortingChange'>): {
|
|
7
|
+
table: import('@tanstack/table-core').Table<TData>;
|
|
8
|
+
columnFilters: ColumnFiltersState;
|
|
9
|
+
sorting: SortingState;
|
|
10
|
+
pageCount: number | undefined;
|
|
11
|
+
validatedPagination: import('../components').DataTablePagination | null;
|
|
12
|
+
};
|