@sqrzro/ui 4.0.0-alpha.0 → 4.0.0-alpha.2
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/ActionButton/index.d.ts +7 -0
- package/dist/components/buttons/ActionButton/index.js +33 -0
- package/dist/components/buttons/Button/index.d.ts +65 -0
- package/dist/components/buttons/Button/index.js +50 -0
- package/dist/components/buttons/ConfirmableButton/index.d.ts +7 -0
- package/dist/components/buttons/ConfirmableButton/index.js +13 -0
- package/dist/components/buttons/TextButton/index.d.ts +5 -0
- package/dist/components/buttons/TextButton/index.js +6 -0
- package/dist/components/collections/Collection/index.d.ts +15 -0
- package/dist/components/collections/Collection/index.js +45 -0
- package/dist/components/collections/EmptyMessage/index.d.ts +26 -0
- package/dist/components/collections/EmptyMessage/index.js +17 -0
- package/dist/components/collections/EmptyMessageAction/index.d.ts +6 -0
- package/dist/components/collections/EmptyMessageAction/index.js +19 -0
- package/dist/components/collections/List/index.d.ts +6 -0
- package/dist/components/collections/List/index.js +13 -0
- package/dist/components/collections/ListClientComponent/index.d.ts +7 -0
- package/dist/components/collections/ListClientComponent/index.js +9 -0
- package/dist/components/collections/ListItem/index.d.ts +14 -0
- package/dist/components/collections/ListItem/index.js +28 -0
- package/dist/components/collections/ListItemMeta/index.d.ts +11 -0
- package/dist/components/collections/ListItemMeta/index.js +22 -0
- package/dist/components/collections/ListItemSecondary/index.d.ts +6 -0
- package/dist/components/collections/ListItemSecondary/index.js +16 -0
- package/dist/components/collections/Pagination/index.d.ts +19 -0
- package/dist/components/collections/Pagination/index.js +17 -0
- package/dist/components/collections/Table/index.d.ts +9 -0
- package/dist/components/collections/Table/index.js +13 -0
- package/dist/components/collections/TableClientComponent/index.d.ts +14 -0
- package/dist/components/collections/TableClientComponent/index.js +30 -0
- package/dist/components/collections/interfaces.d.ts +57 -0
- package/dist/components/collections/interfaces.js +1 -0
- package/dist/components/collections/lang.d.ts +4 -0
- package/dist/components/collections/lang.js +4 -0
- package/dist/components/collections/utility/filter-columns.d.ts +3 -0
- package/dist/components/collections/utility/filter-columns.js +8 -0
- package/dist/components/collections/utility/get-selected-from-search-params.d.ts +2 -0
- package/dist/components/collections/utility/get-selected-from-search-params.js +5 -0
- package/dist/components/collections/utility/is-paginated.d.ts +3 -0
- package/dist/components/collections/utility/is-paginated.js +4 -0
- package/dist/components/collections/utility/set-selected-to-search-params.d.ts +2 -0
- package/dist/components/collections/utility/set-selected-to-search-params.js +4 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +9 -0
- package/dist/components/modals/ConfirmModal/index.d.ts +7 -0
- package/dist/components/modals/ConfirmModal/index.js +23 -0
- package/dist/components/modals/Modal/index.d.ts +19 -0
- package/dist/components/modals/Modal/index.js +17 -0
- package/dist/components/modals/ModalActions/index.d.ts +9 -0
- package/dist/components/modals/ModalActions/index.js +8 -0
- package/dist/components/modals/ModalLauncher/index.d.ts +5 -0
- package/dist/components/modals/ModalLauncher/index.js +14 -0
- package/dist/components/utility/ActionList/index.d.ts +12 -0
- package/dist/components/utility/ActionList/index.js +9 -0
- package/dist/components/utility/Assistive/index.d.ts +8 -0
- package/dist/components/utility/Assistive/index.js +8 -0
- package/dist/components/utility/ClassNames/index.d.ts +6 -0
- package/dist/components/utility/ClassNames/index.js +7 -0
- package/dist/components/utility/Container/index.d.ts +9 -0
- package/dist/components/utility/Container/index.js +8 -0
- package/dist/components/utility/Link/index.d.ts +19 -0
- package/dist/components/utility/Link/index.js +33 -0
- package/dist/components/utility/Loader/index.d.ts +8 -0
- package/dist/components/utility/Loader/index.js +9 -0
- package/dist/components/utility/Page/index.d.ts +18 -0
- package/dist/components/utility/Page/index.js +34 -0
- package/dist/components/utility/Popover/index.d.ts +14 -0
- package/dist/components/utility/Popover/index.js +71 -0
- package/dist/components/utility/RootLayout/index.d.ts +12 -0
- package/dist/components/utility/RootLayout/index.js +14 -0
- package/dist/components/utility/Toast/index.d.ts +11 -0
- package/dist/components/utility/Toast/index.js +11 -0
- package/dist/components/utility/Toaster/index.d.ts +8 -0
- package/dist/components/utility/Toaster/index.js +57 -0
- package/dist/filters/components/FilterBar/index.d.ts +9 -0
- package/dist/filters/components/FilterBar/index.js +9 -0
- package/dist/filters/components/FilterBarClientComponent/index.d.ts +12 -0
- package/dist/filters/components/FilterBarClientComponent/index.js +68 -0
- package/dist/filters/components/FilterClearButton/index.d.ts +5 -0
- package/dist/filters/components/FilterClearButton/index.js +6 -0
- package/dist/filters/components/FilterControl/index.d.ts +12 -0
- package/dist/filters/components/FilterControl/index.js +10 -0
- package/dist/filters/components/FilterItem/index.d.ts +14 -0
- package/dist/filters/components/FilterItem/index.js +43 -0
- package/dist/filters/components/FilterPanel/index.d.ts +19 -0
- package/dist/filters/components/FilterPanel/index.js +36 -0
- package/dist/filters/filters/BooleanFilter/index.d.ts +3 -0
- package/dist/filters/filters/BooleanFilter/index.js +10 -0
- package/dist/filters/filters/CalendarFilter/index.d.ts +3 -0
- package/dist/filters/filters/CalendarFilter/index.js +10 -0
- package/dist/filters/filters/DateFilter/index.d.ts +3 -0
- package/dist/filters/filters/DateFilter/index.js +21 -0
- package/dist/filters/filters/DropdownFilter/index.d.ts +3 -0
- package/dist/filters/filters/DropdownFilter/index.js +10 -0
- package/dist/filters/filters/Filter/index.d.ts +16 -0
- package/dist/filters/filters/Filter/index.js +13 -0
- package/dist/filters/filters/MultiFilter/index.d.ts +3 -0
- package/dist/filters/filters/MultiFilter/index.js +9 -0
- package/dist/filters/filters/SearchFilter/index.d.ts +4 -0
- package/dist/filters/filters/SearchFilter/index.js +30 -0
- package/dist/filters/filters/interfaces.d.ts +10 -0
- package/dist/filters/filters/interfaces.js +1 -0
- package/dist/filters/hooks/useFilters.d.ts +5 -0
- package/dist/filters/hooks/useFilters.js +25 -0
- package/dist/filters/index.d.ts +2 -0
- package/dist/filters/index.js +2 -0
- package/dist/filters/interfaces.d.ts +28 -0
- package/dist/filters/interfaces.js +1 -0
- package/dist/filters/lang.d.ts +1 -0
- package/dist/filters/lang.js +1 -0
- package/dist/filters/utility/check-has-filters.d.ts +2 -0
- package/dist/filters/utility/check-has-filters.js +8 -0
- package/dist/filters/utility/create-client-filter-map.d.ts +3 -0
- package/dist/filters/utility/create-client-filter-map.js +14 -0
- package/dist/filters/utility/filter.d.ts +16 -0
- package/dist/filters/utility/filter.js +120 -0
- package/dist/filters/utility/get-quick-dates.d.ts +3 -0
- package/dist/filters/utility/get-quick-dates.js +90 -0
- package/dist/filters/utility/parse-filters.d.ts +3 -0
- package/dist/filters/utility/parse-filters.js +16 -0
- package/dist/filters/utility/parse-page.d.ts +2 -0
- package/dist/filters/utility/parse-page.js +8 -0
- package/dist/filters/utility/render-value.d.ts +3 -0
- package/dist/filters/utility/render-value.js +57 -0
- package/dist/filters/utility/transform-boolean.d.ts +2 -0
- package/dist/filters/utility/transform-boolean.js +10 -0
- package/dist/filters/utility/transform-date.d.ts +2 -0
- package/dist/filters/utility/transform-date.js +29 -0
- package/dist/filters/utility/transform-multi.d.ts +2 -0
- package/dist/filters/utility/transform-multi.js +9 -0
- package/dist/forms/components/Dropdown/index.d.ts +22 -0
- package/dist/forms/components/Dropdown/index.js +41 -0
- package/dist/forms/components/DropdownList/index.d.ts +8 -0
- package/dist/forms/components/DropdownList/index.js +20 -0
- package/dist/forms/components/EditableForm/index.d.ts +24 -0
- package/dist/forms/components/EditableForm/index.js +23 -0
- package/dist/forms/components/EditableFormField/index.d.ts +14 -0
- package/dist/forms/components/EditableFormField/index.js +37 -0
- package/dist/forms/components/EditableFormFields/index.d.ts +7 -0
- package/dist/forms/components/EditableFormFields/index.js +20 -0
- package/dist/forms/components/Form/index.d.ts +12 -0
- package/dist/forms/components/Form/index.js +9 -0
- package/dist/forms/components/FormError/index.d.ts +9 -0
- package/dist/forms/components/FormError/index.js +8 -0
- package/dist/forms/components/FormField/index.d.ts +25 -0
- package/dist/forms/components/FormField/index.js +37 -0
- package/dist/forms/components/FormFields/index.d.ts +10 -0
- package/dist/forms/components/FormFields/index.js +22 -0
- package/dist/forms/components/FormLabel/index.d.ts +10 -0
- package/dist/forms/components/FormLabel/index.js +8 -0
- package/dist/forms/components/FormSubmit/index.d.ts +4 -0
- package/dist/forms/components/FormSubmit/index.js +9 -0
- package/dist/forms/components/ModalForm/index.d.ts +13 -0
- package/dist/forms/components/ModalForm/index.js +25 -0
- package/dist/forms/components/PasswordInput/index.d.ts +11 -0
- package/dist/forms/components/PasswordInput/index.js +17 -0
- package/dist/forms/components/StaticTextInput/index.d.ts +22 -0
- package/dist/forms/components/StaticTextInput/index.js +22 -0
- package/dist/forms/components/Switch/index.d.ts +11 -0
- package/dist/forms/components/Switch/index.js +17 -0
- package/dist/forms/components/TextInput/index.d.ts +34 -0
- package/dist/forms/components/TextInput/index.js +30 -0
- package/dist/forms/hooks/useDropdown.d.ts +10 -0
- package/dist/forms/hooks/useDropdown.js +14 -0
- package/dist/forms/hooks/useEditableForm.d.ts +24 -0
- package/dist/forms/hooks/useEditableForm.js +34 -0
- package/dist/forms/hooks/useForm.d.ts +136 -0
- package/dist/forms/hooks/useForm.js +209 -0
- package/dist/forms/hooks/useModalForm.d.ts +14 -0
- package/dist/forms/hooks/useModalForm.js +29 -0
- package/dist/forms/index.d.ts +27 -0
- package/dist/forms/index.js +17 -0
- package/dist/forms/interfaces.d.ts +32 -0
- package/dist/forms/interfaces.js +1 -0
- package/dist/forms/utility/extract-editable-input-props.d.ts +8 -0
- package/dist/forms/utility/extract-editable-input-props.js +19 -0
- package/dist/forms/utility/extract-input-props.d.ts +9 -0
- package/dist/forms/utility/extract-input-props.js +37 -0
- package/dist/hooks/index.d.ts +0 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useClickOutside.d.ts +93 -0
- package/dist/hooks/useClickOutside.js +124 -0
- package/dist/hooks/usePagination.d.ts +17 -0
- package/dist/hooks/usePagination.js +46 -0
- package/dist/hooks/useSearchParamsHref.d.ts +6 -0
- package/dist/hooks/useSearchParamsHref.js +33 -0
- package/dist/hooks/useToast.d.ts +18 -0
- package/dist/hooks/useToast.js +25 -0
- package/dist/navigation/components/AppNavigation/index.d.ts +13 -0
- package/dist/navigation/components/AppNavigation/index.js +15 -0
- package/dist/navigation/components/AppNavigationItem/index.d.ts +6 -0
- package/dist/navigation/components/AppNavigationItem/index.js +9 -0
- package/dist/navigation/components/Tabs/index.d.ts +7 -0
- package/dist/navigation/components/Tabs/index.js +9 -0
- package/dist/navigation/hooks/useNavigation.d.ts +10 -0
- package/dist/navigation/hooks/useNavigation.js +38 -0
- package/dist/navigation/index.d.ts +5 -0
- package/dist/navigation/index.js +3 -0
- package/dist/navigation/interfaces.d.ts +7 -0
- package/dist/navigation/interfaces.js +1 -0
- package/dist/styles/config.d.ts +64 -0
- package/dist/styles/config.js +43 -0
- package/dist/styles/icons.d.ts +15 -0
- package/dist/styles/icons.js +7 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/index.js +1 -0
- package/dist/styles/interfaces.d.ts +41 -0
- package/dist/styles/interfaces.js +1 -0
- package/dist/styles/tw.d.ts +9 -0
- package/dist/styles/tw.js +15 -0
- package/dist/utility/index.d.ts +1 -0
- package/dist/utility/index.js +1 -0
- package/dist/utility/interfaces.d.ts +35 -0
- package/dist/utility/interfaces.js +1 -1
- package/package.json +55 -8
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/lists/List/index.d.ts +0 -5
- package/dist/lists/List/index.js +0 -6
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { usePathname, useSearchParams } from 'next/navigation';
|
|
2
|
+
export function getLink(pathname, searchParams, page) {
|
|
3
|
+
const newSearchParams = new URLSearchParams(searchParams.toString());
|
|
4
|
+
newSearchParams.set('page', page.toString());
|
|
5
|
+
return `${pathname}?${newSearchParams.toString()}`;
|
|
6
|
+
}
|
|
7
|
+
function getOffsetPage(pageCount, page) {
|
|
8
|
+
if (page === 1) {
|
|
9
|
+
return 2;
|
|
10
|
+
}
|
|
11
|
+
if (page === pageCount) {
|
|
12
|
+
return pageCount - 1;
|
|
13
|
+
}
|
|
14
|
+
return page;
|
|
15
|
+
}
|
|
16
|
+
function getLinks(pathname, searchParams, pageCount, page) {
|
|
17
|
+
const offsetPage = getOffsetPage(pageCount, page);
|
|
18
|
+
const set = new Set([1, offsetPage - 1, offsetPage, offsetPage + 1, pageCount]);
|
|
19
|
+
const array = Array.from(set).filter((item) => item > 0 && item <= pageCount);
|
|
20
|
+
const links = [];
|
|
21
|
+
for (let i = 0; i < array.length; i++) {
|
|
22
|
+
const current = array[i];
|
|
23
|
+
const next = array[i + 1];
|
|
24
|
+
links.push({ href: getLink(pathname, searchParams, current), label: String(current) });
|
|
25
|
+
if (next && next !== current + 1) {
|
|
26
|
+
links.push(null);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return links;
|
|
30
|
+
}
|
|
31
|
+
function usePagination({ limit, page, total }) {
|
|
32
|
+
const pathname = usePathname();
|
|
33
|
+
const searchParams = useSearchParams();
|
|
34
|
+
const pageCount = Math.ceil(total / limit);
|
|
35
|
+
if (pageCount <= 1) {
|
|
36
|
+
return { links: [], pageCount };
|
|
37
|
+
}
|
|
38
|
+
const links = getLinks(pathname, searchParams, pageCount, page);
|
|
39
|
+
return {
|
|
40
|
+
links,
|
|
41
|
+
nextLink: page === pageCount ? null : getLink(pathname, searchParams, page + 1),
|
|
42
|
+
pageCount,
|
|
43
|
+
previousLink: page === 1 ? null : getLink(pathname, searchParams, page - 1),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export default usePagination;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface UseSearchParamsHrefReturn {
|
|
2
|
+
getSearchParamsHref: (key: string | Record<string, string | null>, value?: string | null) => string;
|
|
3
|
+
setSearchParamsHref: (key: string | Record<string, string | null>, value?: string | null) => void;
|
|
4
|
+
}
|
|
5
|
+
declare function useSearchParamsHref(): UseSearchParamsHrefReturn;
|
|
6
|
+
export default useSearchParamsHref;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { usePathname, useSearchParams } from 'next/navigation';
|
|
3
|
+
function useSearchParamsHref() {
|
|
4
|
+
const pathname = usePathname();
|
|
5
|
+
const searchParams = useSearchParams();
|
|
6
|
+
function setParam(params, key, value) {
|
|
7
|
+
if (value === null) {
|
|
8
|
+
params.delete(key);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
params.set(key, value);
|
|
12
|
+
}
|
|
13
|
+
return params;
|
|
14
|
+
}
|
|
15
|
+
function getSearchParamsHref(key, value) {
|
|
16
|
+
let params = new URLSearchParams(searchParams?.toString());
|
|
17
|
+
if (typeof key === 'object') {
|
|
18
|
+
Object.entries(key).forEach(([k, v]) => {
|
|
19
|
+
params = setParam(params, k, v);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
params = setParam(params, key, value ?? null);
|
|
24
|
+
}
|
|
25
|
+
return `${pathname ?? ''}?${params.toString()}`;
|
|
26
|
+
}
|
|
27
|
+
function setSearchParamsHref(key, value) {
|
|
28
|
+
const href = getSearchParamsHref(key, value);
|
|
29
|
+
window.history.replaceState(null, '', href);
|
|
30
|
+
}
|
|
31
|
+
return { getSearchParamsHref, setSearchParamsHref };
|
|
32
|
+
}
|
|
33
|
+
export default useSearchParamsHref;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ToastObject {
|
|
2
|
+
message: string;
|
|
3
|
+
}
|
|
4
|
+
interface UseToastArgs {
|
|
5
|
+
channel?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ToastFunctionOptions {
|
|
8
|
+
duration?: number;
|
|
9
|
+
}
|
|
10
|
+
type ToastFunction = (message: string, options?: ToastFunctionOptions) => void;
|
|
11
|
+
interface UseToastReturn {
|
|
12
|
+
toastError: ToastFunction;
|
|
13
|
+
toastInfo: ToastFunction;
|
|
14
|
+
toastSuccess: ToastFunction;
|
|
15
|
+
toastWarning: ToastFunction;
|
|
16
|
+
}
|
|
17
|
+
declare function useToast(args?: UseToastArgs): UseToastReturn;
|
|
18
|
+
export default useToast;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
function useToast(args) {
|
|
3
|
+
function setToast({ message, type }) {
|
|
4
|
+
const eventName = args?.channel ? `toast-${args.channel}` : 'toast';
|
|
5
|
+
const event = new CustomEvent(eventName, {
|
|
6
|
+
bubbles: false,
|
|
7
|
+
detail: { id: String(Math.random()), message, type },
|
|
8
|
+
});
|
|
9
|
+
document.dispatchEvent(event);
|
|
10
|
+
}
|
|
11
|
+
function toastError(message) {
|
|
12
|
+
setToast({ message, type: 'error' });
|
|
13
|
+
}
|
|
14
|
+
function toastInfo(message) {
|
|
15
|
+
setToast({ message, type: 'info' });
|
|
16
|
+
}
|
|
17
|
+
function toastSuccess(message) {
|
|
18
|
+
setToast({ message, type: 'success' });
|
|
19
|
+
}
|
|
20
|
+
function toastWarning(message) {
|
|
21
|
+
setToast({ message, type: 'warning' });
|
|
22
|
+
}
|
|
23
|
+
return { toastError, toastInfo, toastSuccess, toastWarning };
|
|
24
|
+
}
|
|
25
|
+
export default useToast;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ClassNameProps, HighlightableClassName } from '../../../styles/interfaces';
|
|
2
|
+
import type { NavigationObject } from '../../interfaces';
|
|
3
|
+
export interface AppNavigationClassNames {
|
|
4
|
+
root: string;
|
|
5
|
+
list: string;
|
|
6
|
+
item: HighlightableClassName;
|
|
7
|
+
link: HighlightableClassName;
|
|
8
|
+
}
|
|
9
|
+
export interface AppNavigationProps extends ClassNameProps<AppNavigationClassNames> {
|
|
10
|
+
data: NavigationObject[];
|
|
11
|
+
}
|
|
12
|
+
declare function AppNavigation(props: Readonly<AppNavigationProps>): React.ReactElement;
|
|
13
|
+
export default AppNavigation;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense } from 'react';
|
|
4
|
+
import { getClassNames } from '../../../styles/config';
|
|
5
|
+
import useNavigation from '../../hooks/useNavigation';
|
|
6
|
+
import AppNavigationItem from '../AppNavigationItem';
|
|
7
|
+
function AppNavigationComponent({ classNameProps, classNames, data, }) {
|
|
8
|
+
const componentClassNames = classNames || getClassNames('appNavigation')?.(classNameProps);
|
|
9
|
+
const navigation = useNavigation(data);
|
|
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
|
+
}
|
|
12
|
+
function AppNavigation(props) {
|
|
13
|
+
return (_jsx(Suspense, { children: _jsx(AppNavigationComponent, { ...props }) }));
|
|
14
|
+
}
|
|
15
|
+
export default AppNavigation;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NavigationObject } from '../../../navigation/interfaces';
|
|
2
|
+
import type { ClassNameProps } from '../../../styles/interfaces';
|
|
3
|
+
import type { AppNavigationClassNames } from '../AppNavigation';
|
|
4
|
+
export type AppNavigationItemProps = NavigationObject & ClassNameProps<AppNavigationClassNames>;
|
|
5
|
+
declare function AppNavigationItem({ classNameProps, classNames, href, isActive, label, }: Readonly<AppNavigationItemProps>): React.ReactElement;
|
|
6
|
+
export default AppNavigationItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Link from '../../../components/utility/Link';
|
|
3
|
+
import { getClassNames } from '../../../styles/config';
|
|
4
|
+
import tw from '../../../styles/tw';
|
|
5
|
+
function AppNavigationItem({ classNameProps, classNames, href, isActive, label, }) {
|
|
6
|
+
const componentClassNames = classNames || getClassNames('appNavigation')?.(classNameProps);
|
|
7
|
+
return (_jsx("li", { className: tw(componentClassNames?.item?.default, isActive ? componentClassNames?.item?.highlighted : null), children: _jsx(Link, { className: tw(componentClassNames?.link?.default, isActive ? componentClassNames?.link?.highlighted : null), href: href, children: label }) }));
|
|
8
|
+
}
|
|
9
|
+
export default AppNavigationItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AppNavigationClassNames, AppNavigationProps } from '../AppNavigation';
|
|
2
|
+
export type TabsClassNames = AppNavigationClassNames;
|
|
3
|
+
export interface TabsProps extends Omit<AppNavigationProps, 'classNames'> {
|
|
4
|
+
classNames?: TabsClassNames;
|
|
5
|
+
}
|
|
6
|
+
declare function Tabs({ classNameProps, classNames, ...props }: Readonly<TabsProps>): React.ReactElement;
|
|
7
|
+
export default Tabs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { getClassNames } from '../../../styles/config';
|
|
4
|
+
import AppNavigation from '../AppNavigation';
|
|
5
|
+
function Tabs({ classNameProps, classNames, ...props }) {
|
|
6
|
+
const componentClassNames = classNames || getClassNames('tabs')?.(classNameProps);
|
|
7
|
+
return _jsx(AppNavigation, { classNames: componentClassNames ?? {}, ...props });
|
|
8
|
+
}
|
|
9
|
+
export default Tabs;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Action } from '../../utility/interfaces';
|
|
2
|
+
import type { NavigationObject } from '../interfaces';
|
|
3
|
+
interface NavigationAction extends Action {
|
|
4
|
+
children?: Action[];
|
|
5
|
+
}
|
|
6
|
+
interface UseNavigationOptions {
|
|
7
|
+
basePath?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function useNavigation(data: NavigationAction[], options?: UseNavigationOptions): NavigationObject[];
|
|
10
|
+
export default useNavigation;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { joinUrl } from '@sqrzro/utility';
|
|
2
|
+
import { usePathname, useSelectedLayoutSegments } from 'next/navigation';
|
|
3
|
+
function getActivePath(pathname, hrefs) {
|
|
4
|
+
return (hrefs
|
|
5
|
+
.filter((href) => href && pathname.startsWith(`/${href.replace(/^\//u, '').split('?')[0]}`))
|
|
6
|
+
.sort((first, second) => {
|
|
7
|
+
if (!first || !second) {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
return second.length - first.length;
|
|
11
|
+
})[0] || '');
|
|
12
|
+
}
|
|
13
|
+
function getBasePath(pathname, segments) {
|
|
14
|
+
const segment = segments.join('/');
|
|
15
|
+
const regex = new RegExp(`/${segment}$`, 'u');
|
|
16
|
+
return pathname.replace(regex, '');
|
|
17
|
+
}
|
|
18
|
+
function transformChildren(children, basePath) {
|
|
19
|
+
return children.map(({ details, href, label }) => ({
|
|
20
|
+
details,
|
|
21
|
+
href: joinUrl(basePath, href),
|
|
22
|
+
label,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
function useNavigation(data, options) {
|
|
26
|
+
const pathname = usePathname();
|
|
27
|
+
const segments = useSelectedLayoutSegments();
|
|
28
|
+
const basePath = getBasePath(pathname, segments);
|
|
29
|
+
const hrefs = data.map(({ href }) => joinUrl(basePath, href));
|
|
30
|
+
const activePath = getActivePath(pathname, hrefs);
|
|
31
|
+
return data.map((item) => ({
|
|
32
|
+
...item,
|
|
33
|
+
children: transformChildren(item.children || [], item.href),
|
|
34
|
+
href: joinUrl(basePath, item.href),
|
|
35
|
+
isActive: joinUrl(basePath, item.href) === activePath,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
export default useNavigation;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './interfaces';
|
|
2
|
+
export type { AppNavigationClassNames, AppNavigationProps } from './components/AppNavigation';
|
|
3
|
+
export { default as AppNavigation } from './components/AppNavigation';
|
|
4
|
+
export type { TabsClassNames, TabsProps } from './components/Tabs';
|
|
5
|
+
export { default as Tabs } from './components/Tabs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ButtonClassNames } from '../components/buttons/Button';
|
|
2
|
+
import type { TextButtonClassNames } from '../components/buttons/TextButton';
|
|
3
|
+
import type { EmptyMessageClassNames } from '../components/collections/EmptyMessage';
|
|
4
|
+
import type { ListItemClassNames } from '../components/collections/ListItem';
|
|
5
|
+
import type { ListItemMetaClassNames } from '../components/collections/ListItemMeta';
|
|
6
|
+
import type { PaginationClassNames } from '../components/collections/Pagination';
|
|
7
|
+
import type { TableClassNames } from '../components/collections/Table';
|
|
8
|
+
import type { ModalClassNames } from '../components/modals/Modal';
|
|
9
|
+
import type { ActionListClassNames } from '../components/utility/ActionList';
|
|
10
|
+
import type { ContainerClassNames } from '../components/utility/Container';
|
|
11
|
+
import type { LinkClassNames } from '../components/utility/Link';
|
|
12
|
+
import type { LoaderClassNames } from '../components/utility/Loader';
|
|
13
|
+
import type { PopoverClassNames } from '../components/utility/Popover';
|
|
14
|
+
import type { RootLayoutClassNames } from '../components/utility/RootLayout';
|
|
15
|
+
import type { ToastClassNames } from '../components/utility/Toast';
|
|
16
|
+
import type { FilterBarClassNames } from '../filters/components/FilterBar';
|
|
17
|
+
import type { FilterItemClassNames } from '../filters/components/FilterItem';
|
|
18
|
+
import type { FilterPanelClassNames } from '../filters/components/FilterPanel';
|
|
19
|
+
import type { DropdownClassNames } from '../forms/components/Dropdown';
|
|
20
|
+
import type { EditableFormClassNames } from '../forms/components/EditableForm';
|
|
21
|
+
import type { EditableFormFieldClassNames } from '../forms/components/EditableFormField';
|
|
22
|
+
import type { FormClassNames } from '../forms/components/Form';
|
|
23
|
+
import type { FormFieldClassNames } from '../forms/components/FormField';
|
|
24
|
+
import type { PasswordInputClassNames } from '../forms/components/PasswordInput';
|
|
25
|
+
import type { StaticTextInputClassNames } from '../forms/components/StaticTextInput';
|
|
26
|
+
import type { SwitchClassNames } from '../forms/components/Switch';
|
|
27
|
+
import type { TextInputClassNames } from '../forms/components/TextInput';
|
|
28
|
+
import type { AppNavigationClassNames } from '../navigation/components/AppNavigation';
|
|
29
|
+
import type { TabsClassNames } from '../navigation/components/Tabs';
|
|
30
|
+
type ComponentClassNames<T> = Partial<T>;
|
|
31
|
+
export interface RegisteredClassNames {
|
|
32
|
+
actionList?: ComponentClassNames<ActionListClassNames>;
|
|
33
|
+
appNavigation?: ComponentClassNames<AppNavigationClassNames>;
|
|
34
|
+
button?: ComponentClassNames<ButtonClassNames>;
|
|
35
|
+
container?: ComponentClassNames<ContainerClassNames>;
|
|
36
|
+
dropdown?: ComponentClassNames<DropdownClassNames>;
|
|
37
|
+
editableForm?: ComponentClassNames<EditableFormClassNames>;
|
|
38
|
+
editableFormField?: ComponentClassNames<EditableFormFieldClassNames>;
|
|
39
|
+
emptyMessage?: ComponentClassNames<EmptyMessageClassNames>;
|
|
40
|
+
filterBar?: ComponentClassNames<FilterBarClassNames>;
|
|
41
|
+
filterItem?: ComponentClassNames<FilterItemClassNames>;
|
|
42
|
+
filterPanel?: ComponentClassNames<FilterPanelClassNames>;
|
|
43
|
+
form?: ComponentClassNames<FormClassNames>;
|
|
44
|
+
formField?: ComponentClassNames<FormFieldClassNames>;
|
|
45
|
+
link?: ComponentClassNames<LinkClassNames>;
|
|
46
|
+
listItem?: ComponentClassNames<ListItemClassNames>;
|
|
47
|
+
listItemMeta?: ComponentClassNames<ListItemMetaClassNames>;
|
|
48
|
+
loader?: ComponentClassNames<LoaderClassNames>;
|
|
49
|
+
modal?: ComponentClassNames<ModalClassNames>;
|
|
50
|
+
pagination?: ComponentClassNames<PaginationClassNames>;
|
|
51
|
+
passwordInput?: ComponentClassNames<PasswordInputClassNames>;
|
|
52
|
+
popover?: ComponentClassNames<PopoverClassNames>;
|
|
53
|
+
rootLayout?: ComponentClassNames<RootLayoutClassNames>;
|
|
54
|
+
staticTextInput?: ComponentClassNames<StaticTextInputClassNames>;
|
|
55
|
+
switch?: ComponentClassNames<SwitchClassNames>;
|
|
56
|
+
table?: ComponentClassNames<TableClassNames>;
|
|
57
|
+
tabs?: ComponentClassNames<TabsClassNames>;
|
|
58
|
+
textButton?: ComponentClassNames<TextButtonClassNames>;
|
|
59
|
+
textInput?: ComponentClassNames<TextInputClassNames>;
|
|
60
|
+
toast?: ComponentClassNames<ToastClassNames>;
|
|
61
|
+
}
|
|
62
|
+
export declare function registerClassNames(data: RegisteredClassNames): void;
|
|
63
|
+
export declare function getClassNames<K extends keyof RegisteredClassNames>(componentName: K): (props?: Record<string, unknown>) => RegisteredClassNames[K];
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// import type { ActionListClassNames } from '../elements/ActionList';
|
|
2
|
+
// import type { AppNavigationClassNames } from '../navigation/components/AppNavigation';
|
|
3
|
+
// import type { BadgeClassNames } from '../elements/Badge';
|
|
4
|
+
// import type { CalendarClassNames } from '../forms/Calendar';
|
|
5
|
+
// import type { CalendarInputClassNames } from '../forms/CalendarInput';
|
|
6
|
+
// import type { CalendarNavigationClassNames } from '../forms/CalendarNavigation';
|
|
7
|
+
// import type { CheckboxInputClassNames } from '../forms/CheckboxInput';
|
|
8
|
+
// import type { CodeInputClassNames } from '../forms/CodeInput';
|
|
9
|
+
// import type { ColorInputClassNames } from '../forms/ColorInput';
|
|
10
|
+
// import type { CSVInputClassNames } from '../forms/CSVInput';
|
|
11
|
+
// import type { DefinitionListClassNames } from '../elements/DefinitionList';
|
|
12
|
+
// import type { DropdownClassNames } from '../forms/Dropdown';
|
|
13
|
+
// import type { EditableFormClassNames } from '../forms/EditableForm';
|
|
14
|
+
// import type { EditableFormFieldClassNames } from '../forms/EditableFormField';
|
|
15
|
+
// import type { FieldsetClassNames } from '../forms/Fieldset';
|
|
16
|
+
// import type { FilterBarClassNames } from '../filters/components/FilterBar';
|
|
17
|
+
// import type { FilterItemClassNames } from '../filters/components/FilterItem';
|
|
18
|
+
// import type { FilterPanelClassNames } from '../filters/components/FilterPanel';
|
|
19
|
+
// import type { FormClassNames } from '../forms/Form';
|
|
20
|
+
// import type { ImageInputClassNames } from '../forms/ImageInput';
|
|
21
|
+
// import type { InfoPanelClassNames } from '../elements/InfoPanel';
|
|
22
|
+
// import type { ListMenuClassNames } from '../lists/ListMenu';
|
|
23
|
+
// import type { ListMenuButtonClassNames } from '../lists/ListMenuButton';
|
|
24
|
+
// import type { LoadingModalClassNames } from '../modals/LoadingModal';
|
|
25
|
+
// import type { ModalClassNames } from '../modals/Modal';
|
|
26
|
+
// import type { MultiInputClassNames } from '../forms/MultiInput';
|
|
27
|
+
// import type { ObjectInputClassNames } from '../forms/ObjectInput';
|
|
28
|
+
// import type { RadioInputClassNames } from '../forms/RadioInput';
|
|
29
|
+
// import type { StaticTextInputClassNames } from '../forms/StaticTextInput';
|
|
30
|
+
// import type { SwitchClassNames } from '../forms/Switch';
|
|
31
|
+
// import type { PasswordInputClassNames } from '../forms/PasswordInput';
|
|
32
|
+
// import type { TableClassNames } from '../tables/Table';
|
|
33
|
+
// import type { TextAreaClassNames } from '../forms/TextArea';
|
|
34
|
+
// import type { TextInputClassNames } from '../forms/TextInput';
|
|
35
|
+
// import type { ToastClassNames } from '../elements/Toast';
|
|
36
|
+
// import type { TooltipClassNames } from '../elements/Tooltip';
|
|
37
|
+
let registeredClassNames = {};
|
|
38
|
+
export function registerClassNames(data) {
|
|
39
|
+
registeredClassNames = { ...registeredClassNames, ...data };
|
|
40
|
+
}
|
|
41
|
+
export function getClassNames(componentName) {
|
|
42
|
+
return () => registeredClassNames[componentName];
|
|
43
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type IconComponent = React.ForwardRefExoticComponent<React.PropsWithoutRef<React.SVGProps<SVGSVGElement>> & {
|
|
2
|
+
title?: string;
|
|
3
|
+
titleId?: string;
|
|
4
|
+
} & React.RefAttributes<SVGSVGElement>>;
|
|
5
|
+
export interface RegisteredIcons {
|
|
6
|
+
'collection.empty'?: IconComponent;
|
|
7
|
+
'filter.panel'?: IconComponent;
|
|
8
|
+
'filter.search'?: IconComponent;
|
|
9
|
+
password?: IconComponent;
|
|
10
|
+
'utility.success'?: IconComponent;
|
|
11
|
+
'utility.error'?: IconComponent;
|
|
12
|
+
}
|
|
13
|
+
export declare function registerIcons(data: RegisteredIcons): void;
|
|
14
|
+
export declare function getIcon(componentName: keyof RegisteredIcons): IconComponent | null;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as tw, twx } from './tw';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ButtonVariant, StyleVariant } from "../utility/interfaces";
|
|
2
|
+
export interface ClassNameProps<T> {
|
|
3
|
+
classNames?: Partial<T>;
|
|
4
|
+
classNameProps?: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export interface CheckableClassName {
|
|
7
|
+
default?: string;
|
|
8
|
+
checked?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ErrorableClassName {
|
|
11
|
+
default?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FocusableClassName {
|
|
15
|
+
default?: string;
|
|
16
|
+
focused?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface HighlightableClassName {
|
|
19
|
+
default?: string;
|
|
20
|
+
highlighted?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface LoadableClassName {
|
|
23
|
+
default?: string;
|
|
24
|
+
loading?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SelectableClassName {
|
|
27
|
+
default?: string;
|
|
28
|
+
selected?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SizableClassName {
|
|
31
|
+
default?: string;
|
|
32
|
+
lg?: string;
|
|
33
|
+
md?: string;
|
|
34
|
+
sm?: string;
|
|
35
|
+
}
|
|
36
|
+
export type StylableClassName = Partial<Record<StyleVariant, string>> & {
|
|
37
|
+
default?: string;
|
|
38
|
+
};
|
|
39
|
+
export type StylableButtonClassName = Partial<Record<ButtonVariant, string>> & {
|
|
40
|
+
default?: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function does nothing other than return the object it was given. It's used to 'trick' the
|
|
3
|
+
* `prettier-plugin-tailwind` into sorting the order of the classes in the `classNames` object that
|
|
4
|
+
* is passed to the `ClassNames` component. The `@sqrzro/prettier-config` object then has a rule for
|
|
5
|
+
* `tailwindFunctions` that includes `twx`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function twx<T extends object>(object: T): T;
|
|
8
|
+
declare function tw(...inputs: (string | null | undefined)[]): string;
|
|
9
|
+
export default tw;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
/**
|
|
4
|
+
* This function does nothing other than return the object it was given. It's used to 'trick' the
|
|
5
|
+
* `prettier-plugin-tailwind` into sorting the order of the classes in the `classNames` object that
|
|
6
|
+
* is passed to the `ClassNames` component. The `@sqrzro/prettier-config` object then has a rule for
|
|
7
|
+
* `tailwindFunctions` that includes `twx`.
|
|
8
|
+
*/
|
|
9
|
+
export function twx(object) {
|
|
10
|
+
return object;
|
|
11
|
+
}
|
|
12
|
+
function tw(...inputs) {
|
|
13
|
+
return twMerge(clsx(inputs));
|
|
14
|
+
}
|
|
15
|
+
export default tw;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { NextLayoutProps, NextPageProps } from './interfaces';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface ConfirmableObject {
|
|
2
|
+
actions?: Omit<Action, 'confirmable'>[];
|
|
3
|
+
confirmText?: string;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
modalIcon?: React.ReactNode;
|
|
8
|
+
onBeforeConfirm?: () => void;
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
submitLabel?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Action {
|
|
14
|
+
action?: string;
|
|
15
|
+
confirmable?: ConfirmableObject;
|
|
16
|
+
details?: React.ReactNode;
|
|
17
|
+
href?: string;
|
|
18
|
+
icon?: React.ReactNode;
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
isSubmittable?: boolean;
|
|
22
|
+
label: React.ReactNode;
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
variant?: ButtonVariant;
|
|
25
|
+
}
|
|
26
|
+
export interface NextLayoutProps {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
params?: Promise<Record<string, string>> | null;
|
|
29
|
+
}
|
|
30
|
+
export interface NextPageProps {
|
|
31
|
+
params?: Promise<Record<string, string>> | null;
|
|
32
|
+
searchParams?: Promise<Record<string, string>> | null;
|
|
33
|
+
}
|
|
34
|
+
export type StyleVariant = 'bordered' | 'danger' | 'error' | 'info' | 'primary' | 'secondary' | 'success' | 'tertiary' | 'warning';
|
|
35
|
+
export type ButtonVariant = StyleVariant | 'link';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,30 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqrzro/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
9
|
+
"./components": {
|
|
10
|
+
"types": "./dist/components/index.d.ts",
|
|
11
|
+
"default": "./dist/components/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./filters": {
|
|
14
|
+
"types": "./dist/filters/index.d.ts",
|
|
15
|
+
"default": "./dist/filters/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./forms": {
|
|
18
|
+
"types": "./dist/forms/index.d.ts",
|
|
19
|
+
"default": "./dist/forms/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./hooks": {
|
|
22
|
+
"types": "./dist/hooks/index.d.ts",
|
|
23
|
+
"default": "./dist/hooks/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./navigation": {
|
|
26
|
+
"types": "./dist/navigation/index.d.ts",
|
|
27
|
+
"default": "./dist/navigation/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./styles": {
|
|
30
|
+
"types": "./dist/styles/index.d.ts",
|
|
31
|
+
"default": "./dist/styles/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./utility": {
|
|
34
|
+
"types": "./dist/utility/index.d.ts",
|
|
35
|
+
"default": "./dist/utility/index.js"
|
|
36
|
+
}
|
|
10
37
|
},
|
|
11
38
|
"files": [
|
|
12
39
|
"dist/**/*"
|
|
13
40
|
],
|
|
14
41
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
42
|
+
"clsx": "^2.1.1",
|
|
43
|
+
"next": "^16.1.6",
|
|
44
|
+
"react": "^19.2.4",
|
|
45
|
+
"react-dom": "^19.2.1",
|
|
46
|
+
"tailwind-merge": "^3.4.0",
|
|
47
|
+
"use-deep-compare-effect": "^1.8.1",
|
|
48
|
+
"@sqrzro/utility": "^4.0.0-alpha.1"
|
|
17
49
|
},
|
|
18
50
|
"devDependencies": {
|
|
19
|
-
"@
|
|
51
|
+
"@storybook/addon-a11y": "^10.1.7",
|
|
52
|
+
"@storybook/addon-docs": "^10.1.7",
|
|
53
|
+
"@storybook/nextjs": "^10.1.7",
|
|
54
|
+
"@testing-library/react": "^16.3.0",
|
|
55
|
+
"@testing-library/user-event": "^14.6.1",
|
|
20
56
|
"@types/react": "^19.2.7",
|
|
57
|
+
"@types/react-dom": "^19.2.3",
|
|
58
|
+
"concurrently": "^9.2.1",
|
|
59
|
+
"next-router-mock": "^1.0.4",
|
|
60
|
+
"prettier": "^3.7.4",
|
|
21
61
|
"rimraf": "^6.1.2",
|
|
22
|
-
"
|
|
62
|
+
"storybook": "^10.1.7",
|
|
63
|
+
"tsc-alias": "^1.8.16",
|
|
64
|
+
"tslib": "^2.8.1",
|
|
65
|
+
"typescript": "^5.9.3",
|
|
66
|
+
"@sqrzro/prettier-config": "^4.0.0-alpha.1"
|
|
23
67
|
},
|
|
24
68
|
"scripts": {
|
|
25
|
-
"build": "pnpm clean && tsc",
|
|
69
|
+
"build": "pnpm clean && tsc -p tsconfig.build.json && tsc-alias",
|
|
26
70
|
"clean": "rimraf ./dist",
|
|
27
|
-
"dev": "tsc --watch",
|
|
71
|
+
"dev": "(concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc-alias -w\")",
|
|
72
|
+
"docs:start": "storybook dev -p 6006",
|
|
73
|
+
"docs:build": "storybook build",
|
|
74
|
+
"lint": "tsc --noEmit && eslint \"./src/**/*.ts\"",
|
|
28
75
|
"prettier": "prettier --write \"./src/**/*.tsx\" \"./src/**/*.ts\"",
|
|
29
76
|
"start": "pnpm dev"
|
|
30
77
|
}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as List } from "./lists/List";
|