@moysklad/uikit 30.4.0 → 31.20.0

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 (356) hide show
  1. package/README.md +9 -4
  2. package/dist/colorVariables.css +23 -1
  3. package/dist/components/AutoComplete/AutoComplete.js +2 -2
  4. package/dist/components/BentoBlock/BentoBlock.d.ts +15 -0
  5. package/dist/components/BentoBlock/BentoBlock.js +20 -0
  6. package/dist/components/BentoBlock/BentoBlock.module.js +9 -0
  7. package/dist/components/BentoBlock/BentoBlock_module.css +50 -0
  8. package/dist/components/BentoBlock/consts.d.ts +14 -0
  9. package/dist/components/BentoBlock/consts.js +15 -0
  10. package/dist/components/Button/Button.d.ts +5 -2
  11. package/dist/components/Button/Button.js +28 -19
  12. package/dist/components/Button/Button_module.css +16 -14
  13. package/dist/components/Checkbox/Checkbox.js +1 -1
  14. package/dist/components/DateRange/ArrowButton/ArrowButton.module.js +6 -0
  15. package/dist/components/DateRange/ArrowButton/ArrowButton_module.css +26 -0
  16. package/dist/components/DateRange/ArrowButton/index.d.ts +8 -0
  17. package/dist/components/DateRange/ArrowButton/index.js +23 -0
  18. package/dist/components/DateRange/Calendar/index.d.ts +12 -0
  19. package/dist/components/DateRange/Calendar/index.js +22 -0
  20. package/dist/components/DateRange/DateRange.d.ts +6 -0
  21. package/dist/components/DateRange/DateRange.js +51 -0
  22. package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.d.ts +44 -0
  23. package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.js +128 -0
  24. package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.module.js +19 -0
  25. package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger_module.css +170 -0
  26. package/dist/components/DateRange/DateRangeDefaultTrigger.module.js +12 -0
  27. package/dist/components/DateRange/DateRangeDefaultTrigger_module.css +43 -0
  28. package/dist/components/DateRange/DateRangeInput/DateRangeInput.d.ts +4 -0
  29. package/dist/components/DateRange/DateRangeInput/DateRangeInput.js +69 -0
  30. package/dist/components/DateRange/Day/Day.module.js +16 -0
  31. package/dist/components/DateRange/Day/Day_module.css +80 -0
  32. package/dist/components/DateRange/Day/index.d.ts +12 -0
  33. package/dist/components/DateRange/Day/index.js +39 -0
  34. package/dist/components/DateRange/DropdownContent/DropdownContent.module.js +10 -0
  35. package/dist/components/DateRange/DropdownContent/DropdownContent_module.css +34 -0
  36. package/dist/components/DateRange/DropdownContent/index.d.ts +24 -0
  37. package/dist/components/DateRange/DropdownContent/index.js +132 -0
  38. package/dist/components/DateRange/InputContent/InputContent.module.js +9 -0
  39. package/dist/components/DateRange/InputContent/InputContent_module.css +31 -0
  40. package/dist/components/DateRange/InputContent/index.d.ts +12 -0
  41. package/dist/components/DateRange/InputContent/index.js +59 -0
  42. package/dist/components/DateRange/Month/Month.module.js +7 -0
  43. package/dist/components/DateRange/Month/Month_module.css +17 -0
  44. package/dist/components/DateRange/Month/index.d.ts +15 -0
  45. package/dist/components/DateRange/Month/index.js +158 -0
  46. package/dist/components/DateRange/Month/utils.d.ts +2 -0
  47. package/dist/components/DateRange/Month/utils.js +8 -0
  48. package/dist/components/DateRange/MonthHeader/MonthHeader.module.js +5 -0
  49. package/dist/components/DateRange/MonthHeader/MonthHeader_module.css +10 -0
  50. package/dist/components/DateRange/MonthHeader/index.d.ts +5 -0
  51. package/dist/components/DateRange/MonthHeader/index.js +26 -0
  52. package/dist/components/DateRange/MonthList/MonthList.module.js +7 -0
  53. package/dist/components/DateRange/MonthList/MonthList_module.css +25 -0
  54. package/dist/components/DateRange/MonthList/index.d.ts +11 -0
  55. package/dist/components/DateRange/MonthList/index.js +91 -0
  56. package/dist/components/DateRange/PeriodVariantList/PeriodVariantList.module.js +9 -0
  57. package/dist/components/DateRange/PeriodVariantList/PeriodVariantList_module.css +18 -0
  58. package/dist/components/DateRange/PeriodVariantList/index.d.ts +18 -0
  59. package/dist/components/DateRange/PeriodVariantList/index.js +83 -0
  60. package/dist/components/DateRange/SideMenu/SideMenu.module.js +6 -0
  61. package/dist/components/DateRange/SideMenu/SideMenu_module.css +18 -0
  62. package/dist/components/DateRange/SideMenu/index.d.ts +13 -0
  63. package/dist/components/DateRange/SideMenu/index.js +73 -0
  64. package/dist/components/DateRange/TooltipedText/index.d.ts +8 -0
  65. package/dist/components/DateRange/TooltipedText/index.js +30 -0
  66. package/dist/components/DateRange/Year/Year.module.js +11 -0
  67. package/dist/components/DateRange/Year/Year_module.css +60 -0
  68. package/dist/components/DateRange/Year/index.d.ts +8 -0
  69. package/dist/components/DateRange/Year/index.js +47 -0
  70. package/dist/components/DateRange/YearsList/YearsList.module.js +5 -0
  71. package/dist/components/DateRange/YearsList/YearsList_module.css +15 -0
  72. package/dist/components/DateRange/YearsList/index.d.ts +12 -0
  73. package/dist/components/DateRange/YearsList/index.js +47 -0
  74. package/dist/components/DateRange/consts.d.ts +20 -0
  75. package/dist/components/DateRange/consts.js +81 -0
  76. package/dist/components/DateRange/formatDateRangeValue.d.ts +24 -0
  77. package/dist/components/DateRange/formatDateRangeValue.js +116 -0
  78. package/dist/components/DateRange/hooks/useCalendar.d.ts +13 -0
  79. package/dist/components/DateRange/hooks/useCalendar.js +88 -0
  80. package/dist/components/DateRange/hooks/useDateRange.d.ts +392 -0
  81. package/dist/components/DateRange/hooks/useDateRange.js +36 -0
  82. package/dist/components/DateRange/hooks/useDateRangeDropdown.d.ts +47 -0
  83. package/dist/components/DateRange/hooks/useDateRangeDropdown.js +117 -0
  84. package/dist/components/DateRange/hooks/useDateRangeValue.d.ts +56 -0
  85. package/dist/components/DateRange/hooks/useDateRangeValue.js +173 -0
  86. package/dist/components/DateRange/hooks/useMaskInput.d.ts +18 -0
  87. package/dist/components/DateRange/hooks/useMaskInput.js +169 -0
  88. package/dist/components/DateRange/hooks/useMonthList.d.ts +12 -0
  89. package/dist/components/DateRange/hooks/useMonthList.js +80 -0
  90. package/dist/components/DateRange/hooks/useSideMenu.d.ts +14 -0
  91. package/dist/components/DateRange/hooks/useSideMenu.js +113 -0
  92. package/dist/components/DateRange/index.d.ts +1 -0
  93. package/dist/components/DateRange/index.js +1 -0
  94. package/dist/components/DateRange/locale/en-US.d.ts +2 -0
  95. package/dist/components/DateRange/locale/en-US.js +82 -0
  96. package/dist/components/DateRange/locale/index.d.ts +4 -0
  97. package/dist/components/DateRange/locale/index.js +3 -0
  98. package/dist/components/DateRange/locale/ru-RU.d.ts +2 -0
  99. package/dist/components/DateRange/locale/ru-RU.js +82 -0
  100. package/dist/components/DateRange/locale/types.d.ts +9 -0
  101. package/dist/components/DateRange/locale/types.js +7 -0
  102. package/dist/components/DateRange/locale/useLocale.d.ts +8 -0
  103. package/dist/components/DateRange/locale/useLocale.js +31 -0
  104. package/dist/components/DateRange/props.d.ts +39 -0
  105. package/dist/components/DateRange/props.js +0 -0
  106. package/dist/components/DateRange/types.d.ts +126 -0
  107. package/dist/components/DateRange/types.js +13 -0
  108. package/dist/components/DateRange/utils.d.ts +33 -0
  109. package/dist/components/DateRange/utils.js +105 -0
  110. package/dist/components/Datepicker/Datepicker.d.ts +3 -1
  111. package/dist/components/Datepicker/Datepicker.js +4 -2
  112. package/dist/components/EditableDate/DropdownContent/DropdownContent.d.ts +9 -0
  113. package/dist/components/EditableDate/DropdownContent/DropdownContent.js +36 -0
  114. package/dist/components/EditableDate/EditableDate.d.ts +9 -0
  115. package/dist/components/EditableDate/EditableDate.js +142 -0
  116. package/dist/components/EditableDate/EditableDate.module.js +7 -0
  117. package/dist/components/EditableDate/EditableDate_module.css +32 -0
  118. package/dist/components/EditableTitle/EditableTitle.d.ts +7 -2
  119. package/dist/components/EditableTitle/EditableTitle.js +63 -31
  120. package/dist/components/EditableTitle/EditableTitle.module.js +1 -0
  121. package/dist/components/EditableTitle/EditableTitle_module.css +6 -0
  122. package/dist/components/EmptyState/EmptyState.d.ts +1 -1
  123. package/dist/components/EmptyStateLarge/EmptyStateLarge_module.css +2 -2
  124. package/dist/components/Help/Help_module.css +1 -1
  125. package/dist/components/Informer/Informer.d.ts +37 -0
  126. package/dist/components/Informer/Informer.js +36 -0
  127. package/dist/components/Informer/Informer.module.js +7 -0
  128. package/dist/components/Informer/Informer_module.css +24 -0
  129. package/dist/components/Input/Input.js +10 -5
  130. package/dist/components/Input/components/InfoBlock.d.ts +3 -1
  131. package/dist/components/Input/components/InfoBlock.js +7 -4
  132. package/dist/components/InputUnit/InputUnit.js +4 -4
  133. package/dist/components/LabelValue/LabelValue.d.ts +14 -10
  134. package/dist/components/LabelValue/LabelValue.js +46 -25
  135. package/dist/components/LabelValue/LabelValue.module.js +10 -4
  136. package/dist/components/LabelValue/LabelValue_module.css +53 -19
  137. package/dist/components/LabelValue/ValueBlock/ValueBlock.d.ts +2 -0
  138. package/dist/components/LabelValue/ValueBlock/ValueBlock.js +82 -0
  139. package/dist/components/LabelValue/ValueBlockWrapper.d.ts +5 -0
  140. package/dist/components/LabelValue/ValueBlockWrapper.js +13 -0
  141. package/dist/components/LabelValue/ValueIcon.d.ts +4 -0
  142. package/dist/components/LabelValue/ValueIcon.js +9 -0
  143. package/dist/components/LabelValue/ValueText.d.ts +10 -0
  144. package/dist/components/LabelValue/ValueText.js +24 -0
  145. package/dist/components/LabelValue/ValueTextWithHint.d.ts +12 -0
  146. package/dist/components/LabelValue/ValueTextWithHint.js +29 -0
  147. package/dist/components/LabelValue/hooks/useValueBlock.d.ts +29 -0
  148. package/dist/components/LabelValue/hooks/useValueBlock.js +72 -0
  149. package/dist/components/LabelValue/{ValueBlock/index.d.ts → types.d.ts} +8 -4
  150. package/dist/components/LabelValue/types.js +0 -0
  151. package/dist/components/LabelValueDate/LabelValueDate.js +2 -2
  152. package/dist/components/LabelValueFile/DeleteButton/DeleteButton.d.ts +9 -0
  153. package/dist/components/LabelValueFile/DeleteButton/DeleteButton.js +17 -0
  154. package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.d.ts +7 -0
  155. package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.js +15 -0
  156. package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.module.js +6 -0
  157. package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon_module.css +10 -0
  158. package/dist/components/LabelValueFile/ImagePreview/ImagePreview.d.ts +8 -0
  159. package/dist/components/LabelValueFile/ImagePreview/ImagePreview.js +53 -0
  160. package/dist/components/LabelValueFile/ImagePreview/ImagePreview.module.js +6 -0
  161. package/dist/components/LabelValueFile/ImagePreview/ImagePreview_module.css +13 -0
  162. package/dist/components/LabelValueFile/LabelValueFile.d.ts +7 -0
  163. package/dist/components/LabelValueFile/LabelValueFile.js +42 -0
  164. package/dist/components/LabelValueFile/LabelValueFile.module.js +12 -0
  165. package/dist/components/LabelValueFile/LabelValueFile_module.css +57 -0
  166. package/dist/components/LabelValueFile/ValueBlock/ValueBlock.d.ts +15 -0
  167. package/dist/components/LabelValueFile/ValueBlock/ValueBlock.js +130 -0
  168. package/dist/components/LabelValueFile/ValueBlock/ValueBlock.module.js +7 -0
  169. package/dist/components/LabelValueFile/ValueBlock/ValueBlock_module.css +17 -0
  170. package/dist/components/LabelValueInput/DropdownConnent/DropdownContent.d.ts +2 -0
  171. package/dist/components/LabelValueInput/DropdownConnent/DropdownContent.js +2 -0
  172. package/dist/components/LabelValueLink/LabelValueLink.d.ts +2 -0
  173. package/dist/components/LabelValueLink/LabelValueLink.js +76 -0
  174. package/dist/components/LabelValueLink/LabelValueLink.module.js +6 -0
  175. package/dist/components/LabelValueLink/LabelValueLink_module.css +11 -0
  176. package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.d.ts +2 -0
  177. package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.js +117 -0
  178. package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.module.js +6 -0
  179. package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock_module.css +8 -0
  180. package/dist/components/LabelValueLink/normalizeLinkValue.d.ts +1 -0
  181. package/dist/components/LabelValueLink/normalizeLinkValue.js +10 -0
  182. package/dist/components/LabelValueLink/useLinkDropdownValue.d.ts +15 -0
  183. package/dist/components/LabelValueLink/useLinkDropdownValue.js +26 -0
  184. package/dist/components/LabelValueSelect/Input/index.js +1 -1
  185. package/dist/components/LabelValueSelect/LabelValueSelect.d.ts +4 -2
  186. package/dist/components/Layout/Layout.d.ts +13 -0
  187. package/dist/components/Layout/Layout.js +41 -0
  188. package/dist/components/Layout/Layout.module.js +15 -0
  189. package/dist/components/Layout/Layout_module.css +77 -0
  190. package/dist/components/Link/Link.d.ts +5 -6
  191. package/dist/components/Link/Link.js +35 -9
  192. package/dist/components/Link/Link.module.js +1 -0
  193. package/dist/components/Link/Link_module.css +9 -0
  194. package/dist/components/MentionsTextfield/Mentions/style.css +2 -6
  195. package/dist/components/MentionsTextfield/MentionsTextfield.js +2 -1
  196. package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.d.ts +8 -0
  197. package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.js +13 -0
  198. package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.module.js +5 -0
  199. package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip_module.css +9 -0
  200. package/dist/components/Multiselect/DropdownContent/MultiselectDropdownContent.d.ts +12 -1
  201. package/dist/components/Multiselect/DropdownContent/MultiselectDropdownContent.js +20 -15
  202. package/dist/components/Multiselect/Input/Input.d.ts +6 -2
  203. package/dist/components/Multiselect/Input/Input.js +18 -4
  204. package/dist/components/Multiselect/Multiselect.d.ts +4 -2
  205. package/dist/components/Multiselect/Multiselect.js +14 -2
  206. package/dist/components/Multiselect/ShortDropdownContent/ShortDropdownContent.js +2 -1
  207. package/dist/components/Multiselect/TextField/MultiselectTextField.d.ts +5 -1
  208. package/dist/components/Multiselect/TextField/MultiselectTextField.js +15 -2
  209. package/dist/components/Multiselect/lib/consts.d.ts +1 -1
  210. package/dist/components/Multiselect/lib/consts.js +1 -1
  211. package/dist/components/Multiselect/lib/helpers.d.ts +24 -0
  212. package/dist/components/Multiselect/lib/helpers.js +15 -0
  213. package/dist/components/Multiselect/types.d.ts +2 -0
  214. package/dist/components/Panel/Panel.d.ts +34 -0
  215. package/dist/components/Panel/Panel.js +39 -0
  216. package/dist/components/Panel/Panel.module.js +6 -0
  217. package/dist/components/Panel/Panel_module.css +17 -0
  218. package/dist/components/Radiobutton/Radiobutton.js +1 -1
  219. package/dist/components/Radiobutton/Radiobutton_module.css +5 -0
  220. package/dist/components/SearchInput/SearchInput_module.css +1 -1
  221. package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.d.ts +3 -4
  222. package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.js +19 -24
  223. package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.module.js +1 -2
  224. package/dist/components/Select/ArchivedInputValue/ArchivedInputValue_module.css +5 -12
  225. package/dist/components/Select/Combobox/Combobox.d.ts +3 -1
  226. package/dist/components/Select/Combobox/Combobox.js +19 -8
  227. package/dist/components/Select/Combobox/Combobox.module.js +4 -3
  228. package/dist/components/Select/Combobox/Combobox_module.css +15 -9
  229. package/dist/components/Select/OptionsList/OptionsList.d.ts +3 -1
  230. package/dist/components/Select/OptionsList/OptionsList.js +37 -21
  231. package/dist/components/Select/OptionsList/OptionsList.module.js +2 -0
  232. package/dist/components/Select/OptionsList/OptionsList_module.css +15 -0
  233. package/dist/components/Select/Select.d.ts +2 -3
  234. package/dist/components/Select/Select.js +17 -7
  235. package/dist/components/Select/Select_module.css +5 -0
  236. package/dist/components/Select/ShortVariant/ShortVariant.js +1 -1
  237. package/dist/components/StatusBadge/StatusBadge.d.ts +28 -0
  238. package/dist/components/StatusBadge/StatusBadge.js +167 -0
  239. package/dist/components/StatusBadge/StatusBadge.module.js +37 -0
  240. package/dist/components/StatusBadge/StatusBadge_module.css +149 -0
  241. package/dist/components/StatusBadge/utils/StatusBadgeColor.d.ts +21 -0
  242. package/dist/components/StatusBadge/utils/StatusBadgeColor.js +20 -0
  243. package/dist/components/StatusBadge/utils/getStatusBadgeColor.d.ts +2 -0
  244. package/dist/components/StatusBadge/utils/getStatusBadgeColor.js +8 -0
  245. package/dist/components/Textfield/Textfield.d.ts +7 -2
  246. package/dist/components/Textfield/Textfield.js +2 -1
  247. package/dist/components/Textfield/components/Container/Container.d.ts +2 -0
  248. package/dist/components/Textfield/components/Container/Container.js +17 -6
  249. package/dist/components/Textfield/components/Container/Container.module.js +2 -1
  250. package/dist/components/Textfield/components/Container/Container_module.css +4 -0
  251. package/dist/components/Toggle/Toggle.js +1 -1
  252. package/dist/components/ViewersStack/ViewersStack.js +5 -3
  253. package/dist/components/_shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.d.ts +12 -0
  254. package/dist/components/{LabelValueDate/DropdownContent/index.js → _shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.js} +10 -10
  255. package/dist/components/_shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.module.js +9 -0
  256. package/dist/components/{LabelValueDate/DropdownContent/DropdownContent_module.css → _shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent_module.css} +6 -6
  257. package/dist/components/_shared/FieldLabel/FieldLabel.d.ts +18 -0
  258. package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.js +19 -12
  259. package/dist/components/_shared/FieldLabel/FieldLabel.module.js +11 -0
  260. package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel_module.css +8 -8
  261. package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.d.ts +1 -1
  262. package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.js +2 -2
  263. package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.module.js +1 -1
  264. package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton_module.css +1 -1
  265. package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.d.ts +1 -1
  266. package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.js +1 -1
  267. package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.module.js +3 -3
  268. package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow_module.css +3 -3
  269. package/dist/components/{Info → _shared/Info}/Info.d.ts +3 -1
  270. package/dist/components/{Info → _shared/Info}/Info.js +9 -6
  271. package/dist/components/_shared/Info/Info.module.js +9 -0
  272. package/dist/components/{Info → _shared/Info}/Info_module.css +6 -6
  273. package/dist/components/_shared/Info/types/index.d.ts +6 -0
  274. package/dist/components/_shared/Info/types/index.js +5 -0
  275. package/dist/components/{InputClear → _shared/InputClear}/InputClear.d.ts +1 -1
  276. package/dist/components/{InputClear → _shared/InputClear}/InputClear.js +2 -2
  277. package/dist/components/{InputClear → _shared/InputClear}/InputClear.module.js +3 -3
  278. package/dist/components/{InputClear → _shared/InputClear}/InputClear_module.css +5 -5
  279. package/dist/components/_shared/utils/polymorphicClickableTypes.d.ts +17 -0
  280. package/dist/components/_shared/utils/polymorphicClickableTypes.js +7 -0
  281. package/dist/data-grid/Filters/DateRangeFilter/DropdownContent/index.js +3 -3
  282. package/dist/data-grid/Filters/DateRangeFilter/InputContent/index.js +29 -26
  283. package/dist/data-grid/Filters/DateRangeFilter/PeriodVariantList/index.js +5 -3
  284. package/dist/data-grid/Filters/DateRangeFilter/Year/index.js +3 -3
  285. package/dist/data-grid/Filters/DateRangeFilter/consts.js +6 -6
  286. package/dist/data-grid/Filters/DateRangeFilter/hooks/useMaskInput.js +6 -6
  287. package/dist/data-grid/Filters/DateRangeFilter/hooks/useSideMenu.js +1 -4
  288. package/dist/data-grid/Filters/DateRangeFilter/types.d.ts +68 -56
  289. package/dist/data-grid/Filters/FiltersContainer/FiltersContainer.js +2 -1
  290. package/dist/data-grid/Filters/FiltersContainer/utils/useRenderParams.d.ts +1 -0
  291. package/dist/data-grid/Filters/FiltersContainer/utils/useRenderParams.js +14 -6
  292. package/dist/data-grid/Filters/MultiselectFilter/MultiselectFilter.js +2 -2
  293. package/dist/data-grid/Filters/OutlineInput/OutlineInput.js +2 -2
  294. package/dist/data-grid/Filters/OutlineInput/OutlineInput_module.css +1 -1
  295. package/dist/data-grid/Table/Table_module.css +0 -1
  296. package/dist/data-grid/cells/ImageCell/ImageMiniature/ImageMiniature_module.css +1 -1
  297. package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.d.ts +1 -0
  298. package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.js +17 -5
  299. package/dist/data-grid/cells/components/TableSelect/TableSelect.js +3 -2
  300. package/dist/data-grid/headers/components/Dropdown/Dropdown.d.ts +3 -0
  301. package/dist/data-grid/headers/components/HeaderBuilder/HeaderBuilder.js +1 -0
  302. package/dist/data-grid/index.d.ts +0 -4
  303. package/dist/data-grid/locale/en-US.js +68 -56
  304. package/dist/data-grid/locale/ru-RU.js +68 -56
  305. package/dist/data-grid/locale/useLocale.d.ts +6 -1
  306. package/dist/data-grid/locale/useLocale.js +14 -5
  307. package/dist/hooks/useIsElementOverflowing/index.d.ts +1 -0
  308. package/dist/hooks/useIsElementOverflowing/index.js +8 -2
  309. package/dist/hooks/useOverflowHint/index.d.ts +7 -0
  310. package/dist/hooks/useOverflowHint/index.js +16 -0
  311. package/dist/hooks/useTextField/useTextField.d.ts +1 -1
  312. package/dist/icon/components/MsLogo12Icon.d.ts +8 -0
  313. package/dist/icon/components/MsLogo12Icon.js +28 -0
  314. package/dist/icon/components/MsLogo16Icon.d.ts +8 -0
  315. package/dist/icon/components/MsLogo16Icon.js +26 -0
  316. package/dist/icon/components/MsLogo20Icon.d.ts +8 -0
  317. package/dist/icon/components/MsLogo20Icon.js +28 -0
  318. package/dist/icon/components/Phone12Icon.d.ts +8 -0
  319. package/dist/icon/components/Phone12Icon.js +18 -0
  320. package/dist/icon/components/Phone16Icon.d.ts +8 -0
  321. package/dist/icon/components/Phone16Icon.js +17 -0
  322. package/dist/icon/components/Phone20Icon.d.ts +8 -0
  323. package/dist/icon/components/Phone20Icon.js +18 -0
  324. package/dist/icon/index.d.ts +6 -0
  325. package/dist/icon/index.js +6 -0
  326. package/dist/index.d.ts +9 -1
  327. package/dist/index.js +8 -0
  328. package/dist/utils/checkIsArchivedValue.d.ts +2 -0
  329. package/dist/utils/checkIsArchivedValue.js +5 -0
  330. package/dist/utils/utils.d.ts +1 -0
  331. package/dist/utils/utils.js +1 -0
  332. package/package.json +70 -13
  333. package/dist/components/FieldLabel/FieldLabel.d.ts +0 -17
  334. package/dist/components/FieldLabel/FieldLabel.module.js +0 -11
  335. package/dist/components/Info/Info.module.js +0 -9
  336. package/dist/components/LabelValue/ValueBlock/index.js +0 -138
  337. package/dist/components/LabelValue/hooks/useTooltip.d.ts +0 -8
  338. package/dist/components/LabelValue/hooks/useTooltip.js +0 -16
  339. package/dist/components/LabelValueDate/DropdownContent/DropdownContent.module.js +0 -9
  340. package/dist/components/LabelValueDate/DropdownContent/index.d.ts +0 -12
  341. package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.d.ts +0 -7
  342. package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.js +0 -27
  343. package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.module.js +0 -8
  344. package/dist/components/MentionsTextfield/OptionForStory/OptionForStory_module.css +0 -25
  345. package/dist/components/MentionsTextfield/OptionForStory/index.d.ts +0 -1
  346. package/dist/components/MentionsTextfield/OptionForStory/index.js +0 -1
  347. package/dist/components/Textfield/components/Label/Label.d.ts +0 -11
  348. package/dist/components/Textfield/components/Label/Label.js +0 -38
  349. package/dist/components/Textfield/components/Label/Label.module.js +0 -7
  350. package/dist/components/Textfield/components/Label/Label_module.css +0 -17
  351. package/dist/components/Textfield/components/Label/index.d.ts +0 -1
  352. package/dist/components/Textfield/components/Label/index.js +0 -1
  353. /package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.constants.d.ts +0 -0
  354. /package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.constants.js +0 -0
  355. /package/dist/components/{FieldLabel → _shared/FieldLabel}/components/index.d.ts +0 -0
  356. /package/dist/components/{FieldLabel → _shared/FieldLabel}/components/index.js +0 -0
@@ -1,7 +1,6 @@
1
1
  import "./ArchivedInputValue_module.css";
2
2
  const ArchivedInputValue_module = {
3
- rightIconContainer: "rightIconContainer-gnRvlS",
4
- rightIconText: "rightIconText-fpxSCr",
3
+ textContainer: "textContainer-BEuqYt",
5
4
  rightIcon: "rightIcon-PUbQMv",
6
5
  rightIconDisabled: "rightIconDisabled-chCxrA"
7
6
  };
@@ -1,21 +1,14 @@
1
- .rightIconContainer-gnRvlS {
2
- pointer-events: none;
1
+ .textContainer-BEuqYt {
2
+ align-items: center;
3
+ gap: 8px;
3
4
  width: 100%;
4
- height: 100%;
5
+ min-width: 0;
5
6
  display: flex;
6
- position: absolute;
7
- }
8
-
9
- .rightIconText-fpxSCr {
10
- opacity: 0;
11
- text-overflow: ellipsis;
12
- height: 0;
13
- margin-right: 8px;
14
- overflow: hidden;
15
7
  }
16
8
 
17
9
  .rightIcon-PUbQMv {
18
10
  color: var(--elements-disable, #d1d6df);
11
+ flex-shrink: 0;
19
12
  align-items: center;
20
13
  display: flex;
21
14
  }
@@ -5,11 +5,13 @@ interface Props extends IBaseSelectProps, HTMLAttributes<HTMLDivElement>, IHasTe
5
5
  id?: HTMLInputElement['id'];
6
6
  searchText?: string;
7
7
  inputProps?: HTMLAttributes<HTMLInputElement>;
8
+ inputHintText?: string;
8
9
  onToggle?: () => void;
9
10
  onSearch: (searchText: string) => void;
10
11
  isDropdownOpen: boolean;
11
12
  actions?: ReactNode;
12
- isArchived?: boolean;
13
+ showArchived?: boolean;
14
+ isFocus?: boolean;
13
15
  triggerAriaProps?: Pick<AriaAttributes, 'aria-controls' | 'aria-expanded' | 'aria-haspopup' | 'aria-activedescendant'>;
14
16
  }
15
17
  export declare const Combobox: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,18 +1,21 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useEffect, useRef, useState } from "react";
3
3
  import { cn } from "../../../common/css/cn.js";
4
+ import { FieldRow } from "../../_shared/FieldRow/FieldRow.js";
5
+ import { Info } from "../../_shared/Info/Info.js";
4
6
  import { Text, TextColor } from "../../Text/Text.js";
5
7
  import { useId } from "../../../hooks/useId/index.js";
6
8
  import { Down12Icon } from "../../../icon/index.js";
7
- import { FieldRow } from "../../FieldRow/FieldRow.js";
8
- import { Info } from "../../Info/Info.js";
9
+ import { checkIsArchivedValue } from "../../../utils/checkIsArchivedValue.js";
9
10
  import { Label } from "../../Label/Label.js";
10
11
  import { ActionButton } from "../ActionButton/ActionButton.js";
12
+ import { ArchivedInputValue } from "../ArchivedInputValue/ArchivedInputValue.js";
11
13
  import Combobox_module from "./Combobox.module.js";
12
- const Combobox = /*#__PURE__*/ forwardRef(({ id, label, required, testId, disabled, placeholder, searchable, error, helperText, info, helpComponent, actions, searchText, fullWidth, inputProps, triggerAriaProps, style, value, onSearch, onToggle, onMouseEnter, onMouseLeave, renderValue, isDropdownOpen, isArchived, ...otherProps }, ref)=>{
14
+ const Combobox = /*#__PURE__*/ forwardRef(({ id, label, required, testId, disabled, placeholder, searchable, error, helperText, info, helpComponent, actions, searchText, fullWidth, inputProps, inputHintText, triggerAriaProps, style, value, onSearch, onToggle, onMouseEnter, onMouseLeave, renderValue, isDropdownOpen, showArchived = false, isFocus = false, ...otherProps }, ref)=>{
13
15
  const [hovered, setHovered] = useState(false);
14
16
  const inputRef = useRef(null);
15
17
  const inputId = useId(id);
18
+ const isArchived = showArchived && checkIsArchivedValue(value);
16
19
  useEffect(()=>{
17
20
  if (inputRef.current && isDropdownOpen) inputRef.current.focus();
18
21
  }, [
@@ -28,7 +31,7 @@ const Combobox = /*#__PURE__*/ forwardRef(({ id, label, required, testId, disabl
28
31
  id: inputId,
29
32
  ref: inputRef,
30
33
  type: "text",
31
- className: cn(Combobox_module.search, isArchived && Combobox_module.archivedTextColor),
34
+ className: cn(Combobox_module.search, isArchived && Combobox_module.archivedTextColor, isArchived && Combobox_module.archivedFitContent),
32
35
  value: searchText,
33
36
  onChange: (e)=>onSearch(e.target.value),
34
37
  disabled: disabled,
@@ -38,19 +41,27 @@ const Combobox = /*#__PURE__*/ forwardRef(({ id, label, required, testId, disabl
38
41
  ...inputProps
39
42
  });
40
43
  const inputComponentNotEdit = /*#__PURE__*/ jsx(Text.Body, {
41
- className: cn(Combobox_module.selectedValue, isArchived && !disabled && Combobox_module.archivedTextColor, isArchived && disabled && Combobox_module.archivedDisabledTextColor),
44
+ className: cn(Combobox_module.selectedValue, isArchived && !disabled && Combobox_module.archivedTextColor, disabled && Combobox_module.disabledTextColor, isArchived && !isFocus && Combobox_module.archivedFitContent),
42
45
  children: searchText
43
46
  });
44
47
  const renderValueComponent = ()=>{
48
+ const input = searchable ? inputComponent : inputComponentNotEdit;
49
+ if (showArchived) return /*#__PURE__*/ jsx(ArchivedInputValue, {
50
+ input: input,
51
+ isShowIcon: isArchived && !isFocus,
52
+ disabled: disabled,
53
+ inputHintText: inputHintText,
54
+ testId: testId
55
+ });
45
56
  if (renderValue) return renderValue({
46
- input: searchable ? inputComponent : inputComponentNotEdit,
57
+ input,
47
58
  placeholder: placeholderComponent,
48
59
  value,
49
60
  searchable,
50
61
  searchText,
51
62
  disabled
52
63
  });
53
- return searchable ? inputComponent : inputComponentNotEdit;
64
+ return input;
54
65
  };
55
66
  return /*#__PURE__*/ jsxs("div", {
56
67
  className: cn(Combobox_module.container, fullWidth && Combobox_module.fullWidth),
@@ -84,7 +95,7 @@ const Combobox = /*#__PURE__*/ forwardRef(({ id, label, required, testId, disabl
84
95
  },
85
96
  style: {
86
97
  ...style,
87
- width: !fullWidth && style?.width
98
+ width: fullWidth ? void 0 : style?.width
88
99
  },
89
100
  "data-searchable": searchable,
90
101
  "data-test-id": testId ? `${testId}-search-container` : '',
@@ -8,9 +8,10 @@ const Combobox_module = {
8
8
  innerCombobox: "innerCombobox-ojzOuH",
9
9
  placeholder: "placeholder-_WVTl5",
10
10
  selectedValue: "selectedValue-oFS_XU",
11
- archivedDisabledTextColor: "archivedDisabledTextColor-qThU95",
12
- arrowAction: "arrowAction-lxn4Ah",
13
11
  search: "search-_t7sYi",
14
- archivedTextColor: "archivedTextColor-TFgYY_"
12
+ archivedFitContent: "archivedFitContent-IhCvaO",
13
+ arrowAction: "arrowAction-lxn4Ah",
14
+ archivedTextColor: "archivedTextColor-TFgYY_",
15
+ disabledTextColor: "disabledTextColor-TmImIF"
15
16
  };
16
17
  export default Combobox_module;
@@ -95,13 +95,18 @@
95
95
  overflow: hidden;
96
96
  }
97
97
 
98
- .container-aL2rxg .combobox-b5S72r .innerCombobox-ojzOuH .archivedDisabledTextColor-qThU95 {
99
- color: var(--text-secondary, #5f6d79);
100
- padding-right: 24px;
98
+ .container-aL2rxg .combobox-b5S72r .innerCombobox-ojzOuH .search-_t7sYi.archivedFitContent-IhCvaO {
99
+ field-sizing: content;
100
+ width: auto;
101
+ min-width: 0;
101
102
  }
102
103
 
103
- .container-aL2rxg .combobox-b5S72r .innerCombobox-ojzOuH .archivedDisabledTextColor-qThU95:hover, .container-aL2rxg .combobox-b5S72r .innerCombobox-ojzOuH .archivedDisabledTextColor-qThU95:focus {
104
- color: var(--text-secondary, #5f6d79);
104
+ .container-aL2rxg .combobox-b5S72r .innerCombobox-ojzOuH .selectedValue-oFS_XU.archivedFitContent-IhCvaO {
105
+ min-width: 0;
106
+ }
107
+
108
+ .container-aL2rxg .combobox-b5S72r:has([data-select-clear-action]):hover .innerCombobox-ojzOuH, .container-aL2rxg .combobox-b5S72r:has([data-select-clear-action]):focus-within .innerCombobox-ojzOuH {
109
+ width: calc(100% - 25px);
105
110
  }
106
111
 
107
112
  .container-aL2rxg .combobox-b5S72r .arrowAction-lxn4Ah {
@@ -112,6 +117,7 @@
112
117
  .container-aL2rxg .combobox-b5S72r .search-_t7sYi {
113
118
  z-index: 1;
114
119
  width: 100%;
120
+ min-width: 0;
115
121
  color: var(--text-primary, #091739);
116
122
  text-overflow: ellipsis;
117
123
  background-color: #0000;
@@ -130,11 +136,11 @@
130
136
  color: var(--text-secondary, #5f6d79);
131
137
  }
132
138
 
133
- .container-aL2rxg .combobox-b5S72r .archivedTextColor-TFgYY_ {
134
- padding-right: 24px;
135
- }
136
-
137
139
  .container-aL2rxg .combobox-b5S72r .archivedTextColor-TFgYY_:not(:disabled, :focus) {
138
140
  color: var(--text-tertiary, #9fa7af);
139
141
  }
140
142
 
143
+ .disabledTextColor-TmImIF, .disabledTextColor-TmImIF:hover, .disabledTextColor-TmImIF:focus {
144
+ color: var(--text-secondary, #5f6d79);
145
+ }
146
+
@@ -19,8 +19,10 @@ interface Props<T> extends IHasTestId {
19
19
  className?: string;
20
20
  scrollable?: boolean;
21
21
  isFocusable?: boolean;
22
+ title?: string;
22
23
  onPressEsc?: () => void;
24
+ onOptionClick?: () => void;
23
25
  skipSelectOnEnterWithoutCursor?: boolean;
24
26
  }
25
- export declare const OptionsList: <T>({ listboxId, items, value, searchText, optionClassName, isOptionEllipsis, testId, cursor, onSetCursor, renderOption, skipSelectOnTab, onSelect, onMouseDown, searchable, hintZIndex, className, scrollable, isFocusable, onPressEsc, skipSelectOnEnterWithoutCursor, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const OptionsList: <T>({ listboxId, items, value, searchText, optionClassName, isOptionEllipsis, testId, cursor, onSetCursor, renderOption, skipSelectOnTab, onSelect, onMouseDown, searchable, hintZIndex, className, scrollable, isFocusable, title, onPressEsc, onOptionClick, skipSelectOnEnterWithoutCursor, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
26
28
  export {};
@@ -1,13 +1,15 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef } from "react";
3
+ import { getOptionalTestId } from "../../../common/index.js";
3
4
  import { cn } from "../../../common/css/index.js";
5
+ import { Text, TextColor } from "../../Text/Text.js";
4
6
  import { useId } from "../../../hooks/useId/index.js";
5
7
  import { genericMemo } from "../../../utils/genericMemo.js";
6
8
  import { Option } from "../Option/Option.js";
7
9
  import { KEYBOARD_KEYS } from "../types.js";
8
10
  import { useArrowDownListener, useArrowUpListener, useKeyPress } from "./hooks.js";
9
11
  import OptionsList_module from "./OptionsList.module.js";
10
- const Options = ({ listboxId, items, value, searchText, optionClassName, isOptionEllipsis, testId, cursor, onSetCursor, renderOption, skipSelectOnTab, onSelect, onMouseDown, searchable, hintZIndex, className, scrollable, isFocusable = true, onPressEsc, skipSelectOnEnterWithoutCursor })=>{
12
+ const Options = ({ listboxId, items, value, searchText, optionClassName, isOptionEllipsis, testId, cursor, onSetCursor, renderOption, skipSelectOnTab, onSelect, onMouseDown, searchable, hintZIndex, className, scrollable, isFocusable = true, title, onPressEsc, onOptionClick, skipSelectOnEnterWithoutCursor })=>{
11
13
  const resolvedListboxId = useId(listboxId);
12
14
  const listRef = useRef(null);
13
15
  useKeyPress(KEYBOARD_KEYS.TAB, ()=>{
@@ -35,31 +37,45 @@ const Options = ({ listboxId, items, value, searchText, optionClassName, isOptio
35
37
  }, [
36
38
  enterPressed
37
39
  ]);
38
- return /*#__PURE__*/ jsx("ul", {
40
+ return /*#__PURE__*/ jsxs("ul", {
39
41
  className: cn(OptionsList_module.optionsList, className, scrollable && OptionsList_module.scrollable),
40
42
  id: resolvedListboxId,
41
43
  role: "listbox",
42
44
  "data-test-id": testId ? `${testId}-options-list` : '',
43
45
  ref: listRef,
44
46
  tabIndex: isFocusable ? 0 : -1,
45
- children: items.map((option, idx)=>{
46
- const isSelected = value ? value.value === option.value : false;
47
- return /*#__PURE__*/ jsx(Option, {
48
- id: `${resolvedListboxId}-option-${idx}`,
49
- isSelected: isSelected,
50
- onClick: onSelect,
51
- onMouseDown: onMouseDown,
52
- searchText: searchText,
53
- isFocused: idx === cursor,
54
- className: optionClassName,
55
- isEllipsis: isOptionEllipsis,
56
- testId: testId ? `${testId}-option-${idx}` : '',
57
- showHighlight: value ? value.label !== searchText : true,
58
- option: option,
59
- renderOption: renderOption,
60
- hintZIndex: hintZIndex
61
- }, option.value);
62
- })
47
+ children: [
48
+ !!title && /*#__PURE__*/ jsx("div", {
49
+ className: OptionsList_module.titleWrapper,
50
+ children: /*#__PURE__*/ jsx(Text.Caption, {
51
+ colorToken: TextColor.secondary,
52
+ className: OptionsList_module.title,
53
+ "data-test-id": getOptionalTestId(testId, 'options-list-title'),
54
+ children: title
55
+ })
56
+ }),
57
+ items.map((option, idx)=>{
58
+ const isSelected = value ? value.value === option.value : false;
59
+ return /*#__PURE__*/ jsx(Option, {
60
+ id: `${resolvedListboxId}-option-${idx}`,
61
+ isSelected: isSelected,
62
+ onClick: (option)=>{
63
+ onSelect(option);
64
+ onOptionClick?.();
65
+ },
66
+ onMouseDown: onMouseDown,
67
+ searchText: searchText,
68
+ isFocused: idx === cursor,
69
+ className: optionClassName,
70
+ isEllipsis: isOptionEllipsis,
71
+ testId: testId ? `${testId}-option-${idx}` : '',
72
+ showHighlight: value ? value.label !== searchText : true,
73
+ option: option,
74
+ renderOption: renderOption,
75
+ hintZIndex: hintZIndex
76
+ }, option.value);
77
+ })
78
+ ]
63
79
  });
64
80
  };
65
81
  const OptionsList = genericMemo(Options);
@@ -1,5 +1,7 @@
1
1
  import "./OptionsList_module.css";
2
2
  const OptionsList_module = {
3
+ titleWrapper: "titleWrapper-kzjp2E",
4
+ title: "title-i2hZyT",
3
5
  optionsList: "optionsList-nnTF3n",
4
6
  scrollable: "scrollable-BpMvGu"
5
7
  };
@@ -1,3 +1,18 @@
1
+ .titleWrapper-kzjp2E {
2
+ width: 100%;
3
+ display: flex;
4
+ }
5
+
6
+ .title-i2hZyT {
7
+ white-space: nowrap;
8
+ text-overflow: ellipsis;
9
+ flex: 1;
10
+ width: 10px;
11
+ padding-top: 4px;
12
+ padding-left: 12px;
13
+ overflow: hidden;
14
+ }
15
+
1
16
  .optionsList-nnTF3n {
2
17
  margin: 0;
3
18
  padding: 4px;
@@ -1,6 +1,5 @@
1
1
  import { type CSSProperties, type FocusEventHandler, type ForwardedRef, type HTMLAttributes, type KeyboardEventHandler, type ReactElement, type ReactNode } from 'react';
2
2
  import { ActionButton } from './ActionButton/ActionButton';
3
- import { ArchivedInputValue } from './ArchivedInputValue/ArchivedInputValue';
4
3
  import { DropDownWithColors } from './DropDownWithColors/DropDownWithColors';
5
4
  import { Option } from './Option/Option';
6
5
  import { OptionsList } from './OptionsList/OptionsList';
@@ -22,6 +21,7 @@ export interface SelectProps<T> extends IBaseSelectProps<T> {
22
21
  dropdownStyle?: CSSProperties;
23
22
  dropdownZIndex?: number;
24
23
  inputProps?: HTMLAttributes<HTMLInputElement>;
24
+ inputHintText?: string;
25
25
  variant?: SelectVariantsEnum;
26
26
  disableShortClear?: boolean;
27
27
  isSearchDebounced?: boolean;
@@ -42,7 +42,7 @@ export interface SelectProps<T> extends IBaseSelectProps<T> {
42
42
  renderInput?: (options: IRenderInputOptions) => ReactNode;
43
43
  isDisableEnterSelect?: boolean;
44
44
  isBlurNecessarily?: boolean;
45
- isArchived?: boolean;
45
+ showArchived?: boolean;
46
46
  onAddButtonClick?: () => void;
47
47
  addButtonText?: string;
48
48
  scrollableOptionsList?: boolean;
@@ -68,7 +68,6 @@ interface ISelectComponent {
68
68
  Option: typeof Option;
69
69
  DropdownActionButton: typeof DropdownActionButton;
70
70
  DropDownWithColors: typeof DropDownWithColors;
71
- ArchivedInputValue: typeof ArchivedInputValue;
72
71
  displayName?: string;
73
72
  }
74
73
  declare const SelectComponent: ISelectComponent;
@@ -6,7 +6,6 @@ import { getListboxTriggerA11y } from "../Dropdown/utils/getListboxTriggerA11y.j
6
6
  import { useDebounceCallback } from "../../hooks/useDebounceCallback/useDebounceCallback.js";
7
7
  import { Add16Icon, RemoveClose12Icon } from "../../icon/index.js";
8
8
  import { ActionButton } from "./ActionButton/ActionButton.js";
9
- import { ArchivedInputValue } from "./ArchivedInputValue/ArchivedInputValue.js";
10
9
  import { Combobox } from "./Combobox/Combobox.js";
11
10
  import { DropdownActionsContainer } from "./DropdownActionsContainer/DropdownActionsContainer.js";
12
11
  import { DropDownWithColors } from "./DropDownWithColors/DropDownWithColors.js";
@@ -21,11 +20,12 @@ import { useDropdownPadding } from "./useDropdownPadding.js";
21
20
  import { SELECT_DROPDOWN_CLOSE_REASON, useSelectDropdown } from "./useSelectDropdown.js";
22
21
  import { getFilteredOptions } from "./utils.js";
23
22
  import Select_module from "./Select.module.js";
24
- function SelectInner({ options, value, label, required, testId, disabled, placeholder, searchable = true, error, helperText = '', info = '', helpComponent, clearable = true, fullWidth, emptyText, className, dropdownClassName, dropdownOffsetX, dropdownOffsetY, isDropdownInnerScroll, optionClassName, isOptionEllipsis = true, style, dropdownStyle, dropdownZIndex, inputProps, variant = 'default', disableShortClear = false, hintZIndex = 100, isSearchDebounced = true, searchDebounceTimeout = 300, isLoading = false, loadingText = 'Загрузка...', skipSelectOnTab = false, shortVariantTextClassName, shortVariantContainerClassName, shortVariantIsVisibleFocusOutline, onSearch, renderActions, renderDropdownContent, renderOption, onChange, onClear, renderValue, onDropdownToggle, renderInput, isDisableEnterSelect = false, isBlurNecessarily = false, isArchived = false, onAddButtonClick, addButtonText = '', scrollableOptionsList, isFocusableOptionsList, closeOnSelect = true, renderDropdownActions, onFocus, onBlur, onKeyDown }, ref) {
23
+ function SelectInner({ options, value, label, required, testId, disabled, placeholder, searchable = true, error, helperText = '', info = '', helpComponent, clearable = true, fullWidth, emptyText, className, dropdownClassName, dropdownOffsetX, dropdownOffsetY, isDropdownInnerScroll, optionClassName, isOptionEllipsis = true, style, dropdownStyle, dropdownZIndex, inputProps, inputHintText, variant = 'default', disableShortClear = false, hintZIndex = 100, isSearchDebounced = true, searchDebounceTimeout = 300, isLoading = false, loadingText = 'Загрузка...', skipSelectOnTab = false, shortVariantTextClassName, shortVariantContainerClassName, shortVariantIsVisibleFocusOutline, onSearch, renderActions, renderDropdownContent, renderOption, onChange, onClear, renderValue, onDropdownToggle, renderInput, isDisableEnterSelect = false, isBlurNecessarily = false, showArchived = false, onAddButtonClick, addButtonText = '', scrollableOptionsList, isFocusableOptionsList, closeOnSelect = true, renderDropdownActions, onFocus, onBlur, onKeyDown }, ref) {
24
+ const [isFocus, setIsFocus] = useState(false);
25
25
  const [cursor, setCursor] = useState(null);
26
26
  const [searchText, setSearchText] = useState(value?.label ?? '');
27
27
  const [newOptions, setNewOptions] = useState([]);
28
- const showClearButton = clearable && (searchText.length > 0 || value);
28
+ const showClearButton = clearable && !disabled && (searchText.length > 0 || value);
29
29
  const valueLabel = value?.label ?? '';
30
30
  const filteredOptions = getFilteredOptions({
31
31
  searchText,
@@ -153,13 +153,20 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
153
153
  if (e.key === KEYBOARD_KEYS.ESCAPE) restoreInputFromValue();
154
154
  inputProps?.onKeyUp?.(e);
155
155
  };
156
+ const handleInputFocus = useCallback((e)=>{
157
+ setIsFocus(true);
158
+ inputProps?.onFocus?.(e);
159
+ }, [
160
+ inputProps
161
+ ]);
156
162
  const handleInputBlur = useCallback((e)=>{
163
+ setIsFocus(false);
157
164
  if (isBlurNecessarily) inputProps?.onBlur?.(e);
158
165
  if (filteredOptions.length && searchText.length) return;
159
166
  if (!isBlurNecessarily) inputProps?.onBlur?.(e);
160
167
  }, [
161
- searchText,
162
- filteredOptions,
168
+ filteredOptions.length,
169
+ searchText.length,
163
170
  inputProps
164
171
  ]);
165
172
  useImperativeHandle(ref, ()=>({
@@ -228,19 +235,23 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
228
235
  onClick: disabled ? void 0 : openDropdown,
229
236
  triggerAriaProps: listboxTriggerAriaProps,
230
237
  onToggle: disabled ? void 0 : toggleDropdown,
231
- isArchived: isArchived,
238
+ showArchived: showArchived,
239
+ isFocus: isFocus,
232
240
  inputProps: {
233
241
  ...listboxTriggerAriaProps,
234
242
  ...inputProps,
235
243
  onKeyUp: handleInputKeyUp,
244
+ onFocus: handleInputFocus,
236
245
  onBlur: handleInputBlur
237
246
  },
247
+ inputHintText: inputHintText,
238
248
  style: style,
239
249
  actions: /*#__PURE__*/ jsxs("div", {
240
250
  className: cn(Select_module.actions, disabled && Select_module.disabled),
241
251
  children: [
242
252
  showClearButton && /*#__PURE__*/ jsx(ActionButton, {
243
253
  "data-test-id": testId ? `${testId}-clear-button` : '',
254
+ "data-select-clear-action": true,
244
255
  onClick: handleClear,
245
256
  className: Select_module.clearAction,
246
257
  disabled: disabled,
@@ -362,6 +373,5 @@ SelectComponent.OptionsList = OptionsList;
362
373
  SelectComponent.Option = Option;
363
374
  SelectComponent.DropdownActionButton = DropdownActionButton;
364
375
  SelectComponent.DropDownWithColors = DropDownWithColors;
365
- SelectComponent.ArchivedInputValue = ArchivedInputValue;
366
376
  SelectComponent.displayName = 'Select';
367
377
  export { SelectComponent as Select };
@@ -6,6 +6,7 @@
6
6
  justify-content: center;
7
7
  align-items: center;
8
8
  display: flex;
9
+ position: relative;
9
10
  }
10
11
 
11
12
  .container-C2p99t .actions-cQr4nG .clearAction-sc7Lsp {
@@ -13,6 +14,10 @@
13
14
  padding-left: 0;
14
15
  padding-right: 12px;
15
16
  display: none;
17
+ position: absolute;
18
+ top: 50%;
19
+ left: 0;
20
+ transform: translate(-100%, -50%);
16
21
  }
17
22
 
18
23
  .dropdown-_J2KVk:focus {
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { cn } from "../../../common/css/cn.js";
4
+ import { Info } from "../../_shared/Info/Info.js";
4
5
  import { Text } from "../../Text/Text.js";
5
6
  import { Down12Icon, RemoveClose12Icon } from "../../../icon/index.js";
6
- import { Info } from "../../Info/Info.js";
7
7
  import { Label } from "../../Label/Label.js";
8
8
  import { OverflowingHint } from "../OverflowingHint/OverflowingHint.js";
9
9
  import ShortVariant_module from "./ShortVariant.module.js";
@@ -0,0 +1,28 @@
1
+ import { type ButtonHTMLAttributes } from 'react';
2
+ import type { ValueOf } from '../../common/types';
3
+ import { type ISelectOption } from '../Select/Select';
4
+ import { StatusColor, type StatusColorType } from './utils/StatusBadgeColor';
5
+ export declare const StatusBadgeSize: {
6
+ readonly Comfortable: "comfortable";
7
+ readonly Compact: "compact";
8
+ };
9
+ export type StatusBadgeSizeType = ValueOf<typeof StatusBadgeSize>;
10
+ export interface StatusBadgeOption<T = unknown> extends Pick<ISelectOption<T>, 'label' | 'value' | 'dto'> {
11
+ color: StatusColorType;
12
+ }
13
+ export interface StatusBadgeProps<T = unknown> extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onSelect' | 'value'> {
14
+ title: string;
15
+ value?: StatusBadgeOption<T>;
16
+ testId?: string;
17
+ /**
18
+ * @default "comfortable"
19
+ */
20
+ size?: StatusBadgeSizeType;
21
+ availableStatuses: StatusBadgeOption<T>[];
22
+ dropdownZIndex?: number;
23
+ dropdownButtonText?: string;
24
+ onSelect?: (option: StatusBadgeOption<T>) => void;
25
+ onDropdownButtonClick?: () => void;
26
+ }
27
+ export declare const StatusBadge: <T>({ title, value, disabled, className, testId, size: sizeProp, availableStatuses, dropdownZIndex, dropdownButtonText, onSelect, onDropdownButtonClick, ...props }: StatusBadgeProps<T>) => import("react/jsx-runtime").JSX.Element;
28
+ export { StatusColor, type StatusColorType };
@@ -0,0 +1,167 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import { cn } from "../../common/css/index.js";
4
+ import { mergeRefs } from "../../common/react/mergeRefs.js";
5
+ import { useOverflowHint } from "../../hooks/useOverflowHint/index.js";
6
+ import { Down12Icon, Settings16Icon } from "../../icon/index.js";
7
+ import { Button } from "../Button/Button.js";
8
+ import { Dropdown, useDropdown } from "../Dropdown/Dropdown.js";
9
+ import { Hint } from "../Hint/Hint.js";
10
+ import { Select } from "../Select/Select.js";
11
+ import { Text, TextVariant } from "../Text/Text.js";
12
+ import { getStatusColor } from "./utils/getStatusBadgeColor.js";
13
+ import { StatusColor } from "./utils/StatusBadgeColor.js";
14
+ import StatusBadge_module from "./StatusBadge.module.js";
15
+ const StatusBadgeSize = {
16
+ Comfortable: 'comfortable',
17
+ Compact: 'compact'
18
+ };
19
+ const StatusBadge = ({ title, value, disabled, className, testId, size: sizeProp, availableStatuses, dropdownZIndex, dropdownButtonText = 'Настроить статусы', onSelect, onDropdownButtonClick, ...props })=>{
20
+ const color = value?.color ?? StatusColor.Empty;
21
+ const size = sizeProp ?? StatusBadgeSize.Comfortable;
22
+ const statusDropdown = useDropdown();
23
+ const titleHint = useOverflowHint({
24
+ targetText: title
25
+ });
26
+ const [cursor, setCursor] = useState(0);
27
+ const [isHintVisible, setIsHintVisible] = useState(false);
28
+ const badgeButtonRef = useRef(null);
29
+ const dropdownButtonRef = useRef(null);
30
+ const handleKeyDown = (event)=>{
31
+ props.onKeyDown?.(event);
32
+ if (statusDropdown.open && [
33
+ 'ArrowUp',
34
+ 'ArrowDown'
35
+ ].includes(event.key)) event.preventDefault();
36
+ if (statusDropdown.open && 'Tab' === event.key && !event.shiftKey) {
37
+ event.preventDefault();
38
+ dropdownButtonRef.current?.focus();
39
+ }
40
+ };
41
+ const handleClick = (event)=>{
42
+ props.onClick?.(event);
43
+ statusDropdown.handleToggle();
44
+ };
45
+ useEffect(()=>{
46
+ if (statusDropdown.open) setIsHintVisible(false);
47
+ }, [
48
+ statusDropdown.open
49
+ ]);
50
+ const handleSelect = (option)=>{
51
+ onSelect?.({
52
+ label: option.label,
53
+ value: option.value,
54
+ color: getStatusColor(option.color),
55
+ dto: option.dto
56
+ });
57
+ };
58
+ const handleDropdownButtonKeyDown = (event)=>{
59
+ if ('Enter' === event.key) event.stopPropagation();
60
+ if ('Tab' === event.key) {
61
+ event.preventDefault();
62
+ statusDropdown.handleClose();
63
+ badgeButtonRef.current?.focus();
64
+ }
65
+ };
66
+ const handleDropdownButtonClick = ()=>{
67
+ statusDropdown.handleClose();
68
+ badgeButtonRef.current?.focus();
69
+ onDropdownButtonClick?.();
70
+ };
71
+ return /*#__PURE__*/ jsxs(Fragment, {
72
+ children: [
73
+ /*#__PURE__*/ jsxs("button", {
74
+ ...props,
75
+ ...statusDropdown.triggerAriaProps,
76
+ ref: mergeRefs([
77
+ badgeButtonRef,
78
+ statusDropdown.triggerRef
79
+ ]),
80
+ className: cn(StatusBadge_module.container, StatusBadge_module[color], className, disabled && StatusBadge_module.disabled),
81
+ tabIndex: disabled ? -1 : 0,
82
+ "data-test-id": testId,
83
+ "data-disabled": disabled,
84
+ onClick: disabled ? void 0 : handleClick,
85
+ onKeyDown: handleKeyDown,
86
+ type: "button",
87
+ children: [
88
+ /*#__PURE__*/ jsx(Hint, {
89
+ visible: isHintVisible,
90
+ onVisibleChange: (visible)=>{
91
+ if (!statusDropdown.open) setIsHintVisible(visible);
92
+ },
93
+ overlay: /*#__PURE__*/ jsx(Text.Body, {
94
+ colorToken: "invert",
95
+ children: title
96
+ }),
97
+ trigger: titleHint.needShowHint ? 'hover' : [],
98
+ testId: testId,
99
+ children: /*#__PURE__*/ jsx(Text, {
100
+ ref: titleHint.targetRef,
101
+ variant: size === StatusBadgeSize.Comfortable ? TextVariant.body : TextVariant.caption,
102
+ colorToken: color === StatusColor.Empty ? 'primary' : 'invert',
103
+ className: StatusBadge_module.title,
104
+ testId: testId ? `${testId}-title` : void 0,
105
+ children: title
106
+ })
107
+ }),
108
+ !disabled && /*#__PURE__*/ jsx(Down12Icon, {
109
+ stroke: "var(--status-icon-color)"
110
+ })
111
+ ]
112
+ }),
113
+ /*#__PURE__*/ jsxs(Dropdown, {
114
+ ...statusDropdown.dropdownAriaProps,
115
+ open: statusDropdown.open,
116
+ ref: statusDropdown.dropdownRef,
117
+ onClose: statusDropdown.handleClose,
118
+ triggerRef: statusDropdown.triggerRef,
119
+ zIndex: dropdownZIndex,
120
+ className: StatusBadge_module.dropdown,
121
+ children: [
122
+ /*#__PURE__*/ jsx(Select.OptionsList, {
123
+ className: StatusBadge_module.optionsList,
124
+ isFocusable: false,
125
+ skipSelectOnTab: true,
126
+ testId: testId,
127
+ cursor: cursor,
128
+ onSetCursor: setCursor,
129
+ items: availableStatuses,
130
+ value: value,
131
+ onSelect: handleSelect,
132
+ onOptionClick: statusDropdown.handleClose,
133
+ renderOption: (option)=>/*#__PURE__*/ jsxs("div", {
134
+ className: StatusBadge_module.statusWithText,
135
+ children: [
136
+ /*#__PURE__*/ jsx("div", {
137
+ className: cn(StatusBadge_module.statusBullet, option.color && StatusBadge_module[option.color])
138
+ }),
139
+ /*#__PURE__*/ jsx(Text.Body, {
140
+ className: StatusBadge_module.optionText,
141
+ children: option.label
142
+ })
143
+ ]
144
+ })
145
+ }),
146
+ !!availableStatuses.length && /*#__PURE__*/ jsx("div", {
147
+ className: StatusBadge_module.delimitter
148
+ }),
149
+ /*#__PURE__*/ jsxs(Button, {
150
+ testId: testId ? `${testId}-settings-button` : void 0,
151
+ ref: dropdownButtonRef,
152
+ variant: "frameless",
153
+ withHorisontalPadding: true,
154
+ type: "button",
155
+ onKeyDown: handleDropdownButtonKeyDown,
156
+ onClick: handleDropdownButtonClick,
157
+ children: [
158
+ /*#__PURE__*/ jsx(Settings16Icon, {}),
159
+ dropdownButtonText
160
+ ]
161
+ })
162
+ ]
163
+ })
164
+ ]
165
+ });
166
+ };
167
+ export { StatusBadge, StatusBadgeSize, StatusColor };