Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Housekeeping/components 3.24.0 #113

Merged
merged 5 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions app/phn-header/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
'use client';

import { PButton, PIcon, PLinkPure } from '@porsche-design-system/components-react/ssr';
import React, { useEffect } from 'react';
import { defineCustomElements } from '@porschehn/navigation/loader';
import React from 'react';
// import { defineCustomElements } from '@porschehn/navigation/loader';

export default function PhnHeaderPage() {
useEffect(() => {
if (typeof window !== 'undefined') {
defineCustomElements(window);
}
}, []);
// useEffect(() => {
// if (typeof window !== 'undefined') {
// defineCustomElements(window);
// }
// }, []);

return (
<>
<phn-header env="preview" locale="de-DE" style={{ position: 'absolute', left: 0, right: 0 }} />
{/*<phn-header env="preview" locale="de-DE" style={{ position: 'absolute', left: 0, right: 0 }} />*/}

<div style={{ paddingTop: 180 }}>
<PButton>Some PButton</PButton>
Expand Down
10 changes: 10 additions & 0 deletions app/styles/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { buttonStyle } from './vanilla-extract.css';

export default function StylesPage() {
return (
<>
<p>Vanilla Extract Test</p>
<button className={buttonStyle}>Button with hover and focus style</button>
</>
);
};
8 changes: 8 additions & 0 deletions app/styles/vanilla-extract.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { style } from '@vanilla-extract/css';
import { getHoverStyle, getFocusStyle } from '@porsche-design-system/components-react/styles/vanilla-extract';

export const buttonStyle = style({
backgroundColor: 'white',
...getFocusStyle(),
...getHoverStyle(),
});
3 changes: 2 additions & 1 deletion components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PDivider, PHeadline } from '@porsche-design-system/components-react/ssr
import React from 'react';
import { PrefixedLink } from './prefixedLink';

export const Header = (): JSX.Element => (
export const Header = () => (
<>
<PHeadline variant="headline-2" align="center">
Example usage of the Porsche-Design-System NextJS
Expand All @@ -14,6 +14,7 @@ export const Header = (): JSX.Element => (
<PrefixedLink href="/utilities">Utilities</PrefixedLink>
<PrefixedLink href="/phn-header">Phn Header</PrefixedLink>
<PrefixedLink href="/layout-shift">Layout Shift</PrefixedLink>
<PrefixedLink href="/styles">Styles</PrefixedLink>

<PDivider className="divider" />
</>
Expand Down
2 changes: 1 addition & 1 deletion components/prefixedLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PLinkPure } from '@porsche-design-system/components-react/ssr';
import Link, { LinkProps } from 'next/link';
import React, { PropsWithChildren } from 'react';

export const PrefixedLink = ({ href, ...props }: PropsWithChildren<LinkProps>): JSX.Element => (
export const PrefixedLink = ({ href, ...props }: PropsWithChildren<LinkProps>) => (
<PLinkPure>
<Link href={href} as={`${process.env.BASE_PATH ?? ''}${href}`} {...props} />
</PLinkPure>
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
10 changes: 9 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const {
createVanillaExtractPlugin
} = require('@vanilla-extract/next-plugin');

const withVanillaExtract = createVanillaExtractPlugin();

const BASE_PATH = process.env.CI ? '/sample-integration-nextjs' : '';

/** @type {import('next').NextConfig} */
module.exports = {
const nextConfig = {
output: 'export',
assetPrefix: BASE_PATH,
env: {
Expand All @@ -15,3 +21,5 @@ module.exports = {
return config;
},
};

module.exports = withVanillaExtract(nextConfig);
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,31 @@
"clean:build": "rm -rf ./out && rm -rf ./.next"
},
"dependencies": {
"@porsche-design-system/components-react": "3.20.0-rc.1",
"@porsche-design-system/components-react": "3.24.0",
"@porsche-design-system/utilities": "5.4.1",
"@porschehn/navigation": "3.3.0",
"next": "14.2.5",
"react": "18.3.1",
"react-dom": "18.3.1"
"next": "15.1.4",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@porsche-design-system/prettier-config": "^1.0.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.6",
"@types/node": "^20.12.8",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"core-js": "^3.37.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"@types/node": "^22.10.5",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
"@vanilla-extract/css": "^1.17.0",
"@vanilla-extract/next-plugin": "^2.4.8",
"core-js": "^3.40.0",
"ignore-loader": "^0.1.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.5",
"prettier": "^3.4.2",
"regenerator-runtime": "0.14.1",
"sass": "^1.76.0",
"ts-jest": "^29.1.2",
"typescript": "^5.4.5"
"sass": "^1.83.1",
"ts-jest": "^29.2.5",
"typescript": "^5.7.2"
},
"volta": {
"node": "20.10.0",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
Expand Down
Loading
Loading