Skip to content

Commit

Permalink
Create design-system package
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszbachorski committed Jun 4, 2024
1 parent ef1a895 commit 8da12e2
Show file tree
Hide file tree
Showing 34 changed files with 13,207 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@
},
"overrides": [
{
"files": ["app/**/*.ts?(x)"],
"files": ["app/**/*.ts?(x)", "**/*.stories.ts?(x)"],
"rules": {
"import/no-default-export": "off"
}
}
},
]
}
11 changes: 10 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
//
// SPDX-License-Identifier: MIT
//

import type { Metadata } from 'next'
import type { ReactNode } from 'react'
import './globals.css'
import '@stanfordbdhg/design-system/main.css'
import { themeToCSSVariables, lightTheme } from '@stanfordbdhg/design-system'

export const metadata: Metadata = {
title: 'ENGAGE-HF Web Frontend',
Expand All @@ -22,6 +23,14 @@ interface RootLayoutProps {
export default function RootLayout({ children }: RootLayoutProps) {
return (
<html lang="en">
<head>
<style>
{`
:root { ${themeToCSSVariables(lightTheme)} }
`}
</style>
</head>

<body>{children}</body>
</html>
)
Expand Down
8 changes: 4 additions & 4 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
//

import Image from 'next/image'
import { generateGreeting } from '@stanfordbdhg/example-package'

export default function Home() {
const greeting = generateGreeting()

return (
<div className="flex min-h-screen items-center justify-center">
<div className="flex flex-col items-center">
Expand All @@ -21,7 +18,10 @@ export default function Home() {
width={634}
height={235}
/>
<h1 className="mt-4 text-center text-3xl">{`${greeting.message} to the ${greeting.project}`}</h1>
<h1 className="mt-4 text-center text-3xl">
Welcome to the Stanford Biodesign Digital Health ENGAGE-HF Web
Frontend
</h1>
</div>
</div>
)
Expand Down
4 changes: 0 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@ module.exports = {
},
],
},
moduleNameMapper: {
'^@stanfordbdhg/example-package$':
'<rootDir>/packages/example-package/dist',
},
}
111 changes: 102 additions & 9 deletions package-lock.json

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

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@
},
"private": true,
"scripts": {
"dev": "concurrently \"next dev\" \"npm --prefix packages/example-package run watch\"",
"prebuild": "npm --prefix packages/example-package run build",
"buildTypes": "npm --prefix packages/example-package run buildTypes",
"dev": "concurrently \"next dev\" \"npm --prefix packages/design-system run watch\"",
"prebuild": "npm --prefix packages/design-system run build",
"build": "next build",
"start": "next start",
"lint": "eslint .",
"lint:fix": "eslint . --fix & prettier --write .",
"lint:ci": "npm run buildTypes && eslint --output-file eslint_report.json --format json .",
"pretest": "npm --prefix packages/example-package run build",
"lint:ci": "npm run prebuild && eslint --output-file eslint_report.json --format json .",
"pretest": "npm run prebuild",
"test": "jest",
"docs": "typedoc",
"docs:ci": "typedoc --out ./out/docs --githubPages true"
},
"dependencies": {
"@stanfordbdhg/example-package": "file:../packages/example-package",
"@stanfordbdhg/design-system": "file:./packages/design-system",
"next": "^14",
"prettier-plugin-tailwindcss": "^0.5.14",
"react": "^18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
# SPDX-License-Identifier: MIT
#

dist
dist
node_modules
*storybook.log
16 changes: 16 additions & 0 deletions packages/design-system/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @type { import('@storybook/react-vite').StorybookConfig } */
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
}
export default config
Loading

0 comments on commit 8da12e2

Please sign in to comment.