@nuptechs/nup-xlsx-preview 1.0.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.
@@ -0,0 +1,182 @@
1
+ /**
2
+ * @aspect/nup-xlsx-preview - Print Styles
3
+ * Optimized for printing spreadsheets
4
+ */
5
+
6
+ @media print {
7
+ /* Reset colors for print */
8
+ .nup-spreadsheet,
9
+ .nup-spreadsheet * {
10
+ background: white !important;
11
+ color: black !important;
12
+ box-shadow: none !important;
13
+ }
14
+
15
+ /* Container */
16
+ .nup-spreadsheet {
17
+ position: static !important;
18
+ width: 100% !important;
19
+ height: auto !important;
20
+ max-height: none !important;
21
+ overflow: visible !important;
22
+ border: none !important;
23
+ border-radius: 0 !important;
24
+ page-break-inside: auto;
25
+ }
26
+
27
+ /* Scroll container - remove scrolling */
28
+ .nup-scroll-container {
29
+ position: static !important;
30
+ overflow: visible !important;
31
+ height: auto !important;
32
+ }
33
+
34
+ /* Content */
35
+ .nup-content {
36
+ position: static !important;
37
+ width: auto !important;
38
+ height: auto !important;
39
+ }
40
+
41
+ /* Cells - use table layout for print */
42
+ .nup-cell {
43
+ position: static !important;
44
+ display: table-cell !important;
45
+ border: 0.5pt solid #999999 !important;
46
+ padding: 3pt 5pt !important;
47
+ font-size: 9pt !important;
48
+ white-space: normal !important;
49
+ word-wrap: break-word !important;
50
+ page-break-inside: avoid;
51
+ }
52
+
53
+ /* Headers */
54
+ .nup-header {
55
+ display: table-cell !important;
56
+ position: static !important;
57
+ background: #f0f0f0 !important;
58
+ border: 0.5pt solid #999999 !important;
59
+ font-weight: bold !important;
60
+ font-size: 8pt !important;
61
+ }
62
+
63
+ /* Selection styling - hide for print */
64
+ .nup-selection-border,
65
+ .nup-cell-selected,
66
+ .nup-cell-search-result,
67
+ .nup-cell-search-current {
68
+ background: white !important;
69
+ border-color: #999999 !important;
70
+ }
71
+
72
+ .nup-selection-border {
73
+ display: none !important;
74
+ }
75
+
76
+ /* Hide UI elements */
77
+ .nup-sheet-tabs,
78
+ .nup-search-bar,
79
+ .nup-resize-handle,
80
+ .nup-frozen-line-row,
81
+ .nup-frozen-line-col,
82
+ .nup-loading {
83
+ display: none !important;
84
+ }
85
+
86
+ /* Scrollbars */
87
+ .nup-scroll-container::-webkit-scrollbar {
88
+ display: none !important;
89
+ }
90
+
91
+ /* Page breaks */
92
+ .nup-print-page-break {
93
+ page-break-after: always;
94
+ }
95
+
96
+ /* Header rows repeat on each page */
97
+ .nup-print-header {
98
+ display: table-header-group !important;
99
+ }
100
+
101
+ /* Repeat column headers */
102
+ thead {
103
+ display: table-header-group;
104
+ }
105
+
106
+ /* Avoid orphan rows */
107
+ tr {
108
+ page-break-inside: avoid;
109
+ page-break-after: auto;
110
+ }
111
+
112
+ /* Print margins */
113
+ @page {
114
+ margin: 1cm;
115
+ size: A4 landscape;
116
+ }
117
+
118
+ /* First page */
119
+ @page :first {
120
+ margin-top: 1.5cm;
121
+ }
122
+
123
+ /* Left pages */
124
+ @page :left {
125
+ margin-left: 1.5cm;
126
+ margin-right: 1cm;
127
+ }
128
+
129
+ /* Right pages */
130
+ @page :right {
131
+ margin-left: 1cm;
132
+ margin-right: 1.5cm;
133
+ }
134
+
135
+ /* Grayscale print option */
136
+ .nup-print-grayscale {
137
+ filter: grayscale(100%);
138
+ -webkit-filter: grayscale(100%);
139
+ }
140
+
141
+ /* Compact print option */
142
+ .nup-print-compact .nup-cell {
143
+ padding: 1pt 3pt !important;
144
+ font-size: 8pt !important;
145
+ }
146
+
147
+ .nup-print-compact .nup-header {
148
+ font-size: 7pt !important;
149
+ }
150
+
151
+ /* Hide column/row headers for cleaner print */
152
+ .nup-print-no-headers .nup-header {
153
+ display: none !important;
154
+ }
155
+
156
+ .nup-print-no-headers .nup-corner {
157
+ display: none !important;
158
+ }
159
+
160
+ /* Grid lines option */
161
+ .nup-print-no-gridlines .nup-cell {
162
+ border: none !important;
163
+ }
164
+
165
+ .nup-print-no-gridlines .nup-header {
166
+ border: none !important;
167
+ border-bottom: 1pt solid #999999 !important;
168
+ }
169
+ }
170
+
171
+ /* Print preview styles (visible in normal view) */
172
+ .nup-print-preview {
173
+ background: white;
174
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
175
+ margin: 20px auto;
176
+ max-width: 297mm; /* A4 landscape width */
177
+ }
178
+
179
+ .nup-print-preview .nup-spreadsheet {
180
+ border: none;
181
+ border-radius: 0;
182
+ }
@@ -0,0 +1,202 @@
1
+ /**
2
+ * @aspect/nup-xlsx-preview - Theme Definitions
3
+ * 7 themes: 4 light, 2 dark, 1 accessible
4
+ */
5
+
6
+ /* === LIGHT THEMES === */
7
+
8
+ /* Theme: Default (Google Sheets inspired) */
9
+ .nup-theme-default {
10
+ --nup-background: #ffffff;
11
+ --nup-foreground: #202124;
12
+ --nup-grid: #e0e0e0;
13
+ --nup-border: #dadce0;
14
+ --nup-cell-bg: #ffffff;
15
+ --nup-cell-hover: #f8f9fa;
16
+ --nup-header-bg: #f8f9fa;
17
+ --nup-header-fg: #5f6368;
18
+ --nup-header-selected-bg: #e8f0fe;
19
+ --nup-selection-border: #1a73e8;
20
+ --nup-selection-bg: rgba(26, 115, 232, 0.08);
21
+ --nup-frozen-border: #dadce0;
22
+ --nup-scrollbar-track: #f1f1f1;
23
+ --nup-scrollbar-thumb: #c1c1c1;
24
+ --nup-scrollbar-thumb-hover: #a8a8a8;
25
+ --nup-search-bg: #fff59d;
26
+ --nup-search-current-bg: #ffb300;
27
+ --nup-font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
28
+ --nup-font-size: 13px;
29
+ }
30
+
31
+ /* Theme: Excel Classic */
32
+ .nup-theme-excel {
33
+ --nup-background: #ffffff;
34
+ --nup-foreground: #000000;
35
+ --nup-grid: #d4d4d4;
36
+ --nup-border: #b4b4b4;
37
+ --nup-cell-bg: #ffffff;
38
+ --nup-cell-hover: #f0f0f0;
39
+ --nup-header-bg: #f0f0f0;
40
+ --nup-header-fg: #000000;
41
+ --nup-header-selected-bg: #cce4f7;
42
+ --nup-selection-border: #217346;
43
+ --nup-selection-bg: rgba(33, 115, 70, 0.1);
44
+ --nup-frozen-border: #9bc2e6;
45
+ --nup-scrollbar-track: #f0f0f0;
46
+ --nup-scrollbar-thumb: #c0c0c0;
47
+ --nup-scrollbar-thumb-hover: #a0a0a0;
48
+ --nup-search-bg: #ffff00;
49
+ --nup-search-current-bg: #ff9632;
50
+ --nup-font-family: 'Calibri', 'Segoe UI', sans-serif;
51
+ --nup-font-size: 11px;
52
+ }
53
+
54
+ /* Theme: Modern */
55
+ .nup-theme-modern {
56
+ --nup-background: #fafafa;
57
+ --nup-foreground: #18181b;
58
+ --nup-grid: #e4e4e7;
59
+ --nup-border: #d4d4d8;
60
+ --nup-cell-bg: #ffffff;
61
+ --nup-cell-hover: #f4f4f5;
62
+ --nup-header-bg: #f4f4f5;
63
+ --nup-header-fg: #71717a;
64
+ --nup-header-selected-bg: #dbeafe;
65
+ --nup-selection-border: #3b82f6;
66
+ --nup-selection-bg: rgba(59, 130, 246, 0.08);
67
+ --nup-frozen-border: #a1a1aa;
68
+ --nup-scrollbar-track: #f4f4f5;
69
+ --nup-scrollbar-thumb: #d4d4d8;
70
+ --nup-scrollbar-thumb-hover: #a1a1aa;
71
+ --nup-search-bg: #fef08a;
72
+ --nup-search-current-bg: #fbbf24;
73
+ --nup-font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
74
+ --nup-font-size: 13px;
75
+ }
76
+
77
+ /* Theme: Minimal */
78
+ .nup-theme-minimal {
79
+ --nup-background: #ffffff;
80
+ --nup-foreground: #27272a;
81
+ --nup-grid: #f4f4f5;
82
+ --nup-border: #e4e4e7;
83
+ --nup-cell-bg: #ffffff;
84
+ --nup-cell-hover: #fafafa;
85
+ --nup-header-bg: #ffffff;
86
+ --nup-header-fg: #a1a1aa;
87
+ --nup-header-selected-bg: #f4f4f5;
88
+ --nup-selection-border: #18181b;
89
+ --nup-selection-bg: rgba(24, 24, 27, 0.04);
90
+ --nup-frozen-border: #e4e4e7;
91
+ --nup-scrollbar-track: #ffffff;
92
+ --nup-scrollbar-thumb: #e4e4e7;
93
+ --nup-scrollbar-thumb-hover: #d4d4d8;
94
+ --nup-search-bg: #fef9c3;
95
+ --nup-search-current-bg: #fde047;
96
+ --nup-font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
97
+ --nup-font-size: 13px;
98
+ }
99
+
100
+ /* === DARK THEMES === */
101
+
102
+ /* Theme: Dark */
103
+ .nup-theme-dark {
104
+ --nup-background: #1e1e1e;
105
+ --nup-foreground: #d4d4d4;
106
+ --nup-grid: #3c3c3c;
107
+ --nup-border: #4a4a4a;
108
+ --nup-cell-bg: #252526;
109
+ --nup-cell-hover: #2a2d2e;
110
+ --nup-header-bg: #252526;
111
+ --nup-header-fg: #858585;
112
+ --nup-header-selected-bg: #264f78;
113
+ --nup-selection-border: #0078d4;
114
+ --nup-selection-bg: rgba(0, 120, 212, 0.2);
115
+ --nup-frozen-border: #4a4a4a;
116
+ --nup-scrollbar-track: #1e1e1e;
117
+ --nup-scrollbar-thumb: #4a4a4a;
118
+ --nup-scrollbar-thumb-hover: #5a5a5a;
119
+ --nup-search-bg: #613a00;
120
+ --nup-search-current-bg: #a86400;
121
+ --nup-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
122
+ --nup-font-size: 13px;
123
+ }
124
+
125
+ /* Theme: Midnight */
126
+ .nup-theme-midnight {
127
+ --nup-background: #0d1117;
128
+ --nup-foreground: #c9d1d9;
129
+ --nup-grid: #21262d;
130
+ --nup-border: #30363d;
131
+ --nup-cell-bg: #0d1117;
132
+ --nup-cell-hover: #161b22;
133
+ --nup-header-bg: #161b22;
134
+ --nup-header-fg: #8b949e;
135
+ --nup-header-selected-bg: #1f6feb33;
136
+ --nup-selection-border: #58a6ff;
137
+ --nup-selection-bg: rgba(88, 166, 255, 0.15);
138
+ --nup-frozen-border: #30363d;
139
+ --nup-scrollbar-track: #0d1117;
140
+ --nup-scrollbar-thumb: #30363d;
141
+ --nup-scrollbar-thumb-hover: #484f58;
142
+ --nup-search-bg: #634700;
143
+ --nup-search-current-bg: #9e6a00;
144
+ --nup-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
145
+ --nup-font-size: 13px;
146
+ }
147
+
148
+ /* === ACCESSIBLE THEME (WCAG AAA) === */
149
+
150
+ /* Theme: High Contrast */
151
+ .nup-theme-accessible {
152
+ --nup-background: #ffffff;
153
+ --nup-foreground: #000000;
154
+ --nup-grid: #000000;
155
+ --nup-border: #000000;
156
+ --nup-cell-bg: #ffffff;
157
+ --nup-cell-hover: #e6e6e6;
158
+ --nup-header-bg: #e6e6e6;
159
+ --nup-header-fg: #000000;
160
+ --nup-header-selected-bg: #0078d4;
161
+ --nup-selection-border: #0000ff;
162
+ --nup-selection-bg: rgba(0, 0, 255, 0.15);
163
+ --nup-frozen-border: #000000;
164
+ --nup-scrollbar-track: #e6e6e6;
165
+ --nup-scrollbar-thumb: #666666;
166
+ --nup-scrollbar-thumb-hover: #333333;
167
+ --nup-search-bg: #ffff00;
168
+ --nup-search-current-bg: #ff6600;
169
+ --nup-font-family: Arial, Helvetica, sans-serif;
170
+ --nup-font-size: 14px;
171
+ }
172
+
173
+ /* Accessible theme selected state overrides */
174
+ .nup-theme-accessible .nup-header-selected {
175
+ color: #ffffff;
176
+ }
177
+
178
+ /* === COLORBLIND-FRIENDLY VARIANTS === */
179
+
180
+ /* Deuteranopia (red-green) */
181
+ .nup-colorblind-deuteranopia {
182
+ --nup-selection-border: #0077bb;
183
+ --nup-selection-bg: rgba(0, 119, 187, 0.12);
184
+ --nup-search-bg: #ddcc77;
185
+ --nup-search-current-bg: #cc6677;
186
+ }
187
+
188
+ /* Protanopia (red-green) */
189
+ .nup-colorblind-protanopia {
190
+ --nup-selection-border: #33bbee;
191
+ --nup-selection-bg: rgba(51, 187, 238, 0.12);
192
+ --nup-search-bg: #ee7733;
193
+ --nup-search-current-bg: #cc3311;
194
+ }
195
+
196
+ /* Tritanopia (blue-yellow) */
197
+ .nup-colorblind-tritanopia {
198
+ --nup-selection-border: #ee3377;
199
+ --nup-selection-bg: rgba(238, 51, 119, 0.12);
200
+ --nup-search-bg: #009988;
201
+ --nup-search-current-bg: #ee7733;
202
+ }
package/package.json ADDED
@@ -0,0 +1,131 @@
1
+ {
2
+ "name": "@nuptechs/nup-xlsx-preview",
3
+ "version": "1.0.0",
4
+ "description": "Ultra-light Excel visualization component with virtual scrolling, themes, and framework adapters",
5
+ "author": "Aspect",
6
+ "license": "Commercial",
7
+ "keywords": [
8
+ "excel",
9
+ "xlsx",
10
+ "spreadsheet",
11
+ "preview",
12
+ "viewer",
13
+ "virtual-scroll",
14
+ "react",
15
+ "vue",
16
+ "typescript"
17
+ ],
18
+ "type": "module",
19
+ "main": "./dist/index.cjs",
20
+ "module": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "import": {
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "require": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.cjs"
31
+ }
32
+ },
33
+ "./react": {
34
+ "import": {
35
+ "types": "./dist/adapters/react.d.ts",
36
+ "default": "./dist/adapters/react.js"
37
+ },
38
+ "require": {
39
+ "types": "./dist/adapters/react.d.ts",
40
+ "default": "./dist/adapters/react.cjs"
41
+ }
42
+ },
43
+ "./vue": {
44
+ "import": {
45
+ "types": "./dist/adapters/vue.d.ts",
46
+ "default": "./dist/adapters/vue.js"
47
+ },
48
+ "require": {
49
+ "types": "./dist/adapters/vue.d.ts",
50
+ "default": "./dist/adapters/vue.cjs"
51
+ }
52
+ },
53
+ "./vanilla": {
54
+ "import": {
55
+ "types": "./dist/adapters/vanilla.d.ts",
56
+ "default": "./dist/adapters/vanilla.js"
57
+ },
58
+ "require": {
59
+ "types": "./dist/adapters/vanilla.d.ts",
60
+ "default": "./dist/adapters/vanilla.cjs"
61
+ }
62
+ },
63
+ "./styles/base.css": "./dist/styles/base.css",
64
+ "./styles/themes.css": "./dist/styles/themes.css",
65
+ "./styles/print.css": "./dist/styles/print.css",
66
+ "./styles": "./dist/styles/index.css"
67
+ },
68
+ "files": [
69
+ "dist",
70
+ "README.md"
71
+ ],
72
+ "sideEffects": [
73
+ "*.css"
74
+ ],
75
+ "scripts": {
76
+ "build": "tsup && npm run build:css",
77
+ "build:css": "mkdir -p dist/styles && cp src/styles/*.css dist/styles/ && cat src/styles/base.css src/styles/themes.css src/styles/print.css > dist/styles/index.css",
78
+ "dev": "tsup --watch",
79
+ "typecheck": "tsc --noEmit",
80
+ "test": "vitest",
81
+ "test:coverage": "vitest run --coverage",
82
+ "lint": "eslint src --ext .ts,.tsx",
83
+ "clean": "rm -rf dist"
84
+ },
85
+ "peerDependencies": {
86
+ "@aspect/nup-xlsx-core": "^1.0.0",
87
+ "@aspect/nup-xlsx-tokens": "^1.0.0",
88
+ "react": "^18.0.0",
89
+ "react-dom": "^18.0.0",
90
+ "vue": "^3.0.0"
91
+ },
92
+ "peerDependenciesMeta": {
93
+ "@aspect/nup-xlsx-core": {
94
+ "optional": true
95
+ },
96
+ "@aspect/nup-xlsx-tokens": {
97
+ "optional": true
98
+ },
99
+ "react": {
100
+ "optional": true
101
+ },
102
+ "react-dom": {
103
+ "optional": true
104
+ },
105
+ "vue": {
106
+ "optional": true
107
+ }
108
+ },
109
+ "devDependencies": {
110
+ "@types/react": "^18.2.0",
111
+ "@types/react-dom": "^18.2.0",
112
+ "react": "^18.2.0",
113
+ "react-dom": "^18.2.0",
114
+ "tsup": "^8.0.0",
115
+ "typescript": "^5.0.0",
116
+ "vitest": "^1.0.0",
117
+ "vue": "^3.4.0"
118
+ },
119
+ "engines": {
120
+ "node": ">=18.0.0"
121
+ },
122
+ "repository": {
123
+ "type": "git",
124
+ "url": "https://github.com/aspect/nup-xlsx-suite.git",
125
+ "directory": "packages/nup-xlsx-preview"
126
+ },
127
+ "bugs": {
128
+ "url": "https://github.com/aspect/nup-xlsx-suite/issues"
129
+ },
130
+ "homepage": "https://github.com/aspect/nup-xlsx-suite/tree/main/packages/nup-xlsx-preview#readme"
131
+ }