Skip to content

Commit

Permalink
Components: Add <Heading/> component.
Browse files Browse the repository at this point in the history
This also fixes `scss`/`css` support and removes support for the dated
`commonjs` format that shouldn't be used by anyone anymore.
  • Loading branch information
filiphsps committed Nov 17, 2023
1 parent 7f132eb commit ba39c4c
Show file tree
Hide file tree
Showing 32 changed files with 339 additions and 169 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-garlics-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@nordcom/nordstar-heading': patch
---

Add initial `<Heading/>` component.
10 changes: 10 additions & 0 deletions .changeset/selfish-peaches-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@nordcom/nordstar-heading': patch
'@nordcom/nordstar-card': patch
'@nordcom/nordstar': patch
---

Remove `commonjs` support.

While we could probably quite easily continue to support it we absolutely shouldn't.
There is no reason what so ever to still use `commonjs` in 2023 almost 2024, like literally none.
2 changes: 2 additions & 0 deletions @types/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare module '*.module.css';
declare module '*.module.scss';
2 changes: 2 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"homepage": "https://nordstar.nordcom.io/",
"dependencies": {
"@nordcom/nordstar": "*",
"@nordcom/nordstar-card": "*",
"@nordcom/nordstar-heading": "*",
"next": "14.0.3",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
18 changes: 18 additions & 0 deletions docs/src/app/page.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.container {
display: flex;
flex-direction: column;
gap: 1rem;

.title {
max-width: 52rem;
display: flex;
flex-direction: column;
gap: 0.25rem;
}

.content {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}
}
19 changes: 17 additions & 2 deletions docs/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import { Card } from '@nordcom/nordstar-card';
import { Heading } from '@nordcom/nordstar-heading';
import styles from './page.module.scss';

export default async function IndexPage() {
return (
<main>
<h1>nordstar</h1>
<main className={styles.container}>
<div className={styles.title}>
<Heading>Nordstar</Heading>
<Heading subheading>
An opinionated component library for building human-centric user interfaces
</Heading>
</div>

<div className={styles.content}>
<Card></Card>
<Card></Card>
<Card></Card>
</div>
</main>
);
}
208 changes: 55 additions & 153 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"jsdom": "22.1.0",
"lint-staged": "15.1.0",
"plop": "4.0.0",
"postcss": "8.4.31",
"postcss-scss": "4.0.9",
"prettier": "3.1.0",
"prettier-eslint": "16.1.2",
"react": "18.2.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/components/card/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
syntax: 'postcss-scss',
plugins: [],
}
2 changes: 1 addition & 1 deletion packages/components/card/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"compilerOptions": {
"baseUrl": "."
},
"include": ["src/**/*"],
"include": ["src/**/*", "../../../@types/declaration.d.ts"],
"exclude": ["src/**/*.stories.*", "src/**/*.test.*"]
}
2 changes: 1 addition & 1 deletion packages/components/card/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default defineConfig({
cjsInterop: true,
clean: true,
entry: ['src/index.ts', 'src/**/*.ts(x)?', '!src/**/*.(stories|test).ts(x)?'],
format: ['cjs', 'esm'],
format: ['esm'],
keepNames: true,
skipNodeModulesBundle: true,
sourcemap: true,
Expand Down
Loading

0 comments on commit ba39c4c

Please sign in to comment.