-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui-trackoccupancydiagram: setup sub-repo
Co-authored-by: Uriel-Sautron <uriel.sautron@gmail.com> Signed-off-by: Yohh <durandyohan@zaclys.net>
- Loading branch information
1 parent
c0df267
commit 3ffe206
Showing
16 changed files
with
175 additions
and
7 deletions.
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
storybook/stories/TrackOccupancyDiagram/TrackOccupancyDiagram.stories.tsx
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,39 @@ | ||
import React from 'react'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { | ||
TrackOccupancyManchette, | ||
TrackOccupancyCanvas, | ||
} from '../../../ui-trackoccupancydiagram/src/index'; | ||
|
||
const TrackOccupancyDiagram = () => ( | ||
<div> | ||
<TrackOccupancyManchette /> | ||
<TrackOccupancyCanvas /> | ||
</div> | ||
); | ||
|
||
const meta: Meta<typeof TrackOccupancyDiagram> = { | ||
title: 'TrackOccupancyDiagram/Rendering', | ||
component: TrackOccupancyDiagram, | ||
decorators: [(Story) => <Story />], | ||
parameters: { | ||
layout: 'centered', | ||
backgrounds: { | ||
default: 'dark', | ||
}, | ||
}, | ||
args: {}, | ||
|
||
render: () => <TrackOccupancyDiagram />, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof TrackOccupancyDiagram>; | ||
|
||
export const TrackOccupancyDiagramStoryDefault: Story = { | ||
args: {}, | ||
}; |
This file was deleted.
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
Empty file.
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,58 @@ | ||
{ | ||
"name": "@osrd-project/ui-trackoccupancydiagram", | ||
"version": "0.0.1-dev", | ||
"license": "LGPL-3.0-or-later", | ||
"bugs": "https://github.com/osrd-project/osrd-ui/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/osrd-project/osrd-ui.git", | ||
"directory": "ui-trackoccupancydiagram" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"type": "module", | ||
"module": "./dist/index.esm.js", | ||
"types": "./dist/index.d.ts", | ||
"main": "./dist/index.esm.js", | ||
"style": "dist/theme.css", | ||
"files": [ | ||
"/dist" | ||
], | ||
"exports": { | ||
"./dist/theme.css": "./dist/theme.css", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.esm.js" | ||
} | ||
}, | ||
"scripts": { | ||
"rollup": "rollup -c", | ||
"clean": "rimraf dist", | ||
"build": "npm run rollup", | ||
"watch": "NODE_ENV=development rollup -c -w", | ||
"test": "vitest run --dir src/__tests__", | ||
"prepublishOnly": "npm run clean && npm run build", | ||
"lint": "eslint src --max-warnings 0", | ||
"lint:fix": "eslint src --fix" | ||
}, | ||
"dependencies": { | ||
"@types/chroma-js": "^2.4.4", | ||
"chroma-js": "^3.1.1", | ||
"classnames": "^2.5.1", | ||
"tailwindcss": "^3.4.1" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=18.0" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer": "^10.4.17", | ||
"postcss": "^8.4.37", | ||
"postcss-assets": "^6.0.0", | ||
"postcss-import": "^16.0.0", | ||
"postcss-preset-env": "^10.0.5", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"rollup-plugin-serve": "^1.1.1" | ||
} | ||
} |
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,3 @@ | ||
import generateBaseRollupConfig from '../rollup-base.config.js'; | ||
|
||
export default generateBaseRollupConfig('osrdTrackOccupancyDiagram', ['react']); |
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,7 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
describe('test to remove', () => { | ||
it('should return the good value', () => { | ||
expect(1 + 1).toEqual(2); | ||
}); | ||
}); |
5 changes: 5 additions & 0 deletions
5
ui-trackoccupancydiagram/src/components/TrackOccupancyCanvas.tsx
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 React from 'react'; | ||
|
||
const TrackOccupancyCanvas = () => <div>TrackOccupancyCanvas</div>; | ||
|
||
export default TrackOccupancyCanvas; |
5 changes: 5 additions & 0 deletions
5
ui-trackoccupancydiagram/src/components/TrackOccupancyManchette.tsx
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 React from 'react'; | ||
|
||
const TrackOccupancyManchette = () => <div>TrackOccupancyManchette</div>; | ||
|
||
export default TrackOccupancyManchette; |
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 '@osrd-project/ui-core/dist/theme.css'; | ||
import './styles/main.css'; | ||
|
||
export { default as TrackOccupancyCanvas } from './components/TrackOccupancyCanvas'; | ||
export { default as TrackOccupancyManchette } from './components/TrackOccupancyManchette'; |
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,3 @@ | ||
@import 'tailwindcss/base'; | ||
@import 'tailwindcss/components'; | ||
@import 'tailwindcss/utilities'; |
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,6 @@ | ||
import osrdUiPreset from '../tailwind-preset.js'; | ||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
presets: [osrdUiPreset], | ||
content: ['./src/**/*.{js,jsx,ts,tsx}'], | ||
}; |
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,10 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"include": ["./src/**/*"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"declarationDir": "./dist", | ||
"typeRoots": ["./node_modules/@types", "../raw.d.ts"] | ||
} | ||
} |