@eintrek/erp-theme 1.0.3 → 1.4.3
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/data-table/data-table-cell.d.ts +35 -0
- package/dist/components/data-table/data-table-column-header.d.ts +3 -2
- package/dist/components/data-table/data-table-faceted-filter.d.ts +1 -1
- package/dist/components/data-table/data-table-filter-dropdown.d.ts +12 -0
- package/dist/components/data-table/data-table-filter-list.d.ts +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +15 -1
- package/dist/components/data-table/data-table-range-filter.d.ts +1 -1
- package/dist/components/data-table/data-table-slider-filter.d.ts +1 -2
- package/dist/components/data-table/data-table-sort-list.d.ts +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +6 -1
- package/dist/components/data-table/data-table-types.d.ts +115 -0
- package/dist/components/data-table/data-table.d.ts +5 -2
- package/dist/components/data-table/hooks/use-callback-ref.d.ts +9 -0
- package/dist/{hooks → components/data-table/hooks}/use-data-table.d.ts +4 -3
- package/dist/components/data-table/hooks/use-debounced-callback.d.ts +4 -0
- package/dist/components/data-table/hooks/use-media-query.d.ts +1 -0
- package/dist/components/data-table/index.d.ts +17 -0
- package/dist/components/ui/calendar.d.ts +23 -8
- package/dist/components/ui/carousel.d.ts +1 -1
- package/dist/components/ui/command.d.ts +1 -1
- package/dist/components/ui/custom-select-field2.d.ts +18 -0
- package/dist/components/ui/date-picker-field.d.ts +13 -0
- package/dist/components/ui/date-picker.d.ts +19 -0
- package/dist/components/ui/faceted.d.ts +2 -2
- package/dist/components/ui/file-uploader.d.ts +33 -0
- package/dist/components/ui/form-skeleton.d.ts +11 -0
- package/dist/components/ui/input-field.d.ts +13 -0
- package/dist/components/ui/loading-screen.d.ts +1 -0
- package/dist/components/ui/page-header.d.ts +7 -0
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/select-field.d.ts +31 -0
- package/dist/components/ui/sidebar.d.ts +4 -4
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/textarea-field.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts +1 -1
- package/dist/components/ui/validation-errors.d.ts +25 -0
- package/dist/hooks/use-debounce.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +32 -19
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +30773 -44919
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +30837 -44920
- package/dist/index.js.map +1 -1
- package/dist/lib/baht-text.d.ts +1 -0
- package/dist/lib/date-utils.d.ts +71 -0
- package/dist/lib/file.d.ts +20 -0
- package/dist/lib/format.d.ts +35 -0
- package/package.json +38 -22
- package/scripts/enforce-pnpm.js +18 -0
- package/dist/components/data-table/data-table-action-bar.d.ts +0 -20
- package/dist/components/data-table/data-table-advanced-toolbar.d.ts +0 -7
- package/dist/components/data-table/data-table-filter-menu.d.ts +0 -11
- package/dist/lib/data-table.d.ts +0 -12
- package/dist/lib/filter-columns.d.ts +0 -8
- package/dist/lib/parsers.d.ts +0 -25
- package/dist/registry/alert.stories.d.ts +0 -34
- package/dist/registry/aspect-ratio.stories.d.ts +0 -24
- package/dist/registry/badge.stories.d.ts +0 -42
- package/dist/registry/breadcrumb.stories.d.ts +0 -26
- package/dist/registry/button.stories.d.ts +0 -82
- package/dist/registry/calendar.stories.d.ts +0 -43
- package/dist/registry/card.stories.d.ts +0 -24
- package/dist/registry/carousel.stories.d.ts +0 -17
- package/dist/registry/chart.stories.d.ts +0 -32
- package/dist/registry/checkbox.stories.d.ts +0 -17
- package/dist/registry/command.stories.d.ts +0 -41
- package/dist/registry/data-table.stories.d.ts +0 -59
- package/dist/registry/date-picker.stories.d.ts +0 -32
- package/dist/registry/drawer.stories.d.ts +0 -27
- package/dist/registry/form.stories.d.ts +0 -14
- package/dist/registry/input-otp.stories.d.ts +0 -41
- package/dist/registry/input.stories.d.ts +0 -47
- package/dist/registry/label.stories.d.ts +0 -27
- package/dist/registry/pagination.stories.d.ts +0 -91
- package/dist/registry/progress.stories.d.ts +0 -31
- package/dist/registry/resizable.stories.d.ts +0 -12
- package/dist/registry/scroll-area.stories.d.ts +0 -41
- package/dist/registry/select.stories.d.ts +0 -13
- package/dist/registry/separator.stories.d.ts +0 -21
- package/dist/registry/sheet.stories.d.ts +0 -16
- package/dist/registry/sidebar.stories.d.ts +0 -336
- package/dist/registry/skeleton.stories.d.ts +0 -20
- package/dist/registry/slider.stories.d.ts +0 -30
- package/dist/registry/sonner.stories.d.ts +0 -14
- package/dist/registry/table.stories.d.ts +0 -104
- package/dist/registry/textarea.stories.d.ts +0 -40
- package/dist/registry/toggle.stories.d.ts +0 -35
- package/dist/registry/tokens/color.stories.d.ts +0 -23
- package/dist/registry/tokens/radius.stories.d.ts +0 -17
- package/dist/registry/tokens/typography.stories.d.ts +0 -28
- package/dist/registry/tooltip.stories.d.ts +0 -26
- package/dist/types/data-table.d.ts +0 -33
- package/dist/types/doc.d.ts +0 -195
- /package/dist/{config/data-table.d.ts → components/data-table/data-table-config.d.ts} +0 -0
- /package/dist/components/ui/{form.d.ts → Form.d.ts} +0 -0
- /package/dist/components/ui/{input.d.ts → Input.d.ts} +0 -0
- /package/dist/components/ui/{label.d.ts → Label.d.ts} +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { TooltipContent } from "@/components/ui/tooltip";
|
|
3
|
-
/**
|
|
4
|
-
* A popup that displays information related to an element when the element
|
|
5
|
-
* receives keyboard focus or the mouse hovers over it.
|
|
6
|
-
*/
|
|
7
|
-
declare const meta: Meta<typeof TooltipContent>;
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof meta>;
|
|
10
|
-
/**
|
|
11
|
-
* The default form of the tooltip.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Default: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Use the `bottom` side to display the tooltip below the element.
|
|
16
|
-
*/
|
|
17
|
-
export declare const Bottom: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Use the `left` side to display the tooltip to the left of the element.
|
|
20
|
-
*/
|
|
21
|
-
export declare const Left: Story;
|
|
22
|
-
/**
|
|
23
|
-
* Use the `right` side to display the tooltip to the right of the element.
|
|
24
|
-
*/
|
|
25
|
-
export declare const Right: Story;
|
|
26
|
-
export declare const ShouldShowOnHover: Story;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { DataTableConfig } from "@/config/data-table";
|
|
2
|
-
import type { FilterItemSchema } from "@/lib/parsers";
|
|
3
|
-
import type { ColumnSort, Row, RowData } from "@tanstack/react-table";
|
|
4
|
-
declare module "@tanstack/react-table" {
|
|
5
|
-
interface ColumnMeta<TData extends RowData, TValue> {
|
|
6
|
-
label?: string;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
variant?: FilterVariant;
|
|
9
|
-
options?: Option[];
|
|
10
|
-
range?: [number, number];
|
|
11
|
-
unit?: string;
|
|
12
|
-
icon?: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export interface Option {
|
|
16
|
-
label: string;
|
|
17
|
-
value: string;
|
|
18
|
-
count?: number;
|
|
19
|
-
icon?: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
20
|
-
}
|
|
21
|
-
export type FilterOperator = DataTableConfig["operators"][number];
|
|
22
|
-
export type FilterVariant = DataTableConfig["filterVariants"][number];
|
|
23
|
-
export type JoinOperator = DataTableConfig["joinOperators"][number];
|
|
24
|
-
export interface ExtendedColumnSort<TData> extends Omit<ColumnSort, "id"> {
|
|
25
|
-
id: Extract<keyof TData, string>;
|
|
26
|
-
}
|
|
27
|
-
export interface ExtendedColumnFilter<TData> extends FilterItemSchema {
|
|
28
|
-
id: Extract<keyof TData, string>;
|
|
29
|
-
}
|
|
30
|
-
export interface DataTableRowAction<TData> {
|
|
31
|
-
row: Row<TData>;
|
|
32
|
-
variant: "update" | "delete";
|
|
33
|
-
}
|
package/dist/types/doc.d.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import type { DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
|
2
|
-
import type { EmptyProps } from "@/types";
|
|
3
|
-
import type { ExtendedColumnFilter, Option } from "@/types/data-table";
|
|
4
|
-
import type { Column, Table, TableOptions } from "@tanstack/react-table";
|
|
5
|
-
import type { motion } from "motion/react";
|
|
6
|
-
import type * as React from "react";
|
|
7
|
-
export interface UseDataTableProps<TData> extends Required<Pick<TableOptions<TData>, "pageCount">>, Pick<TableOptions<TData>, "data" | "columns" | "getRowId" | "defaultColumn" | "initialState"> {
|
|
8
|
-
/**
|
|
9
|
-
* Determines how query updates affect history.
|
|
10
|
-
* `push` creates a new history entry; `replace` (default) updates the current entry.
|
|
11
|
-
* @default "replace"
|
|
12
|
-
*/
|
|
13
|
-
history?: "push" | "replace";
|
|
14
|
-
/**
|
|
15
|
-
* Debounce time (ms) for filter updates to enhance performance during rapid input.
|
|
16
|
-
* @default 300
|
|
17
|
-
*/
|
|
18
|
-
debounceMs?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum time (ms) to wait between URL query string updates.
|
|
21
|
-
* Helps with browser rate-limiting. Minimum effective value is 50ms.
|
|
22
|
-
* @default 50
|
|
23
|
-
*/
|
|
24
|
-
throttleMs?: number;
|
|
25
|
-
/**
|
|
26
|
-
* Clear URL query key-value pair when state is set to default.
|
|
27
|
-
* Keep URL meaning consistent when defaults change.
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
clearOnDefault?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Enable notion like column filters.
|
|
33
|
-
* Advanced filters and column filters cannot be used at the same time.
|
|
34
|
-
* @default false
|
|
35
|
-
* @type boolean
|
|
36
|
-
*/
|
|
37
|
-
enableAdvancedFilter?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the page should scroll to the top when the URL changes.
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
scroll?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Whether to keep query states client-side, avoiding server calls.
|
|
45
|
-
* Setting to `false` triggers a network request with the updated querystring.
|
|
46
|
-
* @default true
|
|
47
|
-
*/
|
|
48
|
-
shallow?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Observe Server Component loading states for non-shallow updates.
|
|
51
|
-
* Pass `startTransition` from `React.useTransition()`.
|
|
52
|
-
* Sets `shallow` to `false` automatically.
|
|
53
|
-
* So shallow: true` and `startTransition` cannot be used at the same time.
|
|
54
|
-
* @see https://react.dev/reference/react/useTransition
|
|
55
|
-
*/
|
|
56
|
-
startTransition?: React.TransitionStartFunction;
|
|
57
|
-
}
|
|
58
|
-
export interface DataTableProps<TData> extends EmptyProps<"div"> {
|
|
59
|
-
/** The table instance. */
|
|
60
|
-
table: Table<TData>;
|
|
61
|
-
/** The action bar to display above the table. */
|
|
62
|
-
actionBar?: React.ReactNode;
|
|
63
|
-
}
|
|
64
|
-
export interface DataTableToolbarProps<TData> extends EmptyProps<"div"> {
|
|
65
|
-
/** The table instance. */
|
|
66
|
-
table: Table<TData>;
|
|
67
|
-
}
|
|
68
|
-
export interface DataTableAdvancedToolbarProps<TData> extends EmptyProps<"div"> {
|
|
69
|
-
/** The table instance. */
|
|
70
|
-
table: Table<TData>;
|
|
71
|
-
}
|
|
72
|
-
export interface DataTableActionBarProps<TData> extends EmptyProps<typeof motion.div> {
|
|
73
|
-
/** The table instance. */
|
|
74
|
-
table: Table<TData>;
|
|
75
|
-
/** Whether the action bar is visible. */
|
|
76
|
-
visible?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* The container to mount the portal into.
|
|
79
|
-
* @default document.body
|
|
80
|
-
*/
|
|
81
|
-
container?: Element | DocumentFragment | null;
|
|
82
|
-
}
|
|
83
|
-
export interface DataTableColumnHeaderProps<TData, TValue> extends EmptyProps<typeof DropdownMenuTrigger> {
|
|
84
|
-
/** The column instance. */
|
|
85
|
-
column: Column<TData, TValue>;
|
|
86
|
-
/** The column title. */
|
|
87
|
-
title: string;
|
|
88
|
-
}
|
|
89
|
-
export interface DataTableDateFilterProps<TData> {
|
|
90
|
-
/** The column instance. */
|
|
91
|
-
column: Column<TData, unknown>;
|
|
92
|
-
/** The title of the date picker. */
|
|
93
|
-
title?: string;
|
|
94
|
-
/** Whether to enable range selection. */
|
|
95
|
-
multiple?: boolean;
|
|
96
|
-
}
|
|
97
|
-
export interface DataTableFacetedFilterProps<TData, TValue> {
|
|
98
|
-
/** The column instance. */
|
|
99
|
-
column?: Column<TData, TValue>;
|
|
100
|
-
/** The title of the filter. */
|
|
101
|
-
title?: string;
|
|
102
|
-
/** The options of the filter. */
|
|
103
|
-
options: Option[];
|
|
104
|
-
/** Whether to enable multiple selection. */
|
|
105
|
-
multiple?: boolean;
|
|
106
|
-
}
|
|
107
|
-
export interface DataTableSliderFilterProps<TData> {
|
|
108
|
-
/** The column instance. */
|
|
109
|
-
column: Column<TData, unknown>;
|
|
110
|
-
/** The title of the slider filter. */
|
|
111
|
-
title?: string;
|
|
112
|
-
}
|
|
113
|
-
export interface DataTableRangeFilterProps<TData> extends EmptyProps<"div"> {
|
|
114
|
-
/** The extended column filter. */
|
|
115
|
-
filter: ExtendedColumnFilter<TData>;
|
|
116
|
-
/** The column instance. */
|
|
117
|
-
column: Column<TData>;
|
|
118
|
-
/** The input id for screen readers. */
|
|
119
|
-
inputId: string;
|
|
120
|
-
/** The function to update the filter. */
|
|
121
|
-
onFilterUpdate: (filterId: string, updates: Partial<Omit<ExtendedColumnFilter<TData>, "filterId">>) => void;
|
|
122
|
-
}
|
|
123
|
-
export interface DataTableFilterListProps<TData> {
|
|
124
|
-
/** The table instance. */
|
|
125
|
-
table: Table<TData>;
|
|
126
|
-
/**
|
|
127
|
-
* Debounce time (ms) for filter updates to enhance performance during rapid input.
|
|
128
|
-
* @default 300
|
|
129
|
-
*/
|
|
130
|
-
debounceMs?: number;
|
|
131
|
-
/**
|
|
132
|
-
* Maximum time (ms) to wait between URL query string updates.
|
|
133
|
-
* Helps with browser rate-limiting. Minimum effective value is 50ms.
|
|
134
|
-
* @default 50
|
|
135
|
-
*/
|
|
136
|
-
throttleMs?: number;
|
|
137
|
-
/**
|
|
138
|
-
* Whether to keep query states client-side, avoiding server calls.
|
|
139
|
-
* Setting to `false` triggers a network request with the updated querystring.
|
|
140
|
-
* @default true
|
|
141
|
-
*/
|
|
142
|
-
shallow?: boolean;
|
|
143
|
-
}
|
|
144
|
-
export interface DataTableFilterMenuProps<TData> extends DataTableFilterListProps<TData> {
|
|
145
|
-
}
|
|
146
|
-
export interface DataTableSortListProps<TData> extends DataTableFilterListProps<TData> {
|
|
147
|
-
}
|
|
148
|
-
export interface DataTablePaginationProps<TData> extends EmptyProps<"div"> {
|
|
149
|
-
/** The table instance. */
|
|
150
|
-
table: Table<TData>;
|
|
151
|
-
/**
|
|
152
|
-
* The options of the pagination.
|
|
153
|
-
* @default [10, 20, 30, 40, 50]
|
|
154
|
-
*/
|
|
155
|
-
pageSizeOptions?: number[];
|
|
156
|
-
}
|
|
157
|
-
export interface DataTableViewOptionsProps<TData> {
|
|
158
|
-
/** The table instance. */
|
|
159
|
-
table: Table<TData>;
|
|
160
|
-
}
|
|
161
|
-
export interface DataTableSkeletonProps extends EmptyProps<"div"> {
|
|
162
|
-
/** The number of columns in the table. */
|
|
163
|
-
columnCount: number;
|
|
164
|
-
/**
|
|
165
|
-
* The number of rows in the table.
|
|
166
|
-
* @default 10
|
|
167
|
-
*/
|
|
168
|
-
rowCount?: number;
|
|
169
|
-
/**
|
|
170
|
-
* The number of filters in the table.
|
|
171
|
-
* @default 0
|
|
172
|
-
*/
|
|
173
|
-
filterCount?: number;
|
|
174
|
-
/**
|
|
175
|
-
* Array of CSS width values for each table column.
|
|
176
|
-
* The maximum length of the array must match columnCount, extra values will be ignored.
|
|
177
|
-
* @default ["auto"]
|
|
178
|
-
*/
|
|
179
|
-
cellWidths?: string[];
|
|
180
|
-
/**
|
|
181
|
-
* Whether to show the view options.
|
|
182
|
-
* @default true
|
|
183
|
-
*/
|
|
184
|
-
withViewOptions?: boolean;
|
|
185
|
-
/**
|
|
186
|
-
* Whether to show the pagination bar.
|
|
187
|
-
* @default true
|
|
188
|
-
*/
|
|
189
|
-
withPagination?: boolean;
|
|
190
|
-
/**
|
|
191
|
-
* Whether to prevent the table cells from shrinking.
|
|
192
|
-
* @default false
|
|
193
|
-
*/
|
|
194
|
-
shrinkZero?: boolean;
|
|
195
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|