Skip to content

Commit 80c8848

Browse files
authored
V0.2.1 (#3)
* replace default styles from css module with inline css styles (better to ship) * replace default styles from css module with inline css styles (better to ship) * bump * v0.2.1
1 parent 92498e8 commit 80c8848

File tree

11 files changed

+213
-1461
lines changed

11 files changed

+213
-1461
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.2.1
4+
5+
some polishing, and build changes:
6+
7+
- ship default styles as css-in-js instead of css file (better for shipping)
8+
- package.json is now type:"module".
9+
310
## 0.2.0
411

512
- dropped `minVisibleItems` prop in favor of simplicity (same effect can achieved with reversed flex direction and reversing the items array)

demo/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
"tslib": "^2.8.1",
4848
"typescript": "~5.8.3",
4949
"typescript-eslint": "^8.39.1",
50-
"vite": "^7.1.2",
51-
"vite-plugin-prerender": "^1.0.8",
52-
"vite-prerender-plugin": "^0.5.12"
50+
"vite": "^7.1.2"
5351
}
5452
}

demo/src/App.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,22 @@ footer {
337337
.code-preview-content {
338338
background: white;
339339
}
340+
341+
.demo-button {
342+
background: none;
343+
border: 1.5px solid #bfc9db;
344+
cursor: pointer;
345+
font-size: 14px;
346+
font-weight: 500;
347+
color: #495057;
348+
transition: color 0.2s;
349+
border-radius: 4px;
350+
padding: 8px;
351+
border: 1px solid #ccc;
352+
}
353+
354+
.demo-button:hover {
355+
color: #007bff;
356+
border-color: #007bff;
357+
box-shadow: 0 4px 16px 0 rgba(37, 99, 235, 0.08);
358+
}

demo/src/components/RadixVirtualizedOverflowList.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,21 @@ const VirtualizedDropdown = React.forwardRef<
116116
setScrollElement(node?.querySelector(".rt-ScrollAreaViewport") as HTMLDivElement | null);
117117
}}
118118
style={{
119-
minWidth: "200px",
120-
maxWidth: "400px",
121119
maxHeight: "300px",
122120
...dropdownStyle,
123121
}}
124122
>
125123
<>
126124
{enableSearch && (
127-
<div style={{ marginBottom: "8px" }}>
125+
<div style={{ marginBottom: "8px", position: "sticky", top: 0, backgroundColor: "white" }}>
128126
<input
127+
autoFocus
129128
type="text"
130129
placeholder={searchPlaceholder}
131130
value={searchTerm}
132131
onChange={(e) => setSearchTerm(e.target.value)}
133132
style={{
134-
width: "100%",
135133
padding: "6px 8px",
136-
borderRadius: "4px",
137-
fontSize: "14px",
138134
}}
139135
/>
140136
</div>
@@ -150,7 +146,6 @@ const VirtualizedDropdown = React.forwardRef<
150146
gap: "8px",
151147
alignItems: "flex-start",
152148
position: "relative",
153-
border: "1px solid #ccc",
154149
height: `${virtualizer.getTotalSize()}px`,
155150
minWidth: `${containerWidth}px`,
156151
}}

demo/vite.config.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";
3-
import { fileURLToPath, URL } from "node:url";
43
import vike from "vike/plugin";
54

65
export default defineConfig(() => {
76
const appMode = process.env.VITE_APP_MODE || ("spa" as "spa" | "ssr");
87
console.log(`VITE_APP_MODE is "${appMode}"`);
8+
const isProduction = process.env.NODE_ENV === "production";
99

1010
return {
1111
plugins: [react(), vike()],
@@ -15,12 +15,6 @@ export default defineConfig(() => {
1515
// Handle CommonJS modules
1616
// external: ["react-copy-to-clipboard"],
1717
},
18-
base: "/react-responsive-overflow-list/",
19-
resolve: {
20-
// trick to avoid needing to build-watch the library when developing the demo
21-
alias: {
22-
"react-responsive-overflow-list": fileURLToPath(new URL("../src/index.ts", import.meta.url)),
23-
},
24-
},
18+
base: isProduction ? "/react-responsive-overflow-list/" : "/",
2519
};
2620
});

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"name": "react-responsive-overflow-list",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
4+
"type": "module",
45
"description": "A responsive React component that shows as many items as can fit within constraints, hiding overflow items behind a configurable overflow renderer",
5-
"main": "dist/index.js",
6-
"module": "dist/index.mjs",
6+
"module": "dist/index.js",
7+
"main": "dist/index.cjs",
78
"types": "dist/index.d.ts",
89
"exports": {
910
".": {
1011
"types": "./dist/index.d.ts",
11-
"import": "./dist/index.mjs",
12-
"require": "./dist/index.js"
12+
"import": "./dist/index.js",
13+
"require": "./dist/index.cjs"
1314
}
1415
},
1516
"files": [

0 commit comments

Comments
 (0)