ff-ds-ui 0.0.2 → 0.0.4
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/.husky/pre-commit +2 -0
- package/.prettierrc +7 -0
- package/.storybook/main.ts +14 -0
- package/.storybook/preview.ts +21 -0
- package/.storybook/vitest.setup.ts +7 -0
- package/LICENSE +21 -21
- package/README.md +13 -73
- package/eslint.config.js +29 -23
- package/package.json +57 -36
- package/src/components/Avatar/Avatar.scss +90 -0
- package/src/components/Avatar/Avatar.tsx +40 -0
- package/src/components/Avatar/__stories__/Avatar.stories.tsx +21 -0
- package/src/components/Avatar/__test__/utils.test.ts +76 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Avatar/utils.tsx +26 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +40 -0
- package/src/components/Breadcrumbs/__stories__/Breadcrumbs.stories.tsx +20 -0
- package/src/components/Breadcrumbs/index.ts +1 -0
- package/src/components/Button/Button.scss +245 -0
- package/src/components/Button/Button.tsx +34 -0
- package/src/components/Button/__stories__/Button.stories.tsx +168 -0
- package/src/components/Button/const.ts +26 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/Card.scss +13 -0
- package/src/components/Card/Card.tsx +12 -0
- package/src/components/Card/__stories__/Card.stories.tsx +18 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.scss +28 -0
- package/src/components/Checkbox/Checkbox.tsx +23 -0
- package/src/components/Checkbox/__stories__/Checkbox.stories.tsx +21 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Divider/Divider.scss +62 -0
- package/src/components/Divider/Divider.tsx +21 -0
- package/src/components/Divider/__stories__/Divider.stories.tsx +68 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/Flex/Flex.scss +94 -0
- package/src/components/Flex/Flex.tsx +41 -0
- package/src/components/Flex/__stories__/Flex.stories.tsx +27 -0
- package/src/components/Flex/index.ts +1 -0
- package/src/components/Label/Label.scss +53 -0
- package/src/components/Label/Label.tsx +27 -0
- package/src/components/Label/__stories__/Label.stories.tsx +26 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Link/Link.scss +13 -0
- package/src/components/Link/Link.tsx +18 -0
- package/src/components/Link/__stories__/Link.stories.tsx +20 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Loader/Loader.scss +56 -0
- package/src/components/Loader/Loader.tsx +33 -0
- package/src/components/Loader/__stories__/Loader.stories.tsx +18 -0
- package/src/components/Loader/const.ts +7 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/Radio/Radio.scss +28 -0
- package/src/components/Radio/Radio.tsx +24 -0
- package/src/components/Radio/__stories__/Radio.stories.tsx +21 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Skeleton/Skeleton.scss +73 -0
- package/src/components/Skeleton/Skeleton.tsx +16 -0
- package/src/components/Skeleton/__stories__/Skeleton.stories.tsx +16 -0
- package/src/components/Skeleton/index.ts +1 -0
- package/src/components/Tabs/Tabs.scss +25 -0
- package/src/components/Tabs/Tabs.tsx +39 -0
- package/src/components/Tabs/__stories__/Tabs.stories.tsx +19 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Text/Text.scss +30 -0
- package/src/components/Text/Text.tsx +68 -0
- package/src/components/Text/_stories_/Text.stories.tsx +95 -0
- package/src/components/Text/index.ts +1 -0
- package/src/components/TextArea/TextArea.scss +45 -0
- package/src/components/TextArea/TextArea.tsx +38 -0
- package/src/components/TextArea/__stories__/TextArea.stories.tsx +20 -0
- package/src/components/TextArea/index.ts +1 -0
- package/src/components/TextInput/TextInput.scss +92 -0
- package/src/components/TextInput/TextInput.tsx +43 -0
- package/src/components/TextInput/__stories__/TextInput.stories.tsx +40 -0
- package/src/components/TextInput/index.ts +1 -0
- package/src/components/User/User.scss +7 -0
- package/src/components/User/User.tsx +23 -0
- package/src/components/User/__stories__/User.stories.tsx +23 -0
- package/src/components/User/index.ts +1 -0
- package/src/components/index.ts +17 -0
- package/src/index.ts +1 -1
- package/src/stories/modules.mdx +14 -0
- package/src/styles/fonts.scss +1 -0
- package/src/styles/mixins/_index.scss +18 -0
- package/src/styles/mixins/button.scss +29 -0
- package/src/styles/mixins/typography.scss +107 -0
- package/src/styles/styles.scss +3 -0
- package/src/styles/variables/_index.scss +25 -0
- package/src/styles/variables/colors.scss +45 -0
- package/src/styles/variables/padding.scss +7 -0
- package/src/styles/variables/radius.scss +8 -0
- package/src/styles/variables/spacing.scss +15 -0
- package/src/styles/variables/typography.scss +66 -0
- package/src/utils/bem/__tests__/bem.test.ts +25 -0
- package/src/utils/bem/bem.ts +24 -0
- package/src/utils/index.ts +1 -0
- package/tsconfig.app.json +28 -28
- package/tsconfig.build.json +16 -0
- package/tsconfig.json +4 -7
- package/tsconfig.node.json +26 -26
- package/vite.config.ts +78 -32
- package/vitest.shims.d.ts +1 -0
- package/index.html +0 -13
- package/public/vite.svg +0 -1
- package/src/components/Button.tsx +0 -9
package/vite.config.ts
CHANGED
|
@@ -1,32 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
|
+
import { defineConfig } from 'vite'
|
|
3
|
+
import react from '@vitejs/plugin-react'
|
|
4
|
+
import dts from 'vite-plugin-dts'
|
|
5
|
+
import path from 'path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'
|
|
8
|
+
import { playwright } from '@vitest/browser-playwright'
|
|
9
|
+
const dirname =
|
|
10
|
+
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url))
|
|
11
|
+
|
|
12
|
+
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
plugins: [
|
|
15
|
+
react(),
|
|
16
|
+
dts({
|
|
17
|
+
tsconfigPath: './tsconfig.build.json',
|
|
18
|
+
insertTypesEntry: true,
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
build: {
|
|
22
|
+
lib: {
|
|
23
|
+
entry: 'src/index.ts',
|
|
24
|
+
name: 'MyUILib',
|
|
25
|
+
fileName: (format) => `my-ui-lib.${format}.js`,
|
|
26
|
+
},
|
|
27
|
+
outDir: 'dist',
|
|
28
|
+
// папка сборки
|
|
29
|
+
emptyOutDir: true,
|
|
30
|
+
// очищает dist перед сборкой
|
|
31
|
+
rollupOptions: {
|
|
32
|
+
external: ['react', 'react-dom'],
|
|
33
|
+
output: {
|
|
34
|
+
globals: {
|
|
35
|
+
react: 'React',
|
|
36
|
+
'react-dom': 'ReactDOM',
|
|
37
|
+
},
|
|
38
|
+
preserveModules: false, // отключаем копирование структуры src
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
test: {
|
|
43
|
+
projects: [
|
|
44
|
+
{
|
|
45
|
+
extends: true,
|
|
46
|
+
plugins: [
|
|
47
|
+
// The plugin will run tests for the stories defined in your Storybook config
|
|
48
|
+
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
49
|
+
storybookTest({
|
|
50
|
+
configDir: path.join(dirname, '.storybook'),
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
test: {
|
|
54
|
+
name: 'storybook',
|
|
55
|
+
browser: {
|
|
56
|
+
enabled: true,
|
|
57
|
+
headless: true,
|
|
58
|
+
provider: playwright({}),
|
|
59
|
+
instances: [
|
|
60
|
+
{
|
|
61
|
+
browser: 'chromium',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
setupFiles: ['.storybook/vitest.setup.ts'],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
extends: true,
|
|
70
|
+
test: {
|
|
71
|
+
name: 'unit',
|
|
72
|
+
include: ['src/**/*.test.{ts,tsx}'],
|
|
73
|
+
environment: 'node', // или 'node', если это не React
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@vitest/browser-playwright" />
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>ff-ds-ui</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/index.ts"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/public/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|