sy-ui-lib 1.0.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.
- package/README.md +89 -0
- package/dist/components/AdminBetSlip/AdminBetSlip.component.d.ts +32 -0
- package/dist/components/AdminBetSlip/AdminBetSlip.stories.d.ts +8 -0
- package/dist/components/AdminBetSlip/AdminBetSlip.types.d.ts +50 -0
- package/dist/components/AdminBetSlip/index.d.ts +3 -0
- package/dist/components/Avatar/Avatar.component.d.ts +18 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +6 -0
- package/dist/components/Avatar/Avatar.types.d.ts +13 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/BannerCard/BannerCard.component.d.ts +3 -0
- package/dist/components/BannerCard/BannerCard.stories.d.ts +6 -0
- package/dist/components/BannerCard/BannerCard.types.d.ts +12 -0
- package/dist/components/BannerCard/index.d.ts +3 -0
- package/dist/components/BetSlip/BetSlip.component.d.ts +88 -0
- package/dist/components/BetSlip/BetSlip.stories.d.ts +13 -0
- package/dist/components/BetSlip/BetSlip.types.d.ts +51 -0
- package/dist/components/BetSlip/index.d.ts +3 -0
- package/dist/components/BetSlipModal/BetSlipModal.component.d.ts +24 -0
- package/dist/components/BetSlipModal/BetSlipModal.stories.d.ts +11 -0
- package/dist/components/BetSlipModal/BetSlipModal.types.d.ts +8 -0
- package/dist/components/BetSlipModal/index.d.ts +3 -0
- package/dist/components/Button/Button.component.d.ts +33 -0
- package/dist/components/Button/Button.stories.d.ts +18 -0
- package/dist/components/Button/Button.types.d.ts +29 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.component.d.ts +27 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +16 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Chip/Chip.component.d.ts +21 -0
- package/dist/components/Chip/Chip.stories.d.ts +51 -0
- package/dist/components/Chip/Chip.types.d.ts +22 -0
- package/dist/components/Chip/index.d.ts +3 -0
- package/dist/components/Colors/Colors.component.d.ts +2 -0
- package/dist/components/Colors/Colors.stories.d.ts +6 -0
- package/dist/components/CommonMarketHeader/CommonMarketHeader.component.d.ts +3 -0
- package/dist/components/CommonMarketHeader/CommonMarketHeader.stories.d.ts +17 -0
- package/dist/components/CommonMarketHeader/CommonMarketHeader.types.d.ts +35 -0
- package/dist/components/CommonMarketHeader/index.d.ts +3 -0
- package/dist/components/CommonMarketRow/CommonMarketRow.component.d.ts +4 -0
- package/dist/components/CommonMarketRow/CommonMarketRow.stories.d.ts +9 -0
- package/dist/components/CommonMarketRow/CommonMarketRow.types.d.ts +151 -0
- package/dist/components/CommonMarketRow/CommonOddButton.component.d.ts +132 -0
- package/dist/components/CommonMarketRow/FancyOddsRow.component.d.ts +3 -0
- package/dist/components/CommonMarketRow/LayeredOddsRow.component.d.ts +3 -0
- package/dist/components/CommonMarketRow/PairOddsRow.component.d.ts +3 -0
- package/dist/components/CommonMarketRow/index.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.component.d.ts +28 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts +10 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +33 -0
- package/dist/components/DatePicker/index.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.component.d.ts +38 -0
- package/dist/components/Dropdown/Dropdown.stories.d.ts +10 -0
- package/dist/components/Dropdown/Dropdown.types.d.ts +26 -0
- package/dist/components/Dropdown/index.d.ts +3 -0
- package/dist/components/EventCard/EventCard.component.d.ts +48 -0
- package/dist/components/EventCard/EventCard.stories.d.ts +6 -0
- package/dist/components/EventCard/EventCard.types.d.ts +44 -0
- package/dist/components/EventCard/index.d.ts +3 -0
- package/dist/components/EventDisplayCard/EventDisplayCard.component.d.ts +24 -0
- package/dist/components/EventDisplayCard/EventDisplayCard.stories.d.ts +8 -0
- package/dist/components/EventDisplayCard/EventDisplayCard.types.d.ts +10 -0
- package/dist/components/EventDisplayCard/index.d.ts +3 -0
- package/dist/components/EventInfoCard/EventInfoCard.component.d.ts +38 -0
- package/dist/components/EventInfoCard/EventInfoCard.stories.d.ts +6 -0
- package/dist/components/EventInfoCard/EventInfoCard.types.d.ts +19 -0
- package/dist/components/EventInfoCard/index.d.ts +3 -0
- package/dist/components/FileUploader/FileUploader.component.d.ts +55 -0
- package/dist/components/FileUploader/FileUploader.stories.d.ts +8 -0
- package/dist/components/FileUploader/FileUploader.types.d.ts +23 -0
- package/dist/components/FileUploader/index.d.ts +3 -0
- package/dist/components/FlashNotification/FlashNotification.component.d.ts +34 -0
- package/dist/components/FlashNotification/FlashNotification.stories.d.ts +9 -0
- package/dist/components/FlashNotification/FlashNotification.types.d.ts +13 -0
- package/dist/components/FlashNotification/index.d.ts +3 -0
- package/dist/components/Icon/Icon.component.d.ts +20 -0
- package/dist/components/Icon/Icon.types.d.ts +43 -0
- package/dist/components/Icon/SvgIcons.d.ts +80 -0
- package/dist/components/Icon/index.d.ts +3 -0
- package/dist/components/ImageCard/ImageCard.component.d.ts +22 -0
- package/dist/components/ImageCard/ImageCard.stories.d.ts +9 -0
- package/dist/components/ImageCard/ImageCard.types.d.ts +8 -0
- package/dist/components/ImageCard/index.d.ts +3 -0
- package/dist/components/InputField/InputField.component.d.ts +28 -0
- package/dist/components/InputField/InputField.stories.d.ts +10 -0
- package/dist/components/InputField/InputField.types.d.ts +33 -0
- package/dist/components/InputField/index.d.ts +3 -0
- package/dist/components/Loader/Loader.component.d.ts +18 -0
- package/dist/components/Loader/Loader.stories.d.ts +14 -0
- package/dist/components/Loader/Loader.types.d.ts +8 -0
- package/dist/components/Loader/index.d.ts +3 -0
- package/dist/components/MaintenancePage/MaintenancePage.component.d.ts +37 -0
- package/dist/components/MaintenancePage/MaintenancePage.stories.d.ts +10 -0
- package/dist/components/MaintenancePage/MaintenancePage.types.d.ts +14 -0
- package/dist/components/MaintenancePage/index.d.ts +3 -0
- package/dist/components/Menu/Menu.component.d.ts +21 -0
- package/dist/components/Menu/Menu.stories.d.ts +7 -0
- package/dist/components/Menu/Menu.types.d.ts +24 -0
- package/dist/components/Menu/index.d.ts +3 -0
- package/dist/components/Modal/Modal.component.d.ts +39 -0
- package/dist/components/Modal/Modal.stories.d.ts +11 -0
- package/dist/components/Modal/Modal.types.d.ts +20 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.component.d.ts +22 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.stories.d.ts +10 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +22 -0
- package/dist/components/MultiSelectDropdown/index.d.ts +3 -0
- package/dist/components/NotFoundPage/NotFoundPage.component.d.ts +48 -0
- package/dist/components/NotFoundPage/NotFoundPage.stories.d.ts +11 -0
- package/dist/components/NotFoundPage/NotFoundPage.types.d.ts +13 -0
- package/dist/components/NotFoundPage/index.d.ts +3 -0
- package/dist/components/NotificationBanner/NotificationBanner.component.d.ts +39 -0
- package/dist/components/NotificationBanner/NotificationBanner.stories.d.ts +6 -0
- package/dist/components/NotificationBanner/NotificationBanner.types.d.ts +44 -0
- package/dist/components/NotificationBanner/index.d.ts +3 -0
- package/dist/components/NullState/NullState.component.d.ts +25 -0
- package/dist/components/NullState/NullState.stories.d.ts +14 -0
- package/dist/components/NullState/NullState.types.d.ts +22 -0
- package/dist/components/NullState/index.d.ts +3 -0
- package/dist/components/Pagination/Pagination.component.d.ts +23 -0
- package/dist/components/Pagination/Pagination.stories.d.ts +7 -0
- package/dist/components/Pagination/Pagination.types.d.ts +14 -0
- package/dist/components/Pagination/index.d.ts +3 -0
- package/dist/components/PasswordFieldGroup/PasswordFieldGroup.component.d.ts +28 -0
- package/dist/components/PasswordFieldGroup/PasswordFieldGroup.stories.d.ts +8 -0
- package/dist/components/PasswordFieldGroup/PasswordFieldGroup.types.d.ts +21 -0
- package/dist/components/PasswordFieldGroup/index.d.ts +3 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.component.d.ts +38 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.stories.d.ts +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.types.d.ts +6 -0
- package/dist/components/PhoneNumberInput/index.d.ts +3 -0
- package/dist/components/ProgressBar/ProgressBar.component.d.ts +22 -0
- package/dist/components/ProgressBar/ProgressBar.stories.d.ts +9 -0
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +12 -0
- package/dist/components/ProgressBar/index.d.ts +3 -0
- package/dist/components/RadioButton/RadioButton.component.d.ts +15 -0
- package/dist/components/RadioButton/RadioButton.stories.d.ts +8 -0
- package/dist/components/RadioButton/RadioButton.types.d.ts +31 -0
- package/dist/components/RadioButton/index.d.ts +3 -0
- package/dist/components/SearchBar/SearchBar.component.d.ts +18 -0
- package/dist/components/SearchBar/SearchBar.stories.d.ts +8 -0
- package/dist/components/SearchBar/SearchBar.types.d.ts +11 -0
- package/dist/components/SearchBar/index.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.component.d.ts +29 -0
- package/dist/components/Skeleton/Skeleton.stories.d.ts +6 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +26 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/SnackBar/SnackBar.component.d.ts +47 -0
- package/dist/components/SnackBar/SnackBar.stories.d.ts +8 -0
- package/dist/components/SnackBar/SnackBar.types.d.ts +41 -0
- package/dist/components/SnackBar/SnackBarQueue.d.ts +9 -0
- package/dist/components/SnackBar/SnackbarFetcher.d.ts +34 -0
- package/dist/components/SnackBar/SnackbarProvider.d.ts +25 -0
- package/dist/components/SnackBar/index.d.ts +4 -0
- package/dist/components/StatsList/StatsList.component.d.ts +34 -0
- package/dist/components/StatsList/StatsList.stories.d.ts +11 -0
- package/dist/components/StatsList/StatsList.types.d.ts +39 -0
- package/dist/components/StatsList/index.d.ts +3 -0
- package/dist/components/StatusDisplayCard/StatusDisplayCard.component.d.ts +20 -0
- package/dist/components/StatusDisplayCard/StatusDisplayCard.stories.d.ts +30 -0
- package/dist/components/StatusDisplayCard/StatusDisplayCard.types.d.ts +17 -0
- package/dist/components/StatusDisplayCard/index.d.ts +3 -0
- package/dist/components/Svgs/LoaderSvg.d.ts +2 -0
- package/dist/components/Svgs/NotFoundSvg.d.ts +2 -0
- package/dist/components/Svgs/NullStateAdminSvg.d.ts +2 -0
- package/dist/components/Svgs/NullStateUserSvg.d.ts +2 -0
- package/dist/components/Svgs/UnderMaintenanceSvg.d.ts +2 -0
- package/dist/components/Svgs/index.d.ts +6 -0
- package/dist/components/Swiper/Swiper.component.d.ts +37 -0
- package/dist/components/Swiper/Swiper.stories.d.ts +32 -0
- package/dist/components/Swiper/Swiper.types.d.ts +46 -0
- package/dist/components/Swiper/index.d.ts +3 -0
- package/dist/components/TabList/TabList.component.d.ts +37 -0
- package/dist/components/TabList/TabList.stories.d.ts +16 -0
- package/dist/components/TabList/TabList.types.d.ts +27 -0
- package/dist/components/TabList/index.d.ts +3 -0
- package/dist/components/Table/Table.component.d.ts +47 -0
- package/dist/components/Table/Table.stories.d.ts +25 -0
- package/dist/components/Table/Table.types.d.ts +28 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/TimePicker/TimePicker.component.d.ts +22 -0
- package/dist/components/TimePicker/TimePicker.stories.d.ts +8 -0
- package/dist/components/TimePicker/TimePicker.types.d.ts +22 -0
- package/dist/components/TimePicker/index.d.ts +3 -0
- package/dist/components/TitleBar/TitleBar.component.d.ts +22 -0
- package/dist/components/TitleBar/TitleBar.stories.d.ts +8 -0
- package/dist/components/TitleBar/TitleBar.types.d.ts +10 -0
- package/dist/components/TitleBar/index.d.ts +3 -0
- package/dist/components/Toggle/Toggle.component.d.ts +22 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +8 -0
- package/dist/components/Toggle/Toggle.types.d.ts +8 -0
- package/dist/components/Toggle/index.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.component.d.ts +19 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +10 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +11 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/TooltipExt/TooltipExt.component.d.ts +23 -0
- package/dist/components/TooltipExt/TooltipExt.stories.d.ts +19 -0
- package/dist/components/TooltipExt/TooltipExt.types.d.ts +11 -0
- package/dist/components/TooltipExt/index.d.ts +3 -0
- package/dist/components/Typography/Typography.component.d.ts +24 -0
- package/dist/components/Typography/Typography.stories.d.ts +8 -0
- package/dist/components/Typography/Typography.types.d.ts +54 -0
- package/dist/components/Typography/index.d.ts +3 -0
- package/dist/components/UserBetSlip/UserBetSlip.component.d.ts +45 -0
- package/dist/components/UserBetSlip/UserBetSlip.stories.d.ts +9 -0
- package/dist/components/UserBetSlip/UserBetSlip.types.d.ts +56 -0
- package/dist/components/UserBetSlip/index.d.ts +3 -0
- package/dist/components/WalletInfo/WalletInfo.component.d.ts +59 -0
- package/dist/components/WalletInfo/WalletInfo.stories.d.ts +7 -0
- package/dist/components/WalletInfo/WalletInfo.types.d.ts +25 -0
- package/dist/components/WalletInfo/index.d.ts +3 -0
- package/dist/components/ZIndex/ZIndex.component.d.ts +2 -0
- package/dist/components/ZIndex/ZIndex.stories.d.ts +5 -0
- package/dist/components/ZIndex/index.d.ts +2 -0
- package/dist/components/index.d.ts +50 -0
- package/dist/fonts/roboto-v48-latin-100.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-200.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-300.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-500.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-600.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-700.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-800.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-900.woff2 +0 -0
- package/dist/fonts/roboto-v48-latin-regular.woff2 +0 -0
- package/dist/images/404_Error_image.png +0 -0
- package/dist/images/female_avatar.png +0 -0
- package/dist/images/image_card.png +0 -0
- package/dist/images/loader.png +0 -0
- package/dist/images/male_avatar.png +0 -0
- package/dist/images/null_state_admin.png +0 -0
- package/dist/images/null_state_user.png +0 -0
- package/dist/images/under_maintenance.png +0 -0
- package/dist/index.cjs +59 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15014 -0
- package/dist/utils/commonFunctionality/commonFunctionality.d.ts +13 -0
- package/dist/utils/commonFunctionality/commonFunctionality.types.d.ts +3 -0
- package/dist/utils/commonFunctionality/index.d.ts +2 -0
- package/dist/utils/constants.d.ts +44 -0
- package/dist/utils/countryCodes.d.ts +6 -0
- package/dist/utils/paginationUtils.d.ts +10 -0
- package/dist/utils/useScreenSize.d.ts +3 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IconName } from '../Icon/Icon.types';
|
|
3
|
+
/** Props associated with Input Field component*/
|
|
4
|
+
export interface InputFieldProps {
|
|
5
|
+
/** The label text displayed above the input field. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** The HTML `id` attribute for the input, useful for accessibility and linking labels. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** The name of the input (used when submitting form data). */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** The type of input (e.g., `text`, `email`, `password`). Defaults to `text`. */
|
|
12
|
+
type?: "text" | "email" | "number" | "password";
|
|
13
|
+
/** Text displayed inside the input when it's empty. */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** If input field is required then pass 'true' otherwise 'false' */
|
|
16
|
+
isRequired?: boolean;
|
|
17
|
+
/** Shows an error state with red border and error message when `true`. */
|
|
18
|
+
hasError?: boolean;
|
|
19
|
+
/** The message displayed when there's an error and `hasError` is `true`. */
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
/** Disables the input field when `true`. */
|
|
22
|
+
isDisabled?: boolean;
|
|
23
|
+
/** The current value of the input. */
|
|
24
|
+
value?: string;
|
|
25
|
+
/** Optional custom CSS classes to style the input. */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Handler function called when the input value changes. */
|
|
28
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
29
|
+
/** Set an icon at the end of input field */
|
|
30
|
+
iconName?: IconName;
|
|
31
|
+
/** Handler function on icon onclick event. */
|
|
32
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LoaderProps } from './Loader.types';
|
|
2
|
+
/**
|
|
3
|
+
* Loader component
|
|
4
|
+
*
|
|
5
|
+
* A fullscreen loading indicator with:
|
|
6
|
+
* - Optional title text
|
|
7
|
+
* - Optional countdown timer
|
|
8
|
+
* - Optional completion callback
|
|
9
|
+
*
|
|
10
|
+
* @param {string} [title = "loading"] - Default loading message display below the spinner.
|
|
11
|
+
* @param {number} [duration] - Optional countdown duration in seconds.
|
|
12
|
+
* @param {Function}[onComplete] - Optional callback after countdown finishes.
|
|
13
|
+
*
|
|
14
|
+
* Example usage:
|
|
15
|
+
* <Loader title="Fetching data..." duration={5} onComplete={() => console.log("Done!")) />
|
|
16
|
+
*/
|
|
17
|
+
declare const Loader: React.FC<LoaderProps>;
|
|
18
|
+
export default Loader;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite/*';
|
|
2
|
+
import { default as Loader } from './Loader.component';
|
|
3
|
+
declare const meta: Meta<typeof Loader>;
|
|
4
|
+
export default meta;
|
|
5
|
+
/** Type alias for a story object of loader*/
|
|
6
|
+
type Story = StoryObj<typeof Loader>;
|
|
7
|
+
/** Default loader without title prop.*/
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
/** Default loader without title prop.*/
|
|
10
|
+
export declare const WithTitle: Story;
|
|
11
|
+
/** Default loader without title prop.*/
|
|
12
|
+
export declare const WithTimer: Story;
|
|
13
|
+
/** Loader with custom title message.*/
|
|
14
|
+
export declare const WithOnComplete: Story;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MaintenancePageProps } from './MaintenancePage.types';
|
|
3
|
+
/**
|
|
4
|
+
* MaintenancePage component
|
|
5
|
+
*
|
|
6
|
+
* Displays a full-page view indicating that the site is currently under maintenance.
|
|
7
|
+
* By default, it renders an SVG image (`UnderMaintenanceSvg`). You can override this by passing:
|
|
8
|
+
* - A custom image URL via `image.src`, or
|
|
9
|
+
* - A custom React component via `image.component` (e.g., your own SVG).
|
|
10
|
+
*
|
|
11
|
+
* The title and description can also be customized. Text size adapts based on screen size.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} [image] - Optional image shown above the title.
|
|
14
|
+
* @param {string} [image.src] - Path or URL of a custom image.
|
|
15
|
+
* @param {React.ComponentType<React.SVGProps<SVGSVGElement>>} [image.component] - A React component (e.g. SVG) to render instead of the default image.
|
|
16
|
+
* @param {string} [title] - Main heading text. Defaults to "🚧 Site Under Maintenance".
|
|
17
|
+
* @param {string} [description] - Supporting message text. Defaults to a scheduled update message.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* Default usage (renders UnderMaintenanceSvg)
|
|
21
|
+
* <MaintenancePage />
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* Use a custom image by URL
|
|
25
|
+
* <MaintenancePage
|
|
26
|
+
* image={{ src: "/custom-maintenance.svg", alt: "Custom maintenance image" }}
|
|
27
|
+
* />
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* Use a custom SVG component
|
|
31
|
+
* import MySvg from "./MySvg";
|
|
32
|
+
* <MaintenancePage
|
|
33
|
+
* image={{ component: <MySvg className="w-full h-auto" /> }}
|
|
34
|
+
* />
|
|
35
|
+
*/
|
|
36
|
+
declare const MaintenancePage: React.FC<MaintenancePageProps>;
|
|
37
|
+
export default MaintenancePage;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite/*';
|
|
2
|
+
import { default as MaintenancePage } from './MaintenancePage.component';
|
|
3
|
+
declare const meta: Meta<typeof MaintenancePage>;
|
|
4
|
+
export default meta;
|
|
5
|
+
/** Type alias for a story object of MaintenancePage*/
|
|
6
|
+
type Story = StoryObj<typeof MaintenancePage>;
|
|
7
|
+
/** Default maintenance message with fallback image and text.*/
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
/** Custom title and description.*/
|
|
10
|
+
export declare const Customize: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Props for the MaintenancePage component.*/
|
|
2
|
+
export interface MaintenancePageProps {
|
|
3
|
+
/** Optional image to show at the top of the page */
|
|
4
|
+
image?: {
|
|
5
|
+
/** Source path or URL of the image */
|
|
6
|
+
src: string;
|
|
7
|
+
/** A React component (e.g. SVG) to render instead of the default image.*/
|
|
8
|
+
component?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
9
|
+
};
|
|
10
|
+
/** Optional title displayed below the image */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Optional description text shown under the title */
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MenuProps } from './Menu.types';
|
|
3
|
+
/**
|
|
4
|
+
* Menu component
|
|
5
|
+
*
|
|
6
|
+
* Displays a vertical list of menu items with an optional last item that can include an icon.
|
|
7
|
+
*
|
|
8
|
+
* @param {MenuItemProps[]} items - Array of menu items to render.
|
|
9
|
+
* @param {LastItemsProps} [lastItem] - Optional last item with text, icon, and click handler.
|
|
10
|
+
*
|
|
11
|
+
* Example usage:
|
|
12
|
+
* <Menu
|
|
13
|
+
* items={[
|
|
14
|
+
* { text: "Profile", onClick: () => {} },
|
|
15
|
+
* { text: "Settings", onClick: () => {} },
|
|
16
|
+
* ]}
|
|
17
|
+
* lastItem={{ text: "Logout", iconName: "logout", onClick: () => console.log("Logout clicked") }}
|
|
18
|
+
* />
|
|
19
|
+
*/
|
|
20
|
+
declare const Menu: React.FC<MenuProps>;
|
|
21
|
+
export default Menu;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as Menu } from './Menu.component';
|
|
3
|
+
declare const meta: Meta<typeof Menu>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Menu>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithoutLastItem: Story;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IconName } from '../Icon';
|
|
2
|
+
/** Props for each individual menu item*/
|
|
3
|
+
export interface MenuItemProps {
|
|
4
|
+
/** Text label to display in the menu item*/
|
|
5
|
+
text: string;
|
|
6
|
+
/** Function called when this menu item is clicked*/
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
}
|
|
9
|
+
/** Props for the "last item" in the menu (like a logout button)*/
|
|
10
|
+
export interface LastItemsProps {
|
|
11
|
+
/** Optional text label for the last item*/
|
|
12
|
+
text?: string;
|
|
13
|
+
/** Optional icon name to show alongside the text*/
|
|
14
|
+
iconName?: IconName;
|
|
15
|
+
/** Function called when last item is clicked*/
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
}
|
|
18
|
+
/** Props for the Menu component itself*/
|
|
19
|
+
export interface MenuProps {
|
|
20
|
+
/** Array of regular menu items to display*/
|
|
21
|
+
items: MenuItemProps[];
|
|
22
|
+
/** Optional last item (e.g., logout) at the bottom of the menu*/
|
|
23
|
+
lastItem?: LastItemsProps;
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ModalProps } from './Modal.types';
|
|
2
|
+
/**
|
|
3
|
+
* Modal component to display overlay content with a header, body, and optional footer actions.
|
|
4
|
+
*
|
|
5
|
+
* @component
|
|
6
|
+
* @param {boolean} isOpen Controls visibility of the modal.
|
|
7
|
+
* @param {string} title Title displayed in the modal header.
|
|
8
|
+
* @param {() => void} onClose Callback to close the modal.
|
|
9
|
+
* @param {React.ReactNode} children Body content of the modal.
|
|
10
|
+
* @param {FooterCTAProps[]} [footerCTA] Optional array of footer buttons with their configurations.
|
|
11
|
+
* @param {boolean} enableBackdropClick Optional prop to close the modal when clicking outside the modal area.
|
|
12
|
+
* @param {boolean} showCancelIcon Optional prop to show header or not.
|
|
13
|
+
*
|
|
14
|
+
* @returns {JSX.Element | null} The rendered Modal component or null if not open.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Modal
|
|
18
|
+
* isOpen={isOpen}
|
|
19
|
+
* title="Confirm Action"
|
|
20
|
+
* onClose={handleClose}
|
|
21
|
+
* footerCTA={[
|
|
22
|
+
* {
|
|
23
|
+
* text: "Cancel",
|
|
24
|
+
* variant: "ghost",
|
|
25
|
+
* onClick: handleOnClose,
|
|
26
|
+
* },
|
|
27
|
+
* {
|
|
28
|
+
* text: "Create",
|
|
29
|
+
* variant: "primary",
|
|
30
|
+
* onClick: handleSave,
|
|
31
|
+
* type: "submit",
|
|
32
|
+
* },
|
|
33
|
+
* ]}
|
|
34
|
+
* >
|
|
35
|
+
* <p>Are you sure you want to perform this action?</p>
|
|
36
|
+
* </Modal>
|
|
37
|
+
*/
|
|
38
|
+
declare const Modal: React.FC<ModalProps>;
|
|
39
|
+
export default Modal;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ModalProps } from './Modal.types';
|
|
3
|
+
/**
|
|
4
|
+
* Storybook metadata configuration for Modal component.
|
|
5
|
+
* Includes title, component reference, and control settings.
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<ModalProps>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<ModalProps>;
|
|
10
|
+
export declare const DefaultModal: Story;
|
|
11
|
+
export declare const BankingModal: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ButtonProps } from '..';
|
|
2
|
+
/** Allowed button HTML types */
|
|
3
|
+
export type ButtonTypes = "button" | "submit" | "reset";
|
|
4
|
+
/** Props associated with Modal component */
|
|
5
|
+
export interface ModalProps {
|
|
6
|
+
/** Controls modal visibility */
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
/** Modal title text displayed in the header */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Function to run when closing the modal */
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
/** Content to render inside the modal body */
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/** Optional list of footer call-to-action buttons. */
|
|
15
|
+
footerCTA?: ButtonProps[];
|
|
16
|
+
/** Optional prop to close the modal when clicking outside the modal area.*/
|
|
17
|
+
enableBackdropClick?: boolean;
|
|
18
|
+
/** Optional prop to show cancel icon in header or not. */
|
|
19
|
+
showCancelIcon?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MultiSelectDropdownProps } from './MultiSelectDropdown.types';
|
|
2
|
+
/**
|
|
3
|
+
* MultiSelectDropdown Component
|
|
4
|
+
*
|
|
5
|
+
* Allows multiple selection from a dropdown using checkboxes.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} label - Placeholder label when no items selected
|
|
8
|
+
* @param {"sm" | "lg" | "full"} [size="sm"] - Dropdown size. Use `"sm"` for compact, `"lg"` for larger, and `"full"` for full width.
|
|
9
|
+
* @param {MultiSelectOptionValues[]} options - List of selectable items
|
|
10
|
+
* @param {MultiSelectOptionValues[]} selected - Currently selected items
|
|
11
|
+
* @param {(selected: MultiSelectOptionValues[]) => void} onSelect - Selection change handler
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <MultiSelectDropdown
|
|
15
|
+
* label="Choose tags"
|
|
16
|
+
* options={[{ label: "React", value: "react" }]}
|
|
17
|
+
* selected={[{ label: "React", value: "react" }]}
|
|
18
|
+
* onSelect={(items) => console.log(items)}
|
|
19
|
+
* />
|
|
20
|
+
*/
|
|
21
|
+
declare const MultiSelectDropdown: ({ label, size, options, selected, onSelect, }: MultiSelectDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default MultiSelectDropdown;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as MultiSelectDropdown } from './MultiSelectDropdown.component';
|
|
3
|
+
declare const meta: Meta<typeof MultiSelectDropdown>;
|
|
4
|
+
export default meta;
|
|
5
|
+
/** Type alias for a story object of Multiselect Dropdown.*/
|
|
6
|
+
type Story = StoryObj<typeof MultiSelectDropdown>;
|
|
7
|
+
/** Default story for the MultiSelectDropdown component.*/
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
/** Story example to showing a default selected value.*/
|
|
10
|
+
export declare const Selected: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface MultiSelectOptionValues {
|
|
2
|
+
/** The visible label shown in the dropdown list and selected state */
|
|
3
|
+
label: string;
|
|
4
|
+
/** The underlying value associated with the option */
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
/** Props associated with Dropdown component*/
|
|
8
|
+
export interface MultiSelectDropdownProps {
|
|
9
|
+
/** The fallback label to display when no option is selected. */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Defines the size of the dropdown button and options. default value is "sm" */
|
|
12
|
+
size?: "sm" | "lg" | "full";
|
|
13
|
+
/** List of dropdown options available for selection. */
|
|
14
|
+
options: MultiSelectOptionValues[];
|
|
15
|
+
/** Currently selected option. Must be one of the items from `options`. */
|
|
16
|
+
selected: MultiSelectOptionValues[];
|
|
17
|
+
/**
|
|
18
|
+
* Callback function that is triggered when a new option is selected.
|
|
19
|
+
* @param selected - The updated list of selected option objects.
|
|
20
|
+
*/
|
|
21
|
+
onSelect: (selected: MultiSelectOptionValues[]) => void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NotFoundPageProps } from './NotFoundPage.types';
|
|
3
|
+
/**
|
|
4
|
+
* NotFoundPage Component
|
|
5
|
+
*
|
|
6
|
+
* A reusable 404 error page component.
|
|
7
|
+
*
|
|
8
|
+
* By default, it renders an SVG illustration (`NotFoundSvg`) to indicate the page is not found.
|
|
9
|
+
* You can override this with:
|
|
10
|
+
* - A custom image URL via `image.src`, or
|
|
11
|
+
* - A custom React component via `image.component` (e.g., an inline SVG).
|
|
12
|
+
*
|
|
13
|
+
* You can also pass an optional button with custom props below the image.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} [image] - Optional image shown on the 404 page.
|
|
16
|
+
* @param {string} [image.src] - Path or URL of a custom image.
|
|
17
|
+
* @param {React.ComponentType<React.SVGProps<SVGSVGElement>>} [image.component] - A React component (e.g. SVG) to render instead of the default image.
|
|
18
|
+
* @param {ButtonProps} [buttonProps] - Optional props to render a button below the image.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* Default usage (renders NotFoundSvg)
|
|
22
|
+
* <NotFoundPage />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* Use a custom image via src
|
|
26
|
+
* <NotFoundPage
|
|
27
|
+
* image={{ src: "/images/404_custom.svg", alt: "Page not found" }}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* Use a custom component (e.g. inline SVG)
|
|
32
|
+
* import Custom404Svg from "./Custom404Svg";
|
|
33
|
+
* <NotFoundPage
|
|
34
|
+
* image={{ component: <Custom404Svg className="w-full h-auto" /> }}
|
|
35
|
+
* />
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* With a button
|
|
39
|
+
* <NotFoundPage
|
|
40
|
+
* buttonProps={{
|
|
41
|
+
* text: "Go Home",
|
|
42
|
+
* variant: "primary",
|
|
43
|
+
* onClick: () => navigate("/"),
|
|
44
|
+
* }}
|
|
45
|
+
* />
|
|
46
|
+
*/
|
|
47
|
+
declare const NotFoundPage: React.FC<NotFoundPageProps>;
|
|
48
|
+
export default NotFoundPage;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite/*';
|
|
2
|
+
import { default as NotFoundPage } from './NotFoundPage.component';
|
|
3
|
+
/** Storybook configuration for NotFoundPage component.*/
|
|
4
|
+
declare const meta: Meta<typeof NotFoundPage>;
|
|
5
|
+
export default meta;
|
|
6
|
+
/** Type alias for a NotFoundPage story*/
|
|
7
|
+
type Story = StoryObj<typeof NotFoundPage>;
|
|
8
|
+
/** Default view with placeholder image and no button */
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
/** 404 Page with a custom button */
|
|
11
|
+
export declare const WithButton: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonProps } from '..';
|
|
2
|
+
/** Props for the NotFoundPage component.*/
|
|
3
|
+
export interface NotFoundPageProps {
|
|
4
|
+
/** Optional image to show on the 404 page.*/
|
|
5
|
+
image?: {
|
|
6
|
+
/** Path or URL of a custom image.*/
|
|
7
|
+
src?: string;
|
|
8
|
+
/** A custom React component (e.g. SVG) to replace the default image. */
|
|
9
|
+
component?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
10
|
+
};
|
|
11
|
+
/** Optional props for the button below the image.*/
|
|
12
|
+
buttonProps?: ButtonProps;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NotificationBannerProps } from './NotificationBanner.types';
|
|
2
|
+
/**
|
|
3
|
+
* **NotificationBanner Component**
|
|
4
|
+
*
|
|
5
|
+
* A horizontally scrolling banner that continuously displays a list of upcoming
|
|
6
|
+
* events, announcements, or notifications. The content moves from right to left
|
|
7
|
+
* in a marquee-like style and pauses when hovered over.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @example
|
|
11
|
+
* <NotificationBanner
|
|
12
|
+
* data={[
|
|
13
|
+
* {
|
|
14
|
+
* title: "Upcoming",
|
|
15
|
+
* iconName: "calendar",
|
|
16
|
+
* events: [
|
|
17
|
+
* { timeLabel: "July 05 - July 06", description: "TAMIL NADU PREMIER LEAGUE 2025" },
|
|
18
|
+
* { timeLabel: "Tomorrow 12:50 PM", description: "IND vs AUS Match" },
|
|
19
|
+
* ],
|
|
20
|
+
* },
|
|
21
|
+
* {
|
|
22
|
+
* title: "Under Maintenance",
|
|
23
|
+
* iconName: "calendar",
|
|
24
|
+
* events: [
|
|
25
|
+
* { timeLabel: "July 05 - July 06", description: "TAMIL NADU PREMIER LEAGUE 2025" },
|
|
26
|
+
* ],
|
|
27
|
+
* },
|
|
28
|
+
* ]}
|
|
29
|
+
* scrollSpeed={120}
|
|
30
|
+
* defaultTitle="No upcoming events. Stay tuned!"
|
|
31
|
+
* />
|
|
32
|
+
* @param {NotificationBannerItem[]} data Array of notification items to display.
|
|
33
|
+
* @param {number} scrollSpeed Scroll speed in pixels per second. Defaults to 100.
|
|
34
|
+
* @param {string} defaultTitle Fallback text when no data is available. Defaults to "No upcoming events. Stay tuned!".
|
|
35
|
+
*
|
|
36
|
+
* @returns {JSX.Element} The rendered notification banner component.
|
|
37
|
+
*/
|
|
38
|
+
declare const NotificationBanner: React.FC<NotificationBannerProps>;
|
|
39
|
+
export default NotificationBanner;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as NotificationBanner } from './NotificationBanner.component';
|
|
3
|
+
declare const meta: Meta<typeof NotificationBanner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof NotificationBanner>;
|
|
6
|
+
export declare const BasicNotificationBanner: Story;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IconName } from '../Icon';
|
|
2
|
+
export interface NotificationBannerItemEvent {
|
|
3
|
+
/**
|
|
4
|
+
* The text content of the notification.
|
|
5
|
+
*/
|
|
6
|
+
description: string;
|
|
7
|
+
/**
|
|
8
|
+
* The date of the notification.
|
|
9
|
+
* Can be a string or Date object depending on usage.
|
|
10
|
+
*/
|
|
11
|
+
timeLabel: string;
|
|
12
|
+
}
|
|
13
|
+
export interface NotificationBannerItem {
|
|
14
|
+
/**
|
|
15
|
+
* Custom title to display at the start of the banner.
|
|
16
|
+
* Overrides the defaultTitle if provided.
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional icon to render alongside the banner title.
|
|
21
|
+
* Uses the `IconName` type from the Icon component.
|
|
22
|
+
*/
|
|
23
|
+
iconName?: IconName;
|
|
24
|
+
/**
|
|
25
|
+
* Array of notification items that will be displayed in the banner.
|
|
26
|
+
* These items will scroll if scrolling is enabled.
|
|
27
|
+
*/
|
|
28
|
+
events: NotificationBannerItemEvent[];
|
|
29
|
+
}
|
|
30
|
+
export interface NotificationBannerProps {
|
|
31
|
+
/**
|
|
32
|
+
* Array of notification items that will be displayed in the banner.
|
|
33
|
+
* These items will scroll if scrolling is enabled.
|
|
34
|
+
*/
|
|
35
|
+
data: NotificationBannerItem[];
|
|
36
|
+
/**
|
|
37
|
+
* Speed of the scrolling animation in pixels per second.
|
|
38
|
+
*/
|
|
39
|
+
scrollSpeed?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Fallback title to use when no custom title is provided.
|
|
42
|
+
*/
|
|
43
|
+
defaultTitle?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NullStateProps } from './NullState.types';
|
|
3
|
+
/**
|
|
4
|
+
* NullState Component:
|
|
5
|
+
*
|
|
6
|
+
* A reusable UI component for displaying an empty or placeholder state.
|
|
7
|
+
* with an image, optional title, description, and button.
|
|
8
|
+
* @param {string} [image.src] - URL for the null state image.
|
|
9
|
+
* @param {React.ComponentType<React.SVGProps<SVGSVGElement>>} [image.component] - A React component (e.g. SVG) to render instead of the default image.
|
|
10
|
+
* @param {string} [title] - Optional heading to show in the null state.
|
|
11
|
+
* @param {string} [description] - Optional description text.
|
|
12
|
+
* @param {Object} [buttonProps] - Optional button to prompt user action.
|
|
13
|
+
*
|
|
14
|
+
* <NullState
|
|
15
|
+
* src="/images/null_state_admin.png"
|
|
16
|
+
* title="No Data Found"
|
|
17
|
+
* description="There’s nothing to show right now. Please add new items to get started."
|
|
18
|
+
* buttonProps={{
|
|
19
|
+
* text: "Add Master",
|
|
20
|
+
* iconName: "addUser",
|
|
21
|
+
* }}
|
|
22
|
+
* />
|
|
23
|
+
*/
|
|
24
|
+
declare const NullState: React.FC<NullStateProps>;
|
|
25
|
+
export default NullState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as NullState } from './NullState.component';
|
|
3
|
+
declare const meta: Meta<typeof NullState>;
|
|
4
|
+
export default meta;
|
|
5
|
+
/** Type alias for a story object for null state */
|
|
6
|
+
type Story = StoryObj<typeof NullState>;
|
|
7
|
+
/**
|
|
8
|
+
* Admin Null State - Shows default admin illustration and full content.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
/**
|
|
12
|
+
* User Null State - Uses image with minimal content.
|
|
13
|
+
*/
|
|
14
|
+
export declare const UserNull: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IconName } from '../Icon/Icon.types';
|
|
2
|
+
export interface NullStateProps {
|
|
3
|
+
/** Optional image URL to show. If not provided, a default image will be shown.*/
|
|
4
|
+
image?: {
|
|
5
|
+
/** Source path or URL of the image (used if `component` is not provided). */
|
|
6
|
+
src?: string;
|
|
7
|
+
/** A custom React component (e.g. SVG) to replace the default image. */
|
|
8
|
+
component?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
9
|
+
};
|
|
10
|
+
title?: string;
|
|
11
|
+
/** Optional descriptive text providing more context about the null state.*/
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Here it is a CTA that can lead to change the state from null to something different.*/
|
|
14
|
+
buttonProps?: {
|
|
15
|
+
/** Text to display on the CTA button. */
|
|
16
|
+
text: string;
|
|
17
|
+
/** Optional icon to accompany the CTA button text. */
|
|
18
|
+
iconName?: IconName;
|
|
19
|
+
/** Optional click handler for the CTA button*/
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PaginationProps } from './Pagination.types';
|
|
2
|
+
/**
|
|
3
|
+
* Pagination component for navigating through paged content.
|
|
4
|
+
*
|
|
5
|
+
* Displays:
|
|
6
|
+
* - A list of page numbers (condensed with ellipsis when totalPages is large)
|
|
7
|
+
* - Navigation arrows (previous/next)
|
|
8
|
+
*
|
|
9
|
+
* @param {PaginationProps} props
|
|
10
|
+
* @param {number} props.currentPage - The currently active page (1-based index)
|
|
11
|
+
* @param {number} props.totalPages - The total number of pages
|
|
12
|
+
* @param {(page: number) => void} props.onPageChange - Callback invoked when a new page is selected
|
|
13
|
+
* @param {number} visiblePages - Number of visible page buttons around the current, default value is "5".
|
|
14
|
+
* @returns {JSX.Element} A responsive pagination control with page numbers and arrows
|
|
15
|
+
*
|
|
16
|
+
* <Pagination
|
|
17
|
+
* currentPage={3}
|
|
18
|
+
* totalPages={10}
|
|
19
|
+
* onPageChange={(page) => setPage(page)}
|
|
20
|
+
* />
|
|
21
|
+
*/
|
|
22
|
+
declare const Pagination: React.FC<PaginationProps>;
|
|
23
|
+
export default Pagination;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { PaginationProps } from './Pagination.types';
|
|
3
|
+
declare const meta: Meta<PaginationProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<PaginationProps>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CustomVisiblePages: Story;
|