@opexa/portal-components 0.0.294 → 0.0.295

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 (66) hide show
  1. package/dist/client/hooks/useCheckInDailyCheckInQuestMutation.js +3 -0
  2. package/dist/components/Banner/Banner.client.d.ts +12 -0
  3. package/dist/components/Banner/Banner.client.js +49 -0
  4. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
  5. package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
  6. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  7. package/dist/third-parties/FacebookPixel/api.js +1 -0
  8. package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
  9. package/dist/third-parties/FacebookPixel/index.js +1 -0
  10. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
  11. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
  12. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  13. package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
  14. package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
  15. package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
  16. package/dist/third-parties/index.d.ts +2 -0
  17. package/dist/third-parties/index.js +2 -0
  18. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  19. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  20. package/dist/ui/Badge/Badge.d.ts +12 -12
  21. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  22. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  23. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  24. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  25. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  26. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  27. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  28. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  29. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  30. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  31. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  32. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  33. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  34. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  35. package/dist/ui/Dialog/Dialog.d.ts +88 -88
  36. package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
  37. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  38. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  39. package/dist/ui/Field/Field.d.ts +21 -21
  40. package/dist/ui/Field/field.recipe.d.ts +3 -3
  41. package/dist/ui/Menu/Menu.d.ts +252 -252
  42. package/dist/ui/Menu/menu.recipe.d.ts +14 -14
  43. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  44. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  45. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  46. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  47. package/dist/ui/PinInput/PinInput.d.ts +12 -12
  48. package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
  49. package/dist/ui/Popover/Popover.d.ts +55 -55
  50. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  51. package/dist/ui/Progress/Progress.d.ts +27 -27
  52. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  53. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  54. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  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.anatomy.d.ts +1 -1
  61. package/dist/ui/Table/table.recipe.d.ts +3 -3
  62. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  63. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  64. package/package.json +1 -1
  65. package/dist/client/utils/recaptcha.d.ts +0 -14
  66. package/dist/client/utils/recaptcha.js +0 -18
@@ -29,6 +29,9 @@ export const useCheckInDailyCheckInQuestMutation = (config) => {
29
29
  status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
30
30
  lastCheckInDate: new Date().toISOString(),
31
31
  progressPercentage: progressPercentage.toFixed(2),
32
+ checkInStreak: quest.checkInStreak
33
+ ? quest.checkInStreak + 1
34
+ : 1,
32
35
  };
33
36
  }
34
37
  return quest;
@@ -0,0 +1,12 @@
1
+ import type { ImageProps } from 'next/image';
2
+ export interface BannerEntry {
3
+ src: ImageProps['src'];
4
+ redirectUrl?: string;
5
+ }
6
+ export interface BannerProps {
7
+ banners: BannerEntry[];
8
+ imageWidth?: number | [mobile: number, desktop: number];
9
+ imageHeight?: number | [mobile: number, desktop: number];
10
+ className?: string;
11
+ }
12
+ export declare function Banner__client(props: BannerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import emblaCarouselAutoplay from 'embla-carousel-autoplay';
4
+ import useEmblaCarousel, {} from 'embla-carousel-react';
5
+ import isMobile from 'is-mobile';
6
+ import Image from 'next/image';
7
+ import Link from 'next/link';
8
+ import { Fragment, useEffect, useState } from 'react';
9
+ import { twMerge } from 'tailwind-merge';
10
+ import { dataAttr } from '../../utils/dataAttr.js';
11
+ export function Banner__client(props) {
12
+ const [emblaRef, emblaApi] = useEmblaCarousel({
13
+ loop: true,
14
+ align: 'start',
15
+ }, [
16
+ emblaCarouselAutoplay({
17
+ playOnInit: true,
18
+ delay: 5000,
19
+ }),
20
+ ]);
21
+ const [currentIndex, setCurrentIndex] = useState(0);
22
+ useEffect(() => {
23
+ function handler(detail) {
24
+ setCurrentIndex(detail?.selectedScrollSnap() ?? 0);
25
+ }
26
+ emblaApi?.on('scroll', handler);
27
+ emblaApi?.on('init', handler);
28
+ return () => {
29
+ emblaApi?.on('init', handler);
30
+ emblaApi?.off('scroll', handler);
31
+ };
32
+ }, [emblaApi]);
33
+ const imageWidth = !props.imageWidth
34
+ ? [400, 1200]
35
+ : Array.isArray(props.imageWidth)
36
+ ? props.imageWidth
37
+ : [props.imageWidth, props.imageWidth];
38
+ const imageHeight = !props.imageHeight
39
+ ? [225, 300]
40
+ : Array.isArray(props.imageHeight)
41
+ ? props.imageHeight
42
+ : [props.imageHeight, props.imageHeight];
43
+ return (_jsxs("div", { className: twMerge('relative', props.className), children: [_jsx("div", { ref: emblaRef, className: "overflow-hidden", children: _jsx("div", { className: "flex gap-2", children: props.banners.map((banner, index) => {
44
+ const img = (_jsx(Image, { src: banner.src, alt: "", width: isMobile() ? imageWidth[0] : imageWidth[1], height: isMobile() ? imageHeight[0] : imageHeight[1], className: "block h-auto w-full", priority: index === 0 }));
45
+ return (_jsx(Fragment, { children: !banner.redirectUrl ? (_jsx("div", { className: "w-full shrink-0", children: img })) : (_jsx(Link, { href: banner.redirectUrl, className: "block w-full shrink-0", "aria-label": `Open ${banner.redirectUrl}`, children: img })) }, index));
46
+ }) }) }), _jsx("div", { className: "absolute bottom-lg left-1/2 flex w-fit -translate-x-1/2 gap-2", children: props.banners.map((_, index) => (_jsx("button", { type: "button", className: "ui-active:bg-brand-500 bg-gray-300 size-3 shrink-0 rounded-full border border-white transition-all duration-300 ui-active:w-9", onClick: () => {
47
+ emblaApi?.scrollTo(index);
48
+ }, "aria-label": `Go to slide ${index + 1}`, "data-active": dataAttr(index === currentIndex) }, index))) })] }));
49
+ }
@@ -0,0 +1,4 @@
1
+ export interface FacebookPixelProps {
2
+ fbId: string;
3
+ }
4
+ export declare function FacebookPixel(props: FacebookPixelProps): null;
@@ -0,0 +1,4 @@
1
+ export function FacebookPixel(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel';
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel.js';
@@ -0,0 +1,4 @@
1
+ export interface GoogleRecaptchaProps {
2
+ siteKey: string;
3
+ }
4
+ export declare function GoogleRecaptcha(props: GoogleRecaptchaProps): null;
@@ -0,0 +1,4 @@
1
+ export function GoogleRecaptcha(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha';
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha.js';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel';
2
+ export * from './GoogleRecaptcha';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel/index.js';
2
+ export * from './GoogleRecaptcha/index.js';