@segmentify/ui 0.0.28 → 0.0.31

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.
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { AlertDialog as AlertDialogPrimitive } from 'radix-ui';
3
+ import { Button } from '../../components/atoms/button';
4
+ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
7
+ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
+ declare function AlertDialogContent({ className, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
9
+ size?: 'default' | 'sm';
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
12
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
13
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
15
+ declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
16
+ declare function AlertDialogAction({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>): import("react/jsx-runtime").JSX.Element;
17
+ declare function AlertDialogCancel({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>): import("react/jsx-runtime").JSX.Element;
18
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import { Combobox as ComboboxPrimitive } from '@base-ui/react';
3
+ declare const Combobox: typeof ComboboxPrimitive.Root;
4
+ declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): import("react/jsx-runtime").JSX.Element;
5
+ declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
6
+ declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
7
+ showTrigger?: boolean;
8
+ showClear?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>): import("react/jsx-runtime").JSX.Element;
11
+ declare function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): import("react/jsx-runtime").JSX.Element;
12
+ declare function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props): import("react/jsx-runtime").JSX.Element;
13
+ declare function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props): import("react/jsx-runtime").JSX.Element;
14
+ declare function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props): import("react/jsx-runtime").JSX.Element;
15
+ declare function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props): import("react/jsx-runtime").JSX.Element;
16
+ declare function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props): import("react/jsx-runtime").JSX.Element;
17
+ declare function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props): import("react/jsx-runtime").JSX.Element;
18
+ declare function ComboboxChips({ className, ...props }: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props): import("react/jsx-runtime").JSX.Element;
19
+ declare function ComboboxChip({ className, children, showRemove, ...props }: ComboboxPrimitive.Chip.Props & {
20
+ showRemove?: boolean;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ declare function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props): import("react/jsx-runtime").JSX.Element;
23
+ declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
24
+ export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import type { ClassValue } from 'clsx';
3
3
  type Props = {
4
- title: string;
5
4
  children: React.ReactNode;
5
+ title?: string;
6
6
  className?: ClassValue;
7
7
  titleClassName?: string;
8
8
  header?: React.ReactNode;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ import { Button } from '../../components/atoms/button';
4
+ declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
5
+ declare const inputGroupAddonVariants: (props?: ({
6
+ align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
9
+ declare const inputGroupButtonVariants: (props?: ({
10
+ size?: "xs" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, 'size'> & VariantProps<typeof inputGroupButtonVariants>): import("react/jsx-runtime").JSX.Element;
13
+ declare function InputGroupText({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
14
+ declare function InputGroupInput({ className, ...props }: React.ComponentProps<'input'>): import("react/jsx-runtime").JSX.Element;
15
+ declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<'textarea'>): import("react/jsx-runtime").JSX.Element;
16
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea };
@@ -1,31 +1,26 @@
1
- import type { SelectItemProps } from '../../lib/types';
2
- type TriggerProps = {
3
- trigger: React.ReactNode;
4
- triggerPlaceholder?: never;
5
- } | {
6
- trigger?: never;
7
- triggerPlaceholder: string;
1
+ import React from 'react';
2
+ export type ComboboxFieldItem = {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
8
6
  };
9
- type Props = TriggerProps & {
10
- isDisabled?: boolean;
11
- options: SelectItemProps[];
12
- isFormControlWrapper?: boolean;
13
- avoidCollisions?: boolean;
14
- contentClassName?: string;
15
- inputPlaceholder: string;
16
- emptyMessage: string;
17
- containerClassName?: string;
18
- contentListClassName?: string;
19
- closeOnSelect?: boolean;
20
- align?: 'start' | 'center' | 'end';
7
+ export type ComboboxFieldInputMode = 'input' | 'popup';
8
+ type Props = {
9
+ items: ComboboxFieldItem[];
10
+ value: ComboboxFieldItem[];
11
+ onValueChange: (values: ComboboxFieldItem[]) => void;
21
12
  label?: string;
22
- onInputChange?: (inputValue: string) => void;
23
- clearable?: boolean;
24
13
  multiple?: boolean;
25
- value: string | string[];
26
- onValueChange: (value: string | string[]) => void;
14
+ hasClearButton?: boolean;
15
+ disabled?: boolean;
16
+ placeholder?: string;
17
+ containerClassName?: string;
18
+ emptyMessage?: string;
27
19
  hasAllOption?: boolean;
28
20
  allOptionLabel?: string;
21
+ inputMode?: ComboboxFieldInputMode;
22
+ renderPopupTrigger?: (valueElement: React.ReactNode, selectedValues: ComboboxFieldItem[]) => React.ReactElement;
23
+ onInputChange?: (value: string) => void;
29
24
  };
30
- export declare const ComboboxField: ({ value, isDisabled, hasAllOption, multiple, options, allOptionLabel, triggerPlaceholder, trigger, isFormControlWrapper, avoidCollisions, align, contentClassName, inputPlaceholder, emptyMessage, containerClassName, contentListClassName, closeOnSelect, label, onValueChange, onInputChange, clearable, }: Props) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const ComboboxField: ({ items, label, multiple, hasClearButton, disabled, placeholder, containerClassName, emptyMessage, hasAllOption, allOptionLabel, inputMode, renderPopupTrigger, onInputChange, value, onValueChange, }: Props) => import("react/jsx-runtime").JSX.Element;
31
26
  export {};
@@ -1,15 +1,15 @@
1
1
  import { type DateRange } from 'react-day-picker';
2
2
  import { type ClassValue } from 'clsx';
3
3
  type Props = {
4
- start: Date;
5
- end: Date;
4
+ start?: Date;
5
+ end?: Date;
6
6
  onConfirm: (range: DateRange) => void;
7
- className?: ClassValue;
8
- triggerButtonClassName?: ClassValue;
9
- label: string;
7
+ label?: string;
10
8
  placeholder: string;
11
- confirmLabel: string;
12
- disabledCondition: (date: Date) => boolean;
9
+ triggerButtonClassName?: ClassValue;
10
+ className?: ClassValue;
11
+ confirmLabel?: string;
12
+ disabledCondition?: boolean | ((date: Date) => boolean);
13
13
  };
14
14
  export declare const DateRangePicker: ({ start, end, onConfirm, className, triggerButtonClassName, label, placeholder, confirmLabel, disabledCondition, }: Props) => import("react/jsx-runtime").JSX.Element;
15
15
  export {};
@@ -1,7 +1,6 @@
1
1
  interface ColumnVisibilityProps {
2
- inputPlaceholder?: string;
3
2
  emptyMessage?: string;
4
3
  allOptionLabel?: string;
5
4
  }
6
- export declare function ColumnVisibility({ inputPlaceholder, emptyMessage, allOptionLabel, }: ColumnVisibilityProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function ColumnVisibility({ emptyMessage, allOptionLabel, }: ColumnVisibilityProps): import("react/jsx-runtime").JSX.Element;
7
6
  export {};
@@ -0,0 +1,8 @@
1
+ import { type DateRange } from './presets';
2
+ export interface DatePresetContextValue {
3
+ range: DateRange;
4
+ preset: string | null;
5
+ setRange: (range: DateRange, preset?: string | null) => void;
6
+ }
7
+ export declare const DatePresetContext: import("react").Context<DatePresetContextValue | null>;
8
+ export declare function useDatePreset(): DatePresetContextValue;
@@ -0,0 +1,9 @@
1
+ import { type DatePresetItem } from './presets';
2
+ export interface DatePresetProps {
3
+ presets?: Record<string, DatePresetItem>;
4
+ className?: string;
5
+ confirmLabel?: string;
6
+ placeholder?: string;
7
+ disabledCondition?: boolean | ((date: Date) => boolean);
8
+ }
9
+ export declare function DatePreset({ presets, className, confirmLabel, placeholder, disabledCondition, }: DatePresetProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export type { DateRange, DatePresetItem } from './presets';
2
+ export type { DatePresetContextValue } from './context';
3
+ export type { DatePresetProps } from './date-preset';
4
+ export type { DatePresetProviderProps } from './root';
5
+ export { DATE_PRESETS, DEFAULT_PRESET_KEY, findMatchingPreset } from './presets';
6
+ export { useDatePreset } from './context';
7
+ export { DatePreset } from './date-preset';
8
+ export { DatePresetProvider } from './root';
@@ -0,0 +1,21 @@
1
+ export interface DateRange {
2
+ from: Date;
3
+ to: Date;
4
+ }
5
+ export interface DateRangeOptional {
6
+ from?: Date;
7
+ to?: Date;
8
+ }
9
+ export interface DatePresetItem {
10
+ key: string;
11
+ label: string;
12
+ getRange: () => DateRange;
13
+ }
14
+ export declare const DATE_PRESETS: Record<string, DatePresetItem>;
15
+ export declare const DEFAULT_PRESET_KEY = "LAST_7_DAYS";
16
+ /**
17
+ * Finds a matching preset for a given date range.
18
+ * Compares dates by day (ignores time).
19
+ * @returns The matching preset key or null if no match found.
20
+ */
21
+ export declare function findMatchingPreset(range: DateRange, presets?: Record<string, DatePresetItem>): string | null;
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type DateRange } from './presets';
3
+ export interface DatePresetProviderProps {
4
+ children: ReactNode;
5
+ initialRange?: DateRange;
6
+ initialPreset?: string | null;
7
+ onRangeChange?: (range: DateRange, preset: string | null) => void;
8
+ }
9
+ export declare function DatePresetProvider({ children, initialRange, initialPreset, onRangeChange, }: DatePresetProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,26 +1,21 @@
1
1
  import { type Control, type FieldValues, type Path } from 'react-hook-form';
2
- import type { SelectItemProps } from '../../lib/types';
2
+ import { type ComboboxFieldItem } from '../../components/molecules/combobox-field';
3
3
  type FormComboboxProps<TFieldValues extends FieldValues = FieldValues> = {
4
4
  name: Path<TFieldValues>;
5
- label: string;
6
- triggerPlaceholder: string;
7
- inputPlaceholder: string;
8
- options: SelectItemProps[];
5
+ label?: string;
6
+ placeholder?: string;
7
+ items: ComboboxFieldItem[];
9
8
  description?: string;
10
9
  multiple?: boolean;
11
- emptyMessage: string;
10
+ emptyMessage?: string;
12
11
  containerClassName?: string;
13
- contentClassName?: string;
14
- contentListClassName?: string;
15
- avoidCollisions?: boolean;
16
- clearable?: boolean;
12
+ hasClearButton?: boolean;
17
13
  hasAllOption?: boolean;
18
14
  allOptionLabel?: string;
19
- closeOnSelect?: boolean;
20
- onInputChange?: (inputValue: string) => void;
21
- isDisabled?: boolean;
15
+ disabled?: boolean;
22
16
  tooltipContent?: string;
23
17
  control?: Control<TFieldValues>;
18
+ inputMode?: 'input' | 'popup';
24
19
  };
25
- export declare const FormCombobox: <TFieldValues extends FieldValues = FieldValues>({ name, label, triggerPlaceholder, inputPlaceholder, options, description, multiple, emptyMessage, containerClassName, contentClassName, contentListClassName, avoidCollisions, clearable, hasAllOption, allOptionLabel, closeOnSelect, onInputChange, isDisabled, tooltipContent, control, }: FormComboboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const FormCombobox: <TFieldValues extends FieldValues = FieldValues>({ name, label, placeholder, items, description, multiple, emptyMessage, containerClassName, hasClearButton, hasAllOption, allOptionLabel, disabled, tooltipContent, control, inputMode, }: FormComboboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
26
21
  export {};
@@ -0,0 +1,23 @@
1
+ import { type LucideIcon } from 'lucide-react';
2
+ import { type ReactNode } from 'react';
3
+ export interface IconConfig {
4
+ icon: LucideIcon;
5
+ bg?: string;
6
+ text?: string;
7
+ }
8
+ export interface TimelineItem {
9
+ iconConfig: IconConfig;
10
+ title: string;
11
+ description: string;
12
+ timestamp: number;
13
+ tags?: string[];
14
+ topRightSlot?: ReactNode;
15
+ bottomRightSlot?: ReactNode;
16
+ }
17
+ export interface TimelineProps {
18
+ items: TimelineItem[];
19
+ header?: ReactNode;
20
+ className?: string;
21
+ onItemClick?: (item: TimelineItem, index: number) => void;
22
+ }
23
+ export declare const Timeline: ({ items, header, className, onItemClick }: TimelineProps) => import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './components/atoms/accordion';
2
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from './components/atoms/alert-dialog';
2
3
  export { AspectRatio } from './components/atoms/aspect-ratio';
3
4
  export { Avatar, AvatarFallback, AvatarImage } from './components/atoms/avatar';
4
5
  export { Badge } from './components/atoms/badge';
@@ -17,7 +18,6 @@ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, Comman
17
18
  export { ContentWrapper } from './components/atoms/content-wrapper';
18
19
  export { CreatableActionIcons } from './components/molecules/creatable-action-icons';
19
20
  export { CheckboxField } from './components/molecules/checkbox-field';
20
- export { ConfirmationDialog } from './components/molecules/confirmation-dialog';
21
21
  export { ComboboxField } from './components/molecules/combobox-field';
22
22
  export { FormattedDate } from './components/atoms/date';
23
23
  export { DateRangePicker } from './components/molecules/date-range-picker';
@@ -69,8 +69,13 @@ export { Tabs, TabsList, TabsTrigger, TabsContent } from './components/atoms/tab
69
69
  export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, } from './components/atoms/table';
70
70
  export { Textarea } from './components/atoms/textarea';
71
71
  export { TextAreaField } from './components/molecules/textarea-field';
72
+ export { Timeline, type IconConfig, type TimelineItem, type TimelineProps } from './components/organisms/timeline';
72
73
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/atoms/tooltip';
73
74
  export { TooltipField } from './components/molecules/tooltip-field';
74
75
  export { QuillEditor } from './components/atoms/quill-editor';
76
+ export { DATE_PRESETS, DEFAULT_PRESET_KEY } from './components/organisms/date-preset/presets';
77
+ export { type DateRange, type DatePresetItem } from './components/organisms/date-preset/presets';
78
+ export { type DatePresetProviderProps } from './components/organisms/date-preset/root';
79
+ export { type DatePresetContextValue } from './components/organisms/date-preset/context';
75
80
  export { useDataTable, type UseDataTableOptions, type UseDataTableReturn, type FetcherParams, type FetcherResponse, } from './hooks/use-data-table';
76
81
  export { cn } from './lib/utils';
@@ -1,6 +1,6 @@
1
1
  export declare const buttonVariants: (props?: ({
2
2
  variant?: "link" | "primary" | "secondary" | "tertiary" | "success" | "destructive" | "outline" | "ghost" | "action" | "paginationActive" | "paginationInactive" | null | undefined;
3
- size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
3
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
5
  export declare const labelVariants: (props?: ({
6
6
  variant?: "default" | null | undefined;
package/dist/mock.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ import { Product } from './app';
3
+ export declare const columns: ColumnDef<Product>[];