nntc-ui 0.0.76 → 0.0.78

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 (302) hide show
  1. package/.editorconfig +25 -0
  2. package/.gitattributes +64 -0
  3. package/.gitlab-ci.yml +40 -0
  4. package/.helm/Chart.yaml +5 -0
  5. package/.helm/values.yaml +12 -0
  6. package/.prettierignore +12 -0
  7. package/.prettierrc.json +19 -0
  8. package/.storybook/global.d.ts +4 -0
  9. package/.storybook/main.ts +12 -0
  10. package/.storybook/preview.tsx +62 -0
  11. package/.stylelintignore +3 -0
  12. package/.stylelintrc.json +5 -0
  13. package/.vscode/settings.json +10 -0
  14. package/Dockerfile +21 -0
  15. package/babel.config.json +23 -0
  16. package/cssModulesPluginTemplate.js +5 -0
  17. package/eslint.config.mjs +161 -0
  18. package/gl-container-scanning-report.json +1 -0
  19. package/gl-dependency-scanning-report.json +1 -0
  20. package/gl-sbom-report.cdx.json +1 -0
  21. package/nginx.conf +14 -0
  22. package/package.json +2 -2
  23. package/postcss.config.cjs +12 -0
  24. package/src/components/common/Button/Button.stories.tsx +46 -0
  25. package/src/components/common/Button/Button.tsx +47 -0
  26. package/src/components/common/Button/button.module.css +204 -0
  27. package/src/components/common/Button/button.module.css.json +1 -0
  28. package/src/components/common/Button/index.ts +1 -0
  29. package/src/components/common/ButtonsGroup/ButtonsGroup.stories.tsx +52 -0
  30. package/src/components/common/ButtonsGroup/ButtonsGroup.tsx +16 -0
  31. package/src/components/common/ButtonsGroup/buttonsGroup.module.css +25 -0
  32. package/src/components/common/ButtonsGroup/buttonsGroup.module.css.json +1 -0
  33. package/src/components/common/ButtonsGroup/index.ts +1 -0
  34. package/src/components/common/Checkbox/Checkbox.stories.tsx +48 -0
  35. package/src/components/common/Checkbox/Checkbox.tsx +97 -0
  36. package/src/components/common/Checkbox/checkbox.module.css +112 -0
  37. package/src/components/common/Checkbox/checkbox.module.css.json +1 -0
  38. package/src/components/common/Checkbox/index.ts +1 -0
  39. package/src/components/common/Checklist/Checklist.stories.tsx +138 -0
  40. package/src/components/common/Checklist/Checklist.tsx +151 -0
  41. package/src/components/common/Checklist/checklist.module.css +23 -0
  42. package/src/components/common/Checklist/checklist.module.css.json +1 -0
  43. package/src/components/common/Checklist/index.ts +4 -0
  44. package/src/components/common/Checklist/models/Item.ts +4 -0
  45. package/src/components/common/Checklist/models/SelectedItems.ts +3 -0
  46. package/src/components/common/Checklist/utils/filterItems.ts +18 -0
  47. package/src/components/common/ColorPicker/ColorPicker.stories.tsx +110 -0
  48. package/src/components/common/ColorPicker/ColorPicker.tsx +116 -0
  49. package/src/components/common/ColorPicker/colorPicker.module.css +132 -0
  50. package/src/components/common/ColorPicker/colorPicker.module.css.json +1 -0
  51. package/src/components/common/ColorPicker/index.ts +1 -0
  52. package/src/components/common/DateTime/DateTime.stories.tsx +155 -0
  53. package/src/components/common/DateTime/DateTime.tsx +142 -0
  54. package/src/components/common/DateTime/dateTime.module.css +96 -0
  55. package/src/components/common/DateTime/dateTime.module.css.json +1 -0
  56. package/src/components/common/DateTime/index.ts +2 -0
  57. package/src/components/common/DateTime/models/dayjs.ts +18 -0
  58. package/src/components/common/DateTime/ui/CalendarPopover/CalendarPopover.tsx +481 -0
  59. package/src/components/common/DateTime/ui/CalendarPopover/calendarPopover.module.css +131 -0
  60. package/src/components/common/DateTime/ui/CalendarPopover/calendarPopover.module.css.json +1 -0
  61. package/src/components/common/DateTime/ui/CalendarPopover/index.ts +1 -0
  62. package/src/components/common/Input/Input.stories.tsx +100 -0
  63. package/src/components/common/Input/Input.tsx +70 -0
  64. package/src/components/common/Input/index.ts +1 -0
  65. package/src/components/common/Input/input.module.css +72 -0
  66. package/src/components/common/Input/input.module.css.json +1 -0
  67. package/src/components/common/MultiSelect/MultiSelect.stories.tsx +259 -0
  68. package/src/components/common/MultiSelect/MultiSelect.tsx +226 -0
  69. package/src/components/common/MultiSelect/index.ts +4 -0
  70. package/src/components/common/MultiSelect/models/Item.ts +7 -0
  71. package/src/components/common/MultiSelect/models/TitleVariant.ts +1 -0
  72. package/src/components/common/MultiSelect/multiSelect.module.css +260 -0
  73. package/src/components/common/MultiSelect/multiSelect.module.css.json +1 -0
  74. package/src/components/common/MultiSelect/multiSelect.stories.module.css +4 -0
  75. package/src/components/common/MultiSelect/ui/SelectPopover/SelectPopover.tsx +70 -0
  76. package/src/components/common/MultiSelect/ui/SelectPopover/index.ts +1 -0
  77. package/src/components/common/MultiSelect/utils/getTitle.ts +16 -0
  78. package/src/components/common/SearchInput/SearchInput.stories.tsx +87 -0
  79. package/src/components/common/SearchInput/SearchInput.tsx +68 -0
  80. package/src/components/common/SearchInput/index.ts +1 -0
  81. package/src/components/common/SearchInput/searchInput.module.css +90 -0
  82. package/src/components/common/SearchInput/searchInput.module.css.json +1 -0
  83. package/src/components/common/Select/Select.stories.tsx +161 -0
  84. package/src/components/common/Select/Select.tsx +168 -0
  85. package/src/components/common/Select/index.ts +5 -0
  86. package/src/components/common/Select/models/Divider.ts +4 -0
  87. package/src/components/common/Select/models/Item.ts +15 -0
  88. package/src/components/common/Select/select.module.css +187 -0
  89. package/src/components/common/Select/select.module.css.json +1 -0
  90. package/src/components/common/Select/ui/SelectPopover/SelectPopover.tsx +50 -0
  91. package/src/components/common/Select/ui/SelectPopover/index.ts +1 -0
  92. package/src/components/common/WrapForLabel/WrapForLabel.stories.tsx +36 -0
  93. package/src/components/common/WrapForLabel/WrapForLabel.tsx +19 -0
  94. package/src/components/common/WrapForLabel/index.ts +1 -0
  95. package/src/components/common/WrapForLabel/wrapForLabel.module.css +14 -0
  96. package/src/components/common/WrapForLabel/wrapForLabel.module.css.json +1 -0
  97. package/src/components/layout/Layout/Layout.stories.tsx +44 -0
  98. package/src/components/layout/Layout/Layout.tsx +20 -0
  99. package/src/components/layout/Layout/index.ts +1 -0
  100. package/src/components/layout/Layout/layout.module.css +16 -0
  101. package/src/components/layout/Layout/layout.module.css.json +1 -0
  102. package/src/components/layout/Surface/Surface.stories.tsx +42 -0
  103. package/src/components/layout/Surface/Surface.tsx +16 -0
  104. package/src/components/layout/Surface/index.ts +1 -0
  105. package/src/components/layout/Surface/surface.module.css +24 -0
  106. package/src/components/layout/Surface/surface.module.css.json +1 -0
  107. package/src/components/navigation/Menu/Menu.stories.tsx +226 -0
  108. package/src/components/navigation/Menu/Menu.tsx +121 -0
  109. package/src/components/navigation/Menu/index.ts +4 -0
  110. package/src/components/navigation/Menu/menu.module.css +110 -0
  111. package/src/components/navigation/Menu/menu.module.css.json +1 -0
  112. package/src/components/navigation/Menu/models/Divider.ts +4 -0
  113. package/src/components/navigation/Menu/models/Item.ts +20 -0
  114. package/src/components/navigation/Tabs/Tabs.stories.tsx +959 -0
  115. package/src/components/navigation/Tabs/Tabs.tsx +163 -0
  116. package/src/components/navigation/Tabs/index.ts +3 -0
  117. package/src/components/navigation/Tabs/models/Item.ts +9 -0
  118. package/src/components/navigation/Tabs/tabs.module.css +179 -0
  119. package/src/components/navigation/Tabs/tabs.module.css.json +1 -0
  120. package/src/components/navigation/Tabs/tabs.stories.module.css +3 -0
  121. package/src/components/view/Card/Card.stories.tsx +74 -0
  122. package/src/components/view/Card/Card.tsx +29 -0
  123. package/src/components/view/Card/card.module.css +21 -0
  124. package/src/components/view/Card/card.module.css.json +1 -0
  125. package/src/components/view/Card/index.ts +1 -0
  126. package/src/components/view/Chip/Chip.stories.tsx +208 -0
  127. package/src/components/view/Chip/Chip.tsx +69 -0
  128. package/src/components/view/Chip/chip.module.css +152 -0
  129. package/src/components/view/Chip/chip.module.css.json +1 -0
  130. package/src/components/view/Chip/index.ts +2 -0
  131. package/src/components/view/Modal/Modal.stories.tsx +63 -0
  132. package/src/components/view/Modal/Modal.tsx +53 -0
  133. package/src/components/view/Modal/index.ts +1 -0
  134. package/src/components/view/Modal/modal.module.css +18 -0
  135. package/src/components/view/Modal/modal.module.css.json +1 -0
  136. package/src/components/view/Modal/modal.stories.module.css +18 -0
  137. package/src/components/view/Pairs/Pairs.stories.tsx +101 -0
  138. package/src/components/view/Pairs/Pairs.tsx +61 -0
  139. package/src/components/view/Pairs/index.ts +2 -0
  140. package/src/components/view/Pairs/models/Pair.ts +4 -0
  141. package/src/components/view/Pairs/pairs.module.css +35 -0
  142. package/src/components/view/Pairs/pairs.module.css.json +1 -0
  143. package/src/components/view/Pairs/ui/TypographyWithTooltip.tsx +31 -0
  144. package/src/components/view/Popover/Popover.stories.tsx +105 -0
  145. package/src/components/view/Popover/Popover.tsx +72 -0
  146. package/src/components/view/Popover/index.ts +1 -0
  147. package/src/components/view/Popover/popover.module.css +23 -0
  148. package/src/components/view/Popover/popover.module.css.json +1 -0
  149. package/src/components/view/Popover/ui/Arrow/Arrow.tsx +11 -0
  150. package/src/components/view/Popover/ui/Arrow/index.ts +1 -0
  151. package/src/components/view/Popover/ui/PopoverContent/PopoverContent.tsx +48 -0
  152. package/src/components/view/Popover/ui/PopoverContent/index.ts +1 -0
  153. package/src/components/view/Popover/ui/PopoverProvider/PopoverProvider.tsx +13 -0
  154. package/src/components/view/Popover/ui/PopoverProvider/constants/PopoverContext.ts +5 -0
  155. package/src/components/view/Popover/ui/PopoverProvider/hooks/usePopover.ts +71 -0
  156. package/src/components/view/Popover/ui/PopoverProvider/index.ts +1 -0
  157. package/src/components/view/Popover/ui/PopoverProvider/models/PopoverOptions.ts +12 -0
  158. package/src/components/view/Popover/ui/PopoverProvider/models/PopoverState.ts +7 -0
  159. package/src/components/view/Popover/ui/PopoverTrigger/PopoverTrigger.tsx +36 -0
  160. package/src/components/view/Popover/ui/PopoverTrigger/index.ts +1 -0
  161. package/src/components/view/Tooltip/Tooltip.stories.tsx +141 -0
  162. package/src/components/view/Tooltip/Tooltip.tsx +74 -0
  163. package/src/components/view/Tooltip/index.ts +1 -0
  164. package/src/components/view/Tooltip/tooltip.module.css +93 -0
  165. package/src/components/view/Tooltip/tooltip.module.css.json +1 -0
  166. package/src/components/view/Tooltip/ui/TooltipContent/TooltipContent.tsx +88 -0
  167. package/src/components/view/Tooltip/ui/TooltipContent/index.ts +1 -0
  168. package/src/components/view/Tooltip/ui/TooltipProvider/TooltipProvider.tsx +13 -0
  169. package/src/components/view/Tooltip/ui/TooltipProvider/constants/TooltipContext.ts +5 -0
  170. package/src/components/view/Tooltip/ui/TooltipProvider/hooks/useTooltip.ts +76 -0
  171. package/src/components/view/Tooltip/ui/TooltipProvider/index.ts +1 -0
  172. package/src/components/view/Tooltip/ui/TooltipProvider/models/TooltipOptions.ts +12 -0
  173. package/src/components/view/Tooltip/ui/TooltipProvider/models/TooltipState.ts +3 -0
  174. package/src/components/view/Tooltip/ui/TooltipTrigger/TooltipTrigger.tsx +36 -0
  175. package/src/components/view/Tooltip/ui/TooltipTrigger/index.ts +1 -0
  176. package/src/components/view/TreeView/TreeView.stories.tsx +174 -0
  177. package/src/components/view/TreeView/TreeView.tsx +69 -0
  178. package/src/components/view/TreeView/index.ts +2 -0
  179. package/src/components/view/TreeView/models/Item.ts +7 -0
  180. package/src/components/view/TreeView/treeView.module.css +3 -0
  181. package/src/components/view/TreeView/treeView.module.css.json +1 -0
  182. package/src/components/view/TreeView/ui/TreeViewItem/TreeViewItem.tsx +84 -0
  183. package/src/components/view/TreeView/ui/TreeViewItem/index.ts +1 -0
  184. package/src/components/view/TreeView/ui/TreeViewItem/treeViewItem.module.css +30 -0
  185. package/src/components/view/TreeView/ui/TreeViewItem/treeViewItem.module.css.json +1 -0
  186. package/src/components/view/TreeView/utils/getFilteredTree.ts +23 -0
  187. package/src/components/view/Typography/Typography.stories.tsx +115 -0
  188. package/src/components/view/Typography/Typography.tsx +42 -0
  189. package/src/components/view/Typography/index.ts +1 -0
  190. package/src/components/view/Typography/typography.module.css +97 -0
  191. package/src/components/view/Typography/typography.module.css.json +1 -0
  192. package/src/components/view/VirtualTable/VirtualTable.stories.tsx +126 -0
  193. package/src/components/view/VirtualTable/VirtualTable.tsx +684 -0
  194. package/src/components/view/VirtualTable/constants/baseColumns.ts +39 -0
  195. package/src/components/view/VirtualTable/constants/bigBaseColumns.ts +35 -0
  196. package/src/components/view/VirtualTable/constants/bigSampleData.ts +92 -0
  197. package/src/components/view/VirtualTable/constants/defaultRowHeight.ts +1 -0
  198. package/src/components/view/VirtualTable/constants/sampleData.ts +213 -0
  199. package/src/components/view/VirtualTable/index.ts +14 -0
  200. package/src/components/view/VirtualTable/models/AdditionalButton.ts +10 -0
  201. package/src/components/view/VirtualTable/models/ColumnAlign.ts +1 -0
  202. package/src/components/view/VirtualTable/models/FilterBy.ts +5 -0
  203. package/src/components/view/VirtualTable/models/SortBy.ts +7 -0
  204. package/src/components/view/VirtualTable/models/SortType.ts +1 -0
  205. package/src/components/view/VirtualTable/models/TableCell.ts +5 -0
  206. package/src/components/view/VirtualTable/models/TableColumn.ts +26 -0
  207. package/src/components/view/VirtualTable/models/TableRow.ts +5 -0
  208. package/src/components/view/VirtualTable/models/VerticalAlign.ts +1 -0
  209. package/src/components/view/VirtualTable/models/VirtualTableRef.ts +4 -0
  210. package/src/components/view/VirtualTable/ui/DateFiltration/DateFiltration.tsx +37 -0
  211. package/src/components/view/VirtualTable/ui/DateFiltration/dateFiltration.module.css +6 -0
  212. package/src/components/view/VirtualTable/ui/DateFiltration/dateFiltration.module.css.json +1 -0
  213. package/src/components/view/VirtualTable/ui/DateFiltration/index.ts +1 -0
  214. package/src/components/view/VirtualTable/ui/DefaultColumn/DefaultColumn.tsx +130 -0
  215. package/src/components/view/VirtualTable/ui/DefaultColumn/index.ts +1 -0
  216. package/src/components/view/VirtualTable/ui/HeaderDropdown/HeaderDropdown.tsx +297 -0
  217. package/src/components/view/VirtualTable/ui/HeaderDropdown/headerDropdown.module.css +20 -0
  218. package/src/components/view/VirtualTable/ui/HeaderDropdown/headerDropdown.module.css.json +1 -0
  219. package/src/components/view/VirtualTable/ui/HeaderDropdown/index.ts +1 -0
  220. package/src/components/view/VirtualTable/ui/NumberFiltration/NumberFiltration.tsx +150 -0
  221. package/src/components/view/VirtualTable/ui/NumberFiltration/index.ts +1 -0
  222. package/src/components/view/VirtualTable/ui/NumberFiltration/numberFiltration.module.css +23 -0
  223. package/src/components/view/VirtualTable/ui/NumberFiltration/numberFiltration.module.css.json +1 -0
  224. package/src/components/view/VirtualTable/utils/alphanumericCompare.ts +29 -0
  225. package/src/components/view/VirtualTable/utils/getColumns.ts +38 -0
  226. package/src/components/view/VirtualTable/utils/getNextHorizontalHeaders.ts +21 -0
  227. package/src/components/view/VirtualTable/utils/getNextVerticalHeaders.ts +18 -0
  228. package/src/components/view/VirtualTable/utils/getPrevHorizontalHeaders.ts +19 -0
  229. package/src/components/view/VirtualTable/utils/getPrevVerticalHeaders.ts +22 -0
  230. package/src/components/view/VirtualTable/utils/recursiveFilter.ts +33 -0
  231. package/src/components/view/VirtualTable/utils/recursiveSort.ts +24 -0
  232. package/src/components/view/VirtualTable/virtualTable.module.css +263 -0
  233. package/src/components/view/VirtualTable/virtualTable.module.css.json +1 -0
  234. package/src/hooks/useTranslation.ts +15 -0
  235. package/src/hooks/window/hooks/useWindowSize.ts +14 -0
  236. package/src/hooks/window/index.ts +1 -0
  237. package/src/i18n/config.ts +23 -0
  238. package/src/i18n/locales/en.json +23 -0
  239. package/src/i18n/locales/ru.json +23 -0
  240. package/src/icons/AddIcon.tsx +9 -0
  241. package/src/icons/AlertIcon.tsx +13 -0
  242. package/src/icons/ArrowDropDownIcon.tsx +9 -0
  243. package/src/icons/ArrowDropUpIcon.tsx +9 -0
  244. package/src/icons/AttachIcon.tsx +10 -0
  245. package/src/icons/BarChartIcon.tsx +9 -0
  246. package/src/icons/BookmarkAddIcon.tsx +12 -0
  247. package/src/icons/BookmarkIcon.tsx +9 -0
  248. package/src/icons/CheckboxDeselectedIcon.tsx +9 -0
  249. package/src/icons/CheckboxIcon.tsx +10 -0
  250. package/src/icons/CheckboxSeveralIcon.tsx +10 -0
  251. package/src/icons/ChevronLeftIcon.tsx +9 -0
  252. package/src/icons/ChevronRightIcon.tsx +9 -0
  253. package/src/icons/CircleFilledIcon.tsx +9 -0
  254. package/src/icons/CloseIcon.tsx +9 -0
  255. package/src/icons/DateRangeIcon.tsx +10 -0
  256. package/src/icons/DeleteIcon.tsx +9 -0
  257. package/src/icons/DoneIcon.tsx +9 -0
  258. package/src/icons/DownloadIcon.tsx +9 -0
  259. package/src/icons/EditIcon.tsx +10 -0
  260. package/src/icons/ExportTableIcon.tsx +19 -0
  261. package/src/icons/FileUploadIcon.tsx +9 -0
  262. package/src/icons/FilterClearIcon.tsx +24 -0
  263. package/src/icons/FilterIcon.tsx +13 -0
  264. package/src/icons/FullScreenOffIcon.tsx +9 -0
  265. package/src/icons/FullScreenOnIcon.tsx +12 -0
  266. package/src/icons/Icon.tsx +27 -0
  267. package/src/icons/InfoIcon.tsx +12 -0
  268. package/src/icons/KeyboardArrowDownIcon.tsx +9 -0
  269. package/src/icons/ListIcon.tsx +9 -0
  270. package/src/icons/MoreVerticalIcon.tsx +10 -0
  271. package/src/icons/SearchIcon.tsx +10 -0
  272. package/src/icons/SettingsIcon.tsx +10 -0
  273. package/src/icons/SortDownIcon.tsx +9 -0
  274. package/src/icons/SortUpIcon.tsx +9 -0
  275. package/src/icons/TableChartIcon.tsx +9 -0
  276. package/src/icons/UploadIcon.tsx +9 -0
  277. package/src/icons/VisibilityIcon.tsx +18 -0
  278. package/src/icons/WellIcon.tsx +10 -0
  279. package/src/icons/index.ts +38 -0
  280. package/src/index.ts +61 -0
  281. package/src/models/Maybe.ts +1 -0
  282. package/src/models/UiProps.ts +3 -0
  283. package/{icons/index.js → src/stories/icons/Icons.stories.tsx} +40 -12
  284. package/src/types/global.d.ts +3 -0
  285. package/src/types/tanstack.d.ts +36 -0
  286. package/src/utils/index.ts +2 -0
  287. package/src/utils/toFirstLetterLowerCase.ts +3 -0
  288. package/src/utils/toFirstLetterUpperCase.ts +3 -0
  289. package/tsconfig.json +50 -0
  290. package/tsup.config.ts +11 -0
  291. package/vite.config.ts +13 -0
  292. package/werf-giterminism.yaml +19 -0
  293. package/werf.yaml +8 -0
  294. package/chunk-64SOJQ5A.js +0 -292
  295. package/icons/index.d.ts +0 -85
  296. package/index.css +0 -2111
  297. package/index.d.ts +0 -459
  298. package/index.js +0 -4361
  299. /package/{styles → src/styles}/global.css +0 -0
  300. /package/{styles → src/styles}/localGlobal.css +0 -0
  301. /package/{styles → src/styles}/themes/dark.css +0 -0
  302. /package/{styles → src/styles}/themes/light.css +0 -0
package/.editorconfig ADDED
@@ -0,0 +1,25 @@
1
+ # top-most EditorConfig file
2
+ root = true
3
+
4
+ ### defaults
5
+ [*]
6
+ charset = utf-8
7
+
8
+ # Unix-style newlines with
9
+ end_of_line = lf
10
+
11
+ # 2 space indentation
12
+ indent_size = 2
13
+ indent_style = space
14
+ tab_width = 2
15
+
16
+ # remove any whitespace characters preceding newline characters
17
+ trim_trailing_whitespace = true
18
+
19
+ # newline ending every file
20
+ insert_final_newline = true
21
+
22
+ ### custom for markdown
23
+ [*.md]
24
+ # do not remove any whitespace characters preceding newline characters
25
+ trim_trailing_whitespace = false
package/.gitattributes ADDED
@@ -0,0 +1,64 @@
1
+ ###############################################################################
2
+ # Set default behavior to automatically normalize line endings.
3
+ ###############################################################################
4
+ * text=auto
5
+ * eol=lf
6
+
7
+ ###############################################################################
8
+ # Set default behavior for command prompt diff.
9
+ #
10
+ # This is need for earlier builds of msysgit that does not have it on by
11
+ # default for csharp files.
12
+ # Note: This is only used by command line
13
+ ###############################################################################
14
+ #*.cs diff=csharp
15
+
16
+ ###############################################################################
17
+ # Set the merge driver for project and solution files
18
+ #
19
+ # Merging from the command prompt will add diff markers to the files if there
20
+ # are conflicts (Merging from VS is not affected by the settings below, in VS
21
+ # the diff markers are never inserted). Diff markers may cause the following
22
+ # file extensions to fail to load in VS. An alternative would be to treat
23
+ # these files as binary and thus will always conflict and require user
24
+ # intervention with every merge. To do so, just uncomment the entries below
25
+ ###############################################################################
26
+ #*.sln merge=binary
27
+ #*.csproj merge=binary
28
+ #*.vbproj merge=binary
29
+ #*.vcxproj merge=binary
30
+ #*.vcproj merge=binary
31
+ #*.dbproj merge=binary
32
+ #*.fsproj merge=binary
33
+ #*.lsproj merge=binary
34
+ #*.wixproj merge=binary
35
+ #*.modelproj merge=binary
36
+ #*.sqlproj merge=binary
37
+ #*.wwaproj merge=binary
38
+
39
+ ###############################################################################
40
+ # behavior for image files
41
+ #
42
+ # image files are treated as binary by default.
43
+ ###############################################################################
44
+ #*.jpg binary
45
+ #*.png binary
46
+ #*.gif binary
47
+
48
+ ###############################################################################
49
+ # diff behavior for common document formats
50
+ #
51
+ # Convert binary document formats to text before diffing them. This feature
52
+ # is only available from the command line. Turn it on by uncommenting the
53
+ # entries below.
54
+ ###############################################################################
55
+ #*.doc diff=astextplain
56
+ #*.DOC diff=astextplain
57
+ #*.docx diff=astextplain
58
+ #*.DOCX diff=astextplain
59
+ #*.dot diff=astextplain
60
+ #*.DOT diff=astextplain
61
+ #*.pdf diff=astextplain
62
+ #*.PDF diff=astextplain
63
+ #*.rtf diff=astextplain
64
+ #*.RTF diff=astextplain
package/.gitlab-ci.yml ADDED
@@ -0,0 +1,40 @@
1
+ include:
2
+ - project: 'DevOps/templates'
3
+ refs: main
4
+ file:
5
+ - 'workflow/argo.yml'
6
+
7
+ variables:
8
+ # IMAGE_NAME: nntc-ui-kit
9
+ DOCKERFILE_PATH: Dockerfile
10
+
11
+ deploy_test_k8s:
12
+ variables:
13
+ NAMESPACE: iifa-test
14
+
15
+ publish_npm:
16
+ image: node:20
17
+ stage: deploy
18
+ rules:
19
+ - if: '$CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+-stabletest$/'
20
+ before_script:
21
+ - node -v
22
+ - npm -v
23
+ - corepack enable
24
+ - yarn --version
25
+ - yarn install --frozen-lockfile
26
+ script:
27
+ - export VERSION="${CI_COMMIT_TAG%-stabletest}"
28
+ - echo "Publishing version $VERSION"
29
+
30
+ - node -e "const fs=require('fs'); const pkg=JSON.parse(fs.readFileSync('package.json','utf8')); pkg.version=process.env.VERSION; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));"
31
+
32
+ - yarn build
33
+
34
+ - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
35
+
36
+ - npm publish --access public
37
+
38
+ update_readme:
39
+ rules:
40
+ - when: never
@@ -0,0 +1,5 @@
1
+ apiVersion: v2
2
+ dependencies:
3
+ - name: backend
4
+ version: ~3.x.x
5
+ repository: oci://harbor.infra.nntc.pro/charts
@@ -0,0 +1,12 @@
1
+ # имя секрета, с помощью которого будет извлечен образ (лучше оставить текущее значение)
2
+ imagePullSecrets:
3
+ - name: docker
4
+
5
+ # порт для доступа к сервису (лучше оставить текущее значение)
6
+ service:
7
+ type: ClusterIP
8
+ port: 80
9
+
10
+ # порт, на котором приложение принимает входящие подключения (указать нужное значение)
11
+ container:
12
+ port: 80
@@ -0,0 +1,12 @@
1
+ node_modules/**
2
+ .idea/**
3
+ .vscode/**
4
+ build/**
5
+ generated-types.tsx
6
+ dist
7
+ coverage
8
+ .next
9
+ storybook-static
10
+ *.log
11
+ yarn.lock
12
+ package-lock.json
@@ -0,0 +1,19 @@
1
+ {
2
+ "arrowParens": "always",
3
+ "bracketSameLine": false,
4
+ "bracketSpacing": true,
5
+ "embeddedLanguageFormatting": "auto",
6
+ "endOfLine": "lf",
7
+ "htmlWhitespaceSensitivity": "css",
8
+ "insertPragma": false,
9
+ "jsxSingleQuote": false,
10
+ "printWidth": 120,
11
+ "proseWrap": "preserve",
12
+ "quoteProps": "as-needed",
13
+ "requirePragma": false,
14
+ "semi": true,
15
+ "singleQuote": true,
16
+ "tabWidth": 2,
17
+ "trailingComma": "all",
18
+ "useTabs": false
19
+ }
@@ -0,0 +1,4 @@
1
+ declare module '*.css?inline' {
2
+ const content: string;
3
+ export default content;
4
+ }
@@ -0,0 +1,12 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+
3
+ const config: StorybookConfig = {
4
+ stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
5
+ addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
6
+ framework: {
7
+ name: '@storybook/react-vite',
8
+ options: {},
9
+ },
10
+ };
11
+
12
+ export default config;
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import { Preview } from '@storybook/react';
3
+ import { I18nextProvider } from 'react-i18next';
4
+ import light from '../src/styles/themes/light.css?inline';
5
+ import dark from '../src/styles/themes/dark.css?inline';
6
+
7
+ import { i18n } from '../src/i18n/config';
8
+
9
+ import '../src/styles/localGlobal.css';
10
+ import '../src/styles/global.css';
11
+
12
+ const themes = [
13
+ { name: 'light', value: '#f8f8f8', css: light },
14
+ { name: 'dark', value: '#373737', css: dark },
15
+ ];
16
+ const styleTagId = 'theme-style';
17
+
18
+ const preview: Preview = {
19
+ parameters: {
20
+ actions: { argTypesRegex: '^on[A-Z].*' },
21
+ controls: {
22
+ matchers: {
23
+ color: /(background|color)$/i,
24
+ date: /Date$/,
25
+ },
26
+ },
27
+ docs: {
28
+ toc: true,
29
+ },
30
+ backgrounds: {
31
+ values: themes,
32
+ default: 'light',
33
+ },
34
+ options: {
35
+ storySort: {
36
+ order: ['Components', '*'],
37
+ },
38
+ },
39
+ },
40
+ decorators: [
41
+ (Story, context) => {
42
+ const theme = themes?.find((t) => t.value === context?.globals?.backgrounds?.value);
43
+
44
+ let style = document.getElementById(styleTagId) as HTMLStyleElement | null;
45
+
46
+ if (!style) {
47
+ style = document.createElement('style');
48
+ style.id = styleTagId;
49
+ document.head.appendChild(style);
50
+ }
51
+
52
+ style.innerHTML = theme?.css || themes[0].css;
53
+ return (
54
+ <I18nextProvider i18n={i18n}>
55
+ <Story />
56
+ </I18nextProvider>
57
+ );
58
+ },
59
+ ],
60
+ };
61
+
62
+ export default preview;
@@ -0,0 +1,3 @@
1
+ node_modules/
2
+ build/
3
+ public/
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": ["stylelint-config-recess-order", "stylelint-prettier/recommended"],
3
+ "plugins": ["stylelint-order"],
4
+ "rules": {}
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "eslint.validate": [
3
+ "typescript"
4
+ ],
5
+ "editor.codeActionsOnSave": {
6
+ "source.fixAll.eslint": "explicit"
7
+ },
8
+ "typescript.tsdk": "./node_modules/typescript/lib",
9
+ "typescript.enablePromptUseWorkspaceTsdk": true
10
+ }
package/Dockerfile ADDED
@@ -0,0 +1,21 @@
1
+ FROM harbor.infra.nntc.pro/docker-registry/node:22-slim
2
+
3
+ WORKDIR /app
4
+ COPY package.json ./
5
+ COPY yarn.lock ./
6
+
7
+ RUN yarn install --frozen-lockfile
8
+
9
+ COPY . .
10
+
11
+ RUN yarn build-storybook
12
+
13
+ FROM docker.nntc.pro/nginx:alpine
14
+
15
+ COPY --from=0 /app/storybook-static /usr/share/nginx/html
16
+
17
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
18
+
19
+ EXPOSE 80
20
+
21
+ CMD ["nginx", "-g", "daemon off;"]
@@ -0,0 +1,23 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "useBuiltIns": "usage",
7
+ "corejs": 3,
8
+ "targets": {
9
+ "node": "current",
10
+ "browsers": [">0.2%", "not dead", "not op_mini all"]
11
+ }
12
+ }
13
+ ],
14
+ "@babel/preset-typescript",
15
+ [
16
+ "@babel/preset-react",
17
+ {
18
+ "runtime": "automatic"
19
+ }
20
+ ]
21
+ ],
22
+ "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-object-rest-spread"]
23
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = (_dts, { classes }) => {
2
+ return Object.keys(classes)
3
+ .map((key) => `export const ${key.replace(/-+(\w)/g, (_match, firstLetter) => firstLetter.toUpperCase())}: string`)
4
+ .join('\n');
5
+ };
@@ -0,0 +1,161 @@
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+
4
+ import { fixupPluginRules } from '@eslint/compat';
5
+ import { FlatCompat } from '@eslint/eslintrc';
6
+ import js from '@eslint/js';
7
+ import typescriptEslint from '@typescript-eslint/eslint-plugin';
8
+ import tsParser from '@typescript-eslint/parser';
9
+ import _import from 'eslint-plugin-import';
10
+ import jsxA11Y from 'eslint-plugin-jsx-a11y';
11
+ import optimizeRegex from 'eslint-plugin-optimize-regex';
12
+ import react from 'eslint-plugin-react';
13
+ import reactHooks from 'eslint-plugin-react-hooks';
14
+
15
+ const filename = fileURLToPath(import.meta.url);
16
+ const dirname = path.dirname(filename);
17
+ const compat = new FlatCompat({
18
+ baseDirectory: dirname,
19
+ recommendedConfig: js.configs.recommended,
20
+ allConfig: js.configs.all,
21
+ });
22
+
23
+ export default [
24
+ {
25
+ ignores: [
26
+ 'node_modules/**/*',
27
+ '.idea/**/*',
28
+ '.vscode/**/*',
29
+ 'dist/**/*',
30
+ '.storybook/**/*',
31
+ '*.config.mjs',
32
+ '*.config.js',
33
+ '*.config.cjs',
34
+ '*.config.ts',
35
+ ],
36
+ },
37
+ ...compat.extends(
38
+ 'airbnb-typescript',
39
+ 'plugin:@typescript-eslint/recommended',
40
+ 'plugin:prettier/recommended',
41
+ 'plugin:jsx-a11y/recommended',
42
+ 'plugin:optimize-regex/recommended',
43
+ ),
44
+ {
45
+ plugins: {
46
+ '@typescript-eslint': typescriptEslint,
47
+ import: fixupPluginRules(_import),
48
+ 'jsx-a11y': jsxA11Y,
49
+ react: fixupPluginRules(react),
50
+ 'react-hooks': fixupPluginRules(reactHooks),
51
+ 'optimize-regex': optimizeRegex,
52
+ },
53
+
54
+ languageOptions: {
55
+ parser: tsParser,
56
+ ecmaVersion: 2020,
57
+ sourceType: 'module',
58
+
59
+ parserOptions: {
60
+ ecmaFeatures: {
61
+ jsx: true,
62
+ },
63
+
64
+ project: './tsconfig.json',
65
+ tsconfigRootDir: './',
66
+ },
67
+ },
68
+
69
+ settings: {
70
+ react: {
71
+ version: 'detect',
72
+ },
73
+ 'import/resolver': {
74
+ typescript: {
75
+ project: './tsconfig.json',
76
+ },
77
+ },
78
+ },
79
+
80
+ rules: {
81
+ 'linebreak-style': ['error', 'unix'],
82
+
83
+ 'max-len': [
84
+ 'error',
85
+ {
86
+ code: 120,
87
+ ignoreTrailingComments: true,
88
+ ignoreUrls: true,
89
+ },
90
+ ],
91
+
92
+ 'react/jsx-props-no-spreading': [
93
+ 'error',
94
+ {
95
+ html: 'ignore',
96
+ custom: 'ignore',
97
+ exceptions: [''],
98
+ },
99
+ ],
100
+
101
+ 'comma-dangle': [
102
+ 'error',
103
+ {
104
+ arrays: 'always-multiline',
105
+ objects: 'always-multiline',
106
+ imports: 'always-multiline',
107
+ exports: 'always-multiline',
108
+ functions: 'always-multiline',
109
+ },
110
+ ],
111
+
112
+ 'prefer-destructuring': [
113
+ 'error',
114
+ {
115
+ object: true,
116
+ array: false,
117
+ },
118
+ ],
119
+
120
+ 'no-plusplus': [
121
+ 'warn',
122
+ {
123
+ allowForLoopAfterthoughts: true,
124
+ },
125
+ ],
126
+
127
+ '@typescript-eslint/no-unused-vars': 'warn',
128
+ '@typescript-eslint/no-unused-expressions': 'warn',
129
+ 'jsx-a11y/anchor-is-valid': 'warn',
130
+ 'jsx-a11y/no-autofocus': 'off',
131
+ 'jsx-a11y/click-events-have-key-events': 'off',
132
+ 'jsx-a11y/no-noninteractive-element-interactions': 'off',
133
+ 'jsx-a11y/no-static-element-interactions': 'off',
134
+ 'no-unused-vars': 'off',
135
+ 'no-unused-expressions': 'off',
136
+
137
+ 'sort-imports': [
138
+ 'error',
139
+ {
140
+ ignoreCase: false,
141
+ ignoreDeclarationSort: true,
142
+ ignoreMemberSort: false,
143
+ memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
144
+ allowSeparatedGroups: true,
145
+ },
146
+ ],
147
+
148
+ 'import/order': [
149
+ 'error',
150
+ {
151
+ groups: ['builtin', 'external', 'internal', ['sibling', 'parent'], 'index', 'unknown'],
152
+ 'newlines-between': 'always',
153
+ alphabetize: {
154
+ order: 'asc',
155
+ caseInsensitive: true,
156
+ },
157
+ },
158
+ ],
159
+ },
160
+ },
161
+ ];