@sima-land/moleculas 12.1.0 → 12.3.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.
Files changed (77) hide show
  1. package/common/components/adult-block/adult-block.d.ts +2 -2
  2. package/common/components/adult-block/adult-block.js +2 -2
  3. package/common/components/badge/badge.module.scss +1 -1
  4. package/common/components/badge/index.d.ts +4 -0
  5. package/common/components/badge/index.js +2 -6
  6. package/common/components/badge-list/badge-list.module.scss +0 -1
  7. package/common/components/badge-list/index.d.ts +6 -2
  8. package/common/components/badge-list/index.js +4 -2
  9. package/common/components/product-info/index.d.ts +5 -0
  10. package/common/components/product-info/index.js +5 -4
  11. package/common/components/product-info/product-info.module.scss +10 -0
  12. package/common/components/quick-view-button/index.js +1 -1
  13. package/common/components/wish-button/index.js +1 -1
  14. package/common/helpers/format-qty-string.js +1 -3
  15. package/common/helpers/get-contained-items.js +2 -1
  16. package/desktop/components/breadcrumbs/breadcrumbs.module.scss +2 -2
  17. package/desktop/components/breadcrumbs/index.d.ts +4 -0
  18. package/desktop/components/breadcrumbs/index.js +5 -5
  19. package/desktop/components/gallery-modal/components/all-round-view.js +13 -13
  20. package/desktop/components/gallery-modal/components/all-round-view.module.scss +1 -1
  21. package/desktop/components/gallery-modal/components/gallery-modal.d.ts +7 -0
  22. package/desktop/components/gallery-modal/components/gallery-modal.js +13 -12
  23. package/desktop/components/gallery-modal/components/image-overlay.js +1 -1
  24. package/desktop/components/gallery-modal/components/image-overlay.module.scss +1 -1
  25. package/desktop/components/gallery-modal/components/review-info.d.ts +1 -1
  26. package/desktop/components/gallery-modal/components/review-info.js +1 -1
  27. package/desktop/components/gallery-modal/components/thumbnail.d.ts +1 -1
  28. package/desktop/components/gallery-modal/components/thumbnail.js +3 -3
  29. package/desktop/components/gallery-modal/utils.d.ts +1 -1
  30. package/desktop/components/gallery-modal/utils.js +6 -6
  31. package/desktop/components/item-image/index.d.ts +1 -1
  32. package/desktop/components/item-image/index.js +8 -9
  33. package/desktop/components/item-image/item-image.module.scss +4 -4
  34. package/desktop/components/modifiers/button/index.js +4 -4
  35. package/desktop/components/modifiers/group/index.js +19 -18
  36. package/desktop/components/modifiers/widget/index.js +2 -2
  37. package/desktop/components/person-modal/index.d.ts +16 -14
  38. package/desktop/components/person-modal/index.js +5 -16
  39. package/desktop/components/product-card/index.d.ts +5 -2
  40. package/desktop/components/product-card/index.js +7 -7
  41. package/desktop/components/product-card/product-card.module.scss +14 -0
  42. package/desktop/components/product-carousel/hover-card.js +4 -4
  43. package/desktop/components/product-carousel/index.d.ts +6 -0
  44. package/desktop/components/product-carousel/index.js +35 -34
  45. package/desktop/components/product-carousel/product-carousel.module.scss +1 -1
  46. package/desktop/components/product-carousel/utils.js +11 -11
  47. package/desktop/components/promotion-card/banner-title.js +7 -7
  48. package/desktop/components/promotion-card/estimate.js +4 -6
  49. package/desktop/components/promotion-card/index.d.ts +11 -1
  50. package/desktop/components/promotion-card/index.js +7 -7
  51. package/desktop/components/promotion-card/index.module.scss +2 -2
  52. package/desktop/components/promotion-card/placeholder.js +4 -4
  53. package/mobile/components/garland-calculator-button/garland-calculator-button.module.scss +1 -1
  54. package/mobile/components/item-image/index.d.ts +1 -1
  55. package/mobile/components/item-image/index.js +5 -7
  56. package/mobile/components/item-image/item-image.module.scss +3 -3
  57. package/mobile/components/modifiers-list/index.d.ts +1 -1
  58. package/mobile/components/modifiers-list/index.js +1 -1
  59. package/mobile/components/modifiers-list/modifier-item/index.js +7 -7
  60. package/mobile/components/modifiers-list/modifiers-list.module.scss +0 -1
  61. package/mobile/components/person-screen/index.d.ts +1 -1
  62. package/mobile/components/person-screen/index.js +3 -3
  63. package/mobile/components/person-screen/person-screen.module.scss +0 -1
  64. package/mobile/components/product-actions-alert/index.js +6 -5
  65. package/mobile/components/product-row/index.d.ts +1 -1
  66. package/mobile/components/product-row/index.js +19 -24
  67. package/mobile/components/product-row/product-row.module.scss +0 -1
  68. package/mobile/components/product-slider/index.d.ts +1 -1
  69. package/mobile/components/product-slider/index.js +7 -7
  70. package/mobile/components/product-slider/item.js +2 -2
  71. package/mobile/components/product-slider/utils.js +1 -1
  72. package/mobile/components/search-bar/index.d.ts +1 -1
  73. package/mobile/components/search-bar/index.js +31 -31
  74. package/mobile/components/search-bar/search-bar.module.scss +9 -3
  75. package/mobile/components/select-screen/index.js +5 -6
  76. package/package.json +39 -31
  77. package/README.md +0 -86
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sima-land/moleculas",
3
- "version": "12.1.0",
3
+ "version": "12.3.1",
4
4
  "repository": "ssh://git@github.com:sima-land/moleculas.git",
5
5
  "author": "www.sima-land.ru team",
6
6
  "license": "Apache-2.0",
@@ -13,21 +13,24 @@
13
13
  "build:before": "rimraf build",
14
14
  "build:main": "tsc --project tsconfig.build.json",
15
15
  "build:after": "node .build/dist.js",
16
- "build": "yarn build:before && yarn build:main && yarn build:after",
16
+ "build": "npm run build:before && npm run build:main && npm run build:after",
17
17
  "type-check": "tsc -p . --noEmit",
18
18
  "test": "jest",
19
19
  "coverage": "jest --coverage",
20
20
  "lint:scripts": "eslint --cache src/ --ext .js,.jsx,.ts,.tsx",
21
21
  "lint:styles": "stylelint 'src/**/*.scss'",
22
22
  "storybook": "start-storybook -p 6006",
23
- "storybook:build": "build-storybook --no-dll --quiet --loglevel error -o build-storybook"
23
+ "storybook:build": "build-storybook --quiet --loglevel error -o build-storybook",
24
+ "prettier": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,css,scss}\" --loglevel error",
25
+ "prettier:check": "prettier --check \"./src/**/*.{js,jsx,ts,tsx,css,scss}\" --loglevel error"
24
26
  },
25
27
  "dependencies": {
26
- "@sima-land/ui-nucleons": "^39.0.1",
27
- "@sima-land/ui-quarks": "^2.0.1",
28
+ "@sima-land/ui-nucleons": "^40.3.0",
29
+ "@sima-land/ui-quarks": "^2.2.0",
28
30
  "classnames": "^2.3.1",
31
+ "date-fns": "^2.26.0",
29
32
  "lodash": "^4.17.21",
30
- "react-svg": "^11.2.2",
33
+ "react-svg": "^14.1.3",
31
34
  "react-transition-group": "^4.4.1"
32
35
  },
33
36
  "peerDependencies": {
@@ -35,44 +38,49 @@
35
38
  "react-dom": ">=17"
36
39
  },
37
40
  "devDependencies": {
38
- "@babel/core": "^7.14.8",
39
- "@babel/preset-env": "^7.14.8",
40
- "@babel/preset-react": "^7.14.5",
41
- "@sima-land/linters": "^1.0.12",
42
- "@storybook/addon-actions": "^6.3.6",
43
- "@storybook/addon-docs": "^6.3.6",
44
- "@storybook/addon-storysource": "^6.3.6",
45
- "@storybook/addon-viewport": "^6.3.6",
46
- "@storybook/react": "^6.3.6",
41
+ "@babel/core": "^7.16.0",
42
+ "@babel/preset-env": "^7.16.4",
43
+ "@babel/preset-react": "^7.16.0",
44
+ "@rushstack/eslint-patch": "^1.1.0",
45
+ "@sima-land/linters": "^2.1.1",
46
+ "@storybook/addon-actions": "^6.3.12",
47
+ "@storybook/addon-docs": "^6.3.12",
48
+ "@storybook/addon-storysource": "^6.3.12",
49
+ "@storybook/addon-viewport": "^6.3.12",
50
+ "@storybook/builder-webpack5": "^6.3.12",
51
+ "@storybook/manager-webpack5": "^6.3.12",
52
+ "@storybook/react": "^6.3.12",
53
+ "@storybook/theming": "^6.3.12",
47
54
  "@svgr/webpack": "^5.5.0",
48
55
  "@testing-library/react": "^12.1.0",
49
- "@types/enzyme": "^3.10.8",
50
- "@types/jest": "^26.0.22",
51
- "@types/lodash": "^4.14.169",
52
- "@types/react-dom": "^17.0.4",
53
- "@types/react-transition-group": "^4.4.1",
54
- "@typescript-eslint/eslint-plugin": "^4.22.0",
55
- "@typescript-eslint/parser": "^4.22.0",
56
- "@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
57
- "babel-preset-jest": "^27.0.6",
56
+ "@types/enzyme": "^3.10.10",
57
+ "@types/jest": "^27.0.3",
58
+ "@types/lodash": "^4.14.177",
59
+ "@types/react-dom": "^17.0.11",
60
+ "@types/react-transition-group": "^4.4.4",
61
+ "@wojtekmaj/enzyme-adapter-react-17": "^0.6.5",
62
+ "babel-preset-jest": "^27.2.0",
58
63
  "copyfiles": "^2.4.1",
59
64
  "css-loader": "^5.0.1",
60
- "date-fns": "^2.16.1",
61
65
  "enzyme": "^3.11.0",
62
- "enzyme-adapter-react-16": "^1.15.2",
63
66
  "enzyme-to-json": "^3.4.4",
64
- "husky": "^7.0.1",
67
+ "eslint": "^7.32.0",
68
+ "husky": "^7.0.4",
65
69
  "identity-obj-proxy": "^3.0.0",
66
- "jest": "^26.6.3",
67
- "lint-staged": "^11.1.1",
70
+ "jest": "^27.3.1",
71
+ "lint-staged": "^12.1.2",
72
+ "postcss": "^8.3.11",
73
+ "prettier": "^2.5.0",
68
74
  "react": "^17.0.2",
75
+ "react-docgen-typescript": "^2.1.1",
69
76
  "react-dom": "^17.0.2",
70
77
  "rimraf": "^3.0.2",
71
78
  "sass": "^1.36.0",
72
79
  "sass-loader": "^10.1.0",
73
80
  "style-loader": "^2.0.0",
74
- "ts-jest": "^26.5.5",
81
+ "stylelint": "^14.1.0",
82
+ "ts-jest": "^27.0.7",
75
83
  "typescript": "^4.2.4",
76
- "webpack": "^5.47.1"
84
+ "webpack": "^5.64.4"
77
85
  }
78
86
  }
package/README.md DELETED
@@ -1,86 +0,0 @@
1
- # Библиотека компонентов www.sima-land.ru
2
-
3
- React-компоненты, привязанные к контексту интернет-магазина.
4
-
5
- ## Начало работы
6
-
7
- ### Подключение
8
-
9
- Для подключения к проекту используйте
10
-
11
- ```bash
12
- # npm
13
- $ npm i -S @sima-land/moleculas
14
-
15
- # yarn
16
- $ yarn add @sima-land/moleculas
17
- ```
18
-
19
- ### Консольные команды, необходимые в процессе разработки
20
-
21
- * `yarn test` - запуск unit-тестов
22
- * `yarn lint` - запуск линтеров
23
- * `yarn storybook` - запуск *storybook*
24
-
25
- ## Соглашения
26
-
27
- 1. В проекте используется линтер *ESLint*. Чтобы сделать `commit` и `push` в репозиторий, изменения должны пройти проверку линтером.
28
- 1. Необходимо полное покрытие тестами всего функционала. Чтобы сделать `push` в репозиторий, все тесты должны пройти успешно.
29
- 1. Коммиты должны быть оформлены по следующему шаблону:
30
- ```
31
- [№ задачи] [Название задачи]
32
-
33
- [Изменение №1]
34
- [Изменение №2]
35
- ...
36
- [Изменение №n]
37
- ```
38
- Пример:
39
- ```
40
- #62 Подключить отладку серверного приложения, написать документацию по работе с проектом
41
-
42
- Внесены изменения в README.md, добавлены инструкции по началу работы в проекте
43
- Добавлены конфигурационные файлы для Jest
44
- Настроена отладка приложения в режиме разработки, инструкции по настройке IDE добавлены в README.md
45
- ```
46
-
47
- ## Отладка
48
-
49
- Для отладки иногда полезно подключить данную библиотеку к проекту напрямую, сделав `symlink` в файловой системе.
50
-
51
- 1. Клонируем библиотеку. Заходим в папку этой библиотеки и делаем ```yarn build && cd build && yarn link```. Это нужно сделать 1 раз.
52
- 2. Заходим в папку проекта к которому подключена библиотека и делаем ```yarn link "@sima-land/moleculas"```. Это
53
- приведет к тому, что код в node_modules будет заменен на ссылку в вашей FS.
54
- 3. Для возврата в нормальный режим ```yarn unlink "@sima-land/moleculas" && yarn install --force```
55
-
56
- Примечание: Если возникли ошибки с реактом/хуками, и одной из проблем в логе ошибки значится дублирование react'a,
57
- следует сделать линк реакта молекул с реактом проекта:
58
- 1. Директория проекта куда добавлены молекулы `cd ./node_modules/react && yarn link`.
59
- 2. Директория молекул `yarn link "react"`.
60
-
61
- ## Витрина компонентов
62
-
63
- В качестве витрины компонентов для отображения размещенных в библиотеке компонентов используется [storybook](https://storybook.js.org/)
64
-
65
- Истории и документация компонентов позволяют увидеть варианты использования компонента с различными свойствами и примеры использования не вникая в код и логику компонента, что позволяет ускорить разработку при использовании библиотеки.
66
- Поэтому, при создании историй/документации компонентов необходимо учитывать различные **варианты использования** и различные **комбинации входных параметров**.
67
-
68
- ### Соглашения
69
-
70
- Истории компонентов должны соответствовать формату `*.stories.(ts|tsx)`.
71
-
72
- Истории и вспомогательные файлы должны размещаться в директории `__stories__` в директории компонента.
73
-
74
- ### Требования к историям/документации
75
-
76
- **История должна содержать:**
77
- - Вариант использования компонента;
78
- - Наименование, соответствующее варианту использования;
79
- - Необходимые начальные свойства (их можно изменить в UI Storybook на вкладке _Controls_).
80
-
81
- **Документация/блок историй должны содержать:**
82
- - Наименование компонента с префиксом группы, например `desktop/MyComponent`;
83
- - Текстовое описание компонента;
84
- - Блок кода с примером использования компонента;
85
- - Если компонент принимает в параметрах функции-обработчики, то они должны быть объявлены как [action](https://storybook.js.org/docs/react/essentials/actions), для отображения выполнения обработчиков на вкладке _Actions_ в UI.
86
- Для свойств-обработчиков, чьи имена начинаются с `on*` добавление [action](https://storybook.js.org/docs/react/essentials/actions) происходит автоматически, дополнительных действий с ними не требуется.