@opexa/portal-components 0.0.788 → 0.0.789

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.
@@ -4,7 +4,8 @@ export interface StageItemUnlockedClassNameEntries {
4
4
  root?: string;
5
5
  header?: string;
6
6
  stageTitle?: string;
7
- statusBadge?: string;
7
+ statusBadgeCompleted?: string;
8
+ statusBadgeOngoing?: string;
8
9
  body?: string;
9
10
  progressText?: string;
10
11
  bonusBadge?: string;
@@ -19,6 +20,9 @@ export interface StageItemLockedClassNameEntries {
19
20
  }
20
21
  export interface ClassNameEntries {
21
22
  root?: string;
23
+ stageBadge?: string;
24
+ stageBadgeIcon?: string;
25
+ stageBadgeText?: string;
22
26
  progressBarContainer?: string;
23
27
  progressBar?: string;
24
28
  bonusText?: string;
@@ -45,7 +45,7 @@ export function WageringQuestNext(props) {
45
45
  const numericValue = parseFloat(value);
46
46
  return Math.floor(numericValue).toString();
47
47
  };
48
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start gap-2", children: [_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-md border border-[#9E165F] bg-[#4E0D30] px-2 py-1", children: [_jsx(Flag05Icon, { className: "size-4 text-[#EE46BC]" }), _jsxs("p", { className: "font-medium text-[#FAA7E0] text-sm", children: ["Stage ", currentStage] })] }), _jsx(RemainingTime, {})] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(0), "%"] }), _jsxs("p", { children: [formatTurnover(turnover), _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressPercentage}%` } }) }), _jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Stage ", currentStage, " of ", quest?.program.stages?.length] }), _jsxs("div", { className: twMerge('rounded-[6px] border border-utility-brand-200 bg-utility-brand-50 px-1.5 py-0.5 font-medium text-utility-brand-700 text-xs leading-tight'), children: ["+", formatNumber(bonus, {
48
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start gap-2", children: [_jsxs("div", { className: twMerge('flex w-fit items-center gap-1 rounded-md border border-[#9E165F] bg-[#4E0D30] px-2 py-1', classNames?.stageBadge), children: [_jsx(Flag05Icon, { className: twMerge('size-4 text-[#EE46BC]', classNames?.stageBadgeIcon) }), _jsxs("p", { className: twMerge('font-medium text-[#FAA7E0] text-sm', classNames?.stageBadgeText), children: ["Stage ", currentStage] })] }), _jsx(RemainingTime, {})] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(0), "%"] }), _jsxs("p", { children: [formatTurnover(turnover), _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressPercentage}%` } }) }), _jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Stage ", currentStage, " of ", quest?.program.stages?.length] }), _jsxs("div", { className: twMerge('rounded-[6px] border border-utility-brand-200 bg-utility-brand-50 px-1.5 py-0.5 font-medium text-utility-brand-700 text-xs leading-tight'), children: ["+", formatNumber(bonus, {
49
49
  currency: localeInfo.currency.code,
50
50
  }), ' ', "Bonus"] })] })] }), status === 'IN_PROGRESS' && (_jsx("div", { className: "flex h-full items-end", children: _jsx(Button, { size: "sm", onClick: () => disclosure.setOpen(true), "aria-label": "View Details", disabled: false, className: "disabled:bg-bg-primary disabled:text-text-disabled", children: "View Details" }) }))] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen, gameProviderCarousel: props.gameProviderCarousel, gameProviders: Object.entries(quest.turnoverRequirementContributionPercentagePerGameProvider ?? [])
51
51
  .filter(([_, value]) => +value > 0)
@@ -66,7 +66,7 @@ function Rules(props) {
66
66
  ? (quest?.stage ?? 0) + 1
67
67
  : quest.stage;
68
68
  }, [quest.stage]);
69
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: 'mx-auto flex max-h-[80vh] min-h-auto max-w-[400px] flex-col rounded-xl px-4 pt-5 pb-0', children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: 'flex flex-shrink-0 flex-col space-y-5', children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: quest.name }), _jsx("p", { className: "mb-4 font-normal text-sm text-text-tertiary-600", children: "Play and roll your way to rewards! Ready for a challenge? Complete them all and get amazing rewards!" })] }), _jsx("div", { className: "flex-1 overflow-y-auto md:scrollbar:w-2 md:scrollbar-thumb:rounded-full md:scrollbar-thumb:bg-bg-quaternary md:scrollbar-track:bg-transparent", children: (quest?.program.stages ?? []).map((stage, index) => currentStage >= index + 1 ? (_jsx(StageItemUnlocked, { stageDetails: stage, stageLevel: currentStage, index: index, writableBonus: quest.bonus, questCompleted: quest.status === 'COMPLETED', className: props.className?.stageItemUnlocked }, index)) : (_jsx(StageItemLocked, { index: index, className: props.className?.stageItemLocked }, index))) }), _jsxs("div", { className: "flex-shrink-0", children: [((!featureFlag.enabled &&
69
+ return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto flex max-h-[80vh] min-h-auto max-w-[400px] flex-col rounded-xl px-4 pt-5 pb-0", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-shrink-0 flex-col space-y-5", children: [_jsx("h2", { className: "font-semibold text-lg text-text-primary-900", children: quest.name }), _jsx("p", { className: "mb-4 font-normal text-sm text-text-tertiary-600", children: "Play and roll your way to rewards! Ready for a challenge? Complete them all and get amazing rewards!" })] }), _jsx("div", { className: "flex-1 overflow-y-auto md:scrollbar:w-2 md:scrollbar-thumb:rounded-full md:scrollbar-thumb:bg-bg-quaternary md:scrollbar-track:bg-transparent", children: (quest?.program.stages ?? []).map((stage, index) => currentStage >= index + 1 ? (_jsx(StageItemUnlocked, { stageDetails: stage, stageLevel: currentStage, index: index, writableBonus: quest.bonus, questCompleted: quest.status === 'COMPLETED', className: props.className?.stageItemUnlocked }, index)) : (_jsx(StageItemLocked, { index: index, className: props.className?.stageItemLocked }, index))) }), _jsxs("div", { className: "flex-shrink-0", children: [((!featureFlag.enabled &&
70
70
  typeof window !== 'undefined' &&
71
71
  (window.location.href.includes('blucky') ||
72
72
  window.location.href.includes('powerplay') ||
@@ -121,7 +121,7 @@ function StageItemUnlocked({ stageLevel, stageDetails, index, writableBonus, que
121
121
  const progress = stageLevel > index + 1
122
122
  ? 100
123
123
  : Math.round(Number(quest.progressPercentage ?? 0));
124
- return (_jsxs("div", { className: twMerge('mb-4 flex flex-col justify-between rounded-xl bg-bg-tertiary p-3', className?.root), children: [_jsxs("div", { className: twMerge('flex items-center justify-between space-x-2', className?.header), children: [_jsxs("p", { className: twMerge('font-medium', className?.stageTitle), children: ["Stage ", index + 1] }), isCompleted ? (_jsx("div", { className: twMerge('w-fit rounded-full border border-[#085D3A] bg-[#053321] px-2 py-0.5', className?.statusBadge), children: _jsx("p", { className: "font-medium text-[#75E0A7] text-sm", children: "Completed" }) })) : (_jsx("div", { className: twMerge('w-fit rounded-full border border-[#065986] bg-[#062C41] px-2 py-0.5', className?.statusBadge), children: _jsx("p", { className: "font-medium text-[#7CD4FD] text-sm", children: "Ongoing" }) }))] }), _jsxs("div", { className: twMerge('flex justify-between pt-[11px] pb-2', className?.body), children: [_jsxs("p", { className: twMerge('text-sm', className?.progressText), children: ["Progress: ", progress, "%"] }), _jsx("div", { className: twMerge('rounded-[6px] border border-utility-brand-200 bg-utility-brand-50 px-1.5 py-0.5 font-medium text-utility-brand-700 text-xs leading-tight', className?.bonusBadge), children: stageLevel > index + 1
124
+ return (_jsxs("div", { className: twMerge('mb-4 flex flex-col justify-between rounded-xl bg-bg-tertiary p-3', className?.root), children: [_jsxs("div", { className: twMerge('flex items-center justify-between space-x-2', className?.header), children: [_jsxs("p", { className: twMerge('font-medium', className?.stageTitle), children: ["Stage ", index + 1] }), isCompleted ? (_jsx("div", { className: twMerge('w-fit rounded-full border border-[#085D3A] bg-[#053321] px-2 py-0.5 font-medium text-[#75E0A7] text-sm', className?.statusBadgeCompleted), children: "Completed" })) : (_jsx("div", { className: twMerge('w-fit rounded-full border border-[#065986] bg-[#062C41] px-2 py-0.5 font-medium text-[#7CD4FD] text-sm', className?.statusBadgeOngoing), children: "Ongoing" }))] }), _jsxs("div", { className: twMerge('flex justify-between pt-[11px] pb-2', className?.body), children: [_jsxs("p", { className: twMerge('text-sm', className?.progressText), children: ["Progress: ", progress, "%"] }), _jsx("div", { className: twMerge('rounded-[6px] border border-utility-brand-200 bg-utility-brand-50 px-1.5 py-0.5 font-medium text-utility-brand-700 text-xs leading-tight', className?.bonusBadge), children: stageLevel > index + 1
125
125
  ? `+ ${stageDetails.bonusAmount} Bonus`
126
126
  : `+ ${writableBonus} Bonus` })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', className?.progressBar), style: { width: `${progress}%` } }) })] }));
127
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.788",
3
+ "version": "0.0.789",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",