tw-react-components 0.0.157 → 0.0.159

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.
Files changed (50) hide show
  1. package/index.esm.js +19 -14
  2. package/package.json +1 -1
  3. package/src/components/Badge/index.d.ts +1 -1
  4. package/src/components/Block/index.d.ts +1 -1
  5. package/src/components/Button/index.d.ts +3 -3
  6. package/src/components/DataTable/index.d.ts +5 -5
  7. package/src/components/Dialog/ConfirmDialog.d.ts +1 -1
  8. package/src/components/Dialog/Dialog.d.ts +1 -1
  9. package/src/components/Dialog/FormDialog.d.ts +3 -3
  10. package/src/components/Dialog/ListSorterDialog.d.ts +1 -1
  11. package/src/components/Dialog/PdfViewerDialog.d.ts +1 -1
  12. package/src/components/DropdownMenu/index.d.ts +1 -1
  13. package/src/components/Flex/index.d.ts +1 -1
  14. package/src/components/Form/controls/FormGroup.d.ts +1 -1
  15. package/src/components/Form/controls/Label.d.ts +1 -1
  16. package/src/components/Form/controls/custom/date-time/DateSelector.d.ts +1 -1
  17. package/src/components/Form/controls/custom/date-time/DaysView.d.ts +1 -1
  18. package/src/components/Form/controls/custom/date-time/MonthsView.d.ts +1 -1
  19. package/src/components/Form/controls/custom/date-time/TimeSelector.d.ts +1 -1
  20. package/src/components/Form/controls/custom/date-time/YearsView.d.ts +1 -1
  21. package/src/components/Form/controls/custom/date-time/index.d.ts +1 -1
  22. package/src/components/Form/controls/custom/file.d.ts +1 -1
  23. package/src/components/Form/controls/custom/select/index.d.ts +2 -2
  24. package/src/components/Form/controls/primitive/BasicInput.d.ts +2 -2
  25. package/src/components/Form/controls/primitive/CheckBoxInput.d.ts +1 -1
  26. package/src/components/Form/controls/primitive/EmailInput.d.ts +1 -1
  27. package/src/components/Form/controls/primitive/NumberInput.d.ts +2 -2
  28. package/src/components/Form/controls/primitive/PasswordInput.d.ts +1 -1
  29. package/src/components/Form/controls/primitive/TextInput.d.ts +1 -1
  30. package/src/components/Form/controls/primitive/TextareaInput.d.ts +1 -1
  31. package/src/components/Form/controls/with-form.d.ts +4 -4
  32. package/src/components/Hint/index.d.ts +2 -2
  33. package/src/components/Layout/index.d.ts +6 -3
  34. package/src/components/List/index.d.ts +2 -2
  35. package/src/components/ListSorter/index.d.ts +2 -2
  36. package/src/components/Navbar/index.d.ts +1 -1
  37. package/src/components/Pagination/index.d.ts +1 -1
  38. package/src/components/Sheet/index.d.ts +1 -1
  39. package/src/components/Sidebar/index.d.ts +3 -3
  40. package/src/components/Skeleton/index.d.ts +1 -1
  41. package/src/components/Spinner/index.d.ts +1 -1
  42. package/src/components/Switch/index.d.ts +1 -1
  43. package/src/components/Table/index.d.ts +1 -1
  44. package/src/components/ThemeSelector/index.d.ts +1 -1
  45. package/src/components/Tooltip/index.d.ts +1 -1
  46. package/src/contexts/LayoutContext.d.ts +1 -1
  47. package/src/helpers/compareDates.d.ts +1 -1
  48. package/src/helpers/mergeRefs.d.ts +1 -1
  49. package/src/hooks/useOnSwipe.d.ts +1 -1
  50. package/src/hooks/useOutsideClick.d.ts +1 -1
package/index.esm.js CHANGED
@@ -16,7 +16,6 @@ import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, close
16
16
  import { restrictToFirstScrollableAncestor } from '@dnd-kit/modifiers';
17
17
  import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable';
18
18
  import { CSS } from '@dnd-kit/utilities';
19
- import { useLocation, NavLink } from 'react-router';
20
19
  import { Slot } from '@radix-ui/react-slot';
21
20
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
22
21
  import * as PopoverPrimitive from '@radix-ui/react-popover';
@@ -1242,8 +1241,11 @@ const DropdownMenu = Object.assign(DropdownMenuPrimitive.Root, {
1242
1241
  RadioGroup: DropdownMenuRadioGroup,
1243
1242
  });
1244
1243
 
1244
+ const defaultRenderItem = (item, selected) => item.label;
1245
+ const defaultSearchPredicate = (item, searchValue) => item.label.toLowerCase().includes(searchValue.toLowerCase());
1246
+ const defaultSelectPredicate = (a, b) => a === b;
1245
1247
  const SelectInput = forwardRef((_a, ref) => {
1246
- var { className, items, renderItem = (item) => item.label, value, multiple, clearable, allowAddition, onNewItemAdded, search, searchPredicate = (item, searchValue) => item.label.toLowerCase().includes(searchValue.toLowerCase()), selectPredicate = (a, b) => a === b, onChange, readOnly, parentRef } = _a, props = __rest(_a, ["className", "items", "renderItem", "value", "multiple", "clearable", "allowAddition", "onNewItemAdded", "search", "searchPredicate", "selectPredicate", "onChange", "readOnly", "parentRef"]);
1248
+ var { className, items, renderItem = defaultRenderItem, value, multiple, clearable, allowAddition, onNewItemAdded, search, searchPredicate = defaultSearchPredicate, selectPredicate = defaultSelectPredicate, onChange, readOnly, parentRef } = _a, props = __rest(_a, ["className", "items", "renderItem", "value", "multiple", "clearable", "allowAddition", "onNewItemAdded", "search", "searchPredicate", "selectPredicate", "onChange", "readOnly", "parentRef"]);
1247
1249
  const [open, setOpen] = useState(false);
1248
1250
  const [searchValue, setSearchValue] = useState('');
1249
1251
  const pureItems = useMemo(() => items.flatMap((item) => (item.group ? item.items : [item])), [items]);
@@ -1261,14 +1263,14 @@ const SelectInput = forwardRef((_a, ref) => {
1261
1263
  const filteredItems = useMemo(() => !search || !searchValue
1262
1264
  ? items
1263
1265
  : items.flatMap((item) => item.group
1264
- ? item.items.some((subItem) => subItem.label.toLowerCase().includes(searchValue.toLowerCase()))
1266
+ ? item.items.some((subItem) => searchPredicate(subItem, searchValue))
1265
1267
  ? [
1266
- Object.assign(Object.assign({}, item), { items: item.items.filter((subItem) => subItem.label.toLowerCase().includes(searchValue.toLowerCase())) }),
1268
+ Object.assign(Object.assign({}, item), { items: item.items.filter((subItem) => searchPredicate(subItem, searchValue)) }),
1267
1269
  ]
1268
1270
  : []
1269
- : item.label.toLowerCase().includes(searchValue.toLowerCase())
1271
+ : searchPredicate(item, searchValue)
1270
1272
  ? [item]
1271
- : []), [items, search, searchValue]);
1273
+ : []), [items, search, searchPredicate, searchValue]);
1272
1274
  const text = useMemo(() => selectedItems.length
1273
1275
  ? !multiple
1274
1276
  ? selectedItems[0].label
@@ -1298,7 +1300,10 @@ const SelectInput = forwardRef((_a, ref) => {
1298
1300
  }
1299
1301
  }
1300
1302
  }, [clearable, multiple, onChange, pureItems, selectedItems, selectedMap]);
1301
- const handleOnSearchValueChange = (event) => setSearchValue(event.target.value);
1303
+ const handleOnSearchValueChange = (event) => {
1304
+ event.stopPropagation();
1305
+ setSearchValue(event.target.value);
1306
+ };
1302
1307
  const clearSearchValue = () => setSearchValue('');
1303
1308
  const handleOnClear = () => {
1304
1309
  if (readOnly)
@@ -1319,7 +1324,7 @@ const SelectInput = forwardRef((_a, ref) => {
1319
1324
  handleOnSelect(option.id);
1320
1325
  }, children: jsx("span", { children: renderItem(option, isNotNullOrUndefined(selectedMap[option.id])) }) }));
1321
1326
  }, [ItemComponent, handleOnSelect, multiple, renderItem, selectedMap]);
1322
- return (jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [jsx(DropdownMenu.Trigger, { className: cn('w-full', className), children: jsx(TextInput, Object.assign({ className: "[&>div>*]:cursor-pointer", inputClassName: "text-left" }, props, { value: text !== null && text !== void 0 ? text : '', clearable: clearable && !!selectedItems.length, onClear: handleOnClear, suffixIcon: ChevronDownIcon, onSuffixIconClick: () => setOpen((open) => !open), ref: ref, readOnly: true })) }), jsxs(DropdownMenu.Content, { className: "flex max-h-80 w-[calc(var(--radix-popper-anchor-width))] flex-col overflow-hidden", children: [search && (jsxs(Fragment, { children: [jsx(TextInput, { value: searchValue, placeholder: "Search...", size: props.size, onChange: handleOnSearchValueChange, clearable: !!searchValue.length, onClear: clearSearchValue }), jsx(DropdownMenu.Separator, { className: "w-full" })] })), filteredItems.length === 0 &&
1327
+ return (jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [jsx(DropdownMenu.Trigger, { className: cn('w-full', className), children: jsx(TextInput, Object.assign({ className: "[&>div>*]:cursor-pointer", inputClassName: "text-left" }, props, { value: text !== null && text !== void 0 ? text : '', clearable: clearable && !!selectedItems.length, onClear: handleOnClear, suffixIcon: ChevronDownIcon, onSuffixIconClick: () => setOpen((open) => !open), ref: ref, readOnly: true })) }), jsxs(DropdownMenu.Content, { className: "flex max-h-80 w-[calc(var(--radix-popper-anchor-width))] flex-col overflow-hidden", children: [search && (jsxs(Fragment, { children: [jsx(TextInput, { value: searchValue, placeholder: "Search...", size: props.size, onChange: handleOnSearchValueChange, onKeyUp: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), clearable: !!searchValue.length, onClear: clearSearchValue }), jsx(DropdownMenu.Separator, { className: "w-full" })] })), filteredItems.length === 0 &&
1323
1328
  (allowAddition && searchValue ? (jsxs("button", { className: "rounded bg-slate-100 py-1.5 text-center hover:bg-slate-200 dark:bg-slate-900/30 dark:hover:bg-slate-700/30", onClick: handleOnAddItemClicked, children: ["Add '", searchValue, "'"] })) : (jsx("div", { className: "py-1.5 text-center text-slate-500", children: "No items." }))), jsx(GroupComponent, { className: "flex flex-col gap-1 overflow-auto", value: !multiple && selectedItems.length ? String(selectedItems[0].id) : undefined, children: filteredItems.map((item, index) => item.group ? (jsxs(Flex, { className: "gap-1", direction: "column", fullWidth: true, children: [jsx(DropdownMenu.Label, { className: "sticky top-0 z-[51] w-full rounded-md border bg-white py-1 dark:bg-slate-900", children: item.label }), item.items.map((subItem) => (jsx(RenderOption, Object.assign({}, subItem), subItem.id))), index < filteredItems.length - 1 && (jsx("div", { className: "mb-1 h-px w-full bg-slate-200 dark:bg-slate-700" }))] }, item.id)) : (jsx(RenderOption, Object.assign({}, item), item.id))) })] })] }));
1324
1329
  });
1325
1330
  function isNotNullOrUndefined(value) {
@@ -2008,8 +2013,8 @@ const SidebarMenuSubItem = forwardRef((_a, ref) => {
2008
2013
  SidebarMenuSubItem.displayName = 'SidebarMenuSubItem';
2009
2014
  const SidebarMenuSubButton = forwardRef((_a, ref) => {
2010
2015
  var { asChild = false, size = 'md', isActive, className } = _a, props = __rest(_a, ["asChild", "size", "isActive", "className"]);
2011
- const Comp = asChild ? Slot : 'a';
2012
- return (jsx(Comp, Object.assign({ ref: ref, "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground', size === 'sm' && 'text-xs', size === 'md' && 'text-sm', 'group-data-[collapsible=icon]:hidden', className) }, props)));
2016
+ const Comp = asChild ? Slot : 'button';
2017
+ return (jsx(Comp, Object.assign({ ref: ref, "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 w-full min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground', size === 'sm' && 'text-xs', size === 'md' && 'text-sm', 'group-data-[collapsible=icon]:hidden', className) }, props)));
2013
2018
  });
2014
2019
  SidebarMenuSubButton.displayName = 'SidebarMenuSubButton';
2015
2020
  const Sidebar = Object.assign($Sidebar, {
@@ -2039,14 +2044,14 @@ const Sidebar = Object.assign($Sidebar, {
2039
2044
  const Navbar = ({ className, sidebarTriggerClassName, leftSlot, rightSlot, }) => (jsx(Block, { className: cn('border-b p-3 dark:border-slate-700', className), fullWidth: true, children: jsxs(Flex, { align: "center", justify: "between", children: [jsxs(Flex, { align: "center", children: [jsx(Sidebar.Trigger, { className: sidebarTriggerClassName }), leftSlot] }), rightSlot] }) }));
2040
2045
 
2041
2046
  const Layout = (_a) => {
2042
- var { children, className } = _a, _b = _a.sidebarProps, { basePath, header, items, extraContent, footer } = _b, sidebarProps = __rest(_b, ["basePath", "header", "items", "extraContent", "footer"]), { navbarProps } = _a;
2047
+ var { children, className } = _a, _b = _a.sidebarProps, { basePath, header, items, extraContent, footer } = _b, sidebarProps = __rest(_b, ["basePath", "header", "items", "extraContent", "footer"]), { navbarProps, NavLink, useLocation } = _a;
2043
2048
  return (jsxs(Flex, { className: "h-screen w-screen gap-0 text-black dark:bg-slate-900 dark:text-white", children: [jsxs(Sidebar, Object.assign({ collapsible: "icon" }, sidebarProps, { children: [header && (jsx(Sidebar.Header, { children: jsx(Sidebar.Menu, { children: jsx(Sidebar.MenuItem, { children: header }) }) })), jsxs(Sidebar.Content, { className: "gap-0", children: [items
2044
2049
  .filter((item) => !item.hidden)
2045
- .map((item, index) => item.type === 'item' ? (jsx(Sidebar.Group, { children: jsx(Sidebar.Menu, { children: jsx(RenderSideBarItem, Object.assign({ basePath: basePath }, item)) }) }, index)) : (jsxs(Sidebar.Group, { children: [item.title && jsx(Sidebar.GroupLabel, { children: item.title }), jsx(Sidebar.GroupContent, { children: jsx(Sidebar.Menu, { children: item.items
2050
+ .map((item, index) => item.type === 'item' ? (jsx(Sidebar.Group, { children: jsx(Sidebar.Menu, { children: jsx(RenderSideBarItem, Object.assign({ basePath: basePath }, item, { NavLink: NavLink, useLocation: useLocation })) }) }, index)) : (jsxs(Sidebar.Group, { children: [item.title && jsx(Sidebar.GroupLabel, { children: item.title }), jsx(Sidebar.GroupContent, { children: jsx(Sidebar.Menu, { children: item.items
2046
2051
  .filter((subItem) => !subItem.hidden)
2047
- .map((subItem, index) => (jsx(RenderSideBarItem, Object.assign({ basePath: basePath }, subItem), index))) }) })] }, index))), extraContent] }), footer && (jsx(Sidebar.Footer, { children: jsx(Sidebar.Menu, { children: jsx(Sidebar.MenuItem, { children: footer }) }) })), jsx(Sidebar.Rail, {})] })), jsxs(Flex, { className: "gap-0 overflow-hidden", direction: "column", fullHeight: true, fullWidth: true, children: [navbarProps && jsx(Navbar, Object.assign({}, navbarProps)), jsx(Flex, { className: cn('overflow-hidden p-3', className), direction: "column", fullWidth: true, fullHeight: true, children: children })] })] }));
2052
+ .map((subItem, index) => (jsx(RenderSideBarItem, Object.assign({ basePath: basePath }, subItem, { NavLink: NavLink, useLocation: useLocation }), index))) }) })] }, index))), extraContent] }), footer && (jsx(Sidebar.Footer, { children: jsx(Sidebar.Menu, { children: jsx(Sidebar.MenuItem, { children: footer }) }) })), jsx(Sidebar.Rail, {})] })), jsxs(Flex, { className: "gap-0 overflow-hidden", direction: "column", fullHeight: true, fullWidth: true, children: [navbarProps && jsx(Navbar, Object.assign({}, navbarProps)), jsx(Flex, { className: cn('overflow-hidden p-3', className), direction: "column", fullWidth: true, fullHeight: true, children: children })] })] }));
2048
2053
  };
2049
- const RenderSideBarItem = ({ basePath = '/', pathname, title, Icon, items, }) => {
2054
+ const RenderSideBarItem = ({ basePath = '/', pathname, title, Icon, items, NavLink, useLocation }) => {
2050
2055
  const location = useLocation();
2051
2056
  const { open } = useSidebar();
2052
2057
  const currentPath = useMemo(() => location.pathname.replace(basePath, '').replace(/^\/*/, ''), [basePath, location.pathname]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tw-react-components",
3
3
  "description": "A set of React components build with TailwindCSS to make a nice dashboard.",
4
- "version": "0.0.157",
4
+ "version": "0.0.159",
5
5
  "license": "MIT",
6
6
  "homepage": "https://bacali95.github.io/tw-react-components",
7
7
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { ButtonProps, ButtonVariant } from '../Button';
1
+ import type { ButtonProps, ButtonVariant } from '../Button';
2
2
  export type BadgeVariant = Exclude<ButtonVariant, 'text'>;
3
3
  export type BadgeProps = Omit<ButtonProps, 'variant'> & {
4
4
  variant?: BadgeVariant;
@@ -1,4 +1,4 @@
1
- import { ComponentProps, PropsWithoutRef } from 'react';
1
+ import type { ComponentProps, PropsWithoutRef } from 'react';
2
2
  export type BlockProps = PropsWithoutRef<ComponentProps<'div'> & {
3
3
  className?: string;
4
4
  centered?: boolean;
@@ -1,6 +1,6 @@
1
- import { LucideIcon } from 'lucide-react';
2
- import { ComponentProps, PropsWithoutRef } from 'react';
3
- import { Color, Size } from '../types';
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ComponentProps, PropsWithoutRef } from 'react';
3
+ import type { Color, Size } from '../types';
4
4
  export type ButtonVariant = 'filled' | 'outlined' | 'text';
5
5
  export type ButtonProps = PropsWithoutRef<ComponentProps<'button'>> & {
6
6
  size?: Size;
@@ -1,8 +1,8 @@
1
- import { LucideIcon } from 'lucide-react';
2
- import { ComponentProps, FC, ReactNode } from 'react';
3
- import { HintBadgeProps, HintDotProps } from '../Hint';
4
- import { PaginationProps } from '../Pagination';
5
- import { Color, Paths, ResolvePath } from '../types';
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ComponentProps, FC, ReactNode } from 'react';
3
+ import type { HintBadgeProps, HintDotProps } from '../Hint';
4
+ import type { PaginationProps } from '../Pagination';
5
+ import type { Color, Paths, ResolvePath } from '../types';
6
6
  export type DataTableColumn<T, Field extends Paths<T> = Paths<T>> = {
7
7
  className?: string;
8
8
  header: ReactNode;
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren, ReactNode } from 'react';
1
+ import type { FC, PropsWithChildren, ReactNode } from 'react';
2
2
  type Props = {
3
3
  open: boolean;
4
4
  title: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import * as DialogPrimitive from '@radix-ui/react-dialog';
2
- import { FC, HTMLAttributes } from 'react';
2
+ import type { FC, HTMLAttributes } from 'react';
3
3
  export declare const Dialog: FC<DialogPrimitive.DialogProps> & {
4
4
  Portal: FC<DialogPrimitive.DialogPortalProps>;
5
5
  Overlay: import("react").ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,7 +1,7 @@
1
- import { PropsWithChildren, ReactNode } from 'react';
2
- import { FieldValues, SubmitErrorHandler, SubmitHandler, UseFormReturn } from 'react-hook-form';
1
+ import type { PropsWithChildren, ReactNode } from 'react';
2
+ import type { FieldValues, SubmitErrorHandler, SubmitHandler, UseFormReturn } from 'react-hook-form';
3
3
  import { Sheet } from '../Sheet';
4
- import { Dialog } from './Dialog';
4
+ import type { Dialog } from './Dialog';
5
5
  type Props<T extends FieldValues> = {
6
6
  className?: string;
7
7
  formClassName?: string;
@@ -1,4 +1,4 @@
1
- import { ListSorterItem, ListSorterProps } from '../ListSorter';
1
+ import type { ListSorterItem, ListSorterProps } from '../ListSorter';
2
2
  export type ListSorterDialogProps<T extends ListSorterItem> = {
3
3
  className?: string;
4
4
  open: boolean;
@@ -1,4 +1,4 @@
1
- import { FC, ReactNode } from 'react';
1
+ import type { FC, ReactNode } from 'react';
2
2
  type Props = {
3
3
  open: boolean;
4
4
  title: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
2
- import { HTMLAttributes } from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
3
  export declare const DropdownMenu: import("react").FC<DropdownMenuPrimitive.DropdownMenuProps> & {
4
4
  Trigger: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
5
5
  Content: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,4 @@
1
- import { BlockProps } from '../Block';
1
+ import type { BlockProps } from '../Block';
2
2
  type Direction = 'row' | 'column';
3
3
  type Position = 'start' | 'center' | 'end';
4
4
  export type FlexProps = BlockProps & {
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  export type FormGroupProps = PropsWithChildren<{
3
3
  className?: string;
4
4
  label: string;
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren, ReactNode } from 'react';
1
+ import type { FC, PropsWithChildren, ReactNode } from 'react';
2
2
  type Props = {
3
3
  className?: string;
4
4
  description?: ReactNode;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  export type View = 'days' | 'months' | 'years';
3
3
  type DateSelectorProps = {
4
4
  date: Date;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  type DaysViewProps = {
3
3
  date: Date;
4
4
  value?: string | Date | null;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  type MonthsViewProps = {
3
3
  date: Date;
4
4
  value?: string | Date | null;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  type TimeSelectorProps = {
3
3
  date: Date;
4
4
  step?: number;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  type YearsViewProps = {
3
3
  date: Date;
4
4
  value?: string | Date | null;
@@ -1,4 +1,4 @@
1
- import { BasicInputProps } from '../../primitive';
1
+ import type { BasicInputProps } from '../../primitive';
2
2
  export type DateTimeInputType = 'date' | 'time' | 'datetime-local';
3
3
  export type DateTimeInputProps = {
4
4
  value?: string | Date | null;
@@ -1,4 +1,4 @@
1
- import { BasicInputProps } from '../primitive';
1
+ import type { BasicInputProps } from '../primitive';
2
2
  export type FileInputProps = {
3
3
  value?: string | null;
4
4
  onChange?: (item?: string) => void;
@@ -1,5 +1,5 @@
1
- import { ForwardedRef, JSX, ReactNode, RefObject } from 'react';
2
- import { BasicInputProps } from '../../primitive';
1
+ import type { ForwardedRef, JSX, ReactNode, RefObject } from 'react';
2
+ import type { BasicInputProps } from '../../primitive';
3
3
  export type SelectInputType = 'select';
4
4
  export type SelectItem<T, Group extends boolean = false> = {
5
5
  id: string | number;
@@ -1,5 +1,5 @@
1
- import { ComponentProps, FC, MouseEvent, PropsWithChildren, ReactNode } from 'react';
2
- import { Size } from '../../../types';
1
+ import type { ComponentProps, FC, MouseEvent, PropsWithChildren, ReactNode } from 'react';
2
+ import type { Size } from '../../../types';
3
3
  export type InputType = ComponentProps<'input'>['type'] | 'textarea';
4
4
  export type BasicInputProps<Type extends InputType> = {
5
5
  inputClassName?: string;
@@ -1,3 +1,3 @@
1
- import { BasicInputProps } from './BasicInput';
1
+ import type { BasicInputProps } from './BasicInput';
2
2
  export type CheckboxInputProps = Omit<BasicInputProps<'checkbox'>, 'type'>;
3
3
  export declare const CheckboxInput: import("react").ForwardRefExoticComponent<CheckboxInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,3 +1,3 @@
1
- import { BasicInputProps } from './BasicInput';
1
+ import type { BasicInputProps } from './BasicInput';
2
2
  export type EmailInputProps = Omit<BasicInputProps<'email'>, 'type'>;
3
3
  export declare const EmailInput: import("react").ForwardRefExoticComponent<EmailInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { BasicInputProps } from './BasicInput';
1
+ import type { ReactNode } from 'react';
2
+ import type { BasicInputProps } from './BasicInput';
3
3
  export type NumberInputProps = Omit<BasicInputProps<'number'>, 'type'> & {
4
4
  unit?: ReactNode;
5
5
  };
@@ -1,3 +1,3 @@
1
- import { BasicInputProps } from './BasicInput';
1
+ import type { BasicInputProps } from './BasicInput';
2
2
  export type PasswordInputProps = Omit<BasicInputProps<'number'>, 'type'>;
3
3
  export declare const PasswordInput: import("react").ForwardRefExoticComponent<PasswordInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,3 +1,3 @@
1
- import { BasicInputProps } from './BasicInput';
1
+ import type { BasicInputProps } from './BasicInput';
2
2
  export type TextInputProps = Omit<BasicInputProps<'text'>, 'type'>;
3
3
  export declare const TextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,3 +1,3 @@
1
- import { BasicInputProps } from './BasicInput';
1
+ import type { BasicInputProps } from './BasicInput';
2
2
  export type TextareaInputProps = Omit<BasicInputProps<'textarea'>, 'type'>;
3
3
  export declare const TextareaInput: import("react").ForwardRefExoticComponent<TextareaInputProps & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -1,7 +1,7 @@
1
- import { ForwardRefExoticComponent } from 'react';
2
- import { ControllerRenderProps, Validate } from 'react-hook-form';
3
- import { DateTimeInputProps, DateTimeInputType, FileInputProps, SelectInputProps, SelectInputType } from './custom';
4
- import { BasicInputProps, CheckboxInputProps, EmailInputProps, InputType, NumberInputProps, PasswordInputProps, TextInputProps, TextareaInputProps } from './primitive';
1
+ import type { ForwardRefExoticComponent } from 'react';
2
+ import type { ControllerRenderProps, Validate } from 'react-hook-form';
3
+ import type { DateTimeInputProps, DateTimeInputType, FileInputProps, SelectInputProps, SelectInputType } from './custom';
4
+ import type { BasicInputProps, CheckboxInputProps, EmailInputProps, InputType, NumberInputProps, PasswordInputProps, TextInputProps, TextareaInputProps } from './primitive';
5
5
  export type WithFormProps<Type extends InputType | SelectInputType, Props = Type extends DateTimeInputType ? DateTimeInputProps : Type extends SelectInputType ? SelectInputProps : Omit<BasicInputProps<Type>, 'type'>> = {
6
6
  name: string;
7
7
  pattern?: RegExp;
@@ -1,5 +1,5 @@
1
- import { BadgeProps, BadgeVariant } from '../Badge';
2
- import { Color, Size } from '../types';
1
+ import type { BadgeProps, BadgeVariant } from '../Badge';
2
+ import type { Color, Size } from '../types';
3
3
  export type HintPlacement = 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
4
4
  export type HintVariant = BadgeVariant;
5
5
  export type HintDotProps = {
@@ -1,6 +1,7 @@
1
- import { LucideIcon } from 'lucide-react';
2
- import { ComponentProps, FC, PropsWithChildren, ReactNode } from 'react';
3
- import { NavbarProps } from '../Navbar';
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ComponentProps, FC, PropsWithChildren, ReactNode } from 'react';
3
+ import type { NavLinkProps, useLocation } from 'react-router';
4
+ import type { NavbarProps } from '../Navbar';
4
5
  import { Sidebar } from '../Sidebar';
5
6
  export type SidebarItem = {
6
7
  pathname: string;
@@ -27,6 +28,8 @@ type Props = {
27
28
  className?: string;
28
29
  sidebarProps: SidebarProps;
29
30
  navbarProps?: NavbarProps;
31
+ NavLink: FC<NavLinkProps>;
32
+ useLocation: typeof useLocation;
30
33
  };
31
34
  export declare const Layout: FC<PropsWithChildren<Props>>;
32
35
  export {};
@@ -1,5 +1,5 @@
1
- import { LucideIcon } from 'lucide-react';
2
- import { Size } from '../types';
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { Size } from '../types';
3
3
  export declare const List: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
4
4
  Item: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
5
  size?: Size;
@@ -1,5 +1,5 @@
1
- import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
2
- import { ReactElement, ReactNode } from 'react';
1
+ import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
2
+ import type { ReactElement, ReactNode } from 'react';
3
3
  export type ListSorterItem = number | string | boolean | Record<'rank', number>;
4
4
  export type ListSorterProps<T extends ListSorterItem> = {
5
5
  className?: string;
@@ -1,4 +1,4 @@
1
- import { FC, ReactNode } from 'react';
1
+ import type { FC, ReactNode } from 'react';
2
2
  export type NavbarProps = {
3
3
  className?: string;
4
4
  sidebarTriggerClassName?: string;
@@ -1,4 +1,4 @@
1
- import { Dispatch, FC, SetStateAction } from 'react';
1
+ import type { Dispatch, FC, SetStateAction } from 'react';
2
2
  export type PaginationProps = {
3
3
  disabled?: boolean;
4
4
  pageSize?: number;
@@ -1,6 +1,6 @@
1
1
  import * as SheetPrimitive from '@radix-ui/react-dialog';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
- import { ComponentPropsWithoutRef, FC, HTMLAttributes } from 'react';
3
+ import type { ComponentPropsWithoutRef, FC, HTMLAttributes } from 'react';
4
4
  declare const sheetVariants: (props?: ({
5
5
  side?: "top" | "bottom" | "left" | "right" | null | undefined;
6
6
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -1,5 +1,5 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
- import { ComponentProps } from 'react';
2
+ import type { ComponentProps } from 'react';
3
3
  import { Tooltip } from '../Tooltip';
4
4
  export declare const SIDEBAR_COOKIE_NAME = "sidebar:state";
5
5
  export declare const SIDEBAR_COOKIE_MAX_AGE: number;
@@ -72,11 +72,11 @@ export declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<imp
72
72
  showIcon?: boolean;
73
73
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
74
74
  MenuSub: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
75
- MenuSubButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLAnchorElement> & import("react").AnchorHTMLAttributes<HTMLAnchorElement> & {
75
+ MenuSubButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
76
76
  asChild?: boolean;
77
77
  size?: "sm" | "md";
78
78
  isActive?: boolean;
79
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
79
+ }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
80
80
  MenuSubItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
81
81
  Rail: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
82
82
  Separator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
- import { FC, HTMLAttributes } from 'react';
1
+ import type { FC, HTMLAttributes } from 'react';
2
2
  export declare const Skeleton: FC<HTMLAttributes<HTMLDivElement>>;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  type Props = {
3
3
  className?: string;
4
4
  fullScreen?: boolean;
@@ -1,5 +1,5 @@
1
1
  import * as SwitchPrimitives from '@radix-ui/react-switch';
2
- import { ComponentProps, ComponentPropsWithoutRef } from 'react';
2
+ import type { ComponentProps, ComponentPropsWithoutRef } from 'react';
3
3
  export type SwitchProps = ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {
4
4
  thumbProps?: ComponentProps<typeof SwitchPrimitives.Thumb>;
5
5
  };
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  export declare const Table: FC<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>> & {
3
3
  Head: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
4
4
  HeadCell: FC<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  type Props = {
3
3
  className?: string;
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
- import { FC, PropsWithChildren, ReactNode } from 'react';
2
+ import type { FC, PropsWithChildren, ReactNode } from 'react';
3
3
  export type TooltipProps = PropsWithChildren<{
4
4
  className?: string;
5
5
  content: ReactNode;
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  export type ThemeState = 'dark' | 'light' | 'system';
3
3
  export type LayoutContext = {
4
4
  theme: ThemeState;
@@ -1,2 +1,2 @@
1
- import { OpUnitType } from 'dayjs';
1
+ import type { OpUnitType } from 'dayjs';
2
2
  export declare function compareDates(date1: Date, date2: Date, startOf?: OpUnitType): number;
@@ -1,2 +1,2 @@
1
- import { LegacyRef, MutableRefObject, RefCallback } from 'react';
1
+ import type { LegacyRef, MutableRefObject, RefCallback } from 'react';
2
2
  export declare function mergeRefs<T = any>(refs: Array<MutableRefObject<T> | LegacyRef<T> | undefined | null>): RefCallback<T>;
@@ -1,4 +1,4 @@
1
- import { RefObject } from 'react';
1
+ import type { RefObject } from 'react';
2
2
  type SwipeDirection = 'up' | 'left' | 'bottom' | 'right';
3
3
  export declare function useOnSwipe(element: RefObject<HTMLElement>, onSwipe: (direction: SwipeDirection) => any | false, minSwipeDistance?: number): void;
4
4
  export {};
@@ -1,2 +1,2 @@
1
- import { RefObject } from 'react';
1
+ import type { RefObject } from 'react';
2
2
  export declare function useOutsideClick(ref: RefObject<HTMLDivElement>, callback: () => void): void;