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.
Files changed (106) hide show
  1. package/.husky/pre-commit +2 -0
  2. package/.prettierrc +7 -0
  3. package/.storybook/main.ts +14 -0
  4. package/.storybook/preview.ts +21 -0
  5. package/.storybook/vitest.setup.ts +7 -0
  6. package/LICENSE +21 -21
  7. package/README.md +13 -73
  8. package/eslint.config.js +29 -23
  9. package/package.json +57 -36
  10. package/src/components/Avatar/Avatar.scss +90 -0
  11. package/src/components/Avatar/Avatar.tsx +40 -0
  12. package/src/components/Avatar/__stories__/Avatar.stories.tsx +21 -0
  13. package/src/components/Avatar/__test__/utils.test.ts +76 -0
  14. package/src/components/Avatar/index.ts +1 -0
  15. package/src/components/Avatar/utils.tsx +26 -0
  16. package/src/components/Breadcrumbs/Breadcrumbs.tsx +40 -0
  17. package/src/components/Breadcrumbs/__stories__/Breadcrumbs.stories.tsx +20 -0
  18. package/src/components/Breadcrumbs/index.ts +1 -0
  19. package/src/components/Button/Button.scss +245 -0
  20. package/src/components/Button/Button.tsx +34 -0
  21. package/src/components/Button/__stories__/Button.stories.tsx +168 -0
  22. package/src/components/Button/const.ts +26 -0
  23. package/src/components/Button/index.ts +1 -0
  24. package/src/components/Card/Card.scss +13 -0
  25. package/src/components/Card/Card.tsx +12 -0
  26. package/src/components/Card/__stories__/Card.stories.tsx +18 -0
  27. package/src/components/Card/index.ts +1 -0
  28. package/src/components/Checkbox/Checkbox.scss +28 -0
  29. package/src/components/Checkbox/Checkbox.tsx +23 -0
  30. package/src/components/Checkbox/__stories__/Checkbox.stories.tsx +21 -0
  31. package/src/components/Checkbox/index.ts +1 -0
  32. package/src/components/Divider/Divider.scss +62 -0
  33. package/src/components/Divider/Divider.tsx +21 -0
  34. package/src/components/Divider/__stories__/Divider.stories.tsx +68 -0
  35. package/src/components/Divider/index.ts +1 -0
  36. package/src/components/Flex/Flex.scss +94 -0
  37. package/src/components/Flex/Flex.tsx +41 -0
  38. package/src/components/Flex/__stories__/Flex.stories.tsx +27 -0
  39. package/src/components/Flex/index.ts +1 -0
  40. package/src/components/Label/Label.scss +53 -0
  41. package/src/components/Label/Label.tsx +27 -0
  42. package/src/components/Label/__stories__/Label.stories.tsx +26 -0
  43. package/src/components/Label/index.ts +1 -0
  44. package/src/components/Link/Link.scss +13 -0
  45. package/src/components/Link/Link.tsx +18 -0
  46. package/src/components/Link/__stories__/Link.stories.tsx +20 -0
  47. package/src/components/Link/index.ts +1 -0
  48. package/src/components/Loader/Loader.scss +56 -0
  49. package/src/components/Loader/Loader.tsx +33 -0
  50. package/src/components/Loader/__stories__/Loader.stories.tsx +18 -0
  51. package/src/components/Loader/const.ts +7 -0
  52. package/src/components/Loader/index.ts +1 -0
  53. package/src/components/Radio/Radio.scss +28 -0
  54. package/src/components/Radio/Radio.tsx +24 -0
  55. package/src/components/Radio/__stories__/Radio.stories.tsx +21 -0
  56. package/src/components/Radio/index.ts +1 -0
  57. package/src/components/Skeleton/Skeleton.scss +73 -0
  58. package/src/components/Skeleton/Skeleton.tsx +16 -0
  59. package/src/components/Skeleton/__stories__/Skeleton.stories.tsx +16 -0
  60. package/src/components/Skeleton/index.ts +1 -0
  61. package/src/components/Tabs/Tabs.scss +25 -0
  62. package/src/components/Tabs/Tabs.tsx +39 -0
  63. package/src/components/Tabs/__stories__/Tabs.stories.tsx +19 -0
  64. package/src/components/Tabs/index.ts +1 -0
  65. package/src/components/Text/Text.scss +30 -0
  66. package/src/components/Text/Text.tsx +68 -0
  67. package/src/components/Text/_stories_/Text.stories.tsx +95 -0
  68. package/src/components/Text/index.ts +1 -0
  69. package/src/components/TextArea/TextArea.scss +45 -0
  70. package/src/components/TextArea/TextArea.tsx +38 -0
  71. package/src/components/TextArea/__stories__/TextArea.stories.tsx +20 -0
  72. package/src/components/TextArea/index.ts +1 -0
  73. package/src/components/TextInput/TextInput.scss +92 -0
  74. package/src/components/TextInput/TextInput.tsx +43 -0
  75. package/src/components/TextInput/__stories__/TextInput.stories.tsx +40 -0
  76. package/src/components/TextInput/index.ts +1 -0
  77. package/src/components/User/User.scss +7 -0
  78. package/src/components/User/User.tsx +23 -0
  79. package/src/components/User/__stories__/User.stories.tsx +23 -0
  80. package/src/components/User/index.ts +1 -0
  81. package/src/components/index.ts +17 -0
  82. package/src/index.ts +1 -1
  83. package/src/stories/modules.mdx +14 -0
  84. package/src/styles/fonts.scss +1 -0
  85. package/src/styles/mixins/_index.scss +18 -0
  86. package/src/styles/mixins/button.scss +29 -0
  87. package/src/styles/mixins/typography.scss +107 -0
  88. package/src/styles/styles.scss +3 -0
  89. package/src/styles/variables/_index.scss +25 -0
  90. package/src/styles/variables/colors.scss +45 -0
  91. package/src/styles/variables/padding.scss +7 -0
  92. package/src/styles/variables/radius.scss +8 -0
  93. package/src/styles/variables/spacing.scss +15 -0
  94. package/src/styles/variables/typography.scss +66 -0
  95. package/src/utils/bem/__tests__/bem.test.ts +25 -0
  96. package/src/utils/bem/bem.ts +24 -0
  97. package/src/utils/index.ts +1 -0
  98. package/tsconfig.app.json +28 -28
  99. package/tsconfig.build.json +16 -0
  100. package/tsconfig.json +4 -7
  101. package/tsconfig.node.json +26 -26
  102. package/vite.config.ts +78 -32
  103. package/vitest.shims.d.ts +1 -0
  104. package/index.html +0 -13
  105. package/public/vite.svg +0 -1
  106. package/src/components/Button.tsx +0 -9
package/vite.config.ts CHANGED
@@ -1,32 +1,78 @@
1
- import { defineConfig } from "vite";
2
- import react from "@vitejs/plugin-react";
3
- import dts from "vite-plugin-dts";
4
-
5
- export default defineConfig({
6
- plugins: [
7
- react(),
8
- dts({
9
- tsconfigPath: "./tsconfig.build.json",
10
- insertTypesEntry: true
11
- })
12
- ],
13
- build: {
14
- lib: {
15
- entry: "src/index.ts",
16
- name: "MyUILib",
17
- fileName: (format) => `my-ui-lib.${format}.js`
18
- },
19
- outDir: "dist", // папка сборки
20
- emptyOutDir: true, // очищает dist перед сборкой
21
- rollupOptions: {
22
- external: ["react", "react-dom"],
23
- output: {
24
- globals: {
25
- react: "React",
26
- "react-dom": "ReactDOM"
27
- },
28
- preserveModules: false // отключаем копирование структуры src
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>
@@ -1,9 +0,0 @@
1
- import React from "react";
2
-
3
- export interface ButtonProps {
4
- children: React.ReactNode;
5
- }
6
-
7
- export const Button: React.FC<ButtonProps> = ({ children }) => {
8
- return <button>{children}</button>;
9
- };