@daryasidorovich/modsen-datepicker 1.0.0 → 1.0.2

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.
Files changed (118) hide show
  1. package/README.md +302 -302
  2. package/package.json +111 -106
  3. package/.babelrc.json +0 -7
  4. package/.github/workflows/chromatic.yml +0 -25
  5. package/.github/workflows/ci.yml +0 -56
  6. package/.husky/commit-msg +0 -1
  7. package/.husky/pre-commit +0 -1
  8. package/.prettierignore +0 -16
  9. package/.prettierrc +0 -6
  10. package/.storybook/main.js +0 -93
  11. package/.storybook/preview-head.html +0 -6
  12. package/.storybook/preview.js +0 -26
  13. package/.storybook/preview.tsx +0 -18
  14. package/commitlint.config.js +0 -23
  15. package/eslint.config.ts +0 -80
  16. package/jest.config.json +0 -21
  17. package/rollup.config.js +0 -65
  18. package/src/assets/actions/Delete.svg +0 -4
  19. package/src/assets/actions/Edit.svg +0 -3
  20. package/src/assets/arrows/Next.svg +0 -4
  21. package/src/assets/arrows/Prev.svg +0 -4
  22. package/src/assets/input/Calendar.svg +0 -3
  23. package/src/assets/input/Clear.svg +0 -3
  24. package/src/components/BaseCalendar/BaseCalendar.stories.tsx +0 -77
  25. package/src/components/BaseCalendar/index.tsx +0 -63
  26. package/src/components/BaseCalendar/styles.module.scss +0 -15
  27. package/src/components/CalendarGrid/CalendarGrid.stories.tsx +0 -136
  28. package/src/components/CalendarGrid/CalendarGridWithTasks/Tooltip/index.tsx +0 -27
  29. package/src/components/CalendarGrid/CalendarGridWithTasks/Tooltip/styles.module.scss +0 -9
  30. package/src/components/CalendarGrid/CalendarGridWithTasks/index.tsx +0 -51
  31. package/src/components/CalendarGrid/CalendarGridWithoutTasks/CalendarGridWithoutTasks.test.tsx +0 -223
  32. package/src/components/CalendarGrid/CalendarGridWithoutTasks/index.tsx +0 -36
  33. package/src/components/CalendarGrid/CalendarGridWithoutTasks/styles.module.scss +0 -11
  34. package/src/components/CalendarGrid/index.tsx +0 -19
  35. package/src/components/CalendarGrid/types.ts +0 -26
  36. package/src/components/Clear/Clear.stories.tsx +0 -16
  37. package/src/components/Clear/index.tsx +0 -12
  38. package/src/components/Clear/styles.module.scss +0 -34
  39. package/src/components/DatePicker/DatePicker.stories.tsx +0 -127
  40. package/src/components/DatePicker/index.tsx +0 -72
  41. package/src/components/DatePicker/styles.module.scss +0 -10
  42. package/src/components/Day/Day.stories.tsx +0 -75
  43. package/src/components/Day/index.tsx +0 -95
  44. package/src/components/Day/styles.module.scss +0 -97
  45. package/src/components/Input/Input.stories.tsx +0 -37
  46. package/src/components/Input/index.tsx +0 -64
  47. package/src/components/Input/styles.module.scss +0 -79
  48. package/src/components/Modal/CrudModal/index.tsx +0 -43
  49. package/src/components/Modal/CrudModal/styles.module.scss +0 -44
  50. package/src/components/Modal/index.tsx +0 -66
  51. package/src/components/Modal/styles.module.scss +0 -40
  52. package/src/components/Modal/types.ts +0 -13
  53. package/src/components/Month/Month.stories.tsx +0 -19
  54. package/src/components/Month/index.tsx +0 -31
  55. package/src/components/Month/styles.module.scss +0 -30
  56. package/src/components/RangePicker/RangePicker.stories.tsx +0 -134
  57. package/src/components/RangePicker/index.tsx +0 -144
  58. package/src/components/RangePicker/styles.module.scss +0 -19
  59. package/src/components/TasksManager/AddModal/index.tsx +0 -62
  60. package/src/components/TasksManager/DeleteModal/index.tsx +0 -22
  61. package/src/components/TasksManager/EditModal/index.tsx +0 -96
  62. package/src/components/TasksManager/index.tsx +0 -112
  63. package/src/components/TasksManager/styles.module.scss +0 -62
  64. package/src/components/Week/Week.stories.tsx +0 -49
  65. package/src/components/Week/index.tsx +0 -68
  66. package/src/components/Week/styles.module.scss +0 -7
  67. package/src/components/WeekDay/WeekDay.stories.tsx +0 -38
  68. package/src/components/WeekDay/index.tsx +0 -35
  69. package/src/components/WeekDay/styles.module.scss +0 -19
  70. package/src/constants/dateMask.ts +0 -23
  71. package/src/constants/firstDayOfWeek.ts +0 -7
  72. package/src/constants/holidays.ts +0 -32
  73. package/src/constants/modes.ts +0 -6
  74. package/src/constants/monthsNames.ts +0 -14
  75. package/src/constants/weekdaysNames.ts +0 -1
  76. package/src/hooks/useCalendar.ts +0 -62
  77. package/src/hooks/useLockBodyScroll.ts +0 -19
  78. package/src/hooks/useModal.ts +0 -45
  79. package/src/hooks/useTooltip.ts +0 -41
  80. package/src/hooks/useValidate.ts +0 -80
  81. package/src/index.ts +0 -15
  82. package/src/services/calendarService.ts +0 -62
  83. package/src/services/decorators/withHolidays.test.ts +0 -64
  84. package/src/services/decorators/withHolidays.ts +0 -12
  85. package/src/services/decorators/withMinMax.test.ts +0 -77
  86. package/src/services/decorators/withMinMax.ts +0 -19
  87. package/src/services/holidayService.ts +0 -56
  88. package/src/setupTests.ts +0 -1
  89. package/src/store/localStorage.ts +0 -33
  90. package/src/store/tasksStore.test.tsx +0 -208
  91. package/src/store/tasksStore.tsx +0 -146
  92. package/src/store/types.ts +0 -22
  93. package/src/styles/_border.scss +0 -9
  94. package/src/styles/_colors.scss +0 -53
  95. package/src/styles/_gap.scss +0 -4
  96. package/src/styles/_globals.scss +0 -61
  97. package/src/styles/_grid.scss +0 -9
  98. package/src/styles/_mixins.scss +0 -6
  99. package/src/styles/_reset.scss +0 -98
  100. package/src/styles/_theme-mixins.scss +0 -51
  101. package/src/styles/_typography.scss +0 -10
  102. package/src/styles/_variables.scss +0 -8
  103. package/src/styles/main.scss +0 -3
  104. package/src/types/types.d.ts +0 -15
  105. package/src/utils/calendar.test.ts +0 -154
  106. package/src/utils/calendar.ts +0 -82
  107. package/src/utils/controlDate.ts +0 -3
  108. package/src/utils/dateChecks.test.ts +0 -216
  109. package/src/utils/dateChecks.ts +0 -75
  110. package/src/utils/formatDate.test.ts +0 -57
  111. package/src/utils/formatDate.ts +0 -27
  112. package/src/utils/schema.test.ts +0 -40
  113. package/src/utils/schema.ts +0 -8
  114. package/src/utils/weekdayOrder.test.ts +0 -11
  115. package/src/utils/weekdayOrder.ts +0 -7
  116. package/tsconfig.json +0 -31
  117. package/vitest.config.ts +0 -38
  118. package/vitest.shims.d.ts +0 -1
package/package.json CHANGED
@@ -1,106 +1,111 @@
1
- {
2
- "name": "@daryasidorovich/modsen-datepicker",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "module": "dist/index.esm.js",
7
- "typings": "types.d.ts",
8
- "style": "index.css",
9
- "scripts": {
10
- "clean": "rimraf dist lib",
11
- "build": "npm run clean && rollup -c --bundleConfigAsCjs",
12
- "pack": "npm run build && npm pack",
13
- "dev": "rollup -c -w",
14
- "storybook": "storybook dev -p 6006",
15
- "build-storybook": "storybook build",
16
- "lint": "eslint src/ --ext .ts,.tsx",
17
- "lint:fix": "eslint src/ --ext .ts,.tsx --fix",
18
- "format": "prettier . --write",
19
- "format:check": "prettier . --check",
20
- "test": "jest",
21
- "test:watch": "jest --watch",
22
- "test:coverage": "jest --coverage",
23
- "chromatic": "npx chromatic --project-token=chpt_0fa93e1434c19df",
24
- "prepare": "husky"
25
- },
26
- "lint-staged": {
27
- "src/**/*.{js,jsx,ts,tsx}": [
28
- "eslint --fix",
29
- "prettier --write"
30
- ],
31
- "src/**/*.{scss,css}": [
32
- "prettier --write"
33
- ],
34
- "*.{js,cjs}": [
35
- "prettier --write"
36
- ]
37
- },
38
- "keywords": [],
39
- "author": "",
40
- "license": "ISC",
41
- "type": "module",
42
- "devDependencies": {
43
- "@babel/preset-env": "^7.29.7",
44
- "@babel/preset-react": "^7.29.7",
45
- "@babel/preset-typescript": "^7.29.7",
46
- "@chromatic-com/storybook": "latest",
47
- "@commitlint/cli": "^21.2.2",
48
- "@commitlint/config-conventional": "^21.2.2",
49
- "@eslint/js": "^9.7.0",
50
- "@rollup/plugin-commonjs": "^29.0.3",
51
- "@rollup/plugin-node-resolve": "^16.0.3",
52
- "@rollup/plugin-typescript": "^12.3.0",
53
- "@storybook/addon-a11y": "^10.5.10",
54
- "@storybook/addon-docs": "^10.5.10",
55
- "@storybook/addon-themes": "^10.5.10",
56
- "@storybook/addon-vitest": "^10.5.10",
57
- "@storybook/react-vite": "^10.5.10",
58
- "@svgr/rollup": "^8.1.0",
59
- "@testing-library/dom": "^10.4.1",
60
- "@testing-library/jest-dom": "^7.0.1",
61
- "@testing-library/react": "^16.3.2",
62
- "@testing-library/user-event": "^14.6.5",
63
- "@types/jest": "^30.0.0",
64
- "@types/react": "^18.2.0",
65
- "@types/react-dom": "^18.2.0",
66
- "@vitest/browser-playwright": "latest",
67
- "@vitest/coverage-v8": "latest",
68
- "chromatic": "^18.5.0",
69
- "classnames": "^2.5.1",
70
- "eslint": "^9.7.0",
71
- "eslint-plugin-import": "^2.32.0",
72
- "eslint-plugin-react": "^7.37.5",
73
- "eslint-plugin-react-hooks": "^5.0.0",
74
- "eslint-plugin-simple-import-sort": "^14.0.0",
75
- "eslint-plugin-storybook": "^10.5.10",
76
- "globals": "^17.11.0",
77
- "husky": "^9.1.7",
78
- "identity-obj-proxy": "^3.0.0",
79
- "jest": "^30.4.2",
80
- "jest-environment-jsdom": "^30.4.1",
81
- "jiti": "^2.7.0",
82
- "lint-staged": "^16.4.0",
83
- "playwright": "latest",
84
- "postcss": "^8.5.26",
85
- "prettier": "3.9.6",
86
- "react": "^19.2.8",
87
- "react-dom": "^19.2.8",
88
- "rimraf": "^6.1.3",
89
- "rollup": "^2.80.0",
90
- "rollup-plugin-babel": "^4.4.0",
91
- "rollup-plugin-styles": "^4.0.0",
92
- "sass": "^1.103.1",
93
- "storybook": "^10.5.10",
94
- "typescript": "^5.6.2",
95
- "typescript-eslint": "^8.0.0",
96
- "vite-plugin-svgr": "^5.2.0",
97
- "vitest": "latest"
98
- },
99
- "dependencies": {
100
- "@hookform/resolvers": "^5.9.1",
101
- "react-hook-form": "^7.87.0",
102
- "react-imask": "^7.6.1",
103
- "tslib": "^2.8.1",
104
- "zod": "^4.5.4"
105
- }
106
- }
1
+ {
2
+ "name": "@daryasidorovich/modsen-datepicker",
3
+ "version": "1.0.2",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.esm.js",
7
+ "typings": "types.d.ts",
8
+ "style": "index.css",
9
+ "files": [
10
+ "dist",
11
+ "docs",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "clean": "rimraf dist lib",
16
+ "build": "npm run clean && rollup -c --bundleConfigAsCjs",
17
+ "pack": "npm run build && npm pack",
18
+ "dev": "rollup -c -w",
19
+ "storybook": "storybook dev -p 6006",
20
+ "build-storybook": "storybook build",
21
+ "lint": "eslint src/ --ext .ts,.tsx",
22
+ "lint:fix": "eslint src/ --ext .ts,.tsx --fix",
23
+ "format": "prettier . --write",
24
+ "format:check": "prettier . --check",
25
+ "test": "jest",
26
+ "test:watch": "jest --watch",
27
+ "test:coverage": "jest --coverage",
28
+ "chromatic": "npx chromatic --project-token=chpt_0fa93e1434c19df",
29
+ "prepare": "husky"
30
+ },
31
+ "lint-staged": {
32
+ "src/**/*.{js,jsx,ts,tsx}": [
33
+ "eslint --fix",
34
+ "prettier --write"
35
+ ],
36
+ "src/**/*.{scss,css}": [
37
+ "prettier --write"
38
+ ],
39
+ "*.{js,cjs}": [
40
+ "prettier --write"
41
+ ]
42
+ },
43
+ "keywords": [],
44
+ "author": "",
45
+ "license": "ISC",
46
+ "type": "module",
47
+ "devDependencies": {
48
+ "@babel/preset-env": "^7.29.7",
49
+ "@babel/preset-react": "^7.29.7",
50
+ "@babel/preset-typescript": "^7.29.7",
51
+ "@chromatic-com/storybook": "latest",
52
+ "@commitlint/cli": "^21.2.2",
53
+ "@commitlint/config-conventional": "^21.2.2",
54
+ "@eslint/js": "^9.7.0",
55
+ "@rollup/plugin-commonjs": "^29.0.3",
56
+ "@rollup/plugin-node-resolve": "^16.0.3",
57
+ "@rollup/plugin-typescript": "^12.3.0",
58
+ "@storybook/addon-a11y": "^10.5.10",
59
+ "@storybook/addon-docs": "^10.5.10",
60
+ "@storybook/addon-themes": "^10.5.10",
61
+ "@storybook/addon-vitest": "^10.5.10",
62
+ "@storybook/react-vite": "^10.5.10",
63
+ "@svgr/rollup": "^8.1.0",
64
+ "@testing-library/dom": "^10.4.1",
65
+ "@testing-library/jest-dom": "^7.0.1",
66
+ "@testing-library/react": "^16.3.2",
67
+ "@testing-library/user-event": "^14.6.5",
68
+ "@types/jest": "^30.0.0",
69
+ "@types/react": "^18.2.0",
70
+ "@types/react-dom": "^18.2.0",
71
+ "@vitest/browser-playwright": "latest",
72
+ "@vitest/coverage-v8": "latest",
73
+ "chromatic": "^18.5.0",
74
+ "classnames": "^2.5.1",
75
+ "eslint": "^9.7.0",
76
+ "eslint-plugin-import": "^2.32.0",
77
+ "eslint-plugin-react": "^7.37.5",
78
+ "eslint-plugin-react-hooks": "^5.0.0",
79
+ "eslint-plugin-simple-import-sort": "^14.0.0",
80
+ "eslint-plugin-storybook": "^10.5.10",
81
+ "globals": "^17.11.0",
82
+ "husky": "^9.1.7",
83
+ "identity-obj-proxy": "^3.0.0",
84
+ "jest": "^30.4.2",
85
+ "jest-environment-jsdom": "^30.4.1",
86
+ "jiti": "^2.7.0",
87
+ "lint-staged": "^16.4.0",
88
+ "playwright": "latest",
89
+ "postcss": "^8.5.26",
90
+ "prettier": "3.9.6",
91
+ "react": "^19.2.8",
92
+ "react-dom": "^19.2.8",
93
+ "rimraf": "^6.1.3",
94
+ "rollup": "^2.80.0",
95
+ "rollup-plugin-babel": "^4.4.0",
96
+ "rollup-plugin-styles": "^4.0.0",
97
+ "sass": "^1.103.1",
98
+ "storybook": "^10.5.10",
99
+ "typescript": "^5.6.2",
100
+ "typescript-eslint": "^8.0.0",
101
+ "vite-plugin-svgr": "^5.2.0",
102
+ "vitest": "latest"
103
+ },
104
+ "dependencies": {
105
+ "@hookform/resolvers": "^5.9.1",
106
+ "react-hook-form": "^7.87.0",
107
+ "react-imask": "^7.6.1",
108
+ "tslib": "^2.8.1",
109
+ "zod": "^4.5.4"
110
+ }
111
+ }
package/.babelrc.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "presets": [
3
- ["@babel/preset-env", { "targets": { "node": "current" } }],
4
- ["@babel/preset-react", { "runtime": "automatic" }],
5
- "@babel/preset-typescript"
6
- ]
7
- }
@@ -1,25 +0,0 @@
1
- name: 'Chromatic'
2
-
3
- on: push
4
-
5
- jobs:
6
- chromatic:
7
- name: Run Chromatic
8
- runs-on: ubuntu-latest
9
- steps:
10
- - name: Checkout code
11
- uses: actions/checkout@v7
12
- with:
13
- fetch-depth: 0
14
- - uses: actions/setup-node@v7
15
- with:
16
- node-version: 24.19.0
17
- - name: Install dependencies
18
- run: npm ci
19
- - name: Run Chromatic
20
- uses: chromaui/action@latest
21
- with:
22
- projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
23
- env:
24
- STORYBOOK_HOLIDAY_API_KEY: ${{ secrets.STORYBOOK_HOLIDAY_API_KEY }}
25
- STORYBOOK_HOLIDAY_API_URL: ${{ secrets.STORYBOOK_HOLIDAY_API_URL }}
@@ -1,56 +0,0 @@
1
- name: CI for datepicker
2
-
3
- on:
4
- push:
5
- branches: [main, dev]
6
- pull_request:
7
- branches: [main, dev]
8
-
9
- jobs:
10
- lint:
11
- name: Lint
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v7
15
- - uses: actions/setup-node@v7
16
- with:
17
- node-version: 24.19.0
18
- cache: 'npm'
19
- - run: npm ci
20
- - run: npm run lint
21
-
22
- format:
23
- name: Format
24
- runs-on: ubuntu-latest
25
- steps:
26
- - uses: actions/checkout@v7
27
- - uses: actions/setup-node@v7
28
- with:
29
- node-version: 24.19.0
30
- cache: 'npm'
31
- - run: npm ci
32
- - run: npm run format:check
33
-
34
- test:
35
- name: Test
36
- runs-on: ubuntu-latest
37
- steps:
38
- - uses: actions/checkout@v7
39
- - uses: actions/setup-node@v7
40
- with:
41
- node-version: 24.19.0
42
- cache: 'npm'
43
- - run: npm ci
44
- - run: npm test
45
-
46
- build:
47
- name: Build
48
- runs-on: ubuntu-latest
49
- steps:
50
- - uses: actions/checkout@v7
51
- - uses: actions/setup-node@v7
52
- with:
53
- node-version: 24.19.0
54
- cache: 'npm'
55
- - run: npm ci
56
- - run: npm run build
package/.husky/commit-msg DELETED
@@ -1 +0,0 @@
1
- npx commitlint --edit "$1"
package/.husky/pre-commit DELETED
@@ -1 +0,0 @@
1
- npx lint-staged
package/.prettierignore DELETED
@@ -1,16 +0,0 @@
1
- # Ignore artifacts:
2
- build
3
- coverage
4
- node_modules
5
- dist
6
- build
7
- coverage
8
- .next
9
- out
10
- .cache
11
- *.min.js
12
- *.min.css
13
- *.map
14
- package-lock.json
15
- yarn.lock
16
- pnpm-lock.yaml
package/.prettierrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "es5",
4
- "tabWidth": 2,
5
- "semi": true
6
- }
@@ -1,93 +0,0 @@
1
- /** @type { import('@storybook/react-vite').StorybookConfig } */
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- import svgr from 'vite-plugin-svgr';
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- const config = {
9
- stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
10
- addons: [
11
- '@storybook/addon-themes',
12
- '@storybook/addon-vitest',
13
- '@storybook/addon-a11y',
14
- '@storybook/addon-docs',
15
- ],
16
- framework: {
17
- name: '@storybook/react-vite',
18
- options: {},
19
- },
20
- docs: {
21
- autodocs: true,
22
- },
23
- typescript: {
24
- check: false,
25
- reactDocgen: 'react-docgen-typescript',
26
- },
27
- async viteFinal(config) {
28
- config.optimizeDeps = {
29
- include: ['react', 'react-dom'],
30
- };
31
-
32
- config.plugins = config.plugins || [];
33
- config.plugins.push(
34
- svgr({
35
- include: '**/*.svg?react',
36
- })
37
- );
38
-
39
- config.css = {
40
- modules: {
41
- localsConvention: 'camelCase',
42
- },
43
- preprocessorOptions: {
44
- scss: {
45
- additionalData: `
46
- @use "@styles/variables" as *;
47
- @use "@styles/border" as *;
48
- @use "@styles/mixins" as *;
49
- @use "@styles/theme-mixins" as *;
50
- @use "@styles/colors" as *;
51
- @use "@styles/typography" as *;
52
- @use "@styles/gap" as *;
53
- `,
54
- },
55
- },
56
- };
57
-
58
- config.define = {
59
- ...config.define,
60
- 'process.env.STORYBOOK_HOLIDAY_API_KEY': JSON.stringify(
61
- process.env.STORYBOOK_HOLIDAY_API_KEY
62
- ),
63
- 'process.env.STORYBOOK_HOLIDAY_API_URL': JSON.stringify(
64
- process.env.STORYBOOK_HOLIDAY_API_URL
65
- ),
66
- };
67
-
68
- config.resolve = {
69
- alias: {
70
- '@': path.resolve(__dirname, '../src'),
71
- '@components': path.resolve(__dirname, '../src/components'),
72
- '@styles': path.resolve(__dirname, '../src/styles'),
73
- '@assets': path.resolve(__dirname, '../src/assets'),
74
- '@utils': path.resolve(__dirname, '../src/utils'),
75
- },
76
- };
77
-
78
- config.server = {
79
- ...config.server,
80
- proxy: {
81
- '/holidays': {
82
- target: 'https://holidayapi.com/v1',
83
- changeOrigin: true,
84
- secure: true,
85
- },
86
- },
87
- };
88
-
89
- return config;
90
- },
91
- };
92
-
93
- export default config;
@@ -1,6 +0,0 @@
1
- <link rel="preconnect" href="https://fonts.googleapis.com" />
2
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
3
- <link
4
- href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300..800&display=swap"
5
- rel="stylesheet"
6
- />
@@ -1,26 +0,0 @@
1
- /** @type { import('@storybook/react-vite').Preview } */
2
- import '../src/styles/main.scss';
3
-
4
- import { withThemeByClassName } from '@storybook/addon-themes';
5
-
6
- const preview = {
7
- parameters: {
8
- controls: {
9
- matchers: {
10
- color: /(background|color)$/i,
11
- date: /Date$/i,
12
- },
13
- },
14
- },
15
- decorators: [
16
- withThemeByClassName({
17
- themes: {
18
- light: 'theme-light',
19
- dark: 'theme-dark',
20
- },
21
- defaultTheme: 'light',
22
- }),
23
- ],
24
- };
25
-
26
- export default preview;
@@ -1,18 +0,0 @@
1
- import type { Preview } from '@storybook/react-vite';
2
-
3
- const preview: Preview = {
4
- parameters: {
5
- controls: {
6
- matchers: {
7
- color: /(background|color)$/i,
8
- date: /Date$/i,
9
- },
10
- },
11
-
12
- a11y: {
13
- test: 'todo',
14
- },
15
- },
16
- };
17
-
18
- export default preview;
@@ -1,23 +0,0 @@
1
- export default {
2
- extends: ['@commitlint/config-conventional'],
3
- rules: {
4
- 'type-enum': [
5
- 2,
6
- 'always',
7
- [
8
- 'feat',
9
- 'fix',
10
- 'docs',
11
- 'style',
12
- 'refactor',
13
- 'test',
14
- 'chore',
15
- 'build',
16
- 'ci',
17
- ],
18
- ],
19
- 'subject-max-length': [2, 'always', 100],
20
- 'subject-empty': [2, 'never'],
21
- 'type-empty': [2, 'never'],
22
- },
23
- };
package/eslint.config.ts DELETED
@@ -1,80 +0,0 @@
1
- import js from '@eslint/js';
2
- import pluginImport from 'eslint-plugin-import';
3
- import react from 'eslint-plugin-react';
4
- import reactHooks from 'eslint-plugin-react-hooks';
5
- import simpleImportSort from 'eslint-plugin-simple-import-sort';
6
- import storybook from 'eslint-plugin-storybook';
7
- import tseslint from 'typescript-eslint';
8
-
9
- export default [
10
- js.configs.recommended,
11
- ...tseslint.configs.recommended,
12
- {
13
- files: ['**/*.{ts,tsx,js,jsx}'],
14
- plugins: {
15
- react: react,
16
- 'react-hooks': reactHooks,
17
- 'simple-import-sort': simpleImportSort,
18
- import: pluginImport,
19
- },
20
- rules: {
21
- 'react/react-in-jsx-scope': 'off',
22
- 'react-hooks/rules-of-hooks': 'error',
23
- 'react-hooks/exhaustive-deps': 'warn',
24
- 'simple-import-sort/imports': 'error',
25
- 'simple-import-sort/exports': 'error',
26
- '@typescript-eslint/no-unused-vars': [
27
- 'error',
28
- { argsIgnorePattern: '^_' },
29
- ],
30
- '@typescript-eslint/explicit-module-boundary-types': 'off',
31
- 'react/destructuring-assignment': ['error', 'always'],
32
- 'prefer-destructuring': [
33
- 'error',
34
- {
35
- VariableDeclarator: { array: false, object: true },
36
- AssignmentExpression: { array: false, object: false },
37
- },
38
- ],
39
- },
40
- settings: {
41
- react: {
42
- version: 'detect',
43
- },
44
- 'import/resolver': {
45
- alias: {
46
- map: [
47
- ['@', './src'],
48
- ['@components', './src/components'],
49
- ['@utils', './src/utils'],
50
- ['@styles', './src/styles'],
51
- ['@assets', './src/assets'],
52
- ],
53
- extensions: ['.ts', '.tsx', '.js', '.jsx'],
54
- },
55
- },
56
- },
57
- languageOptions: {
58
- ecmaVersion: 2022,
59
- sourceType: 'module',
60
- parserOptions: {
61
- ecmaFeatures: {
62
- jsx: true,
63
- },
64
- },
65
-
66
- globals: {
67
- process: 'readonly',
68
- },
69
- },
70
- },
71
- {
72
- ignores: [
73
- 'dist/**',
74
- 'node_modules/**',
75
- '**/*.test.tsx',
76
- '**/*.stories.tsx',
77
- ],
78
- },
79
- ...storybook.configs['flat/recommended'],
80
- ];
package/jest.config.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "clearMocks": true,
3
- "logHeapUsage": true,
4
- "passWithNoTests": true,
5
- "testEnvironment": "jsdom",
6
- "transform": {
7
- "^.+\\.(ts|tsx|js|jsx)$": "babel-jest"
8
- },
9
- "transformIgnorePatterns": ["node_modules/(?!(react|react-dom)/)"],
10
- "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"],
11
- "setupFilesAfterEnv": ["<rootDir>/src/setupTests.ts"],
12
- "moduleNameMapper": {
13
- "^@/(.*)$": "<rootDir>/src/$1",
14
- "^@components/(.*)$": "<rootDir>/src/components/$1",
15
- "^@utils/(.*)$": "<rootDir>/src/utils/$1",
16
- "^@store/(.*)$": "<rootDir>/src/store/$1",
17
- "^@styles/(.*)$": "<rootDir>/src/styles/$1",
18
- "^@assets/(.*)$": "<rootDir>/src/assets/$1",
19
- "\\.(css|less|scss|sass)$": "identity-obj-proxy"
20
- }
21
- }