@segmentify/ui 0.0.35 → 0.0.36
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/dist/components/atoms/alert-dialog.d.ts +18 -0
- package/dist/components/atoms/button.d.ts +2 -2
- package/dist/components/atoms/combobox.d.ts +24 -0
- package/dist/components/atoms/content-wrapper.d.ts +1 -1
- package/dist/components/atoms/input-group.d.ts +16 -0
- package/dist/components/molecules/combobox-field.d.ts +19 -24
- package/dist/components/molecules/date-range-picker.d.ts +10 -8
- package/dist/components/organisms/data-table/column-visibility.d.ts +1 -2
- package/dist/components/organisms/data-table/context.d.ts +2 -2
- package/dist/components/organisms/data-table/index.d.ts +2 -1
- package/dist/components/organisms/data-table/pagination.d.ts +5 -1
- package/dist/components/organisms/data-table/root.d.ts +3 -3
- package/dist/components/organisms/date-preset/context.d.ts +8 -0
- package/dist/components/organisms/date-preset/date-preset.d.ts +11 -0
- package/dist/components/organisms/date-preset/index.d.ts +8 -0
- package/dist/components/organisms/date-preset/presets.d.ts +21 -0
- package/dist/components/organisms/date-preset/root.d.ts +9 -0
- package/dist/components/organisms/form-combobox.d.ts +9 -14
- package/dist/components/organisms/form-file-upload.d.ts +3 -1
- package/dist/components/organisms/timeline.d.ts +25 -0
- package/dist/hooks/use-data-table.d.ts +9 -8
- package/dist/index.d.ts +12 -1
- package/dist/lib/design-variants.d.ts +1 -1
- package/dist/lib/utils.d.ts +27 -1
- package/dist/segmentify-ui.cjs +98 -72
- package/dist/segmentify-ui.js +31460 -25283
- package/dist/ui.css +24 -8
- package/package.json +1 -1
- package/dist/components/molecules/confirmation-dialog.d.ts +0 -24
|
@@ -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, };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { buttonVariants } from '../../lib/design-variants';
|
|
4
|
-
interface ButtonProps extends React.ComponentProps<'button'> {
|
|
4
|
+
export interface ButtonProps extends React.ComponentProps<'button'> {
|
|
5
5
|
variant?: VariantProps<typeof buttonVariants>['variant'];
|
|
6
6
|
size?: VariantProps<typeof buttonVariants>['size'];
|
|
7
7
|
asChild?: boolean;
|
|
8
8
|
}
|
|
9
|
-
declare
|
|
9
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
export { Button };
|
|
@@ -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, };
|
|
@@ -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
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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: ({
|
|
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,17 @@
|
|
|
1
|
+
import { type Locale } from 'date-fns';
|
|
1
2
|
import { type DateRange } from 'react-day-picker';
|
|
2
3
|
import { type ClassValue } from 'clsx';
|
|
3
4
|
type Props = {
|
|
4
|
-
start
|
|
5
|
-
end
|
|
5
|
+
start?: Date;
|
|
6
|
+
end?: Date;
|
|
6
7
|
onConfirm: (range: DateRange) => void;
|
|
7
|
-
|
|
8
|
-
triggerButtonClassName?: ClassValue;
|
|
9
|
-
label: string;
|
|
8
|
+
label?: string;
|
|
10
9
|
placeholder: string;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
triggerButtonClassName?: ClassValue;
|
|
11
|
+
className?: ClassValue;
|
|
12
|
+
confirmLabel?: string;
|
|
13
|
+
disabledCondition?: boolean | ((date: Date) => boolean);
|
|
14
|
+
dateLocale?: Locale;
|
|
13
15
|
};
|
|
14
|
-
export declare const DateRangePicker: ({ start, end, onConfirm, className, triggerButtonClassName, label, placeholder, confirmLabel, disabledCondition, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const DateRangePicker: ({ start, end, onConfirm, className, triggerButtonClassName, label, placeholder, confirmLabel, disabledCondition, dateLocale, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
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({
|
|
5
|
+
export declare function ColumnVisibility({ emptyMessage, allOptionLabel, }: ColumnVisibilityProps): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -2,8 +2,8 @@ import { type Table as TanstackTable } from '@tanstack/react-table';
|
|
|
2
2
|
export interface DataTableContextValue<TData> {
|
|
3
3
|
table: TanstackTable<TData>;
|
|
4
4
|
isLoading: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
search: string;
|
|
6
|
+
onSearchChange: (value: string) => void;
|
|
7
7
|
totalCount?: number;
|
|
8
8
|
}
|
|
9
9
|
export declare const DataTableContext: import("react").Context<DataTableContextValue<unknown> | null>;
|
|
@@ -5,12 +5,13 @@ import { ColumnVisibility } from './column-visibility';
|
|
|
5
5
|
import { Content } from './content';
|
|
6
6
|
export type { ActionItem, ActionsProps } from './actions';
|
|
7
7
|
export type { RenderRowSubComponentProps } from './content';
|
|
8
|
+
export { type ColumnDef } from '@tanstack/react-table';
|
|
8
9
|
export declare const DataTable: {
|
|
9
10
|
Root: typeof Root;
|
|
10
11
|
Toolbar: typeof Toolbar;
|
|
11
12
|
Search: typeof Search;
|
|
12
13
|
ColumnVisibility: typeof ColumnVisibility;
|
|
13
14
|
Content: typeof Content;
|
|
14
|
-
Pagination: ({ showSelectedCount, showPaginationInfo, className }: import("./pagination").PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Pagination: ({ showSelectedCount, showPaginationInfo, className, showPerPageLabel, selectPlaceholder, selectedCountText, paginationInfoText, }: import("./pagination").PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
Actions: ({ actions }: import("./actions").ActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
17
|
};
|
|
@@ -2,5 +2,9 @@ export interface PaginationProps {
|
|
|
2
2
|
showSelectedCount?: boolean;
|
|
3
3
|
showPaginationInfo?: boolean;
|
|
4
4
|
className?: string;
|
|
5
|
+
showPerPageLabel?: string;
|
|
6
|
+
selectPlaceholder?: string;
|
|
7
|
+
selectedCountText?: (selected: number, total: number) => string;
|
|
8
|
+
paginationInfoText?: (start: number, end: number, total: number) => string;
|
|
5
9
|
}
|
|
6
|
-
export declare const Pagination: ({ showSelectedCount, showPaginationInfo, className }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const Pagination: ({ showSelectedCount, showPaginationInfo, className, showPerPageLabel, selectPlaceholder, selectedCountText, paginationInfoText, }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,10 +4,10 @@ interface RootProps<TData> {
|
|
|
4
4
|
table: TanstackTable<TData>;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
isLoading?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
search?: string;
|
|
8
|
+
onSearchChange?: (value: string) => void;
|
|
9
9
|
totalCount?: number;
|
|
10
10
|
className?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare function Root<TData>({ table, children, isLoading,
|
|
12
|
+
export declare function Root<TData>({ table, children, isLoading, search, onSearchChange, totalCount, className, }: RootProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
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,11 @@
|
|
|
1
|
+
import { type Locale } from 'date-fns';
|
|
2
|
+
import { type DatePresetItem } from './presets';
|
|
3
|
+
export interface DatePresetProps {
|
|
4
|
+
presets?: Record<string, DatePresetItem>;
|
|
5
|
+
className?: string;
|
|
6
|
+
confirmLabel?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabledCondition?: boolean | ((date: Date) => boolean);
|
|
9
|
+
dateLocale?: Locale;
|
|
10
|
+
}
|
|
11
|
+
export declare function DatePreset({ presets, className, confirmLabel, placeholder, disabledCondition, dateLocale, }: 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
|
|
2
|
+
import { type ComboboxFieldItem } from '../../components/molecules/combobox-field';
|
|
3
3
|
type FormComboboxProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
4
4
|
name: Path<TFieldValues>;
|
|
5
|
-
label
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
options: SelectItemProps[];
|
|
5
|
+
label?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
items: ComboboxFieldItem[];
|
|
9
8
|
description?: string;
|
|
10
9
|
multiple?: boolean;
|
|
11
|
-
emptyMessage
|
|
10
|
+
emptyMessage?: string;
|
|
12
11
|
containerClassName?: string;
|
|
13
|
-
|
|
14
|
-
contentListClassName?: string;
|
|
15
|
-
avoidCollisions?: boolean;
|
|
16
|
-
clearable?: boolean;
|
|
12
|
+
hasClearButton?: boolean;
|
|
17
13
|
hasAllOption?: boolean;
|
|
18
14
|
allOptionLabel?: string;
|
|
19
|
-
|
|
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,
|
|
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 {};
|
|
@@ -5,6 +5,8 @@ type FormFileUploadProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
|
5
5
|
control?: Control<TFieldValues>;
|
|
6
6
|
label?: string;
|
|
7
7
|
uploadButtonLabel?: string;
|
|
8
|
+
uploadingLabel?: string;
|
|
9
|
+
uploadFailedMessage?: string;
|
|
8
10
|
description?: string;
|
|
9
11
|
accept?: string;
|
|
10
12
|
disabled?: boolean;
|
|
@@ -15,7 +17,7 @@ type FormFileUploadProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
|
15
17
|
onUpload?: (file: File) => Promise<string>;
|
|
16
18
|
};
|
|
17
19
|
export declare const FormFileUpload: {
|
|
18
|
-
<TFieldValues extends FieldValues = FieldValues>({ name, control, label, uploadButtonLabel, description, accept, disabled, multiple, containerClassName, tooltipContent, hasRequiredIndicator, onUpload, }: FormFileUploadProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
<TFieldValues extends FieldValues = FieldValues>({ name, control, label, uploadButtonLabel, uploadingLabel, uploadFailedMessage, description, accept, disabled, multiple, containerClassName, tooltipContent, hasRequiredIndicator, onUpload, }: FormFileUploadProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
displayName: string;
|
|
20
22
|
};
|
|
21
23
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Locale } from 'date-fns';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
3
|
+
import { type ReactNode } from 'react';
|
|
4
|
+
export interface IconConfig {
|
|
5
|
+
icon: LucideIcon;
|
|
6
|
+
bg?: string;
|
|
7
|
+
text?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TimelineItem {
|
|
10
|
+
iconConfig: IconConfig;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
tags?: string[];
|
|
15
|
+
topRightSlot?: ReactNode;
|
|
16
|
+
bottomRightSlot?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface TimelineProps {
|
|
19
|
+
items: TimelineItem[];
|
|
20
|
+
header?: ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
onItemClick?: (item: TimelineItem, index: number) => void;
|
|
23
|
+
dateLocale?: Locale;
|
|
24
|
+
}
|
|
25
|
+
export declare const Timeline: ({ items, header, className, onItemClick, dateLocale }: TimelineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type ColumnDef, type ColumnFiltersState, type SortingState, type VisibilityState, type PaginationState, type RowSelectionState, type ColumnPinningState, type ExpandedState, type Table } from '@tanstack/react-table';
|
|
2
2
|
import { type UseQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
export interface FetcherParams {
|
|
4
|
-
|
|
4
|
+
pageNo: number;
|
|
5
5
|
pageSize: number;
|
|
6
|
-
|
|
6
|
+
sortBy: SortingState;
|
|
7
|
+
reversed: boolean;
|
|
7
8
|
columnFilters: ColumnFiltersState;
|
|
8
|
-
|
|
9
|
+
search: string;
|
|
9
10
|
}
|
|
10
11
|
export interface FetcherResponse<TData> {
|
|
11
12
|
data: TData[];
|
|
@@ -113,17 +114,17 @@ export interface UseDataTableReturn<TData> {
|
|
|
113
114
|
*/
|
|
114
115
|
refetch: () => void;
|
|
115
116
|
/**
|
|
116
|
-
* Current global filter value
|
|
117
|
+
* Current search (global filter) value
|
|
117
118
|
*/
|
|
118
|
-
|
|
119
|
+
search: string;
|
|
119
120
|
/**
|
|
120
|
-
* Set the global filter
|
|
121
|
+
* Set the search (global filter)
|
|
121
122
|
*/
|
|
122
|
-
|
|
123
|
+
setSearch: (value: string) => void;
|
|
123
124
|
/**
|
|
124
125
|
* Current sorting state
|
|
125
126
|
*/
|
|
126
|
-
|
|
127
|
+
sortBy: SortingState;
|
|
127
128
|
/**
|
|
128
129
|
* Current pagination state
|
|
129
130
|
*/
|
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,19 @@ 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 { DataTable, type ColumnDef } from './components/organisms/data-table';
|
|
77
|
+
export type { ActionItem, ActionsProps, RenderRowSubComponentProps } from './components/organisms/data-table';
|
|
78
|
+
export { DatePreset } from './components/organisms/date-preset/date-preset';
|
|
79
|
+
export { DatePresetProvider } from './components/organisms/date-preset/root';
|
|
80
|
+
export { useDatePreset } from './components/organisms/date-preset/context';
|
|
81
|
+
export { DATE_PRESETS, DEFAULT_PRESET_KEY, findMatchingPreset } from './components/organisms/date-preset/presets';
|
|
82
|
+
export type { DateRange, DatePresetItem } from './components/organisms/date-preset/presets';
|
|
83
|
+
export type { DatePresetProps } from './components/organisms/date-preset/date-preset';
|
|
84
|
+
export type { DatePresetProviderProps } from './components/organisms/date-preset/root';
|
|
85
|
+
export type { DatePresetContextValue } from './components/organisms/date-preset/context';
|
|
75
86
|
export { useDataTable, type UseDataTableOptions, type UseDataTableReturn, type FetcherParams, type FetcherResponse, } from './hooks/use-data-table';
|
|
76
87
|
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/lib/utils.d.ts
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
|
+
import { type FormatOptions } from 'date-fns';
|
|
2
3
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Formats a Date object into a localized string using date-fns.
|
|
6
|
+
* Falls back to formatting the current date if the provided date is invalid.
|
|
7
|
+
*
|
|
8
|
+
* @param date - The Date object to format.
|
|
9
|
+
* @param desiredFormat - A date-fns format string. Default: `'MMM d, yyyy h:mmaaa'`
|
|
10
|
+
* @param options - date-fns `FormatOptions` for locale, week start day, etc.
|
|
11
|
+
* @returns The formatted date string.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Default English format
|
|
15
|
+
* formatDate(new Date('2026-02-05T15:30:00'));
|
|
16
|
+
* // => "Feb 5, 2026 3:30pm"
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Turkish locale
|
|
20
|
+
* import { tr } from 'date-fns/locale';
|
|
21
|
+
* formatDate(new Date('2026-02-05T15:30:00'), undefined, { locale: tr });
|
|
22
|
+
* // => "Şub 5, 2026 3:30öö"
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Custom format
|
|
26
|
+
* formatDate(new Date('2026-02-05'), 'dd/MM/yyyy');
|
|
27
|
+
* // => "05/02/2026"
|
|
28
|
+
*/
|
|
29
|
+
export declare const formatDate: (date: Date, desiredFormat?: string, options?: FormatOptions) => string;
|