@foris/avocado-suite 1.1.1 → 1.2.1
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/avocado-suite.es.js +16848 -11707
- package/dist/avocado-suite.umd.js +132 -124
- package/dist/components/DataTable/DataTable.d.ts +1 -0
- package/dist/components/access-panel/AccessPanel.d.ts +1 -0
- package/dist/components/account-menu/AccountMenu.d.ts +17 -0
- package/dist/components/account-menu/components/account-details/AccountDetails.d.ts +14 -0
- package/dist/components/account-menu/components/account-details/index.d.ts +2 -0
- package/dist/components/account-menu/components/account-menu-item/AccountMenuItem.d.ts +12 -0
- package/dist/components/account-menu/components/account-menu-item/index.d.ts +2 -0
- package/dist/components/account-menu/components/menu-locale-dropdown/MenuLocaleDropdown.d.ts +8 -0
- package/dist/components/account-menu/components/menu-locale-dropdown/index.d.ts +2 -0
- package/dist/components/banner/index.d.ts +1 -0
- package/dist/components/button/Button.d.ts +2 -0
- package/dist/components/menu/Menu.d.ts +2 -0
- package/dist/components/round-button/RoundButton.d.ts +2 -0
- package/dist/components/switch-theme/SwitchTheme.d.ts +12 -0
- package/dist/components/switch-theme/index.d.ts +2 -0
- package/dist/components/table/components/table-desktop/TableDesktop.d.ts +1 -0
- package/dist/components/table/components/table-desktop-row/TableDesktopRow.d.ts +1 -0
- package/dist/components/table/components/table-mobile-row/TableMobileRow.d.ts +1 -0
- package/dist/components/textarea/Textarea.d.ts +17 -0
- package/dist/index.d.ts +5 -1
- package/dist/store/useLocaleStore.d.ts +12 -0
- package/dist/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
declare const DataTable: {
|
|
2
3
|
Action: import("react").FC<import("./components/DataTableAction/DataTableAction").IDataTableAction>;
|
|
3
4
|
SubActions: import("react").FC<import("./components/DataTableAction/DataTableSubActions").DataTableSubActionsProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { AccountDetailsProps } from './components/account-details/AccountDetails';
|
|
3
|
+
import { MenuLocaleDropdownProps } from './components/menu-locale-dropdown/MenuLocaleDropdown';
|
|
4
|
+
import { SwitchThemeProps } from '../switch-theme/SwitchTheme';
|
|
5
|
+
export interface AccountMenuProps {
|
|
6
|
+
accountDetails?: AccountDetailsProps;
|
|
7
|
+
localeProps?: MenuLocaleDropdownProps & {
|
|
8
|
+
showLocale?: boolean;
|
|
9
|
+
};
|
|
10
|
+
themeProps?: SwitchThemeProps & {
|
|
11
|
+
showTheme?: boolean;
|
|
12
|
+
};
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
onLogout?: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare const AccountMenu: FC<AccountMenuProps>;
|
|
17
|
+
export default AccountMenu;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface AccountDetailsProps {
|
|
3
|
+
/**
|
|
4
|
+
* Usually the user id + user name
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
/**
|
|
9
|
+
* If true, the component will show a skeleton loading
|
|
10
|
+
*/
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const AccountDetails: FC<AccountDetailsProps>;
|
|
14
|
+
export default AccountDetails;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode, FC } from 'react';
|
|
2
|
+
import { type IconTypes } from '../../../../../../avocado-icons';
|
|
3
|
+
interface AccountMenuItemProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
icon?: IconTypes;
|
|
6
|
+
label: string;
|
|
7
|
+
rightContent?: ReactNode;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const AccountMenuItem: FC<AccountMenuItemProps>;
|
|
12
|
+
export default AccountMenuItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Locale } from '../../../../store/useLocaleStore';
|
|
3
|
+
export interface MenuLocaleDropdownProps {
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
onSelectLocale?: (locale: Locale) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const MenuLocaleDropdown: FC<MenuLocaleDropdownProps>;
|
|
8
|
+
export default MenuLocaleDropdown;
|
|
@@ -7,6 +7,8 @@ export interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAtt
|
|
|
7
7
|
children: React.ReactNode | string;
|
|
8
8
|
/** Overwrite className */
|
|
9
9
|
className?: string;
|
|
10
|
+
/** Force light mode styles even in dark mode */
|
|
11
|
+
forceLightMode?: boolean;
|
|
10
12
|
/** Show icon on the left */
|
|
11
13
|
leftIcon?: IconTypes;
|
|
12
14
|
/** Loading state */
|
|
@@ -8,6 +8,8 @@ interface MenuProps {
|
|
|
8
8
|
closeOnClick?: boolean;
|
|
9
9
|
/** Control if you want to close the list after clicking one of the options or not */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/** Force light mode styles even in dark mode */
|
|
12
|
+
forceLightMode?: boolean;
|
|
11
13
|
/** List of the items to render when the menu is open */
|
|
12
14
|
items: MenuItem[];
|
|
13
15
|
/** From where to start to render the list */
|
|
@@ -6,6 +6,8 @@ export interface RoundButtonProps extends Partial<React.DetailedHTMLProps<React.
|
|
|
6
6
|
className?: string;
|
|
7
7
|
/** Disabled state */
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
/** Force light mode styles even in dark mode */
|
|
10
|
+
forceLightMode?: boolean;
|
|
9
11
|
/** Icon name */
|
|
10
12
|
icon: IconTypes;
|
|
11
13
|
/** Loading state */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeMode } from '../../types/theme.types';
|
|
3
|
+
export interface SwitchThemeProps {
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
onSelectTheme?: (newThemeMode: ThemeMode) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare enum ThemeEnum {
|
|
8
|
+
Light = "light",
|
|
9
|
+
Dark = "dark"
|
|
10
|
+
}
|
|
11
|
+
declare const SwitchTheme: React.FC<SwitchThemeProps>;
|
|
12
|
+
export default SwitchTheme;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DetailedHTMLProps, type TextareaHTMLAttributes, type FC } from 'react';
|
|
2
|
+
export interface TextareaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
3
|
+
/** Overwrite className */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Set top label */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Set max length */
|
|
8
|
+
maxLength?: number;
|
|
9
|
+
/** Set error state */
|
|
10
|
+
isError?: boolean;
|
|
11
|
+
/** Set helper text for error state */
|
|
12
|
+
errorText?: string;
|
|
13
|
+
/** Set value */
|
|
14
|
+
value?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const Textarea: FC<TextareaProps>;
|
|
17
|
+
export default Textarea;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { ThemeProvider } from './contexts/theme/ThemeProvider';
|
|
5
5
|
import * as ThemeStore from './store/useThemeStore';
|
|
6
|
+
import * as LocaleStore from './store/useLocaleStore';
|
|
6
7
|
import Accordion from './components/accordion/Accordion';
|
|
7
8
|
import Box from './components/box/Box';
|
|
8
9
|
import Breadcrumbs from './components/breadcrumbs/Breadcrumbs';
|
|
@@ -41,6 +42,7 @@ import Tabs from './components/tabs/Tabs';
|
|
|
41
42
|
import Tag from './components/tag/Tag';
|
|
42
43
|
import Text from './components/text/Text';
|
|
43
44
|
import TextField from './components/text-field/TextField';
|
|
45
|
+
import Textarea from './components/textarea/Textarea';
|
|
44
46
|
import Timer from './components/timer/Timer';
|
|
45
47
|
import Toaster from './components/toaster/Toaster';
|
|
46
48
|
import Tooltip from './components/tooltip/Tooltip';
|
|
@@ -51,8 +53,9 @@ import Drawer from './components/drawer/Drawer';
|
|
|
51
53
|
import Banner from './components/banner';
|
|
52
54
|
import SidebarMenu from './components/sidebar-menu/SidebarMenu';
|
|
53
55
|
import AccessPanel from './components/access-panel/AccessPanel';
|
|
56
|
+
import AccountMenu from './components/account-menu/AccountMenu';
|
|
54
57
|
import { toast } from 'react-toastify';
|
|
55
|
-
export { Banner, Drawer, AccessPanel, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, Loading, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, ThemeProvider, ThemeStore, Timer, Toaster, Tooltip, Table, toast, };
|
|
58
|
+
export { Banner, Drawer, AccessPanel, AccountMenu, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, Loading, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, Textarea, ThemeProvider, ThemeStore, LocaleStore, Timer, Toaster, Tooltip, Table, toast, };
|
|
56
59
|
/**
|
|
57
60
|
* Types
|
|
58
61
|
*/
|
|
@@ -65,6 +68,7 @@ export type { MenuItem } from './types/menu.types';
|
|
|
65
68
|
export type { RoundButtonProps } from './components/round-button/RoundButton';
|
|
66
69
|
export type { SelectProps } from './components/select/Select';
|
|
67
70
|
export type { TextFieldProps } from './components/text-field/TextField';
|
|
71
|
+
export type { TextareaProps } from './components/textarea/Textarea';
|
|
68
72
|
export type { TextProps } from './components/text/Text';
|
|
69
73
|
export type { TimerTime } from './components/timer/Timer';
|
|
70
74
|
export type { ModalProps } from './components/modal/Modal';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Locale = 'en' | 'es';
|
|
2
|
+
export type localeOption = {
|
|
3
|
+
value: Locale;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
type State = {
|
|
7
|
+
locale: Locale;
|
|
8
|
+
locales: localeOption[];
|
|
9
|
+
};
|
|
10
|
+
export declare const useLocaleStore: import("zustand").UseBoundStore<import("zustand").StoreApi<State>>;
|
|
11
|
+
export declare const setLocale: (locale: Locale, useLocalStorage?: boolean, emitEvent?: boolean) => void;
|
|
12
|
+
export {};
|