@segmentify/ui 0.0.31 → 0.0.32
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/molecules/date-range-picker.d.ts +3 -1
- package/dist/components/organisms/data-table/index.d.ts +1 -1
- package/dist/components/organisms/data-table/pagination.d.ts +5 -1
- package/dist/components/organisms/date-preset/date-preset.d.ts +3 -1
- package/dist/components/organisms/form-file-upload.d.ts +3 -1
- package/dist/components/organisms/timeline.d.ts +3 -1
- package/dist/index.d.ts +10 -4
- package/dist/lib/utils.d.ts +27 -1
- package/dist/segmentify-ui.cjs +67 -67
- package/dist/segmentify-ui.js +11828 -11479
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
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 = {
|
|
@@ -10,6 +11,7 @@ type Props = {
|
|
|
10
11
|
className?: ClassValue;
|
|
11
12
|
confirmLabel?: string;
|
|
12
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 {};
|
|
@@ -11,6 +11,6 @@ export declare const DataTable: {
|
|
|
11
11
|
Search: typeof Search;
|
|
12
12
|
ColumnVisibility: typeof ColumnVisibility;
|
|
13
13
|
Content: typeof Content;
|
|
14
|
-
Pagination: ({ showSelectedCount, showPaginationInfo, className }: import("./pagination").PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
Pagination: ({ showSelectedCount, showPaginationInfo, className, showPerPageLabel, selectPlaceholder, selectedCountText, paginationInfoText, }: import("./pagination").PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
Actions: ({ actions }: import("./actions").ActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
16
|
};
|
|
@@ -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;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Locale } from 'date-fns';
|
|
1
2
|
import { type DatePresetItem } from './presets';
|
|
2
3
|
export interface DatePresetProps {
|
|
3
4
|
presets?: Record<string, DatePresetItem>;
|
|
@@ -5,5 +6,6 @@ export interface DatePresetProps {
|
|
|
5
6
|
confirmLabel?: string;
|
|
6
7
|
placeholder?: string;
|
|
7
8
|
disabledCondition?: boolean | ((date: Date) => boolean);
|
|
9
|
+
dateLocale?: Locale;
|
|
8
10
|
}
|
|
9
|
-
export declare function DatePreset({ presets, className, confirmLabel, placeholder, disabledCondition, }: DatePresetProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function DatePreset({ presets, className, confirmLabel, placeholder, disabledCondition, dateLocale, }: DatePresetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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 {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Locale } from 'date-fns';
|
|
1
2
|
import { type LucideIcon } from 'lucide-react';
|
|
2
3
|
import { type ReactNode } from 'react';
|
|
3
4
|
export interface IconConfig {
|
|
@@ -19,5 +20,6 @@ export interface TimelineProps {
|
|
|
19
20
|
header?: ReactNode;
|
|
20
21
|
className?: string;
|
|
21
22
|
onItemClick?: (item: TimelineItem, index: number) => void;
|
|
23
|
+
dateLocale?: Locale;
|
|
22
24
|
}
|
|
23
|
-
export declare const Timeline: ({ items, header, className, onItemClick }: TimelineProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const Timeline: ({ items, header, className, onItemClick, dateLocale }: TimelineProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -73,9 +73,15 @@ export { Timeline, type IconConfig, type TimelineItem, type TimelineProps } from
|
|
|
73
73
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/atoms/tooltip';
|
|
74
74
|
export { TooltipField } from './components/molecules/tooltip-field';
|
|
75
75
|
export { QuillEditor } from './components/atoms/quill-editor';
|
|
76
|
-
export {
|
|
77
|
-
export {
|
|
78
|
-
export {
|
|
79
|
-
export {
|
|
76
|
+
export { DataTable } 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';
|
|
80
86
|
export { useDataTable, type UseDataTableOptions, type UseDataTableReturn, type FetcherParams, type FetcherResponse, } from './hooks/use-data-table';
|
|
81
87
|
export { cn } from './lib/utils';
|
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;
|