@nexub/react 6.4.0 → 6.6.0
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/accessibility.json +44 -1
- package/dist/components/ChartZoom/ChartZoom.d.ts +18 -0
- package/dist/components/ChartZoom/ChartZoom.js +42 -0
- package/dist/components/ChartZoom/index.d.ts +2 -0
- package/dist/components/ChartZoom/index.js +4 -0
- package/dist/components/DataTable/DataTable.d.ts +8 -1
- package/dist/components/DataTable/DataTable.js +31 -4
- package/dist/components/Kanban/Kanban.d.ts +20 -0
- package/dist/components/Kanban/Kanban.js +50 -0
- package/dist/components/Kanban/index.d.ts +2 -0
- package/dist/components/Kanban/index.js +4 -0
- package/dist/components/Sortable/Sortable.d.ts +18 -0
- package/dist/components/Sortable/Sortable.js +31 -0
- package/dist/components/Sortable/index.d.ts +2 -0
- package/dist/components/Sortable/index.js +4 -0
- package/dist/components/Sortable/reorder.d.ts +29 -0
- package/dist/components/Sortable/reorder.js +114 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/styles.css +1 -1
- package/dist/utils/csv.d.ts +11 -0
- package/dist/utils/csv.js +17 -0
- package/package.json +6 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CSVColumn<T> {
|
|
2
|
+
header: string;
|
|
3
|
+
/** A key of the row, or a function returning the cell's value. */
|
|
4
|
+
value: keyof T | ((row: T) => unknown);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Rows to CSV text (RFC 4180, CRLF line ends). Text that starts like a formula
|
|
8
|
+
* gets a leading `'` so spreadsheets show it instead of running it. Pass the
|
|
9
|
+
* rows and columns the person sees, e.g. after sorting and hiding columns.
|
|
10
|
+
*/
|
|
11
|
+
export declare function toCSV<T>(rows: T[], columns: CSVColumn<T>[]): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const FORMULA = /^[=+\-@\t\r]/;
|
|
2
|
+
function cell(value) {
|
|
3
|
+
if (value == null) return "";
|
|
4
|
+
let text = value instanceof Date ? value.toISOString() : String(value);
|
|
5
|
+
if (typeof value !== "number" && FORMULA.test(text)) text = `'${text}`;
|
|
6
|
+
return /[",\r\n]/.test(text) || text !== text.trim() ? `"${text.replace(/"/g, '""')}"` : text;
|
|
7
|
+
}
|
|
8
|
+
function toCSV(rows, columns) {
|
|
9
|
+
const lines = [columns.map((c) => cell(c.header)).join(",")];
|
|
10
|
+
for (const row of rows) {
|
|
11
|
+
lines.push(columns.map((c) => cell(typeof c.value === "function" ? c.value(row) : row[c.value])).join(","));
|
|
12
|
+
}
|
|
13
|
+
return lines.join("\r\n") + "\r\n";
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
toCSV
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexub/react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "React component library for Nexub Design System — 90+ accessible, themeable UI components built on Radix UI primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,14 +81,14 @@
|
|
|
81
81
|
"date-fns": "^4.4.0",
|
|
82
82
|
"react-day-picker": "^10.0.2",
|
|
83
83
|
"tailwind-merge": "^3.7.0",
|
|
84
|
-
"@nexub/core": "6.
|
|
85
|
-
"@nexub/icons": "6.
|
|
84
|
+
"@nexub/core": "6.6.0",
|
|
85
|
+
"@nexub/icons": "6.6.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"react": ">=19 <20",
|
|
89
89
|
"react-dom": ">=19 <20",
|
|
90
90
|
"@tanstack/react-virtual": "^3.14.22",
|
|
91
|
-
"@nexub/tokens": "^6.
|
|
91
|
+
"@nexub/tokens": "^6.6.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
94
94
|
"@tanstack/react-virtual": {
|
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
"vaul": "1.1.2",
|
|
121
121
|
"vite": "^8.3.5",
|
|
122
122
|
"vitest": "^5.0.5",
|
|
123
|
-
"@nexub/themes": "6.
|
|
124
|
-
"@nexub/tokens": "6.
|
|
123
|
+
"@nexub/themes": "6.6.0",
|
|
124
|
+
"@nexub/tokens": "6.6.0"
|
|
125
125
|
},
|
|
126
126
|
"scripts": {
|
|
127
127
|
"build": "rm -rf dist && tsup && tsc -p tsconfig.build.json && rm -f dist/vendor/*.d.ts && node scripts/check-dts.mjs && tailwindcss -i src/styles.css -o dist/styles.css --minify && cp -R ../themes/src/fonts dist/fonts",
|