@sqrzro/admin 2.1.0-bz.35 → 2.1.0-bz.37
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/InfoPanel/index.d.ts +2 -1
- package/dist/components/InfoPanel/index.js +4 -0
- package/dist/components/ListActions/index.d.ts +1 -1
- package/dist/components/ListActions/index.js +3 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/MenuItem/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/styles/config.js +3 -2
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { StyleVariant } from '@sqrzro/interfaces';
|
|
3
|
+
type InfoPanelVariant = StyleVariant | 'mail';
|
|
3
4
|
export interface InfoPanelProps {
|
|
4
5
|
children: React.ReactNode;
|
|
5
|
-
variant?:
|
|
6
|
+
variant?: InfoPanelVariant;
|
|
6
7
|
}
|
|
7
8
|
declare function InfoPanel({ children, variant }: Readonly<InfoPanelProps>): React.ReactElement;
|
|
8
9
|
export default InfoPanel;
|
|
@@ -2,13 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { tw } from '@sqrzro/components';
|
|
3
3
|
const iconClassMap = {
|
|
4
4
|
danger: 'bg-[url(/admin/images/danger.svg)]',
|
|
5
|
+
error: 'bg-[url(/admin/images/danger.svg)]',
|
|
5
6
|
info: 'bg-[url(/admin/images/info.svg)]',
|
|
7
|
+
mail: 'bg-[url(/admin/images/mail.svg)]',
|
|
6
8
|
success: 'bg-[url(/admin/images/success.svg)]',
|
|
7
9
|
warning: 'bg-[url(/admin/images/warning.svg)]',
|
|
8
10
|
};
|
|
9
11
|
const classMap = {
|
|
10
12
|
danger: 'bg-red-100 text-red-700',
|
|
13
|
+
error: 'bg-red-100 text-red-700',
|
|
11
14
|
info: 'bg-sky-100 text-sky-700',
|
|
15
|
+
mail: 'bg-sky-100 text-sky-700',
|
|
12
16
|
success: 'bg-green-100 text-green-700',
|
|
13
17
|
warning: 'bg-yellow-100 text-yellow-700',
|
|
14
18
|
};
|
|
@@ -4,7 +4,7 @@ export interface ListAction extends Omit<ConfirmableAction & LinkableAction, 'on
|
|
|
4
4
|
onClick?: (id: string) => void;
|
|
5
5
|
}
|
|
6
6
|
export interface ListActionsProps {
|
|
7
|
-
actions?: ListAction[] | ((id: string) => ListAction[]);
|
|
7
|
+
actions?: (ListAction | null)[] | ((id: string) => (ListAction | null)[]);
|
|
8
8
|
id: string;
|
|
9
9
|
}
|
|
10
10
|
declare function ListActions({ actions, id }: Readonly<ListActionsProps>): React.ReactElement;
|
|
@@ -13,7 +13,9 @@ function ListActions({ actions, id }) {
|
|
|
13
13
|
function toggleIsOpen() {
|
|
14
14
|
setIsOpen(!isOpen);
|
|
15
15
|
}
|
|
16
|
-
const transformedActions = (typeof actions === 'function' ? actions(id) : actions)
|
|
16
|
+
const transformedActions = (typeof actions === 'function' ? actions(id) : actions)
|
|
17
|
+
.filter(Boolean)
|
|
18
|
+
.map((item) => ({
|
|
17
19
|
...item,
|
|
18
20
|
href: item.href ? parseHref(item.href, id) : undefined, // eslint-disable-line no-undefined
|
|
19
21
|
onClick: () => handleClick(item),
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { InputPanel } from '@sqrzro/components';
|
|
3
3
|
import MenuItem from '../MenuItem';
|
|
4
4
|
function Menu({ actions, align }) {
|
|
5
|
-
return (_jsx(InputPanel, { align: align, children: _jsx("ul", { children: actions.map((item) => (_jsx("li", { children: _jsx(MenuItem, { ...item }) }, item.label))) }) }));
|
|
5
|
+
return (_jsx(InputPanel, { align: align, children: _jsx("ul", { className: "min-w-44 py-1", children: actions.map((item) => (_jsx("li", { children: _jsx(MenuItem, { ...item }) }, item.label))) }) }));
|
|
6
6
|
}
|
|
7
7
|
export default Menu;
|
|
@@ -8,7 +8,7 @@ const classMap = {
|
|
|
8
8
|
success: 'text-green-700',
|
|
9
9
|
};
|
|
10
10
|
function MenuItem({ href, isConfirmable, label, onClick, variant, }) {
|
|
11
|
-
const classNames = tw('block whitespace-nowrap
|
|
11
|
+
const classNames = tw('block w-full whitespace-nowrap px-3 py-1.5 text-left text-sm text-slate-700', variant ? classMap[variant] : null);
|
|
12
12
|
if (!href) {
|
|
13
13
|
if (isConfirmable) {
|
|
14
14
|
return (_jsx(ConfirmableButton, { classNames: { root: { default: classNames } }, onClick: onClick, type: "button", children: label }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Autocomplete, AutocompleteFormField, Button, CalendarInput, CheckboxInput, ConfirmableButton, ConfirmableForm, ContentFormField, DateFormField, DateInput, DefinitionList, Dropdown, DropdownFormField, EditableAutocompleteFormField, EditableContentFormField, EditableDateFormField, EditableDropdownFormField, EditableForm, EditableFormField, EditableMultiFormField, EditableNumberFormField, EditableSwitchFormField, EditableTextAreaFormField, EditableTextFormField, EmptyMessage, Fieldset, Form, FormField, FormSubmit, ImageInput, ImageFormField, Link, LoadingModal, Modal, ModalActions, ModalForm, MoneyFormField, MoneyInput, MultiFormField, NumberFormField, NumberInput, ObjectFormField, RadioInput, Switch, SwitchFormField, TextArea, TextAreaFormField, TextFormField, TextInput, Toaster, } from '@sqrzro/components';
|
|
1
|
+
export { Autocomplete, AutocompleteFormField, Button, CalendarInput, CheckboxInput, ConfirmableButton, ConfirmableForm, ContentFormField, DateFormField, DateInput, DefinitionList, Dropdown, DropdownFormField, EditableAutocompleteFormField, EditableContentFormField, EditableDateFormField, EditableDropdownFormField, EditableForm, EditableFormField, EditableMoneyFormField, EditableMultiFormField, EditableNumberFormField, EditableSwitchFormField, EditableTextAreaFormField, EditableTextFormField, EmptyMessage, Fieldset, Form, FormField, FormSubmit, ImageInput, ImageFormField, Link, LoadingModal, Modal, ModalActions, ModalForm, MoneyFormField, MoneyInput, MultiFormField, NumberFormField, NumberInput, ObjectFormField, RadioInput, Switch, SwitchFormField, TextArea, TextAreaFormField, TextFormField, TextInput, Toaster, } from '@sqrzro/components';
|
|
2
2
|
export type { DropdownItem, EditableFormFieldProps, FormFieldProps, LinkProps, NumberInputProps, } from '@sqrzro/components';
|
|
3
3
|
export type { AppLayoutProps } from './AppLayout';
|
|
4
4
|
export { default as AppLayout } from './AppLayout';
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Exported from @sqrzro/components
|
|
2
|
-
export { Autocomplete, AutocompleteFormField, Button, CalendarInput, CheckboxInput, ConfirmableButton, ConfirmableForm, ContentFormField, DateFormField, DateInput, DefinitionList, Dropdown, DropdownFormField, EditableAutocompleteFormField, EditableContentFormField, EditableDateFormField, EditableDropdownFormField, EditableForm, EditableFormField, EditableMultiFormField, EditableNumberFormField, EditableSwitchFormField, EditableTextAreaFormField, EditableTextFormField, EmptyMessage, Fieldset, Form, FormField, FormSubmit, ImageInput, ImageFormField, Link, LoadingModal, Modal, ModalActions, ModalForm, MoneyFormField, MoneyInput, MultiFormField, NumberFormField, NumberInput, ObjectFormField, RadioInput, Switch, SwitchFormField, TextArea, TextAreaFormField, TextFormField, TextInput, Toaster, } from '@sqrzro/components';
|
|
2
|
+
export { Autocomplete, AutocompleteFormField, Button, CalendarInput, CheckboxInput, ConfirmableButton, ConfirmableForm, ContentFormField, DateFormField, DateInput, DefinitionList, Dropdown, DropdownFormField, EditableAutocompleteFormField, EditableContentFormField, EditableDateFormField, EditableDropdownFormField, EditableForm, EditableFormField, EditableMoneyFormField, EditableMultiFormField, EditableNumberFormField, EditableSwitchFormField, EditableTextAreaFormField, EditableTextFormField, EmptyMessage, Fieldset, Form, FormField, FormSubmit, ImageInput, ImageFormField, Link, LoadingModal, Modal, ModalActions, ModalForm, MoneyFormField, MoneyInput, MultiFormField, NumberFormField, NumberInput, ObjectFormField, RadioInput, Switch, SwitchFormField, TextArea, TextAreaFormField, TextFormField, TextInput, Toaster, } from '@sqrzro/components';
|
|
3
3
|
export { default as AppLayout } from './AppLayout';
|
|
4
4
|
export { default as Badge } from './Badge';
|
|
5
5
|
export { default as Dashboard } from './Dashboard';
|
package/dist/styles/config.js
CHANGED
|
@@ -108,8 +108,9 @@ const classNames = twx({
|
|
|
108
108
|
}),
|
|
109
109
|
modal: () => ({
|
|
110
110
|
root: 'open:backdrop:fade py-16 backdrop:bg-slate-700/50',
|
|
111
|
-
panel: 'show bg-panel row-start-2 mx-auto w-full max-w-lg rounded p-6 text-left shadow-xl',
|
|
112
|
-
|
|
111
|
+
panel: 'show bg-panel row-start-2 mx-auto flex w-full max-w-lg flex-col gap-6 rounded p-6 text-left shadow-xl',
|
|
112
|
+
content: 'flex flex-col gap-6',
|
|
113
|
+
title: 'text-lg font-semibold',
|
|
113
114
|
actions: 'flex justify-end border-t border-slate-200 pt-6',
|
|
114
115
|
}),
|
|
115
116
|
multiInput: () => ({
|