blimpui 0.0.19 → 0.0.20
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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/$/components/primitives/toast/index.d.ts +0 -2
- package/dist/$/components/primitives/toast/index.d.ts.map +0 -1
- package/dist/$/components/primitives/toast/index.js +0 -1
- package/dist/$/components/primitives/toast/index.web.d.ts +0 -2
- package/dist/$/components/primitives/toast/index.web.d.ts.map +0 -1
- package/dist/$/components/primitives/toast/index.web.js +0 -1
- package/dist/$/components/ui/table.d.ts +0 -36
- package/dist/$/components/ui/table.d.ts.map +0 -1
- package/dist/$/components/ui/table.js +0 -56
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export * from "./$/components/ui/label";
|
|
|
28
28
|
export * from "./$/components/ui/list";
|
|
29
29
|
export * from "./$/components/ui/toast";
|
|
30
30
|
export * from "./$/components/ui/menubar";
|
|
31
|
-
export * from "./$/components/ui/table";
|
|
31
|
+
export * from "./$/components/ui/table/index";
|
|
32
32
|
export * from "./$/components/primitives/pagination";
|
|
33
33
|
export * from "./$/components/ui/popover";
|
|
34
34
|
export * from "./$/components/ui/picker";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAE/C,cAAc,4BA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;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,yBAAyB,CAAC;AAExC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AAExC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AAErD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAElD,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export * from "./$/components/ui/label";
|
|
|
28
28
|
export * from "./$/components/ui/list";
|
|
29
29
|
export * from "./$/components/ui/toast";
|
|
30
30
|
export * from "./$/components/ui/menubar";
|
|
31
|
-
export * from "./$/components/ui/table";
|
|
31
|
+
export * from "./$/components/ui/table/index";
|
|
32
32
|
export * from "./$/components/primitives/pagination";
|
|
33
33
|
export * from "./$/components/ui/popover";
|
|
34
34
|
export * from "./$/components/ui/picker";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../$/components/primitives/toast/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'sonner-native';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../../$/components/primitives/toast/index.web.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'sonner';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface TableColumn<T> {
|
|
3
|
-
header: string | React.ReactNode;
|
|
4
|
-
accessorKey?: keyof T;
|
|
5
|
-
cell?: (info: {
|
|
6
|
-
row: T;
|
|
7
|
-
value: any;
|
|
8
|
-
}) => React.ReactNode;
|
|
9
|
-
id?: string;
|
|
10
|
-
meta?: {
|
|
11
|
-
isMobileHeader?: boolean;
|
|
12
|
-
mobileLabel?: string;
|
|
13
|
-
mobileClassName?: string;
|
|
14
|
-
};
|
|
15
|
-
className?: string;
|
|
16
|
-
headerClassName?: string;
|
|
17
|
-
cellClassName?: string;
|
|
18
|
-
}
|
|
19
|
-
interface TableProps<T> {
|
|
20
|
-
data: T[];
|
|
21
|
-
columns: TableColumn<T>[];
|
|
22
|
-
mobileBreakpoint?: number;
|
|
23
|
-
className?: string;
|
|
24
|
-
onRowPress?: (row: T) => void;
|
|
25
|
-
onItemPress?: (row: T) => void;
|
|
26
|
-
keyExtractor?: (item: T, index: number) => string;
|
|
27
|
-
headerRowClassName?: string;
|
|
28
|
-
rowClassName?: string | ((row: T, index: number) => string);
|
|
29
|
-
bodyClassName?: string;
|
|
30
|
-
mobileCardClassName?: string;
|
|
31
|
-
mobileHeaderClassName?: string;
|
|
32
|
-
mobileBodyClassName?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare function Table<T>({ data, columns, mobileBreakpoint, className, onRowPress, onItemPress, keyExtractor, headerRowClassName, rowClassName, bodyClassName, mobileCardClassName, mobileHeaderClassName, mobileBodyClassName, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../$/components/ui/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,WAAW,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IACzD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE;QACN,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,eAAe,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,UAAU,CAAC,CAAC;IACrB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,EACxB,IAAI,EACJ,OAAO,EACP,gBAAsB,EACtB,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACnB,EAAE,UAAU,CAAC,CAAC,CAAC,2CA+Kf"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LegendList } from "@legendapp/list";
|
|
3
|
-
import { Pressable, Text, View, useWindowDimensions } from "react-native";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
import * as TablePrimitive from "../primitives/table";
|
|
6
|
-
export function Table(_a) {
|
|
7
|
-
var data = _a.data, columns = _a.columns, _b = _a.mobileBreakpoint, mobileBreakpoint = _b === void 0 ? 768 : _b, className = _a.className, onRowPress = _a.onRowPress, onItemPress = _a.onItemPress, keyExtractor = _a.keyExtractor, headerRowClassName = _a.headerRowClassName, rowClassName = _a.rowClassName, bodyClassName = _a.bodyClassName, mobileCardClassName = _a.mobileCardClassName, mobileHeaderClassName = _a.mobileHeaderClassName, mobileBodyClassName = _a.mobileBodyClassName;
|
|
8
|
-
var width = useWindowDimensions().width;
|
|
9
|
-
var isMobile = width < mobileBreakpoint;
|
|
10
|
-
var handlePress = onItemPress || onRowPress;
|
|
11
|
-
var getValue = function (row, column) {
|
|
12
|
-
if (column.accessorKey) {
|
|
13
|
-
return row[column.accessorKey];
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
};
|
|
17
|
-
var renderCell = function (row, column) {
|
|
18
|
-
var value = getValue(row, column);
|
|
19
|
-
if (column.cell) {
|
|
20
|
-
return column.cell({ row: row, value: value });
|
|
21
|
-
}
|
|
22
|
-
return (_jsx(Text, { className: "text-foreground text-sm font-medium", children: value }));
|
|
23
|
-
};
|
|
24
|
-
if (isMobile) {
|
|
25
|
-
return (_jsx(LegendList, { data: data, estimatedItemSize: 200, keyExtractor: keyExtractor, className: bodyClassName, renderItem: function (_a) {
|
|
26
|
-
var item = _a.item, index = _a.index;
|
|
27
|
-
// Separate header columns (shown at top) from body columns
|
|
28
|
-
var headerColumns = columns.filter(function (col) { var _a; return (_a = col.meta) === null || _a === void 0 ? void 0 : _a.isMobileHeader; });
|
|
29
|
-
var bodyColumns = columns.filter(function (col) { var _a; return !((_a = col.meta) === null || _a === void 0 ? void 0 : _a.isMobileHeader); });
|
|
30
|
-
var cardContent = (_jsxs(View, { className: cn("mb-4 rounded-xl border border-border bg-card p-4", mobileCardClassName, typeof rowClassName === "function"
|
|
31
|
-
? rowClassName(item, index)
|
|
32
|
-
: rowClassName), children: [headerColumns.length > 0 && (_jsx(View, { className: cn("mb-4 flex-row items-center justify-between border-b border-border pb-4", mobileHeaderClassName), children: headerColumns.map(function (col, idx) {
|
|
33
|
-
var _a, _b;
|
|
34
|
-
return (_jsx(View, { className: cn((_a = col.meta) === null || _a === void 0 ? void 0 : _a.mobileClassName, col.className), children: renderCell(item, col) }, col.id || ((_b = col.accessorKey) === null || _b === void 0 ? void 0 : _b.toString()) || idx));
|
|
35
|
-
}) })), _jsx(View, { className: cn("gap-4", mobileBodyClassName), children: bodyColumns.map(function (col, idx) {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
return (_jsxs(View, { className: "flex-row items-center justify-between", children: [_jsx(Text, { className: "text-muted-foreground text-sm font-medium", children: ((_a = col.meta) === null || _a === void 0 ? void 0 : _a.mobileLabel) || col.header }), _jsx(View, { className: cn("flex-1 items-end pl-4", col.className, col.cellClassName), children: renderCell(item, col) })] }, col.id || ((_b = col.accessorKey) === null || _b === void 0 ? void 0 : _b.toString()) || idx));
|
|
38
|
-
}) })] }));
|
|
39
|
-
if (handlePress) {
|
|
40
|
-
return (_jsx(Pressable, { onPress: function () { return handlePress(item); }, children: cardContent }));
|
|
41
|
-
}
|
|
42
|
-
return cardContent;
|
|
43
|
-
}, contentContainerStyle: { padding: 16 } }));
|
|
44
|
-
}
|
|
45
|
-
return (_jsx(View, { className: cn("w-full overflow-hidden not-sm:rounded-md", className), children: _jsxs(TablePrimitive.Root, { children: [_jsx(TablePrimitive.Header, { children: _jsx(TablePrimitive.Row, { className: cn("flex-row border-b-0 bg-muted/50 hover:bg-muted/50", headerRowClassName), children: columns.map(function (col, index) {
|
|
46
|
-
var _a;
|
|
47
|
-
return (_jsx(TablePrimitive.Head, { className: cn("flex-1 py-4 justify-center px-4", col.className, col.headerClassName), children: typeof col.header === "string" ? (_jsx(Text, { className: "text-muted-foreground text-sm font-medium", children: col.header })) : (col.header) }, col.id || ((_a = col.accessorKey) === null || _a === void 0 ? void 0 : _a.toString()) || index));
|
|
48
|
-
}) }) }), _jsx(TablePrimitive.Body, { className: bodyClassName, children: data.map(function (row, rowIndex) { return (_jsx(TablePrimitive.Row, { className: cn("flex-row border-b border-border text-foreground transition-colors hover:bg-muted/50", handlePress && "cursor-pointer", typeof rowClassName === "function"
|
|
49
|
-
? rowClassName(row, rowIndex)
|
|
50
|
-
: rowClassName), onPress: handlePress ? function () { return handlePress(row); } : undefined, children: columns.map(function (col, colIndex) {
|
|
51
|
-
var _a;
|
|
52
|
-
return (_jsx(TablePrimitive.Cell, { className: cn("flex-1 justify-center p-4", col.className, col.cellClassName), children: renderCell(row, col) }, col.id || ((_a = col.accessorKey) === null || _a === void 0 ? void 0 : _a.toString()) || colIndex));
|
|
53
|
-
}) }, keyExtractor
|
|
54
|
-
? keyExtractor(row, rowIndex)
|
|
55
|
-
: rowIndex)); }) })] }) }));
|
|
56
|
-
}
|