@makolabs/ripple 0.0.1-dev.20 → 0.0.1-dev.21

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/index.d.ts CHANGED
@@ -163,52 +163,49 @@ export type StatsCardProps = {
163
163
  class?: ClassValue;
164
164
  formatLargeNumbers?: boolean;
165
165
  };
166
- export type KeyType = string | number;
167
166
  export type DataRow = Record<string, any>;
168
- export type StatusType = 'idle' | 'loading' | 'error' | 'success' | 'empty';
169
- export type SortDirection = 'asc' | 'desc';
170
- export type SortState = {
171
- column: string;
172
- direction: SortDirection;
173
- };
174
- export type TableColumn = {
175
- key: string;
167
+ export type KeyType = keyof DataRow;
168
+ export type StatusType = 'active' | 'inactive' | 'pending' | 'error' | 'default';
169
+ export type TableColumn<T extends DataRow = any> = {
170
+ key: KeyType;
176
171
  header: string;
172
+ cell?: Snippet<[row: T, key: KeyType, index?: number]>;
177
173
  sortable?: boolean;
174
+ sortKey?: string;
178
175
  align?: 'left' | 'center' | 'right';
179
176
  width?: string;
180
- cell?: (value: any, row: DataRow) => string | ReturnType<import("svelte").Snippet>;
177
+ class?: ClassValue;
181
178
  };
182
- export type TableProps = {
183
- data: DataRow[];
184
- columns: TableColumn[];
185
- keyField?: string;
186
- status?: StatusType;
187
- searchable?: boolean;
188
- pagination?: boolean;
189
- rowsPerPage?: number;
190
- sortable?: boolean;
191
- defaultSort?: SortState;
179
+ export type SortDirection = 'asc' | 'desc' | null;
180
+ export type SortState = {
181
+ column: string | null;
182
+ direction: SortDirection;
183
+ };
184
+ export type TableProps<T extends DataRow = any> = {
185
+ data: T[];
186
+ columns: TableColumn<T>[];
187
+ color?: VariantColors;
188
+ size?: VariantSizes;
189
+ bordered?: boolean;
190
+ striped?: boolean;
191
+ emptyStateText?: string;
192
+ pageSize?: number;
192
193
  selectable?: boolean;
193
- onRowClick?: (row: DataRow) => void;
194
- onSelectionChange?: (selectedRows: DataRow[]) => void;
195
- onSortChange?: (sortState: SortState) => void;
196
- onPageChange?: (page: number) => void;
197
- emptyMessage?: string;
198
- errorMessage?: string;
199
- searchPlaceholder?: string;
194
+ selected?: T[];
200
195
  class?: ClassValue;
201
- headerClass?: ClassValue;
202
- rowClass?: ClassValue | ((row: DataRow) => ClassValue);
203
- cellClass?: ClassValue | ((value: any, row: DataRow, columnKey: string) => ClassValue);
204
- searchClass?: ClassValue;
205
- paginationClass?: ClassValue;
206
- loadingTemplate?: Snippet;
207
- emptyTemplate?: Snippet;
208
- errorTemplate?: Snippet;
209
- searchDebounceMs?: number;
210
- showCount?: boolean;
211
- rowsPerPageOptions?: number[];
196
+ wrapperclass?: ClassValue;
197
+ tableclass?: ClassValue;
198
+ theadclass?: ClassValue;
199
+ tbodyclass?: ClassValue;
200
+ trclass?: ClassValue;
201
+ thclass?: ClassValue;
202
+ tdclass?: ClassValue;
203
+ footerclass?: ClassValue;
204
+ onrowclick?: (row: T, index: number) => void;
205
+ onsort?: (sortState: SortState) => void;
206
+ onselect?: (selected: T[]) => void;
207
+ rowclass?: (row: T, index: number) => ClassValue;
208
+ loading?: boolean;
212
209
  };
213
210
  export type BreadcrumbItem = {
214
211
  label: string;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../helper/cls.js';
3
- import { table, type TableProps, type SortDirection, type SortState } from './table.js';
4
-
3
+ import { table } from './table.js';
4
+ import type { TableProps, SortDirection, SortState } from '../../index.js';
5
5
  let {
6
6
  data = [],
7
7
  columns = [],
@@ -1,4 +1,4 @@
1
- import { type TableProps } from './table.js';
1
+ import type { TableProps } from '../../index.js';
2
2
  declare const Table: import("svelte").Component<TableProps<any>, {}, "selected">;
3
3
  type Table = ReturnType<typeof Table>;
4
4
  export default Table;
@@ -1,24 +1,5 @@
1
1
  import type { ClassValue } from 'tailwind-variants';
2
- import type { Snippet } from 'svelte';
3
2
  import type { VariantColors, VariantSizes } from '../../index.js';
4
- export type DataRow = Record<string, any>;
5
- export type KeyType = keyof DataRow;
6
- export type StatusType = 'active' | 'inactive' | 'pending' | 'error' | 'default';
7
- export type TableColumn<T extends DataRow = any> = {
8
- key: KeyType;
9
- header: string;
10
- cell?: Snippet<[row: T, key: KeyType, index?: number]>;
11
- sortable?: boolean;
12
- sortKey?: string;
13
- align?: 'left' | 'center' | 'right';
14
- width?: string;
15
- class?: ClassValue;
16
- };
17
- export type SortDirection = 'asc' | 'desc' | null;
18
- export type SortState = {
19
- column: string | null;
20
- direction: SortDirection;
21
- };
22
3
  export declare const table: import("tailwind-variants").TVReturnType<{
23
4
  size: {
24
5
  xs: {
@@ -1,12 +1,4 @@
1
1
  import { tv } from 'tailwind-variants';
2
- // Prebuild Cell rendering options
3
- // Snippet 1 - Date
4
- // Snippet 2 - Currency
5
- // Snippet 3 - Percentage
6
- // Snippet 4 - Phone Number
7
- // Snippet 5 - Email
8
- // Snippet 6 - Status
9
- // Snippet 7 - Time
10
2
  export const table = tv({
11
3
  slots: {
12
4
  base: 'w-full',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makolabs/ripple",
3
- "version": "0.0.1-dev.20",
3
+ "version": "0.0.1-dev.21",
4
4
  "description": "Simple Svelte 5 powered component library ✨",
5
5
  "repository": {
6
6
  "type": "git",