Skip to content

Commit 64c44ae

Browse files
committed
first commit
0 parents  commit 64c44ae

Some content is hidden

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

80 files changed

+15483
-0
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = true

.storybook/main.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { StorybookConfig } from 'storybook-framework-qwik';
2+
import { qwikVite } from '@builder.io/qwik/optimizer';
3+
4+
const config: StorybookConfig = {
5+
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
6+
framework: {
7+
name: 'storybook-framework-qwik',
8+
},
9+
core: {
10+
renderer: 'storybook-framework-qwik',
11+
},
12+
stories: [
13+
// ...rootMain.stories,
14+
'../packages/hooks/src/**/*.stories.@(js|jsx|ts|tsx)',
15+
],
16+
17+
viteFinal(config) {
18+
config.plugins = config.plugins || []
19+
config.plugins.push(qwikVite({
20+
srcDir: './playground/src',
21+
}))
22+
return config;
23+
},
24+
};
25+
26+
export default config;

.storybook/preview-head.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<script>
2+
window.global = window;
3+
</script>
4+
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>

.storybook/preview.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Parameters } from 'storybook-framework-qwik';
2+
3+
export const parameters: Parameters = {
4+
a11y: {
5+
config: {},
6+
options: {
7+
checks: { 'color-contrast': { options: { noScroll: true } } },
8+
restoreScroll: true,
9+
},
10+
},
11+
options: {
12+
showRoots: true,
13+
},
14+
docs: {
15+
iframeHeight: '200px',
16+
},
17+
};

.storybook/tsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"experimentalDecorators": true,
5+
"emitDecoratorMetadata": true
6+
},
7+
8+
"exclude": ["../**/*.spec.ts", "../**/*.test.ts", "../**/*.spec.tsx", "../**/*.test.tsx"],
9+
"include": [
10+
"../packages/**/*.stories.ts",
11+
"../packages/**/*.stories.js",
12+
"../packages/**/*.stories.jsx",
13+
"../packages/**/*.stories.tsx",
14+
"../packages/**/*.stories.mdx",
15+
"*.ts",
16+
"*.js",
17+
"preview.tsx"
18+
]
19+
}

LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Vaggelis Yfantis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Qwiky (WIP)
2+
3+
> **This is a WIP, please don't use it in production a lot of things will break as we move forward with the development.**
4+
5+
Qwiky is a collection of utilities, hooks and components for building awesome apps with [Qwik](https://qwik.builder.io/)
6+
7+
8+
## 🦄 Hooks
9+
Collection of essential Qwik Hooks
10+
11+
## 📦 Getting Started - (Not working at the moment)
12+
```shell
13+
npm install @qwiky/hooks
14+
# or
15+
pnpm add @qwiky/hooks
16+
# or
17+
yarn add @qwiky/hooks
18+
```
19+
20+
## 🎨 TODO: Components
21+
UI component Library
22+
23+
24+
# 🏗️ Contribute
25+
26+
1. Fork it!
27+
2. Create your feature branch: git checkout -b feat/new-hook
28+
3. Commit your changes: git commit -am 'feat(hooks): add a new hook'
29+
4. Push to the branch: git push origin feat/new-hook
30+
5. Submit a pull request :D
31+
32+
33+
## 🤩 Thanks
34+
35+
This project is heavily inspired by the following awesome projects.
36+
37+
- [vueuse/vueuse](https://github.com/vueuse/vueuse)
38+
- [mantinedev/mantine](https://github.com/mantinedev/mantine)
39+
- [streamich/react-use](https://github.com/streamich/react-use)
40+
41+
Also thanks to the [Qwik Team](https://github.com/builderio/qwik)
42+
43+
And thanks to [all the contributors on GitHub](https://github.com/octoper/qwiky/contributors)!
44+
45+
## 📄 License
46+
47+
[MIT License](LICENSE) © 2023 [Vaggelis Yfantis](https://github.com/octoper)

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"private": true,
3+
"type": "module",
4+
"scripts": {
5+
"build": "turbo run build --filter='./packages/**'",
6+
"dev": "turbo run dev --filter='./packages/**'",
7+
"play": "turbo run dev --filter='./playground/'",
8+
"lint": "turbo run lint",
9+
"lint:fix": "turbo run lint:fix",
10+
"typecheck": "tsc --noEmit",
11+
"test": "vitest",
12+
"storybook": "storybook dev -p 6006",
13+
"build-storybook": "storybook build"
14+
},
15+
"devDependencies": {
16+
"@builder.io/qwik": "^1.0.0",
17+
"@storybook/addon-essentials": "7.0.7",
18+
"@storybook/addon-links": "7.0.7",
19+
"@storybook/blocks": "7.0.7",
20+
"@storybook/builder-vite": "7.0.7",
21+
"@storybook/html": "7.0.7",
22+
"@storybook/html-vite": "7.0.7",
23+
"@types/jsdom": "^21.1.1",
24+
"eslint": "^8.39.0",
25+
"esno": "^0.16.3",
26+
"prettier": "^2.8.8",
27+
"rimraf": "^5.0.0",
28+
"storybook": "7.0.7",
29+
"storybook-framework-qwik": "0.2.0",
30+
"turbo": "^1.9.3",
31+
"typescript": "^5.0.4",
32+
"vite": "^4.3.3",
33+
"vite-plugin-dts": "^2.3.0",
34+
"vitest": "^0.30.1"
35+
}
36+
}

packages/hooks/.eslintignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
**/*.log
2+
**/.DS_Store
3+
*.
4+
.vscode/settings.json
5+
.history
6+
.yarn
7+
bazel-*
8+
bazel-bin
9+
bazel-out
10+
bazel-qwik
11+
bazel-testlogs
12+
dist
13+
dist-dev
14+
lib
15+
lib-types
16+
etc
17+
external
18+
node_modules
19+
temp
20+
tsc-out
21+
tsdoc-metadata.json
22+
target
23+
output
24+
rollup.config.js
25+
build
26+
.cache
27+
.vscode
28+
.rollup.cache
29+
dist
30+
tsconfig.tsbuildinfo
31+
vite.config.ts

packages/hooks/.eslintrc.cjs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
'eslint:recommended',
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:qwik/recommended',
12+
],
13+
parser: '@typescript-eslint/parser',
14+
parserOptions: {
15+
tsconfigRootDir: __dirname,
16+
project: ['./tsconfig.json'],
17+
ecmaVersion: 2021,
18+
sourceType: 'module',
19+
ecmaFeatures: {
20+
jsx: true,
21+
},
22+
},
23+
plugins: ['@typescript-eslint'],
24+
rules: {
25+
'@typescript-eslint/no-explicit-any': 'off',
26+
'@typescript-eslint/explicit-module-boundary-types': 'off',
27+
'@typescript-eslint/no-inferrable-types': 'off',
28+
'@typescript-eslint/no-non-null-assertion': 'off',
29+
'@typescript-eslint/no-empty-interface': 'off',
30+
'@typescript-eslint/no-namespace': 'off',
31+
'@typescript-eslint/no-empty-function': 'off',
32+
'@typescript-eslint/no-this-alias': 'off',
33+
'@typescript-eslint/ban-types': 'off',
34+
'@typescript-eslint/ban-ts-comment': 'off',
35+
'prefer-spread': 'off',
36+
'no-case-declarations': 'off',
37+
'no-console': 'off',
38+
'@typescript-eslint/no-unused-vars': ['error'],
39+
'qwik/use-method-usage': 'off',
40+
},
41+
};

packages/hooks/.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Build
2+
/dist
3+
/lib
4+
/lib-types
5+
/server
6+
7+
# Development
8+
node_modules
9+
10+
# Cache
11+
.cache
12+
.mf
13+
.vscode
14+
.rollup.cache
15+
tsconfig.tsbuildinfo
16+
17+
# Logs
18+
logs
19+
*.log
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
pnpm-debug.log*
24+
lerna-debug.log*
25+
26+
# Editor
27+
!.vscode/extensions.json
28+
.idea
29+
.DS_Store
30+
*.suo
31+
*.ntvs*
32+
*.njsproj
33+
*.sln
34+
*.sw?
35+
36+
# Yarn
37+
.yarn/*
38+
!.yarn/releases

packages/hooks/.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Files Prettier should not format
2+
**/*.log
3+
**/.DS_Store
4+
*.
5+
dist
6+
node_modules

packages/hooks/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 🦄 Qwiky Hooks
2+
Collection of essential Qwik Hooks
3+
4+
## 📦 Getting Started - (Not working at the moment)
5+
```shell
6+
npm install @qwiky/hooks
7+
# or
8+
pnpm add @qwiky/hooks
9+
# or
10+
yarn add @qwiky/hooks
11+
```

packages/hooks/package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "@qwiky/hooks",
3+
"main": "./dist/index.qwik.mjs",
4+
"qwik": "./dits/index.qwik.mjs",
5+
"types": "./dist/types/index.d.ts",
6+
"exports": {
7+
".": {
8+
"import": "./dist/index.qwik.mjs",
9+
"require": "./dist/index.qwik.cjs",
10+
"types": "./dist/types/index.d.ts"
11+
}
12+
},
13+
"files": [
14+
"dist",
15+
"README.md"
16+
],
17+
"engines": {
18+
"node": ">=15.0.0"
19+
},
20+
"private": false,
21+
"type": "module",
22+
"scripts": {
23+
"clean": "rm -rf dist",
24+
"build": "vite build --mode lib",
25+
"dev": "vite build --mode lib --watch",
26+
"lint": "eslint \"src/**/*.ts*\"",
27+
"lint:fix": "pnpm run lint --fix"
28+
},
29+
"peerDependencies": {
30+
"@builder.io/qwik": "1.0.0"
31+
},
32+
"devDependencies": {
33+
"@types/eslint": "8.37.0",
34+
"@types/node": "^18.16.1",
35+
"@typescript-eslint/eslint-plugin": "5.59.1",
36+
"@typescript-eslint/parser": "5.59.1",
37+
"eslint": "8.39.0",
38+
"eslint-plugin-qwik": "latest",
39+
"np": "7.6.1",
40+
"prettier": "2.8.8",
41+
"typescript": "5.0.4",
42+
"undici": "5.22.0",
43+
"vite": "4.3.3"
44+
}
45+
}

packages/hooks/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export * from './useActiveElement'
2+
export * from './useNetwork'
3+
export * from './useWindowScroll'
4+
export * from './useWindowSize'
5+
export * from './useWindowFocus'
6+
export * from './useIdle'
7+
export * from './useHover'
8+
export * from './useLastChanged'
9+
export * from './useDocumentVisibility'
10+
export * from './useTitle'
11+
export * from './useTextSelection'
12+
export * from './useMediaQuery'
13+
export * from './useIntersectionObserver'
14+
export * from './useMouse'

0 commit comments

Comments
 (0)