@leatcom/portal-sessions 0.1.0 → 0.3.0-beta.10
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 +66 -57
- package/dist/calendar-Can0qQlp.js +35 -0
- package/dist/camera-switch-GycOMC0h.js +32 -0
- package/dist/caret-left-Bu6hBQ5l.js +35 -0
- package/dist/close-DEGYFjZn.js +31 -0
- package/dist/crossBlack-nmm64QX1.js +40 -0
- package/dist/dollar-BbDPUsF1.js +56 -0
- package/dist/edit-xcD5f5zi.js +31 -0
- package/dist/home-Cdal78fu.js +40 -0
- package/dist/information-Cq6k4byC.js +50 -0
- package/dist/leat_logo-BpQeHCzL.js +33 -0
- package/dist/lib/api/errorHandler.d.ts +3 -0
- package/dist/lib/api/types.d.ts +9 -0
- package/dist/lib/api/useFetcher.d.ts +16 -0
- package/dist/lib/api/useHttp.d.ts +7 -0
- package/dist/lib/api/useV2Fetcher.d.ts +16 -0
- package/dist/lib/api/useV2Http.d.ts +7 -0
- package/dist/lib/components/AnimatedCounter/AnimatedCounter.d.ts +9 -0
- package/dist/lib/components/AnimatedCounter/index.d.ts +1 -0
- package/dist/lib/components/Badge/Badge.d.ts +10 -0
- package/dist/lib/components/Badge/variants.d.ts +5 -0
- package/dist/lib/components/Banner/Banner.d.ts +5 -0
- package/dist/lib/components/Buttons/Button-cva.d.ts +28 -0
- package/dist/lib/components/Buttons/Button.d.ts +12 -0
- package/dist/lib/components/Buttons/NavLinkButton.d.ts +21 -0
- package/dist/lib/components/Buttons/index.d.ts +2 -0
- package/dist/lib/components/Buttons/variants.d.ts +8 -0
- package/dist/lib/components/Card/Card.d.ts +8 -0
- package/dist/lib/components/Card/CardContent.d.ts +7 -0
- package/dist/lib/components/Card/CardFooter.d.ts +6 -0
- package/dist/lib/components/Card/CardHeader.d.ts +6 -0
- package/dist/lib/components/Card/CardSubTitle.d.ts +6 -0
- package/dist/lib/components/Card/CardTitle.d.ts +6 -0
- package/dist/lib/components/Card/NavigationHeader.d.ts +1 -0
- package/dist/lib/components/Card/index.d.ts +6 -0
- package/dist/lib/components/Checkbox/Checkbox.d.ts +15 -0
- package/dist/lib/components/Checkbox/CheckboxBase.d.ts +8 -0
- package/dist/lib/components/Checkbox/CheckboxGroup.d.ts +15 -0
- package/dist/lib/components/Checkbox/index.d.ts +3 -0
- package/dist/lib/components/Form/Form.d.ts +4 -0
- package/dist/lib/components/Form/FormInputField.d.ts +13 -0
- package/dist/lib/components/Hooks/useCloseDropdownHandler.d.ts +2 -0
- package/dist/lib/components/Hooks/useCustomEvents.d.ts +8 -0
- package/dist/lib/components/Hooks/useCustomEvents.test.d.ts +1 -0
- package/dist/lib/components/Hooks/useViewPortSize.d.ts +6 -0
- package/dist/lib/components/Icon/Icon.d.ts +10 -0
- package/dist/lib/components/Icon/IconBase.d.ts +5 -0
- package/dist/lib/components/Icon/index.d.ts +1 -0
- package/dist/lib/components/Icon/variants.d.ts +6 -0
- package/dist/lib/components/Input/Input.d.ts +23 -0
- package/dist/lib/components/Input/InputDate.d.ts +18 -0
- package/dist/lib/components/Input/InputEmail.d.ts +18 -0
- package/dist/lib/components/Input/InputNumeric.d.ts +9 -0
- package/dist/lib/components/Input/index.d.ts +3 -0
- package/dist/lib/components/Keyboard/Keyboard.d.ts +6 -0
- package/dist/lib/components/Keyboard/KeyboardWrapper.d.ts +10 -0
- package/dist/lib/components/Keyboard/NumericKeyboard.d.ts +7 -0
- package/dist/lib/components/Keyboard/index.d.ts +4 -0
- package/dist/lib/components/Keyboard/useKeyboard.d.ts +8 -0
- package/dist/lib/components/Label/Label.d.ts +18 -0
- package/dist/lib/components/Label/index.d.ts +1 -0
- package/dist/lib/components/Layout/Container.d.ts +6 -0
- package/dist/lib/components/Layout/index.d.ts +1 -0
- package/dist/lib/components/Loader/Loader.d.ts +3 -0
- package/dist/lib/components/Message/Message.d.ts +11 -0
- package/dist/lib/components/Modal/Modal.d.ts +17 -0
- package/dist/lib/components/Modal/index.d.ts +1 -0
- package/dist/lib/components/MultiSelect/MultiSelect.d.ts +13 -0
- package/dist/lib/components/MultiSelect/MultiSelectOption.d.ts +8 -0
- package/dist/lib/components/MultiSelect/index.d.ts +1 -0
- package/dist/lib/components/ProgressBar/ProgressBar.d.ts +7 -0
- package/dist/lib/components/ProgressBar/index.d.ts +1 -0
- package/dist/lib/components/Select/Select.d.ts +12 -0
- package/dist/lib/components/Select/SelectGroup.d.ts +7 -0
- package/dist/lib/components/Select/SelectOption.d.ts +5 -0
- package/dist/lib/components/Select/SelectTrigger.d.ts +10 -0
- package/dist/lib/components/Select/index.d.ts +3 -0
- package/dist/lib/components/Skeletons/RowsSkeletonLoader.d.ts +5 -0
- package/dist/lib/components/Skeletons/Skeleton.d.ts +1 -0
- package/dist/lib/components/Skeletons/TableSkeleton.d.ts +8 -0
- package/dist/lib/components/Spinner/Spinner.d.ts +2 -0
- package/dist/lib/components/Spinner/index.d.ts +1 -0
- package/dist/lib/components/Stack/Stack.d.ts +9 -0
- package/dist/lib/components/Stack/index.d.ts +1 -0
- package/dist/lib/components/Switch/Switch.d.ts +20 -0
- package/dist/lib/components/Switch/SwitchBase.d.ts +12 -0
- package/dist/lib/components/Switch/SwitchGroup.d.ts +23 -0
- package/dist/lib/components/Switch/index.d.ts +3 -0
- package/dist/lib/components/Switch/variants.d.ts +6 -0
- package/dist/lib/components/Table/Header.d.ts +6 -0
- package/dist/lib/components/Table/Row.d.ts +7 -0
- package/dist/lib/components/Table/Table.d.ts +9 -0
- package/dist/lib/components/Table/index.d.ts +2 -0
- package/dist/lib/components/Table/types.d.ts +24 -0
- package/dist/lib/components/Typography/Text.d.ts +16 -0
- package/dist/lib/components/Typography/index.d.ts +2 -0
- package/dist/lib/components/Typography/types.d.ts +3 -0
- package/dist/lib/components/debug/DebugOverlay.d.ts +1 -0
- package/dist/lib/components/special/CustomErrorBoundary.d.ts +16 -0
- package/dist/lib/components/special/ErrorHasOccurred.d.ts +1 -0
- package/dist/lib/components/special/LoadingScreen.d.ts +5 -0
- package/dist/lib/components/special/SessionUnavailable.d.ts +3 -0
- package/dist/lib/components/special/SpecialScreen.d.ts +7 -0
- package/dist/lib/components/types.d.ts +17 -0
- package/dist/lib/context/Api/ApiContext.d.ts +5 -0
- package/dist/lib/context/Api/useApiContext.d.ts +1 -0
- package/dist/lib/context/Configuration/ConfigurationContext.d.ts +19 -0
- package/dist/lib/context/Configuration/WithConfiguration.d.ts +7 -0
- package/dist/lib/context/Configuration/useConfigurationContext.d.ts +1 -0
- package/dist/lib/context/PortalSession/PortalSessionContext.d.ts +10 -0
- package/dist/lib/context/PortalSession/PortalSessionProvider.d.ts +7 -0
- package/dist/lib/context/PortalSession/usePortalSessionContext.d.ts +1 -0
- package/dist/lib/design/colorPaletteGenerator.d.ts +6 -0
- package/dist/lib/design/setupBranding.d.ts +2 -0
- package/dist/lib/helpers/displayNameForContact.d.ts +2 -0
- package/dist/lib/helpers/enum.d.ts +23 -0
- package/dist/lib/helpers/helpers.d.ts +9 -0
- package/dist/lib/helpers/index.d.ts +2 -0
- package/dist/lib/hooks/fetchers/useContactIdentifiers.d.ts +10 -0
- package/dist/lib/hooks/fetchers/useContactSubscriptions.d.ts +6 -0
- package/dist/lib/hooks/fetchers/useGiftcard.d.ts +6 -0
- package/dist/lib/hooks/fetchers/useLoyaltyTransactions.d.ts +20 -0
- package/dist/lib/hooks/fetchers/usePrepaidBalance.d.ts +6 -0
- package/dist/lib/hooks/fetchers/useRewards.d.ts +6 -0
- package/dist/lib/hooks/fetchers/useSubscriptions.d.ts +6 -0
- package/dist/lib/hooks/fetchers/useVoucher.d.ts +6 -0
- package/dist/lib/hooks/fetchers/useVouchers.d.ts +6 -0
- package/dist/lib/hooks/toasts/useToast.d.ts +7 -0
- package/dist/lib/hooks/useCreatePortalSession.d.ts +5 -0
- package/dist/lib/hooks/useCurrency.d.ts +5 -0
- package/dist/lib/hooks/useEvents.d.ts +4 -0
- package/dist/lib/localization/i18n.d.ts +2 -0
- package/dist/lib/main.d.ts +8 -0
- package/dist/lib/modules/CreateNewPortalSession.d.ts +31 -0
- package/dist/lib/modules/Root.d.ts +14 -0
- package/dist/lib/modules/StartSession.d.ts +2 -0
- package/dist/lib/modules/UuidSession.d.ts +6 -0
- package/dist/lib/modules/components/HandleContactIdentifier.d.ts +7 -0
- package/dist/lib/modules/components/Scanner/QrReader.d.ts +5 -0
- package/dist/lib/modules/components/Scanner/QrReader2.d.ts +5 -0
- package/dist/lib/modules/components/Scanner/QrReader3.d.ts +5 -0
- package/dist/lib/modules/components/Scanner/QrReader4.d.ts +5 -0
- package/dist/lib/modules/components/Scanner/Scanner.d.ts +9 -0
- package/dist/lib/modules/components/auth/AuthenticateContact.d.ts +1 -0
- package/dist/lib/modules/components/auth/AuthenticateViaContactIdentifier.d.ts +4 -0
- package/dist/lib/modules/components/auth/AuthenticateViaEmail.d.ts +13 -0
- package/dist/lib/modules/components/useFindOrCreateContact.d.ts +9 -0
- package/dist/lib/modules/components/useLinkContactToSession.d.ts +4 -0
- package/dist/lib/modules/components/useLinkIdentifierToContact.d.ts +5 -0
- package/dist/lib/modules/generic/Generic.d.ts +6 -0
- package/dist/lib/modules/giftcard/HandleGiftcard.d.ts +7 -0
- package/dist/lib/modules/giftcard/IdentifyGiftcard.d.ts +1 -0
- package/dist/lib/modules/pointsTransaction/PointsTransaction.d.ts +1 -0
- package/dist/lib/modules/portal/profile/Data.d.ts +1 -0
- package/dist/lib/modules/portal/profile/details/activities/Activities.d.ts +1 -0
- package/dist/lib/modules/portal/profile/details/contactAttributes/ContactAttributes.d.ts +1 -0
- package/dist/lib/modules/portal/profile/details/contactIdentifiers/ContactIdentifiers.d.ts +1 -0
- package/dist/lib/modules/portal/profile/details/contactIdentifiers/CreateContactIdentifier.d.ts +1 -0
- package/dist/lib/modules/portal/profile/details/subscriptions/Subscriptions.d.ts +1 -0
- package/dist/lib/modules/portal/profile/sections/Balance.d.ts +1 -0
- package/dist/lib/modules/portal/profile/sections/LoyaltyTransactions.d.ts +1 -0
- package/dist/lib/modules/portal/profile/sections/Section.d.ts +5 -0
- package/dist/lib/modules/portal/profile/sections/Stats.d.ts +1 -0
- package/dist/lib/modules/portal/profile/sections/Subscriptions.d.ts +1 -0
- package/dist/lib/modules/portal/rewards/Reward.d.ts +11 -0
- package/dist/lib/modules/portal/rewards/Rewards.d.ts +1 -0
- package/dist/lib/modules/portal/rewards/RewardsContent.d.ts +8 -0
- package/dist/lib/modules/portal/vouchers/Voucher.d.ts +9 -0
- package/dist/lib/modules/portal/vouchers/Vouchers.d.ts +1 -0
- package/dist/lib/modules/prepaid/HandlePrepaid.d.ts +1 -0
- package/dist/lib/modules/voucher/HandleVoucher.d.ts +14 -0
- package/dist/lib/modules/voucher/IdentifyVoucher.d.ts +1 -0
- package/dist/lib/routing/AuthenticatedRoute.d.ts +6 -0
- package/dist/lib/routing/ContactRoutes.d.ts +1 -0
- package/dist/lib/routing/PortalRoutes.d.ts +1 -0
- package/dist/lib/routing/Router.d.ts +1 -0
- package/dist/lib/routing/RouterStateReporter.d.ts +16 -0
- package/dist/lib/routing/routes.d.ts +3 -0
- package/dist/lib/types/Contact.d.ts +35 -0
- package/dist/lib/types/Giftcard.d.ts +47 -0
- package/dist/lib/types/PortalSession.d.ts +61 -0
- package/dist/lib/types/Prepaid.d.ts +27 -0
- package/dist/lib/types/Reward.d.ts +18 -0
- package/dist/lib/types/Subscription.d.ts +32 -0
- package/dist/lib/types/Voucher.d.ts +39 -0
- package/dist/mail-CILHEgMY.js +32 -0
- package/dist/notificationErrorV2-CtLIl0uv.js +50 -0
- package/dist/notificationSuccessV2-CiOOunIj.js +50 -0
- package/dist/notificationWarningV2-DeiXPjap.js +50 -0
- package/dist/portal-sessions.es.js +45723 -35379
- package/dist/portal-sessions.umd.js +76 -69
- package/dist/qr-scanner-worker.min-uyv8r9jq.js +20 -0
- package/dist/settings-hMBGAHeo.js +40 -0
- package/dist/shopping-bag-D83pzW-N.js +48 -0
- package/dist/star-DQL2OQsB.js +34 -0
- package/dist/style.css +24 -1
- package/dist/user-DATIDkwc.js +28 -0
- package/package.json +52 -54
- package/dist/calendar-DatiUSvc.js +0 -19
- package/dist/camera-switch-BG4ghgtr.js +0 -19
- package/dist/caret-left-BzIJ4OR3.js +0 -19
- package/dist/close-BOnvojez.js +0 -19
- package/dist/crossBlack-D3AScCz7.js +0 -19
- package/dist/dollar-BiByq0t0.js +0 -19
- package/dist/edit-GxItFJF8.js +0 -19
- package/dist/home-BRXF8Ydg.js +0 -19
- package/dist/information-kCveus0e.js +0 -19
- package/dist/mail-Dn-PppcI.js +0 -19
- package/dist/notificationErrorV2-BT7C7lnC.js +0 -19
- package/dist/notificationSuccessV2-CD4Nzkx1.js +0 -19
- package/dist/notificationWarningV2-Ce-MU9nv.js +0 -19
- package/dist/portal-sessions.es.d.ts +0 -173
- package/dist/qr-scanner-worker.min-BT9FO00c.js +0 -115
- package/dist/settings-iI_Z4aYk.js +0 -19
- package/dist/shopping-bag-gCcU6Sk5.js +0 -19
- package/dist/star-B5vZfVjf.js +0 -19
- package/dist/user-CefiGOdl.js +0 -19
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { switchBaseCva, switchHandleCva } from './variants';
|
|
4
|
+
export type SwitchProps = VariantProps<typeof switchBaseCva> & VariantProps<typeof switchHandleCva> & {
|
|
5
|
+
id?: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
isToggled?: boolean;
|
|
9
|
+
toggleLeft?: boolean;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
helperText?: React.ReactNode;
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
tooltip?: React.ReactNode;
|
|
16
|
+
size?: "md" | "lg";
|
|
17
|
+
onChange?: () => void;
|
|
18
|
+
};
|
|
19
|
+
declare const Switch: React.FC<SwitchProps>;
|
|
20
|
+
export default Switch;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { switchBaseCva, switchHandleCva } from './variants';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
type SwitchProps = VariantProps<typeof switchBaseCva> & VariantProps<typeof switchHandleCva> & {
|
|
5
|
+
id?: string;
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
isSwitched?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onChange?: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const SwitchBase: React.FC<SwitchProps>;
|
|
12
|
+
export default SwitchBase;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LabelProps } from '../Label/Label';
|
|
3
|
+
import { LabelHelperProps } from '../types';
|
|
4
|
+
import { SwitchProps } from '../Switch';
|
|
5
|
+
export type SwitchGroupElement = HTMLDivElement;
|
|
6
|
+
export type SwitchGroupProps = React.HTMLAttributes<HTMLDivElement> & LabelProps & LabelHelperProps & {
|
|
7
|
+
toggleLeft?: boolean;
|
|
8
|
+
size?: "md" | "lg";
|
|
9
|
+
};
|
|
10
|
+
type SwitchGroupContextProps = {
|
|
11
|
+
disabled?: SwitchGroupProps["disabled"];
|
|
12
|
+
size?: SwitchGroupProps["size"];
|
|
13
|
+
toggleLeft?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function useSwitchGroupContext(skipCheck?: boolean): SwitchGroupContextProps;
|
|
16
|
+
type SwitchGroupItemProps = SwitchProps;
|
|
17
|
+
declare const SwitchGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & LabelProps & LabelHelperProps & {
|
|
18
|
+
toggleLeft?: boolean;
|
|
19
|
+
size?: "md" | "lg";
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>> & {
|
|
21
|
+
Item: ({ disabled, label, defaultChecked }: SwitchGroupItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
};
|
|
23
|
+
export default SwitchGroup;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const switchHandleCva: (props?: {
|
|
2
|
+
size?: "md" | "lg";
|
|
3
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
4
|
+
export declare const switchBaseCva: (props?: {
|
|
5
|
+
size?: "md" | "lg";
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeaderItem, RowType } from './types';
|
|
2
|
+
type TableProps = {
|
|
3
|
+
header: HeaderItem[];
|
|
4
|
+
rows: RowType[];
|
|
5
|
+
pending?: boolean;
|
|
6
|
+
onClick?: (id: number) => void;
|
|
7
|
+
};
|
|
8
|
+
export default function Table({ header, rows, pending, onClick }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type HeaderItem = {
|
|
2
|
+
value?: string;
|
|
3
|
+
align?: "left" | "center" | "right";
|
|
4
|
+
};
|
|
5
|
+
export type Header = {
|
|
6
|
+
items: HeaderItem[];
|
|
7
|
+
};
|
|
8
|
+
export type ColumnValue = {
|
|
9
|
+
id: number;
|
|
10
|
+
type: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type Column = {
|
|
18
|
+
align?: "left" | "center" | "right";
|
|
19
|
+
value: ColumnValue;
|
|
20
|
+
};
|
|
21
|
+
export type RowType = {
|
|
22
|
+
columns: Column[];
|
|
23
|
+
id: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SizeTypes, TextRenderTypes, WeightTypes } from './types';
|
|
2
|
+
export interface TextProps {
|
|
3
|
+
children?: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
hidden?: boolean;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
size?: SizeTypes;
|
|
8
|
+
weight?: WeightTypes;
|
|
9
|
+
render_as?: TextRenderTypes;
|
|
10
|
+
dangerously_set_inner_html?: boolean;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
align?: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
}
|
|
16
|
+
export default function Text({ className, hidden, children, onClick, align, size, weight, render_as, dangerously_set_inner_html, }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function DebugOverlay(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Scope } from '@sentry/react';
|
|
2
|
+
import { default as React, Component, ErrorInfo } from 'react';
|
|
3
|
+
type Props = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
type State = {
|
|
7
|
+
hasError: boolean;
|
|
8
|
+
scope: Scope;
|
|
9
|
+
};
|
|
10
|
+
export default class CustomErrorBoundary extends Component<Props, State> {
|
|
11
|
+
constructor(props: Props);
|
|
12
|
+
componentDidMount(): void;
|
|
13
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
14
|
+
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>> | import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ErrorHasOccurred(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type LabelHelperProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Main label displayed above radio buttons. It can be a string, element, or any other
|
|
4
|
+
* renderable node.
|
|
5
|
+
*/
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Additional text or information to guide the user. This can be an instruction,
|
|
9
|
+
* a hint, or any other supplementary information. It's rendered below label.
|
|
10
|
+
*/
|
|
11
|
+
helperText?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Tooltip displayed next to the label. It can be a string, element, or any other
|
|
14
|
+
* renderable node.
|
|
15
|
+
*/
|
|
16
|
+
tooltip?: React.ReactNode;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useApiContext(): Partial<import('./ApiContext').ApiContextType>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GiftcardTransactionResource } from '../../types/Giftcard';
|
|
2
|
+
import { PrepaidTransaction } from '../../types/Prepaid';
|
|
3
|
+
import { PrimaryIdentificationMethod } from '../../types/PortalSession';
|
|
4
|
+
import { RewardResource } from '../../types/Reward';
|
|
5
|
+
import { VoucherResource } from '../../types/Voucher';
|
|
6
|
+
import { FacingMode } from '../../helpers';
|
|
7
|
+
import { Contact } from '../../types/Contact';
|
|
8
|
+
export type ConfigurationContextType = {
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
primaryIdentificationMethod?: PrimaryIdentificationMethod;
|
|
11
|
+
cameraService?: 1 | 2 | 3 | 4;
|
|
12
|
+
cameraFacingMode?: FacingMode | "user" | "environment";
|
|
13
|
+
onContactLink?: (contact: Contact) => void;
|
|
14
|
+
onClaimReward?: (reward: RewardResource, transactionUuid?: string) => void;
|
|
15
|
+
onRedeemVoucher?: (voucher: VoucherResource) => void;
|
|
16
|
+
onUseGiftcard?: (giftcardTransaction: GiftcardTransactionResource) => void;
|
|
17
|
+
onCreatePrepaidTransaction?: (prepaidTransaction: PrepaidTransaction) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const ConfigurationContext: import('react').Context<Partial<ConfigurationContextType>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ConfigurationContextType } from './ConfigurationContext';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
type ConfigurationProps = ConfigurationContextType & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export default function WithConfiguration(props: ConfigurationProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useConfigurationContext(): Partial<import('./ConfigurationContext').ConfigurationContextType>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KeyedMutator } from 'swr/_internal';
|
|
2
|
+
import { PortalSession } from '../../types/PortalSession';
|
|
3
|
+
export type PortalSessionContextType = {
|
|
4
|
+
uuid: string;
|
|
5
|
+
portalSession: PortalSession | null;
|
|
6
|
+
setPortalSession: (portalSession: PortalSession | null) => void;
|
|
7
|
+
mutate: KeyedMutator<any>;
|
|
8
|
+
error?: Error;
|
|
9
|
+
};
|
|
10
|
+
export declare const PortalSessionContext: import('react').Context<Partial<PortalSessionContextType>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function usePortalSessionContext(): Partial<import('./PortalSessionContext').PortalSessionContextType>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum PortalType {
|
|
2
|
+
GENERIC = "GENERIC",
|
|
3
|
+
GIFTCARD = "GIFTCARD",
|
|
4
|
+
REDEEM_GIFTCARD = "REDEEM_GIFTCARD",
|
|
5
|
+
TOP_UP_GIFTCARD = "TOP_UP_GIFTCARD",
|
|
6
|
+
PORTAL = "PORTAL",
|
|
7
|
+
PREPAID = "PREPAID",
|
|
8
|
+
PAY_PREPAID = "PAY_PREPAID",
|
|
9
|
+
TOP_UP_PREPAID = "TOP_UP_PREPAID",
|
|
10
|
+
POINTS_TRANSACTION = "POINTS_TRANSACTION",
|
|
11
|
+
VOUCHER = "VOUCHER"
|
|
12
|
+
}
|
|
13
|
+
export declare enum EventType {
|
|
14
|
+
CREDIT_RECEPTION = "credit_reception",
|
|
15
|
+
GIFTCARD_TRANSACTION = "giftcard_transaction",
|
|
16
|
+
VOUCHER_REDEEMED = "voucher_redeemed",
|
|
17
|
+
REWARD_RECEPTION = "reward_reception",
|
|
18
|
+
PREPAID_TRANSACTION = "prepaid_transaction"
|
|
19
|
+
}
|
|
20
|
+
export declare enum FacingMode {
|
|
21
|
+
USER = "user",
|
|
22
|
+
ENVIRONMENT = "environment"
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '../types/PortalSession';
|
|
2
|
+
export declare const formatCentsAsCurrency: (amountInCents: number, currency?: string) => string;
|
|
3
|
+
export declare const getCurrencySymbol: (currency: string) => string;
|
|
4
|
+
export declare const getInitials: (name: string) => string;
|
|
5
|
+
export declare const postEventsToParentWindow: (events: Array<Event>) => void;
|
|
6
|
+
export declare const getDaysBetween: (date1: Date, date2: Date) => number;
|
|
7
|
+
export declare const getWeeksBetween: (date1: Date, date2: Date) => number;
|
|
8
|
+
export declare const getYearsBetween: (date1: Date, date2: Date) => number;
|
|
9
|
+
export declare const isNullOrEmptyStringOrUndefined: (value: any) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ContactIdentifier = {
|
|
2
|
+
value: string;
|
|
3
|
+
name: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
};
|
|
6
|
+
export default function useContactIdentifiers(): {
|
|
7
|
+
contactIdentifiers: ContactIdentifier[];
|
|
8
|
+
pending: boolean;
|
|
9
|
+
mutate: import('swr').KeyedMutator<import('axios').AxiosResponse<any, any, {}>>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type LoyaltyTransaction = {
|
|
2
|
+
id: number;
|
|
3
|
+
uuid: string;
|
|
4
|
+
type: LoyaltyTransactionType;
|
|
5
|
+
data: {
|
|
6
|
+
title: string;
|
|
7
|
+
};
|
|
8
|
+
credits: number;
|
|
9
|
+
created_at: string;
|
|
10
|
+
};
|
|
11
|
+
export declare enum LoyaltyTransactionType {
|
|
12
|
+
CREDIT_RECEPTION = 1,
|
|
13
|
+
PHYSICAL_REWARD_RECEPTION = 2,
|
|
14
|
+
DIGITAL_REWARD_RECEPTION = 3
|
|
15
|
+
}
|
|
16
|
+
export default function useLoyaltyTransactions(): {
|
|
17
|
+
loyaltyTransactions: LoyaltyTransaction[];
|
|
18
|
+
pending: boolean;
|
|
19
|
+
mutate: import('swr').KeyedMutator<import('axios').AxiosResponse<any, any, {}>>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExternalToast } from 'sonner';
|
|
2
|
+
export default function useToast(): {
|
|
3
|
+
toast: (result: "success" | "error", message: string) => void;
|
|
4
|
+
successToast: (message?: string, customOptions?: ExternalToast) => void;
|
|
5
|
+
warningToast: (message?: string) => void;
|
|
6
|
+
errorToast: (error?: any) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { Contact as ContactResource } from './types/Contact';
|
|
2
|
+
export type { GiftcardTransactionResource } from './types/Giftcard';
|
|
3
|
+
export { PrimaryIdentificationMethod } from './types/PortalSession';
|
|
4
|
+
export type { RewardResource } from './types/Reward';
|
|
5
|
+
export type { VoucherResource } from './types/Voucher';
|
|
6
|
+
export { FacingMode, PortalType } from './helpers/enum';
|
|
7
|
+
export { default as PortalSession } from './modules/CreateNewPortalSession';
|
|
8
|
+
export { default as UuidSession } from './modules/UuidSession';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FacingMode, PortalType } from '../helpers';
|
|
2
|
+
import { Contact } from '../types/Contact';
|
|
3
|
+
import { GiftcardTransactionResource } from '../types/Giftcard';
|
|
4
|
+
import { PrimaryIdentificationMethod } from '../types/PortalSession';
|
|
5
|
+
import { PrepaidTransaction } from '../types/Prepaid';
|
|
6
|
+
import { RewardResource } from '../types/Reward';
|
|
7
|
+
import { VoucherResource } from '../types/Voucher';
|
|
8
|
+
export type PortalSessionProps = {
|
|
9
|
+
type?: PortalType;
|
|
10
|
+
host?: string;
|
|
11
|
+
apiKey: string;
|
|
12
|
+
debug?: boolean;
|
|
13
|
+
shopUuid: string;
|
|
14
|
+
contactUuid?: string;
|
|
15
|
+
enableRegistration?: boolean;
|
|
16
|
+
enableEmailIdentification?: boolean;
|
|
17
|
+
enableOnScreenKeyboard?: boolean;
|
|
18
|
+
allowMultipleGiftcards?: boolean;
|
|
19
|
+
amountInCents?: number;
|
|
20
|
+
cameraService?: 1 | 2 | 3 | 4;
|
|
21
|
+
cameraFacingMode?: FacingMode | "user" | "environment";
|
|
22
|
+
onContactLink?: (contact: Contact) => void;
|
|
23
|
+
onClaimReward?: (reward: RewardResource, transactionUuid?: string) => void;
|
|
24
|
+
onRedeemVoucher?: (voucher: VoucherResource) => void;
|
|
25
|
+
onUseGiftcard?: (giftcardTransaction: GiftcardTransactionResource) => void;
|
|
26
|
+
onCreateTransaction?: (creditReceptionId: number) => void;
|
|
27
|
+
onCreatePrepaidTransaction?: (prepaidTransaction: PrepaidTransaction) => void;
|
|
28
|
+
primaryIdentificationMethod?: PrimaryIdentificationMethod;
|
|
29
|
+
enableMarketingPreferences?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export default function CreateNewPortalSession(props: PortalSessionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Brandkit = {
|
|
2
|
+
default_font: {
|
|
3
|
+
id: number;
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
font_family: string;
|
|
7
|
+
large_logo_url: string;
|
|
8
|
+
primary_color: string;
|
|
9
|
+
quarternary_color: string;
|
|
10
|
+
secondary_color: string;
|
|
11
|
+
small_logo_url: string;
|
|
12
|
+
tertiary_color: string;
|
|
13
|
+
};
|
|
14
|
+
export default function Root(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type ScannerProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
onInputChange: (value: string) => void;
|
|
4
|
+
onScannerChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
export default function Scanner({ value, onInputChange, onScannerChange, placeholder, label, }: ScannerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AuthenticateContact(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Contact } from '../../../types/Contact';
|
|
2
|
+
export type ContactIdentifier = {
|
|
3
|
+
id: number;
|
|
4
|
+
value: string;
|
|
5
|
+
contact: Contact | null;
|
|
6
|
+
uuid: string;
|
|
7
|
+
};
|
|
8
|
+
type Props = {
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
onSuccess: () => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export default function AuthenticateViaEmail({ onCancel, onSuccess }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Contact } from '../../types/Contact';
|
|
2
|
+
type FindOrCreateContactParams = {
|
|
3
|
+
email: string;
|
|
4
|
+
createIfNotFound: boolean;
|
|
5
|
+
};
|
|
6
|
+
export default function useFindOrCreateContact(): {
|
|
7
|
+
findOrCreateContact: ({ email, createIfNotFound, }: FindOrCreateContactParams) => Promise<Contact>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|