@segmentify/ui 0.0.23 → 0.0.24
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/app.d.ts +0 -12
- package/dist/components/atoms/table.d.ts +12 -5
- package/dist/components/molecules/base-button.d.ts +7 -2
- package/dist/components/molecules/combobox-field.d.ts +16 -15
- package/dist/components/molecules/debounced-input.d.ts +3 -11
- package/dist/components/organisms/form-combobox.d.ts +8 -6
- package/dist/components/organisms/form-file-upload.d.ts +5 -3
- package/dist/components/organisms/form-password.d.ts +5 -3
- package/dist/components/organisms/form-radio.d.ts +5 -3
- package/dist/components/organisms/form-slider.d.ts +7 -5
- package/dist/components/organisms/form-switch.d.ts +5 -3
- package/dist/components/organisms/form-textarea.d.ts +5 -3
- package/dist/index.d.ts +1 -2
- package/dist/segmentify-ui.cjs +82 -85
- package/dist/segmentify-ui.js +15902 -18476
- package/dist/ui.css +39 -168
- package/package.json +1 -1
- package/dist/components/organisms/data-table/column-visibility.d.ts +0 -7
- package/dist/components/organisms/data-table/content.d.ts +0 -8
- package/dist/components/organisms/data-table/context.d.ts +0 -9
- package/dist/components/organisms/data-table/index.d.ts +0 -13
- package/dist/components/organisms/data-table/pagination.d.ts +0 -7
- package/dist/components/organisms/data-table/root.d.ts +0 -12
- package/dist/components/organisms/data-table/search.d.ts +0 -7
- package/dist/components/organisms/data-table/toolbar.d.ts +0 -7
- package/dist/hooks/use-data-table.d.ts +0 -133
- package/dist/mock.d.ts +0 -3
package/dist/app.d.ts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
export type Product = {
|
|
2
|
-
id: number;
|
|
3
|
-
title: string;
|
|
4
|
-
description: string;
|
|
5
|
-
price: number;
|
|
6
|
-
discountPercentage: number;
|
|
7
|
-
rating: number;
|
|
8
|
-
stock: number;
|
|
9
|
-
brand: string;
|
|
10
|
-
category: string;
|
|
11
|
-
thumbnail: string;
|
|
12
|
-
};
|
|
13
1
|
declare function App(): import("react/jsx-runtime").JSX.Element;
|
|
14
2
|
export default App;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
declare function Table({ className, ...props }: React.ComponentProps<'table'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare function
|
|
3
|
+
type TableHeaderProps = React.ComponentProps<'thead'> & {
|
|
4
|
+
disableHover?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare function TableHeader({ className, disableHover, ...props }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TableHeadRow({ className, ...props }: React.ComponentProps<'tr'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
type TableRowProps = React.ComponentProps<'tr'> & {
|
|
11
|
+
disableHover?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function TableRow({ className, disableHover, ...props }: TableRowProps): import("react/jsx-runtime").JSX.Element;
|
|
8
14
|
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): import("react/jsx-runtime").JSX.Element;
|
|
9
15
|
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
|
|
16
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { Table, TableHeader, TableBody, TableHeadRow, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
@@ -2,14 +2,19 @@ import React from 'react';
|
|
|
2
2
|
import { buttonVariants } from '../../lib/design-variants';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import type { Union } from 'ts-toolbelt';
|
|
5
|
-
type BaseProps =
|
|
5
|
+
type BaseProps = {
|
|
6
|
+
className?: string;
|
|
7
|
+
type?: 'button' | 'submit' | 'reset';
|
|
6
8
|
size?: VariantProps<typeof buttonVariants>['size'];
|
|
7
9
|
variant?: VariantProps<typeof buttonVariants>['variant'];
|
|
8
10
|
label?: string;
|
|
9
11
|
suffix?: boolean;
|
|
10
12
|
prefix?: boolean;
|
|
11
13
|
isLoading?: boolean;
|
|
14
|
+
onClick?: () => void;
|
|
12
15
|
labelClassName?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
form?: string;
|
|
13
18
|
};
|
|
14
19
|
type IconOnlyProps = BaseProps & {
|
|
15
20
|
isIconOnly: true;
|
|
@@ -20,5 +25,5 @@ type DefaultButtonProps = BaseProps & {
|
|
|
20
25
|
icon?: React.ReactNode;
|
|
21
26
|
};
|
|
22
27
|
type BaseButtonProps = Union.Strict<IconOnlyProps | DefaultButtonProps>;
|
|
23
|
-
declare const BaseButton:
|
|
28
|
+
declare const BaseButton: ({ icon, type, label, size, variant, suffix, prefix, isLoading, onClick, className, labelClassName, disabled, isIconOnly, form, }: BaseButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
29
|
export { BaseButton };
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type { SelectItemProps } from '../../lib/types';
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
triggerPlaceholder?: never;
|
|
5
|
-
} | {
|
|
6
|
-
trigger?: never;
|
|
7
|
-
triggerPlaceholder: string;
|
|
8
|
-
};
|
|
9
|
-
type Props = TriggerProps & {
|
|
2
|
+
import type { Union } from 'ts-toolbelt';
|
|
3
|
+
type BaseProps = {
|
|
10
4
|
isDisabled?: boolean;
|
|
11
5
|
options: SelectItemProps[];
|
|
6
|
+
triggerPlaceholder: string;
|
|
12
7
|
isFormControlWrapper?: boolean;
|
|
13
8
|
avoidCollisions?: boolean;
|
|
14
9
|
contentClassName?: string;
|
|
@@ -17,15 +12,21 @@ type Props = TriggerProps & {
|
|
|
17
12
|
containerClassName?: string;
|
|
18
13
|
contentListClassName?: string;
|
|
19
14
|
closeOnSelect?: boolean;
|
|
20
|
-
align?: 'start' | 'center' | 'end';
|
|
21
15
|
label?: string;
|
|
22
|
-
onInputChange
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
onInputChange: (inputValue: string) => void;
|
|
17
|
+
handleSelectItem: (value: string | string[], option: SelectItemProps) => void;
|
|
18
|
+
};
|
|
19
|
+
type MultiSelectProps = BaseProps & {
|
|
20
|
+
isMultiSelect: true;
|
|
21
|
+
value: string[];
|
|
27
22
|
hasAllOption?: boolean;
|
|
28
23
|
allOptionLabel?: string;
|
|
24
|
+
handleSelectAll: (value: string | string[], availableOptions: SelectItemProps[]) => void;
|
|
25
|
+
};
|
|
26
|
+
type SingleSelectProps = BaseProps & {
|
|
27
|
+
isMultiSelect?: false;
|
|
28
|
+
value: string;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
type Props = Union.Strict<MultiSelectProps | SingleSelectProps>;
|
|
31
|
+
export declare const ComboboxField: ({ value, isDisabled, hasAllOption, isMultiSelect, options, allOptionLabel, triggerPlaceholder, isFormControlWrapper, avoidCollisions, contentClassName, inputPlaceholder, emptyMessage, containerClassName, contentListClassName, closeOnSelect, label, handleSelectItem, handleSelectAll, onInputChange, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
export {};
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface SearchInputProps {
|
|
2
|
+
name: string;
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (value: string) => void;
|
|
5
5
|
placeholder: string;
|
|
6
6
|
className?: string;
|
|
7
|
+
label?: string;
|
|
7
8
|
inputClassName?: string;
|
|
8
9
|
}
|
|
9
|
-
type WithLabelProps = O.Merge<BaseSearchInputProps, {
|
|
10
|
-
label: string;
|
|
11
|
-
name: string;
|
|
12
|
-
}>;
|
|
13
|
-
type WithoutLabelProps = O.Merge<BaseSearchInputProps, {
|
|
14
|
-
label?: undefined;
|
|
15
|
-
name?: string;
|
|
16
|
-
}>;
|
|
17
|
-
type SearchInputProps = WithLabelProps | WithoutLabelProps;
|
|
18
10
|
declare function DebouncedInput({ value, onChange, className, inputClassName, name, placeholder, label }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
19
11
|
export { DebouncedInput };
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
+
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
1
2
|
import type { SelectItemProps } from '../../lib/types';
|
|
2
|
-
type
|
|
3
|
-
name:
|
|
3
|
+
type FormComboboxProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
4
|
+
name: Path<TFieldValues>;
|
|
5
|
+
control?: Control<TFieldValues>;
|
|
4
6
|
label: string;
|
|
5
7
|
triggerPlaceholder: string;
|
|
6
8
|
inputPlaceholder: string;
|
|
7
9
|
options: SelectItemProps[];
|
|
8
10
|
description?: string;
|
|
9
|
-
|
|
11
|
+
isMultiSelect?: boolean;
|
|
10
12
|
emptyMessage: string;
|
|
11
13
|
containerClassName?: string;
|
|
12
14
|
contentClassName?: string;
|
|
13
15
|
contentListClassName?: string;
|
|
14
16
|
avoidCollisions?: boolean;
|
|
15
|
-
|
|
17
|
+
hasClearButton?: boolean;
|
|
16
18
|
hasAllOption?: boolean;
|
|
17
19
|
allOptionLabel?: string;
|
|
18
20
|
closeOnSelect?: boolean;
|
|
19
|
-
onInputChange
|
|
21
|
+
onInputChange: (inputValue: string) => void;
|
|
20
22
|
isDisabled?: boolean;
|
|
21
23
|
tooltipContent?: string;
|
|
22
24
|
};
|
|
23
|
-
export declare const FormCombobox: ({ name, label, triggerPlaceholder, inputPlaceholder, options, description,
|
|
25
|
+
export declare const FormCombobox: <TFieldValues extends FieldValues = FieldValues>({ name, control, label, triggerPlaceholder, inputPlaceholder, options, description, isMultiSelect, emptyMessage, containerClassName, contentClassName, contentListClassName, avoidCollisions, hasClearButton, hasAllOption, allOptionLabel, closeOnSelect, onInputChange, isDisabled, tooltipContent, }: FormComboboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
24
26
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
1
2
|
import type { ClassValue } from 'clsx';
|
|
2
|
-
type FormFileUploadProps = {
|
|
3
|
-
name:
|
|
3
|
+
type FormFileUploadProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
4
|
+
name: Path<TFieldValues>;
|
|
5
|
+
control?: Control<TFieldValues>;
|
|
4
6
|
label?: string;
|
|
5
7
|
uploadButtonLabel?: string;
|
|
6
8
|
description?: string;
|
|
@@ -13,7 +15,7 @@ type FormFileUploadProps = {
|
|
|
13
15
|
onUpload?: (file: File) => Promise<string>;
|
|
14
16
|
};
|
|
15
17
|
export declare const FormFileUpload: {
|
|
16
|
-
({ name, label, uploadButtonLabel, description, accept, disabled, multiple, containerClassName, tooltipContent, hasRequiredIndicator, onUpload, }: FormFileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
17
19
|
displayName: string;
|
|
18
20
|
};
|
|
19
21
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
1
2
|
import type { ClassValue } from 'clsx';
|
|
2
|
-
type Props = {
|
|
3
|
+
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
3
4
|
label: string;
|
|
4
|
-
name:
|
|
5
|
+
name: Path<TFieldValues>;
|
|
5
6
|
placeholder: string;
|
|
7
|
+
control?: Control<TFieldValues>;
|
|
6
8
|
containerClassName?: ClassValue;
|
|
7
9
|
description?: string;
|
|
8
10
|
tooltipContent?: string;
|
|
9
11
|
hasRequiredIndicator?: boolean;
|
|
10
12
|
};
|
|
11
|
-
export declare const FormPassword: ({ label, name, containerClassName, description, placeholder, tooltipContent, hasRequiredIndicator, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const FormPassword: <TFieldValues extends FieldValues = FieldValues>({ label, name, containerClassName, description, placeholder, tooltipContent, control, hasRequiredIndicator, ...props }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
1
2
|
import type { SelectItemProps } from '../../lib/types';
|
|
2
|
-
type Props = {
|
|
3
|
-
name:
|
|
3
|
+
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
4
|
+
name: Path<TFieldValues>;
|
|
4
5
|
label: string;
|
|
5
6
|
items: SelectItemProps[];
|
|
7
|
+
control?: Control<TFieldValues>;
|
|
6
8
|
containerClassName?: string;
|
|
7
9
|
itemClassName?: string;
|
|
8
10
|
itemLabelClassName?: string;
|
|
9
11
|
selectedClassName?: string;
|
|
10
12
|
description?: string;
|
|
11
13
|
};
|
|
12
|
-
export declare const FormRadio: ({ name, label, items, containerClassName, itemClassName, itemLabelClassName, selectedClassName, description, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const FormRadio: <TFieldValues extends FieldValues = FieldValues>({ name, label, items, control, containerClassName, itemClassName, itemLabelClassName, selectedClassName, description, }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
2
3
|
import { Slider } from '../../components/atoms/slider';
|
|
3
|
-
type FormSliderProps = {
|
|
4
|
-
name:
|
|
4
|
+
type FormSliderProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
5
|
+
name: Path<TFieldValues>;
|
|
6
|
+
control?: Control<TFieldValues>;
|
|
5
7
|
label?: string;
|
|
6
8
|
description?: string;
|
|
7
9
|
min?: number;
|
|
@@ -10,12 +12,12 @@ type FormSliderProps = {
|
|
|
10
12
|
leftLabel?: string;
|
|
11
13
|
rightLabel?: string;
|
|
12
14
|
showLabels?: boolean;
|
|
13
|
-
complementaryField?:
|
|
15
|
+
complementaryField?: Path<TFieldValues>;
|
|
14
16
|
onValueChange?: (value: number) => void;
|
|
15
17
|
containerClassName?: string;
|
|
16
18
|
labelClassName?: string;
|
|
17
19
|
showErrorPlaceholder?: boolean;
|
|
18
20
|
tooltipContent?: string;
|
|
19
|
-
} & React.ComponentProps<typeof Slider>;
|
|
20
|
-
export declare const FormSlider: ({ name, label, description, min, max, step, leftLabel, rightLabel, showLabels, complementaryField, onValueChange, containerClassName, labelClassName, showErrorPlaceholder, tooltipContent, ...props }: FormSliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
} & Omit<React.ComponentProps<typeof Slider>, 'name' | 'onValueChange'>;
|
|
22
|
+
export declare const FormSlider: <TFieldValues extends FieldValues = FieldValues>({ name, control, label, description, min, max, step, leftLabel, rightLabel, showLabels, complementaryField, onValueChange, containerClassName, labelClassName, showErrorPlaceholder, tooltipContent, ...props }: FormSliderProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
1
|
+
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
2
|
+
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
3
|
+
name: Path<TFieldValues>;
|
|
3
4
|
label: string;
|
|
5
|
+
control?: Control<TFieldValues>;
|
|
4
6
|
description?: string;
|
|
5
7
|
};
|
|
6
|
-
export declare const FormSwitch: ({ name, label, description, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const FormSwitch: <TFieldValues extends FieldValues = FieldValues>({ name, label, description, control, ...props }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
type
|
|
1
|
+
import { type Control, type FieldValues, type Path } from 'react-hook-form';
|
|
2
|
+
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
2
3
|
label: string;
|
|
3
|
-
name:
|
|
4
|
+
name: Path<TFieldValues>;
|
|
4
5
|
placeholder: string;
|
|
6
|
+
control?: Control<TFieldValues>;
|
|
5
7
|
description?: string;
|
|
6
8
|
containerClassName?: string;
|
|
7
9
|
};
|
|
8
|
-
export declare const FormTextarea: ({ label, name, description, placeholder, containerClassName, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const FormTextarea: <TFieldValues extends FieldValues = FieldValues>({ label, name, description, placeholder, containerClassName, control, ...props }: Props<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -66,11 +66,10 @@ export { Spinner } from './components/atoms/spinner';
|
|
|
66
66
|
export { Switch } from './components/atoms/switch';
|
|
67
67
|
export { SwitchField } from './components/molecules/switch-field';
|
|
68
68
|
export { Tabs, TabsList, TabsTrigger, TabsContent } from './components/atoms/tabs';
|
|
69
|
-
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, } from './components/atoms/table';
|
|
69
|
+
export { Table, TableHeader, TableBody, TableHeadRow, 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
72
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/atoms/tooltip';
|
|
73
73
|
export { TooltipField } from './components/molecules/tooltip-field';
|
|
74
74
|
export { QuillEditor } from './components/atoms/quill-editor';
|
|
75
|
-
export { useDataTable, type UseDataTableOptions, type UseDataTableReturn, type FetcherParams, type FetcherResponse, } from './hooks/use-data-table';
|
|
76
75
|
export { cn } from './lib/utils';
|