Skip to content

Commit 930bd3a

Browse files
committed
ui-kit: init
0 parents  commit 930bd3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+10631
-0
lines changed

.adr-dir

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/ADR/decisions

.editorconfig

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
indent_style = space
11+
indent_size = 2
12+
insert_final_newline = true
13+
14+
# Tab indentation (no size specified)
15+
[{Makefile,go.mod,go.sum,*.go,*.go.tmpl}]
16+
indent_style = tab
17+
indent_size = 4
18+
19+
# Use tabs
20+
[**.mk]
21+
indent_style = tab
22+
indent_size = 4
23+
24+
# Use tabs
25+
[**.xml]
26+
indent_size = 4
27+
28+
[*.rs]
29+
trim_trailing_whitespace = true
30+
indent_size = 4
31+
32+
[*.py]
33+
indent_size = 4

.eslintrc.cjs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['react-refresh'],
12+
rules: {
13+
'react-refresh/only-export-components': [
14+
'warn',
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
}

.gitattributes

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
*.sops.yaml diff=sopsdiffer
4+
5+
# do not show lock files while doing git diff
6+
package-lock.json -diff
7+
yarn.lock -diff
8+
go.sum -diff linguist-generated
9+
10+
# config for Gitlab 16.10+ --------------------------------------------------------------------------------
11+
# Collapse all files with a .txt extension
12+
*.txt gitlab-generated

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
.eslintcache
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
27+
# Storybook
28+
storybook-static

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
storybook-static

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "all"
5+
}

.storybook/main.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { StorybookConfig } from '@storybook/experimental-nextjs-vite'
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
6+
addons: [
7+
'@storybook/addon-links',
8+
'@storybook/addon-essentials',
9+
'@storybook/addon-themes',
10+
'@storybook/addon-interactions',
11+
'@storybook/addon-controls',
12+
'@chromatic-com/storybook',
13+
'@storybook/addon-a11y',
14+
'@storybook/addon-coverage',
15+
'@storybook/addon-jest',
16+
'storybook-addon-next',
17+
'storybook-addon-next-router',
18+
],
19+
20+
core: {
21+
builder: '@storybook/builder-vite',
22+
},
23+
24+
framework: {
25+
name: '@storybook/experimental-nextjs-vite',
26+
options: {}
27+
},
28+
29+
features: {},
30+
typescript: {},
31+
32+
docs: {}
33+
}
34+
35+
export default config

.storybook/preview-head.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script>
2+
window.global = window;
3+
</script>

.storybook/preview.tsx

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Preview } from '@storybook/react'
2+
import { Provider } from 'react-wrap-balancer'
3+
4+
import '@fontsource/roboto/300.css'
5+
import '@fontsource/roboto/400.css'
6+
import '@fontsource/roboto/500.css'
7+
import '@fontsource/roboto/700.css'
8+
import '@fontsource/caveat'
9+
import '@fontsource/material-icons'
10+
import { ThemeProvider } from '@mui/material/styles'
11+
import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'
12+
import { ThemeProvider as ThemeProviderNext } from 'next-themes'
13+
import { LocalizationProvider } from '@mui/x-date-pickers'
14+
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
15+
16+
import '../src/theme/styles.css'
17+
import { theme } from '../src/theme/theme'
18+
19+
const preview: Preview = {
20+
decorators: [
21+
(Story) => {
22+
return (
23+
// @ts-ignore
24+
(<ThemeProviderNext
25+
enableSystem
26+
attribute="class"
27+
defaultTheme={'light'}
28+
>
29+
<ThemeProvider theme={theme}>
30+
<InitColorSchemeScript />
31+
<LocalizationProvider dateAdapter={AdapterDayjs}>
32+
<Provider>
33+
<Story />
34+
</Provider>
35+
</LocalizationProvider>
36+
</ThemeProvider>
37+
</ThemeProviderNext>)
38+
);
39+
},
40+
],
41+
42+
tags: []
43+
}
44+
45+
export default preview

README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## @shortlink/ui-kit
2+
3+
<img width='200' height='200' src="./docs/public/logo.svg">
4+
5+
> [!NOTE]
6+
> The UI Kit is a collection of React components that are used in the ShortLink app.
7+
8+
### Installation
9+
10+
```bash
11+
npm install @shortlink/ui-kit # for GitLab registry
12+
npm install shortlink-ui-kit # for NPM registry
13+
```
14+
15+
### Usage
16+
17+
```jsx
18+
import { ToggleDarkMode } from '@shortlink/ui-kit'
19+
20+
const App = () => {
21+
return <ToggleDarkMode />
22+
}
23+
```
24+
25+
### Storybook
26+
27+
The UI Kit is documented with Storybook. You can run it locally with:
28+
29+
```bash
30+
npm run storybook
31+
```
32+
33+
### Stack
34+
35+
- ReactJS
36+
- Pretty code base
37+
- Typescript
38+
- ESLint/Prettier
39+
- Pretty UI
40+
- TailwindCSS
41+
- Storybook (for UI)
42+
- Jest

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

docs/public/logo.svg

+295
Loading

docs/public/logo.webp

92.8 KB
Binary file not shown.

eslint.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// const shortlink = require('eslint-config-shortlink')
2+
3+
export default [
4+
// ...shortlink,
5+
{
6+
ignores: ['.*', 'node_modules', 'dist', 'storybook-static'],
7+
},
8+
]

0 commit comments

Comments
 (0)