@mci-ui/mci-ui 0.0.86 → 0.0.87
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/index.css +1 -1
- package/dist/shared/ui/MciModal/MciModal.js +107 -59
- package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +23 -21
- package/dist/shared/ui/mciButton/MciButton.js +47 -32
- package/dist/shared/ui/mciCheck/MciCheck.js +116 -92
- package/dist/shared/ui/mciCollapse/MciCollapse.js +86 -54
- package/dist/shared/ui/mciDrawer/MciDrawer.js +70 -52
- package/dist/shared/ui/mciInput/MciInput.js +143 -130
- package/dist/shared/ui/mciInput/mci-input.utils.js +10 -10
- package/dist/shared/ui/mciPagination/MciPagination.js +85 -63
- package/dist/shared/ui/mciPhone/MciPhone.js +59 -54
- package/dist/shared/ui/mciPhone/mci-phone.utils.js +10 -10
- package/dist/shared/ui/mciPicker/MciPicker.js +349 -181
- package/dist/shared/ui/mciSelect/MciSelect.js +150 -131
- package/dist/shared/ui/mciSelect/mci-select.utils.js +12 -12
- package/dist/shared/ui/mciSkeleton/MciSkeleton.js +16 -14
- package/dist/shared/ui/mciTable/MciTable.js +165 -126
- package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +113 -106
- package/dist/shared/ui/mciTabs/MciTabs.js +52 -45
- package/dist/shared/ui/mciTag/MciTag.js +27 -18
- package/dist/shared/ui/mciTextarea/MciTextarea.js +47 -35
- package/dist/shared/ui/mciToast/MciToast.js +118 -72
- package/dist/shared/ui/mciToast/mci-toast.utils.js +40 -12
- package/dist/shared/ui/mciToggle/MciToggle.js +58 -36
- package/dist/shared/ui/mciTooltip/MciTooltip.js +2 -2
- package/dist/shared/ui/mciUpload/MciUpload.js +172 -149
- package/dist/types/shared/types/mci-table.types.d.ts +1 -0
- package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -0
- package/dist/types/shared/types/ui/button.types.d.ts +3 -7
- package/dist/types/shared/types/ui/check.types.d.ts +4 -9
- package/dist/types/shared/types/ui/collapse.types.d.ts +1 -0
- package/dist/types/shared/types/ui/drawer.types.d.ts +1 -0
- package/dist/types/shared/types/ui/input.types.d.ts +4 -15
- package/dist/types/shared/types/ui/modal.types.d.ts +1 -0
- package/dist/types/shared/types/ui/pagination.types.d.ts +1 -0
- package/dist/types/shared/types/ui/phone.types.d.ts +1 -0
- package/dist/types/shared/types/ui/picker.types.d.ts +1 -0
- package/dist/types/shared/types/ui/select.types.d.ts +1 -0
- package/dist/types/shared/types/ui/skeleton.types.d.ts +1 -0
- package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
- package/dist/types/shared/types/ui/tag.types.d.ts +1 -0
- package/dist/types/shared/types/ui/textarea.types.d.ts +3 -7
- package/dist/types/shared/types/ui/toast.types.d.ts +1 -0
- package/dist/types/shared/types/ui/toggle.types.d.ts +3 -2
- package/dist/types/shared/types/ui/upload.types.d.ts +1 -0
- package/dist/types/shared/ui/MciModal/MciModal.d.ts +1 -1
- package/dist/types/shared/ui/mciBreadcrumb/MciBreadcrumb.d.ts +1 -1
- package/dist/types/shared/ui/mciButton/MciButton.d.ts +1 -1
- package/dist/types/shared/ui/mciCollapse/MciCollapse.d.ts +1 -1
- package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
- package/dist/types/shared/ui/mciInput/MciInput.d.ts +13 -2
- package/dist/types/shared/ui/mciInput/mci-input.utils.d.ts +2 -2
- package/dist/types/shared/ui/mciPagination/MciPagination.d.ts +1 -1
- package/dist/types/shared/ui/mciPhone/mci-phone.utils.d.ts +2 -2
- package/dist/types/shared/ui/mciSelect/mci-select.utils.d.ts +2 -2
- package/dist/types/shared/ui/mciSkeleton/MciSkeleton.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +2 -1
- package/dist/types/shared/ui/mciTabs/MciTabs.d.ts +1 -1
- package/dist/types/shared/ui/mciTag/MciTag.d.ts +1 -1
- package/dist/types/shared/ui/mciTextarea/MciTextarea.d.ts +7 -2
- package/dist/types/shared/ui/mciToast/mci-toast.utils.d.ts +32 -4
- package/dist/types/shared/ui/mciToggle/MciToggle.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'className'> & {
|
|
2
3
|
label?: string;
|
|
3
|
-
|
|
4
|
-
value?: string;
|
|
4
|
+
darkMode?: boolean;
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
6
|
error?: string;
|
|
9
7
|
className?: string;
|
|
10
|
-
rows?: number;
|
|
11
|
-
name?: string;
|
|
12
8
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export type ToggleProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'type' | 'className' | 'onChange'> & {
|
|
2
3
|
checked?: boolean;
|
|
3
4
|
onChange?: (checked: boolean) => void;
|
|
4
|
-
disabled?: boolean;
|
|
5
5
|
variant?: 'blue' | 'yellow';
|
|
6
|
+
darkMode?: boolean;
|
|
6
7
|
label?: string;
|
|
7
8
|
supportText?: string;
|
|
8
9
|
className?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ModalProps } from '../../types/ui/modal.types';
|
|
2
|
-
export default function MciModal({ show, setShow, title, description, Header, Body, footer, handleClickOutside, showCloseIcon, showHeader, overlayClassName, containerClassName, bodyClassName, footerClassName, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciModal({ show, setShow, title, description, Header, Body, footer, handleClickOutside, showCloseIcon, showHeader, darkMode, overlayClassName, containerClassName, bodyClassName, footerClassName, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MciBreadcrumbProps } from '../../types/ui/breadcrumb.types';
|
|
2
|
-
export default function MciBreadcrumb({ items, variant, className, }: MciBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciBreadcrumb({ items, variant, darkMode, className, }: MciBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ButtonProps } from '../../types/ui/button.types';
|
|
2
|
-
export default function MciButton({ children, text, icon, iconPosition, size, variant, color, loading, disabled,
|
|
2
|
+
export default function MciButton({ children, text, icon, iconPosition, size, variant, color, darkMode, loading, disabled, className, type, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CollapseProps } from '../../types/ui/collapse.types';
|
|
2
|
-
export default function MciCollapse({ title, children, defaultOpen, icon, className, contentClassName, }: CollapseProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciCollapse({ title, children, defaultOpen, icon, darkMode, className, contentClassName, }: CollapseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DrawerProps } from '../../types/ui/drawer.types';
|
|
2
|
-
export default function MciDrawer({ isOpen, onClose, position, children, footer, title, description, showCloseButton, drawerClassName, contentClassName, closeOnOverlayClick, closeOnEscape, width, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciDrawer({ isOpen, onClose, position, children, footer, title, description, showCloseButton, drawerClassName, contentClassName, closeOnOverlayClick, closeOnEscape, width, darkMode, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare const MciInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "className" | "type" | "size"> & {
|
|
3
|
+
label?: string;
|
|
4
|
+
type?: "text" | "email" | "password" | "number" | "tel";
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
rightIcon?: React.ReactNode;
|
|
7
|
+
iconPosition?: "left" | "right";
|
|
8
|
+
size?: "sm" | "md" | "base";
|
|
9
|
+
darkMode?: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
onClear?: () => void;
|
|
12
|
+
showClearButton?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
4
15
|
export default MciInput;
|
|
@@ -14,7 +14,7 @@ export declare function getInputSizes(hasLeftIcon: boolean, hasRightIcon: boolea
|
|
|
14
14
|
md: InputSizeWithPadding;
|
|
15
15
|
base: InputSizeWithPadding;
|
|
16
16
|
};
|
|
17
|
-
export declare function getInputStateStyles(error
|
|
18
|
-
export declare function getInputIconColor(disabled: boolean, error: string | undefined, isFocused: boolean): "text-slate-400" | "text-red-600" | "text-black";
|
|
17
|
+
export declare function getInputStateStyles(error: string | undefined, darkMode: boolean): "border-red-500 hover:border-red-500 focus:border-red-500 focus:shadow-[0_0_0_2px_rgba(231,0,11,0.25)]" | "border-neutral-200 hover:border-neutral-100 focus:border-blue-500 focus:shadow-[0_0_0_2px_var(--opacity-25,rgba(21,93,252,0.25))]" | "border-red-600 focus:border-red-600 shadow-red" | "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600";
|
|
18
|
+
export declare function getInputIconColor(disabled: boolean, error: string | undefined, isFocused: boolean, darkMode: boolean): "text-neutral-100/50" | "text-slate-400" | "text-white" | "text-red-500" | "text-red-600" | "text-neutral-100" | "text-black";
|
|
19
19
|
export declare function getInputRightPaddingClass(size: 'sm' | 'md' | 'base', rightControlsCount: number): "" | "pr-14" | "pr-11" | "pr-7" | "pr-16" | "pr-12" | "pr-8" | "pr-20" | "pr-10";
|
|
20
20
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PaginationProps } from '../../types/ui/pagination.types';
|
|
2
|
-
export default function MciPagination({ totalItems, currentPage, perPage, onPageChange, onPerPageChange, siblingCount, perPageOptions, showPerPage, variant, size, paginationClassName }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export default function MciPagination({ totalItems, currentPage, perPage, onPageChange, onPerPageChange, siblingCount, perPageOptions, showPerPage, variant, size, darkMode, paginationClassName }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -28,5 +28,5 @@ export declare const PHONE_SIZES: {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
export declare function formatPhoneValue(input: string): string;
|
|
31
|
-
export declare function getPhoneStateStyles(hasError?: string): "border-red-600 focus:border-red-600 shadow-red" | "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600";
|
|
32
|
-
export declare function getPhoneIconColor(disabled: boolean, error: string | undefined, isFocused: boolean): "text-slate-400" | "text-red-600" | "text-black";
|
|
31
|
+
export declare function getPhoneStateStyles(hasError?: string, darkMode?: boolean): "border-red-500 hover:border-red-500 focus:border-red-500 focus:shadow-[0_0_0_2px_rgba(231,0,11,0.25)]" | "border-neutral-200 hover:border-neutral-100 focus:border-blue-500 focus:shadow-[0_0_0_2px_var(--opacity-25,rgba(21,93,252,0.25))]" | "border-red-600 focus:border-red-600 shadow-red" | "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600";
|
|
32
|
+
export declare function getPhoneIconColor(disabled: boolean, error: string | undefined, isFocused: boolean, darkMode?: boolean): "text-neutral-100/50" | "text-slate-400" | "text-white" | "text-red-500" | "text-red-600" | "text-neutral-100" | "text-black";
|
|
@@ -35,5 +35,5 @@ export declare const SELECT_SIZES: {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
export declare function getFilteredOptions(options: Option[], searchTerm: string, searchable: boolean, hasExternalSearch: boolean): Option[];
|
|
38
|
-
export declare function getSelectStateStyles(disabled: boolean, error?: string): "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" | "border-red-600 focus:border-red-600 shadow-red bg-white" | "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white";
|
|
39
|
-
export declare function getSelectIconColor(disabled: boolean, error: string | undefined, isOpen: boolean, isFocused: boolean): "text-slate-400" | "text-red-600" | "text-black";
|
|
38
|
+
export declare function getSelectStateStyles(disabled: boolean, error?: string, darkMode?: boolean): "border-neutral-200 bg-neutral-300 text-neutral-100/50 cursor-not-allowed" | "border-red-500 bg-transparent text-neutral-50 hover:border-red-500" | "border-neutral-200 bg-transparent text-neutral-50 hover:border-neutral-100" | "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" | "border-red-600 focus:border-red-600 shadow-red bg-white" | "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white";
|
|
39
|
+
export declare function getSelectIconColor(disabled: boolean, error: string | undefined, isOpen: boolean, isFocused: boolean, darkMode?: boolean): "text-neutral-100/50" | "text-slate-400" | "text-white" | "text-red-500" | "text-red-600" | "text-neutral-100" | "text-black";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SkeletonProps } from '../../types/ui/skeleton.types';
|
|
2
|
-
export default function MciSkeleton({ className, variant, width, height, }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciSkeleton({ className, variant, width, height, darkMode, }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MciTableProps } from '../../types/mci-table.types.ts';
|
|
2
|
-
export default function MciTable<T extends Record<string, unknown>>({ columns, data, loading, skeletonRows, noDataText, sort: externalSort, onSortChange, className, headerClassName, bodyClassName, rowKey, rowSelection, }: MciTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciTable<T extends Record<string, unknown>>({ columns, data, loading, skeletonRows, noDataText, sort: externalSort, onSortChange, className, headerClassName, bodyClassName, darkMode, rowKey, rowSelection, }: MciTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,6 +10,7 @@ type Props<T extends Record<string, unknown>> = {
|
|
|
10
10
|
onMoveByKey?: (from: ColumnKey<T>, to: ColumnKey<T>, position: DropPosition) => void;
|
|
11
11
|
minVisible?: number;
|
|
12
12
|
locale?: MciTablePanelLocale;
|
|
13
|
+
darkMode?: boolean;
|
|
13
14
|
};
|
|
14
|
-
export default function MciTableColumnsPanel<T extends Record<string, unknown>>({ open, onClose, columns, hidden, onToggle, onMove, onMoveByKey, minVisible, locale, }: Props<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export default function MciTableColumnsPanel<T extends Record<string, unknown>>({ open, onClose, columns, hidden, onToggle, onMove, onMoveByKey, minVisible, locale, darkMode, }: Props<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
15
16
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TabsProps } from '../../types/ui/tabs.types';
|
|
2
|
-
export default function MciTabs({ tabs, defaultTab, position, className, tabListClassName, contentClassName, extra, onChange, }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciTabs({ tabs, defaultTab, position, darkMode, className, tabListClassName, contentClassName, extra, onChange, }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TagProps } from '../../types/ui/tag.types';
|
|
2
|
-
export default function MciTag({ children, variant, size, icon, iconPosition, className, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciTag({ children, variant, size, darkMode, icon, iconPosition, rounded, className, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
declare const MciTextarea: import('react').ForwardRefExoticComponent<Omit<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, "className" | "onChange"> & {
|
|
2
|
+
label?: string;
|
|
3
|
+
darkMode?: boolean;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
error?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
} & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
3
8
|
export default MciTextarea;
|
|
@@ -5,30 +5,58 @@ export declare const TOAST_STYLES: {
|
|
|
5
5
|
readonly bg: {
|
|
6
6
|
readonly success: "bg-green-50";
|
|
7
7
|
readonly error: "bg-red-50";
|
|
8
|
-
readonly warning: "bg-
|
|
8
|
+
readonly warning: "bg-yellow-50";
|
|
9
9
|
readonly info: "bg-blue-50";
|
|
10
10
|
readonly loading: "bg-slate-50";
|
|
11
11
|
};
|
|
12
|
+
readonly bgDark: {
|
|
13
|
+
readonly success: "bg-green-950";
|
|
14
|
+
readonly error: "bg-red-950";
|
|
15
|
+
readonly warning: "bg-yellow-900";
|
|
16
|
+
readonly info: "bg-blue-900";
|
|
17
|
+
readonly loading: "bg-slate-900";
|
|
18
|
+
};
|
|
12
19
|
readonly line: {
|
|
13
20
|
readonly success: "bg-green-600";
|
|
14
21
|
readonly error: "bg-red-600";
|
|
15
|
-
readonly warning: "bg-
|
|
22
|
+
readonly warning: "bg-yellow-600";
|
|
16
23
|
readonly info: "bg-blue-600";
|
|
17
24
|
readonly loading: "bg-slate-600";
|
|
18
25
|
};
|
|
26
|
+
readonly lineDark: {
|
|
27
|
+
readonly success: "bg-green-400";
|
|
28
|
+
readonly error: "bg-red-400";
|
|
29
|
+
readonly warning: "bg-yellow-400";
|
|
30
|
+
readonly info: "bg-blue-400";
|
|
31
|
+
readonly loading: "bg-slate-400";
|
|
32
|
+
};
|
|
19
33
|
readonly text: {
|
|
20
34
|
readonly success: "text-green-600";
|
|
21
35
|
readonly error: "text-red-600";
|
|
22
|
-
readonly warning: "text-
|
|
36
|
+
readonly warning: "text-yellow-600";
|
|
23
37
|
readonly info: "text-blue-600";
|
|
24
38
|
readonly loading: "text-slate-600";
|
|
25
39
|
};
|
|
40
|
+
readonly textDark: {
|
|
41
|
+
readonly success: "text-green-400";
|
|
42
|
+
readonly error: "text-red-400";
|
|
43
|
+
readonly warning: "text-yellow-400";
|
|
44
|
+
readonly info: "text-blue-400";
|
|
45
|
+
readonly loading: "text-slate-400";
|
|
46
|
+
};
|
|
26
47
|
readonly action: {
|
|
27
48
|
readonly success: "text-green-600";
|
|
28
49
|
readonly error: "text-red-600";
|
|
29
|
-
readonly warning: "text-
|
|
50
|
+
readonly warning: "text-yellow-600";
|
|
30
51
|
readonly info: "text-blue-600";
|
|
31
52
|
readonly loading: "text-slate-600";
|
|
32
53
|
};
|
|
54
|
+
readonly actionDark: {
|
|
55
|
+
readonly success: "text-green-400";
|
|
56
|
+
readonly error: "text-red-400";
|
|
57
|
+
readonly warning: "text-yellow-400";
|
|
58
|
+
readonly info: "text-blue-400";
|
|
59
|
+
readonly loading: "text-slate-400";
|
|
60
|
+
};
|
|
33
61
|
};
|
|
34
62
|
export declare function getOrCreateToastContainer(): HTMLElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ToggleProps } from '../../types/ui/toggle.types';
|
|
2
|
-
export default function MciToggle({ checked, onChange, disabled, variant, label, supportText, className, }: ToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciToggle({ checked, onChange, disabled, variant, darkMode, label, supportText, className, ...rest }: ToggleProps): import("react/jsx-runtime").JSX.Element;
|