blunt-ui 0.3.2 → 0.3.4
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/ConfirmDialog/ConfirmDialog.d.ts +5 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +8 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.test.d.ts +0 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +13 -0
- package/dist/components/ConfirmDialog/index.d.ts +4 -0
- package/dist/components/ConfirmDialog/useConfirm.d.ts +6 -0
- package/dist/components/ConfirmDialog/useConfirm.test.d.ts +0 -0
- package/dist/components/ConfirmDialog/useConfirm.types.d.ts +14 -0
- package/dist/components/DatePicker/DatePicker.d.ts +5 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts +11 -0
- package/dist/components/DatePicker/DatePicker.test.d.ts +0 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +14 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/Editable/Editable.d.ts +5 -0
- package/dist/components/Editable/Editable.stories.d.ts +10 -0
- package/dist/components/Editable/Editable.types.d.ts +9 -0
- package/dist/components/Editable/index.d.ts +2 -0
- package/dist/components/Field/Field.d.ts +5 -0
- package/dist/components/Field/Field.stories.d.ts +8 -0
- package/dist/components/Field/Field.types.d.ts +6 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/useForm.d.ts +2 -0
- package/dist/components/Form/useForm.test.d.ts +1 -0
- package/dist/components/Form/useForm.types.d.ts +20 -0
- package/dist/components/Input/Input.types.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +2 -3
- package/dist/components/Spinner/Spinner.d.ts +5 -0
- package/dist/components/Spinner/Spinner.stories.d.ts +9 -0
- package/dist/components/Spinner/Spinner.types.d.ts +8 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.stories.d.ts +1 -0
- package/dist/components/Table/Table.types.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +5 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +8 -0
- package/dist/components/Textarea/Textarea.types.d.ts +11 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/useToast.d.ts +6 -0
- package/dist/components/Toast/useToast.test.d.ts +0 -0
- package/dist/components/Toast/useToast.types.d.ts +17 -0
- package/dist/index.cjs +581 -264
- package/dist/index.d.ts +19 -12
- package/dist/index.js +1782 -1277
- package/dist/{components/ThemeProvider/index.d.ts → themes/ThemeProvider.d.ts} +1 -1
- package/dist/themes/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/DataTable/DataTable.d.ts +0 -5
- package/dist/components/DataTable/DataTable.stories.d.ts +0 -14
- package/dist/components/DataTable/DataTable.types.d.ts +0 -30
- package/dist/components/DataTable/index.d.ts +0 -2
- package/dist/themes/default.d.ts +0 -2
- /package/dist/{styles → themes}/GlobalStyles.d.ts +0 -0
- /package/dist/{consts.d.ts → themes/consts.d.ts} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfirmDialogProps } from './ConfirmDialog.types';
|
|
2
|
+
export declare function ConfirmDialog({ open, title, message, confirmLabel, cancelLabel, variant, size, onConfirm, onCancel, }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace ConfirmDialog {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ConfirmDialog } from './ConfirmDialog';
|
|
3
|
+
declare const meta: Meta<typeof ConfirmDialog>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ConfirmDialog>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Danger: Story;
|
|
8
|
+
export declare const WithHook: Story;
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModalSizes } from '../Modal';
|
|
2
|
+
export type ConfirmVariant = "default" | "danger";
|
|
3
|
+
export interface ConfirmDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
message: string;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
variant?: ConfirmVariant;
|
|
10
|
+
size?: ModalSizes;
|
|
11
|
+
onConfirm: () => void;
|
|
12
|
+
onCancel: () => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ConfirmDialog } from './ConfirmDialog';
|
|
2
|
+
export type { ConfirmDialogProps, ConfirmVariant } from './ConfirmDialog.types';
|
|
3
|
+
export { useConfirm, ConfirmProvider } from './useConfirm';
|
|
4
|
+
export type { ConfirmOptions, ConfirmFn, ConfirmContextValue, } from './useConfirm.types';
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ConfirmVariant } from './ConfirmDialog.types';
|
|
2
|
+
import { ModalSizes } from '../Modal';
|
|
3
|
+
export interface ConfirmOptions {
|
|
4
|
+
title?: string;
|
|
5
|
+
message: string;
|
|
6
|
+
confirmLabel?: string;
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
variant?: ConfirmVariant;
|
|
9
|
+
size?: ModalSizes;
|
|
10
|
+
}
|
|
11
|
+
export type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
12
|
+
export interface ConfirmContextValue {
|
|
13
|
+
confirm: ConfirmFn;
|
|
14
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DatePickerProps } from './DatePicker.types';
|
|
2
|
+
export declare function DatePicker({ value, onChange, placeholder, size, disabled, clearable, minDate, maxDate, formatDate, id, error, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace DatePicker {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DatePicker } from './DatePicker';
|
|
3
|
+
declare const meta: Meta<typeof DatePicker>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DatePicker>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithValue: Story;
|
|
8
|
+
export declare const WithMinMax: Story;
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const WithError: Story;
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type DatePickerSizes = "sm" | "md" | "lg";
|
|
2
|
+
export interface DatePickerProps {
|
|
3
|
+
value?: Date | null;
|
|
4
|
+
onChange?: (date: Date | null) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
size?: DatePickerSizes;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
clearable?: boolean;
|
|
9
|
+
minDate?: Date;
|
|
10
|
+
maxDate?: Date;
|
|
11
|
+
formatDate?: (date: Date) => string;
|
|
12
|
+
id?: string;
|
|
13
|
+
error?: boolean | string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EditableProps } from './Editable.types';
|
|
2
|
+
export declare function Editable({ value, defaultValue, onChange, onSubmit, onCancel, placeholder, disabled, }: EditableProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Editable {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Editable } from './Editable';
|
|
3
|
+
declare const meta: Meta<typeof Editable>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Editable>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Placeholder: Story;
|
|
8
|
+
export declare const Controlled: Story;
|
|
9
|
+
export declare const Disabled: Story;
|
|
10
|
+
export declare const InTable: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Field } from './Field';
|
|
3
|
+
declare const meta: Meta<typeof Field>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Field>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Empty: Story;
|
|
8
|
+
export declare const WithLink: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChangeEvent, FocusEvent, FormEvent } from 'react';
|
|
2
|
+
type FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
3
|
+
export interface UseFormOptions<T extends Record<string, string>> {
|
|
4
|
+
initialValues: T;
|
|
5
|
+
validate?: (values: T) => Partial<Record<keyof T, string | undefined>>;
|
|
6
|
+
onSubmit?: (values: T) => void | Promise<void>;
|
|
7
|
+
onError?: (errors: Partial<Record<keyof T, string>>) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface UseFormReturn<T extends Record<string, string>> {
|
|
10
|
+
values: T;
|
|
11
|
+
errors: Partial<Record<keyof T, string>>;
|
|
12
|
+
touched: Partial<Record<keyof T, boolean>>;
|
|
13
|
+
handleChange: (e: ChangeEvent<FieldElement>) => void;
|
|
14
|
+
handleBlur: (e: FocusEvent<FieldElement>) => void;
|
|
15
|
+
handleSubmit: (e?: FormEvent) => void;
|
|
16
|
+
setFieldValue: (field: keyof T, value: string) => void;
|
|
17
|
+
reset: (newValues?: T) => void;
|
|
18
|
+
isSubmitting: boolean;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
export type InputTypes = "text" | "email" | "password" | "number" | "search" | "tel" | "url";
|
|
3
3
|
export type InputSizes = "sm" | "md" | "lg";
|
|
4
|
-
export type InputVariants = "default" | "outlined"
|
|
4
|
+
export type InputVariants = "default" | "outlined";
|
|
5
5
|
export interface InputProps extends Omit<ComponentPropsWithRef<"input">, "size" | "type"> {
|
|
6
6
|
type?: InputTypes;
|
|
7
7
|
size?: InputSizes;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
export type SelectVariants = InputVariants;
|
|
2
|
+
export type SelectSizes = "sm" | "md" | "lg";
|
|
3
|
+
export type SelectVariants = "default" | "outlined";
|
|
5
4
|
export interface SelectOption {
|
|
6
5
|
value: string;
|
|
7
6
|
label: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Spinner } from './Spinner';
|
|
3
|
+
declare const meta: Meta<typeof Spinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Spinner>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Weights: Story;
|
|
9
|
+
export declare const CustomColor: Story;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableProps } from './Table.types';
|
|
2
|
-
export declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, data, rowKey, size, striped, bordered, stickyHeader, caption, emptyMessage, loading, sort, defaultSort, onSortChange, pageSize, page, defaultPage, totalRows, onPageChange, onChange, borderColor, headerColor, rowColor, stripeColor, className, style, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, data, rowKey, size, striped, bordered, stickyHeader, caption, emptyMessage, loading, sort, defaultSort, onSortChange, pageSize, page, defaultPage, totalRows, onPageChange, onChange, onRowClick, borderColor, headerColor, rowColor, stripeColor, className, style, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare namespace Table {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TextareaProps } from './Textarea.types';
|
|
2
|
+
export declare function Textarea({ ref, size, variant, label, helperText, error, fullWidth, id, value, defaultValue, onChange, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare namespace Textarea {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Textarea } from './Textarea';
|
|
3
|
+
declare const meta: Meta<typeof Textarea>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Textarea>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Error: Story;
|
|
8
|
+
export declare const WithHelperText: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type TextareaSizes = "sm" | "md" | "lg";
|
|
3
|
+
export type TextareaVariants = "default" | "outlined";
|
|
4
|
+
export interface TextareaProps extends Omit<ComponentPropsWithRef<"textarea">, "size"> {
|
|
5
|
+
size?: TextareaSizes;
|
|
6
|
+
variant?: TextareaVariants;
|
|
7
|
+
label?: string;
|
|
8
|
+
helperText?: string;
|
|
9
|
+
error?: boolean | string;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ToastContextValue } from './useToast.types';
|
|
3
|
+
export declare function ToastProvider({ children }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function useToast(): ToastContextValue;
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ToastVariants, ToastPosition } from './Toast.types';
|
|
2
|
+
export interface ToastOptions {
|
|
3
|
+
message: string;
|
|
4
|
+
variant?: ToastVariants;
|
|
5
|
+
duration?: number;
|
|
6
|
+
position?: ToastPosition;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastFn {
|
|
9
|
+
(options: ToastOptions): void;
|
|
10
|
+
success: (message: string, options?: Omit<ToastOptions, "message" | "variant">) => void;
|
|
11
|
+
error: (message: string, options?: Omit<ToastOptions, "message" | "variant">) => void;
|
|
12
|
+
warning: (message: string, options?: Omit<ToastOptions, "message" | "variant">) => void;
|
|
13
|
+
info: (message: string, options?: Omit<ToastOptions, "message" | "variant">) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface ToastContextValue {
|
|
16
|
+
toast: ToastFn;
|
|
17
|
+
}
|