@prediktif/ui 0.1.20 → 0.1.22
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/README.md +21 -3
- package/dist/index.d.mts +35 -8
- package/dist/index.d.ts +35 -8
- package/dist/index.js +506 -358
- package/dist/index.mjs +468 -326
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,7 +139,7 @@ Open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
|
139
139
|
|
|
140
140
|
### 2. Adding a New Composed Component
|
|
141
141
|
|
|
142
|
-
1. Create
|
|
142
|
+
1. **Create the component** in `src/components/composed/my-component.tsx`:
|
|
143
143
|
```tsx
|
|
144
144
|
export interface MyComponentProps {
|
|
145
145
|
label: string;
|
|
@@ -149,12 +149,30 @@ Open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
|
149
149
|
return <div className="p-4 rounded-md border">{label}</div>;
|
|
150
150
|
}
|
|
151
151
|
```
|
|
152
|
-
|
|
152
|
+
|
|
153
|
+
2. **Export the component** in `src/components/composed/index.ts`:
|
|
153
154
|
```ts
|
|
154
155
|
export * from "./header-title";
|
|
155
156
|
export * from "./my-component";
|
|
156
157
|
```
|
|
157
|
-
|
|
158
|
+
|
|
159
|
+
3. **Register in navigation** (`src/lib/docs-config.ts`):
|
|
160
|
+
```ts
|
|
161
|
+
{
|
|
162
|
+
title: "Components",
|
|
163
|
+
url: "/components",
|
|
164
|
+
items: [
|
|
165
|
+
// ...
|
|
166
|
+
{ title: "My Component", url: "/components/my-component" },
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
4. **Create the documentation detail page** in `src/app/(docs)/components/my-component/page.tsx`:
|
|
172
|
+
- Include `<ComponentHeader>`, `<ComponentSection title="Preview">`, `<ComponentCodeExample>`, `<ComponentPropsTable>`, and `<ComponentPagination />`.
|
|
173
|
+
|
|
174
|
+
5. **Add a preview card** to `src/app/(docs)/components/page.tsx`:
|
|
175
|
+
- Add `<Card>` with `<CardHeader>`, `<CardTitle>`, `<CardDescription className="truncate">`, and `<CardContent className="max-h-32 overflow-y-scroll">` wrapping `<ComponentPreview>`.
|
|
158
176
|
|
|
159
177
|
---
|
|
160
178
|
|
package/dist/index.d.mts
CHANGED
|
@@ -41,6 +41,38 @@ interface AppSidebarProps {
|
|
|
41
41
|
}
|
|
42
42
|
declare const AppSidebar: react.NamedExoticComponent<AppSidebarProps>;
|
|
43
43
|
|
|
44
|
+
interface AvatarUserProps {
|
|
45
|
+
name?: string | null;
|
|
46
|
+
image?: string | null;
|
|
47
|
+
}
|
|
48
|
+
declare const AvatarUser: react.NamedExoticComponent<AvatarUserProps>;
|
|
49
|
+
|
|
50
|
+
interface EmailLabelProps {
|
|
51
|
+
email?: string | null;
|
|
52
|
+
}
|
|
53
|
+
declare const EmailLabel: react.NamedExoticComponent<EmailLabelProps>;
|
|
54
|
+
|
|
55
|
+
interface EmailVerifiedProps {
|
|
56
|
+
verified: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare const EmailVerified: react.NamedExoticComponent<EmailVerifiedProps>;
|
|
59
|
+
|
|
60
|
+
interface JoinedLabelProps {
|
|
61
|
+
joined?: Date | string | null;
|
|
62
|
+
locale?: string;
|
|
63
|
+
}
|
|
64
|
+
declare const JoinedLabel: react.NamedExoticComponent<JoinedLabelProps>;
|
|
65
|
+
|
|
66
|
+
interface UserRoleProps {
|
|
67
|
+
role?: string | null;
|
|
68
|
+
}
|
|
69
|
+
declare const UserRole: react.NamedExoticComponent<UserRoleProps>;
|
|
70
|
+
|
|
71
|
+
interface UserStatusProps {
|
|
72
|
+
status?: boolean | null;
|
|
73
|
+
}
|
|
74
|
+
declare const UserStatus: react.NamedExoticComponent<UserStatusProps>;
|
|
75
|
+
|
|
44
76
|
/**
|
|
45
77
|
* Configure TanStack Table features used by DataTable.
|
|
46
78
|
* Enables column/global filtering, visibility toggling, pagination, row selection, and sorting.
|
|
@@ -221,10 +253,7 @@ interface DataTableHeaderFilterProps<TData extends RowData> {
|
|
|
221
253
|
declare function smartFilterFn<TData extends RowData>(row: Row<DataTableFeatures, TData>, columnId: string, filterValue: unknown): boolean;
|
|
222
254
|
declare function DataTableHeaderFilter<TData extends RowData>({ table, columnFilters, }: DataTableHeaderFilterProps<TData>): react.JSX.Element | null;
|
|
223
255
|
|
|
224
|
-
|
|
225
|
-
onRefresh?: () => void;
|
|
226
|
-
}
|
|
227
|
-
declare function DataTableHeaderRefresh({ onRefresh, }: DataTableHeaderRefreshProps): react.JSX.Element;
|
|
256
|
+
declare function DataTableHeaderRefresh(): react.JSX.Element;
|
|
228
257
|
|
|
229
258
|
interface DataTableHeaderSearchProps {
|
|
230
259
|
value?: string;
|
|
@@ -254,8 +283,6 @@ interface DataTableProps<TData extends RowData> {
|
|
|
254
283
|
renderCreateDialog?: (open: boolean, onOpenChange: (open: boolean) => void) => ReactNode;
|
|
255
284
|
/** Label text for the add button (defaults to "Add") */
|
|
256
285
|
addLabel?: string;
|
|
257
|
-
/** Callback triggered when user clicks the refresh button */
|
|
258
|
-
onRefresh?: () => void;
|
|
259
286
|
/** Callback triggered when user downloads data */
|
|
260
287
|
onDownload?: () => void;
|
|
261
288
|
/** Base filename used when exporting data (defaults to "data-export") */
|
|
@@ -282,7 +309,7 @@ interface DataTableProps<TData extends RowData> {
|
|
|
282
309
|
* data refresh, pagination, row actions, add/create modal dialog binding,
|
|
283
310
|
* and standard hardcoded global empty state via StateEmpty.
|
|
284
311
|
*/
|
|
285
|
-
declare function DataTable<TData extends RowData>({ columns, data, initialColumnVisibility, renderCreateDialog, addLabel,
|
|
312
|
+
declare function DataTable<TData extends RowData>({ columns, data, initialColumnVisibility, renderCreateDialog, addLabel, onDownload, exportFilename, showSearchInput, showRefreshButton, showSortButton, showFilterButton, showDownloadButton, showColumnToggleButton, showAddButton, }: DataTableProps<TData>): react.JSX.Element;
|
|
286
313
|
|
|
287
314
|
interface HeaderTabItem {
|
|
288
315
|
title: string;
|
|
@@ -326,4 +353,4 @@ interface StateEmptyProps {
|
|
|
326
353
|
}
|
|
327
354
|
declare const StateEmpty: react.NamedExoticComponent<StateEmptyProps>;
|
|
328
355
|
|
|
329
|
-
export { AppSidebar, type AppSidebarProps, type ColumnMetaCustom, DataTable, DataTableContentBody, type DataTableContentBodyProps, DataTableContentHeader, type DataTableContentHeaderProps, type DataTableFeatures, DataTableFooterEntries, type DataTableFooterEntriesProps, DataTableFooterPagination, type DataTableFooterPaginationProps, DataTableHeaderAdd, type DataTableHeaderAddProps, DataTableHeaderDownload, type DataTableHeaderDownloadProps, DataTableHeaderFilter, type DataTableHeaderFilterProps, DataTableHeaderRefresh,
|
|
356
|
+
export { AppSidebar, type AppSidebarProps, AvatarUser, type AvatarUserProps, type ColumnMetaCustom, DataTable, DataTableContentBody, type DataTableContentBodyProps, DataTableContentHeader, type DataTableContentHeaderProps, type DataTableFeatures, DataTableFooterEntries, type DataTableFooterEntriesProps, DataTableFooterPagination, type DataTableFooterPaginationProps, DataTableHeaderAdd, type DataTableHeaderAddProps, DataTableHeaderDownload, type DataTableHeaderDownloadProps, DataTableHeaderFilter, type DataTableHeaderFilterProps, DataTableHeaderRefresh, DataTableHeaderSearch, type DataTableHeaderSearchProps, DataTableHeaderSort, type DataTableHeaderSortProps, DataTableHeaderToggle, type DataTableHeaderToggleProps, type DataTableProps, EmailLabel, type EmailLabelProps, EmailVerified, type EmailVerifiedProps, type FilterSelectOption, type FilterVariant, type HeaderTabItem, HeaderTabs, type HeaderTabsProps, HeaderTitle, type HeaderTitleProps, JoinedLabel, type JoinedLabelProps, type NavItem, type OrganizationItem, type RowActionItem, RowActions, type RowActionsProps, StateEmpty, type StateEmptyProps, UserRole, type UserRoleProps, UserStatus, type UserStatusProps, exportToCSV, exportToPDF, exportToXLSX, features, getTableExportData, printTable, smartFilterFn };
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,38 @@ interface AppSidebarProps {
|
|
|
41
41
|
}
|
|
42
42
|
declare const AppSidebar: react.NamedExoticComponent<AppSidebarProps>;
|
|
43
43
|
|
|
44
|
+
interface AvatarUserProps {
|
|
45
|
+
name?: string | null;
|
|
46
|
+
image?: string | null;
|
|
47
|
+
}
|
|
48
|
+
declare const AvatarUser: react.NamedExoticComponent<AvatarUserProps>;
|
|
49
|
+
|
|
50
|
+
interface EmailLabelProps {
|
|
51
|
+
email?: string | null;
|
|
52
|
+
}
|
|
53
|
+
declare const EmailLabel: react.NamedExoticComponent<EmailLabelProps>;
|
|
54
|
+
|
|
55
|
+
interface EmailVerifiedProps {
|
|
56
|
+
verified: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare const EmailVerified: react.NamedExoticComponent<EmailVerifiedProps>;
|
|
59
|
+
|
|
60
|
+
interface JoinedLabelProps {
|
|
61
|
+
joined?: Date | string | null;
|
|
62
|
+
locale?: string;
|
|
63
|
+
}
|
|
64
|
+
declare const JoinedLabel: react.NamedExoticComponent<JoinedLabelProps>;
|
|
65
|
+
|
|
66
|
+
interface UserRoleProps {
|
|
67
|
+
role?: string | null;
|
|
68
|
+
}
|
|
69
|
+
declare const UserRole: react.NamedExoticComponent<UserRoleProps>;
|
|
70
|
+
|
|
71
|
+
interface UserStatusProps {
|
|
72
|
+
status?: boolean | null;
|
|
73
|
+
}
|
|
74
|
+
declare const UserStatus: react.NamedExoticComponent<UserStatusProps>;
|
|
75
|
+
|
|
44
76
|
/**
|
|
45
77
|
* Configure TanStack Table features used by DataTable.
|
|
46
78
|
* Enables column/global filtering, visibility toggling, pagination, row selection, and sorting.
|
|
@@ -221,10 +253,7 @@ interface DataTableHeaderFilterProps<TData extends RowData> {
|
|
|
221
253
|
declare function smartFilterFn<TData extends RowData>(row: Row<DataTableFeatures, TData>, columnId: string, filterValue: unknown): boolean;
|
|
222
254
|
declare function DataTableHeaderFilter<TData extends RowData>({ table, columnFilters, }: DataTableHeaderFilterProps<TData>): react.JSX.Element | null;
|
|
223
255
|
|
|
224
|
-
|
|
225
|
-
onRefresh?: () => void;
|
|
226
|
-
}
|
|
227
|
-
declare function DataTableHeaderRefresh({ onRefresh, }: DataTableHeaderRefreshProps): react.JSX.Element;
|
|
256
|
+
declare function DataTableHeaderRefresh(): react.JSX.Element;
|
|
228
257
|
|
|
229
258
|
interface DataTableHeaderSearchProps {
|
|
230
259
|
value?: string;
|
|
@@ -254,8 +283,6 @@ interface DataTableProps<TData extends RowData> {
|
|
|
254
283
|
renderCreateDialog?: (open: boolean, onOpenChange: (open: boolean) => void) => ReactNode;
|
|
255
284
|
/** Label text for the add button (defaults to "Add") */
|
|
256
285
|
addLabel?: string;
|
|
257
|
-
/** Callback triggered when user clicks the refresh button */
|
|
258
|
-
onRefresh?: () => void;
|
|
259
286
|
/** Callback triggered when user downloads data */
|
|
260
287
|
onDownload?: () => void;
|
|
261
288
|
/** Base filename used when exporting data (defaults to "data-export") */
|
|
@@ -282,7 +309,7 @@ interface DataTableProps<TData extends RowData> {
|
|
|
282
309
|
* data refresh, pagination, row actions, add/create modal dialog binding,
|
|
283
310
|
* and standard hardcoded global empty state via StateEmpty.
|
|
284
311
|
*/
|
|
285
|
-
declare function DataTable<TData extends RowData>({ columns, data, initialColumnVisibility, renderCreateDialog, addLabel,
|
|
312
|
+
declare function DataTable<TData extends RowData>({ columns, data, initialColumnVisibility, renderCreateDialog, addLabel, onDownload, exportFilename, showSearchInput, showRefreshButton, showSortButton, showFilterButton, showDownloadButton, showColumnToggleButton, showAddButton, }: DataTableProps<TData>): react.JSX.Element;
|
|
286
313
|
|
|
287
314
|
interface HeaderTabItem {
|
|
288
315
|
title: string;
|
|
@@ -326,4 +353,4 @@ interface StateEmptyProps {
|
|
|
326
353
|
}
|
|
327
354
|
declare const StateEmpty: react.NamedExoticComponent<StateEmptyProps>;
|
|
328
355
|
|
|
329
|
-
export { AppSidebar, type AppSidebarProps, type ColumnMetaCustom, DataTable, DataTableContentBody, type DataTableContentBodyProps, DataTableContentHeader, type DataTableContentHeaderProps, type DataTableFeatures, DataTableFooterEntries, type DataTableFooterEntriesProps, DataTableFooterPagination, type DataTableFooterPaginationProps, DataTableHeaderAdd, type DataTableHeaderAddProps, DataTableHeaderDownload, type DataTableHeaderDownloadProps, DataTableHeaderFilter, type DataTableHeaderFilterProps, DataTableHeaderRefresh,
|
|
356
|
+
export { AppSidebar, type AppSidebarProps, AvatarUser, type AvatarUserProps, type ColumnMetaCustom, DataTable, DataTableContentBody, type DataTableContentBodyProps, DataTableContentHeader, type DataTableContentHeaderProps, type DataTableFeatures, DataTableFooterEntries, type DataTableFooterEntriesProps, DataTableFooterPagination, type DataTableFooterPaginationProps, DataTableHeaderAdd, type DataTableHeaderAddProps, DataTableHeaderDownload, type DataTableHeaderDownloadProps, DataTableHeaderFilter, type DataTableHeaderFilterProps, DataTableHeaderRefresh, DataTableHeaderSearch, type DataTableHeaderSearchProps, DataTableHeaderSort, type DataTableHeaderSortProps, DataTableHeaderToggle, type DataTableHeaderToggleProps, type DataTableProps, EmailLabel, type EmailLabelProps, EmailVerified, type EmailVerifiedProps, type FilterSelectOption, type FilterVariant, type HeaderTabItem, HeaderTabs, type HeaderTabsProps, HeaderTitle, type HeaderTitleProps, JoinedLabel, type JoinedLabelProps, type NavItem, type OrganizationItem, type RowActionItem, RowActions, type RowActionsProps, StateEmpty, type StateEmptyProps, UserRole, type UserRoleProps, UserStatus, type UserStatusProps, exportToCSV, exportToPDF, exportToXLSX, features, getTableExportData, printTable, smartFilterFn };
|