-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
165 changed files
with
24,244 additions
and
0 deletions.
There are no files selected for viewing
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,210 @@ | ||
// disable compile check | ||
const DEV_ERROR = 'error'; | ||
const REACT_ERROR = 2; | ||
|
||
const overrideRules = { | ||
'react-hooks/rules-of-hooks': DEV_ERROR, | ||
'react-hooks/exhaustive-deps': 'off', | ||
'react/jsx-curly-newline': [ REACT_ERROR ], | ||
'react/jsx-curly-spacing': [ REACT_ERROR, { when: 'always', children: true } ], | ||
'react/jsx-equals-spacing': [ REACT_ERROR, 'never' ], | ||
'react/jsx-tag-spacing': [ REACT_ERROR, { beforeSelfClosing: 'always' } ], | ||
'no-extra-semi': [ DEV_ERROR ], | ||
'no-mixed-spaces-and-tabs': [ DEV_ERROR, 'smart-tabs' ], | ||
'no-unreachable': [ DEV_ERROR ], | ||
'no-unused-vars': [ DEV_ERROR ], | ||
'array-bracket-spacing': [ DEV_ERROR, 'always' ], | ||
'array-element-newline': [ | ||
DEV_ERROR, | ||
{ | ||
multiline: true, | ||
minItems: 3, | ||
}, | ||
], | ||
'block-spacing': [ DEV_ERROR, 'always' ], | ||
'object-curly-spacing': [ DEV_ERROR, 'always' ], | ||
'quotes': [ | ||
DEV_ERROR, | ||
'single', | ||
{ allowTemplateLiterals: true }, | ||
], | ||
'quote-props': [ DEV_ERROR, 'consistent-as-needed' ], | ||
'comma-spacing': [ | ||
DEV_ERROR, | ||
{ | ||
before: false, | ||
after: true, | ||
}, | ||
], | ||
'comma-style': [ DEV_ERROR ], | ||
'array-bracket-newline': [ DEV_ERROR, { multiline: true } ], | ||
'object-curly-newline': [ DEV_ERROR, { multiline: true } ], | ||
'indent': [ | ||
'warn', | ||
2, | ||
{ SwitchCase: 1 }, | ||
], | ||
'sort-imports': [ DEV_ERROR, { ignoreDeclarationSort: true, allowSeparatedGroups: true } ], | ||
'semi': [ DEV_ERROR, 'always' ], | ||
'semi-spacing': [ DEV_ERROR ], | ||
'semi-style': [ DEV_ERROR, 'last' ], | ||
'comma-dangle': [ | ||
DEV_ERROR, | ||
{ | ||
arrays: 'always-multiline', | ||
objects: 'always-multiline', | ||
imports: 'always-multiline', | ||
exports: 'always-multiline', | ||
functions: 'never', | ||
}, | ||
], | ||
'newline-per-chained-call': [ DEV_ERROR, { ignoreChainWithDepth: 1 } ], | ||
'no-extra-boolean-cast': [ 'error' ], | ||
'no-empty': [ 'error' ], | ||
'implicit-arrow-linebreak': [ DEV_ERROR, 'beside' ], | ||
// 'jsonc/sort-keys': [ DEV_ERROR ], | ||
'jsonc/indent': [ | ||
DEV_ERROR, | ||
2, | ||
{}, | ||
], | ||
'jsonc/array-bracket-spacing': [ DEV_ERROR, 'always' ], | ||
'jsonc/array-bracket-newline': [ | ||
DEV_ERROR, | ||
{ | ||
multiline: true, | ||
minItems: 2, | ||
}, | ||
], | ||
'jsonc/array-element-newline': [ | ||
DEV_ERROR, | ||
{ | ||
multiline: true, | ||
minItems: 2, | ||
}, | ||
], | ||
'jsonc/object-curly-newline': [ DEV_ERROR, { minProperties: 2 } ], | ||
'jsonc/object-curly-spacing': [ DEV_ERROR, 'always' ], | ||
'jsonc/key-spacing': [ | ||
DEV_ERROR, | ||
{ | ||
beforeColon: false, | ||
afterColon: true, | ||
mode: 'strict', | ||
}, | ||
], | ||
'jsx-quotes': [ DEV_ERROR, 'prefer-double' ], | ||
'key-spacing': [ | ||
DEV_ERROR, | ||
{ | ||
beforeColon: false, | ||
afterColon: true, | ||
mode: 'strict', | ||
}, | ||
], | ||
'arrow-spacing': [ DEV_ERROR ], | ||
'prefer-arrow-callback': [ DEV_ERROR ], | ||
'arrow-body-style': [ DEV_ERROR, 'as-needed' ], | ||
'arrow-parens': [ DEV_ERROR, 'as-needed' ], | ||
'no-confusing-arrow': [ DEV_ERROR ], | ||
'no-multi-spaces': [ DEV_ERROR ], | ||
'no-trailing-spaces': [ DEV_ERROR ], | ||
'space-in-parens': [ DEV_ERROR, 'never' ], | ||
'space-before-function-paren': [ | ||
DEV_ERROR, | ||
{ | ||
anonymous: 'always', | ||
named: 'never', | ||
asyncArrow: 'always', | ||
}, | ||
], | ||
}; | ||
|
||
const config = { | ||
parser: '@typescript-eslint/parser', | ||
plugins: [ | ||
'react', | ||
'react-hooks', | ||
'@typescript-eslint', | ||
], | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:jsonc/recommended-with-jsonc', | ||
'plugin:storybook/recommended', | ||
], | ||
env: { es6: true, browser: true }, | ||
rules: { | ||
'constructor-super': [ 'error' ], | ||
'for-direction': [ 'error' ], | ||
'getter-return': [ 'error' ], | ||
'no-case-declarations': [ 'error' ], | ||
'no-class-assign': [ 'error' ], | ||
'no-compare-neg-zero': [ 'error' ], | ||
'no-cond-assign': [ 'error' ], | ||
'no-const-assign': [ 'error' ], | ||
'no-constant-condition': [ 'error' ], | ||
'no-control-regex': [ 'error' ], | ||
'no-debugger': [ 'error' ], | ||
'no-delete-var': [ 'error' ], | ||
'no-dupe-args': [ 'error' ], | ||
'no-dupe-class-members': [ 'error' ], | ||
'no-dupe-else-if': [ 'error' ], | ||
'no-dupe-keys': [ 'error' ], | ||
'no-duplicate-case': [ 'error' ], | ||
'no-empty-character-class': [ 'error' ], | ||
'no-empty-pattern': [ 'error' ], | ||
'no-ex-assign': [ 'error' ], | ||
'no-fallthrough': [ 'error' ], | ||
'no-func-assign': [ 'error' ], | ||
'no-global-assign': [ 'error' ], | ||
'no-import-assign': [ 'error' ], | ||
'no-inner-declarations': [ 'error' ], | ||
'no-invalid-regexp': [ 'error' ], | ||
'no-irregular-whitespace': [ 'error' ], | ||
'no-loss-of-precision': [ 'error' ], | ||
'no-misleading-character-class': [ 'error' ], | ||
'no-new-symbol': [ 'error' ], | ||
'no-nonoctal-decimal-escape': [ 'error' ], | ||
'no-obj-calls': [ 'error' ], | ||
'no-octal': [ 'error' ], | ||
'no-redeclare': [ 'error' ], | ||
'no-regex-spaces': [ 'error' ], | ||
'no-self-assign': [ 'error' ], | ||
'no-setter-return': [ 'error' ], | ||
'no-shadow-restricted-names': [ 'error' ], | ||
'no-sparse-arrays': [ 'error' ], | ||
'no-this-before-super': [ 'error' ], | ||
'no-undef': [ 'error' ], | ||
'no-unexpected-multiline': [ 'error' ], | ||
'no-unsafe-finally': [ 'error' ], | ||
'no-unsafe-negation': [ 'error' ], | ||
'no-unsafe-optional-chaining': [ 'error' ], | ||
'no-unused-labels': [ 'error' ], | ||
'no-useless-backreference': [ 'error' ], | ||
'no-useless-catch': [ 'error' ], | ||
'no-useless-escape': [ 'warn' ], | ||
'no-with': [ 'error' ], | ||
'require-yield': [ 'error' ], | ||
'use-isnan': [ 'error' ], | ||
'valid-typeof': [ 'error' ], | ||
...overrideRules, | ||
}, | ||
overrides: [ | ||
{ | ||
files: [ '**/*.ts?(x)' ], | ||
rules: { | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
}, | ||
}, | ||
], | ||
parserOptions: { | ||
ecmaFeatures: { jsx: true }, | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
ignorePatterns: [ '*.json' ], | ||
|
||
}; | ||
|
||
module.exports = config; |
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 @@ | ||
node_modules |
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,19 @@ | ||
import type { StorybookConfig } from "@storybook/react-vite"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
}; | ||
export default config; |
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,15 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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,36 @@ | ||
{ | ||
"editor.insertSpaces": false, | ||
"editor.formatOnType": false, | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint", | ||
"eslint.format.enable": true, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"json", | ||
"jsonc", | ||
"json5" | ||
], | ||
"editor.tabSize": 2, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "vscode.typescript-language-features" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "vscode.json-language-features" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "vscode.typescript-language-features" | ||
}, | ||
"[scss]": { | ||
"editor.defaultFormatter": "vscode.css-language-features" | ||
}, | ||
"scss.format.newlineBetweenSelectors": false, | ||
"scss.format.spaceAroundSelectorSeparator": true, | ||
"css.format.newlineBetweenSelectors": false, | ||
"css.format.spaceAroundSelectorSeparator": true, | ||
"[typescript]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" } | ||
} |
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,15 @@ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
|
||
const presets = [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
"@babel/preset-typescript", | ||
]; | ||
const plugins = []; | ||
|
||
return { | ||
presets, | ||
plugins | ||
}; | ||
} |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import React, { PropsWithChildren } from 'react'; | ||
import { BookProps } from './Book.types'; | ||
declare const Book: React.FC<PropsWithChildren<BookProps>>; | ||
export default Book; |
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,21 @@ | ||
import React from 'react'; | ||
export interface BookProps { | ||
cover?: string; | ||
title?: string; | ||
subtitle?: string; | ||
leftCornerRadius?: string; | ||
rightCornerRadius?: string; | ||
creaseMargin?: string; | ||
creaseWidth?: string; | ||
thickness?: string; | ||
coverColor?: string; | ||
coverMargin?: string; | ||
transitionTimingFunction?: TransitionTimingFunction; | ||
transitionDuration: TransitionDuration; | ||
coverCloseAngle?: number; | ||
coverOpenAngle?: number; | ||
coverContent?: React.JSX.Element | React.JSX.Element[]; | ||
pageContent?: React.JSX.Element | React.JSX.Element[]; | ||
} | ||
export type TransitionDuration = `${number}ms` | `${number}s`; | ||
export type TransitionTimingFunction = 'ease' | 'ease-in' | 'ease-in-out' | 'ease-out' | 'jump-both' | 'jump-end' | 'jump-none' | 'jump-start' | 'linear' | 'step-end' | 'step-start' | 'steps' | `cubic-bezier(${string})` | `linear(${string})`; |
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 @@ | ||
/// <reference types="react" /> | ||
export declare const BookWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>; | ||
export declare const FrontCover: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>; | ||
export declare const BackCover: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>; | ||
export declare const Pages: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>; |
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,4 @@ | ||
import React from 'react'; | ||
import { ButtonProps } from './Button.types'; | ||
declare const Button: React.FC<ButtonProps>; | ||
export default Button; |
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,8 @@ | ||
import { MouseEventHandler } from 'react'; | ||
export interface ButtonProps { | ||
text?: string; | ||
primary?: boolean; | ||
disabled?: boolean; | ||
size: 'small' | 'medium' | 'large'; | ||
onClick: MouseEventHandler<HTMLButtonElement>; | ||
} |
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,4 @@ | ||
import { FC } from 'react'; | ||
import { InputProps } from './Input.types'; | ||
declare const Input: FC<InputProps>; | ||
export default Input; |
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,11 @@ | ||
import { ChangeEventHandler } from "react"; | ||
export interface InputProps { | ||
id?: string; | ||
label?: string; | ||
error?: boolean; | ||
message?: string; | ||
success?: boolean; | ||
disabled?: boolean; | ||
placeholder?: string; | ||
onChange?: ChangeEventHandler<HTMLInputElement>; | ||
} |
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,2 @@ | ||
export * from './Button'; | ||
export * from './Input'; |
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 @@ | ||
export * from './components'; |
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 @@ | ||
export declare const interpolateNumber: (value: number, inputMin: number, inputMax: number, outputMin: number, outputMax: number) => number; |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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,4 @@ | ||
import React, { PropsWithChildren } from 'react'; | ||
import { BookProps } from './Book.types'; | ||
declare const Book: React.FC<PropsWithChildren<BookProps>>; | ||
export default Book; |
Oops, something went wrong.