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,14 @@
|
|
|
1
|
+
/** Props for the Pagination component */
|
|
2
|
+
export interface PaginationProps {
|
|
3
|
+
/** The currently active page number (1-based index) */
|
|
4
|
+
currentPage: number;
|
|
5
|
+
/** The total number of pages available*/
|
|
6
|
+
totalPages: number;
|
|
7
|
+
/**
|
|
8
|
+
* Callback function triggered when the page is changed
|
|
9
|
+
* @param page - The new page number to navigate to
|
|
10
|
+
*/
|
|
11
|
+
onPageChange: (page: number) => void;
|
|
12
|
+
/** Number of pagination buttons to show around the current page (Defaults '5') */
|
|
13
|
+
visiblePages?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PasswordFieldGroupProps } from './PasswordFieldGroup.types';
|
|
2
|
+
/**
|
|
3
|
+
* PasswordFieldGroup Component
|
|
4
|
+
*
|
|
5
|
+
* This component renders two input fields:
|
|
6
|
+
* - Password
|
|
7
|
+
* - Confirm Password
|
|
8
|
+
* It handles visibility toggling, validates if the two values match,
|
|
9
|
+
* and conditionally displays a success or error message.
|
|
10
|
+
*
|
|
11
|
+
* Props:
|
|
12
|
+
* @param {string} passwordLabel - Label text for the password field.
|
|
13
|
+
* @param {string} confirmPasswordLabel - Label text for the confirm password field.
|
|
14
|
+
* @param {boolean} showMismatchError - Whether to display error message when passwords do not match. Default: true.
|
|
15
|
+
* @param {string} mismatchErrorMessage - Error message shown when passwords do not match.
|
|
16
|
+
* @param {string} matchSuccessMessage - Success message shown when passwords match.
|
|
17
|
+
* @param {boolean} isRequired - Marks both fields as required. Default: false.
|
|
18
|
+
* @param {string} className - Optional Tailwind CSS classes for custom styling.
|
|
19
|
+
* @param {(password: string, confirmPassword: string, isMatching: boolean) => void} onChange - Callback triggered when either input value changes.
|
|
20
|
+
*
|
|
21
|
+
* Example usage:
|
|
22
|
+
* <PasswordFieldGroup
|
|
23
|
+
* isRequired
|
|
24
|
+
* onChange={(password, confirmPassword, match) => console.log(password, confirmPassword, match)}
|
|
25
|
+
* />
|
|
26
|
+
*/
|
|
27
|
+
declare const PasswordFieldGroup: React.FC<PasswordFieldGroupProps>;
|
|
28
|
+
export default PasswordFieldGroup;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as PasswordFieldGroup } from './PasswordFieldGroup.component';
|
|
3
|
+
declare const meta: Meta<typeof PasswordFieldGroup>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof PasswordFieldGroup>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithCustomErrorMessage: Story;
|
|
8
|
+
export declare const WithoutRequire: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface PasswordFieldGroupProps {
|
|
2
|
+
/** Label for password field */
|
|
3
|
+
passwordLabel?: string;
|
|
4
|
+
/** Label for confirm password field */
|
|
5
|
+
confirmPasswordLabel?: string;
|
|
6
|
+
/** Whether to show an error when passwords mismatch */
|
|
7
|
+
showMismatchError?: boolean;
|
|
8
|
+
/** Text shown when passwords do not match */
|
|
9
|
+
mismatchErrorMessage?: string;
|
|
10
|
+
/** Text shown when passwords is matched */
|
|
11
|
+
matchSuccessMessage?: string;
|
|
12
|
+
/** If fields are required */
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Triggered on any input change
|
|
16
|
+
* @param password string
|
|
17
|
+
* @param confirmPassword string
|
|
18
|
+
* @param isMatching boolean
|
|
19
|
+
*/
|
|
20
|
+
onChange?: (password: string, confirmPassword: string, isMatching: boolean) => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PhoneNumberInputProps } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* PhoneNumberInput Component
|
|
4
|
+
*
|
|
5
|
+
* A fully controlled input component for phone numbers with country code selection.
|
|
6
|
+
* Supports validation, error display, disabled state, and dropdown for selecting countries.
|
|
7
|
+
*
|
|
8
|
+
* Props:
|
|
9
|
+
* @param {string} label - The label text displayed above the input field.
|
|
10
|
+
* @param {string} value - The current input value in the format "countryCode-phoneNumber".
|
|
11
|
+
* @param {(value: string) => void} onChange - Handler function called when the input value changes.
|
|
12
|
+
* @param {string} placeholder - Text displayed inside the input when empty.
|
|
13
|
+
* @param {boolean} isRequired - If true, shows a required indicator (*) next to the label.
|
|
14
|
+
* @param {boolean} isDisabled - Disables the input field and dropdown when true.
|
|
15
|
+
* @param {string} errorMessage - The message displayed when the input has an error.
|
|
16
|
+
* @param {string} className - Optional custom CSS classes for the input element.
|
|
17
|
+
* @param {...rest} - Any other native HTML input props.
|
|
18
|
+
*
|
|
19
|
+
* Behavior:
|
|
20
|
+
* - Only numeric input is allowed in the phone number part; non-numeric input triggers an error state.
|
|
21
|
+
* - Clicking outside the country code dropdown closes it automatically.
|
|
22
|
+
* - Selected country is highlighted in the dropdown.
|
|
23
|
+
* - Dynamically updates border and text color based on error state.
|
|
24
|
+
*
|
|
25
|
+
* Example usage:
|
|
26
|
+
* <PhoneNumberInput
|
|
27
|
+
* label="Phone"
|
|
28
|
+
* value={value}
|
|
29
|
+
* onChange={setValue}
|
|
30
|
+
* placeholder="Enter phone number"
|
|
31
|
+
* isRequired
|
|
32
|
+
* errorMessage="Only numbers allowed"
|
|
33
|
+
* isDisabled={false}
|
|
34
|
+
* />
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
declare const PhoneNumberInput: React.FC<PhoneNumberInputProps>;
|
|
38
|
+
export default PhoneNumberInput;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { PhoneNumberInputProps } from './PhoneNumberInput.types';
|
|
3
|
+
declare const meta: Meta<PhoneNumberInputProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<PhoneNumberInputProps>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const ErrorStory: Story;
|
|
8
|
+
export declare const DisabledStory: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputFieldProps } from '../InputField';
|
|
2
|
+
/** Props associated with PhoneNumberInput component */
|
|
3
|
+
export interface PhoneNumberInputProps extends Omit<InputFieldProps, "type" | "iconName" | "onClick" | "onChange"> {
|
|
4
|
+
/** Handler function called when the phone input value changes. Receives the new value as a string. */
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ProgressBarProps } from './ProgressBar.types';
|
|
2
|
+
/**
|
|
3
|
+
* ProgressBar Component
|
|
4
|
+
*
|
|
5
|
+
* Displays a multi-step horizontal progress indicator with three visual states —
|
|
6
|
+
* `completed`, `inProgress`, and `pending`.
|
|
7
|
+
* Each step includes a circular visual indicator and a text label with full Typography support.
|
|
8
|
+
* Titles use the Typography component, allowing any variant or color.
|
|
9
|
+
*
|
|
10
|
+
* @param {ProgressBarProps} props.steps - Array of step objects defining title and status.
|
|
11
|
+
*
|
|
12
|
+
* Example usage:
|
|
13
|
+
* <ProgressBar
|
|
14
|
+
* steps={[
|
|
15
|
+
* { title: { text: "Payment Completed" }, status: "completed" },
|
|
16
|
+
* { title: { text: "Upload Payment Slip" }, status: "inProgress" },
|
|
17
|
+
* { title: { text: "Request Successful" }, status: "pending" },
|
|
18
|
+
* ]}
|
|
19
|
+
* />
|
|
20
|
+
*/
|
|
21
|
+
declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
22
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite/*';
|
|
2
|
+
import { default as ProgressBar } from './ProgressBar.component';
|
|
3
|
+
declare const meta: Meta<typeof ProgressBar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ProgressBar>;
|
|
6
|
+
/** Default ProgressBar with standard step statuses */
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
/** Example showing custom Typography variants and colors */
|
|
9
|
+
export declare const CustomTypography: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TypographyProps } from '../Typography';
|
|
2
|
+
/** A single step in the progress bar */
|
|
3
|
+
export interface ProgressBarStep {
|
|
4
|
+
/** Typography configuration for the step title (text required, others optional) */
|
|
5
|
+
title: Pick<TypographyProps, "text"> & Partial<Omit<TypographyProps, "text">>;
|
|
6
|
+
status: "completed" | "inProgress" | "pending";
|
|
7
|
+
}
|
|
8
|
+
/** Props for the ProgressBar component */
|
|
9
|
+
export interface ProgressBarProps {
|
|
10
|
+
/** Array of progress steps */
|
|
11
|
+
steps: ProgressBarStep[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RadioGroupProps } from './RadioButton.types';
|
|
2
|
+
/**
|
|
3
|
+
* RadioGroup component for rendering a group of radio buttons.
|
|
4
|
+
* Supports both controlled and uncontrolled usage.
|
|
5
|
+
*
|
|
6
|
+
* @component
|
|
7
|
+
* @param {RadioOptions[]} options - List of options to render as radio buttons.
|
|
8
|
+
* @param {string} [selectedValue] - Selected value for controlled mode.
|
|
9
|
+
* @param {string} [defaultValue=""] - Initial selected value for uncontrolled mode.
|
|
10
|
+
* @param {(value: string) => void} [onChange] - Callback when a radio is selected.
|
|
11
|
+
* @param {boolean} [disabled=false] - Disables all buttons in the group.
|
|
12
|
+
* @param {string} [name] - Name for the radio group
|
|
13
|
+
*/
|
|
14
|
+
declare const RadioGroup: ({ options, selectedValue, defaultValue, onChange, disabled, name, }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default RadioGroup;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as RadioGroup } from './RadioButton.component';
|
|
3
|
+
declare const meta: Meta<typeof RadioGroup>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof RadioGroup>;
|
|
6
|
+
export declare const BasicRadioGroup: Story;
|
|
7
|
+
export declare const ControlledRadioGroup: Story;
|
|
8
|
+
export declare const DisabledRadioGroup: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface RadioOptions {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
}
|
|
5
|
+
export interface RadioGroupProps {
|
|
6
|
+
/**
|
|
7
|
+
* Array of options to render radio buttons.
|
|
8
|
+
* Example: ['Option 1', 'Option 2']
|
|
9
|
+
*/
|
|
10
|
+
options: RadioOptions[];
|
|
11
|
+
/**
|
|
12
|
+
* Name for the radio group (prevents conflicts).
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Currently selected value (for controlled usage).
|
|
17
|
+
*/
|
|
18
|
+
selectedValue?: string | number;
|
|
19
|
+
/**
|
|
20
|
+
* Default selected value (for uncontrolled usage).
|
|
21
|
+
*/
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Callback triggered when selected value changes.
|
|
25
|
+
*/
|
|
26
|
+
onChange?: (value: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Disables all radio buttons in the group.
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SearchBarProps } from './SearchBar.types';
|
|
2
|
+
/**
|
|
3
|
+
* SearchBar Component
|
|
4
|
+
*
|
|
5
|
+
* This component use for getting searching input text
|
|
6
|
+
*
|
|
7
|
+
* Props:
|
|
8
|
+
* @param {string} placeholder Placeholder text shown when the input is empty.
|
|
9
|
+
* @param {"sm" | "lg" | "full"} size Defines the size of the input ("small", "large" or "fullWidth"). Default: "small".
|
|
10
|
+
* @param {void} onSearch Callback triggered on input value change.
|
|
11
|
+
* @param {number} debounceTime Set debounce time default value is "500" milliseconds.
|
|
12
|
+
* @param {string} className Additional Tailwind CSS classes for custom styling. Default: "".
|
|
13
|
+
*
|
|
14
|
+
* Example usage:
|
|
15
|
+
* <SearchBar placeholder='Search here' size = 'sm' />
|
|
16
|
+
*/
|
|
17
|
+
declare const SearchBar: React.FC<SearchBarProps>;
|
|
18
|
+
export default SearchBar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SearchBarProps } from './SearchBar.types';
|
|
3
|
+
declare const meta: Meta<SearchBarProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<SearchBarProps>;
|
|
6
|
+
export declare const SmallSize: Story;
|
|
7
|
+
export declare const LargeSize: Story;
|
|
8
|
+
export declare const SearchWithDebounce: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Props associated with SearchBar component*/
|
|
2
|
+
export interface SearchBarProps {
|
|
3
|
+
/** Placeholder text shown when the input is empty. */
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
/** Defines the size of the input ("sm" or "lg"). */
|
|
6
|
+
size?: "sm" | "lg" | "full";
|
|
7
|
+
/** Callback triggered on input value change. */
|
|
8
|
+
onSearch?: (value: string) => void;
|
|
9
|
+
/** Set debounce time and default time is "500" milliseconds. */
|
|
10
|
+
debounceTime?: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SkeletonProps } from './Skeleton.types';
|
|
2
|
+
/**
|
|
3
|
+
* Skeleton Component
|
|
4
|
+
*
|
|
5
|
+
* A customizable placeholder loader component that mimics the shape of the content being loaded.
|
|
6
|
+
* Supports different variants (text, rectangle, circle), custom sizes, and multiple instances.
|
|
7
|
+
*
|
|
8
|
+
* @param {'text' | 'rect' | 'circle'} variant - Shape of the skeleton: text, rect, or circle.
|
|
9
|
+
* @param {number|string} width - Width of the skeleton. Accepts number (as px) or string (%, rem, etc).
|
|
10
|
+
* @param {number|string} height - Height of the skeleton. Accepts number (as px) or string (%, rem, etc).
|
|
11
|
+
* @param {number} count - Number of skeleton elements to render, default value 1.
|
|
12
|
+
* @param {string} className - Additional Tailwind classes for styling.
|
|
13
|
+
*
|
|
14
|
+
* @returns {JSX.Element} Rendered skeleton(s) based on the provided props.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Single text-style skeleton
|
|
18
|
+
* <Skeleton width={200} height={16} />
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Circle avatar skeleton
|
|
22
|
+
* <Skeleton variant="circle" width={40} height={40} />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Multiple skeleton lines
|
|
26
|
+
* <Skeleton count={3} width="100%" height={14} className="mb-2" />
|
|
27
|
+
*/
|
|
28
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
29
|
+
export default Skeleton;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available shape variants for the Skeleton component.
|
|
3
|
+
* - 'text': Rounded small skeleton line, like a text placeholder.
|
|
4
|
+
* - 'rect': Standard rectangle, like a block or image placeholder.
|
|
5
|
+
* - 'circle': Perfect circle, useful for avatars or icons.
|
|
6
|
+
*/
|
|
7
|
+
export type SkeletonVariant = "text" | "rect" | "circle";
|
|
8
|
+
/** Props for the Skeleton component. */
|
|
9
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
/** Shape of the skeleton element. default - 'text' */
|
|
11
|
+
variant?: SkeletonVariant;
|
|
12
|
+
/**
|
|
13
|
+
* Width of the skeleton element.
|
|
14
|
+
* Accepts a number (px) or string (%, rem, etc).
|
|
15
|
+
*/
|
|
16
|
+
width?: number | string;
|
|
17
|
+
/**
|
|
18
|
+
* Height of the skeleton element.
|
|
19
|
+
* Accepts a number (px) or string (%, rem, etc).
|
|
20
|
+
*/
|
|
21
|
+
height?: number | string;
|
|
22
|
+
/** Number of skeleton elements to render. default 1 */
|
|
23
|
+
count?: number;
|
|
24
|
+
/** Optional Tailwind utility classes to apply to the skeleton. */
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SnackBarProps } from './SnackBar.types';
|
|
3
|
+
/**
|
|
4
|
+
* Internal Snackbar component
|
|
5
|
+
*
|
|
6
|
+
* ⚠️ This component is rendered automatically by `SnackbarProvider`.
|
|
7
|
+
* You should not use it directly in your app.
|
|
8
|
+
*
|
|
9
|
+
* Instead, trigger snackbars globally using the `snackbar` utility.
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* ✅ Example usage (via utility):
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* import { snackbar } from "@/components/Snackbar/SnackbarFetcher";
|
|
16
|
+
*
|
|
17
|
+
* Default snackbar:
|
|
18
|
+
* snackbar.success("Data saved");
|
|
19
|
+
*
|
|
20
|
+
* With dismiss button:
|
|
21
|
+
* snackbar.error("Something went wrong", {
|
|
22
|
+
* variant: "dismiss",
|
|
23
|
+
* dismissProps: { title: "Close" },
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* With action button:
|
|
27
|
+
* snackbar.info("Upload failed", {
|
|
28
|
+
* variant: "action",
|
|
29
|
+
* actionProps: {
|
|
30
|
+
* actionLabel: "Retry",
|
|
31
|
+
* onAction: () => retryUpload(),
|
|
32
|
+
* },
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* @component
|
|
36
|
+
* @param {string} message - The message text to show in the snackbar.
|
|
37
|
+
* @param {"info" | "success" | "error"} [type="info"] - The type of snackbar (affects color).
|
|
38
|
+
* @param {"default" | "action" | "dismiss"} [variant="default"] - Type of interaction allowed.
|
|
39
|
+
* @param {number} [duration=3000] - Duration in milliseconds before it auto-dismisses.
|
|
40
|
+
* @param {ActionProps} [actionProps] - Props for action button (used with variant: "action").
|
|
41
|
+
* @param {DismissProps} [dismissProps] - Props for dismiss button (used with variant: "dismiss").
|
|
42
|
+
* @param {() => void} onClose - Called when snackbar closes (internal).
|
|
43
|
+
*/
|
|
44
|
+
declare const Snackbar: React.FC<SnackBarProps & {
|
|
45
|
+
onClose: () => void;
|
|
46
|
+
}>;
|
|
47
|
+
export default Snackbar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as SnackbarProvider } from './SnackbarProvider';
|
|
3
|
+
/** Storybook metadata for the SnackbarProvider component */
|
|
4
|
+
declare const meta: Meta<typeof SnackbarProvider>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof SnackbarProvider>;
|
|
7
|
+
/** Story using Storybook controls to trigger different snackbar variants */
|
|
8
|
+
export declare const ControlledSnackbar: Story;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Types of snackbar variants. */
|
|
2
|
+
export type SnackBarVariant = "default" | "action" | "dismiss";
|
|
3
|
+
/** Types of snackbar message types. */
|
|
4
|
+
export type SnackBarType = "info" | "success" | "error";
|
|
5
|
+
/** Props for the Action button (only for "action" variant) */
|
|
6
|
+
export interface ActionProps {
|
|
7
|
+
/** Label for the action button (only for "action" variant) */
|
|
8
|
+
actionLabel: string;
|
|
9
|
+
/** Callback for the action button (only for "action" variant) */
|
|
10
|
+
onAction: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** Props for the Dismiss button (only for "dismiss" variant) */
|
|
13
|
+
export interface DismissProps {
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
/** Base props common to all snackbar variants */
|
|
17
|
+
interface SnackBarBaseProps {
|
|
18
|
+
/** Message text to display in the snackbar */
|
|
19
|
+
message: string;
|
|
20
|
+
/** Time (in milliseconds) before the snackbar auto-dismisses */
|
|
21
|
+
duration?: number;
|
|
22
|
+
/** Type of message (info, success, error) to control the snackbar color */
|
|
23
|
+
type?: SnackBarType;
|
|
24
|
+
}
|
|
25
|
+
/** Props for the default variant */
|
|
26
|
+
interface DefaultSnackBarProps extends SnackBarBaseProps {
|
|
27
|
+
variant: "default";
|
|
28
|
+
}
|
|
29
|
+
/** Props for the dismiss variant */
|
|
30
|
+
interface DismissSnackBarProps extends SnackBarBaseProps {
|
|
31
|
+
variant: "dismiss";
|
|
32
|
+
dismissProps: DismissProps;
|
|
33
|
+
}
|
|
34
|
+
/** Props for the action variant */
|
|
35
|
+
interface ActionSnackBarProps extends SnackBarBaseProps {
|
|
36
|
+
variant: "action";
|
|
37
|
+
actionProps: ActionProps;
|
|
38
|
+
}
|
|
39
|
+
/** Combined discriminated union type */
|
|
40
|
+
export type SnackBarProps = DefaultSnackBarProps | DismissSnackBarProps | ActionSnackBarProps;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SnackBarProps } from './SnackBar.types';
|
|
2
|
+
declare let pushSnackbar: (props: SnackBarProps) => void;
|
|
3
|
+
/** External queue interface to trigger snackbars from anywhere */
|
|
4
|
+
export declare const snackbarQueue: {
|
|
5
|
+
show: (props: SnackBarProps) => void;
|
|
6
|
+
};
|
|
7
|
+
/** Set the internal push handler (called by the SnackbarProvider) */
|
|
8
|
+
export declare const setPushSnackbar: (fn: typeof pushSnackbar) => void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Options for displaying a snackbar, based on the variant type.*/
|
|
2
|
+
type SnackbarOptions = {
|
|
3
|
+
/** Default variant */
|
|
4
|
+
variant: "default";
|
|
5
|
+
/** Auto-close duration (ms) */
|
|
6
|
+
duration?: number;
|
|
7
|
+
} | {
|
|
8
|
+
/** Action variant */
|
|
9
|
+
variant: "action";
|
|
10
|
+
duration?: number;
|
|
11
|
+
/** Action button config */
|
|
12
|
+
actionProps: {
|
|
13
|
+
actionLabel: string;
|
|
14
|
+
onAction: () => void;
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
/** Dismiss variant */
|
|
18
|
+
variant: "dismiss";
|
|
19
|
+
duration?: number;
|
|
20
|
+
/** Dismiss button config */
|
|
21
|
+
dismissProps: {
|
|
22
|
+
title: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** Trigger global snackbars.*/
|
|
26
|
+
export declare const snackbar: {
|
|
27
|
+
/** Show success snackbar */
|
|
28
|
+
success: (message: string, options?: SnackbarOptions) => void;
|
|
29
|
+
/** Show error snackbar */
|
|
30
|
+
error: (message: string, options?: SnackbarOptions) => void;
|
|
31
|
+
/** Show info snackbar */
|
|
32
|
+
info: (message: string, options?: SnackbarOptions) => void;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SnackbarProvider
|
|
4
|
+
*
|
|
5
|
+
* Global provider to display toast/snackbar notifications via a portal.
|
|
6
|
+
* Mount it once at the app root (e.g., in `App.tsx`).
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* 1. Add provider:
|
|
10
|
+
* <MainRouter />
|
|
11
|
+
* <SnackbarProvider />
|
|
12
|
+
* ```
|
|
13
|
+
* 2. Trigger notifications:
|
|
14
|
+
* snackbar.success("Saved!");
|
|
15
|
+
* snackbar.error("Error", { variant: "dismiss" });
|
|
16
|
+
* snackbar.info("Retry?", { variant: "action", actionProps: { ... } });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Notes:
|
|
20
|
+
* - Automatically renders all snackbars.
|
|
21
|
+
* - No need to use `<Snackbar />` manually.
|
|
22
|
+
* - `snackbar.*` functions work only if this provider is mounted.
|
|
23
|
+
*/
|
|
24
|
+
declare const SnackbarProvider: React.FC;
|
|
25
|
+
export default SnackbarProvider;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StatsListProp } from './StatsList.types';
|
|
3
|
+
/**
|
|
4
|
+
* StatsList Component:
|
|
5
|
+
*
|
|
6
|
+
* Displays a list of statistical data in three layout variants: `card`, `linear`, or `gradient`.
|
|
7
|
+
*
|
|
8
|
+
* - In `card` mode: shows each stat in a scrollable card layout with "PTH" prefix before the value.
|
|
9
|
+
* - Supports an optional info icon (ℹ) when `tooltipProps` is provided.
|
|
10
|
+
* - On hover, a tooltip displays additional details for the card.
|
|
11
|
+
* - In `linear` mode: shows stats inline with the title and value.
|
|
12
|
+
* - In `gradient` mode: Displays stats in a flexible layout with a transparent gradient background.
|
|
13
|
+
*
|
|
14
|
+
* Props:
|
|
15
|
+
* @param {"card" | "linear" | "gradient"} [type="linear"] - Determines the layout style of the stats list.
|
|
16
|
+
* @param {StatItem[]} [statItems] - Array of stat items with name and value object.
|
|
17
|
+
* StatItem[statTitle] Optional. In `card` variant, shows an info icon with tooltip.
|
|
18
|
+
* - `title`: Tooltip text.
|
|
19
|
+
* - `position`: Tooltip placement (default `"top"`).
|
|
20
|
+
*
|
|
21
|
+
* Example usage:
|
|
22
|
+
* <StatsList
|
|
23
|
+
* type="card"
|
|
24
|
+
* statItems={[
|
|
25
|
+
* {
|
|
26
|
+
* statName: { title: "Total Balance", color: "primary" },
|
|
27
|
+
* statValue: { value: "10343.34", color: "success"},
|
|
28
|
+
* statTitle: { title: "This is your total balance including deposits & winnings.", position: "right" }
|
|
29
|
+
* }
|
|
30
|
+
* ]}
|
|
31
|
+
* />
|
|
32
|
+
*/
|
|
33
|
+
declare const StatsList: React.FC<StatsListProp>;
|
|
34
|
+
export default StatsList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { StatsList } from '..';
|
|
3
|
+
declare const meta: Meta<typeof StatsList>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof StatsList>;
|
|
6
|
+
/** Card Story: Displays the StatsList in a card layout. */
|
|
7
|
+
export declare const Card: Story;
|
|
8
|
+
/** Linear Story: Displays the stats in a horizontal linear layout. */
|
|
9
|
+
export declare const Linear: Story;
|
|
10
|
+
/** Gradient Story: Displays the stats in a gradient-styled layout */
|
|
11
|
+
export declare const Gradient: Story;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TooltipPositionExt, TypoColor } from '..';
|
|
2
|
+
/** Layout options for the StatsList component. */
|
|
3
|
+
export type StatType = "linear" | "card" | "gradient";
|
|
4
|
+
/** Title selection of the stat item. */
|
|
5
|
+
export interface StatName {
|
|
6
|
+
/** The title or the label of the stat. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Optional color for the stat title. */
|
|
9
|
+
color?: TypoColor;
|
|
10
|
+
}
|
|
11
|
+
/** Value selection of the stat item. */
|
|
12
|
+
export interface StatValue {
|
|
13
|
+
/** The value of the stat*/
|
|
14
|
+
value: string | number;
|
|
15
|
+
/** Optional color of the stat value. */
|
|
16
|
+
color?: TypoColor;
|
|
17
|
+
}
|
|
18
|
+
export interface statTooltipProps {
|
|
19
|
+
/** Content displayed inside the tooltip. Supports text, numbers, JSX, or components. */
|
|
20
|
+
title?: string | number | React.ReactNode;
|
|
21
|
+
/** Position of the tooltip relative to the hovered element. Defaults to "right" if not provided.*/
|
|
22
|
+
position?: TooltipPositionExt;
|
|
23
|
+
}
|
|
24
|
+
/** Single Item inside the stats list. */
|
|
25
|
+
export interface StatItem {
|
|
26
|
+
/** The name or label of the stat */
|
|
27
|
+
statName: StatName;
|
|
28
|
+
/** The displayed value and optional color for the stat. */
|
|
29
|
+
statValue: StatValue;
|
|
30
|
+
/** On hover, a tooltip displays additional details for the card. */
|
|
31
|
+
statTitle?: statTooltipProps;
|
|
32
|
+
}
|
|
33
|
+
/** Props for the statsList component. */
|
|
34
|
+
export interface StatsListProp {
|
|
35
|
+
/** Layout type of the stats list. */
|
|
36
|
+
type?: StatType;
|
|
37
|
+
/** Array of the stats item to display. */
|
|
38
|
+
statItems: StatItem[];
|
|
39
|
+
}
|