@sqrzro/ui 4.0.0-alpha.13 → 4.0.0-alpha.15
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/buttons/Button/index.d.ts +4 -4
- package/dist/components/buttons/Button/index.js +5 -14
- package/dist/components/collections/Collection/index.d.ts +4 -1
- package/dist/components/collections/Collection/index.js +2 -2
- package/dist/components/collections/DataTable/index.d.ts +2 -2
- package/dist/components/collections/DataTable/index.js +5 -4
- package/dist/components/collections/EmptyMessage/index.d.ts +1 -1
- package/dist/components/collections/EmptyMessage/index.js +3 -4
- package/dist/components/collections/List/index.d.ts +2 -1
- package/dist/components/collections/ListClientComponent/index.d.ts +6 -2
- package/dist/components/collections/ListClientComponent/index.js +4 -2
- package/dist/components/collections/ListItem/index.d.ts +1 -1
- package/dist/components/collections/ListItem/index.js +5 -5
- package/dist/components/collections/ListItemMeta/index.d.ts +6 -4
- package/dist/components/collections/ListItemMeta/index.js +12 -7
- package/dist/components/collections/ListItemSecondary/index.d.ts +1 -1
- package/dist/components/collections/ListItemSecondary/index.js +3 -4
- package/dist/components/collections/Pagination/index.d.ts +1 -1
- package/dist/components/collections/Pagination/index.js +5 -6
- package/dist/components/collections/PaginationLink/index.d.ts +9 -0
- package/dist/components/collections/PaginationLink/index.js +8 -0
- package/dist/components/collections/TableClientComponent/index.d.ts +1 -1
- package/dist/components/collections/TableClientComponent/index.js +4 -7
- package/dist/components/collections/TableRow/index.d.ts +12 -0
- package/dist/components/collections/TableRow/index.js +9 -0
- package/dist/components/collections/interfaces.d.ts +5 -12
- package/dist/components/collections/utility/is-data-table-array.d.ts +3 -0
- package/dist/components/collections/utility/is-data-table-array.js +5 -0
- package/dist/components/collections/utility/is-data-table-object.d.ts +3 -0
- package/dist/components/collections/utility/is-data-table-object.js +4 -0
- package/dist/components/errors/AppError/index.d.ts +19 -0
- package/dist/components/errors/AppError/index.js +8 -0
- package/dist/components/errors/AppForbiddenError/index.d.ts +7 -0
- package/dist/components/errors/AppForbiddenError/index.js +6 -0
- package/dist/components/errors/AppNotFoundError/index.d.ts +7 -0
- package/dist/components/errors/AppNotFoundError/index.js +6 -0
- package/dist/components/errors/AppServerError/index.d.ts +8 -0
- package/dist/components/errors/AppServerError/index.js +17 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +3 -0
- package/dist/components/modals/ConfirmModal/index.js +1 -1
- package/dist/components/modals/Modal/index.d.ts +1 -1
- package/dist/components/modals/Modal/index.js +3 -3
- package/dist/components/modals/ModalActions/index.d.ts +1 -1
- package/dist/components/modals/ModalActions/index.js +3 -3
- package/dist/components/utility/ActionList/index.d.ts +1 -1
- package/dist/components/utility/ActionList/index.js +2 -2
- package/dist/components/utility/ClassNamesClientComponent/index.d.ts +6 -0
- package/dist/components/utility/ClassNamesClientComponent/index.js +7 -0
- package/dist/components/utility/Container/index.d.ts +1 -1
- package/dist/components/utility/Container/index.js +2 -2
- package/dist/components/utility/Link/index.d.ts +1 -1
- package/dist/components/utility/Link/index.js +3 -3
- package/dist/components/utility/Loader/index.d.ts +1 -1
- package/dist/components/utility/Loader/index.js +4 -4
- package/dist/components/utility/Popover/index.d.ts +1 -1
- package/dist/components/utility/Popover/index.js +4 -4
- package/dist/components/utility/RootLayout/index.d.ts +2 -2
- package/dist/components/utility/RootLayout/index.js +6 -5
- package/dist/components/utility/Toast/index.d.ts +1 -1
- package/dist/components/utility/Toast/index.js +2 -2
- package/dist/filters/components/FilterBarClientComponent/index.d.ts +1 -1
- package/dist/filters/components/FilterBarClientComponent/index.js +2 -2
- package/dist/filters/components/FilterControl/index.d.ts +1 -1
- package/dist/filters/components/FilterControl/index.js +7 -4
- package/dist/filters/components/FilterItem/index.d.ts +1 -1
- package/dist/filters/components/FilterItem/index.js +2 -2
- package/dist/filters/components/FilterPanel/index.d.ts +1 -1
- package/dist/filters/filters/Filter/index.d.ts +1 -1
- package/dist/filters/filters/Filter/index.js +3 -4
- package/dist/filters/filters/SearchFilter/index.js +1 -1
- package/dist/filters/index.d.ts +1 -0
- package/dist/filters/index.js +1 -0
- package/dist/forms/components/Autocomplete/index.d.ts +1 -1
- package/dist/forms/components/Dropdown/index.d.ts +1 -1
- package/dist/forms/components/Dropdown/index.js +7 -4
- package/dist/forms/components/DropdownItem/index.d.ts +9 -0
- package/dist/forms/components/DropdownItem/index.js +8 -0
- package/dist/forms/components/DropdownList/index.d.ts +1 -1
- package/dist/forms/components/DropdownList/index.js +5 -10
- package/dist/forms/components/EditableForm/index.d.ts +1 -1
- package/dist/forms/components/EditableForm/index.js +3 -4
- package/dist/forms/components/EditableFormField/index.d.ts +1 -1
- package/dist/forms/components/EditableFormField/index.js +2 -2
- package/dist/forms/components/Form/index.d.ts +1 -1
- package/dist/forms/components/Form/index.js +3 -3
- package/dist/forms/components/FormError/index.d.ts +1 -1
- package/dist/forms/components/FormError/index.js +3 -3
- package/dist/forms/components/FormField/index.d.ts +2 -2
- package/dist/forms/components/FormField/index.js +7 -6
- package/dist/forms/components/FormLabel/index.d.ts +1 -1
- package/dist/forms/components/FormLabel/index.js +3 -3
- package/dist/forms/components/ModalForm/index.js +1 -1
- package/dist/forms/components/NumberInput/index.d.ts +1 -1
- package/dist/forms/components/PasswordComplexity/index.d.ts +9 -0
- package/dist/forms/components/PasswordComplexity/index.js +10 -0
- package/dist/forms/components/PasswordInput/index.d.ts +1 -1
- package/dist/forms/components/PasswordInput/index.js +4 -5
- package/dist/forms/components/StaticTextInput/index.d.ts +1 -1
- package/dist/forms/components/StaticTextInput/index.js +4 -7
- package/dist/forms/components/Switch/index.d.ts +1 -1
- package/dist/forms/components/Switch/index.js +4 -4
- package/dist/forms/components/TextInput/index.d.ts +1 -1
- package/dist/forms/components/TextInput/index.js +4 -4
- package/dist/forms/hooks/useForm.js +1 -1
- package/dist/forms/index.d.ts +4 -2
- package/dist/forms/index.js +2 -1
- package/dist/navigation/components/AppNavigation/index.d.ts +1 -1
- package/dist/navigation/components/AppNavigation/index.js +2 -2
- package/dist/navigation/components/AppNavigationItem/index.d.ts +1 -1
- package/dist/navigation/components/AppNavigationItem/index.js +3 -4
- package/dist/navigation/components/Tabs/index.js +2 -2
- package/dist/navigation/hooks/useNavigation.js +5 -5
- package/dist/styles/classnames/apply-variants.d.ts +3 -0
- package/dist/styles/classnames/apply-variants.js +25 -0
- package/dist/styles/classnames/config.d.ts +67 -0
- package/dist/styles/classnames/index.d.ts +7 -0
- package/dist/styles/classnames/index.js +37 -0
- package/dist/styles/classnames/interfaces.d.ts +56 -0
- package/dist/styles/classnames/interfaces.js +1 -0
- package/dist/styles/classnames/utility/is-classname-object.d.ts +3 -0
- package/dist/styles/classnames/utility/is-classname-object.js +7 -0
- package/dist/styles/icons/config.d.ts +9 -0
- package/dist/styles/icons/config.js +1 -0
- package/dist/styles/icons/index.d.ts +4 -0
- package/dist/styles/icons/interfaces.d.ts +4 -0
- package/dist/styles/icons/interfaces.js +1 -0
- package/dist/styles/index.d.ts +2 -2
- package/dist/styles/index.js +1 -1
- package/dist/styles/styles.css +59 -0
- package/dist/utility/interfaces.d.ts +1 -2
- package/package.json +9 -4
- package/dist/components/utility/ClassNames/index.d.ts +0 -6
- package/dist/components/utility/ClassNames/index.js +0 -7
- package/dist/styles/config.d.ts +0 -66
- package/dist/styles/config.js +0 -43
- package/dist/styles/icons.d.ts +0 -15
- package/dist/styles/interfaces.d.ts +0 -41
- /package/dist/styles/{interfaces.js → classnames/config.js} +0 -0
- /package/dist/styles/{tw.d.ts → classnames/tw.d.ts} +0 -0
- /package/dist/styles/{tw.js → classnames/tw.js} +0 -0
- /package/dist/styles/{icons.js → icons/index.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputEvent, InputProps } from '../../../forms/interfaces';
|
|
2
|
-
import type { ClassNameProps, ErrorableClassName } from '../../../styles/interfaces';
|
|
2
|
+
import type { ClassNameProps, ErrorableClassName } from '../../../styles/classnames/interfaces';
|
|
3
3
|
import { Action } from '../../../utility/interfaces';
|
|
4
4
|
export interface FormFieldClassNames {
|
|
5
5
|
root: ErrorableClassName;
|
|
@@ -21,5 +21,5 @@ export interface FormFieldProps<T, V extends T> extends ClassNameProps<FormField
|
|
|
21
21
|
onChange?: (event: InputEvent<T>) => void;
|
|
22
22
|
render: (props: InputProps<T>) => React.ReactElement | null;
|
|
23
23
|
}
|
|
24
|
-
declare function FormField<T, V extends T>({ action, classNameProps, details, error, hasAssistiveError, hasAssistiveLabel, id, isContentOnly, isDisabled, isOptional, label, name, onChange, onKeyDown, render, value, }: Readonly<FormFieldProps<T, V>>): React.ReactElement | null;
|
|
24
|
+
declare function FormField<T, V extends T>({ action, classNameProps, classNames, details, error, hasAssistiveError, hasAssistiveLabel, id, isContentOnly, isDisabled, isOptional, label, name, onChange, onKeyDown, render, value, }: Readonly<FormFieldProps<T, V>>): React.ReactElement | null;
|
|
25
25
|
export default FormField;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { getClassNames } from '../../../styles/
|
|
5
|
-
import tw from '../../../styles/tw';
|
|
4
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
6
5
|
import FormError from '../FormError';
|
|
7
6
|
import FormLabel from '../FormLabel';
|
|
8
7
|
import ActionButton from '../../../components/buttons/ActionButton';
|
|
9
8
|
function checkHasError(error) {
|
|
10
|
-
return Boolean(error &&
|
|
9
|
+
return Boolean(error &&
|
|
10
|
+
Object.keys(error).length > 0 &&
|
|
11
|
+
Object.values(error).some((item) => typeof item === 'string'));
|
|
11
12
|
}
|
|
12
|
-
function FormField({ action, classNameProps, details, error, hasAssistiveError, hasAssistiveLabel, id, isContentOnly, isDisabled, isOptional, label, name, onChange, onKeyDown, render, value, }) {
|
|
13
|
-
const
|
|
13
|
+
function FormField({ action, classNameProps, classNames, details, error, hasAssistiveError, hasAssistiveLabel, id, isContentOnly, isDisabled, isOptional, label, name, onChange, onKeyDown, render, value, }) {
|
|
14
|
+
const componentClassNames = getClassNames('formField', { props: classNameProps, states: { isError: checkHasError(error) } }, classNames);
|
|
14
15
|
const inputId = id || `ff_${name}`;
|
|
15
16
|
const [inputError, setInputError] = useState(null);
|
|
16
17
|
function handleError(message) {
|
|
@@ -32,6 +33,6 @@ function FormField({ action, classNameProps, details, error, hasAssistiveError,
|
|
|
32
33
|
if (isContentOnly) {
|
|
33
34
|
return render(renderProps);
|
|
34
35
|
}
|
|
35
|
-
return (_jsxs("div", { className:
|
|
36
|
+
return (_jsxs("div", { className: componentClassNames?.root, children: [label ? (_jsx(FormLabel, { classNameProps: classNameProps, htmlFor: inputId, isAssistive: hasAssistiveLabel, isOptional: isOptional, children: label })) : null, details && label ? (_jsx("div", { className: componentClassNames?.details, children: details })) : null, _jsx("div", { className: componentClassNames?.field, children: render(renderProps) }), action ? (_jsx("div", { children: _jsx(ActionButton, { ...action, isDisabled: Boolean(isDisabled || action.isDisabled) }) })) : null, inputError || error?.[name] ? (_jsx(FormError, { classNameProps: classNameProps, id: inputId, isAssistive: hasAssistiveError, children: inputError || error?.[name] })) : null] }));
|
|
36
37
|
}
|
|
37
38
|
export default FormField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClassNameProps } from '../../../styles/interfaces';
|
|
1
|
+
import type { ClassNameProps } from '../../../styles/classnames/interfaces';
|
|
2
2
|
import type { FormFieldClassNames } from '../FormField';
|
|
3
3
|
interface FormLabelProps extends ClassNameProps<FormFieldClassNames> {
|
|
4
4
|
children: React.ReactNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getClassNames } from '../../../styles/
|
|
3
|
-
import tw from '../../../styles/tw';
|
|
2
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
3
|
+
import tw from '../../../styles/classnames/tw';
|
|
4
4
|
function FormLabel({ children, classNames, classNameProps, htmlFor, isAssistive, isOptional, }) {
|
|
5
|
-
const componentClassNames =
|
|
5
|
+
const componentClassNames = getClassNames('formField', { props: classNameProps }, classNames);
|
|
6
6
|
return (_jsxs("label", { className: tw(componentClassNames?.label, isAssistive ? 'sr-only' : null), htmlFor: htmlFor, children: [children, isOptional ? _jsx("small", { className: componentClassNames?.optional, children: "Optional" }) : null] }));
|
|
7
7
|
}
|
|
8
8
|
export default FormLabel;
|
|
@@ -10,7 +10,7 @@ function ModalForm({ children, formProps, hasServerError, hasSubmit = true, isDi
|
|
|
10
10
|
setSearchParamsHref('action', null);
|
|
11
11
|
}
|
|
12
12
|
return (_jsx(Modal, { ...modalProps, children: _jsxs(Form, { ...formProps, children: [children, hasServerError ? _jsx("div", { children: "SERVER ERROR" }) : null, _jsx(ModalActions, { actions: [
|
|
13
|
-
{ label: 'Cancel', onClick: handleCancel
|
|
13
|
+
{ label: 'Cancel', onClick: handleCancel },
|
|
14
14
|
...(modalProps.actions || []),
|
|
15
15
|
hasSubmit
|
|
16
16
|
? {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassNameProps } from '../../../styles/interfaces';
|
|
1
|
+
import { ClassNameProps } from '../../../styles/classnames/interfaces';
|
|
2
2
|
import type { InputProps } from '../../interfaces';
|
|
3
3
|
import type { TextInputClassNames, TextInputComponentProps } from '../TextInput';
|
|
4
4
|
export type NumberInputComponentProps = TextInputComponentProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PasswordComplexityProps {
|
|
2
|
+
data: {
|
|
3
|
+
status: boolean;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
onComplexity?: (isValid: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function PasswordComplexity({ data, onComplexity }: PasswordComplexityProps): React.ReactElement;
|
|
9
|
+
export default PasswordComplexity;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import useDeepCompareEffect from 'use-deep-compare-effect';
|
|
4
|
+
function PasswordComplexity({ data, onComplexity }) {
|
|
5
|
+
useDeepCompareEffect(() => {
|
|
6
|
+
onComplexity?.(data.every((item) => item.status));
|
|
7
|
+
}, [data]);
|
|
8
|
+
return (_jsx("aside", { children: _jsx("ul", { children: data.map((item) => (_jsx("li", { style: { color: item.status ? 'green' : 'red' }, children: item.value }, item.value))) }) }));
|
|
9
|
+
}
|
|
10
|
+
export default PasswordComplexity;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputProps } from '../../../forms/interfaces';
|
|
2
|
-
import type { ClassNameProps, SelectableClassName } from '../../../styles/interfaces';
|
|
2
|
+
import type { ClassNameProps, SelectableClassName } from '../../../styles/classnames/interfaces';
|
|
3
3
|
import type { TextInputComponentProps } from '../TextInput';
|
|
4
4
|
export interface PasswordInputClassNames {
|
|
5
5
|
action: string;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { getClassNames } from '../../../styles/
|
|
4
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
5
5
|
import { getIcon } from '../../../styles/icons';
|
|
6
|
-
import tw from '../../../styles/tw';
|
|
7
6
|
import TextInput from '../TextInput';
|
|
8
7
|
function PasswordInput({ classNameProps, classNames, ...props }) {
|
|
9
|
-
const componentClassNames = classNames || getClassNames('passwordInput')?.(classNameProps);
|
|
10
|
-
const Icon = getIcon('password');
|
|
11
8
|
const [isVisible, setIsVisible] = useState(false);
|
|
9
|
+
const componentClassNames = getClassNames('passwordInput', { props: classNameProps, states: { isSelected: isVisible } }, classNames);
|
|
10
|
+
const Icon = getIcon('password');
|
|
12
11
|
function toggleVisible() {
|
|
13
12
|
setIsVisible(!isVisible);
|
|
14
13
|
}
|
|
15
|
-
return (_jsxs("div", { className: "relative", children: [_jsx(TextInput, { type: isVisible ? 'text' : 'password', ...props }), _jsx("div", { className: componentClassNames?.action, children: _jsxs("button", { className:
|
|
14
|
+
return (_jsxs("div", { className: "relative", children: [_jsx(TextInput, { type: isVisible ? 'text' : 'password', ...props }), _jsx("div", { className: componentClassNames?.action, children: _jsxs("button", { className: componentClassNames?.icon, onClick: toggleVisible, type: "button", children: [Icon ? _jsx(Icon, {}) : null, isVisible ? 'Hide' : 'Show'] }) })] }));
|
|
16
15
|
}
|
|
17
16
|
export default PasswordInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputProps } from '../../../forms/interfaces';
|
|
2
|
-
import type { ClassNameProps, ErrorableClassName } from '../../../styles/interfaces';
|
|
2
|
+
import type { ClassNameProps, ErrorableClassName } from '../../../styles/classnames/interfaces';
|
|
3
3
|
export interface StaticTextInputClassNames {
|
|
4
4
|
root: ErrorableClassName;
|
|
5
5
|
placeholder: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
3
|
import Assistive from '../../../components/utility/Assistive';
|
|
4
|
-
import { getClassNames } from '../../../styles/
|
|
5
|
-
import tw from '../../../styles/tw';
|
|
4
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
5
|
+
import tw from '../../../styles/classnames/tw';
|
|
6
6
|
function hasValue(value) {
|
|
7
7
|
if (Array.isArray(value)) {
|
|
8
8
|
return Boolean(value.filter((item) => Boolean(item)).length);
|
|
@@ -10,13 +10,10 @@ function hasValue(value) {
|
|
|
10
10
|
return Boolean(value);
|
|
11
11
|
}
|
|
12
12
|
function StaticTextInput({ classNames, classNameProps, details, hasError, icon, isDisabled, isOptional, label, name, onClear, onClick, onKeyDown, placeholder = 'Select...', value, }) {
|
|
13
|
-
const componentClassNames = {
|
|
14
|
-
...getClassNames('staticTextInput')?.(classNameProps),
|
|
15
|
-
...classNames,
|
|
16
|
-
};
|
|
13
|
+
const componentClassNames = getClassNames('staticTextInput', { props: classNameProps, states: { isError: hasError ?? false } }, classNames);
|
|
17
14
|
function handleClear() {
|
|
18
15
|
onClear?.();
|
|
19
16
|
}
|
|
20
|
-
return (_jsxs("div", { className: tw('relative', isDisabled ? 'pointer-events-none opacity-30' : null
|
|
17
|
+
return (_jsxs("div", { className: tw('relative', componentClassNames?.root, isDisabled ? 'pointer-events-none opacity-30' : null), children: [_jsx("input", { name: name, type: "hidden", value: value ? value.toString() : '' }), label ? (_jsxs(Fragment, { children: [_jsx("span", { className: componentClassNames?.label, children: label }), details ? (_jsx("small", { className: componentClassNames?.details, children: details })) : null] })) : (_jsx("span", { className: componentClassNames?.placeholder, children: placeholder })), onClick ? (_jsx("button", { className: "absolute -bottom-px -left-px -right-px -top-px", disabled: isDisabled, onClick: onClick, onKeyDown: onKeyDown, tabIndex: 0, type: "button", children: _jsx(Assistive, { children: "Toggle" }) })) : null, _jsxs("div", { className: "absolute bottom-0 right-0 top-0 flex w-0 items-center justify-end", children: [isOptional && hasValue(value) ? (_jsx("button", { className: tw('flex-none', componentClassNames?.clear), onClick: handleClear, type: "button", children: _jsx(Assistive, { children: "Clear" }) })) : null, icon && !isDisabled ? (_jsx("i", { className: tw('pointer-events-none flex-none', componentClassNames?.icon) })) : null] })] }));
|
|
21
18
|
}
|
|
22
19
|
export default StaticTextInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputProps } from '../../../forms/interfaces';
|
|
2
|
-
import { CheckableClassName, ClassNameProps } from '../../../styles/interfaces';
|
|
2
|
+
import { CheckableClassName, ClassNameProps } from '../../../styles/classnames/interfaces';
|
|
3
3
|
export interface SwitchClassNames {
|
|
4
4
|
root: string;
|
|
5
5
|
control: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
|
-
import { getClassNames } from '../../../styles/
|
|
4
|
-
import tw from '../../../styles/tw';
|
|
3
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
4
|
+
import tw from '../../../styles/classnames/tw';
|
|
5
5
|
function Switch({ classNameProps, classNames, id, isDisabled, name, onChange, value, }) {
|
|
6
|
-
const componentClassNames =
|
|
6
|
+
const componentClassNames = getClassNames('switch', { props: classNameProps, states: { isChecked: Boolean(value) } }, classNames);
|
|
7
7
|
function handleChange(event) {
|
|
8
8
|
if (onChange) {
|
|
9
9
|
const inputEvent = {
|
|
@@ -12,6 +12,6 @@ function Switch({ classNameProps, classNames, id, isDisabled, name, onChange, va
|
|
|
12
12
|
onChange(inputEvent);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
return (_jsxs(Fragment, { children: [_jsx("input", { name: name, type: "hidden", value: "false" }), _jsx("div", { className: tw('block', componentClassNames?.root), children: _jsxs("div", { className: tw('relative', componentClassNames?.control), children: [_jsx("input", { "aria-checked": Boolean(value), checked: Boolean(value), className: tw('appearance-none', componentClassNames?.input
|
|
15
|
+
return (_jsxs(Fragment, { children: [_jsx("input", { name: name, type: "hidden", value: "false" }), _jsx("div", { className: tw('block', componentClassNames?.root), children: _jsxs("div", { className: tw('relative', componentClassNames?.control), children: [_jsx("input", { "aria-checked": Boolean(value), checked: Boolean(value), className: tw('appearance-none', componentClassNames?.input), disabled: isDisabled, id: id || name, name: name, onChange: handleChange, type: "checkbox", value: "true" }), _jsx("i", { className: componentClassNames?.icon })] }) })] }));
|
|
16
16
|
}
|
|
17
17
|
export default Switch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputProps } from '../../../forms/interfaces';
|
|
2
|
-
import type { ClassNameProps, ErrorableClassName } from '../../../styles/interfaces';
|
|
2
|
+
import type { ClassNameProps, ErrorableClassName } from '../../../styles/classnames/interfaces';
|
|
3
3
|
export interface TextInputClassNames {
|
|
4
4
|
loading: string;
|
|
5
5
|
prefix: ErrorableClassName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getClassNames } from '../../../styles/
|
|
3
|
-
import tw from '../../../styles/tw';
|
|
2
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
3
|
+
import tw from '../../../styles/classnames/tw';
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* ## ClassNames
|
|
@@ -14,7 +14,7 @@ import tw from '../../../styles/tw';
|
|
|
14
14
|
* button itself is handled by the `renderClear` prop. | `string` |
|
|
15
15
|
*/
|
|
16
16
|
function TextInput({ classNames, classNameProps, hasError, id, isAutocomplete, isDisabled, name, onBlur, onChange, onFocus, onKeyDown, placeholder, prefix, ref, suffix, type, value, }) {
|
|
17
|
-
const componentClassNames =
|
|
17
|
+
const componentClassNames = getClassNames('textInput', { props: classNameProps, states: { isError: hasError ?? false } }, classNames);
|
|
18
18
|
function handleChange(event) {
|
|
19
19
|
if (onChange) {
|
|
20
20
|
const target = { name, value: event.target.value };
|
|
@@ -25,6 +25,6 @@ function TextInput({ classNames, classNameProps, hasError, id, isAutocomplete, i
|
|
|
25
25
|
? `${id || name}_err`
|
|
26
26
|
: undefined /* eslint-disable-line no-undefined */, autoComplete: isAutocomplete === false
|
|
27
27
|
? 'one-time-code'
|
|
28
|
-
: undefined /* eslint-disable-line no-undefined */, className: tw('peer w-full focus-visible:outline-0', prefix ? 'border-l-0' : null, (!prefix && suffix) || value ? 'border-r-0' : null, componentClassNames?.root
|
|
28
|
+
: undefined /* eslint-disable-line no-undefined */, className: tw('peer w-full focus-visible:outline-0', prefix ? 'border-l-0' : null, (!prefix && suffix) || value ? 'border-r-0' : null, componentClassNames?.root), disabled: isDisabled, formNoValidate: true, id: id || name, name: name, onBlur: onBlur, onChange: handleChange, onFocus: onFocus, onKeyDown: onKeyDown, placeholder: placeholder, type: type, value: value || '' }), suffix ? _jsx("div", { children: suffix }) : null] }));
|
|
29
29
|
}
|
|
30
30
|
export default TextInput;
|
|
@@ -168,7 +168,7 @@ function useForm({ defaults = {}, onError, onSubmit, onSuccess, onValidation, re
|
|
|
168
168
|
if (fnReturn.validation) {
|
|
169
169
|
return handleValidation(fnReturn.validation);
|
|
170
170
|
}
|
|
171
|
-
if (fnReturn.data) {
|
|
171
|
+
if (fnReturn.data !== null) {
|
|
172
172
|
return handleSuccess(fnReturn.data);
|
|
173
173
|
}
|
|
174
174
|
}
|
package/dist/forms/index.d.ts
CHANGED
|
@@ -15,12 +15,14 @@ export type { FormSubmitProps } from './components/FormSubmit';
|
|
|
15
15
|
export { default as FormSubmit } from './components/FormSubmit';
|
|
16
16
|
export type { ModalFormProps } from './components/ModalForm';
|
|
17
17
|
export { default as ModalForm } from './components/ModalForm';
|
|
18
|
-
export type {
|
|
19
|
-
export { default as
|
|
18
|
+
export type { PasswordComplexityProps } from './components/PasswordComplexity';
|
|
19
|
+
export { default as PasswordComplexity } from './components/PasswordComplexity';
|
|
20
20
|
export type { NumberInputProps } from './components/NumberInput';
|
|
21
21
|
export { default as NumberInput } from './components/NumberInput';
|
|
22
22
|
export type { PasswordInputClassNames, PasswordInputProps } from './components/PasswordInput';
|
|
23
23
|
export { default as PasswordInput } from './components/PasswordInput';
|
|
24
|
+
export type { PointsInputProps } from './components/PointsInput';
|
|
25
|
+
export { default as PointsInput } from './components/PointsInput';
|
|
24
26
|
export type { StaticTextInputClassNames, StaticTextInputProps } from './components/StaticTextInput';
|
|
25
27
|
export { default as StaticTextInput } from './components/StaticTextInput';
|
|
26
28
|
export type { TextInputClassNames, TextInputProps } from './components/TextInput';
|
package/dist/forms/index.js
CHANGED
|
@@ -7,9 +7,10 @@ export { default as Form } from './components/Form';
|
|
|
7
7
|
export { default as FormField } from './components/FormField';
|
|
8
8
|
export { default as FormSubmit } from './components/FormSubmit';
|
|
9
9
|
export { default as ModalForm } from './components/ModalForm';
|
|
10
|
-
export { default as
|
|
10
|
+
export { default as PasswordComplexity } from './components/PasswordComplexity';
|
|
11
11
|
export { default as NumberInput } from './components/NumberInput';
|
|
12
12
|
export { default as PasswordInput } from './components/PasswordInput';
|
|
13
|
+
export { default as PointsInput } from './components/PointsInput';
|
|
13
14
|
export { default as StaticTextInput } from './components/StaticTextInput';
|
|
14
15
|
export { default as TextInput } from './components/TextInput';
|
|
15
16
|
export { EditableDropdownFormField, EditableTextFormField } from './components/EditableFormFields';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClassNameProps, HighlightableClassName } from '../../../styles/interfaces';
|
|
1
|
+
import type { ClassNameProps, HighlightableClassName } from '../../../styles/classnames/interfaces';
|
|
2
2
|
import type { NavigationObject } from '../../interfaces';
|
|
3
3
|
export interface AppNavigationClassNames {
|
|
4
4
|
root: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Suspense } from 'react';
|
|
4
|
-
import { getClassNames } from '../../../styles/
|
|
4
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
5
5
|
import useNavigation from '../../hooks/useNavigation';
|
|
6
6
|
import AppNavigationItem from '../AppNavigationItem';
|
|
7
7
|
function AppNavigationComponent({ classNameProps, classNames, data, }) {
|
|
8
|
-
const componentClassNames =
|
|
8
|
+
const componentClassNames = getClassNames('appNavigation', { props: classNameProps }, classNames);
|
|
9
9
|
const navigation = useNavigation(data);
|
|
10
10
|
return (_jsx("nav", { className: componentClassNames?.root, children: _jsx("ul", { className: componentClassNames?.list, children: navigation.map((item, index) => (_jsx(AppNavigationItem, { classNames: classNames, ...item }, index))) }) }));
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NavigationObject } from '../../../navigation/interfaces';
|
|
2
|
-
import type { ClassNameProps } from '../../../styles/interfaces';
|
|
2
|
+
import type { ClassNameProps } from '../../../styles/classnames/interfaces';
|
|
3
3
|
import type { AppNavigationClassNames } from '../AppNavigation';
|
|
4
4
|
export type AppNavigationItemProps = NavigationObject & ClassNameProps<AppNavigationClassNames>;
|
|
5
5
|
declare function AppNavigationItem({ classNameProps, classNames, href, isActive, label, }: Readonly<AppNavigationItemProps>): React.ReactElement;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Link from '../../../components/utility/Link';
|
|
3
|
-
import { getClassNames } from '../../../styles/
|
|
4
|
-
import tw from '../../../styles/tw';
|
|
3
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
5
4
|
function AppNavigationItem({ classNameProps, classNames, href, isActive, label, }) {
|
|
6
|
-
const componentClassNames =
|
|
7
|
-
return (_jsx("li", { className:
|
|
5
|
+
const componentClassNames = getClassNames('appNavigation', { props: classNameProps, states: { isHighlighted: isActive ?? false } }, classNames);
|
|
6
|
+
return (_jsx("li", { className: componentClassNames?.item, children: _jsx(Link, { className: componentClassNames?.link, href: href, children: label }) }));
|
|
8
7
|
}
|
|
9
8
|
export default AppNavigationItem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { getClassNames } from '../../../styles/
|
|
3
|
+
import { getClassNames } from '../../../styles/classnames';
|
|
4
4
|
import AppNavigation from '../AppNavigation';
|
|
5
5
|
function Tabs({ classNameProps, classNames, ...props }) {
|
|
6
|
-
const componentClassNames =
|
|
6
|
+
const componentClassNames = getClassNames('tabs', { props: classNameProps }, classNames);
|
|
7
7
|
return _jsx(AppNavigation, { classNames: componentClassNames ?? {}, ...props });
|
|
8
8
|
}
|
|
9
9
|
export default Tabs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { joinURL } from '@sqrzro/utility';
|
|
2
2
|
import { usePathname, useSelectedLayoutSegments } from 'next/navigation';
|
|
3
3
|
function getActivePath(pathname, hrefs) {
|
|
4
4
|
return (hrefs
|
|
@@ -18,7 +18,7 @@ function getBasePath(pathname, segments) {
|
|
|
18
18
|
function transformChildren(children, basePath) {
|
|
19
19
|
return children.map(({ details, href, label }) => ({
|
|
20
20
|
details,
|
|
21
|
-
href:
|
|
21
|
+
href: joinURL(basePath, href),
|
|
22
22
|
label,
|
|
23
23
|
}));
|
|
24
24
|
}
|
|
@@ -26,13 +26,13 @@ function useNavigation(data, options) {
|
|
|
26
26
|
const pathname = usePathname();
|
|
27
27
|
const segments = useSelectedLayoutSegments();
|
|
28
28
|
const basePath = getBasePath(pathname, segments);
|
|
29
|
-
const hrefs = data.map(({ href }) =>
|
|
29
|
+
const hrefs = data.map(({ href }) => joinURL(basePath, href));
|
|
30
30
|
const activePath = getActivePath(pathname, hrefs);
|
|
31
31
|
return data.map((item) => ({
|
|
32
32
|
...item,
|
|
33
33
|
children: transformChildren(item.children || [], item.href),
|
|
34
|
-
href:
|
|
35
|
-
isActive:
|
|
34
|
+
href: joinURL(basePath, item.href),
|
|
35
|
+
isActive: joinURL(basePath, item.href) === activePath,
|
|
36
36
|
}));
|
|
37
37
|
}
|
|
38
38
|
export default useNavigation;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const keyMap = {
|
|
2
|
+
bordered: 'isBordered',
|
|
3
|
+
danger: 'isDanger',
|
|
4
|
+
error: 'isError',
|
|
5
|
+
info: 'isInfo',
|
|
6
|
+
primary: 'isPrimary',
|
|
7
|
+
secondary: 'isSecondary',
|
|
8
|
+
success: 'isSuccess',
|
|
9
|
+
tertiary: 'isTertiary',
|
|
10
|
+
warning: 'isWarning',
|
|
11
|
+
};
|
|
12
|
+
function applyVariants(variants) {
|
|
13
|
+
if (!variants) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
const variantArray = Array.isArray(variants) ? variants : [variants];
|
|
17
|
+
return variantArray.reduce((acc, variant) => {
|
|
18
|
+
const key = keyMap[variant];
|
|
19
|
+
if (key) {
|
|
20
|
+
acc[key] = true;
|
|
21
|
+
}
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
}
|
|
25
|
+
export default applyVariants;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ButtonClassNames } from '../../components/buttons/Button';
|
|
2
|
+
import type { TextButtonClassNames } from '../../components/buttons/TextButton';
|
|
3
|
+
import type { DataTableClassNames } from '../../components/collections/DataTable';
|
|
4
|
+
import type { EmptyMessageClassNames } from '../../components/collections/EmptyMessage';
|
|
5
|
+
import type { ListClassNames } from '../../components/collections/ListClientComponent';
|
|
6
|
+
import type { ListItemClassNames } from '../../components/collections/ListItem';
|
|
7
|
+
import type { ListItemMetaClassNames } from '../../components/collections/ListItemMeta';
|
|
8
|
+
import type { PaginationClassNames } from '../../components/collections/Pagination';
|
|
9
|
+
import type { TableClassNames } from '../../components/collections/Table';
|
|
10
|
+
import type { AppErrorClassNames } from '../../components/errors/AppError';
|
|
11
|
+
import type { ModalClassNames } from '../../components/modals/Modal';
|
|
12
|
+
import type { ActionListClassNames } from '../../components/utility/ActionList';
|
|
13
|
+
import type { ContainerClassNames } from '../../components/utility/Container';
|
|
14
|
+
import type { LinkClassNames } from '../../components/utility/Link';
|
|
15
|
+
import type { LoaderClassNames } from '../../components/utility/Loader';
|
|
16
|
+
import type { PopoverClassNames } from '../../components/utility/Popover';
|
|
17
|
+
import type { RootLayoutClassNames } from '../../components/utility/RootLayout';
|
|
18
|
+
import type { ToastClassNames } from '../../components/utility/Toast';
|
|
19
|
+
import type { FilterBarClassNames } from '../../filters/components/FilterBar';
|
|
20
|
+
import type { FilterItemClassNames } from '../../filters/components/FilterItem';
|
|
21
|
+
import type { FilterPanelClassNames } from '../../filters/components/FilterPanel';
|
|
22
|
+
import type { DropdownClassNames } from '../../forms/components/Dropdown';
|
|
23
|
+
import type { EditableFormClassNames } from '../../forms/components/EditableForm';
|
|
24
|
+
import type { EditableFormFieldClassNames } from '../../forms/components/EditableFormField';
|
|
25
|
+
import type { FormClassNames } from '../../forms/components/Form';
|
|
26
|
+
import type { FormFieldClassNames } from '../../forms/components/FormField';
|
|
27
|
+
import type { PasswordInputClassNames } from '../../forms/components/PasswordInput';
|
|
28
|
+
import type { StaticTextInputClassNames } from '../../forms/components/StaticTextInput';
|
|
29
|
+
import type { SwitchClassNames } from '../../forms/components/Switch';
|
|
30
|
+
import type { TextInputClassNames } from '../../forms/components/TextInput';
|
|
31
|
+
import type { AppNavigationClassNames } from '../../navigation/components/AppNavigation';
|
|
32
|
+
import type { TabsClassNames } from '../../navigation/components/Tabs';
|
|
33
|
+
import type { ComponentClassNames } from './interfaces';
|
|
34
|
+
export interface RegisteredClassNames {
|
|
35
|
+
actionList?: ComponentClassNames<ActionListClassNames>;
|
|
36
|
+
appError?: ComponentClassNames<AppErrorClassNames>;
|
|
37
|
+
appNavigation?: ComponentClassNames<AppNavigationClassNames>;
|
|
38
|
+
button?: ComponentClassNames<ButtonClassNames>;
|
|
39
|
+
container?: ComponentClassNames<ContainerClassNames>;
|
|
40
|
+
dataTable?: ComponentClassNames<DataTableClassNames>;
|
|
41
|
+
dropdown?: ComponentClassNames<DropdownClassNames>;
|
|
42
|
+
editableForm?: ComponentClassNames<EditableFormClassNames>;
|
|
43
|
+
editableFormField?: ComponentClassNames<EditableFormFieldClassNames>;
|
|
44
|
+
emptyMessage?: ComponentClassNames<EmptyMessageClassNames>;
|
|
45
|
+
filterBar?: ComponentClassNames<FilterBarClassNames>;
|
|
46
|
+
filterItem?: ComponentClassNames<FilterItemClassNames>;
|
|
47
|
+
filterPanel?: ComponentClassNames<FilterPanelClassNames>;
|
|
48
|
+
form?: ComponentClassNames<FormClassNames>;
|
|
49
|
+
formField?: ComponentClassNames<FormFieldClassNames>;
|
|
50
|
+
link?: ComponentClassNames<LinkClassNames>;
|
|
51
|
+
list?: ComponentClassNames<ListClassNames>;
|
|
52
|
+
listItem?: ComponentClassNames<ListItemClassNames>;
|
|
53
|
+
listItemMeta?: ComponentClassNames<ListItemMetaClassNames>;
|
|
54
|
+
loader?: ComponentClassNames<LoaderClassNames>;
|
|
55
|
+
modal?: ComponentClassNames<ModalClassNames>;
|
|
56
|
+
pagination?: ComponentClassNames<PaginationClassNames>;
|
|
57
|
+
passwordInput?: ComponentClassNames<PasswordInputClassNames>;
|
|
58
|
+
popover?: ComponentClassNames<PopoverClassNames>;
|
|
59
|
+
rootLayout?: ComponentClassNames<RootLayoutClassNames>;
|
|
60
|
+
staticTextInput?: ComponentClassNames<StaticTextInputClassNames>;
|
|
61
|
+
switch?: ComponentClassNames<SwitchClassNames>;
|
|
62
|
+
table?: ComponentClassNames<TableClassNames>;
|
|
63
|
+
tabs?: ComponentClassNames<TabsClassNames>;
|
|
64
|
+
textButton?: ComponentClassNames<TextButtonClassNames>;
|
|
65
|
+
textInput?: ComponentClassNames<TextInputClassNames>;
|
|
66
|
+
toast?: ComponentClassNames<ToastClassNames>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RegisteredClassNames } from './config';
|
|
2
|
+
import type { ExtractClassNames } from './interfaces';
|
|
3
|
+
export declare function registerClassNames(data: RegisteredClassNames): void;
|
|
4
|
+
export declare function getClassNames<K extends keyof RegisteredClassNames>(component: K, config?: {
|
|
5
|
+
props?: Record<string, boolean>;
|
|
6
|
+
states?: Record<string, boolean>;
|
|
7
|
+
}, overrides?: RegisteredClassNames[K]): ExtractClassNames<RegisteredClassNames[K]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getEntries } from '@sqrzro/utility';
|
|
2
|
+
import tw from './tw';
|
|
3
|
+
import isClassNameObject from './utility/is-classname-object';
|
|
4
|
+
let registeredClassNames = {};
|
|
5
|
+
export function registerClassNames(data) {
|
|
6
|
+
registeredClassNames = { ...registeredClassNames, ...data };
|
|
7
|
+
}
|
|
8
|
+
export function getClassNames(component, config, overrides) {
|
|
9
|
+
const componentClassNames = registeredClassNames[component];
|
|
10
|
+
if (!componentClassNames) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
const overridden = { ...componentClassNames, ...overrides };
|
|
14
|
+
return getEntries(overridden).reduce((acc, [key, value]) => {
|
|
15
|
+
if (typeof value === 'string') {
|
|
16
|
+
return { ...acc, [key]: value };
|
|
17
|
+
}
|
|
18
|
+
if (isClassNameObject(value)) {
|
|
19
|
+
const { default: defaultClassName, props, states } = value;
|
|
20
|
+
const propClassNames = props
|
|
21
|
+
? Object.keys(props)
|
|
22
|
+
.filter((key) => config?.props?.[key])
|
|
23
|
+
.map((key) => props[key])
|
|
24
|
+
: [];
|
|
25
|
+
const stateClassNames = states
|
|
26
|
+
? Object.keys(states)
|
|
27
|
+
.filter((key) => config?.states?.[key])
|
|
28
|
+
.map((key) => states[key])
|
|
29
|
+
: [];
|
|
30
|
+
return {
|
|
31
|
+
...acc,
|
|
32
|
+
[key]: tw(defaultClassName, ...propClassNames, ...stateClassNames),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return acc;
|
|
36
|
+
}, {});
|
|
37
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
type ComponentClassNamesValue<T> = T extends string ? string | StatefulClassName : T extends StatefulClassName<infer U> ? StatefulClassName<U> : never;
|
|
2
|
+
export type ComponentClassNames<T> = {
|
|
3
|
+
[K in keyof T]?: ComponentClassNamesValue<T[K]>;
|
|
4
|
+
};
|
|
5
|
+
export type ExtractClassNames<T> = {
|
|
6
|
+
[K in keyof T]?: string;
|
|
7
|
+
};
|
|
8
|
+
export interface ClassNameObject {
|
|
9
|
+
default: string;
|
|
10
|
+
props?: Record<string, string>;
|
|
11
|
+
states?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export interface ClassNameProps<T> {
|
|
14
|
+
classNames?: Partial<T>;
|
|
15
|
+
classNameProps?: Record<string, boolean>;
|
|
16
|
+
}
|
|
17
|
+
interface StatefulClassName<T = null> {
|
|
18
|
+
default: string;
|
|
19
|
+
props?: Record<string, string>;
|
|
20
|
+
states?: T;
|
|
21
|
+
}
|
|
22
|
+
export type CheckableClassName = string | StatefulClassName<{
|
|
23
|
+
isChecked?: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type ErrorableClassName = string | StatefulClassName<{
|
|
26
|
+
isError?: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type FocusableClassName = string | StatefulClassName<{
|
|
29
|
+
isFocused?: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type HighlightableClassName = string | StatefulClassName<{
|
|
32
|
+
isHighlighted?: string;
|
|
33
|
+
}>;
|
|
34
|
+
export type LoadableClassName = string | StatefulClassName<{
|
|
35
|
+
isLoading?: string;
|
|
36
|
+
}>;
|
|
37
|
+
export type SelectableClassName = string | StatefulClassName<{
|
|
38
|
+
isSelected?: string;
|
|
39
|
+
}>;
|
|
40
|
+
export type SizableClassName = string | StatefulClassName<{
|
|
41
|
+
isLarge?: string;
|
|
42
|
+
isMedium?: string;
|
|
43
|
+
isSmall?: string;
|
|
44
|
+
}>;
|
|
45
|
+
export type StylableClassName = string | StatefulClassName<{
|
|
46
|
+
isBordered?: string;
|
|
47
|
+
isDanger?: string;
|
|
48
|
+
isError?: string;
|
|
49
|
+
isInfo?: string;
|
|
50
|
+
isPrimary?: string;
|
|
51
|
+
isSecondary?: string;
|
|
52
|
+
isSuccess?: string;
|
|
53
|
+
isTertiary?: string;
|
|
54
|
+
isWarning?: string;
|
|
55
|
+
}>;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IconComponent } from './interfaces';
|
|
2
|
+
export interface RegisteredIcons {
|
|
3
|
+
'collection.empty'?: IconComponent;
|
|
4
|
+
'filter.panel'?: IconComponent;
|
|
5
|
+
'filter.search'?: IconComponent;
|
|
6
|
+
password?: IconComponent;
|
|
7
|
+
'utility.success'?: IconComponent;
|
|
8
|
+
'utility.error'?: IconComponent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|