@tmlmobilidade/ui 0.0.4

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 (106) hide show
  1. package/README.md +321 -0
  2. package/dist/cjs/index.js +1551 -0
  3. package/dist/cjs/index.js.map +1 -0
  4. package/dist/cjs/types/scripts/build.d.ts +1 -0
  5. package/dist/cjs/types/scripts/rollup/compile.d.ts +3 -0
  6. package/dist/cjs/types/scripts/rollup/config.d.ts +3 -0
  7. package/dist/cjs/types/scripts/watch.d.ts +1 -0
  8. package/dist/cjs/types/src/components/authentication/LoginForm/index.d.ts +45 -0
  9. package/dist/cjs/types/src/components/authentication/LoginForm/use-login.d.ts +8 -0
  10. package/dist/cjs/types/src/components/authentication/index.d.ts +1 -0
  11. package/dist/cjs/types/src/components/common/ActionIcon/index.d.ts +6 -0
  12. package/dist/cjs/types/src/components/common/AppLogos/index.d.ts +5 -0
  13. package/dist/cjs/types/src/components/common/Badge/index.d.ts +13 -0
  14. package/dist/cjs/types/src/components/common/Button/index.d.ts +12 -0
  15. package/dist/cjs/types/src/components/common/Checkbox/index.d.ts +3 -0
  16. package/dist/cjs/types/src/components/common/Combobox/index.d.ts +13 -0
  17. package/dist/cjs/types/src/components/common/Menu/index.d.ts +16 -0
  18. package/dist/cjs/types/src/components/common/PasswordInput/index.d.ts +6 -0
  19. package/dist/cjs/types/src/components/common/SegmentedControl/index.d.ts +4 -0
  20. package/dist/cjs/types/src/components/common/Slider/index.d.ts +5 -0
  21. package/dist/cjs/types/src/components/common/Switch/index.d.ts +5 -0
  22. package/dist/cjs/types/src/components/common/TextArea/index.d.ts +4 -0
  23. package/dist/cjs/types/src/components/common/TextInput/index.d.ts +6 -0
  24. package/dist/cjs/types/src/components/common/Tooltip/index.d.ts +3 -0
  25. package/dist/cjs/types/src/components/common/index.d.ts +13 -0
  26. package/dist/cjs/types/src/components/datatable/DataTable/index.d.ts +2 -0
  27. package/dist/cjs/types/src/components/datatable/DataTableContext/index.d.ts +30 -0
  28. package/dist/cjs/types/src/components/datatable/DataTableFilter/index.d.ts +1 -0
  29. package/dist/cjs/types/src/components/datatable/DataTableHeader/index.d.ts +2 -0
  30. package/dist/cjs/types/src/components/datatable/DataTableRow/index.d.ts +2 -0
  31. package/dist/cjs/types/src/components/datatable/DataTableTitle/index.d.ts +2 -0
  32. package/dist/cjs/types/src/components/datatable/datatable.type.d.ts +125 -0
  33. package/dist/cjs/types/src/components/datatable/index.d.ts +2 -0
  34. package/dist/cjs/types/src/components/index.d.ts +5 -0
  35. package/dist/cjs/types/src/components/layout/Grid/index.d.ts +8 -0
  36. package/dist/cjs/types/src/components/layout/Section/index.d.ts +10 -0
  37. package/dist/cjs/types/src/components/layout/Sidebar/index.d.ts +19 -0
  38. package/dist/cjs/types/src/components/layout/Spacer/index.d.ts +7 -0
  39. package/dist/cjs/types/src/components/layout/Surface/index.d.ts +19 -0
  40. package/dist/cjs/types/src/components/layout/index.d.ts +5 -0
  41. package/dist/cjs/types/src/components/theme/ThemeProvider/index.d.ts +12 -0
  42. package/dist/cjs/types/src/components/theme/ThemeProvider/use-theme.d.ts +2 -0
  43. package/dist/cjs/types/src/components/theme/ThemeSwitcher/index.d.ts +5 -0
  44. package/dist/cjs/types/src/components/theme/Themer/index.d.ts +26 -0
  45. package/dist/cjs/types/src/components/theme/index.d.ts +4 -0
  46. package/dist/cjs/types/src/hooks/use-is-active-page.d.ts +1 -0
  47. package/dist/cjs/types/src/hooks/use-screen-size.d.ts +1 -0
  48. package/dist/cjs/types/src/hooks/use-search-query.d.ts +8 -0
  49. package/dist/cjs/types/src/index.d.ts +4 -0
  50. package/dist/cjs/types/src/lib/getCssVariableValue.d.ts +1 -0
  51. package/dist/cjs/types/src/lib/utils.d.ts +53 -0
  52. package/dist/cjs/types/src/styles/theme.d.ts +3 -0
  53. package/dist/esm/index.js +1500 -0
  54. package/dist/esm/index.js.map +1 -0
  55. package/dist/esm/types/scripts/build.d.ts +1 -0
  56. package/dist/esm/types/scripts/rollup/compile.d.ts +3 -0
  57. package/dist/esm/types/scripts/rollup/config.d.ts +3 -0
  58. package/dist/esm/types/scripts/watch.d.ts +1 -0
  59. package/dist/esm/types/src/components/authentication/LoginForm/index.d.ts +45 -0
  60. package/dist/esm/types/src/components/authentication/LoginForm/use-login.d.ts +8 -0
  61. package/dist/esm/types/src/components/authentication/index.d.ts +1 -0
  62. package/dist/esm/types/src/components/common/ActionIcon/index.d.ts +6 -0
  63. package/dist/esm/types/src/components/common/AppLogos/index.d.ts +5 -0
  64. package/dist/esm/types/src/components/common/Badge/index.d.ts +13 -0
  65. package/dist/esm/types/src/components/common/Button/index.d.ts +12 -0
  66. package/dist/esm/types/src/components/common/Checkbox/index.d.ts +3 -0
  67. package/dist/esm/types/src/components/common/Combobox/index.d.ts +13 -0
  68. package/dist/esm/types/src/components/common/Menu/index.d.ts +16 -0
  69. package/dist/esm/types/src/components/common/PasswordInput/index.d.ts +6 -0
  70. package/dist/esm/types/src/components/common/SegmentedControl/index.d.ts +4 -0
  71. package/dist/esm/types/src/components/common/Slider/index.d.ts +5 -0
  72. package/dist/esm/types/src/components/common/Switch/index.d.ts +5 -0
  73. package/dist/esm/types/src/components/common/TextArea/index.d.ts +4 -0
  74. package/dist/esm/types/src/components/common/TextInput/index.d.ts +6 -0
  75. package/dist/esm/types/src/components/common/Tooltip/index.d.ts +3 -0
  76. package/dist/esm/types/src/components/common/index.d.ts +13 -0
  77. package/dist/esm/types/src/components/datatable/DataTable/index.d.ts +2 -0
  78. package/dist/esm/types/src/components/datatable/DataTableContext/index.d.ts +30 -0
  79. package/dist/esm/types/src/components/datatable/DataTableFilter/index.d.ts +1 -0
  80. package/dist/esm/types/src/components/datatable/DataTableHeader/index.d.ts +2 -0
  81. package/dist/esm/types/src/components/datatable/DataTableRow/index.d.ts +2 -0
  82. package/dist/esm/types/src/components/datatable/DataTableTitle/index.d.ts +2 -0
  83. package/dist/esm/types/src/components/datatable/datatable.type.d.ts +125 -0
  84. package/dist/esm/types/src/components/datatable/index.d.ts +2 -0
  85. package/dist/esm/types/src/components/index.d.ts +5 -0
  86. package/dist/esm/types/src/components/layout/Grid/index.d.ts +8 -0
  87. package/dist/esm/types/src/components/layout/Section/index.d.ts +10 -0
  88. package/dist/esm/types/src/components/layout/Sidebar/index.d.ts +19 -0
  89. package/dist/esm/types/src/components/layout/Spacer/index.d.ts +7 -0
  90. package/dist/esm/types/src/components/layout/Surface/index.d.ts +19 -0
  91. package/dist/esm/types/src/components/layout/index.d.ts +5 -0
  92. package/dist/esm/types/src/components/theme/ThemeProvider/index.d.ts +12 -0
  93. package/dist/esm/types/src/components/theme/ThemeProvider/use-theme.d.ts +2 -0
  94. package/dist/esm/types/src/components/theme/ThemeSwitcher/index.d.ts +5 -0
  95. package/dist/esm/types/src/components/theme/Themer/index.d.ts +26 -0
  96. package/dist/esm/types/src/components/theme/index.d.ts +4 -0
  97. package/dist/esm/types/src/hooks/use-is-active-page.d.ts +1 -0
  98. package/dist/esm/types/src/hooks/use-screen-size.d.ts +1 -0
  99. package/dist/esm/types/src/hooks/use-search-query.d.ts +8 -0
  100. package/dist/esm/types/src/index.d.ts +4 -0
  101. package/dist/esm/types/src/lib/getCssVariableValue.d.ts +1 -0
  102. package/dist/esm/types/src/lib/utils.d.ts +53 -0
  103. package/dist/esm/types/src/styles/theme.d.ts +3 -0
  104. package/dist/index.d.ts +379 -0
  105. package/dist/styles.css +9495 -0
  106. package/package.json +87 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { RollupOptions } from 'rollup';
2
+ export declare function compile(configs: RollupOptions | RollupOptions[]): Promise<import("rollup").RollupOutput[][]>;
3
+ export default compile;
@@ -0,0 +1,3 @@
1
+ import { RollupOptions } from "rollup";
2
+ export declare function rollupConfig(): RollupOptions[];
3
+ export default rollupConfig;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ interface LoginFormProps {
2
+ /**
3
+ * Optional title for the login form.
4
+ */
5
+ title: string;
6
+ /**
7
+ * Optional description for the login form.
8
+ */
9
+ description: string;
10
+ /**
11
+ * Optional label for the login button.
12
+ * @default "Login"
13
+ */
14
+ buttonLabel?: string;
15
+ /**
16
+ * Optional icon to be rendered next to the button label.
17
+ * @default <IconArrowRight size={20} />
18
+ */
19
+ buttonIcon?: React.ReactNode;
20
+ /**
21
+ * Optional React node to be rendered as footer links in the form.
22
+ */
23
+ footerLinks?: React.ReactNode[];
24
+ /**
25
+ * The URL to be used for the login request.
26
+ */
27
+ authUrl: string;
28
+ /**
29
+ * Optional class names for various elements within the LoginForm component.
30
+ */
31
+ classNames?: {
32
+ root?: string;
33
+ header?: string;
34
+ headerContent?: string;
35
+ headerTitle?: string;
36
+ headerDescription?: string;
37
+ headerImage?: string;
38
+ form?: string;
39
+ formFooter?: string;
40
+ formFooterLinks?: string;
41
+ formButton?: string;
42
+ };
43
+ }
44
+ export default function LoginForm({ authUrl, classNames, footerLinks, title, description, buttonLabel, buttonIcon, }: LoginFormProps): import("react/jsx-runtime").JSX.Element;
45
+ export {};
@@ -0,0 +1,8 @@
1
+ import { LoginDto } from '@tmlmobilidade/core-types';
2
+ interface UseLoginReturn {
3
+ login: (credentials: LoginDto) => Promise<void>;
4
+ loading: boolean;
5
+ error: string | null;
6
+ }
7
+ export declare function useLogin(authUrl: string): UseLoginReturn;
8
+ export {};
@@ -0,0 +1 @@
1
+ export { default as LoginForm } from './LoginForm';
@@ -0,0 +1,6 @@
1
+ import { ActionIconProps as ActionIconMantineProps } from '@mantine/core';
2
+ export interface ActionIconProps extends Omit<ActionIconMantineProps, 'size'> {
3
+ disabled?: boolean;
4
+ variant?: 'primary' | 'secondary' | 'muted' | 'danger' | 'info' | 'success' | 'warning' | 'active';
5
+ }
6
+ export default function ActionIcon({ children, className, disabled, variant, ...props }: ActionIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare function CMIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function CMLogo(): import("react/jsx-runtime").JSX.Element;
3
+ export declare function TMLogoLight(): import("react/jsx-runtime").JSX.Element;
4
+ export declare function TMLogoDark(): import("react/jsx-runtime").JSX.Element;
5
+ export declare function TMLogo(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { BadgeProps as MantineBadgeProps } from '@mantine/core';
2
+ import React from 'react';
3
+ export interface BadgeProps extends MantineBadgeProps {
4
+ icon?: React.ReactNode;
5
+ children?: React.ReactNode;
6
+ type?: 'tag' | 'pill';
7
+ variant?: 'primary' | 'secondary' | 'muted' | 'danger' | 'info' | 'success' | 'warning' | 'active' | 'disabled';
8
+ filled?: boolean;
9
+ disabled?: boolean;
10
+ fullWidth?: boolean;
11
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
12
+ }
13
+ export default function Badge({ className, icon, children, variant, filled, fullWidth, disabled, type, size, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { ButtonProps as MantineButtonProps } from '@mantine/core';
2
+ import React from 'react';
3
+ export interface ButtonProps extends MantineButtonProps {
4
+ icon?: React.ReactNode;
5
+ children?: React.ReactNode;
6
+ onClick?: () => void;
7
+ target?: string;
8
+ type?: 'button' | 'reset' | 'submit';
9
+ variant?: 'primary' | 'secondary' | 'muted' | 'danger' | 'info' | 'success' | 'warning' | 'active';
10
+ textTransform?: 'capitalize' | 'lowercase' | 'uppercase' | 'none';
11
+ }
12
+ export default function Component({ className, icon, children, onClick, target, type, variant, disabled, textTransform, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { CheckboxProps as MantineCheckboxProps } from "@mantine/core";
2
+ export type CheckboxProps = MantineCheckboxProps;
3
+ export default function Checkbox(props: CheckboxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { ComboboxProps } from '@mantine/core';
2
+ export interface Props extends ComboboxProps {
3
+ multiple?: boolean;
4
+ searchable?: boolean;
5
+ autoComplete?: boolean;
6
+ onChange?: (value: string | string[]) => void;
7
+ value?: string | string[];
8
+ clearable?: boolean;
9
+ data: string[];
10
+ label?: string;
11
+ description?: string;
12
+ }
13
+ export default function Component({ multiple, searchable, autoComplete, onChange, data, clearable, label, description, ...props }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { MenuProps as MantineMenuProps, MenuTargetProps as MantineMenuTargetProps, MenuDropdownProps as MantineMenuDropdownProps, MenuItemProps as MantineMenuItemProps, MenuDividerProps as MantineMenuDividerProps, MenuLabelProps as MantineMenuLabelProps } from '@mantine/core';
2
+ export type MenuProps = MantineMenuProps;
3
+ export type MenuTargetProps = MantineMenuTargetProps;
4
+ export type MenuDropdownProps = MantineMenuDropdownProps;
5
+ export type MenuItemProps = MantineMenuItemProps;
6
+ export type MenuDividerProps = MantineMenuDividerProps;
7
+ export type MenuLabelProps = MantineMenuLabelProps;
8
+ declare function Menu(props: MenuProps): import("react/jsx-runtime").JSX.Element;
9
+ declare namespace Menu {
10
+ var Target: (props: MenuTargetProps) => import("react/jsx-runtime").JSX.Element;
11
+ var Dropdown: (props: MenuDropdownProps) => import("react/jsx-runtime").JSX.Element;
12
+ var Item: (props: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
13
+ var Divider: (props: MenuDividerProps) => import("react/jsx-runtime").JSX.Element;
14
+ var Label: (props: MenuLabelProps) => import("react/jsx-runtime").JSX.Element;
15
+ }
16
+ export default Menu;
@@ -0,0 +1,6 @@
1
+ import { PasswordInputProps as MantinePasswordInputProps } from '@mantine/core';
2
+ export interface PasswordInputProps extends MantinePasswordInputProps {
3
+ tooltip?: string;
4
+ validation?: RegExp;
5
+ }
6
+ export default function Component({ error, validation, value, classNames, ...props }: PasswordInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { SegmentedControlProps as MantineSegmentedControlProps } from '@mantine/core';
2
+ export interface SegmentedControlProps extends MantineSegmentedControlProps {
3
+ }
4
+ export default function SegmentedControl({ ...props }: SegmentedControlProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { SliderProps as MantineSliderProps } from '@mantine/core';
2
+ interface SliderProps extends MantineSliderProps {
3
+ }
4
+ export default function Slider({ classNames, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ import { SwitchProps as MantineSwitchProps } from '@mantine/core';
2
+ interface SwitchProps extends MantineSwitchProps {
3
+ }
4
+ export default function Switch({ classNames, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,4 @@
1
+ import { TextareaProps as MantineTextareaProps } from '@mantine/core';
2
+ export interface TextAreaProps extends MantineTextareaProps {
3
+ }
4
+ export default function Component({ classNames, ...props }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { TextInputProps as MantineTextInputProps } from '@mantine/core';
2
+ export interface TextInputProps extends MantineTextInputProps {
3
+ tooltip?: string;
4
+ validation?: RegExp;
5
+ }
6
+ export default function Component({ error, validation, value, classNames, ...props }: TextInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TooltipProps as MantineTooltipProps } from "@mantine/core";
2
+ export type TooltipProps = MantineTooltipProps;
3
+ export default function Tooltip({ children, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export { default as Button } from './Button';
2
+ export { default as Checkbox } from './Checkbox';
3
+ export { default as SegmentedControl } from './SegmentedControl';
4
+ export { default as TextInput } from './TextInput';
5
+ export { default as PasswordInput } from './PasswordInput';
6
+ export { default as TextArea } from './TextArea';
7
+ export { default as Combobox } from './Combobox';
8
+ export { default as Badge } from './Badge';
9
+ export { default as Tooltip } from './Tooltip';
10
+ export { default as Switch } from './Switch';
11
+ export { default as Slider } from './Slider';
12
+ export { default as ActionIcon } from './ActionIcon';
13
+ export { default as Menu } from './Menu';
@@ -0,0 +1,2 @@
1
+ import { DataTableProps } from '../datatable.type';
2
+ export default function DataTable<T>({ records, ...props }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { ReactNode } from 'react';
2
+ import { DataTableSearchProps } from '../datatable.type';
3
+ interface DataTableContextType<T> {
4
+ actions: {
5
+ clearSearchQuery: () => void;
6
+ handleSort: (accessor: string) => void;
7
+ updateFilterBySearchQuery: (query: string) => void;
8
+ };
9
+ data: {
10
+ initialRecords: T[];
11
+ records: T[];
12
+ };
13
+ filters: {
14
+ searchQuery?: string;
15
+ sortState: null | SortState;
16
+ };
17
+ }
18
+ interface DataTableProviderProps<T> {
19
+ children: ReactNode;
20
+ initialRecords: T[];
21
+ searchAccessors: DataTableSearchProps<T>['accessors'];
22
+ }
23
+ type SortOrder = 'asc' | 'desc' | null;
24
+ interface SortState {
25
+ accessor: string;
26
+ order: SortOrder;
27
+ }
28
+ export declare function DataTableProvider<T>({ children, initialRecords, searchAccessors }: DataTableProviderProps<T>): import("react/jsx-runtime").JSX.Element;
29
+ export declare function useDataTableContext<T>(): DataTableContextType<T>;
30
+ export {};
@@ -0,0 +1 @@
1
+ export default function DataTableFilter(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DataTableHeaderProps } from '../datatable.type';
2
+ export default function DataTableHeader<T = Record<string, unknown>>({ columns, }: DataTableHeaderProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DataTableRowProps } from '../datatable.type';
2
+ export default function DataTableRow<T = Record<string, unknown>>({ columns, record, }: DataTableRowProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DataTableTitleProps } from '../datatable.type';
2
+ export default function DataTableTitle<T>({ search, title }: DataTableTitleProps<T>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,125 @@
1
+ export interface DataTableColumn<T> {
2
+ /**
3
+ * Column accessor.
4
+ * You can use dot-notation for nested objects property drilling.
5
+ * (i.e. `department.name` or `department.company.name`)
6
+ */
7
+ accessor: keyof T | (string & {});
8
+ /**
9
+ * Whether the column is hidden.
10
+ * @default false
11
+ */
12
+ hidden?: boolean;
13
+ /**
14
+ * Custom cell data render function.
15
+ * Accepts the current record and its index in `records` as arguments and returns a React node
16
+ * (remember that a string is a valid React node too).
17
+ *
18
+ * Will override the default render function for this column.
19
+ */
20
+ render?: (record: T) => React.ReactNode;
21
+ /**
22
+ * Whether the column is sortable.
23
+ * @default false
24
+ */
25
+ sortable?: boolean;
26
+ /**
27
+ * The key to be used for sorting.
28
+ * If not provided, the column accessor will be used.
29
+ */
30
+ sortKey?: string;
31
+ /**
32
+ * Optional column header title.
33
+ * If not present, one will be generated by "humanizing" the provided column accessor.
34
+ * (i.e. `firstName` -> `First name`; `user.firstName` -> `User first name`)
35
+ */
36
+ title?: React.ReactNode | string;
37
+ }
38
+ export interface DataTableColumnProps<T = Record<string, unknown>> {
39
+ /**
40
+ * The columns to be displayed in the table.
41
+ */
42
+ columns: DataTableColumn<T>[];
43
+ }
44
+ export interface DataTableHeaderProps<T = Record<string, unknown>> {
45
+ /**
46
+ * The columns to be displayed in the table header.
47
+ */
48
+ columns: DataTableColumn<T>[];
49
+ }
50
+ export interface DataTableProps<T> {
51
+ /**
52
+ * The classnames to be applied to the table.
53
+ */
54
+ classnames?: Partial<Record<'body' | 'cell' | 'footer' | 'header' | 'root' | 'row' | 'table' | 'tableWrapper', string>>;
55
+ /**
56
+ * The column configuration for the table.
57
+ */
58
+ columns: DataTableColumn<T>[];
59
+ /**
60
+ * The maximum height of the table in pixels.
61
+ * @default 100%
62
+ */
63
+ maxHeight?: number;
64
+ /**
65
+ * The data to be displayed in the table.
66
+ */
67
+ records: T[];
68
+ /**
69
+ * Whether the table should have a search input.
70
+ * @default false
71
+ */
72
+ search?: DataTableSearchProps<T>;
73
+ /**
74
+ * The title of the table.
75
+ */
76
+ title?: string;
77
+ }
78
+ export interface DataTableRowProps<T = Record<string, unknown>> {
79
+ /**
80
+ * The column configuration for the row.
81
+ */
82
+ columns: DataTableColumn<T>[];
83
+ /**
84
+ * The data record for the row.
85
+ */
86
+ record: T;
87
+ }
88
+ export interface DataTableSearchProps<T> {
89
+ /**
90
+ * The list of accessors to be used for searching.
91
+ */
92
+ accessors: (keyof T | (string & {}))[];
93
+ /**
94
+ * Whether the search functionality is enabled.
95
+ */
96
+ hidden?: boolean;
97
+ /**
98
+ * The icon to be displayed in the search input.
99
+ * @default <SearchIcon />
100
+ */
101
+ icon?: React.ReactNode;
102
+ /**
103
+ * Callback function to handle search input changes.
104
+ * @param value - The new search input value.
105
+ */
106
+ onChange?: (value: string) => void;
107
+ /**
108
+ * Placeholder text for the search input.
109
+ */
110
+ placeholder?: string;
111
+ /**
112
+ * The current value of the search input.
113
+ */
114
+ value?: string;
115
+ }
116
+ export interface DataTableTitleProps<T> {
117
+ /**
118
+ * The search configuration for the table.
119
+ */
120
+ search?: DataTableSearchProps<T>;
121
+ /**
122
+ * The title of the table.
123
+ */
124
+ title?: string;
125
+ }
@@ -0,0 +1,2 @@
1
+ export { default as DataTable } from './DataTable';
2
+ export * from './datatable.type';
@@ -0,0 +1,5 @@
1
+ export * from './common';
2
+ export * from './layout';
3
+ export * from './datatable';
4
+ export * from './theme';
5
+ export * from './authentication';
@@ -0,0 +1,8 @@
1
+ interface Props extends React.HTMLAttributes<HTMLDivElement> {
2
+ columns?: 'a' | 'aab' | 'ab' | 'abb' | 'abc' | 'abcd';
3
+ hAlign?: 'center' | 'end' | 'start';
4
+ vAlign?: 'center' | 'end' | 'start';
5
+ gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ }
7
+ export default function Grid({ children, className, columns, hAlign, vAlign, gap, ...props }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface SectionProps {
3
+ children: React.ReactNode;
4
+ title: string;
5
+ description?: string;
6
+ icon?: React.ReactNode;
7
+ titleAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
8
+ }
9
+ export default function Section({ title, description, icon, children, titleAs, }: SectionProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,19 @@
1
+ interface SidebarItemProps {
2
+ href: string;
3
+ icon: React.ReactNode;
4
+ label: string;
5
+ permission?: {
6
+ action: string;
7
+ scope: string;
8
+ };
9
+ }
10
+ interface SidebarProps {
11
+ items: SidebarItemProps[];
12
+ classNames?: {
13
+ container?: string;
14
+ navWrapper?: string;
15
+ navButton?: string;
16
+ };
17
+ }
18
+ export default function Sidebar({ items, classNames }: SidebarProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,7 @@
1
+ interface SpacerProps {
2
+ size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
3
+ orientation: 'vertical' | 'horizontal';
4
+ className?: string;
5
+ }
6
+ export default function Spacer({ size, orientation, className }: SpacerProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,19 @@
1
+ interface SurfaceClassNames {
2
+ root?: string;
3
+ surface?: string;
4
+ divider?: string;
5
+ }
6
+ interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ children: React.ReactNode;
8
+ classNames?: SurfaceClassNames;
9
+ borderRadius?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
10
+ padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
11
+ gap?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
12
+ justifyContent?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
13
+ alignItems?: 'start' | 'center' | 'end';
14
+ flexDirection?: 'column' | 'row';
15
+ divider?: boolean;
16
+ variant?: 'default' | 'primary' | 'secondary';
17
+ }
18
+ export default function Surface({ children, classNames, borderRadius, padding, gap, divider, flexDirection, variant, justifyContent, alignItems, ...props }: SurfaceProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,5 @@
1
+ export { default as Grid } from './Grid';
2
+ export { default as Section } from './Section';
3
+ export { default as Spacer } from './Spacer';
4
+ export { default as Surface } from './Surface';
5
+ export { default as Sidebar } from './Sidebar';
@@ -0,0 +1,12 @@
1
+ export declare const THEMES: readonly ["ocean", "park", "path", "pool", "royal", "street"];
2
+ export type ThemeContextType = {
3
+ theme: typeof THEMES[number];
4
+ setTheme: (theme: typeof THEMES[number]) => void;
5
+ };
6
+ export declare const ThemeContext: import("react").Context<ThemeContextType>;
7
+ interface Props {
8
+ children: React.ReactNode;
9
+ initialTheme?: typeof THEMES[number];
10
+ }
11
+ export default function ThemeProvider({ children, initialTheme }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ThemeContextType } from "./index";
2
+ export default function useTheme(): ThemeContextType;
@@ -0,0 +1,5 @@
1
+ interface ThemeSwitcherProps {
2
+ onThemeChange?: (theme: string) => void;
3
+ }
4
+ export default function ThemeSwitcher({ onThemeChange }: ThemeSwitcherProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Use to show children only when light theme is active. Hidden otherwise.
3
+ * @param {ReactNode} children The content to display in light theme.
4
+ * @returns {JSX.Element} The rendered ThemeLight component.
5
+ */
6
+ export declare function ThemeLight({ children }: {
7
+ children: React.ReactNode;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ /**
10
+ * Use to show children only when dark theme is active. Hidden otherwise.
11
+ * @param {ReactNode} children The content to display in dark theme.
12
+ * @returns {JSX.Element} The rendered ThemeDark component.
13
+ */
14
+ export declare function ThemeDark({ children }: {
15
+ children: React.ReactNode;
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ /**
18
+ * ThemeSwitch component to automatically toggle children components between dark and light themes.
19
+ * @param {ReactNode} dark The content to display in dark theme.
20
+ * @param {ReactNode} light The content to display in light theme.
21
+ * @returns {JSX.Element} The rendered ThemeSwitch component.
22
+ */
23
+ export declare function Themer({ dark, light }: {
24
+ dark: React.ReactNode;
25
+ light: React.ReactNode;
26
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { default as ThemeProvider } from './ThemeProvider';
2
+ export { default as useTheme } from './ThemeProvider/use-theme';
3
+ export { default as ThemeSwitcher } from './ThemeSwitcher';
4
+ export * from './Themer';
@@ -0,0 +1 @@
1
+ export declare function useIsActivePage(href: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function useScreenSize(): "mobile" | "tablet" | "desktop" | undefined;
@@ -0,0 +1,8 @@
1
+ export declare function useSearchQuery<T>(data: T[], { accessors, debounce }?: {
2
+ accessors?: (keyof T | (string & {}))[];
3
+ debounce?: number;
4
+ }): {
5
+ filteredData: T[];
6
+ searchQuery: string | undefined;
7
+ setSearchQuery: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
8
+ };
@@ -0,0 +1,4 @@
1
+ import "./styles/index.css";
2
+ export * from "./components";
3
+ export * from "./hooks/use-screen-size";
4
+ export * from "@mantine/hooks";
@@ -0,0 +1 @@
1
+ export declare const getCssVariableValue: (variableName: string) => string | undefined;
@@ -0,0 +1,53 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /**
3
+ * Utility function that merges class names together
4
+ */
5
+ export declare function cn(...inputs: ClassValue[]): string;
6
+ /**
7
+ * Utility function that returns a humanized version of a string, e.g. "camelCase" -> "Camel Case"
8
+ */
9
+ export declare function humanize(value: string): string;
10
+ /**
11
+ * Truncates a string to a specified length and adds ellipsis if necessary.
12
+ * @param {string | null} str - The string to truncate.
13
+ * @param {number} length - The maximum length of the truncated string.
14
+ * @returns {string | null} - The truncated string with ellipsis if it exceeds the specified length, or the original string if it does not.
15
+ */
16
+ export declare const truncate: (str: string | null, length: number) => string | null;
17
+ /**
18
+ * Fetches data from a given URL and returns the JSON response.
19
+ * @param {...Parameters<typeof fetch>} args - The arguments to pass to the fetch function.
20
+ * @returns {Promise<any>} - A promise that resolves to the JSON response.
21
+ */
22
+ export declare const fetcher: (input: string | URL | Request, init?: RequestInit | undefined) => Promise<any>;
23
+ /**
24
+ * Capitalizes first letters of words in string.
25
+ * @param {string} str String to be modified
26
+ * @param {boolean=false} lower Whether all other letters should be lowercased
27
+ * @return {string}
28
+ * @see https://stackoverflow.com/questions/2332811/capitalize-words-in-string/7592235#7592235
29
+ * @usage
30
+ * capitalize('fix this string'); // -> 'Fix This String'
31
+ * capitalize('javaSCrIPT'); // -> 'JavaSCrIPT'
32
+ * capitalize('javaSCrIPT', true); // -> 'Javascript'
33
+ */
34
+ export declare const capitalize: (str: string, lower?: boolean) => string;
35
+ /**
36
+ * Formats a date input into a human-readable string.
37
+ * @param {number | string} input - The date input to format.
38
+ * @returns {string} - The formatted date string.
39
+ */
40
+ export declare function formatDate(input: number | string): string;
41
+ /**
42
+ * Tries to parse an ISO date string into a timestamp.
43
+ * @param {string} input - The ISO date string to parse.
44
+ * @returns {number | undefined} - The parsed timestamp or undefined if parsing fails.
45
+ */
46
+ export declare function tryParseDateToTimestamp(input: string): number | undefined;
47
+ /**
48
+ * Utility function that returns the value at a given path in an object.
49
+ * @param {T} obj - The object to retrieve the value from.
50
+ * @param {keyof T | string} path - The path to the value in the object.
51
+ * @returns {unknown} - The value at the given path or undefined if the path is invalid.
52
+ */
53
+ export declare function getValueAtPath<T>(obj: T, path: keyof T | (NonNullable<unknown> & string)): unknown;
@@ -0,0 +1,3 @@
1
+ import { MantineThemeOverride } from '@mantine/core';
2
+ declare const theme: MantineThemeOverride;
3
+ export default theme;