@segmentify/ui 0.0.33 → 0.0.34
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/README.md +5 -1
- package/dist/components/atoms/content-wrapper.d.ts +1 -1
- package/dist/components/molecules/combobox-field.d.ts +24 -19
- package/dist/components/molecules/confirmation-dialog.d.ts +24 -0
- package/dist/components/molecules/date-range-picker.d.ts +8 -10
- package/dist/components/organisms/data-table/column-visibility.d.ts +2 -1
- package/dist/components/organisms/data-table/index.d.ts +1 -2
- package/dist/components/organisms/data-table/pagination.d.ts +1 -5
- package/dist/components/organisms/form-combobox.d.ts +14 -9
- package/dist/components/organisms/form-file-upload.d.ts +1 -3
- package/dist/index.d.ts +1 -12
- package/dist/lib/design-variants.d.ts +1 -1
- package/dist/lib/utils.d.ts +1 -27
- package/dist/segmentify-ui.cjs +72 -98
- package/dist/segmentify-ui.js +24702 -30844
- package/dist/ui.css +46 -896
- package/package.json +1 -1
- package/dist/components/atoms/alert-dialog.d.ts +0 -18
- package/dist/components/atoms/combobox.d.ts +0 -24
- package/dist/components/atoms/input-group.d.ts +0 -16
- package/dist/components/organisms/date-preset/context.d.ts +0 -8
- package/dist/components/organisms/date-preset/date-preset.d.ts +0 -11
- package/dist/components/organisms/date-preset/index.d.ts +0 -8
- package/dist/components/organisms/date-preset/presets.d.ts +0 -21
- package/dist/components/organisms/date-preset/root.d.ts +0 -9
- package/dist/components/organisms/timeline.d.ts +0 -25
package/README.md
CHANGED
|
@@ -38,10 +38,14 @@ function App() {
|
|
|
38
38
|
|
|
39
39
|
### Styling
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Import the CSS in your main entry file and wrap your application (or the part using the library) with the `ui-lib-root` class to ensure styles are correctly applied and do not conflict with your own Tailwind CSS:
|
|
42
42
|
|
|
43
43
|
```tsx
|
|
44
44
|
import '@segmentify/ui/dist/ui.css';
|
|
45
|
+
|
|
46
|
+
function App() {
|
|
47
|
+
return <div className="ui-lib-root">{/* your app components */}</div>;
|
|
48
|
+
}
|
|
45
49
|
```
|
|
46
50
|
|
|
47
51
|
## Development
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { SelectItemProps } from '../../lib/types';
|
|
2
|
+
type TriggerProps = {
|
|
3
|
+
trigger: React.ReactNode;
|
|
4
|
+
triggerPlaceholder?: never;
|
|
5
|
+
} | {
|
|
6
|
+
trigger?: never;
|
|
7
|
+
triggerPlaceholder: string;
|
|
6
8
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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';
|
|
12
21
|
label?: string;
|
|
22
|
+
onInputChange?: (inputValue: string) => void;
|
|
23
|
+
clearable?: boolean;
|
|
13
24
|
multiple?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
containerClassName?: string;
|
|
18
|
-
emptyMessage?: string;
|
|
25
|
+
value: string | string[];
|
|
26
|
+
onValueChange: (value: string | string[]) => void;
|
|
19
27
|
hasAllOption?: boolean;
|
|
20
28
|
allOptionLabel?: string;
|
|
21
|
-
inputMode?: ComboboxFieldInputMode;
|
|
22
|
-
renderPopupTrigger?: (valueElement: React.ReactNode, selectedValues: ComboboxFieldItem[]) => React.ReactElement;
|
|
23
|
-
onInputChange?: (value: string) => void;
|
|
24
29
|
};
|
|
25
|
-
export declare const ComboboxField: ({
|
|
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;
|
|
26
31
|
export {};
|
|
@@ -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 {};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { type Locale } from 'date-fns';
|
|
2
1
|
import { type DateRange } from 'react-day-picker';
|
|
3
2
|
import { type ClassValue } from 'clsx';
|
|
4
3
|
type Props = {
|
|
5
|
-
start
|
|
6
|
-
end
|
|
4
|
+
start: Date;
|
|
5
|
+
end: Date;
|
|
7
6
|
onConfirm: (range: DateRange) => void;
|
|
8
|
-
label?: string;
|
|
9
|
-
placeholder: string;
|
|
10
|
-
triggerButtonClassName?: ClassValue;
|
|
11
7
|
className?: ClassValue;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
triggerButtonClassName?: ClassValue;
|
|
9
|
+
label: string;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
confirmLabel: string;
|
|
12
|
+
disabledCondition: (date: Date) => boolean;
|
|
15
13
|
};
|
|
16
|
-
export declare const DateRangePicker: ({ start, end, onConfirm, className, triggerButtonClassName, label, placeholder, confirmLabel, disabledCondition,
|
|
14
|
+
export declare const DateRangePicker: ({ start, end, onConfirm, className, triggerButtonClassName, label, placeholder, confirmLabel, disabledCondition, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
15
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface ColumnVisibilityProps {
|
|
2
|
+
inputPlaceholder?: string;
|
|
2
3
|
emptyMessage?: string;
|
|
3
4
|
allOptionLabel?: string;
|
|
4
5
|
}
|
|
5
|
-
export declare function ColumnVisibility({ emptyMessage, allOptionLabel, }: ColumnVisibilityProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function ColumnVisibility({ inputPlaceholder, emptyMessage, allOptionLabel, }: ColumnVisibilityProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -5,13 +5,12 @@ 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';
|
|
9
8
|
export declare const DataTable: {
|
|
10
9
|
Root: typeof Root;
|
|
11
10
|
Toolbar: typeof Toolbar;
|
|
12
11
|
Search: typeof Search;
|
|
13
12
|
ColumnVisibility: typeof ColumnVisibility;
|
|
14
13
|
Content: typeof Content;
|
|
15
|
-
Pagination: ({ showSelectedCount, showPaginationInfo, className
|
|
14
|
+
Pagination: ({ showSelectedCount, showPaginationInfo, className }: import("./pagination").PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
Actions: ({ actions }: import("./actions").ActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
16
|
};
|
|
@@ -2,9 +2,5 @@ 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;
|
|
9
5
|
}
|
|
10
|
-
export declare const Pagination: ({ showSelectedCount, showPaginationInfo, className
|
|
6
|
+
export declare const Pagination: ({ showSelectedCount, showPaginationInfo, className }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
2
|
-
import {
|
|
2
|
+
import type { SelectItemProps } from '../../lib/types';
|
|
3
3
|
type FormComboboxProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
4
4
|
name: Path<TFieldValues>;
|
|
5
|
-
label
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
label: string;
|
|
6
|
+
triggerPlaceholder: string;
|
|
7
|
+
inputPlaceholder: string;
|
|
8
|
+
options: SelectItemProps[];
|
|
8
9
|
description?: string;
|
|
9
10
|
multiple?: boolean;
|
|
10
|
-
emptyMessage
|
|
11
|
+
emptyMessage: string;
|
|
11
12
|
containerClassName?: string;
|
|
12
|
-
|
|
13
|
+
contentClassName?: string;
|
|
14
|
+
contentListClassName?: string;
|
|
15
|
+
avoidCollisions?: boolean;
|
|
16
|
+
clearable?: boolean;
|
|
13
17
|
hasAllOption?: boolean;
|
|
14
18
|
allOptionLabel?: string;
|
|
15
|
-
|
|
19
|
+
closeOnSelect?: boolean;
|
|
20
|
+
onInputChange?: (inputValue: string) => void;
|
|
21
|
+
isDisabled?: boolean;
|
|
16
22
|
tooltipContent?: string;
|
|
17
23
|
control?: Control<TFieldValues>;
|
|
18
|
-
inputMode?: 'input' | 'popup';
|
|
19
24
|
};
|
|
20
|
-
export declare const FormCombobox: <TFieldValues extends FieldValues = FieldValues>({ name, label,
|
|
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;
|
|
21
26
|
export {};
|
|
@@ -5,8 +5,6 @@ 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;
|
|
10
8
|
description?: string;
|
|
11
9
|
accept?: string;
|
|
12
10
|
disabled?: boolean;
|
|
@@ -17,7 +15,7 @@ type FormFileUploadProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
|
17
15
|
onUpload?: (file: File) => Promise<string>;
|
|
18
16
|
};
|
|
19
17
|
export declare const FormFileUpload: {
|
|
20
|
-
<TFieldValues extends FieldValues = FieldValues>({ name, control, label, uploadButtonLabel,
|
|
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;
|
|
21
19
|
displayName: string;
|
|
22
20
|
};
|
|
23
21
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
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';
|
|
3
2
|
export { AspectRatio } from './components/atoms/aspect-ratio';
|
|
4
3
|
export { Avatar, AvatarFallback, AvatarImage } from './components/atoms/avatar';
|
|
5
4
|
export { Badge } from './components/atoms/badge';
|
|
@@ -18,6 +17,7 @@ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, Comman
|
|
|
18
17
|
export { ContentWrapper } from './components/atoms/content-wrapper';
|
|
19
18
|
export { CreatableActionIcons } from './components/molecules/creatable-action-icons';
|
|
20
19
|
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,19 +69,8 @@ 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';
|
|
73
72
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/atoms/tooltip';
|
|
74
73
|
export { TooltipField } from './components/molecules/tooltip-field';
|
|
75
74
|
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';
|
|
86
75
|
export { useDataTable, type UseDataTableOptions, type UseDataTableReturn, type FetcherParams, type FetcherResponse, } from './hooks/use-data-table';
|
|
87
76
|
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" | "
|
|
3
|
+
size?: "default" | "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,29 +1,3 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
|
-
import { type FormatOptions } from 'date-fns';
|
|
3
2
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
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;
|
|
3
|
+
export declare const formatDate: (date: Date, desiredFormat?: string) => string;
|