@segmentify/ui 0.0.49 → 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 {};
@@ -1,9 +1,9 @@
1
+ import React from 'react';
1
2
  interface CampaignTitleProps {
2
- label: string;
3
- editLabel: string;
4
- status: string;
5
- statusMap: Record<string, string>;
6
- campaignId: string;
3
+ label: React.ReactNode;
4
+ isEdit?: boolean;
5
+ campaignId?: string;
6
+ children?: React.ReactNode;
7
7
  }
8
- declare const CampaignTitle: ({ label, editLabel, status, statusMap, campaignId }: CampaignTitleProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const CampaignTitle: ({ label, campaignId, isEdit, children }: CampaignTitleProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export { CampaignTitle };
@@ -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 {};
@@ -1,16 +1,12 @@
1
1
  import React from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import { labelVariants } from '../../lib/design-variants';
4
- export interface InputFieldProps {
4
+ export interface InputFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'label'> {
5
5
  name: string;
6
- value: string;
7
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
8
- placeholder: string;
6
+ value?: string | number | readonly string[];
9
7
  label?: string;
10
8
  labelVariant?: VariantProps<typeof labelVariants>['variant'];
11
- type?: React.HTMLInputTypeAttribute;
12
9
  description?: string;
13
- className?: string;
14
10
  isReadOnly?: boolean;
15
11
  inputClassName?: string;
16
12
  hasRequiredIndicator?: boolean;
@@ -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
+ }
@@ -1,6 +1,6 @@
1
1
  import { Switch } from '../../components/atoms/switch';
2
2
  interface Props extends React.ComponentProps<typeof Switch> {
3
- label: string;
3
+ label?: string;
4
4
  name: string;
5
5
  }
6
6
  export declare const SwitchField: ({ label, name, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
@@ -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 {};
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import { type Control, type FieldValues, type Path } from 'react-hook-form';
2
3
  import type { ClassValue } from 'clsx';
3
- type Props<TFieldValues extends FieldValues = FieldValues> = {
4
+ type Props<TFieldValues extends FieldValues = FieldValues> = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'defaultValue'> & {
4
5
  name: Path<TFieldValues>;
5
6
  label: string;
6
7
  placeholder?: string;
@@ -11,5 +12,5 @@ type Props<TFieldValues extends FieldValues = FieldValues> = {
11
12
  tooltipContent?: string;
12
13
  hasRequiredIndicator?: boolean;
13
14
  };
14
- export declare const FormInput: <TFieldValues extends FieldValues>({ label, containerClassName, inputClassName, name, description, placeholder, tooltipContent, hasRequiredIndicator, control, ...props }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const FormInput: <TFieldValues extends FieldValues>({ label, containerClassName, inputClassName, name, description, placeholder, tooltipContent, hasRequiredIndicator, control, type, ...props }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { ClassValue } from 'clsx';
3
+ import { type Control, type FieldValues, type Path } from 'react-hook-form';
4
+ import { SelectField } from '../../components/molecules/select-field';
5
+ import type { SelectItemProps } from '../../lib/types';
6
+ type SelectFieldRest = Omit<React.ComponentProps<typeof SelectField>, 'value' | 'onChange' | 'hasFormControlWrapper' | 'label' | 'labelClassName'>;
7
+ type FormSelectProps<TFieldValues extends FieldValues = FieldValues> = {
8
+ name: Path<TFieldValues>;
9
+ label: string;
10
+ options: SelectItemProps[];
11
+ placeholder: string;
12
+ control?: Control<TFieldValues>;
13
+ description?: string;
14
+ tooltipContent?: string;
15
+ hasRequiredIndicator?: boolean;
16
+ containerClassName?: ClassValue;
17
+ } & SelectFieldRest;
18
+ export declare const FormSelect: <TFieldValues extends FieldValues = FieldValues>({ name, label, options, placeholder, description, tooltipContent, hasRequiredIndicator, containerClassName, control, ...selectFieldProps }: FormSelectProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -1,9 +1,10 @@
1
1
  import { type Control, type FieldValues, type Path } from 'react-hook-form';
2
2
  type Props<TFieldValues extends FieldValues = FieldValues> = {
3
3
  name: Path<TFieldValues>;
4
- label: string;
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,22 @@
1
+ /**
2
+ * TimePicker component for selecting time values in forms.
3
+ *
4
+ * @component
5
+ * @param {Object} props - The component props.
6
+ * @param {string} props.name - The name of the input field for form registration.
7
+ * @param {string} [props.label] - The label message ID for internationalization.
8
+ * @param {string} [props.description] - The description message ID for internationalization.
9
+ * @param {string} [props.containerClassName] - Additional CSS classes for the container.
10
+ * @param {number} [props.step=60] - The step interval in seconds for the time input.
11
+ * @returns {JSX.Element} The rendered TimePicker component.
12
+ */
13
+ type FormTimePickerProps = {
14
+ name: string;
15
+ label?: string;
16
+ description?: string;
17
+ containerClassName?: string;
18
+ showErrorPlaceholder?: boolean;
19
+ step?: number;
20
+ };
21
+ export declare const FormTimePicker: ({ name, label, description, containerClassName, showErrorPlaceholder, step, }: FormTimePickerProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
package/dist/index.d.ts CHANGED
@@ -30,8 +30,10 @@ 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
+ export { FormSelect } from './components/organisms/form-select';
36
+ export { FormTimePicker } from './components/organisms/form-time-picker';
35
37
  export { FormDatePicker } from './components/organisms/form-date-picker';
36
38
  export { FormFileUpload } from './components/organisms/form-file-upload';
37
39
  export { FormInput } from './components/organisms/form-input';
@@ -80,6 +82,8 @@ export { TextAreaField } from './components/molecules/textarea-field';
80
82
  export { Timeline, type IconConfig, type TimelineItem, type TimelineProps } from './components/organisms/timeline';
81
83
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/atoms/tooltip';
82
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';
83
87
  export { QuillEditor } from './components/atoms/quill-editor';
84
88
  export { DataTable, type ColumnDef, type Column } from './components/organisms/data-table';
85
89
  export type { ActionItem, ActionsProps, RenderRowSubComponentProps } from './components/organisms/data-table';