-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
284 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
'@nordcom/nordstar-heading': patch | ||
'@nordcom/nordstar-card': patch | ||
'@nordcom/nordstar-view': patch | ||
'@nordcom/nordstar': patch | ||
'@nordcom/nordstar-system': patch | ||
--- | ||
|
||
Add a few layout-related css variables. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@nordcom/nordstar-view': patch | ||
--- | ||
|
||
Add `<View/>` component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# @nordcom/nordstar-view | ||
|
||
Display a dedicated `view` (aka `page`) in your app. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install @nordcom/nordstar-view | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/package.json", | ||
"name": "@nordcom/nordstar-view", | ||
"type": "module", | ||
"version": "0.0.7", | ||
"description": "", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./view": { | ||
"import": "./dist/view.js", | ||
"types": "./dist/view.d.ts" | ||
} | ||
}, | ||
"sideEffects": false, | ||
"engines": { | ||
"npm": ">=8", | ||
"node": ">=18 <=21" | ||
}, | ||
"scripts": { | ||
"build": "vite build", | ||
"dev": "vite build --watch", | ||
"clean": "rimraf dist .turbo", | ||
"typecheck": "tsc --noEmit", | ||
"prepack": "clean-package", | ||
"postpack": "clean-package restore" | ||
}, | ||
"keywords": [ | ||
"nordstar", | ||
"nordcom", | ||
"component", | ||
"react", | ||
"view", | ||
"nordstar-view" | ||
], | ||
"author": { | ||
"name": "Nordcom Group Inc.", | ||
"email": "[email protected]", | ||
"url": "https://nordcom.io/" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Filiph Siitam Sandström", | ||
"email": "[email protected]", | ||
"url": "https://github.com/filiphsps/" | ||
} | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/NordcomInc/nordstar.git", | ||
"directory": "packages/components/view" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/NordcomInc/nordstar/issues" | ||
}, | ||
"homepage": "https://nordstar.nordcom.io/docs/components/view/", | ||
"files": [ | ||
"dist" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@nordcom/nordstar-system": "*" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=18" | ||
}, | ||
"devDependencies": { | ||
"clean-package": "2.2.0", | ||
"react": "18.2.0" | ||
}, | ||
"clean-package": "../../../clean-package.config.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
syntax: 'postcss-scss', | ||
plugins: [] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import View from './view'; | ||
|
||
export type { ViewProps } from './view'; | ||
|
||
export { View }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: center; | ||
|
||
.content { | ||
width: calc(100vw - calc(var(--layout-page-spacing) * 2)); | ||
max-width: var(--layout-page-width); | ||
margin: var(--layout-page-spacing); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import type { ViewProps } from '../src'; | ||
import { View } from '../src'; | ||
|
||
const story: Meta<typeof View> = { | ||
title: 'Components/View', | ||
component: View, | ||
argTypes: {} | ||
}; | ||
|
||
const Template = (args: ViewProps) => <View {...args}>You view's content goes here!</View>; | ||
|
||
export const Standard = { | ||
render: Template, | ||
args: {} | ||
}; | ||
|
||
export default story; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
import { View } from '../src'; | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
describe('components', () => { | ||
describe('view', () => { | ||
describe('View', () => { | ||
it('should render correctly', () => { | ||
const wrapper = render(<View />); | ||
|
||
expect(() => wrapper.unmount()).not.toThrow(); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { forwardRef } from '@nordcom/nordstar-system'; | ||
import type { ReactNode } from 'react'; | ||
import styles from './view.module.scss'; | ||
|
||
export type ViewProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
const View = forwardRef<'main', ViewProps>((props, ref) => { | ||
const { className } = props; | ||
const classes = `${styles.content}${className ? ` ${className}` : ''}`; | ||
|
||
// TODO: Figure out a better way to exclude props from being passed to the DOM element. | ||
return ( | ||
<div className={styles.container}> | ||
<main ref={ref} {...{ ...props, className: undefined }} className={classes} /> | ||
</div> | ||
); | ||
}); | ||
|
||
View.displayName = 'Nordstar.Layout.View'; | ||
|
||
export default View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"rootDir": "./src", | ||
"outDir": "dist" | ||
}, | ||
"exclude": ["node_modules", "dist", "src/**/*.test.*", "src/**/*.stories.*"], | ||
"extends": "../../../tsconfig.json", | ||
"include": ["src", "index.ts", "../../../@types/declaration.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import react from '@vitejs/plugin-react'; | ||
import { resolve } from 'node:path'; | ||
import { defineConfig } from 'vite'; | ||
import dts from 'vite-plugin-dts'; | ||
import { libInjectCss } from 'vite-plugin-lib-inject-css'; | ||
import tsConfigPaths from 'vite-tsconfig-paths'; | ||
|
||
export default defineConfig({ | ||
root: resolve(__dirname), | ||
build: { | ||
target: 'esnext', | ||
copyPublicDir: false, | ||
emptyOutDir: true, | ||
outDir: resolve(__dirname, 'dist'), | ||
sourcemap: true, | ||
lib: { | ||
entry: ['src/index.ts', 'src/view.tsx'], | ||
formats: ['es'] | ||
}, | ||
rollupOptions: { | ||
external: ['react', 'react-dom'], | ||
output: { | ||
globals: { | ||
react: 'React', | ||
'react-dom': 'ReactDOM' | ||
} | ||
} | ||
} | ||
}, | ||
plugins: [ | ||
react(), | ||
libInjectCss(), | ||
tsConfigPaths(), | ||
dts({ | ||
clearPureImport: false, | ||
entryRoot: resolve(__dirname, 'src'), | ||
rollupTypes: true, | ||
insertTypesEntry: true, | ||
tsconfigPath: resolve(__dirname, 'tsconfig.json') | ||
}) | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
98d2d1b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nordstar – ./docs
nordstar-git-master-nordcom.vercel.app
nordstar-nordcom.vercel.app
nordstar.vercel.app
nordstar.nordcom.io