@jk-core/components 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +63 -0
- package/.stylelintrc.json +29 -0
- package/package.json +4 -9
- package/src/styles/color.scss +1 -0
- package/tsconfig.json +13 -0
- package/vite.config.ts +58 -0
- package/dist/Calendar/components/DayTile/index.d.ts +0 -11
- package/dist/Calendar/components/MonthTile/index.d.ts +0 -9
- package/dist/Calendar/components/YearTile/index.d.ts +0 -8
- package/dist/Calendar/hooks/useCalendarNav.d.ts +0 -14
- package/dist/Calendar/hooks/useDateSelect.d.ts +0 -14
- package/dist/Calendar/index.d.ts +0 -12
- package/dist/Calendar/type.d.ts +0 -5
- package/dist/Calendar/utils/getWeeksInMonth.d.ts +0 -5
- package/dist/Calendar/utils/isInRange.d.ts +0 -3
- package/dist/Calendar/utils/isSameDay.d.ts +0 -3
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1007
- package/dist/index.js.map +0 -1
- package/dist/index.umd.cjs +0 -31
- package/dist/index.umd.cjs.map +0 -1
- package/dist/style.css +0 -1
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"eslint:recommended",
|
|
8
|
+
"plugin:@typescript-eslint/recommended",
|
|
9
|
+
"plugin:react/recommended",
|
|
10
|
+
"airbnb",
|
|
11
|
+
"airbnb/hooks",
|
|
12
|
+
"airbnb-typescript"
|
|
13
|
+
],
|
|
14
|
+
"parser": "@typescript-eslint/parser",
|
|
15
|
+
"parserOptions": {
|
|
16
|
+
"ecmaVersion": "latest",
|
|
17
|
+
"sourceType": "module",
|
|
18
|
+
"project": ["./tsconfig.json"]
|
|
19
|
+
},
|
|
20
|
+
"plugins": [
|
|
21
|
+
"@typescript-eslint",
|
|
22
|
+
"react"
|
|
23
|
+
],
|
|
24
|
+
"rules": {
|
|
25
|
+
"import/prefer-default-export":"off",
|
|
26
|
+
"no-var": "error",
|
|
27
|
+
"jsx-a11y/control-has-associated-label":"off",
|
|
28
|
+
"jsx-a11y/label-has-associated-control": [
|
|
29
|
+
2,
|
|
30
|
+
{
|
|
31
|
+
"labelAttributes": ["htmlFor"],
|
|
32
|
+
"depth": 3
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"react/react-in-jsx-scope": "off",
|
|
36
|
+
"react/jsx-props-no-spreading": "off",
|
|
37
|
+
"react/require-default-props": "off",
|
|
38
|
+
"react/jsx-one-expression-per-line": "off",
|
|
39
|
+
"implicit-arrow-linebreak": "off",
|
|
40
|
+
"linebreak-style" : "off",
|
|
41
|
+
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
|
|
42
|
+
"no-restricted-imports": [
|
|
43
|
+
"error",
|
|
44
|
+
{
|
|
45
|
+
"patterns": [
|
|
46
|
+
{
|
|
47
|
+
"group": ["../../../*"],
|
|
48
|
+
"message": "Please use absolute path."
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"sort-imports": [
|
|
54
|
+
"error",
|
|
55
|
+
{
|
|
56
|
+
"ignoreCase": true,
|
|
57
|
+
"ignoreDeclarationSort": true,
|
|
58
|
+
"ignoreMemberSort": false,
|
|
59
|
+
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"stylelint-config-standard",
|
|
4
|
+
"stylelint-config-standard-scss"
|
|
5
|
+
],
|
|
6
|
+
"plugins": ["stylelint-scss","stylelint-selector-bem-pattern"],
|
|
7
|
+
"recommendations": ["stylelint.vscode-stylelint"],
|
|
8
|
+
"rules": {
|
|
9
|
+
"property-no-vendor-prefix":null,
|
|
10
|
+
"import-notation": "string",
|
|
11
|
+
"selector-class-pattern": null,
|
|
12
|
+
"color-hex-length": null,
|
|
13
|
+
"no-descending-specificity": null,
|
|
14
|
+
"color-function-notation":null,
|
|
15
|
+
"alpha-value-notation":null,
|
|
16
|
+
"scss/percent-placeholder-pattern":null,
|
|
17
|
+
"custom-property-pattern":null,
|
|
18
|
+
"declaration-empty-line-before":null,
|
|
19
|
+
"scss/at-mixin-pattern":null,
|
|
20
|
+
"plugin/selector-bem-pattern": {
|
|
21
|
+
"componentName": "[A-Z]+",
|
|
22
|
+
"componentSelectors": {
|
|
23
|
+
"initial": "^\\.{componentName}(?:-[a-z]+)?$",
|
|
24
|
+
"combined": "^\\.combined-{componentName}-[a-z]+$"
|
|
25
|
+
},
|
|
26
|
+
"utilitySelectors": "^\\.util-[a-z]+$"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jk-core/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "./dist/index.
|
|
6
|
-
"types": "./dist/index.d.ts",
|
|
7
|
-
"module": "./dist/index.js",
|
|
5
|
+
"main": "./dist/index.js",
|
|
8
6
|
"license": "MIT",
|
|
9
7
|
"description": "components for jk",
|
|
10
8
|
"author": "KimKyungYun <kky38225221@gmail.com>",
|
|
@@ -21,14 +19,11 @@
|
|
|
21
19
|
},
|
|
22
20
|
"exports": {
|
|
23
21
|
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
24
23
|
"import": "./dist/index.js",
|
|
25
|
-
"require": "./dist/index.
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
26
25
|
}
|
|
27
26
|
},
|
|
28
|
-
"files": [
|
|
29
|
-
"dist",
|
|
30
|
-
"src"
|
|
31
|
-
],
|
|
32
27
|
"keywords": [
|
|
33
28
|
"utils",
|
|
34
29
|
"kyungyun",
|
package/src/styles/color.scss
CHANGED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"composite": true,
|
|
5
|
+
"baseUrl": "./src",
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"emitDeclarationOnly": true,
|
|
10
|
+
"types": ["node", "vite/client","vite-plugin-svgr/client"],
|
|
11
|
+
},
|
|
12
|
+
"include": ["./src", "./src/svg.d.ts"]
|
|
13
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react-swc'
|
|
3
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
4
|
+
import svgr from 'vite-plugin-svgr';
|
|
5
|
+
import checker from 'vite-plugin-checker';
|
|
6
|
+
import { resolve } from 'path'
|
|
7
|
+
import dts from 'vite-plugin-dts'
|
|
8
|
+
import sassDts from 'vite-plugin-sass-dts';
|
|
9
|
+
|
|
10
|
+
// https://vitejs.dev/config/
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
plugins: [
|
|
13
|
+
react(),
|
|
14
|
+
tsconfigPaths(),
|
|
15
|
+
dts(),
|
|
16
|
+
sassDts(),
|
|
17
|
+
svgr({ include: '**/*.svg' }),
|
|
18
|
+
checker({
|
|
19
|
+
typescript: true,
|
|
20
|
+
eslint: {
|
|
21
|
+
lintCommand: 'eslint "./src/**/*.{ts,tsx}"',
|
|
22
|
+
},
|
|
23
|
+
overlay: {
|
|
24
|
+
badgeStyle: 'width:fit-content;font-size:14px;',
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
css: {
|
|
29
|
+
modules: {
|
|
30
|
+
scopeBehaviour: 'local',
|
|
31
|
+
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
|
32
|
+
},
|
|
33
|
+
preprocessorOptions: {
|
|
34
|
+
scss: {
|
|
35
|
+
api:'modern-compiler'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
build: {
|
|
40
|
+
lib: {
|
|
41
|
+
entry: resolve(__dirname, './src/index.tsx'),
|
|
42
|
+
name:'index',
|
|
43
|
+
fileName: 'index'
|
|
44
|
+
},
|
|
45
|
+
sourcemap: true,
|
|
46
|
+
rollupOptions: {
|
|
47
|
+
external: ['react', 'sass'],
|
|
48
|
+
output: {
|
|
49
|
+
assetFileNames:'style.css',
|
|
50
|
+
globals: {
|
|
51
|
+
react: 'React',
|
|
52
|
+
sass: 'sass'
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
outDir: 'dist'
|
|
57
|
+
}
|
|
58
|
+
})
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
selectedDate?: Date;
|
|
3
|
-
weeksInMonth: {
|
|
4
|
-
thisMonth: boolean;
|
|
5
|
-
date: Date;
|
|
6
|
-
}[][];
|
|
7
|
-
tileContent?: () => React.ReactNode;
|
|
8
|
-
handleDayClick: (day: Date) => void;
|
|
9
|
-
}
|
|
10
|
-
export default function DayTile({ selectedDate, weeksInMonth, tileContent, handleDayClick, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CalendarView } from '../../type';
|
|
2
|
-
interface Props {
|
|
3
|
-
selectedDate?: Date;
|
|
4
|
-
viewDate: Date;
|
|
5
|
-
handleMonthClick: (month: number) => void;
|
|
6
|
-
tileContent?: (date: Date, view: CalendarView) => React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export default function MonthTile({ selectedDate, viewDate, handleMonthClick, tileContent, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CalendarView } from '../../type';
|
|
2
|
-
interface Props {
|
|
3
|
-
selectedDate?: Date;
|
|
4
|
-
onClick: (year: number) => void;
|
|
5
|
-
tileContent?: (date: Date, view: CalendarView) => React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export default function YearTile({ selectedDate, onClick, tileContent, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CalendarView } from '../type';
|
|
2
|
-
interface Props {
|
|
3
|
-
method: CalendarView;
|
|
4
|
-
selectMode: CalendarView;
|
|
5
|
-
date: Date;
|
|
6
|
-
setDate: (date: Date) => void;
|
|
7
|
-
min: Date;
|
|
8
|
-
max: Date;
|
|
9
|
-
}
|
|
10
|
-
declare const useCalendarNav: ({ method, selectMode, date, setDate, min, max, }: Props) => {
|
|
11
|
-
disabled: (direction: "prev" | "next") => boolean;
|
|
12
|
-
onArrowClick: (direction: "prev" | "next") => void;
|
|
13
|
-
};
|
|
14
|
-
export default useCalendarNav;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CalendarView } from '../type';
|
|
2
|
-
interface UseDateSelectProps {
|
|
3
|
-
viewDate: Date;
|
|
4
|
-
setViewDate: (date: Date) => void;
|
|
5
|
-
method: CalendarView;
|
|
6
|
-
setSelectMode: (mode: CalendarView) => void;
|
|
7
|
-
onChange: (date: Date) => void;
|
|
8
|
-
}
|
|
9
|
-
declare const useDateSelect: ({ viewDate, setViewDate, onChange, setSelectMode, method, }: UseDateSelectProps) => {
|
|
10
|
-
onDayClick: (day: Date) => void;
|
|
11
|
-
onMonthClick: (month: number) => void;
|
|
12
|
-
onYearClick: (year: number) => void;
|
|
13
|
-
};
|
|
14
|
-
export default useDateSelect;
|
package/dist/Calendar/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CalendarView } from './type';
|
|
2
|
-
interface CalendarProps {
|
|
3
|
-
date?: Date;
|
|
4
|
-
view?: CalendarView;
|
|
5
|
-
tileContent?: (date: Date | undefined, view: CalendarView) => React.ReactNode;
|
|
6
|
-
onChange?: (date: Date) => void;
|
|
7
|
-
min?: Date;
|
|
8
|
-
max?: Date;
|
|
9
|
-
onClose?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export default function Calendar({ date: selectedDate, view, tileContent, onChange, onClose, min, max, }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
package/dist/Calendar/type.d.ts
DELETED
package/dist/index.d.ts
DELETED