@opexa/portal-components 0.0.93 → 0.0.94

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.
Files changed (65) hide show
  1. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  2. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  3. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  4. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  5. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.d.ts +3 -2
  6. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +3 -1
  7. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +13 -2
  8. package/dist/components/Jackpots/JackpotsList/JackpotsList.js +10 -2
  9. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +7 -1
  10. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +2 -2
  11. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +7 -1
  12. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +2 -2
  13. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.d.ts +19 -2
  14. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +26 -2
  15. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.d.ts +17 -2
  16. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +17 -6
  17. package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +19 -2
  18. package/dist/components/Tournaments/TournamentsList/TournamentsList.js +36 -2
  19. package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.d.ts +19 -1
  20. package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +18 -6
  21. package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.d.ts +19 -1
  22. package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +16 -4
  23. package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
  24. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  25. package/dist/ui/Avatar/Avatar.d.ts +9 -9
  26. package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
  27. package/dist/ui/Badge/Badge.d.ts +12 -12
  28. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  29. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  30. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  31. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  32. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  33. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  34. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  35. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  36. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  37. package/dist/ui/DatePicker/DatePicker.d.ts +336 -336
  38. package/dist/ui/DatePicker/datePicker.recipe.d.ts +14 -14
  39. package/dist/ui/Dialog/Dialog.d.ts +121 -121
  40. package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
  41. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  42. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  43. package/dist/ui/Field/Field.d.ts +21 -21
  44. package/dist/ui/Field/field.recipe.d.ts +3 -3
  45. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  46. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  47. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  48. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  49. package/dist/ui/PinInput/PinInput.d.ts +12 -12
  50. package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
  51. package/dist/ui/Popover/Popover.d.ts +55 -55
  52. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  53. package/dist/ui/Progress/Progress.d.ts +27 -27
  54. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  55. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  56. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  57. package/dist/ui/Select/Select.d.ts +45 -45
  58. package/dist/ui/Select/select.recipe.d.ts +3 -3
  59. package/dist/ui/Table/Table.d.ts +21 -21
  60. package/dist/ui/Table/table.recipe.d.ts +3 -3
  61. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  62. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  63. package/dist/utils/isStyleEntries.d.ts +1 -1
  64. package/dist/utils/isStyleEntries.js +1 -1
  65. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  export declare const OnlineBankDepositContext: import("react").Context<{
2
- view: "vca" | "form";
2
+ view: "form" | "vca";
3
3
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
4
  verify: () => void;
5
5
  reset: () => void;
@@ -9,7 +9,7 @@ export declare const OnlineBankDepositContext: import("react").Context<{
9
9
  promo?: string | null;
10
10
  }) => void;
11
11
  }>, useOnlineBankDepositContext: () => {
12
- view: "vca" | "form";
12
+ view: "form" | "vca";
13
13
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
14
14
  verify: () => void;
15
15
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
3
3
  export declare function useOnlineBankDeposit(): {
4
- view: "vca" | "form";
4
+ view: "form" | "vca";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -1,5 +1,5 @@
1
1
  export declare const QRPHDepositContext: import("react").Context<{
2
- view: "qrCode" | "form";
2
+ view: "form" | "qrCode";
3
3
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
4
  verify: () => void;
5
5
  reset: () => void;
@@ -9,7 +9,7 @@ export declare const QRPHDepositContext: import("react").Context<{
9
9
  promo?: string | null;
10
10
  }) => void;
11
11
  }>, useQRPHDepositContext: () => {
12
- view: "qrCode" | "form";
12
+ view: "form" | "qrCode";
13
13
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
14
14
  verify: () => void;
15
15
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
3
3
  export declare function useQRPHDeposit(): {
4
- view: "qrCode" | "form";
4
+ view: "form" | "qrCode";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -1,9 +1,9 @@
1
1
  import { type CSSProperties } from 'react';
2
- export interface ClassNameEntries {
2
+ interface ClassNameEntries {
3
3
  root?: string;
4
4
  itemRoot?: string;
5
5
  }
6
- export interface StyleEntries {
6
+ interface StyleEntries {
7
7
  root?: CSSProperties;
8
8
  itemRoot?: CSSProperties;
9
9
  }
@@ -18,3 +18,4 @@ export interface JackpotsCarouselProps {
18
18
  animate?: boolean;
19
19
  }
20
20
  export declare function JackpotsCarousel({ style, className, ...props }: JackpotsCarouselProps): import("react/jsx-runtime").JSX.Element | null;
21
+ export {};
@@ -56,7 +56,9 @@ export function JackpotsCarousel({ style, className, ...props }) {
56
56
  const jackpots = jackpotsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
57
57
  if (jackpots.length <= 0)
58
58
  return null;
59
- const styles = isStyleEntries(style) ? style : { root: style };
59
+ const styles = isStyleEntries(style, ['root', 'itemRoot'])
60
+ ? style
61
+ : { root: style };
60
62
  const classNames = isString(className)
61
63
  ? { root: className }
62
64
  : (className ?? {});
@@ -1,11 +1,22 @@
1
1
  import { type ImageProps } from 'next/image';
2
+ import type { CSSProperties } from 'react';
2
3
  import type { GameProvider } from '../../../types';
4
+ interface ClassNameEntries {
5
+ root?: string;
6
+ itemRoot?: string;
7
+ }
8
+ interface StyleEntries {
9
+ root?: CSSProperties;
10
+ itemRoot?: CSSProperties;
11
+ }
3
12
  export interface JackpotsListProps {
4
13
  layout: 'list';
5
14
  /** @default "Jackpots" */
6
15
  heading?: string;
7
- className?: string;
16
+ className?: string | ClassNameEntries;
17
+ style?: CSSProperties | StyleEntries;
8
18
  gameProviders: GameProvider[];
9
19
  gameProviderImages?: Partial<Record<GameProvider, ImageProps['src']>>;
10
20
  }
11
- export declare function JackpotsList(props: JackpotsListProps): import("react/jsx-runtime").JSX.Element | null;
21
+ export declare function JackpotsList({ style, className, ...props }: JackpotsListProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export {};
@@ -1,12 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { isString } from 'lodash-es';
3
4
  import Image, {} from 'next/image';
4
5
  import { useJackpotsQuery } from '../../../client/hooks/index.js';
5
6
  import closeChest from '../../../images/close-chest.png';
7
+ import { isStyleEntries } from '../../../utils/index.js';
6
8
  import { JackpotsListItemContext, JackpotsListPropsContext, } from './JackpotsListContext.js';
7
9
  import { JackpotsListItemDesktop } from './JackpotsListItemDesktop.js';
8
10
  import { JackpotsListItemMobile } from './JackpotsListItemMobile.js';
9
- export function JackpotsList(props) {
11
+ export function JackpotsList({ style, className, ...props }) {
10
12
  const jackpotsQuery = useJackpotsQuery({
11
13
  first: 100,
12
14
  filter: {
@@ -25,5 +27,11 @@ export function JackpotsList(props) {
25
27
  const jackpots = jackpotsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
26
28
  if (jackpots.length <= 0)
27
29
  return null;
28
- return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { className: props.className, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Jackpots' }), jackpots.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, {}) }, jackpot.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, {}) }, jackpot.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Jackpots' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'jackpots', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
30
+ const styles = isStyleEntries(style, ['root', 'itemRoot'])
31
+ ? style
32
+ : { root: style };
33
+ const classNames = isString(className)
34
+ ? { root: className }
35
+ : (className ?? {});
36
+ return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { style: styles.root, className: classNames.root, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Jackpots' }), jackpots.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames.itemRoot }) }, jackpot.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot) => (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, { style: styles.itemRoot, className: classNames.itemRoot }) }, jackpot.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Jackpots' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'jackpots', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
29
37
  }
@@ -1 +1,7 @@
1
- export declare function JackpotsListItemDesktop(): import("react/jsx-runtime").JSX.Element;
1
+ import type { CSSProperties } from 'react';
2
+ interface JackpotsListItemDesktopProps {
3
+ className?: string;
4
+ style?: CSSProperties;
5
+ }
6
+ export declare function JackpotsListItemDesktop(props: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -14,10 +14,10 @@ import styles from './JackpotsListItem.module.css';
14
14
  import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
15
15
  import { JackpotsListItemRules } from './JackpotsListItemRules.js';
16
16
  import { useJackpotsListItemData } from './useJackpotsListItemData.js';
17
- export function JackpotsListItemDesktop() {
17
+ export function JackpotsListItemDesktop(props) {
18
18
  const jackpot = useJackpotsListItemContext();
19
19
  const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, starTierStyles, } = useJackpotsListItemData();
20
- return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border'), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "z-1 relative flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "border-utility-success-200 bg-utility-success-50 text-utility-success-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx("span", { className: "full bg-utility-success-500 size-1.5 animate-pulse rounded" }), "Paying Out"] })) : (_jsxs("div", { className: "border-utility-blue-200 bg-utility-blue-50 text-utility-blue-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(ArrowNarrowUpRightIcon, { className: "text-utility-blue-500 size-3.5" }), "Accumulating"] })), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(jackpotAmount, {
20
+ return (_jsxs("div", { style: props.style, className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border', props.className), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "z-1 relative flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "border-utility-success-200 bg-utility-success-50 text-utility-success-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx("span", { className: "full bg-utility-success-500 size-1.5 animate-pulse rounded" }), "Paying Out"] })) : (_jsxs("div", { className: "border-utility-blue-200 bg-utility-blue-50 text-utility-blue-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(ArrowNarrowUpRightIcon, { className: "text-utility-blue-500 size-3.5" }), "Accumulating"] })), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(jackpotAmount, {
21
21
  currency: localeInfo.currency.code,
22
22
  minDecimalPlaces: 2,
23
23
  maxDecimalPlaces: 2,
@@ -1 +1,7 @@
1
- export declare function JackpotsListItemMobile(): import("react/jsx-runtime").JSX.Element;
1
+ import { type CSSProperties } from 'react';
2
+ interface JackpotsListItemMobileProps {
3
+ className?: string;
4
+ style?: CSSProperties;
5
+ }
6
+ export declare function JackpotsListItemMobile(props: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -14,11 +14,11 @@ import styles from './JackpotsListItem.module.css';
14
14
  import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
15
15
  import { JackpotsListItemRules } from './JackpotsListItemRules.js';
16
16
  import { useJackpotsListItemData } from './useJackpotsListItemData.js';
17
- export function JackpotsListItemMobile() {
17
+ export function JackpotsListItemMobile(props) {
18
18
  const jackpot = useJackpotsListItemContext();
19
19
  const { jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, starTierStyles, } = useJackpotsListItemData();
20
20
  const [isDetailsVisible, setIsDetailsVisible] = useState(false);
21
- return (_jsxs("div", { className: "bg-bg-primary border-border-primary rounded-2xl border", children: [_jsxs("div", { className: twMerge('bg-bg-tertiary relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "z-1 relative flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "border-utility-success-200 bg-utility-success-50 text-utility-success-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx("span", { className: "full bg-utility-success-500 size-1.5 animate-pulse rounded" }), "Paying Out"] })) : (_jsxs("div", { className: "border-utility-blue-200 bg-utility-blue-50 text-utility-blue-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(ArrowNarrowUpRightIcon, { className: "text-utility-blue-500 size-3.5" }), "Accumulating"] })), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(jackpotAmount, {
21
+ return (_jsxs("div", { style: props.style, className: twMerge('bg-bg-primary border-border-primary rounded-2xl border', props.className), children: [_jsxs("div", { className: "bg-bg-tertiary relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5", children: [_jsxs("div", { className: "z-1 relative flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { children: [isPayingOut ? (_jsxs("div", { className: "border-utility-success-200 bg-utility-success-50 text-utility-success-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx("span", { className: "full bg-utility-success-500 size-1.5 animate-pulse rounded" }), "Paying Out"] })) : (_jsxs("div", { className: "border-utility-blue-200 bg-utility-blue-50 text-utility-blue-700 flex w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(ArrowNarrowUpRightIcon, { className: "text-utility-blue-500 size-3.5" }), "Accumulating"] })), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(jackpotAmount, {
22
22
  currency: localeInfo.currency.code,
23
23
  minDecimalPlaces: 2,
24
24
  maxDecimalPlaces: 2,
@@ -1,9 +1,26 @@
1
+ import { type CSSProperties } from 'react';
2
+ interface ClassNameEntries {
3
+ root?: string;
4
+ itemRoot?: string;
5
+ itemBadgeRoot?: string;
6
+ itemBadgeLabel?: string;
7
+ itemBadgeIcon?: string;
8
+ }
9
+ interface StyleEntries {
10
+ root?: CSSProperties;
11
+ itemRoot?: CSSProperties;
12
+ itemBadgeRoot?: CSSProperties;
13
+ itemBadgeLabel?: CSSProperties;
14
+ itemBadgeIcon?: CSSProperties;
15
+ }
1
16
  export interface TournamentsCarouselProps {
2
17
  layout: 'carousel';
3
18
  /** @default "Tournaments" */
4
19
  heading?: string;
5
20
  /** @default "/tournaments" */
6
21
  viewAllUrl?: string;
7
- className?: string;
22
+ className?: string | ClassNameEntries;
23
+ style?: CSSProperties | StyleEntries;
8
24
  }
9
- export declare function TournamentsCarousel(props: TournamentsCarouselProps): import("react/jsx-runtime").JSX.Element | null;
25
+ export declare function TournamentsCarousel({ style, className, ...props }: TournamentsCarouselProps): import("react/jsx-runtime").JSX.Element | null;
26
+ export {};
@@ -1,14 +1,16 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import useEmblaCarousel from 'embla-carousel-react';
4
+ import { isString } from 'lodash-es';
4
5
  import Link from 'next/link';
5
6
  import { useCallback, useEffect, useState } from 'react';
6
7
  import { useTournamentsQuery } from '../../../client/hooks/index.js';
7
8
  import { ArrowLeftIcon, ArrowRightIcon, ChevronRightIcon, } from '../../../icons/index.js';
8
9
  import { Button } from '../../../ui/index.js';
10
+ import { isStyleEntries } from '../../../utils/index.js';
9
11
  import { TournamentsCarouselItemContext } from './TournamentsCarouselContext.js';
10
12
  import { TournamentsCarouselItem } from './TournamentsCarouselItem.js';
11
- export function TournamentsCarousel(props) {
13
+ export function TournamentsCarousel({ style, className, ...props }) {
12
14
  const [emblaRef, emblaApi] = useEmblaCarousel({
13
15
  align: 'start',
14
16
  slidesToScroll: 1,
@@ -47,5 +49,27 @@ export function TournamentsCarousel(props) {
47
49
  const tournaments = tournamentsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
48
50
  if (tournaments.length <= 0)
49
51
  return null;
50
- return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-lg font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "flex items-center md:gap-3xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/tournaments', className: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] })] }), _jsx("div", { className: "relative mt-lg lg:overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-2.5", children: tournaments.map((tournament) => (_jsx(TournamentsCarouselItemContext, { value: tournament, children: _jsx(TournamentsCarouselItem, { viewAllUrl: props.viewAllUrl, className: "w-full" }) }, tournament.id))) }) })] }));
52
+ const styles = isStyleEntries(style, [
53
+ 'root',
54
+ 'itemRoot',
55
+ 'itemBadgeRoot',
56
+ 'itemBadgeLabel',
57
+ 'itemBadgeIcon',
58
+ ])
59
+ ? style
60
+ : { root: style };
61
+ const classNames = isString(className)
62
+ ? { root: className }
63
+ : (className ?? {});
64
+ return (_jsxs("div", { className: classNames.root, style: styles.root, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-lg font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "flex items-center md:gap-3xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/tournaments', className: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] })] }), _jsx("div", { className: "relative mt-lg lg:overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-2.5", children: tournaments.map((tournament) => (_jsx(TournamentsCarouselItemContext, { value: tournament, children: _jsx(TournamentsCarouselItem, { viewAllUrl: props.viewAllUrl, style: {
65
+ root: styles.itemRoot,
66
+ badgeIcon: styles.itemBadgeIcon,
67
+ badgeRoot: styles.itemBadgeRoot,
68
+ badgeLabel: styles.itemBadgeLabel,
69
+ }, className: {
70
+ root: classNames.itemRoot,
71
+ badgeRoot: classNames.itemBadgeRoot,
72
+ badgeLabel: classNames.itemBadgeLabel,
73
+ badgeIcon: classNames.itemBadgeIcon,
74
+ } }) }, tournament.id))) }) })] }));
51
75
  }
@@ -1,6 +1,21 @@
1
+ import { type CSSProperties } from 'react';
2
+ interface ClassNameEntries {
3
+ root?: string;
4
+ badgeRoot?: string;
5
+ badgeLabel?: string;
6
+ badgeIcon?: string;
7
+ }
8
+ interface StyleEntries {
9
+ root?: CSSProperties;
10
+ badgeRoot?: CSSProperties;
11
+ badgeLabel?: CSSProperties;
12
+ badgeIcon?: CSSProperties;
13
+ }
1
14
  export interface TournamentsCarouselItemProps {
2
- className?: string;
15
+ style?: CSSProperties | StyleEntries;
16
+ className?: string | ClassNameEntries;
3
17
  /** @default "/tournaments" */
4
18
  viewAllUrl?: string;
5
19
  }
6
- export declare function TournamentsCarouselItem({ className, viewAllUrl, }: TournamentsCarouselItemProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function TournamentsCarouselItem({ style, className, viewAllUrl, }: TournamentsCarouselItemProps): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { pick } from 'lodash-es';
3
+ import { isString, pick } from 'lodash-es';
4
4
  import Image from 'next/image';
5
5
  import Link from 'next/link';
6
6
  import React, { useEffect, useMemo, useState } from 'react';
@@ -11,10 +11,10 @@ import { StarIcon } from '../../../icons/StarIcon.js';
11
11
  import firstPlace from '../../../images/first-place.png';
12
12
  import trophyTwo from '../../../images/trophy-two.png';
13
13
  import trophy from '../../../images/trophy.png';
14
- import { formatNumber, mask } from '../../../utils/index.js';
14
+ import { formatNumber, isStyleEntries, mask } from '../../../utils/index.js';
15
15
  import { useTournamentsCarouselItemContext } from './TournamentsCarouselContext.js';
16
- import styles from './TournamentsCarouselItem.module.css';
17
- export function TournamentsCarouselItem({ className, viewAllUrl, }) {
16
+ import css from './TournamentsCarouselItem.module.css';
17
+ export function TournamentsCarouselItem({ style, className, viewAllUrl, }) {
18
18
  const tournament = useTournamentsCarouselItemContext();
19
19
  const localeInfo = useLocaleInfo();
20
20
  const [timeRemaining, setTimeRemaining] = useState({
@@ -67,7 +67,18 @@ export function TournamentsCarouselItem({ className, viewAllUrl, }) {
67
67
  .map(Number)
68
68
  .reduce((sum, val) => sum + val, 0);
69
69
  const prizeAmountsByRank = Object.values(tournament.rewardSettings).map(Number);
70
- return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary relative flex shrink-0 rounded-2xl border p-3 text-center lg:gap-6 lg:p-5', className), children: [_jsx("div", { className: "z-1 relative flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(Award01Icon, { className: "text-utility-brand-500 size-3.5" }), "Multiplier"] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsxs("div", { className: "flex justify-between", children: [_jsxs("div", { children: [_jsx("div", { className: "text-text-primary-900 mt-2.5 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
70
+ const styles = isStyleEntries(style, [
71
+ 'root',
72
+ 'badgeRoot',
73
+ 'badgeLabel',
74
+ 'badgeIcon',
75
+ ])
76
+ ? style
77
+ : { root: style };
78
+ const classNames = isString(className)
79
+ ? { root: className }
80
+ : (className ?? {});
81
+ return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary relative flex w-full shrink-0 rounded-2xl border p-3 text-center lg:gap-6 lg:p-5', classNames.root), style: styles.root, children: [_jsx("div", { className: "z-1 relative flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { style: styles.badgeRoot, className: twMerge('border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium', classNames.badgeRoot), children: [_jsx(Award01Icon, { style: styles.badgeIcon, className: twMerge('text-utility-brand-500 size-3.5', classNames.badgeIcon) }), _jsx("span", { style: styles.badgeLabel, className: classNames.badgeLabel, children: "Multiplier" })] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsxs("div", { className: "flex justify-between", children: [_jsxs("div", { children: [_jsx("div", { className: "text-text-primary-900 mt-2.5 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
71
82
  currency: localeInfo.currency.code,
72
83
  minDecimalPlaces: 2,
73
84
  maxDecimalPlaces: 2,
@@ -77,7 +88,7 @@ export function TournamentsCarouselItem({ className, viewAllUrl, }) {
77
88
  maxDecimalPlaces: 2,
78
89
  }) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: "No winners yet" }), _jsx("div", { className: "text-text-secondary-700 text-xs", children: "You could be the first to win the tournament!" })] })] }))] }) }) }) }), _jsxs("div", { className: "z-1 hidden flex-1 space-y-4 lg:block", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Image, { width: 24, height: 24, src: trophyTwo, quality: 100, alt: "leaderboardIcon", className: "size-full w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: tournament.currentLeaderboard.edges.length
79
90
  ? 'Leaderboard'
80
- : 'Starting soon!' })] }), _jsxs(Link, { className: "text-button-tertiary-fg flex text-sm font-semibold", href: viewAllUrl ?? '/tournaments', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
91
+ : 'Starting soon!' })] }), _jsxs(Link, { className: "text-button-tertiary-fg flex text-sm font-semibold", href: viewAllUrl ?? '/tournaments', children: ["See details", _jsx(ChevronRightIcon, { className: "size-5" })] })] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', css['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
81
92
  currency: localeInfo.currency.code,
82
93
  minDecimalPlaces: 2,
83
94
  maxDecimalPlaces: 2,
@@ -1,9 +1,26 @@
1
+ import type { CSSProperties } from 'react';
1
2
  import type { GameProvider } from '../../../types';
3
+ interface ClassNameEntries {
4
+ root?: string;
5
+ itemRoot?: string;
6
+ itemBadgeRoot?: string;
7
+ itemBadgeLabel?: string;
8
+ itemBadgeIcon?: string;
9
+ }
10
+ interface StyleEntries {
11
+ root?: CSSProperties;
12
+ itemRoot?: CSSProperties;
13
+ itemBadgeRoot?: CSSProperties;
14
+ itemBadgeLabel?: CSSProperties;
15
+ itemBadgeIcon?: CSSProperties;
16
+ }
2
17
  export interface TournamentsListProps {
3
18
  layout: 'list';
4
19
  /** @default "Tournaments" */
5
20
  heading?: string;
6
- className?: string;
21
+ className?: string | ClassNameEntries;
22
+ style?: CSSProperties | StyleEntries;
7
23
  gameProviders: GameProvider[];
8
24
  }
9
- export declare function TournamentsList(props: TournamentsListProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function TournamentsList({ style, className, ...props }: TournamentsListProps): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -1,12 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { isString } from 'lodash-es';
3
4
  import Image from 'next/image';
4
5
  import { useTournamentsQuery } from '../../../client/hooks/index.js';
5
6
  import closeChest from '../../../images/close-chest.png';
7
+ import { isStyleEntries } from '../../../utils/index.js';
6
8
  import { TournamentsListItemContext, TournamentsListPropsContext, } from './TournamentsListContext.js';
7
9
  import { TournamentsListItemDesktop } from './TournamentsListItemDesktop.js';
8
10
  import { TournamentsListItemMobile } from './TournamentsListItemMobile.js';
9
- export function TournamentsList(props) {
11
+ export function TournamentsList({ style, className, ...props }) {
10
12
  const tournamentsQuery = useTournamentsQuery({
11
13
  first: 100,
12
14
  filter: {
@@ -16,5 +18,37 @@ export function TournamentsList(props) {
16
18
  },
17
19
  });
18
20
  const tournaments = tournamentsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
19
- return (_jsx(TournamentsListPropsContext, { value: props, children: _jsxs("div", { className: props.className, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Tournaments' }), tournaments.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemDesktop, {}) }, tournament.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemMobile, {}) }, tournament.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'tournaments', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
21
+ const styles = isStyleEntries(style, [
22
+ 'root',
23
+ 'itemRoot',
24
+ 'itemBadgeRoot',
25
+ 'itemBadgeLabel',
26
+ 'itemBadgeIcon',
27
+ ])
28
+ ? style
29
+ : { root: style };
30
+ const classNames = isString(className)
31
+ ? { root: className }
32
+ : (className ?? {});
33
+ return (_jsx(TournamentsListPropsContext, { value: props, children: _jsxs("div", { style: styles.root, className: classNames.root, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Tournaments' }), tournaments.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemDesktop, { style: {
34
+ root: styles.itemRoot,
35
+ badgeIcon: styles.itemBadgeIcon,
36
+ badgeRoot: styles.itemBadgeRoot,
37
+ badgeLabel: styles.itemBadgeLabel,
38
+ }, className: {
39
+ root: classNames.itemRoot,
40
+ badgeRoot: classNames.itemBadgeRoot,
41
+ badgeLabel: classNames.itemBadgeLabel,
42
+ badgeIcon: classNames.itemBadgeIcon,
43
+ } }) }, tournament.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemMobile, { style: {
44
+ root: styles.itemRoot,
45
+ badgeIcon: styles.itemBadgeIcon,
46
+ badgeRoot: styles.itemBadgeRoot,
47
+ badgeLabel: styles.itemBadgeLabel,
48
+ }, className: {
49
+ root: classNames.itemRoot,
50
+ badgeRoot: classNames.itemBadgeRoot,
51
+ badgeLabel: classNames.itemBadgeLabel,
52
+ badgeIcon: classNames.itemBadgeIcon,
53
+ } }) }, tournament.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'tournaments', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
20
54
  }
@@ -1 +1,19 @@
1
- export declare function TournamentsListItemDesktop(): import("react/jsx-runtime").JSX.Element;
1
+ import { type CSSProperties } from 'react';
2
+ interface ClassNameEntries {
3
+ root?: string;
4
+ badgeRoot?: string;
5
+ badgeLabel?: string;
6
+ badgeIcon?: string;
7
+ }
8
+ interface StyleEntries {
9
+ root?: CSSProperties;
10
+ badgeRoot?: CSSProperties;
11
+ badgeLabel?: CSSProperties;
12
+ badgeIcon?: CSSProperties;
13
+ }
14
+ interface TournamentsListItemDesktopProps {
15
+ style?: CSSProperties | StyleEntries;
16
+ className?: string | ClassNameEntries;
17
+ }
18
+ export declare function TournamentsListItemDesktop({ style, className, }: TournamentsListItemDesktopProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -1,21 +1,33 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { isString } from 'lodash-es';
2
3
  import Image from 'next/image';
3
- import React from 'react';
4
+ import React, {} from 'react';
4
5
  import { twMerge } from 'tailwind-merge';
5
6
  import { Award01Icon, StarIcon, Trophy01Icon, User01Icon, } from '../../../icons/index.js';
6
7
  import firstPlace from '../../../images/first-place.png';
7
8
  import trophyTwo from '../../../images/trophy-two.png';
8
9
  import trophy from '../../../images/trophy.png';
9
- import { formatNumber, mask } from '../../../utils/index.js';
10
- import styles from './TournamentItem.module.css';
10
+ import { formatNumber, isStyleEntries, mask } from '../../../utils/index.js';
11
+ import css from './TournamentItem.module.css';
11
12
  import { useTournamentsListItemContext } from './TournamentsListContext.js';
12
13
  import { TournamentsListItemGameProviders } from './TournamentsListItemGameProviders.js';
13
14
  import { TournamentsListItemRules } from './TournamentsListItemRules.js';
14
15
  import { useTournamentsListItemData } from './useTournamentListItemData.js';
15
- export function TournamentsListItemDesktop() {
16
+ export function TournamentsListItemDesktop({ style, className, }) {
16
17
  const tournament = useTournamentsListItemContext();
17
18
  const { prizeAmountsByRank, timeParts, tournamentReward, filteredGameProviders, localeInfo, } = useTournamentsListItemData();
18
- return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border'), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-6 lg:p-5'), children: [_jsx("div", { className: "z-1 relative flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(Award01Icon, { className: "text-utility-brand-500 size-3.5" }), "Multiplier"] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
19
+ const styles = isStyleEntries(style, [
20
+ 'root',
21
+ 'badgeRoot',
22
+ 'badgeLabel',
23
+ 'badgeIcon',
24
+ ])
25
+ ? style
26
+ : { root: style };
27
+ const classNames = isString(className)
28
+ ? { root: className }
29
+ : (className ?? {});
30
+ return (_jsxs("div", { style: styles.root, className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border', classNames.root), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-6 lg:p-5'), children: [_jsx("div", { className: "z-1 relative flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { style: styles.badgeRoot, className: twMerge('border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium', classNames.badgeRoot), children: [_jsx(Award01Icon, { style: styles.badgeIcon, className: twMerge('text-utility-brand-500 size-3.5', classNames.badgeIcon) }), _jsx("span", { style: styles.badgeLabel, className: classNames.badgeLabel, children: "Multiplier" })] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
19
31
  currency: localeInfo.currency.code,
20
32
  minDecimalPlaces: 2,
21
33
  maxDecimalPlaces: 2,
@@ -25,7 +37,7 @@ export function TournamentsListItemDesktop() {
25
37
  maxDecimalPlaces: 2,
26
38
  }) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: "No winners yet" }), _jsx("div", { className: "text-text-secondary-700 text-xs", children: "You could be the first to win the tournament!" })] })] }))] }) }) }) }), _jsxs("div", { className: "z-1 hidden flex-1 space-y-4 lg:block", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Image, { width: 24, height: 24, src: trophyTwo, quality: 100, alt: "leaderboardIcon", className: "size-full w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: tournament.currentLeaderboard.edges.length
27
39
  ? 'Leaderboard'
28
- : 'Starting soon!' })] }), _jsx(TournamentsListItemRules, {})] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
40
+ : 'Starting soon!' })] }), _jsx(TournamentsListItemRules, {})] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', css['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
29
41
  currency: localeInfo.currency.code,
30
42
  minDecimalPlaces: 2,
31
43
  maxDecimalPlaces: 2,
@@ -1 +1,19 @@
1
- export declare function TournamentsListItemMobile(): import("react/jsx-runtime").JSX.Element;
1
+ import { type CSSProperties } from 'react';
2
+ interface ClassNameEntries {
3
+ root?: string;
4
+ badgeRoot?: string;
5
+ badgeLabel?: string;
6
+ badgeIcon?: string;
7
+ }
8
+ interface StyleEntries {
9
+ root?: CSSProperties;
10
+ badgeRoot?: CSSProperties;
11
+ badgeLabel?: CSSProperties;
12
+ badgeIcon?: CSSProperties;
13
+ }
14
+ interface TournamentsListItemMobileProps {
15
+ style?: CSSProperties | StyleEntries;
16
+ className?: string | ClassNameEntries;
17
+ }
18
+ export declare function TournamentsListItemMobile({ style, className, }: TournamentsListItemMobileProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};