@segmentify/ui 0.0.50 → 0.0.52

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 };
@@ -5,7 +5,7 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogP
5
5
  declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
6
  declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
7
  declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
- declare function DialogContent({ className, children, showCloseButton, overlayClassName, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
8
+ declare function DialogContent({ className, children, showCloseButton, overlayClassName, ref, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
9
  showCloseButton?: boolean;
10
10
  overlayClassName?: string;
11
11
  }): import("react/jsx-runtime").JSX.Element;
@@ -9,7 +9,7 @@ declare function SelectTrigger({ className, size, children, ...props }: React.Co
9
9
  type SelectContentProps = React.ComponentProps<typeof SelectPrimitive.Content> & {
10
10
  isPortal?: boolean;
11
11
  };
12
- declare function SelectContent({ className, children, position, isPortal, align, ...props }: SelectContentProps): import("react/jsx-runtime").JSX.Element;
12
+ declare function SelectContent({ className, children, position, isPortal, align, style, ...props }: SelectContentProps): import("react/jsx-runtime").JSX.Element;
13
13
  declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
14
14
  declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
15
15
  declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
@@ -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,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
+ }
@@ -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 {};
@@ -0,0 +1 @@
1
+ export declare const usePopupLayerZIndex: () => number | undefined;
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';
@@ -1,6 +1,8 @@
1
+ import * as React from 'react';
1
2
  import { type ClassValue } from 'clsx';
2
3
  import { type FormatOptions } from 'date-fns';
3
4
  export declare function cn(...inputs: ClassValue[]): string;
5
+ export declare function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T>;
4
6
  /**
5
7
  * Formats a Date object into a localized string using date-fns.
6
8
  * Falls back to formatting the current date if the provided date is invalid.
@@ -0,0 +1 @@
1
+ export declare const PopupLayerContext: import("react").Context<number | undefined>;