project-portfolio 1.0.8 → 1.1.1

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.
@@ -79,7 +79,7 @@ export function ProjectCard({ project, schema, priority, variant = "card", baseP
79
79
  transition: "box-shadow 0.3s",
80
80
  fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
81
81
  boxSizing: "border-box",
82
- }, children: [_jsxs("div", { style: { position: "relative", aspectRatio: "16/10", overflow: "hidden", flexShrink: 0 }, children: [imageUrl ? (_jsx("img", { src: imageUrl, alt: project.title, loading: priority ? "eager" : "lazy", style: { width: "100%", height: "100%", objectFit: "cover" } })) : (_jsx("div", { style: { position: "absolute", inset: 0, backgroundColor: "#f4f4f5" } })), _jsx("div", { style: {
82
+ }, children: [_jsxs("div", { style: { position: "relative", width: "100%", height: "220px", overflow: "hidden", flexShrink: 0 }, children: [imageUrl ? (_jsx("img", { src: imageUrl, alt: project.title, loading: priority ? "eager" : "lazy", style: { width: "100%", height: "100%", objectFit: "cover" } })) : (_jsx("div", { style: { position: "absolute", inset: 0, backgroundColor: "#f4f4f5" } })), _jsx("div", { style: {
83
83
  position: "absolute",
84
84
  inset: 0,
85
85
  background: "linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.25) 50%, transparent 100%)",
@@ -113,7 +113,7 @@ export function ProjectCard({ project, schema, priority, variant = "card", baseP
113
113
  fontSize: "11px",
114
114
  fontWeight: 600,
115
115
  padding: "3px 10px",
116
- }, children: badgeValue })), _jsx("h3", { style: { all: "revert", color: "#fff", fontWeight: 700, fontSize: "20px", lineHeight: 1.3, margin: 0, fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" }, children: project.title }), locationString && (_jsx("p", { style: { color: "rgba(255,255,255,0.8)", fontSize: "14px", margin: 0 }, children: locationString }))] })] }), _jsxs("div", { style: { display: "flex", flexDirection: "column", flex: 1, padding: "1.5rem" }, children: [(project.blurb || project.description) && (_jsx("p", { style: { fontSize: "14px", color: "#3f3f46", lineHeight: 1.6, margin: "0 0 16px 0" }, children: project.blurb || project.description })), tagFields.map((field) => {
116
+ }, children: badgeValue })), _jsx("h3", { style: { color: "#fff", fontWeight: 700, fontSize: "20px", lineHeight: 1.3, margin: 0, padding: 0, fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" }, children: project.title }), locationString && (_jsx("p", { style: { color: "rgba(255,255,255,0.8)", fontSize: "14px", margin: 0 }, children: locationString }))] })] }), _jsxs("div", { style: { display: "flex", flexDirection: "column", flex: 1, padding: "1.5rem" }, children: [(project.blurb || project.description) && (_jsx("p", { style: { fontSize: "14px", color: "#3f3f46", lineHeight: 1.6, margin: "0 0 16px 0" }, children: project.blurb || project.description })), tagFields.map((field) => {
117
117
  const vals = parseMultiValue(project.custom_field_values[field.key]);
118
118
  if (vals.length === 0)
119
119
  return null;
@@ -0,0 +1,11 @@
1
+ import type { CustomFieldSchema } from "./types";
2
+ interface ProjectFiltersProps {
3
+ fields: CustomFieldSchema[];
4
+ filters: Record<string, string>;
5
+ onFilterChange: (key: string, value: string) => void;
6
+ onClearFilters: () => void;
7
+ hasActiveFilters: boolean;
8
+ }
9
+ export declare function ProjectFilters({ fields, filters, onFilterChange, onClearFilters, hasActiveFilters, }: ProjectFiltersProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=ProjectFilters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectFilters.d.ts","sourceRoot":"","sources":["../src/ProjectFilters.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,UAAU,mBAAmB;IAC3B,MAAM,EAAE,iBAAiB,EAAE,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpD,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,EAAE,mBAAmB,2CA8FrB"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function ProjectFilters({ fields, filters, onFilterChange, onClearFilters, hasActiveFilters, }) {
3
+ const deduped = fields.filter((f, i, arr) => arr.findIndex((x) => x.key === f.key) === i);
4
+ return (_jsxs("div", { style: {
5
+ marginBottom: "2rem",
6
+ paddingBottom: "2rem",
7
+ borderBottom: "1px solid #e4e4e7",
8
+ display: "flex",
9
+ flexWrap: "wrap",
10
+ alignItems: "flex-end",
11
+ gap: "1rem",
12
+ }, children: [deduped.map((field, fieldIndex) => {
13
+ if (field.type === "select" || field.type === "multi-select") {
14
+ return (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [_jsx("label", { style: { fontSize: "13px", fontWeight: 500, color: "#71717a" }, children: field.name }), _jsxs("select", { value: filters[field.key] || "all", onChange: (e) => onFilterChange(field.key, e.target.value === "all" ? "" : e.target.value), style: {
15
+ width: "180px",
16
+ padding: "8px 12px",
17
+ border: "1px solid #e4e4e7",
18
+ borderRadius: "6px",
19
+ fontSize: "14px",
20
+ backgroundColor: "#fff",
21
+ color: "#18181b",
22
+ outline: "none",
23
+ cursor: "pointer",
24
+ }, children: [_jsxs("option", { value: "all", children: ["All ", field.name] }), [...new Set(field.options)].map((option, i) => (_jsx("option", { value: option, children: option }, `${field.key}-opt-${i}`)))] })] }, `filter-${fieldIndex}-${field.key}`));
25
+ }
26
+ if (field.type === "text" || field.type === "location") {
27
+ return (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [_jsx("label", { style: { fontSize: "13px", fontWeight: 500, color: "#71717a" }, children: field.name }), _jsx("input", { type: "text", placeholder: `Search ${field.name.toLowerCase()}...`, value: filters[field.key] || "", onChange: (e) => onFilterChange(field.key, e.target.value), style: {
28
+ width: "180px",
29
+ padding: "8px 12px",
30
+ border: "1px solid #e4e4e7",
31
+ borderRadius: "6px",
32
+ fontSize: "14px",
33
+ color: "#18181b",
34
+ outline: "none",
35
+ } })] }, `filter-${fieldIndex}-${field.key}`));
36
+ }
37
+ return null;
38
+ }), hasActiveFilters && (_jsx("button", { onClick: onClearFilters, style: {
39
+ display: "flex",
40
+ alignItems: "center",
41
+ gap: "4px",
42
+ padding: "8px 12px",
43
+ background: "none",
44
+ border: "none",
45
+ fontSize: "14px",
46
+ color: "#71717a",
47
+ cursor: "pointer",
48
+ }, children: "\u00D7 Clear filters" }))] }));
49
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectPortfolio.d.ts","sourceRoot":"","sources":["../src/ProjectPortfolio.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAuED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,UAAU,EACV,OAAO,EACP,QAAsB,EACtB,UAAe,GAChB,EAAE,qBAAqB,oDA8BvB"}
1
+ {"version":3,"file":"ProjectPortfolio.d.ts","sourceRoot":"","sources":["../src/ProjectPortfolio.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAuED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,UAAU,EACV,OAAO,EACP,QAAsB,EACtB,UAAe,GAChB,EAAE,qBAAqB,oDAwCvB"}
@@ -59,8 +59,14 @@ export async function ProjectPortfolio({ clientSlug, apiBase, basePath = "/proje
59
59
  return (_jsx("div", { style: { textAlign: "center", padding: "4rem 0" }, children: _jsx("p", { style: { color: "#71717a" }, children: "No projects found." }) }));
60
60
  }
61
61
  return (_jsx("div", { style: {
62
- display: "grid",
63
- gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
64
- gap: "2rem",
65
- }, children: projects.map((project, index) => (_jsx(ProjectCard, { project: project, schema: schema, basePath: basePath, priority: index === 0 }, project.id))) }));
62
+ width: "100%",
63
+ maxWidth: "1280px",
64
+ margin: "0 auto",
65
+ padding: "2rem 1.5rem",
66
+ boxSizing: "border-box",
67
+ }, children: _jsx("div", { style: {
68
+ display: "grid",
69
+ gridTemplateColumns: "repeat(3, 1fr)",
70
+ gap: "2rem",
71
+ }, children: projects.map((project, index) => (_jsx(ProjectCard, { project: project, schema: schema, basePath: basePath, priority: index === 0 }, project.id))) }) }));
66
72
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { ProjectPortfolio } from "./ProjectPortfolio";
2
2
  export type { ProjectPortfolioProps } from "./ProjectPortfolio";
3
- export { ProjectGrid } from "./ProjectGrid";
4
3
  export { ProjectCard } from "./ProjectCard";
5
4
  export type { CardVariant } from "./ProjectCard";
6
5
  export type { Project, CustomFieldSchema, CustomFieldValue, LocationValue, Media, } from "./types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,KAAK,GACN,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,KAAK,GACN,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export { ProjectPortfolio } from "./ProjectPortfolio";
2
- export { ProjectGrid } from "./ProjectGrid";
3
2
  export { ProjectCard } from "./ProjectCard";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-portfolio",
3
- "version": "1.0.8",
3
+ "version": "1.1.1",
4
4
  "description": "Self-contained project portfolio component for Next.js App Router. Drop in one component, pass a clientSlug and apiBase, done.",
5
5
  "keywords": ["nextjs", "react", "portfolio", "projects"],
6
6
  "license": "MIT",
@@ -21,12 +21,12 @@
21
21
  },
22
22
  "peerDependencies": {
23
23
  "next": ">=13.0.0",
24
- "react": ">=18.0.0",
25
- "react-dom": ">=18.0.0"
24
+ "react": ">=19.0.0",
25
+ "react-dom": ">=19.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/react": "^18.0.0",
29
- "@types/react-dom": "^18.0.0",
28
+ "@types/react": "^19.0.0",
29
+ "@types/react-dom": "^19.0.0",
30
30
  "typescript": "^5.0.0"
31
31
  }
32
32
  }