@cyber-harbour/ui 1.0.74 → 1.0.76

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 (178) hide show
  1. package/README.md +76 -0
  2. package/bin/switch-ui-lib.js +196 -0
  3. package/dist/index.d.mts +1 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +90 -90
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +26 -26
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +12 -2
  10. package/.env.example +0 -0
  11. package/src/Core/Alert/Alert.tsx +0 -87
  12. package/src/Core/Alert/index.ts +0 -1
  13. package/src/Core/Box/Box.tsx +0 -46
  14. package/src/Core/Box/index.ts +0 -1
  15. package/src/Core/Button/Button.tsx +0 -208
  16. package/src/Core/Button/index.ts +0 -1
  17. package/src/Core/Checkbox/Checkbox.tsx +0 -73
  18. package/src/Core/Checkbox/index.ts +0 -1
  19. package/src/Core/ContentLoader/ContentLoader.tsx +0 -13
  20. package/src/Core/ContentLoader/index.ts +0 -1
  21. package/src/Core/ContextMenu/ContextMenu.tsx +0 -153
  22. package/src/Core/ContextMenu/ContextMenuDelimiter.tsx +0 -13
  23. package/src/Core/ContextMenu/index.ts +0 -3
  24. package/src/Core/ContextMenu/useContextMenuControl.ts +0 -21
  25. package/src/Core/Drawer/Drawer.tsx +0 -118
  26. package/src/Core/Drawer/index.ts +0 -1
  27. package/src/Core/EmptyData/EmptyData.tsx +0 -44
  28. package/src/Core/EmptyData/index.ts +0 -1
  29. package/src/Core/Flex/FlexContainer.tsx +0 -94
  30. package/src/Core/Flex/FlexItem.tsx +0 -58
  31. package/src/Core/Flex/index.ts +0 -4
  32. package/src/Core/Header/Header.tsx +0 -37
  33. package/src/Core/Header/HeaderDelimeter.tsx +0 -12
  34. package/src/Core/Header/HeaderSection.tsx +0 -37
  35. package/src/Core/Header/index.ts +0 -3
  36. package/src/Core/IconComponents/AlertIcon.tsx +0 -18
  37. package/src/Core/IconComponents/AndroidIcon.tsx +0 -28
  38. package/src/Core/IconComponents/ApiIcon.tsx +0 -26
  39. package/src/Core/IconComponents/ArrowCircleTopRightIcon.tsx +0 -27
  40. package/src/Core/IconComponents/ArrowRightIcon.tsx +0 -23
  41. package/src/Core/IconComponents/BallsMenu.tsx +0 -15
  42. package/src/Core/IconComponents/BugReportIcon.tsx +0 -16
  43. package/src/Core/IconComponents/BusIcon.tsx +0 -24
  44. package/src/Core/IconComponents/CalendarIcon.tsx +0 -26
  45. package/src/Core/IconComponents/CarIcon.tsx +0 -16
  46. package/src/Core/IconComponents/Check.tsx +0 -16
  47. package/src/Core/IconComponents/ChevronDown.tsx +0 -18
  48. package/src/Core/IconComponents/ChevronLeftIcon.tsx +0 -23
  49. package/src/Core/IconComponents/ChevronRightIcon.tsx +0 -23
  50. package/src/Core/IconComponents/ChevronUp.tsx +0 -18
  51. package/src/Core/IconComponents/CloseCircleIcon.tsx +0 -24
  52. package/src/Core/IconComponents/ClosedLockIcon.tsx +0 -22
  53. package/src/Core/IconComponents/Cross.tsx +0 -16
  54. package/src/Core/IconComponents/DataSetsIcon.tsx +0 -26
  55. package/src/Core/IconComponents/DeepSearchIcon.tsx +0 -16
  56. package/src/Core/IconComponents/DisabledVisibleIcon.tsx +0 -26
  57. package/src/Core/IconComponents/DocsIcon.tsx +0 -26
  58. package/src/Core/IconComponents/DownloadIcon.tsx +0 -26
  59. package/src/Core/IconComponents/EditUserIcon.tsx +0 -26
  60. package/src/Core/IconComponents/EnableVisibleIcon.tsx +0 -22
  61. package/src/Core/IconComponents/EnterArrowLeftIcon.tsx +0 -16
  62. package/src/Core/IconComponents/FileIcon.tsx +0 -16
  63. package/src/Core/IconComponents/FiltersIcon.tsx +0 -38
  64. package/src/Core/IconComponents/FlashIcon.tsx +0 -16
  65. package/src/Core/IconComponents/FolderAlertIcon.tsx +0 -32
  66. package/src/Core/IconComponents/FolderInfoIcon.tsx +0 -28
  67. package/src/Core/IconComponents/HomepageIcon.tsx +0 -16
  68. package/src/Core/IconComponents/InfoCircleFilled.tsx +0 -18
  69. package/src/Core/IconComponents/InfoCircleIcon.tsx +0 -23
  70. package/src/Core/IconComponents/IosIcon.tsx +0 -20
  71. package/src/Core/IconComponents/MapRadarIcon.tsx +0 -22
  72. package/src/Core/IconComponents/MaximizeIcon.tsx +0 -28
  73. package/src/Core/IconComponents/MicrosoftIcon.tsx +0 -28
  74. package/src/Core/IconComponents/MoonIcon.tsx +0 -16
  75. package/src/Core/IconComponents/OpenLockIcon.tsx +0 -30
  76. package/src/Core/IconComponents/OrganizationIcon.tsx +0 -26
  77. package/src/Core/IconComponents/PassportIcon.tsx +0 -796
  78. package/src/Core/IconComponents/PasswordFinderIcon.tsx +0 -22
  79. package/src/Core/IconComponents/PencilIcon.tsx +0 -16
  80. package/src/Core/IconComponents/PhonebookIcon.tsx +0 -22
  81. package/src/Core/IconComponents/PlaneIcon.tsx +0 -17
  82. package/src/Core/IconComponents/Plus.tsx +0 -20
  83. package/src/Core/IconComponents/PointIcon.tsx +0 -16
  84. package/src/Core/IconComponents/PrintIcon.tsx +0 -16
  85. package/src/Core/IconComponents/Profiler2Icon.tsx +0 -30
  86. package/src/Core/IconComponents/ProfilerIcon.tsx +0 -22
  87. package/src/Core/IconComponents/RelationIcon.tsx +0 -28
  88. package/src/Core/IconComponents/RelationPointsIcon.tsx +0 -36
  89. package/src/Core/IconComponents/RotateLeftIcon.tsx +0 -24
  90. package/src/Core/IconComponents/RotateRightIcon.tsx +0 -24
  91. package/src/Core/IconComponents/SandBoxIcon.tsx +0 -16
  92. package/src/Core/IconComponents/SearchIcon.tsx +0 -14
  93. package/src/Core/IconComponents/ShipIcon.tsx +0 -32
  94. package/src/Core/IconComponents/StatisticIcon.tsx +0 -26
  95. package/src/Core/IconComponents/SunIcon.tsx +0 -49
  96. package/src/Core/IconComponents/Unfold.tsx +0 -20
  97. package/src/Core/IconComponents/UpRightArrowCircleIcon.tsx +0 -22
  98. package/src/Core/IconComponents/UserInCircle.tsx +0 -24
  99. package/src/Core/IconComponents/Users.tsx +0 -36
  100. package/src/Core/IconComponents/VectorIcon.tsx +0 -17
  101. package/src/Core/IconComponents/WayIcon.tsx +0 -24
  102. package/src/Core/IconComponents/index.ts +0 -66
  103. package/src/Core/Input/Input.tsx +0 -245
  104. package/src/Core/Input/index.ts +0 -1
  105. package/src/Core/Label/Label.tsx +0 -139
  106. package/src/Core/Label/index.ts +0 -1
  107. package/src/Core/Line/Line.tsx +0 -26
  108. package/src/Core/Line/index.ts +0 -1
  109. package/src/Core/LinerProgress/LinerProgress.tsx +0 -47
  110. package/src/Core/LinerProgress/index.ts +0 -1
  111. package/src/Core/ListMenu/ListMenu.tsx +0 -31
  112. package/src/Core/ListMenu/ListMenuItem.tsx +0 -105
  113. package/src/Core/ListMenu/ListMenuSection.tsx +0 -54
  114. package/src/Core/ListMenu/index.ts +0 -3
  115. package/src/Core/Modal/Modal.tsx +0 -116
  116. package/src/Core/Modal/index.ts +0 -1
  117. package/src/Core/Overlay/Overlay.tsx +0 -94
  118. package/src/Core/Overlay/index.ts +0 -1
  119. package/src/Core/Pagination/Pagination.tsx +0 -139
  120. package/src/Core/Pagination/index.ts +0 -1
  121. package/src/Core/RowActionsMenu/RowActionsMenu.tsx +0 -153
  122. package/src/Core/RowActionsMenu/index.ts +0 -1
  123. package/src/Core/Select/Select.tsx +0 -197
  124. package/src/Core/Select/index.ts +0 -1
  125. package/src/Core/Sidebar/Sidebar.tsx +0 -80
  126. package/src/Core/Sidebar/SidebarContext.tsx +0 -13
  127. package/src/Core/Sidebar/SidebarDelimeter.tsx +0 -35
  128. package/src/Core/Sidebar/SidebarItem.tsx +0 -137
  129. package/src/Core/Sidebar/SidebarSection.tsx +0 -31
  130. package/src/Core/Sidebar/index.ts +0 -5
  131. package/src/Core/Switch/Switch.tsx +0 -71
  132. package/src/Core/Switch/index.ts +0 -1
  133. package/src/Core/Table/Cell.tsx +0 -42
  134. package/src/Core/Table/Row.tsx +0 -3
  135. package/src/Core/Table/Table.tsx +0 -94
  136. package/src/Core/Table/index.ts +0 -1
  137. package/src/Core/Tag/Tag.tsx +0 -144
  138. package/src/Core/Tag/index.ts +0 -1
  139. package/src/Core/Tooltip/Tooltip.tsx +0 -103
  140. package/src/Core/Tooltip/index.ts +0 -1
  141. package/src/Core/Typography/Typography.tsx +0 -70
  142. package/src/Core/Typography/index.ts +0 -1
  143. package/src/Core/index.ts +0 -27
  144. package/src/FullscreenCard/FullscreenCard.tsx +0 -56
  145. package/src/FullscreenCard/index.ts +0 -1
  146. package/src/Graph2D/Graph2D.tsx +0 -1837
  147. package/src/Graph2D/GraphLoader.tsx +0 -68
  148. package/src/Graph2D/icons/eye_light.png +0 -0
  149. package/src/Graph2D/icons/eye_light_hover.png +0 -0
  150. package/src/Graph2D/icons/group_light.png +0 -0
  151. package/src/Graph2D/icons/group_light_hover.png +0 -0
  152. package/src/Graph2D/index.ts +0 -2
  153. package/src/Graph2D/json_test.json +0 -44444
  154. package/src/Graph2D/types.ts +0 -122
  155. package/src/Layouts/Container/Container.tsx +0 -33
  156. package/src/Layouts/Container/index.ts +0 -1
  157. package/src/Layouts/PageLayout/PageLayout.tsx +0 -63
  158. package/src/Layouts/PageLayout/index.ts +0 -1
  159. package/src/Layouts/index.ts +0 -2
  160. package/src/Theme/Breakpoint.tsx +0 -50
  161. package/src/Theme/GlobalStyle.tsx +0 -18
  162. package/src/Theme/ThemeProvider.tsx +0 -30
  163. package/src/Theme/componentFabric.tsx +0 -159
  164. package/src/Theme/index.ts +0 -8
  165. package/src/Theme/styled.d.ts +0 -7
  166. package/src/Theme/themes/config.ts +0 -41
  167. package/src/Theme/themes/dark.ts +0 -1005
  168. package/src/Theme/themes/index.ts +0 -2
  169. package/src/Theme/themes/light.ts +0 -1004
  170. package/src/Theme/types.ts +0 -362
  171. package/src/Theme/useTheme.tsx +0 -7
  172. package/src/Theme/utils.ts +0 -205
  173. package/src/custom.d.ts +0 -19
  174. package/src/index.ts +0 -5
  175. package/src/utils.ts +0 -30
  176. package/tsconfig.paths.json +0 -5
  177. package/tsup.config.ts +0 -30
  178. package/tsup.dev.config.ts +0 -10
package/README.md CHANGED
@@ -66,3 +66,79 @@ The project uses various optimizations for efficient building:
66
66
  - Inline source maps for easier debugging
67
67
  - No minification for faster builds
68
68
  - No type generation for speed
69
+
70
+ ## UI Library Switch Tool
71
+
72
+ Цей інструмент дозволяє легко перемикатися між локальною версією UI бібліотеки та версією з NPM.
73
+
74
+ ### Використання
75
+
76
+ #### Варіант 1: Через npx (рекомендований)
77
+
78
+ ```bash
79
+ npx @cyber-harbour/ui switch-ui-lib
80
+ ```
81
+
82
+ #### Варіант 2: Через npm скрипт
83
+
84
+ Додайте скрипт в package.json вашого проекту:
85
+
86
+ ```json
87
+ {
88
+ "scripts": {
89
+ "switch-ui": "npx @cyber-harbour/ui switch-ui-lib"
90
+ }
91
+ }
92
+ ```
93
+
94
+ Потім запускайте:
95
+
96
+ ```bash
97
+ npm run switch-ui
98
+ ```
99
+
100
+ ### Налаштування
101
+
102
+ #### Змінні середовища
103
+
104
+ Створіть файл `.env` або `.env.local` в корені вашого проекту:
105
+
106
+ ```bash
107
+ UI_LIBRARY_PATH=/path/to/your/ui-kit
108
+ ```
109
+
110
+ Якщо змінна не встановлена, скрипт спробує знайти UI бібліотеку в папці `ui-kit` поруч з вашим проектом.
111
+
112
+ #### Структура проектів
113
+
114
+ Рекомендована структура:
115
+
116
+ ```
117
+ projects/
118
+ ├── ui-kit/ # UI бібліотека
119
+ ├── my-app/ # Ваш проект
120
+ └── another-app/ # Інший проект
121
+ ```
122
+
123
+ ### Що робить скрипт
124
+
125
+ #### Локальна версія
126
+
127
+ - Видаляє NPM версію пакету
128
+ - Створює npm link для React та React DOM
129
+ - Створює глобальний link для UI бібліотеки
130
+ - Підключає локальну версію через npm link
131
+
132
+ #### NPM версія
133
+
134
+ - Видаляє всі npm links
135
+ - Встановлює останню версію з NPM
136
+
137
+ ### Залежності
138
+
139
+ Скрипт потребує:
140
+
141
+ - `prompts` - для інтерактивного вибору
142
+ - `dotenv` - для читання змінних середовища (опційно)
143
+
144
+ Ці пакети автоматично встановлюються разом з UI бібліотекою.
@@ -0,0 +1,196 @@
1
+ #!/usr/bin/env node
2
+
3
+ const prompts = require('prompts');
4
+ const { execSync } = require('child_process');
5
+ const path = require('path');
6
+ const fs = require('fs');
7
+
8
+ // Load .env and .env.local files from current working directory
9
+ try {
10
+ require('dotenv').config({ path: path.join(process.cwd(), '.env') });
11
+ require('dotenv').config({ path: path.join(process.cwd(), '.env.local'), override: true });
12
+ } catch (error) {
13
+ // dotenv might not be available in the consuming project
14
+ console.log('💡 Для кращої роботи встановіть dotenv: npm install --save-dev dotenv');
15
+ }
16
+
17
+ const packageName = '@cyber-harbour/ui';
18
+
19
+ function findProjectRoot() {
20
+ let currentDir = process.cwd();
21
+
22
+ while (currentDir !== path.dirname(currentDir)) {
23
+ const packageJsonPath = path.join(currentDir, 'package.json');
24
+ if (fs.existsSync(packageJsonPath)) {
25
+ return currentDir;
26
+ }
27
+ currentDir = path.dirname(currentDir);
28
+ }
29
+
30
+ return process.cwd();
31
+ }
32
+
33
+ function getLocalPath() {
34
+ // Спочатку перевіряємо змінну середовища
35
+ if (process.env.UI_LIBRARY_PATH) {
36
+ return process.env.UI_LIBRARY_PATH;
37
+ }
38
+
39
+ // Якщо змінної немає, пропонуємо стандартний шлях
40
+ const projectRoot = findProjectRoot();
41
+ const parentDir = path.dirname(projectRoot);
42
+ const defaultPath = path.join(parentDir, 'ui-kit');
43
+
44
+ return defaultPath;
45
+ }
46
+
47
+ const projectRoot = findProjectRoot();
48
+ const localPath = getLocalPath();
49
+ const pkgPath = path.resolve(projectRoot, `node_modules/${packageName}/package.json`);
50
+
51
+ function isUsingLocalVersion() {
52
+ try {
53
+ const realPath = fs.realpathSync(pkgPath);
54
+ return realPath.startsWith(path.resolve(localPath));
55
+ } catch {
56
+ return false;
57
+ }
58
+ }
59
+
60
+ function isUsingNpmVersion() {
61
+ try {
62
+ const realPath = fs.realpathSync(pkgPath);
63
+ return !realPath.includes('..') && realPath.includes('node_modules');
64
+ } catch {
65
+ return false;
66
+ }
67
+ }
68
+
69
+ function checkLocalPathExists() {
70
+ if (!fs.existsSync(localPath)) {
71
+ console.log(`⚠️ Локальний шлях не знайдено: ${localPath}`);
72
+ console.log('💡 Встановіть змінну середовища UI_LIBRARY_PATH або перевірте шлях');
73
+ return false;
74
+ }
75
+
76
+ const localPackageJson = path.join(localPath, 'package.json');
77
+ if (!fs.existsSync(localPackageJson)) {
78
+ console.log(`⚠️ package.json не знайдено в: ${localPath}`);
79
+ return false;
80
+ }
81
+
82
+ return true;
83
+ }
84
+
85
+ async function main() {
86
+ console.log(`🏠 Проект: ${projectRoot}`);
87
+ console.log(`📦 Пакет: ${packageName}`);
88
+ console.log(`🔧 Локальний шлях: ${localPath}`);
89
+ console.log('');
90
+
91
+ const response = await prompts({
92
+ type: 'select',
93
+ name: 'mode',
94
+ message: 'Що підключити?',
95
+ choices: [
96
+ { title: `Локальну бібліотеку (${localPath})`, value: 'local' },
97
+ { title: 'Публічну версію з NPM', value: 'npm' },
98
+ ],
99
+ });
100
+
101
+ const { mode } = response;
102
+
103
+ if (mode === 'local') {
104
+ if (!checkLocalPathExists()) {
105
+ return;
106
+ }
107
+
108
+ if (isUsingLocalVersion()) {
109
+ console.log('✅ Вже підключено локально.');
110
+ return;
111
+ }
112
+
113
+ try {
114
+ // Спочатку видаляємо існуючий пакет
115
+ console.log('🔄 Видаляємо існуючий пакет...');
116
+ try {
117
+ execSync(`npm uninstall ${packageName}`, { stdio: 'inherit', cwd: projectRoot });
118
+ } catch {
119
+ // Ігноруємо помилку якщо пакет не встановлений
120
+ }
121
+
122
+ // Копіюємо React і React DOM з основного проекту в UI бібліотеку
123
+ console.log('🔄 Копіюємо React в UI бібліотеку...');
124
+ try {
125
+ execSync('npm link react react-dom', {
126
+ stdio: 'inherit',
127
+ cwd: localPath,
128
+ });
129
+ } catch (error) {
130
+ console.log("⚠️ Не вдалося зв'язати React (це може бути нормально)");
131
+ }
132
+
133
+ // Створюємо глобальний лінк в локальній бібліотеці
134
+ console.log('🔄 Створюємо глобальний лінк...');
135
+ execSync('npm link', {
136
+ stdio: 'inherit',
137
+ cwd: localPath,
138
+ });
139
+
140
+ // Лінкуємо локальну бібліотеку до проекту
141
+ console.log('🔄 Підключаємо локальну версію...');
142
+ execSync(`npm link ${packageName}`, { stdio: 'inherit', cwd: projectRoot });
143
+
144
+ console.log('✅ Успішно підключено локальну версію через npm link.');
145
+ } catch (error) {
146
+ console.error('❌ Помилка при підключенні локальної версії:', error.message);
147
+ }
148
+ }
149
+
150
+ if (mode === 'npm') {
151
+ if (isUsingNpmVersion()) {
152
+ console.log('✅ Вже використовується версія з NPM.');
153
+ return;
154
+ }
155
+
156
+ try {
157
+ // Видаляємо лінк якщо він існує
158
+ console.log('🔄 Видаляємо лінки...');
159
+ try {
160
+ execSync(`npm unlink ${packageName}`, { stdio: 'inherit', cwd: projectRoot });
161
+ } catch {
162
+ // Ігноруємо помилку якщо лінк не існує
163
+ }
164
+
165
+ // Видаляємо лінк React з UI бібліотеки
166
+ if (checkLocalPathExists()) {
167
+ console.log('🔄 Видаляємо React лінки з UI бібліотеки...');
168
+ try {
169
+ execSync('npm unlink react react-dom', {
170
+ stdio: 'inherit',
171
+ cwd: localPath,
172
+ });
173
+ } catch {
174
+ // Ігноруємо помилку якщо лінк не існує
175
+ }
176
+ }
177
+
178
+ // Встановлюємо пакет з NPM
179
+ console.log('🔄 Встановлюємо версію з NPM...');
180
+ execSync(`npm install ${packageName}`, { stdio: 'inherit', cwd: projectRoot });
181
+ console.log('✅ Успішно підключено версію з NPM.');
182
+ } catch (error) {
183
+ console.error('❌ Помилка при підключенні версії з NPM:', error.message);
184
+ }
185
+ }
186
+ }
187
+
188
+ // Перевіряємо чи prompts доступний
189
+ try {
190
+ require.resolve('prompts');
191
+ main().catch(console.error);
192
+ } catch (error) {
193
+ console.error('❌ Помилка: пакет "prompts" не знайдено.');
194
+ console.log('💡 Встановіть prompts: npm install --save-dev prompts');
195
+ process.exit(1);
196
+ }
package/dist/index.d.mts CHANGED
@@ -2,6 +2,7 @@ import * as react from 'react';
2
2
  import react__default, { SVGProps, CSSProperties as CSSProperties$1, ElementType, InputHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
3
  import * as styled_components from 'styled-components';
4
4
  import { CSSProperties, DefaultTheme } from 'styled-components';
5
+ export { ServerStyleSheet, StyleSheetManager } from 'styled-components';
5
6
  import * as styled_components_dist_types from 'styled-components/dist/types';
6
7
  import { DefaultTheme as DefaultTheme$1 } from 'styled-components/dist/types';
7
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as react from 'react';
2
2
  import react__default, { SVGProps, CSSProperties as CSSProperties$1, ElementType, InputHTMLAttributes, TextareaHTMLAttributes } from 'react';
3
3
  import * as styled_components from 'styled-components';
4
4
  import { CSSProperties, DefaultTheme } from 'styled-components';
5
+ export { ServerStyleSheet, StyleSheetManager } from 'styled-components';
5
6
  import * as styled_components_dist_types from 'styled-components/dist/types';
6
7
  import { DefaultTheme as DefaultTheme$1 } from 'styled-components/dist/types';
7
8
  import * as react_jsx_runtime from 'react/jsx-runtime';