@itcase/ui 1.8.18 → 1.8.21

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 (250) hide show
  1. package/dist/Avatar_cjs_CiQ14ufF.js +240 -0
  2. package/dist/Avatar_es_No9vSqji.js +236 -0
  3. package/dist/{Button_cjs_DjCsrrlr.js → Button_cjs_CnStmeGt.js} +12 -4
  4. package/dist/{Button_es_CHDT0-8K.js → Button_es_BV1bepl1.js} +12 -4
  5. package/dist/{ChipsGroup_cjs_CTpMiyQb.js → ChipsGroup_cjs_CL00pWKy.js} +2 -2
  6. package/dist/{ChipsGroup_es_CP_xm25C.js → ChipsGroup_es_Ciln2otW.js} +2 -2
  7. package/dist/{DatePicker_cjs_DPtOL1eW.js → DatePicker_cjs_DGgkpGbI.js} +4 -4
  8. package/dist/{DatePicker_es_DCuzMD0T.js → DatePicker_es_BIOyGm22.js} +4 -4
  9. package/dist/{DropdownItem_cjs_DW0UXopm.js → DropdownItem_cjs_DT-zspEr.js} +15 -15
  10. package/dist/{DropdownItem_es_vuNthDPa.js → DropdownItem_es_BJLFqVuH.js} +15 -15
  11. package/dist/{Group_cjs_DFmNT5Mq.js → Group_cjs_Cwt0gWk4.js} +10 -3
  12. package/dist/{Group_es_CRGwi5XI.js → Group_es_CYW2Hquh.js} +10 -3
  13. package/dist/{Image_cjs_DuIBtUq5.js → Image_cjs_CCWqbNn4.js} +11 -3
  14. package/dist/{Image_es_CSzHhlA1.js → Image_es_DZUVp0FS.js} +11 -3
  15. package/dist/{Label_cjs_mw4pHZR1.js → Label_cjs_Cqcf6ffp.js} +2 -2
  16. package/dist/{Label_es_CiPEDFcR.js → Label_es_CeNdA70T.js} +2 -2
  17. package/dist/Link_cjs_BlXrJ15R.js +303 -0
  18. package/dist/Link_es_CyJn7NFb.js +298 -0
  19. package/dist/{Loader_cjs_DZbIy6Ko.js → Loader_cjs_3VRzFLI2.js} +14 -2
  20. package/dist/{Loader_es_SHdP0IkA.js → Loader_es_DEYowVdU.js} +14 -2
  21. package/dist/Text_cjs_DPhKj3wf.js +68 -0
  22. package/dist/{Text_es_D012qJ8s.js → Text_es_BRb3qqKM.js} +8 -3
  23. package/dist/{Tooltip_cjs_BKOjNMkt.js → Tooltip_cjs_Cq5kuaIK.js} +480 -17
  24. package/dist/{Tooltip_es_C7zstTA2.js → Tooltip_es_D0PSqI2c.js} +480 -17
  25. package/dist/cjs/components/Accordion.js +3 -3
  26. package/dist/cjs/components/Avatar.js +13 -236
  27. package/dist/cjs/components/AvatarStack.js +35 -0
  28. package/dist/cjs/components/Badge.js +3 -3
  29. package/dist/cjs/components/Breadcrumbs.js +3 -3
  30. package/dist/cjs/components/Button.js +5 -5
  31. package/dist/cjs/components/Cell.js +4 -4
  32. package/dist/cjs/components/Checkbox.js +1 -1
  33. package/dist/cjs/components/Chips.js +4 -4
  34. package/dist/cjs/components/Choice.js +6 -6
  35. package/dist/cjs/components/CookiesWarning.js +13 -6
  36. package/dist/cjs/components/DatePeriod.js +8 -8
  37. package/dist/cjs/components/DatePicker.js +7 -7
  38. package/dist/cjs/components/Drawer.js +26 -2
  39. package/dist/cjs/components/Dropdown.js +5 -2
  40. package/dist/cjs/components/Group.js +1 -1
  41. package/dist/cjs/components/Icon.js +3 -3
  42. package/dist/cjs/components/Image.js +2 -2
  43. package/dist/cjs/components/InputPassword.js +226 -46
  44. package/dist/cjs/components/Label.js +4 -4
  45. package/dist/cjs/components/Link.js +1 -1
  46. package/dist/cjs/components/List.js +1 -1
  47. package/dist/cjs/components/Loader.js +2 -2
  48. package/dist/cjs/components/Logo.js +1 -1
  49. package/dist/cjs/components/MenuItem.js +2 -2
  50. package/dist/cjs/components/Modal.js +6 -6
  51. package/dist/cjs/components/ModalSheetBottom.js +7 -0
  52. package/dist/cjs/components/Notification.js +1 -1
  53. package/dist/cjs/components/Pagination.js +11 -9
  54. package/dist/cjs/components/Panel.js +2 -2
  55. package/dist/cjs/components/Radio.js +1 -1
  56. package/dist/cjs/components/Response.js +227 -183
  57. package/dist/cjs/components/Search.js +126 -13
  58. package/dist/cjs/components/Segmented.js +1 -1
  59. package/dist/cjs/components/Select.js +4 -4
  60. package/dist/cjs/components/Swiper.js +3 -3
  61. package/dist/cjs/components/Switch.js +238 -3
  62. package/dist/cjs/components/Tab.js +3 -3
  63. package/dist/cjs/components/Text.js +1 -1
  64. package/dist/cjs/components/Tile.js +240 -5
  65. package/dist/cjs/components/Title.js +3 -3
  66. package/dist/cjs/components/Tooltip.js +3 -3
  67. package/dist/components/Accordion.js +3 -3
  68. package/dist/components/Avatar.js +10 -237
  69. package/dist/components/AvatarStack.js +33 -0
  70. package/dist/components/Badge.js +3 -3
  71. package/dist/components/Breadcrumbs.js +3 -3
  72. package/dist/components/Button.js +5 -5
  73. package/dist/components/Cell.js +4 -4
  74. package/dist/components/Checkbox.js +1 -1
  75. package/dist/components/Chips.js +4 -4
  76. package/dist/components/Choice.js +6 -6
  77. package/dist/components/CookiesWarning.js +13 -7
  78. package/dist/components/DatePeriod.js +8 -8
  79. package/dist/components/DatePicker.js +7 -7
  80. package/dist/components/Drawer.js +26 -2
  81. package/dist/components/Dropdown.js +5 -2
  82. package/dist/components/Group.js +1 -1
  83. package/dist/components/Icon.js +3 -3
  84. package/dist/components/Image.js +2 -2
  85. package/dist/components/InputPassword.js +226 -45
  86. package/dist/components/Label.js +4 -4
  87. package/dist/components/Link.js +1 -1
  88. package/dist/components/List.js +1 -1
  89. package/dist/components/Loader.js +2 -2
  90. package/dist/components/Logo.js +1 -1
  91. package/dist/components/MenuItem.js +2 -2
  92. package/dist/components/Modal.js +6 -6
  93. package/dist/components/ModalSheetBottom.js +7 -1
  94. package/dist/components/Notification.js +1 -1
  95. package/dist/components/Pagination.js +11 -9
  96. package/dist/components/Panel.js +2 -2
  97. package/dist/components/Radio.js +1 -1
  98. package/dist/components/Response.js +227 -183
  99. package/dist/components/Search.js +126 -13
  100. package/dist/components/Segmented.js +1 -1
  101. package/dist/components/Select.js +4 -4
  102. package/dist/components/Swiper.js +3 -3
  103. package/dist/components/Switch.js +238 -3
  104. package/dist/components/Tab.js +3 -3
  105. package/dist/components/Text.js +1 -1
  106. package/dist/components/Tile.js +240 -5
  107. package/dist/components/Title.js +3 -3
  108. package/dist/components/Tooltip.js +3 -3
  109. package/dist/css/components/AvatarStack/AvatarStack.css +67 -0
  110. package/dist/css/components/Group/Group.css +6 -10
  111. package/dist/css/components/Icon/Icon.css +132 -8
  112. package/dist/css/components/Modal/Modal.css +20 -0
  113. package/dist/css/components/Text/Text.css +0 -9
  114. package/dist/css/styles/border-color/border-color_hover.css +6 -8
  115. package/dist/css/styles/fill/fill_active.css +19 -9
  116. package/dist/css/styles/fill/fill_active_hover.css +19 -0
  117. package/dist/css/styles/fill/fill_hover.css +19 -0
  118. package/dist/css/styles/text-color/text-color_active.css +17 -0
  119. package/dist/css/styles/text-color/text-color_active_hover.css +40 -0
  120. package/dist/stories/index.stories.js +49 -0
  121. package/dist/stories/useDevicePropsGenerator.mdx +76 -102
  122. package/dist/stories/useMediaQueries.mdx +32 -7
  123. package/dist/stories/useStyles.mdx +50 -2
  124. package/dist/types/components/AvatarStack/AvatarStack.d.ts +3 -0
  125. package/dist/types/components/AvatarStack/AvatarStack.interface.d.ts +9 -0
  126. package/dist/types/components/AvatarStack/index.d.ts +2 -0
  127. package/dist/types/components/Button/appearance/buttonDanger.d.ts +8 -0
  128. package/dist/types/components/CookiesWarning/CookiesWarning.appearance.d.ts +5 -0
  129. package/dist/types/components/CookiesWarning/index.d.ts +2 -1
  130. package/dist/types/components/Drawer/appearance/drawerSurface.d.ts +25 -0
  131. package/dist/types/components/Dropdown/appearance/dropdownAccent.d.ts +0 -6
  132. package/dist/types/components/Dropdown/appearance/dropdownSurface.d.ts +5 -0
  133. package/dist/types/components/InputPassword/InputPassword.appearance.d.ts +2 -3
  134. package/dist/types/components/InputPassword/InputPassword.interface.d.ts +4 -11
  135. package/dist/types/components/InputPassword/appearance/inputPasswordAccent.d.ts +20 -0
  136. package/dist/types/components/InputPassword/appearance/inputPasswordDanger.d.ts +7 -0
  137. package/dist/types/components/InputPassword/appearance/inputPasswordDisabled.d.ts +20 -0
  138. package/dist/types/components/InputPassword/appearance/inputPasswordError.d.ts +11 -0
  139. package/dist/types/components/InputPassword/appearance/inputPasswordInfo.d.ts +21 -0
  140. package/dist/types/components/InputPassword/appearance/inputPasswordPrimary.d.ts +8 -0
  141. package/dist/types/components/InputPassword/appearance/inputPasswordRequire.d.ts +20 -0
  142. package/dist/types/components/InputPassword/appearance/inputPasswordSecondary.d.ts +8 -0
  143. package/dist/types/components/InputPassword/appearance/inputPasswordSize.d.ts +59 -0
  144. package/dist/types/components/InputPassword/appearance/inputPasswordStyle.d.ts +16 -0
  145. package/dist/types/components/InputPassword/appearance/inputPasswordSuccess.d.ts +11 -0
  146. package/dist/types/components/InputPassword/appearance/inputPasswordSurface.d.ts +25 -0
  147. package/dist/types/components/InputPassword/appearance/inputPasswordWarning.d.ts +11 -0
  148. package/dist/types/components/InputPassword/index.d.ts +1 -1
  149. package/dist/types/components/Link/appearance/linkAccent.d.ts +20 -0
  150. package/dist/types/components/Link/appearance/linkDanger.d.ts +7 -0
  151. package/dist/types/components/Link/appearance/linkDisabled.d.ts +20 -0
  152. package/dist/types/components/Link/appearance/linkError.d.ts +11 -0
  153. package/dist/types/components/Link/appearance/linkInfo.d.ts +21 -0
  154. package/dist/types/components/Link/appearance/linkPrimary.d.ts +8 -0
  155. package/dist/types/components/Link/appearance/linkRequire.d.ts +20 -0
  156. package/dist/types/components/Link/appearance/linkSecondary.d.ts +8 -0
  157. package/dist/types/components/Link/appearance/linkSize.d.ts +59 -0
  158. package/dist/types/components/Link/appearance/linkStyle.d.ts +16 -0
  159. package/dist/types/components/Link/appearance/linkSuccess.d.ts +11 -0
  160. package/dist/types/components/Link/appearance/linkSurface.d.ts +25 -0
  161. package/dist/types/components/Link/appearance/linkWarning.d.ts +11 -0
  162. package/dist/types/components/Loader/Loader.appearance.d.ts +3 -2
  163. package/dist/types/components/Loader/Loader.interface.d.ts +16 -17
  164. package/dist/types/components/Loader/appearance/loaderSize.d.ts +12 -0
  165. package/dist/types/components/ModalSheetBottom/ModalSheetBottom.appearance.d.ts +5 -0
  166. package/dist/types/components/ModalSheetBottom/index.d.ts +1 -0
  167. package/dist/types/components/Pagination/appearance/paginationSize.d.ts +8 -0
  168. package/dist/types/components/Pagination/appearance/paginationSurface.d.ts +2 -0
  169. package/dist/types/components/Response/Response.appearance.d.ts +2 -2
  170. package/dist/types/components/Response/appearance/responseAccent.d.ts +20 -0
  171. package/dist/types/components/Response/appearance/responseDanger.d.ts +7 -0
  172. package/dist/types/components/Response/appearance/responseDisabled.d.ts +20 -0
  173. package/dist/types/components/Response/appearance/responseError.d.ts +11 -0
  174. package/dist/types/components/Response/appearance/responseInfo.d.ts +21 -0
  175. package/dist/types/components/Response/appearance/responsePrimary.d.ts +8 -0
  176. package/dist/types/components/Response/appearance/responseRequire.d.ts +20 -0
  177. package/dist/types/components/Response/appearance/responseSecondary.d.ts +8 -0
  178. package/dist/types/components/Response/appearance/responseSize.d.ts +59 -0
  179. package/dist/types/components/Response/appearance/responseStyle.d.ts +16 -0
  180. package/dist/types/components/Response/appearance/responseSuccess.d.ts +11 -0
  181. package/dist/types/components/Response/appearance/responseSurface.d.ts +25 -0
  182. package/dist/types/components/Response/appearance/responseWarning.d.ts +11 -0
  183. package/dist/types/components/Search/appearance/searchDefault.d.ts +24 -0
  184. package/dist/types/components/Search/appearance/searchDisabled.d.ts +20 -0
  185. package/dist/types/components/Search/appearance/searchError.d.ts +20 -0
  186. package/dist/types/components/Search/appearance/searchRequire.d.ts +20 -0
  187. package/dist/types/components/Search/appearance/searchSize.d.ts +18 -8
  188. package/dist/types/components/Search/appearance/searchSuccess.d.ts +20 -0
  189. package/dist/types/components/Switch/Switch.appearance.d.ts +1 -1
  190. package/dist/types/components/Switch/appearance/switchAccent.d.ts +20 -0
  191. package/dist/types/components/Switch/appearance/switchDanger.d.ts +7 -0
  192. package/dist/types/components/Switch/appearance/switchDisabled.d.ts +20 -0
  193. package/dist/types/components/Switch/appearance/switchError.d.ts +11 -0
  194. package/dist/types/components/Switch/appearance/switchInfo.d.ts +21 -0
  195. package/dist/types/components/Switch/appearance/switchPrimary.d.ts +8 -0
  196. package/dist/types/components/Switch/appearance/switchRequire.d.ts +20 -0
  197. package/dist/types/components/Switch/appearance/switchSecondary.d.ts +8 -0
  198. package/dist/types/components/Switch/appearance/switchSize.d.ts +59 -0
  199. package/dist/types/components/Switch/appearance/switchStyle.d.ts +16 -0
  200. package/dist/types/components/Switch/appearance/switchSuccess.d.ts +11 -0
  201. package/dist/types/components/Switch/appearance/switchSurface.d.ts +25 -0
  202. package/dist/types/components/Switch/appearance/switchWarning.d.ts +11 -0
  203. package/dist/types/components/Tile/appearance/tileAccent.d.ts +20 -0
  204. package/dist/types/components/Tile/appearance/tileDanger.d.ts +7 -0
  205. package/dist/types/components/Tile/appearance/tileDisabled.d.ts +20 -0
  206. package/dist/types/components/Tile/appearance/tileError.d.ts +11 -0
  207. package/dist/types/components/Tile/appearance/tileInfo.d.ts +21 -0
  208. package/dist/types/components/Tile/appearance/tilePrimary.d.ts +8 -0
  209. package/dist/types/components/Tile/appearance/tileRequire.d.ts +20 -0
  210. package/dist/types/components/Tile/appearance/tileSecondary.d.ts +8 -0
  211. package/dist/types/components/Tile/appearance/tileSize.d.ts +59 -0
  212. package/dist/types/components/Tile/appearance/tileStyle.d.ts +16 -0
  213. package/dist/types/components/Tile/appearance/tileSuccess.d.ts +11 -0
  214. package/dist/types/components/Tile/appearance/tileSurface.d.ts +25 -0
  215. package/dist/types/components/Tile/appearance/tileWarning.d.ts +11 -0
  216. package/dist/types/components/Title/Title.appearance.d.ts +2 -2
  217. package/dist/types/components/Title/Title.interface.d.ts +3 -3
  218. package/dist/types/components/Title/appearance/titleAccent.d.ts +20 -0
  219. package/dist/types/components/Title/appearance/titleDanger.d.ts +7 -0
  220. package/dist/types/components/Title/appearance/titleDisabled.d.ts +20 -0
  221. package/dist/types/components/Title/appearance/titleError.d.ts +11 -0
  222. package/dist/types/components/Title/appearance/titleInfo.d.ts +21 -0
  223. package/dist/types/components/Title/appearance/titlePrimary.d.ts +8 -0
  224. package/dist/types/components/Title/appearance/titleRequire.d.ts +20 -0
  225. package/dist/types/components/Title/appearance/titleSecondary.d.ts +8 -0
  226. package/dist/types/components/Title/appearance/titleSize.d.ts +59 -0
  227. package/dist/types/components/Title/appearance/titleStyle.d.ts +16 -0
  228. package/dist/types/components/Title/appearance/titleSuccess.d.ts +11 -0
  229. package/dist/types/components/Title/appearance/titleSurface.d.ts +25 -0
  230. package/dist/types/components/Title/appearance/titleWarning.d.ts +11 -0
  231. package/dist/types/components/Tooltip/Tooltip.appearance.d.ts +1 -1
  232. package/dist/types/components/Tooltip/appearance/tooltipAccent.d.ts +20 -0
  233. package/dist/types/components/Tooltip/appearance/tooltipDanger.d.ts +7 -0
  234. package/dist/types/components/Tooltip/appearance/tooltipDisabled.d.ts +20 -0
  235. package/dist/types/components/Tooltip/appearance/tooltipError.d.ts +11 -0
  236. package/dist/types/components/Tooltip/appearance/tooltipInfo.d.ts +21 -0
  237. package/dist/types/components/Tooltip/appearance/tooltipPrimary.d.ts +8 -0
  238. package/dist/types/components/Tooltip/appearance/tooltipRequire.d.ts +20 -0
  239. package/dist/types/components/Tooltip/appearance/tooltipSecondary.d.ts +8 -0
  240. package/dist/types/components/Tooltip/appearance/tooltipSize.d.ts +59 -0
  241. package/dist/types/components/Tooltip/appearance/tooltipStyle.d.ts +16 -0
  242. package/dist/types/components/Tooltip/appearance/tooltipSuccess.d.ts +11 -0
  243. package/dist/types/components/Tooltip/appearance/tooltipSurface.d.ts +25 -0
  244. package/dist/types/components/Tooltip/appearance/tooltipWarning.d.ts +11 -0
  245. package/package.json +11 -11
  246. package/dist/Link_cjs_yht44xJv.js +0 -68
  247. package/dist/Link_es_DkW06IM-.js +0 -63
  248. package/dist/Text_cjs_iL1l_7V1.js +0 -63
  249. package/dist/stories/Pagination.mdx +0 -11
  250. package/dist/stories/Tile.mdx +0 -11
@@ -3,7 +3,62 @@ import { Meta } from '@storybook/blocks'
3
3
  <Meta title="Hooks / useDevicePropsGenerator" />
4
4
 
5
5
  # `useDevicePropsGenerator`
6
- Хук позволяет автоматически получать значения пропсов или appearance, соответствующие viewport пользователя, а также преобразовывать их в CSS‑классы.
6
+ Хук позволяет автоматически получать значения `props` или `appearance`, которые соответствуют `viewport` пользователя, а также преобразовывать их в `CSS‑классы`.
7
+
8
+ Важно учитывать приоритет при котором будут применяться стили:
9
+
10
+ 1. Сначала используется значение из props, соответствующее текущему устройству
11
+ - Передали
12
+
13
+ ```jsx
14
+ <Component textAlignMobile="center" />
15
+ ```
16
+
17
+ - Получили
18
+ ```jsx
19
+ <Component style={{ textAlign: 'center' }} />
20
+ ```
21
+
22
+ 2. Если такого нет — используется значение из props без учёта устройства
23
+ - Передали
24
+
25
+ ```jsx
26
+ <Component textAlign="right" />
27
+ ```
28
+
29
+ - Получили
30
+
31
+ ```jsx
32
+ <Component style={{ textAlign: 'right' }} />
33
+ ```
34
+
35
+ 3. Если и его нет — берётся значение из appearance-конфига для текущего устройства
36
+
37
+ - Передали
38
+
39
+ ```js
40
+ {
41
+ textAlignMobile: 'left'
42
+ }
43
+ ```
44
+
45
+ - Получили
46
+
47
+ ```jsx
48
+ <Component style={{ textAlign: 'left' }} />
49
+ ```
50
+
51
+ 4. И в последнюю очередь — значение из appearance-конфига без учёта устройства
52
+
53
+ - Передали
54
+ ```jsx
55
+ textAlign: 'justify'
56
+ ```
57
+
58
+ - Получили
59
+ ```jsx
60
+ <Component style={{ textAlign: 'justify' }} />
61
+ ```
7
62
 
8
63
  ## Использование
9
64
 
@@ -19,35 +74,25 @@ const componentConfig: ComponentConfig = {
19
74
  ```
20
75
 
21
76
  2. Для того чтобы передавать несколько appearance в одной строке, например:
22
-
23
77
  ```jsx
24
78
  <Component appearance='errorPrimary sizeM' />
25
79
  ```
26
80
 
27
81
  где `errorPrimary` это
28
-
29
82
  ```js
30
83
  {
31
84
  fill: 'errorTertiary',
32
- borderColor: 'errorBorderQuaternary',
33
- borderHover: 'errorBorderQuaternary',
34
- textColor: 'surfaceTextPrimary',
35
- iconBeforeFill: 'errorItemQuaternary',
36
- iconClearFill: 'errorItemPrimary',
37
- placeholderTextColor: 'surfaceTextQuaternary',
38
85
  }
39
86
  ```
40
87
 
41
88
  а `sizeM` это
42
-
43
- ```js
89
+ ```ts
44
90
  {
45
91
  size: 'm',
46
- textSize: 'm',
47
92
  }
48
93
  ```
49
94
 
50
- нужен appearanceConfig
95
+ Нужен appearanceConfig
51
96
  ```js
52
97
  const appearanceConfig = appearance?.split(' ').reduce(
53
98
  (resultConfig, appearanceKey) => ({
@@ -57,19 +102,12 @@ const componentConfig: ComponentConfig = {
57
102
  {},
58
103
  )
59
104
  ```
60
- которому передается созданный ранее componentConfig и его результатом будет единный объект со свойствами из разных appearance
105
+ Которому передается созданный ранее componentConfig и его результатом будет единый объект со свойствами из разных appearance
61
106
 
62
107
  ```js
63
108
  {
64
109
  fill: 'errorTertiary',
65
- borderColor: 'errorBorderQuaternary',
66
- borderHover: 'errorBorderQuaternary',
67
- textColor: 'surfaceTextPrimary',
68
- iconBeforeFill: 'errorItemQuaternary',
69
- iconClearFill: 'errorItemPrimary',
70
- placeholderTextColor: 'surfaceTextQuaternary',
71
110
  size: "m",
72
- textSize: "m"
73
111
  }
74
112
  ```
75
113
 
@@ -106,7 +144,7 @@ const componentConfig: ComponentConfig = {
106
144
  </table>
107
145
 
108
146
 
109
- Из propsGenerator получаем переменные со строками, которые соответствуют appearance переданными в хук. Если указать просто fill, то получим `errorTertiary`,
147
+ Из propsGenerator получаем переменные со строками, которые соответствуют appearance переданными в хук. Если указать просто `fill`, то получим `errorTertiary`,
110
148
  если укажем `fillClass` то получим `error-tertiary`, поэтому везде в приведенном ниже примере указан суффикс `Class`.
111
149
 
112
150
  ```js
@@ -114,100 +152,36 @@ const componentConfig: ComponentConfig = {
114
152
 
115
153
  const {
116
154
  fillClass,
117
- borderColorClass,
118
- borderHoverClass,
119
- borderWidthClass,
120
- textColorClass,
121
- textSizeClass,
122
- textWeightClass,
123
- caretClass,
124
- placeholderTextColorClass,
125
- shapeClass,
126
155
  sizeClass,
127
- widthClass,
128
156
  } = propsGenerator
129
157
  ```
130
158
 
131
159
  4. Применяем стили к компоненту. Важно учитывать, если в названии класса указывается сначала название компонента, это означает что он ссылается на стили,
132
- которые определены внутри директории этого компонента
160
+ которые определены внутри директории этого компонента `src/components/Component/css`
133
161
 
134
- ```js
135
- `border-width_${borderWidthClass}
162
+ ```jsx
163
+ 'textarea__input'
136
164
  ```
137
165
 
138
- если в названии класса нет название комопнента, это означает что ссылаемся на глобальный класс, который определен `src/styles`
139
-
140
- ```js
166
+ Если в названии класса нет название компонента, это означает что ссылаемся на глобальный класс, который определен `src/styles`
167
+ ```jsx
141
168
  `fill_${fillClass}`
142
169
  ```
143
170
 
144
- ``jsx
171
+ ```jsx
145
172
  <textarea
146
- id={id}
147
173
  className={clsx(
148
174
  'textarea__input',
149
- (textSizeClass || textColorClass || textWeightClass) && 'text',
150
- caretClass && `caret-color_${caretClass}`,
151
175
  fillClass && `fill_${fillClass}`,
152
- borderColorClass && `border-color_${borderColorClass}`,
153
- borderWidthClass && `border-width_${borderWidthClass}`,
154
- borderHoverClass && `border-color_hover_${borderHoverClass}`,
155
- placeholderTextColorClass && `placeholder-text-color_${placeholderTextColorClass}`,
156
- textSizeClass && `text_size_${textSizeClass}`,
157
- textColorClass && `text-color_${textColorClass}`,
158
- textWeightClass && `text-weight_${textWeightClass}`,
159
- widthClass && `width_${widthClass}`,
176
+ sizeClass && `size_${sizeClass}`,
160
177
  )}
161
178
  />
162
179
  ```
163
- к примеру `fill`, будет отображаться в браузере как `fill_`
164
180
 
165
- Возьмем к примеру fillClass
181
+ К примеру fill, будет отображаться в браузере как `fill_error-tertiary`.
166
182
 
167
- Возьмем appearance из приведенного ранее примера
168
- ```js
169
- {
170
- fill: 'errorTertiary',
171
- borderColor: 'errorBorderQuaternary',
172
- borderHover: 'errorBorderQuaternary',
173
- textColor: 'surfaceTextPrimary',
174
- iconBeforeFill: 'errorItemQuaternary',
175
- iconClearFill: 'errorItemPrimary',
176
- placeholderTextColor: 'surfaceTextQuaternary',
177
- size: "m",
178
- textSize: "m"
179
- }
180
- ```
181
-
182
- и возьмем из него свойство `fill_error-tertiary`
183
-
184
- 5. Cоздаются классы, которые соответствуют структуре определенной в css-файлах, например глобальный класс `fill`
185
-
186
- ```css
187
- .fill {
188
- &_none {
189
- background-color: transparent;
190
- }
191
- @each $type in accent, primary, secondary, tertiary, quaternary, surface,
192
- error, success, warning, info, danger, gradient, disabled, hover, inverse {
193
- @each $color in primary, secondary, tertiary, quaternary, accent, disabled,
194
- hover, inverse {
195
- &_$(type) {
196
- &-item {
197
- &-$(color) {
198
- background: var(--color-$(type)-item-$(color));
199
- }
200
- }
201
- &-$(color) {
202
- background: var(--color-$(type)-$(color));
203
- }
204
- }
205
- }
206
- }
207
- }
208
- ```
209
183
 
210
- 6. Чтобы применить стили в зависимости от viewPort, для этого нужно указать в appearance
184
+ 6. Чтобы применить стили в зависимости от `viewPort`, для этого нужно указать в `appearance` суффикс `Mobile` или `Desktop` или `Tablet`
211
185
 
212
186
  ```js
213
187
  {
@@ -215,16 +189,16 @@ const componentConfig: ComponentConfig = {
215
189
  textSizeMobile: 'm',
216
190
  }
217
191
  ```
218
- или напрямую при использовании компонента
192
+
193
+ Или напрямую при использовании компонента
219
194
 
220
195
  ```js
221
196
  <Component sizeMobile="m"/>
222
197
  ```
223
198
 
224
- всего доступны 3 типа размеров
225
-
226
- 1. Mobile
227
- 2. Tablet
228
- 3. Desktop
199
+ Всего доступны 3 типа размеров
200
+ 1. Mobile (от `240px` до `768px`)
201
+ 2. Tablet (от `768px` до `960px`)
202
+ 3. Desktop (от `960px` до `1920px`)
229
203
 
230
- подробнее об этом можно узнать в `UIContext.tsx`.
204
+ Подробнее об этом можно узнать в `src/context/UIContext.tsx`, ознакомиться с размерами для (`Mobile`, `Tablet`, `Desktop`) можно в `src/hooks/useMediaQueries/mediaQueries.json`
@@ -23,20 +23,45 @@ import { Meta } from '@storybook/blocks'
23
23
  <td>userDevice</td>
24
24
  <td>UserDeviceState</td>
25
25
  <td>`{}`</td>
26
- <td>Булевые флаги устройства пользователя</td>
26
+ <td>`Boolean` флаги устройства пользователя</td>
27
27
  </tr>
28
28
  </tbody>
29
29
  </table>
30
30
 
31
31
  ### Возвращает объект
32
32
 
33
- `deviceTypes` - который является объектом в котором находятся все флаги
33
+ `deviceTypes` - который является объектом в котором находятся все `boolean` флаги
34
34
 
35
- - `isMobile` —
36
- - `isMobileHuge` —
37
- - `isTablet` —
38
- - `isDesktop` —
39
- - `isDesktopMega —`
35
+ <table>
36
+ <thead>
37
+ <tr>
38
+ <th>Флаг</th>
39
+ <th>Диапазон(px)</th>
40
+ </tr>
41
+ </thead>
42
+ <tbody>
43
+ <tr>
44
+ <td>`isMobile`</td>
45
+ <td>`≥ 240px и ≤ 768px`</td>
46
+ </tr>
47
+ <tr>
48
+ <td>`isMobileHuge`</td>
49
+ <td>`≥ 640px и ≤ 768px`</td>
50
+ </tr>
51
+ <tr>
52
+ <td>`isTablet`</td>
53
+ <td>`≥ 768px и ≤ 960px`</td>
54
+ </tr>
55
+ <tr>
56
+ <td>`isDesktop`</td>
57
+ <td>`≥ 960px и ≤ 1920px`</td>
58
+ </tr>
59
+ <tr>
60
+ <td>`isDesktopMega`</td>
61
+ <td>`≥ 2560px`</td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
40
65
 
41
66
  ### Использование
42
67
 
@@ -4,15 +4,63 @@ import { Meta } from '@storybook/blocks'
4
4
 
5
5
  # `useStyles`
6
6
 
7
- Хук конвертирует `props` компонента в `inline` стили.
7
+ Хук конвертирует props компонента в inline стили.
8
8
 
9
9
  Важно учитывать приоритет при котором будут применяться стили:
10
10
 
11
- 1. Сначала используется значение из props, соответствующее текущему устройству (Mobile например)
11
+ 1. Сначала используется значение из props, соответствующее текущему устройству
12
+ - Передали
13
+
14
+ ```jsx
15
+ <Component textAlignMobile="center" />
16
+ ```
17
+
18
+ - Получили
19
+ ```jsx
20
+ <Component style={{ textAlign: 'center' }} />
21
+ ```
22
+
12
23
  2. Если такого нет — используется значение из props без учёта устройства
24
+ - Передали
25
+
26
+ ```jsx
27
+ <Component textAlign="right" />
28
+ ```
29
+
30
+ - Получили
31
+
32
+ ```jsx
33
+ <Component style={{ textAlign: 'right' }} />
34
+ ```
35
+
13
36
  3. Если и его нет — берётся значение из appearance-конфига для текущего устройства
37
+
38
+ - Передали
39
+
40
+ ```js
41
+ {
42
+ textAlignMobile: 'left'
43
+ }
44
+ ```
45
+
46
+ - Получили
47
+
48
+ ```jsx
49
+ <Component style={{ textAlign: 'left' }} />
50
+ ```
51
+
14
52
  4. И в последнюю очередь — значение из appearance-конфига без учёта устройства
15
53
 
54
+ - Передали
55
+ ```jsx
56
+ textAlign: 'justify'
57
+ ```
58
+
59
+ - Получили
60
+ ```jsx
61
+ <Component style={{ textAlign: 'justify' }} />
62
+ ```
63
+
16
64
  ## API
17
65
 
18
66
  ### Параметры
@@ -0,0 +1,3 @@
1
+ import { AvatarStackProps } from './AvatarStack.interface';
2
+ declare function AvatarStack(props: AvatarStackProps): any;
3
+ export { AvatarStack };
@@ -0,0 +1,9 @@
1
+ import { SizePXProps, TextSizeProps } from '@itcase/ui/types';
2
+ interface AvatarStackProps {
3
+ avatarSize: SizePXProps;
4
+ showCountUsers?: number;
5
+ textSize?: TextSizeProps;
6
+ userFirstName?: string;
7
+ userLastName?: string;
8
+ }
9
+ export type { AvatarStackProps };
@@ -0,0 +1,2 @@
1
+ import { AvatarStack } from './AvatarStack';
2
+ export { AvatarStack };
@@ -7,5 +7,13 @@ declare const buttonAppearanceDanger: {
7
7
  loaderFill: string;
8
8
  loaderItemFill: string;
9
9
  };
10
+ dangerPrimary: {
11
+ fill: string;
12
+ fillHover: string;
13
+ labelTextColor: string;
14
+ labelTextColorHover: string;
15
+ loaderFill: string;
16
+ loaderItemFill: string;
17
+ };
10
18
  };
11
19
  export { buttonAppearanceDanger };
@@ -0,0 +1,5 @@
1
+ export declare const cookiesWarningAppearance: {
2
+ dev: {
3
+ fill: string;
4
+ };
5
+ };
@@ -1,2 +1,3 @@
1
1
  import { CookiesWarning } from './CookiesWarning';
2
- export { CookiesWarning };
2
+ import { cookiesWarningAppearance } from './CookiesWarning.appearance';
3
+ export { CookiesWarning, cookiesWarningAppearance };
@@ -0,0 +1,25 @@
1
+ declare const drawerAppearanceSurface: {
2
+ surfacePrimary: {
3
+ fill: string;
4
+ fillHover: string;
5
+ labelTextColor: string;
6
+ };
7
+ surfaceQuaternary: {
8
+ fill: string;
9
+ fillHover: string;
10
+ labelTextColor: string;
11
+ };
12
+ surfaceSecondary: {
13
+ fill: string;
14
+ fillHover: string;
15
+ labelTextColor: string;
16
+ loaderFill: string;
17
+ loaderItemFill: string;
18
+ };
19
+ surfaceTertiary: {
20
+ fill: string;
21
+ fillHover: string;
22
+ labelTextColor: string;
23
+ };
24
+ };
25
+ export { drawerAppearanceSurface };
@@ -1,8 +1,4 @@
1
1
  declare const dropdownAppearanceAccent: {
2
- accent: {
3
- fill: string;
4
- fillHover: string;
5
- };
6
2
  accentPrimary: {
7
3
  fill: string;
8
4
  fillHover: string;
@@ -14,8 +10,6 @@ declare const dropdownAppearanceAccent: {
14
10
  labelTextColor: string;
15
11
  labelTextColorHover: string;
16
12
  borderColor: string;
17
- loaderFill: string;
18
- loaderItemFill: string;
19
13
  };
20
14
  };
21
15
  export { dropdownAppearanceAccent };
@@ -3,6 +3,11 @@ declare const dropdownAppearanceSurface: {
3
3
  fill: string;
4
4
  fillHover: string;
5
5
  labelTextColor: string;
6
+ labelTextColorActive: string;
7
+ labelTextColorActiveHover: string;
8
+ labelTextColorHover: string;
9
+ iconAfterFillIcon: string;
10
+ iconBeforeFillIcon: string;
6
11
  };
7
12
  surfaceQuaternary: {
8
13
  fill: string;
@@ -1,3 +1,2 @@
1
- import { InputAppearance, InputState } from './InputPassword.interface';
2
- export declare const InputPasswordAppearance: InputAppearance;
3
- export declare const InputPasswordState: InputState;
1
+ import { InputPasswordAppearanceType } from './InputPassword.interface';
2
+ export declare const inputPasswordAppearance: InputPasswordAppearanceType;
@@ -1,4 +1,4 @@
1
- import { AppearanceKeysDefault, BorderColorProps, BorderWidthProps, FillProps, IconSizeProps, ItemColorProps, ShapeProps, SizeProps, StateKeysDefault, TextColorProps, TextSizeProps, TextWeightProps, WidthProps } from '@itcase/types';
1
+ import { AppearanceKeysDefault, BorderColorProps, BorderWidthProps, FillProps, IconSizeProps, ItemColorProps, ShapeProps, SizeProps, TextColorProps, TextSizeProps, TextWeightProps, WidthProps } from '@itcase/types';
2
2
  import { StyleAttributes } from 'src/hooks/useStyles/styleAttributes.interface';
3
3
  export interface InputThemeColor {
4
4
  [key: number | string | symbol]: any;
@@ -15,19 +15,13 @@ export interface InputThemeColor {
15
15
  width?: WidthProps;
16
16
  }
17
17
  type AppearanceKeys = AppearanceKeysDefault & {};
18
- type stateKeysType = StateKeysDefault & {};
19
- export type InputState = {
20
- [key in stateKeysType]?: InputThemeColor;
21
- };
22
- export type InputAppearance = {
18
+ export type InputPasswordAppearanceType = {
23
19
  [key in AppearanceKeys]?: InputThemeColor;
24
20
  };
25
21
  export interface InputPasswordConfig {
26
22
  [key: number | string | symbol]: any;
27
- appearance: InputAppearance | undefined;
28
- state: InputState | undefined;
29
- setAppearance: (newComponent: InputAppearance) => void;
30
- setState: (newComponent: InputState) => void;
23
+ appearance: InputPasswordAppearanceType | undefined;
24
+ setAppearance: (newComponent: InputPasswordAppearanceType) => void;
31
25
  }
32
26
  export interface InputPasswordProps extends InputThemeColor, StyleAttributes {
33
27
  id?: number | string;
@@ -44,7 +38,6 @@ export interface InputPasswordProps extends InputThemeColor, StyleAttributes {
44
38
  imageRevealableHide?: string;
45
39
  imageRevealableShow?: string;
46
40
  placeholder?: string;
47
- state?: stateKeysType;
48
41
  value?: string;
49
42
  isRevealable?: boolean;
50
43
  onBlur?: () => void;
@@ -0,0 +1,20 @@
1
+ declare const inputPasswordAppearanceAccent: {
2
+ accent: {
3
+ fill: string;
4
+ fillHover: string;
5
+ };
6
+ accentPrimary: {
7
+ fill: string;
8
+ fillHover: string;
9
+ borderColor: string;
10
+ };
11
+ accentSecondary: {
12
+ fill: string;
13
+ fillHover: string;
14
+ labelTextColor: string;
15
+ labelTextColorHover: string;
16
+ borderColor: string;
17
+ loaderItemFill: string;
18
+ };
19
+ };
20
+ export { inputPasswordAppearanceAccent };
@@ -0,0 +1,7 @@
1
+ declare const inputPasswordAppearanceDanger: {
2
+ danger: {
3
+ fill: string;
4
+ fillHover: string;
5
+ };
6
+ };
7
+ export { inputPasswordAppearanceDanger };
@@ -0,0 +1,20 @@
1
+ declare const inputPasswordAppearanceDisabled: {
2
+ disabledPrimary: {
3
+ fill: string;
4
+ borderColor: string;
5
+ borderHover: string;
6
+ textColor: string;
7
+ iconBeforeFill: string;
8
+ iconClearFill: string;
9
+ placeholderTextColor: string;
10
+ };
11
+ disabledSecondary: {
12
+ fill: string;
13
+ borderColor: string;
14
+ borderHover: string;
15
+ iconBeforeFill: string;
16
+ iconClearFill: string;
17
+ placeholderTextColor: string;
18
+ };
19
+ };
20
+ export { inputPasswordAppearanceDisabled };
@@ -0,0 +1,11 @@
1
+ declare const inputPasswordAppearanceError: {
2
+ error: {
3
+ fill: string;
4
+ fillHover: string;
5
+ labelTextColor: string;
6
+ labelTextColorHover: string;
7
+ loaderFill: string;
8
+ loaderItemFill: string;
9
+ };
10
+ };
11
+ export { inputPasswordAppearanceError };
@@ -0,0 +1,21 @@
1
+ declare const inputPasswordAppearanceInfo: {
2
+ info: {
3
+ fill: string;
4
+ fillHover: string;
5
+ labelTextColor: string;
6
+ labelTextColorHover: string;
7
+ borderColor: string;
8
+ loaderFill: string;
9
+ loaderItemFill: string;
10
+ };
11
+ infoSecondary: {
12
+ fill: string;
13
+ fillHover: string;
14
+ labelTextColor: string;
15
+ labelTextColorHover: string;
16
+ borderColor: string;
17
+ loaderFill: string;
18
+ loaderItemFill: string;
19
+ };
20
+ };
21
+ export { inputPasswordAppearanceInfo };
@@ -0,0 +1,8 @@
1
+ declare const inputPasswordAppearancePrimary: {
2
+ primary: {
3
+ fill: string;
4
+ fillHover: string;
5
+ labelTextColor: string;
6
+ };
7
+ };
8
+ export { inputPasswordAppearancePrimary };
@@ -0,0 +1,20 @@
1
+ declare const inputPasswordAppearanceRequire: {
2
+ requirePrimary: {
3
+ fill: string;
4
+ borderColor: string;
5
+ borderHover: string;
6
+ textColor: string;
7
+ iconBeforeFill: string;
8
+ iconClearFill: string;
9
+ placeholderTextColor: string;
10
+ };
11
+ requireSecondary: {
12
+ fill: string;
13
+ borderColor: string;
14
+ borderHover: string;
15
+ iconBeforeFill: string;
16
+ iconClearFill: string;
17
+ placeholderTextColor: string;
18
+ };
19
+ };
20
+ export { inputPasswordAppearanceRequire };
@@ -0,0 +1,8 @@
1
+ declare const inputPasswordAppearanceSecondary: {
2
+ secondary: {
3
+ fill: string;
4
+ fillHover: string;
5
+ labelTextColor: string;
6
+ };
7
+ };
8
+ export { inputPasswordAppearanceSecondary };