@segmentify/ui 0.0.50 → 0.0.51

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.
@@ -3,5 +3,7 @@ import * as AccordionPrimitive from '@radix-ui/react-accordion';
3
3
  declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
4
  declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
5
5
  declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
- declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ declare function AccordionContent({ className, wrapperClassName, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content> & {
7
+ wrapperClassName?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
7
9
  export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -0,0 +1,2 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ export declare const Iphone15: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ type PreviewSingleButtonProps = {
3
+ className?: string;
4
+ };
5
+ export declare const PreviewSingleButton: ({ children, className }: PropsWithChildren<PreviewSingleButtonProps>) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import type { VariantProps } from 'class-variance-authority';
3
+ import { buttonVariants } from '../../lib/design-variants';
4
+ import type { Union } from 'ts-toolbelt';
5
+ type BaseProps = {
6
+ title: string;
7
+ description: string;
8
+ onAction: () => void;
9
+ children?: React.ReactNode;
10
+ cancelLabel: string;
11
+ actionLabel: string;
12
+ actionVariant?: VariantProps<typeof buttonVariants>['variant'];
13
+ };
14
+ type ControlledProps = BaseProps & {
15
+ controlled: true;
16
+ open: boolean;
17
+ setOpen: (open: boolean) => void;
18
+ };
19
+ type UncontrolledProps = BaseProps & {
20
+ controlled?: false;
21
+ };
22
+ type Props = Union.Strict<ControlledProps | UncontrolledProps>;
23
+ export declare const ConfirmationDialog: ({ title, description, onAction, children, cancelLabel, actionLabel, actionVariant, open, setOpen, controlled, }: Props) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type Control, type FieldValues, type Path } from 'react-hook-form';
2
+ type FormCheckboxProps<TFieldValues extends FieldValues = FieldValues> = {
3
+ name: Path<TFieldValues>;
4
+ control?: Control<TFieldValues>;
5
+ label: string;
6
+ containerClassName?: string;
7
+ };
8
+ export declare const FormCheckbox: <TFieldValues extends FieldValues = FieldValues>({ name, control, containerClassName, ...props }: FormCheckboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ import { MessagingPhoneProps } from '../../types/messaging';
2
+ export declare const PreviewSMS: {
3
+ ({ messageData }: MessagingPhoneProps): import("react/jsx-runtime").JSX.Element | null;
4
+ displayName: string;
5
+ };
@@ -0,0 +1,9 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface RecommendationFiltersButtonProps {
3
+ onClick: () => void;
4
+ icon: ReactNode;
5
+ label: ReactNode;
6
+ isInclusion?: boolean;
7
+ }
8
+ export declare const RecommendationFiltersButton: React.FC<RecommendationFiltersButtonProps>;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { SharedAlgorithmProps, RecommendationCardConfig } from '../types';
4
+ interface SelectedAlgorithmsProps<TFieldValues extends FieldValues = FieldValues> extends SharedAlgorithmProps<TFieldValues> {
5
+ update: (index: number, value: unknown) => void;
6
+ swap: (index1: number, index2: number) => void;
7
+ remove: (index: number) => void;
8
+ move: (from: number, to: number) => void;
9
+ config?: RecommendationCardConfig;
10
+ }
11
+ export declare const SelectedAlgorithms: React.FC<SelectedAlgorithmsProps>;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RecommendationCardProps } from './types';
2
+ export declare const RecommendationCard: <TFieldValues extends Record<string, unknown> = Record<string, unknown>>({ ...props }: RecommendationCardProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,82 @@
1
+ import { ReactNode } from 'react';
2
+ import { ArrayPath, Control, FieldValues, UseFieldArrayReturn } from 'react-hook-form';
3
+ export type AlgorithmType = 'INTELLIGENT' | 'STATIC';
4
+ export type FilterType = 'exclude' | 'include';
5
+ export declare const STATIC_ALGORITHM_TYPE: {
6
+ readonly PRODUCT: "PRODUCT";
7
+ };
8
+ export interface IntelligentAlgorithmOption {
9
+ id: string;
10
+ icon?: ReactNode;
11
+ description?: ReactNode;
12
+ label: string;
13
+ value: string;
14
+ desktopProductCount?: number;
15
+ mobileProductCount?: number;
16
+ timeFrame?: string;
17
+ isTimeFrameDisabled?: boolean;
18
+ isOptionsDisabled?: boolean;
19
+ suitablePages?: string[];
20
+ [key: string]: unknown;
21
+ }
22
+ export interface StaticAlgorithmOption {
23
+ key: string;
24
+ title: string;
25
+ description?: string;
26
+ icon?: ReactNode;
27
+ [key: string]: unknown;
28
+ }
29
+ export interface EmailAlgorithmConfig {
30
+ isMultiSelect?: boolean;
31
+ uniqueItems?: boolean;
32
+ isIntelligentDisabled?: boolean;
33
+ isStaticDisabled?: boolean;
34
+ [key: string]: unknown;
35
+ }
36
+ export interface RecommendationCardConfig {
37
+ isRecommendation?: boolean;
38
+ isEmail?: boolean;
39
+ isWhatsapp?: boolean;
40
+ isSearch?: boolean;
41
+ isPromotion?: boolean;
42
+ isKeyword?: boolean;
43
+ showShuffleProducts?: boolean;
44
+ showRecommendOtherCategories?: boolean;
45
+ showShufflePromotions?: boolean;
46
+ }
47
+ export interface SharedAlgorithmProps<TFieldValues extends FieldValues = FieldValues> {
48
+ control: Control<TFieldValues>;
49
+ fields: Record<string, unknown>[];
50
+ intelligentAlgorithms: IntelligentAlgorithmOption[];
51
+ staticAlgorithms?: Record<string, StaticAlgorithmOption>;
52
+ emailAlgorithmConfig?: EmailAlgorithmConfig;
53
+ }
54
+ export interface RecommendationCardProps<TFieldValues extends FieldValues = FieldValues> {
55
+ control: Control<TFieldValues>;
56
+ fieldArray: UseFieldArrayReturn<TFieldValues, ArrayPath<TFieldValues>, 'id'>;
57
+ intelligentAlgorithms: IntelligentAlgorithmOption[];
58
+ staticAlgorithms?: Record<string, StaticAlgorithmOption>;
59
+ emailAlgorithmConfig?: EmailAlgorithmConfig;
60
+ labels?: {
61
+ title?: ReactNode;
62
+ description?: ReactNode;
63
+ shuffleProducts?: string;
64
+ recommendOtherCategories?: string;
65
+ shufflePromotions?: string;
66
+ exclusionFilters?: ReactNode;
67
+ inclusionFilters?: ReactNode;
68
+ };
69
+ config?: RecommendationCardConfig;
70
+ onFiltersToggle?: (type: FilterType, isOpen: boolean) => void;
71
+ renderFilters?: (type: FilterType) => ReactNode;
72
+ renderAlgorithmModals?: (props: SharedAlgorithmProps<TFieldValues> & {
73
+ append: UseFieldArrayReturn<TFieldValues, ArrayPath<TFieldValues>, 'id'>['append'];
74
+ }) => ReactNode;
75
+ renderSelectedAlgorithms?: (props: SharedAlgorithmProps<TFieldValues> & {
76
+ update: UseFieldArrayReturn<TFieldValues, ArrayPath<TFieldValues>, 'id'>['update'];
77
+ move: (from: number, to: number) => void;
78
+ swap: (index1: number, index2: number) => void;
79
+ remove: (index: number) => void;
80
+ config?: RecommendationCardConfig;
81
+ }) => ReactNode;
82
+ }
@@ -0,0 +1,15 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ type WhatsappMessageProps = {
3
+ cards?: {
4
+ image?: string;
5
+ title?: string;
6
+ content?: string;
7
+ buttons: {
8
+ text?: string;
9
+ yupButtonsText?: string;
10
+ }[];
11
+ }[];
12
+ includeTime?: boolean;
13
+ };
14
+ export declare const WhatsappMessage: ({ children, cards, includeTime }: PropsWithChildren<WhatsappMessageProps>) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -4,6 +4,7 @@ type FormCheckboxProps<TFieldValues extends FieldValues = FieldValues> = {
4
4
  control?: Control<TFieldValues>;
5
5
  label: string;
6
6
  formClassName?: string;
7
+ containerClassName?: string;
7
8
  };
8
9
  export declare const FormCheckbox: <TFieldValues extends FieldValues = FieldValues>({ name, control, formClassName, ...props }: FormCheckboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -4,6 +4,7 @@ type Props<TFieldValues extends FieldValues = FieldValues> = {
4
4
  label?: string;
5
5
  control?: Control<TFieldValues>;
6
6
  description?: string;
7
+ className?: string;
7
8
  };
8
- export declare const FormSwitch: <TFieldValues extends FieldValues = FieldValues>({ name, label, description, control, ...props }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const FormSwitch: <TFieldValues extends FieldValues = FieldValues>({ name, label, description, control, className, ...props }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
9
10
  export {};
package/dist/index.d.ts CHANGED
@@ -30,7 +30,7 @@ export { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyCont
30
30
  export { ErrorMessage } from './components/atoms/error-message';
31
31
  export { FieldDescription } from './components/atoms/field-description';
32
32
  export { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from './components/atoms/form';
33
- export { FormCheckbox } from './components/organisms/form-checkbox';
33
+ export { FormCheckbox } from './components/molecules/form-checkbox';
34
34
  export { FormCombobox } from './components/organisms/form-combobox';
35
35
  export { FormSelect } from './components/organisms/form-select';
36
36
  export { FormTimePicker } from './components/organisms/form-time-picker';
@@ -82,6 +82,8 @@ export { TextAreaField } from './components/molecules/textarea-field';
82
82
  export { Timeline, type IconConfig, type TimelineItem, type TimelineProps } from './components/organisms/timeline';
83
83
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/atoms/tooltip';
84
84
  export { TooltipField } from './components/molecules/tooltip-field';
85
+ export { RecommendationCard } from './components/molecules/recommendation-card';
86
+ export type { RecommendationCardProps, IntelligentAlgorithmOption, StaticAlgorithmOption, EmailAlgorithmConfig, AlgorithmType, FilterType, RecommendationCardConfig, } from './components/molecules/recommendation-card/types';
85
87
  export { QuillEditor } from './components/atoms/quill-editor';
86
88
  export { DataTable, type ColumnDef, type Column } from './components/organisms/data-table';
87
89
  export type { ActionItem, ActionsProps, RenderRowSubComponentProps } from './components/organisms/data-table';