Skip to content

Commit 8614c4a

Browse files
feat: add initial implementation of a React application with slider and tablist components
0 parents  commit 8614c4a

38 files changed

Lines changed: 12187 additions & 0 deletions

.github/workflows/cd.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CD - Deploy Storybook
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy-storybook:
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: github-pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
steps:
18+
- name: Checkout repo
19+
uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
28+
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
29+
with:
30+
install_command: npm ci
31+
build_command: npm run build-storybook
32+
path: storybook-static
33+
checkout: false

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo 🧾
14+
uses: actions/checkout@v4
15+
- name: Setup Node
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: 'npm'
20+
- name: Install dependencies 📦
21+
run: npm ci
22+
23+
- name: Format (prettier) 👨🏻‍🎨
24+
run: npm run prettier -- --check
25+
- name: Lint (ESLint) 🔦
26+
run: npm run lint

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

.storybook/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @type { import('@storybook/react-vite').StorybookConfig } */
2+
const config = {
3+
'stories': ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
4+
'addons': ['@storybook/addon-essentials'],
5+
'framework': {
6+
'name': '@storybook/react-vite',
7+
'options': {},
8+
},
9+
};
10+
export default config;

.storybook/preview.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import '../src/components/styles.css';
2+
3+
/** @type { import('@storybook/react').Preview } */
4+
const preview = {
5+
parameters: {
6+
controls: {
7+
matchers: {
8+
color: /(background|color)$/i,
9+
date: /Date$/i,
10+
},
11+
},
12+
},
13+
};
14+
15+
export default preview;

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# React + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.

eslint.config.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
import js from '@eslint/js';
3+
import react from 'eslint-plugin-react';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import jsxA11Y from 'eslint-plugin-jsx-a11y'
6+
import globals from 'globals';
7+
import prettierConfig from "eslint-config-prettier";
8+
9+
/** @type {import('eslint').Linter.Config[]} */
10+
export default [
11+
{
12+
ignores: [
13+
'node_modules/',
14+
'**/.cache/',
15+
'storybook-static/',
16+
'playwright-report/',
17+
'test-results/',
18+
'dist/',
19+
],
20+
},
21+
js.configs.recommended,
22+
{
23+
files: ['./src/**/*.{js,jsx}', './test/**/*.{js,jsx}'],
24+
languageOptions: {
25+
parserOptions: {
26+
ecmaVersion: 'latest',
27+
sourceType: 'module',
28+
ecmaFeatures: {
29+
jsx: true
30+
}
31+
},
32+
globals: {
33+
...globals.browser
34+
}
35+
},
36+
settings: {
37+
react: {
38+
version: 'detect',
39+
},
40+
},
41+
plugins: {
42+
react,
43+
'jsx-a11y': jsxA11Y,
44+
'react-hooks': reactHooks
45+
},
46+
rules: {
47+
...react.configs.recommended.rules,
48+
...jsxA11Y.configs.recommended.rules,
49+
'react/prop-types': 'off'
50+
}
51+
},
52+
prettierConfig,
53+
];

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>

main.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react';
2+
import { StrictMode } from 'react';
3+
import { createRoot } from 'react-dom/client';
4+
5+
createRoot(document.getElementById('root')).render(<StrictMode></StrictMode>);

0 commit comments

Comments
 (0)