@daryasidorovich/modsen-datepicker 1.0.0 → 1.0.1
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/.prettierrc +6 -6
- package/.storybook/main.js +93 -93
- package/.storybook/main.ts +16 -0
- package/.storybook/preview.js +26 -26
- package/.storybook/preview.tsx +18 -18
- package/README.md +5 -5
- package/commitlint.config.js +23 -23
- package/package.json +1 -1
- package/rollup.config.js +65 -65
- package/src/components/BaseCalendar/BaseCalendar.stories.tsx +77 -77
- package/src/components/BaseCalendar/index.tsx +63 -63
- package/src/components/BaseCalendar/styles.module.scss +15 -15
- package/src/components/Button/Button.stories.tsx +16 -0
- package/src/components/Button/Button.tsx +14 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Button/styles.module.scss +3 -0
- package/src/components/CalendarGrid/CalendarGrid.stories.tsx +136 -136
- package/src/components/CalendarGrid/CalendarGridWithTasks/Tooltip/index.tsx +27 -27
- package/src/components/CalendarGrid/CalendarGridWithTasks/Tooltip/styles.module.scss +9 -9
- package/src/components/CalendarGrid/CalendarGridWithTasks/index.tsx +51 -51
- package/src/components/CalendarGrid/CalendarGridWithoutTasks/index.tsx +36 -36
- package/src/components/CalendarGrid/CalendarGridWithoutTasks/styles.module.scss +11 -11
- package/src/components/CalendarGrid/index.tsx +19 -19
- package/src/components/CalendarGrid/types.ts +26 -26
- package/src/components/Clear/Clear.stories.tsx +16 -16
- package/src/components/Clear/index.tsx +12 -12
- package/src/components/Clear/styles.module.scss +34 -34
- package/src/components/DatePicker/DatePicker.stories.tsx +127 -127
- package/src/components/DatePicker/index.tsx +72 -72
- package/src/components/DatePicker/styles.module.scss +10 -10
- package/src/components/Day/Day.stories.tsx +75 -75
- package/src/components/Day/index.tsx +95 -95
- package/src/components/Day/styles.module.scss +97 -97
- package/src/components/Input/Input.stories.tsx +37 -37
- package/src/components/Input/index.tsx +64 -64
- package/src/components/Input/styles.module.scss +79 -79
- package/src/components/Modal/CrudModal/index.tsx +43 -43
- package/src/components/Modal/CrudModal/styles.module.scss +44 -44
- package/src/components/Modal/index.tsx +66 -66
- package/src/components/Modal/styles.module.scss +40 -40
- package/src/components/Modal/types.ts +13 -13
- package/src/components/Month/Month.stories.tsx +19 -19
- package/src/components/Month/index.tsx +31 -31
- package/src/components/Month/styles.module.scss +30 -30
- package/src/components/RangePicker/RangePicker.stories.tsx +134 -134
- package/src/components/RangePicker/index.tsx +144 -144
- package/src/components/RangePicker/styles.module.scss +19 -19
- package/src/components/TasksManager/AddModal/index.tsx +62 -62
- package/src/components/TasksManager/DeleteModal/index.tsx +22 -22
- package/src/components/TasksManager/EditModal/index.tsx +96 -96
- package/src/components/TasksManager/index.tsx +112 -112
- package/src/components/TasksManager/styles.module.scss +62 -62
- package/src/components/Week/Week.stories.tsx +49 -49
- package/src/components/Week/index.tsx +68 -68
- package/src/components/Week/styles.module.scss +7 -7
- package/src/components/WeekDay/WeekDay.stories.tsx +38 -38
- package/src/components/WeekDay/index.tsx +35 -35
- package/src/components/WeekDay/styles.module.scss +19 -19
- package/src/constants/dateMask.ts +23 -23
- package/src/constants/firstDayOfWeek.ts +7 -7
- package/src/constants/holidays.ts +32 -32
- package/src/constants/modes.ts +6 -6
- package/src/constants/monthsNames.ts +14 -14
- package/src/constants/weekdaysNames.ts +1 -1
- package/src/hooks/useCalendar.ts +62 -62
- package/src/hooks/useLockBodyScroll.ts +19 -19
- package/src/hooks/useModal.ts +45 -45
- package/src/hooks/useTooltip.ts +41 -41
- package/src/hooks/useValidate.ts +80 -80
- package/src/index.ts +15 -15
- package/src/services/calendarService.ts +62 -62
- package/src/services/decorators/withHolidays.ts +12 -12
- package/src/services/decorators/withMinMax.test.ts +77 -77
- package/src/services/decorators/withMinMax.ts +19 -19
- package/src/services/holidayService.ts +56 -56
- package/src/store/localStorage.ts +33 -33
- package/src/store/tasksStore.tsx +146 -146
- package/src/store/types.ts +22 -22
- package/src/stories/Button.stories.ts +54 -0
- package/src/stories/Button.tsx +37 -0
- package/src/stories/Configure.mdx +388 -0
- package/src/stories/Header.stories.ts +34 -0
- package/src/stories/Header.tsx +56 -0
- package/src/stories/Page.stories.ts +33 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/styles/_border.scss +9 -9
- package/src/styles/_colors.scss +53 -53
- package/src/styles/_gap.scss +4 -4
- package/src/styles/_globals.scss +61 -61
- package/src/styles/_grid.scss +9 -9
- package/src/styles/_mixins.scss +6 -6
- package/src/styles/_reset.scss +98 -98
- package/src/styles/_theme-mixins.scss +51 -51
- package/src/styles/_typography.scss +10 -10
- package/src/styles/_variables.scss +8 -8
- package/src/styles/main.scss +3 -3
- package/src/types/types.d.ts +15 -15
- package/src/utils/calendar.test.ts +154 -154
- package/src/utils/calendar.ts +82 -82
- package/src/utils/controlDate.ts +3 -3
- package/src/utils/dateChecks.test.ts +216 -216
- package/src/utils/dateChecks.ts +75 -75
- package/src/utils/formatDate.ts +27 -27
- package/src/utils/schema.test.ts +40 -40
- package/src/utils/schema.ts +8 -8
- package/src/utils/weekdayOrder.test.ts +11 -11
- package/src/utils/weekdayOrder.ts +7 -7
- package/vitest.config.ts +38 -38
- package/vitest.shims.d.ts +1 -1
package/.prettierrc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"singleQuote": true,
|
|
3
|
-
"trailingComma": "es5",
|
|
4
|
-
"tabWidth": 2,
|
|
5
|
-
"semi": true
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"trailingComma": "es5",
|
|
4
|
+
"tabWidth": 2,
|
|
5
|
+
"semi": true
|
|
6
|
+
}
|
package/.storybook/main.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
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
|
+
/** @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;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StorybookConfig } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
"stories": [
|
|
5
|
+
"../src/**/*.mdx",
|
|
6
|
+
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
|
|
7
|
+
],
|
|
8
|
+
"addons": [
|
|
9
|
+
"@chromatic-com/storybook",
|
|
10
|
+
"@storybook/addon-vitest",
|
|
11
|
+
"@storybook/addon-a11y",
|
|
12
|
+
"@storybook/addon-docs"
|
|
13
|
+
],
|
|
14
|
+
"framework": "@storybook/react-vite"
|
|
15
|
+
};
|
|
16
|
+
export default config;
|
package/.storybook/preview.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
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
|
+
/** @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;
|
package/.storybook/preview.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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
|
+
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;
|
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ const Example = () => {
|
|
|
86
86
|
|
|
87
87
|
<div align="center">
|
|
88
88
|
|
|
89
|
-

|
|
90
90
|
</div>
|
|
91
91
|
|
|
92
92
|
### RangePicker
|
|
@@ -122,7 +122,7 @@ const Example = () => {
|
|
|
122
122
|
|
|
123
123
|
<div align="center">
|
|
124
124
|
|
|
125
|
-

|
|
126
126
|
</div>
|
|
127
127
|
|
|
128
128
|
### BaseCalendar
|
|
@@ -159,7 +159,7 @@ const Example = () => {
|
|
|
159
159
|
|
|
160
160
|
<div align="center">
|
|
161
161
|
|
|
162
|
-

|
|
163
163
|
</div>
|
|
164
164
|
|
|
165
165
|
## Callbacks
|
|
@@ -183,7 +183,7 @@ The input is `masked` (dd/mm/yyyy) and validated:
|
|
|
183
183
|
- **Out of range** — if minDate or maxDate is set and the value falls outside, the input shows the corresponding error and the value is rejected.
|
|
184
184
|
|
|
185
185
|
<div align="center">
|
|
186
|
-

|
|
187
187
|
|
|
188
188
|
</div>
|
|
189
189
|
|
|
@@ -298,5 +298,5 @@ The library ships with light and dark themes out of the box — no extra configu
|
|
|
298
298
|
|
|
299
299
|
<div align="center">
|
|
300
300
|
|
|
301
|
-

|
|
302
302
|
</div>
|
package/commitlint.config.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
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
|
-
};
|
|
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/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
-
import typescript from '@rollup/plugin-typescript';
|
|
4
|
-
import svgr from '@svgr/rollup';
|
|
5
|
-
import { readFileSync } from 'fs';
|
|
6
|
-
import styles from 'rollup-plugin-styles';
|
|
7
|
-
|
|
8
|
-
const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
|
|
9
|
-
|
|
10
|
-
const external = Object.keys(pkg.peerDependencies || {});
|
|
11
|
-
|
|
12
|
-
const baseOutput = {
|
|
13
|
-
dir: 'dist',
|
|
14
|
-
sourcemap: true,
|
|
15
|
-
exports: 'named',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const plugins = [
|
|
19
|
-
resolve({
|
|
20
|
-
extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss', '.css'],
|
|
21
|
-
}),
|
|
22
|
-
commonjs(),
|
|
23
|
-
styles({
|
|
24
|
-
mode: 'inject',
|
|
25
|
-
sass: {
|
|
26
|
-
data: `
|
|
27
|
-
@import "src/styles/variables.scss";
|
|
28
|
-
@import "src/styles/mixins.scss";
|
|
29
|
-
@import "src/styles/border.scss";
|
|
30
|
-
@import "src/styles/theme-mixins.scss";
|
|
31
|
-
@import "src/styles/colors.scss";
|
|
32
|
-
@import "src/styles/typography.scss";
|
|
33
|
-
@import "src/styles/gap.scss";
|
|
34
|
-
`,
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
svgr({
|
|
38
|
-
include: ['**/*.svg', '**/*.svg?react'],
|
|
39
|
-
}),
|
|
40
|
-
typescript({
|
|
41
|
-
declaration: true,
|
|
42
|
-
declarationDir: 'dist',
|
|
43
|
-
outDir: 'dist',
|
|
44
|
-
rootDir: 'src',
|
|
45
|
-
}),
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
export default [
|
|
49
|
-
{
|
|
50
|
-
input: 'src/index.ts',
|
|
51
|
-
output: [
|
|
52
|
-
{
|
|
53
|
-
...baseOutput,
|
|
54
|
-
format: 'esm',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
...baseOutput,
|
|
58
|
-
format: 'cjs',
|
|
59
|
-
entryFileNames: '[name].cjs',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
external,
|
|
63
|
-
plugins,
|
|
64
|
-
},
|
|
65
|
-
];
|
|
1
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
2
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
+
import typescript from '@rollup/plugin-typescript';
|
|
4
|
+
import svgr from '@svgr/rollup';
|
|
5
|
+
import { readFileSync } from 'fs';
|
|
6
|
+
import styles from 'rollup-plugin-styles';
|
|
7
|
+
|
|
8
|
+
const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
|
|
9
|
+
|
|
10
|
+
const external = Object.keys(pkg.peerDependencies || {});
|
|
11
|
+
|
|
12
|
+
const baseOutput = {
|
|
13
|
+
dir: 'dist',
|
|
14
|
+
sourcemap: true,
|
|
15
|
+
exports: 'named',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const plugins = [
|
|
19
|
+
resolve({
|
|
20
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss', '.css'],
|
|
21
|
+
}),
|
|
22
|
+
commonjs(),
|
|
23
|
+
styles({
|
|
24
|
+
mode: 'inject',
|
|
25
|
+
sass: {
|
|
26
|
+
data: `
|
|
27
|
+
@import "src/styles/variables.scss";
|
|
28
|
+
@import "src/styles/mixins.scss";
|
|
29
|
+
@import "src/styles/border.scss";
|
|
30
|
+
@import "src/styles/theme-mixins.scss";
|
|
31
|
+
@import "src/styles/colors.scss";
|
|
32
|
+
@import "src/styles/typography.scss";
|
|
33
|
+
@import "src/styles/gap.scss";
|
|
34
|
+
`,
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
svgr({
|
|
38
|
+
include: ['**/*.svg', '**/*.svg?react'],
|
|
39
|
+
}),
|
|
40
|
+
typescript({
|
|
41
|
+
declaration: true,
|
|
42
|
+
declarationDir: 'dist',
|
|
43
|
+
outDir: 'dist',
|
|
44
|
+
rootDir: 'src',
|
|
45
|
+
}),
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export default [
|
|
49
|
+
{
|
|
50
|
+
input: 'src/index.ts',
|
|
51
|
+
output: [
|
|
52
|
+
{
|
|
53
|
+
...baseOutput,
|
|
54
|
+
format: 'esm',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
...baseOutput,
|
|
58
|
+
format: 'cjs',
|
|
59
|
+
entryFileNames: '[name].cjs',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
external,
|
|
63
|
+
plugins,
|
|
64
|
+
},
|
|
65
|
+
];
|