ff-ds-ui 0.0.3 → 0.0.5

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.
@@ -0,0 +1,9 @@
1
+ # Публикация либы в NPM
2
+
3
+ 1. Собрать сборку без ошибок => npm run build
4
+ 2. Поднять версию: package.json, json-lock
5
+ 3. Сделать тег: git tag v0.0.0
6
+ 4. Запушить тег: git push origin --tags
7
+ 4. Запушить пакеты: npm publish
8
+
9
+ Если ошибка то: npm login
package/README.md CHANGED
@@ -1 +1,5 @@
1
- # FF-DS-UI lib
1
+ # FF-DS-UI
2
+
3
+ ## Дизайн система FEBFES-TM
4
+
5
+ ## Npm: https://www.npmjs.com/package/ff-ds-ui
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ff-ds-ui",
3
3
  "private": false,
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "type": "module",
6
6
  "main": "./dist/my-ui-lib.umd.js",
7
7
  "module": "./dist/my-ui-lib.es.js",
@@ -28,15 +28,14 @@
28
28
  "@storybook/addon-docs": "^10.1.5",
29
29
  "@storybook/addon-onboarding": "^10.1.8",
30
30
  "@storybook/addon-vitest": "^10.1.8",
31
- "@storybook/react-vite": "^10.1.5",
32
31
  "@storybook/react": "^10.1.10",
32
+ "@storybook/react-vite": "^10.1.5",
33
33
  "@types/node": "^24.10.1",
34
34
  "@types/react": "^19.2.5",
35
35
  "@types/react-dom": "^19.2.3",
36
36
  "@vitejs/plugin-react": "^5.1.1",
37
37
  "@vitest/browser-playwright": "^4.0.15",
38
38
  "@vitest/coverage-v8": "^4.0.15",
39
- "classnames": "^2.5.1",
40
39
  "eslint": "^9.39.1",
41
40
  "eslint-plugin-react-hooks": "^7.0.1",
42
41
  "eslint-plugin-react-refresh": "^0.4.24",
@@ -53,5 +52,8 @@
53
52
  "vite": "^7.2.4",
54
53
  "vite-plugin-dts": "^4.5.4",
55
54
  "vitest": "^4.0.15"
55
+ },
56
+ "dependencies": {
57
+ "classnames": "^2.5.1"
56
58
  }
57
59
  }
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react'
2
2
  import './Avatar.scss'
3
- import { bemBlock } from '@/utils'
4
- import { Text } from '@/components/Text'
3
+ import { bemBlock } from '../../utils'
4
+ import { Text } from '../../components/Text'
5
5
  import { getAvatarCamelCaseText } from './utils'
6
6
 
7
7
  export interface AvatarProps {
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Button.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
  import type { BUTTON_BORDER, BUTTON_SIZES, BUTTON_VARIANTS, BUTTON_WIDTH } from './const'
5
5
 
6
6
  export type ButtonBorder = (typeof BUTTON_BORDER)[number]
@@ -1,4 +1,4 @@
1
- import { Flex } from '@/components'
1
+ import { Flex } from '../../'
2
2
  import { Button } from '../Button'
3
3
  import { BUTTON_BORDER, BUTTON_SIZES, BUTTON_VARIANTS, BUTTON_WIDTH } from '../const'
4
4
  import type { Meta, StoryObj } from '@storybook/react'
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Card.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
 
5
5
  interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
6
6
  children?: React.ReactNode
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import './Checkbox.scss'
3
3
  import { Text } from '../Text'
4
4
  import { Flex } from '../Flex'
5
- import { bemBlock } from '@/utils'
5
+ import { bemBlock } from '../../utils'
6
6
 
7
7
  interface CheckboxProps {
8
8
  size?: 's' | 'm' | 'l'
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Divider.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
  import { Text } from '../Text'
5
5
 
6
6
  interface DividerProps {
@@ -1,7 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react'
2
2
  import { Divider } from '../Divider'
3
- import { Flex } from '@/components/Flex'
4
- import { Avatar } from '@/components/Avatar'
3
+ import { Flex } from '../../'
4
+ import { Avatar } from '../../Avatar'
5
5
 
6
6
  const meta = {
7
7
  title: 'Components/Divider',
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Flex.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
 
5
5
  interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {
6
6
  children: React.ReactNode
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Label.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
  import { Text } from '../Text'
5
5
  import { Flex } from '../Flex'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Link.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
 
5
5
  interface LinkProps {
6
6
  underline?: boolean
@@ -38,7 +38,7 @@ $duration: 2s;
38
38
  -o-transform: rotate(0deg);
39
39
  }
40
40
  50% {
41
- stroke-dashoffset: $offset/2;
41
+ stroke-dashoffset: calc($offset / 2);
42
42
  transform: rotate(135deg);
43
43
  -webkit-transform: rotate(135deg);
44
44
  -moz-transform: rotate(135deg);
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Loader.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
  import { loaderSizes } from './const'
5
5
 
6
6
  interface LoaderProps {
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Radio.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
  import { Text } from '../Text'
5
5
  import { Flex } from '../Flex'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Skeleton.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
 
5
5
  interface SkeletonProps {
6
6
  view?: 'circle' | 'square'
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react'
2
2
  import './Tabs.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
  import { Text } from '../Text'
5
5
 
6
6
  interface TabsProps {
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import './Text.scss'
3
- import { bemBlock } from '@/utils'
3
+ import { bemBlock } from '../../utils'
4
4
 
5
5
  export type TextVariantType =
6
6
  | 'body1'
@@ -1,4 +1,4 @@
1
- import { Flex } from '@/components/Flex'
1
+ import { Flex } from '../../'
2
2
  import { Text } from '../Text'
3
3
  import type { Meta, StoryObj } from '@storybook/react'
4
4
 
@@ -1,8 +1,7 @@
1
1
  import React from 'react'
2
2
  import './TextArea.scss'
3
- import { bemBlock } from '@/utils'
4
- import { Text } from '../Text/Text'
5
- import { Flex } from '../Flex'
3
+ import { bemBlock } from '../../utils'
4
+ import { Text, Flex } from '../'
6
5
 
7
6
  interface TextAreaProps extends React.HTMLAttributes<HTMLTextAreaElement> {
8
7
  placeholder?: string
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import './TextInput.scss'
3
- import { bemBlock } from '@/utils'
4
- import { Flex } from '@/components/Flex'
3
+ import { bemBlock } from '../../utils'
4
+ import { Flex } from '../'
5
5
  import { Text } from '../Text/Text'
6
6
 
7
7
  interface TextInputProps extends React.HTMLAttributes<HTMLInputElement> {
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import './User.scss'
3
3
  import { Avatar, type AvatarProps } from '../Avatar'
4
- import { Flex, Text } from '@/components'
4
+ import { Flex, Text } from '../'
5
5
 
6
6
  interface UserProps {
7
7
  avatar?: AvatarProps
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export * from './components'
1
+ export * from './components'
@@ -11,6 +11,7 @@ export const bemBlock = (bemBlockName: string) => {
11
11
  const classNameMods = mods
12
12
  ? Object.entries(mods)
13
13
  // Cортируем пустые значения
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
15
  .filter(([_, value]) => value !== false && value !== undefined && value !== null)
15
16
  // Убираем значения true - btn_disabled_true => btn_disabled
16
17
  .map(([bemModifier, bemModifierValue]) => {
package/tsconfig.app.json CHANGED
@@ -7,10 +7,7 @@
7
7
  "module": "ESNext",
8
8
  "types": ["vite/client"],
9
9
  "skipLibCheck": true,
10
- "baseUrl": ".",
11
- "paths": {
12
- "@/*": ["src/*"]
13
- },
10
+
14
11
  /* Bundler mode */
15
12
  "moduleResolution": "bundler",
16
13
  "allowImportingTsExtensions": true,
@@ -10,11 +10,8 @@
10
10
  "strict": true,
11
11
  "moduleResolution": "Node",
12
12
  "skipLibCheck": true,
13
- "esModuleInterop": true,
14
- "baseUrl": ".",
15
- "paths": {
16
- "@/*": ["src/*"]
17
- }
13
+ "esModuleInterop": true
18
14
  },
19
- "include": ["src"]
15
+ "include": ["src"],
16
+ "exclude": ["**/*.stories.*"]
20
17
  }
package/vite.config.ts CHANGED
@@ -23,34 +23,26 @@ export default defineConfig({
23
23
  entry: 'src/index.ts',
24
24
  name: 'MyUILib',
25
25
  fileName: (format) => `my-ui-lib.${format}.js`,
26
+ formats: ['es', 'cjs'],
26
27
  },
27
28
  outDir: 'dist',
28
- // папка сборки
29
29
  emptyOutDir: true,
30
- // очищает dist перед сборкой
31
30
  rollupOptions: {
32
- external: ['react', 'react-dom'],
31
+ external: ['react', 'react-dom', 'classnames'],
33
32
  output: {
34
33
  globals: {
35
34
  react: 'React',
36
35
  'react-dom': 'ReactDOM',
37
36
  },
38
- preserveModules: false, // отключаем копирование структуры src
37
+ preserveModules: false,
39
38
  },
40
39
  },
41
40
  },
42
- resolve: {
43
- alias: {
44
- '@': path.resolve(__dirname, 'src'),
45
- },
46
- },
47
41
  test: {
48
42
  projects: [
49
43
  {
50
44
  extends: true,
51
45
  plugins: [
52
- // The plugin will run tests for the stories defined in your Storybook config
53
- // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
54
46
  storybookTest({
55
47
  configDir: path.join(dirname, '.storybook'),
56
48
  }),
@@ -75,7 +67,7 @@ export default defineConfig({
75
67
  test: {
76
68
  name: 'unit',
77
69
  include: ['src/**/*.test.{ts,tsx}'],
78
- environment: 'node', // или 'node', если это не React
70
+ environment: 'node',
79
71
  },
80
72
  },
81
73
  ],