@paygreen/pgui 2.14.10 → 3.0.0-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 +125 -59
- package/dist/components/actions-button/actions-button.d.ts +20 -0
- package/dist/components/data-list/datalist.d.ts +88 -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 +15 -0
- package/dist/components/input/input.d.ts +24 -0
- package/dist/components/input-mask/input-mask.d.ts +27 -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/loader/loader.d.ts +23 -0
- package/dist/components/logos/logoPaygreenByLemonway.d.ts +26 -0
- package/dist/components/modal/modal.d.ts +42 -0
- package/dist/components/pagination/pagination.d.ts +31 -0
- package/dist/components/select/select.d.ts +44 -0
- package/dist/components/sidebar/sidebar.d.ts +103 -0
- package/dist/components/ui/color-mode.d.ts +21 -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 +8355 -0
- package/dist/pgui.css +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/recipes/card-recipe.d.ts +18 -0
- package/dist/theme/recipes/index.d.ts +21 -0
- package/dist/theme/recipes/text-recipe.d.ts +2 -0
- package/dist/theme/semanticTokens/colors.d.ts +46 -0
- package/dist/theme/semanticTokens/index.d.ts +48 -0
- package/dist/theme/tokens/colors.d.ts +35 -0
- package/dist/theme/tokens/font-sizes.d.ts +42 -0
- package/dist/theme/tokens/fonts.d.ts +12 -0
- package/dist/theme/tokens/gradients.d.ts +6 -0
- package/dist/theme/tokens/index.d.ts +188 -0
- package/dist/theme/tokens/radii.d.ts +39 -0
- package/dist/theme/tokens/sizes.d.ts +57 -0
- package/package.json +94 -103
- package/src/components/date-picker/date-picker.css +206 -0
- package/src/components/select/select.css +75 -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,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,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SpinnerProps } from '@chakra-ui/react';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Loader component
|
|
5
|
+
*/
|
|
6
|
+
export interface LoaderProps extends SpinnerProps {
|
|
7
|
+
/** Whether the loader should be visible and spinning */
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
/** Size of the spinner */
|
|
10
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
11
|
+
/** Custom color for the spinner (overrides theme colors) */
|
|
12
|
+
color?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Loader component - A reusable loading spinner with theme-aware styling
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Loader isLoading={true} size="lg" />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const Loader: React.FC<LoaderProps>;
|
|
23
|
+
export { Loader };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the LogoPayGreenByLemonway component
|
|
4
|
+
*/
|
|
5
|
+
export interface LogoPayGreenByLemonwayProps {
|
|
6
|
+
/** Color of the logo - accepts any valid CSS color value or CSS variable */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** Width of the logo - accepts CSS units as string or number (pixels) */
|
|
9
|
+
width?: string | number;
|
|
10
|
+
/** Height of the logo - accepts CSS units as string or number (pixels) */
|
|
11
|
+
height?: string | number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* PayGreen by LemonWay logo component
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <LogoPayGreenByLemonway
|
|
19
|
+
* color="#00B956"
|
|
20
|
+
* width={200}
|
|
21
|
+
* height={80}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const LogoPayGreenByLemonway: FC<LogoPayGreenByLemonwayProps>;
|
|
26
|
+
export { LogoPayGreenByLemonway };
|
|
@@ -0,0 +1,42 @@
|
|
|
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: (value: any) => 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 open={isOpen} setOpen={setIsOpen}>
|
|
21
|
+
* <Modal.Header>Title</Modal.Header>
|
|
22
|
+
* <Modal.Body>Content goes here</Modal.Body>
|
|
23
|
+
* <Modal.Footer>
|
|
24
|
+
* <Button onClick={() => setIsOpen(false)}>Close</Button>
|
|
25
|
+
* </Modal.Footer>
|
|
26
|
+
* </Modal>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare const Modal: {
|
|
30
|
+
({ open, setOpen, children, ...rest }: ModalPropsWithExtensions): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
Header({ children }: {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
Body({ children }: {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
Footer({ children }: {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
42
|
+
export { Modal };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from '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
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Pagination component for navigating through paginated data
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Pagination
|
|
23
|
+
* page={currentPage}
|
|
24
|
+
* setPage={setCurrentPage}
|
|
25
|
+
* pageSize={10}
|
|
26
|
+
* totalItems={250}
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const Pagination: React.FC<PaginationProps>;
|
|
31
|
+
export { Pagination };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Props as ReactSelectProps } from 'react-select';
|
|
3
|
+
/**
|
|
4
|
+
* Option interface for Select component
|
|
5
|
+
*/
|
|
6
|
+
export interface SelectOptionType {
|
|
7
|
+
/** The value of the option */
|
|
8
|
+
value: string;
|
|
9
|
+
/** The label displayed for the option */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Whether the option is disabled */
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Props for Select component extending react-select props
|
|
16
|
+
*/
|
|
17
|
+
export interface SelectProps extends Omit<ReactSelectProps, 'options' | 'isMulti'> {
|
|
18
|
+
/** Array of options to display */
|
|
19
|
+
options?: SelectOptionType[];
|
|
20
|
+
/** Enable multi-selection */
|
|
21
|
+
isMulti?: boolean;
|
|
22
|
+
/** Enable async loading of options */
|
|
23
|
+
isAsync?: boolean;
|
|
24
|
+
/** Enable creating new options */
|
|
25
|
+
isCreatable?: boolean;
|
|
26
|
+
/** Custom test ID for testing */
|
|
27
|
+
'data-testid'?: string;
|
|
28
|
+
/** Function to load options asynchronously */
|
|
29
|
+
loadOptions?: (inputValue: string) => Promise<SelectOptionType[]>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A flexible Select component built on react-select
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Select
|
|
37
|
+
* options={[{value: 'option1', label: 'Option 1'}]}
|
|
38
|
+
* placeholder="Choose an option..."
|
|
39
|
+
* isClearable
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<any>>;
|
|
44
|
+
export { Select };
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
active?: 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
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Props for navigation sections that group related navigation items
|
|
45
|
+
*/
|
|
46
|
+
interface NavSectionProps {
|
|
47
|
+
/** Optional title for the navigation section */
|
|
48
|
+
title?: string;
|
|
49
|
+
/** Array of navigation items to display in this section */
|
|
50
|
+
items: NavItemProps[];
|
|
51
|
+
/** Optional icon to display next to the section title */
|
|
52
|
+
icon?: React.ElementType;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Props for the sidebar body component that contains navigation sections
|
|
56
|
+
*/
|
|
57
|
+
interface SidebarBodyProps {
|
|
58
|
+
/** Array of navigation sections to render in the sidebar body */
|
|
59
|
+
navSections: NavSectionProps[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Main props for the Sidebar component
|
|
63
|
+
*/
|
|
64
|
+
export interface SidebarProps extends Omit<DrawerRootProps, 'open'> {
|
|
65
|
+
/** Custom breakpoint configuration for responsive behavior */
|
|
66
|
+
breakpoints?: any[] | Partial<Record<string, any>>;
|
|
67
|
+
/** Whether the sidebar is currently open/visible */
|
|
68
|
+
open: boolean;
|
|
69
|
+
/** Function to control the sidebar open/close state */
|
|
70
|
+
setOpen: (val: boolean) => void;
|
|
71
|
+
/** Reference to the container element where the drawer portal should be rendered */
|
|
72
|
+
containerRef: RefObject<HTMLElement | null> | undefined;
|
|
73
|
+
/** Child components (Header, Body, Footer) to render inside the sidebar */
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
/** Custom theme configuration for styling */
|
|
76
|
+
theme?: SidebarTheme;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Sidebar component - A responsive sidebar with navigation sections
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```tsx
|
|
83
|
+
* <Sidebar open={isOpen} setOpen={setIsOpen} containerRef={containerRef}>
|
|
84
|
+
* <Sidebar.Header>
|
|
85
|
+
* <Logo />
|
|
86
|
+
* </Sidebar.Header>
|
|
87
|
+
* <Sidebar.Body navSections={navigationSections} />
|
|
88
|
+
* </Sidebar>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare const Sidebar: {
|
|
92
|
+
({ breakpoints, open, setOpen, containerRef, children, theme, ...props }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
NavItem: import('react').NamedExoticComponent<NavItemProps>;
|
|
94
|
+
NavSection: import('react').NamedExoticComponent<NavSectionProps>;
|
|
95
|
+
Body: import('react').NamedExoticComponent<SidebarBodyProps>;
|
|
96
|
+
Header({ children, ...props }: {
|
|
97
|
+
children: ReactNode;
|
|
98
|
+
} & Partial<BoxProps>): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
Footer({ children, ...props }: {
|
|
100
|
+
children: ReactNode;
|
|
101
|
+
} & Partial<BoxProps>): import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
};
|
|
103
|
+
export { Sidebar };
|
|
@@ -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
|
+
};
|