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.
Files changed (55) hide show
  1. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +5 -0
  2. package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +8 -0
  3. package/dist/components/ConfirmDialog/ConfirmDialog.test.d.ts +0 -0
  4. package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +13 -0
  5. package/dist/components/ConfirmDialog/index.d.ts +4 -0
  6. package/dist/components/ConfirmDialog/useConfirm.d.ts +6 -0
  7. package/dist/components/ConfirmDialog/useConfirm.test.d.ts +0 -0
  8. package/dist/components/ConfirmDialog/useConfirm.types.d.ts +14 -0
  9. package/dist/components/DatePicker/DatePicker.d.ts +5 -0
  10. package/dist/components/DatePicker/DatePicker.stories.d.ts +11 -0
  11. package/dist/components/DatePicker/DatePicker.test.d.ts +0 -0
  12. package/dist/components/DatePicker/DatePicker.types.d.ts +14 -0
  13. package/dist/components/DatePicker/index.d.ts +2 -0
  14. package/dist/components/Editable/Editable.d.ts +5 -0
  15. package/dist/components/Editable/Editable.stories.d.ts +10 -0
  16. package/dist/components/Editable/Editable.types.d.ts +9 -0
  17. package/dist/components/Editable/index.d.ts +2 -0
  18. package/dist/components/Field/Field.d.ts +5 -0
  19. package/dist/components/Field/Field.stories.d.ts +8 -0
  20. package/dist/components/Field/Field.types.d.ts +6 -0
  21. package/dist/components/Field/index.d.ts +2 -0
  22. package/dist/components/Form/index.d.ts +2 -0
  23. package/dist/components/Form/useForm.d.ts +2 -0
  24. package/dist/components/Form/useForm.test.d.ts +1 -0
  25. package/dist/components/Form/useForm.types.d.ts +20 -0
  26. package/dist/components/Input/Input.types.d.ts +1 -1
  27. package/dist/components/Select/Select.types.d.ts +2 -3
  28. package/dist/components/Spinner/Spinner.d.ts +5 -0
  29. package/dist/components/Spinner/Spinner.stories.d.ts +9 -0
  30. package/dist/components/Spinner/Spinner.types.d.ts +8 -0
  31. package/dist/components/Spinner/index.d.ts +2 -0
  32. package/dist/components/Table/Table.d.ts +1 -1
  33. package/dist/components/Table/Table.stories.d.ts +1 -0
  34. package/dist/components/Table/Table.types.d.ts +1 -0
  35. package/dist/components/Textarea/Textarea.d.ts +5 -0
  36. package/dist/components/Textarea/Textarea.stories.d.ts +8 -0
  37. package/dist/components/Textarea/Textarea.types.d.ts +11 -0
  38. package/dist/components/Textarea/index.d.ts +2 -0
  39. package/dist/components/Toast/index.d.ts +2 -0
  40. package/dist/components/Toast/useToast.d.ts +6 -0
  41. package/dist/components/Toast/useToast.test.d.ts +0 -0
  42. package/dist/components/Toast/useToast.types.d.ts +17 -0
  43. package/dist/index.cjs +581 -264
  44. package/dist/index.d.ts +19 -12
  45. package/dist/index.js +1782 -1277
  46. package/dist/{components/ThemeProvider/index.d.ts → themes/ThemeProvider.d.ts} +1 -1
  47. package/dist/themes/index.d.ts +2 -1
  48. package/package.json +1 -1
  49. package/dist/components/DataTable/DataTable.d.ts +0 -5
  50. package/dist/components/DataTable/DataTable.stories.d.ts +0 -14
  51. package/dist/components/DataTable/DataTable.types.d.ts +0 -30
  52. package/dist/components/DataTable/index.d.ts +0 -2
  53. package/dist/themes/default.d.ts +0 -2
  54. /package/dist/{styles → themes}/GlobalStyles.d.ts +0 -0
  55. /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;
@@ -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';
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { ConfirmFn } from './useConfirm.types';
3
+ export declare function ConfirmProvider({ children }: {
4
+ children: ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export declare function useConfirm(): ConfirmFn;
@@ -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;
@@ -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,2 @@
1
+ export { DatePicker } from './DatePicker';
2
+ export type { DatePickerProps, DatePickerSizes } from './DatePicker.types';
@@ -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,9 @@
1
+ export interface EditableProps {
2
+ value?: string;
3
+ defaultValue?: string;
4
+ onChange?: (value: string) => void;
5
+ onSubmit?: (value: string) => void;
6
+ onCancel?: (previousValue: string) => void;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ }
@@ -0,0 +1,2 @@
1
+ export { Editable } from './Editable';
2
+ export type { EditableProps } from './Editable.types';
@@ -0,0 +1,5 @@
1
+ import { FieldProps } from './Field.types';
2
+ export declare function Field({ label, value, href }: FieldProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare namespace Field {
4
+ var displayName: string;
5
+ }
@@ -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,6 @@
1
+ import { ReactNode } from 'react';
2
+ export interface FieldProps {
3
+ label: string;
4
+ value?: ReactNode;
5
+ href?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ export { Field } from './Field';
2
+ export type { FieldProps } from './Field.types';
@@ -1,3 +1,5 @@
1
1
  export { Form } from './Form';
2
2
  export { FormField } from './FormField';
3
3
  export type { FormProps, FormFieldProps } from './Form.types';
4
+ export { useForm } from './useForm';
5
+ export type { UseFormOptions, UseFormReturn } from './useForm.types';
@@ -0,0 +1,2 @@
1
+ import { UseFormOptions, UseFormReturn } from './useForm.types';
2
+ export declare function useForm<T extends Record<string, string>>({ initialValues, validate, onSubmit, onError, }: UseFormOptions<T>): UseFormReturn<T>;
@@ -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" | "filled";
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
- import { InputSizes, InputVariants } from '../Input/Input.types';
3
- export type SelectSizes = InputSizes;
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,5 @@
1
+ import { SpinnerProps } from './Spinner.types';
2
+ export declare function Spinner({ size, weight, color, label, }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare namespace Spinner {
4
+ var displayName: string;
5
+ }
@@ -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;
@@ -0,0 +1,8 @@
1
+ export type SpinnerSizes = "sm" | "md" | "lg";
2
+ export type SpinnerWeights = "thin" | "normal" | "bold";
3
+ export interface SpinnerProps {
4
+ size?: SpinnerSizes;
5
+ weight?: SpinnerWeights;
6
+ color?: string;
7
+ label?: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ export { Spinner } from './Spinner';
2
+ export type { SpinnerProps, SpinnerSizes, SpinnerWeights, } from './Spinner.types';
@@ -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
  }
@@ -13,4 +13,5 @@ export declare const Loading: Story;
13
13
  export declare const Empty: Story;
14
14
  export declare const Paginated: Story;
15
15
  export declare const StickyHeader: Story;
16
+ export declare const WithRowClick: Story;
16
17
  export declare const FullyCustomized: Story;
@@ -40,6 +40,7 @@ export interface TableProps<T extends Record<string, unknown> = Record<string, u
40
40
  headerColor?: string;
41
41
  rowColor?: string;
42
42
  stripeColor?: string;
43
+ onRowClick?: (row: T) => void;
43
44
  className?: string;
44
45
  style?: CSSProperties;
45
46
  }
@@ -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,2 @@
1
+ export { Textarea } from './Textarea';
2
+ export type { TextareaProps, TextareaSizes, TextareaVariants, } from './Textarea.types';
@@ -1,2 +1,4 @@
1
1
  export { Toast } from './Toast';
2
2
  export type { ToastProps, ToastVariants, ToastPosition } from './Toast.types';
3
+ export { useToast, ToastProvider } from './useToast';
4
+ export type { ToastOptions, ToastFn, ToastContextValue, } from './useToast.types';
@@ -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
+ }