Skip to content

Commit

Permalink
feat: add first version of the app
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed Mar 30, 2023
1 parent d4e07ac commit 7a63bf1
Show file tree
Hide file tree
Showing 105 changed files with 4,000 additions and 294 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:
- name: Eslint
run: pnpm lint

- name: Typescript
run: pnpm typecheck

- name: Build
run: pnpm build

- name: Check Types
run: pnpm typecheck

- name: Test
run: pnpm test:coverage

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pnpm add -D @storylite/storylite
- [ ] Different responsive sizes + custom size
- [ ] Zoom in/out
- [ ] Accessibility
- [ ] Multiple resizable viewports (side by side)
- [ ] Create `packages/examples` package
- [ ] Try out with React, Vue, Svelte, Solid, and Qwik.

Expand All @@ -74,6 +75,8 @@ pnpm add -D @storylite/storylite
- [ ] Better handling of the iframes
- [ ] Better addons API
- [ ] Use redux-toolkit
- [ ] SSR/SSG support
- [ ] Stories format compatible with Storybook (backwards compatible with SB v6 and v7)
- [ ] Better mobile experience (specially for sidebars and toolbars)

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
context: .
dockerfile: ./.devcontainer/Dockerfile
target: universal
command: ['turbo', 'run', 'dev']
command: ['pnpm', 'dev']
ports:
- '7707:7707'
volumes:
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,41 @@
"build": "turbo run build",
"changelog": "changeset",
"changeset": "changeset",
"dev": "turbo run dev --no-deps --no-cache --parallel",
"dev": "pnpm install && turbo run dev --no-deps --no-cache --parallel --concurrency 15",
"format": "pnpm format:packages && pnpm format:code && pnpm lint:fix",
"format:code": "prettier --write \"**/*.{cjs,js,jsx,ts,tsx,json,yml,yaml,css,scss,md,mdx}\"",
"format:packages": "sort-package-json \"package.json\" \"packages/*/package.json\"",
"postinstall": "pnpm format:packages",
"lint": "eslint --cache \"./packages/*/src/**/*.{ts,tsx}\" --max-warnings=0",
"lint": "eslint --cache \"./packages/*/src/**/*.{ts,tsx}\" --max-warnings=50",
"lint:fix": "eslint --fix \"./packages/*/src/**/*.{ts,tsx}\"",
"prepare": "husky install",
"pretty": "pnpm format",
"release": "pnpm run build && changeset publish",
"test": "turbo run test --concurrency=1",
"test:coverage": "turbo run test:coverage --concurrency=1",
"typecheck": "turbo run typecheck --concurrency=1",
"update:latest": "pnpm update -r --latest",
"version": "changeset version && pnpm install --no-frozen-lockfile && pnpm run format"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@commitlint/cli": "^17.5.0",
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@ianvs/prettier-plugin-sort-imports": "^3.7.2",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"prettier": "^2.8.7",
"pretty-quick": "^3.1.3",
"sort-package-json": "^2.4.1",
"turbo": "^1.8.5",
"typescript": "^4.9.5 || ^5.0.2"
"turbo": "^1.8.8",
"typescript": "^5.0.2"
},
"packageManager": "pnpm@8.0.0",
"packageManager": "pnpm@8.1.0",
"engines": {
"node": ">=18.5.0"
}
Expand Down
15 changes: 15 additions & 0 deletions packages/plugins/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@storylite/plugins",
"version": "0.0.0",
"type": "module",
"scripts": {},
"devDependencies": {
"@types/node": "^18.15.11",
"@vitest/coverage-c8": "^0.29.8",
"glob": "^9.3.2",
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vite-tsconfig-paths": "^4.0.7",
"vitest": "^0.29.8"
}
}
1 change: 1 addition & 0 deletions packages/storylite/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ lerna-debug.log*

node_modules
dist
types/
dist-ssr
*.local

Expand Down
29 changes: 18 additions & 11 deletions packages/storylite/package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
{
"name": "@storylite/storylite",
"version": "0.0.0",
"description": "",
"type": "module",
"files": [
"dist"
],
"scripts": {
"build": "tsc && vite build",
"build": "vite build",
"dev": "PORT=${STORYLITE_PORT:-7707} vite",
"preview": "vite preview",
"test": "vitest",
"test": "vitest --run",
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui",
"test:ui": "pnpm test:coverage && open coverage/index.html && vitest --ui --open",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"lucide-react": "^0.128.0",
"lucide-react": "^0.129.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.9.0"
"react-router-dom": "^6.10.0"
},
"devDependencies": {
"@swc/core": "^1.3.41",
"@storylite/support": "workspace:*",
"@swc/core": "^1.3.42",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jsdom": "^21.1.1",
"@types/node": "^18.15.10",
"@types/react": "^18.0.30",
"@types/node": "^18.15.11",
"@types/react": "^18.0.31",
"@types/react-dom": "^18.0.11",
"@types/testing-library__jest-dom": "^5.14.5",
"@vitejs/plugin-react": "^3.1.0",
"@vitejs/plugin-react-swc": "^3.2.0",
"@vitest/coverage-c8": "^0.29.7",
"@vitest/ui": "^0.29.7",
"@vitest/coverage-istanbul": "^0.29.8",
"@vitest/ui": "^0.29.8",
"eslint-plugin-react": "^7.32.2",
"glob": "^9.3.2",
"jsdom": "^21.1.1",
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vitest": "^0.29.7"
"vite-plugin-dts": "^2.1.0",
"vitest": "^0.29.8"
}
}
14 changes: 0 additions & 14 deletions packages/storylite/src/App.css

This file was deleted.

23 changes: 0 additions & 23 deletions packages/storylite/src/App.test.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions packages/storylite/src/App.tsx

This file was deleted.

115 changes: 115 additions & 0 deletions packages/storylite/src/components/Sidebar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
.Sidebar {
position: relative;
padding: 0;
background: var(--theme-bg-color-panel);
color: var(--theme-font-color-panel);
border-right: 1px solid var(--theme-border-color);
transition: width 0.2s ease-in-out;
transition-property: width, margin;
width: 0;
overflow: hidden;
pointer-events: none;
margin-left: -100px;
margin-right: 100px;
}

.Sidebar[data-open='true'] {
width: 220px;
pointer-events: unset;
margin-left: 0;
margin-right: 0;
}

html[data-color-scheme='dark'] .Sidebar {
border-color: transparent;
}

@media (prefers-color-scheme: dark) {
html[data-color-scheme='auto'] .Sidebar {
border-color: transparent;
}
}

.Content {
position: relative;
min-width: 220px;
}

.Title {
position: relative;
}

/* MENU NAV */

.Nav {
/*margin-top: 1px;*/
}

.Nav ul,
.Nav li {
position: relative;
display: block;
list-style: none;
padding: 0;
margin: 0;
}

.ListBtn {
padding: 0.5rem 1rem;
font-size: 0.8rem;
line-height: 1rem;
color: inherit;
display: flex;
text-decoration: none;
transition: background-color 0.2s linear;
cursor: pointer;
}

.ListBtn .Text,
.ListBtn .Icon,
.ListBtn .Icon svg {
vertical-align: middle;
display: inline-block;
}

.ListBtn .Text {
white-space: nowrap; /* Prevents the text from breaking into multiple lines */
overflow: hidden; /* Hides any overflowing text */
text-overflow: ellipsis; /* Shows an ellipsis at the end of the block */
}

.ListBtn .Icon {
margin-right: 5px;
}

.ListBtn .Icon svg {
width: 12px;
height: 12px;
}

.ListBtn:hover {
background-color: rgba(0, 0, 0, 0.07);
}

html[data-color-scheme='dark'] .ListBtn:hover {
background-color: rgba(0, 0, 0, 0.4);
}

html[data-color-scheme='dark'] .Active .ListBtn:hover,
.Active .ListBtn {
background-color: var(--theme-color-primary);
text-decoration: none;
color: #fff;
}

.WithNestedList .NestedList .ListBtn {
padding-left: 2rem;
}

.NestedList .Icon {
color: var(--theme-color-primary);
}

.NestedList .Active .Icon {
color: inherit;
}
Loading

0 comments on commit 7a63bf1

Please sign in to comment.