@bluealba/pae-ui-react-core 3.0.2-feature-rename-ba-libraries-scope-1169

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 (206) hide show
  1. package/LICENSE +134 -0
  2. package/README.md +368 -0
  3. package/dist/index.cjs.js +252 -0
  4. package/dist/index.css +1 -0
  5. package/dist/index.esm.js +9741 -0
  6. package/dist/index.systemjs.js +253 -0
  7. package/dist/index.umd.js +253 -0
  8. package/dist/src/MicrofrontendProps.d.ts +9 -0
  9. package/dist/src/components/ApplicationIcon.d.ts +7 -0
  10. package/dist/src/components/Authorized.d.ts +12 -0
  11. package/dist/src/components/ExtendExtensionPoint.d.ts +20 -0
  12. package/dist/src/components/ExtensionPoint.d.ts +39 -0
  13. package/dist/src/components/ModulePlaceHolder/BaseContainer.d.ts +4 -0
  14. package/dist/src/components/ModulePlaceHolder/BaseError.d.ts +7 -0
  15. package/dist/src/components/ModulePlaceHolder/BaseLoading.d.ts +7 -0
  16. package/dist/src/components/ModulePlaceHolder/ModulePlaceHolder.d.ts +22 -0
  17. package/dist/src/components/ModulePlaceHolder/index.d.ts +2 -0
  18. package/dist/src/components/PAEModule.d.ts +18 -0
  19. package/dist/src/components/PlatformEventListener.d.ts +12 -0
  20. package/dist/src/components/common/Alert/Alert.d.ts +16 -0
  21. package/dist/src/components/common/Alert/index.d.ts +2 -0
  22. package/dist/src/components/common/Badge/Badge.d.ts +9 -0
  23. package/dist/src/components/common/Badge/Badge.stories.d.ts +20 -0
  24. package/dist/src/components/common/Badge/Badges.d.ts +6 -0
  25. package/dist/src/components/common/Button/Button.d.ts +10 -0
  26. package/dist/src/components/common/Button/Button.stories.d.ts +45 -0
  27. package/dist/src/components/common/ConfirmDialog/ConfirmDialog.d.ts +11 -0
  28. package/dist/src/components/common/ConfirmDialog/ConfirmDialog.stories.d.ts +14 -0
  29. package/dist/src/components/common/CopyToClipboardButton/CopyToClipboardButton.d.ts +7 -0
  30. package/dist/src/components/common/CopyToClipboardButton/CopyToClipboardButton.stories.d.ts +15 -0
  31. package/dist/src/components/common/Dialog/Dialog.d.ts +26 -0
  32. package/dist/src/components/common/Dialog/Dialog.stories.d.ts +14 -0
  33. package/dist/src/components/common/Dialog/index.d.ts +2 -0
  34. package/dist/src/components/common/Dialog/subComponents/Actions.d.ts +6 -0
  35. package/dist/src/components/common/Dialog/subComponents/Close.d.ts +6 -0
  36. package/dist/src/components/common/Dialog/subComponents/Content.d.ts +6 -0
  37. package/dist/src/components/common/Dialog/subComponents/Description.d.ts +6 -0
  38. package/dist/src/components/common/Dialog/subComponents/Footer.d.ts +6 -0
  39. package/dist/src/components/common/Dialog/subComponents/Header.d.ts +6 -0
  40. package/dist/src/components/common/Dialog/subComponents/Title.d.ts +6 -0
  41. package/dist/src/components/common/DropdownList/DropdownList.d.ts +8 -0
  42. package/dist/src/components/common/DropdownList/index.d.ts +3 -0
  43. package/dist/src/components/common/EmptyState/EmptyState.d.ts +7 -0
  44. package/dist/src/components/common/EmptyState/EmptyState.stories.d.ts +16 -0
  45. package/dist/src/components/common/EmptyState/EmptyStateIcon.d.ts +7 -0
  46. package/dist/src/components/common/ErrorState/ErrorState.d.ts +9 -0
  47. package/dist/src/components/common/ErrorState/ErrorState.stories.d.ts +11 -0
  48. package/dist/src/components/common/ErrorState/WarningIcon.d.ts +6 -0
  49. package/dist/src/components/common/ErrorState/index.d.ts +2 -0
  50. package/dist/src/components/common/FieldGroup/FieldGroup.d.ts +7 -0
  51. package/dist/src/components/common/Icon/ArrowDown.d.ts +7 -0
  52. package/dist/src/components/common/Icon/ChevronLeft.d.ts +7 -0
  53. package/dist/src/components/common/Icon/ChevronRight.d.ts +7 -0
  54. package/dist/src/components/common/Icon/ClipboardCheckIcon.d.ts +13 -0
  55. package/dist/src/components/common/Icon/ClipboardIcon.d.ts +14 -0
  56. package/dist/src/components/common/Icon/EyeIcon.d.ts +13 -0
  57. package/dist/src/components/common/Icon/HorizontalDots.d.ts +7 -0
  58. package/dist/src/components/common/Input/Input.d.ts +7 -0
  59. package/dist/src/components/common/Input/Input.stories.d.ts +23 -0
  60. package/dist/src/components/common/InputError/InputError.d.ts +6 -0
  61. package/dist/src/components/common/Label/Label.d.ts +7 -0
  62. package/dist/src/components/common/List/List.d.ts +26 -0
  63. package/dist/src/components/common/List/List.stories.d.ts +27 -0
  64. package/dist/src/components/common/List/index.d.ts +2 -0
  65. package/dist/src/components/common/List/subComponents/Action.d.ts +6 -0
  66. package/dist/src/components/common/List/subComponents/Actions.d.ts +6 -0
  67. package/dist/src/components/common/List/subComponents/Description.d.ts +6 -0
  68. package/dist/src/components/common/List/subComponents/Icon.d.ts +6 -0
  69. package/dist/src/components/common/List/subComponents/Item.d.ts +8 -0
  70. package/dist/src/components/common/List/subComponents/Title.d.ts +6 -0
  71. package/dist/src/components/common/Pagination/Pagination.d.ts +31 -0
  72. package/dist/src/components/common/PasswordInput/PasswordInput.d.ts +8 -0
  73. package/dist/src/components/common/PasswordInput/PasswordInput.stories.d.ts +20 -0
  74. package/dist/src/components/common/Pill/Pill.d.ts +8 -0
  75. package/dist/src/components/common/Pill/Pill.stories.d.ts +26 -0
  76. package/dist/src/components/common/PluralizeCounter/PluralizeCounter.d.ts +9 -0
  77. package/dist/src/components/common/PluralizeCounter/PluralizeCounter.stories.d.ts +14 -0
  78. package/dist/src/components/common/SearchAutocomplete/AutocompleteHighlighter.d.ts +8 -0
  79. package/dist/src/components/common/SearchAutocomplete/AutocompleteItem.d.ts +7 -0
  80. package/dist/src/components/common/SearchAutocomplete/SearchAutocomplete.d.ts +27 -0
  81. package/dist/src/components/common/SearchAutocomplete/SearchAutocomplete.stories.d.ts +51 -0
  82. package/dist/src/components/common/SearchAutocomplete/hooks/useAutocomplete.d.ts +13 -0
  83. package/dist/src/components/common/SearchAutocomplete/types.d.ts +12 -0
  84. package/dist/src/components/common/SearchInput/SearchInput.d.ts +9 -0
  85. package/dist/src/components/common/SearchInput/SearchInput.stories.d.ts +30 -0
  86. package/dist/src/components/common/Select/Option.d.ts +6 -0
  87. package/dist/src/components/common/Select/Select.d.ts +13 -0
  88. package/dist/src/components/common/Select/Select.stories.d.ts +20 -0
  89. package/dist/src/components/common/Show/Show.d.ts +32 -0
  90. package/dist/src/components/common/Skeleton/Skeleton.d.ts +11 -0
  91. package/dist/src/components/common/Skeleton/Skeleton.stories.d.ts +11 -0
  92. package/dist/src/components/common/Skeleton/SkeletonList.d.ts +10 -0
  93. package/dist/src/components/common/Skeleton/SkeletonList.stories.d.ts +11 -0
  94. package/dist/src/components/common/Spinner/Spinner.d.ts +10 -0
  95. package/dist/src/components/common/Spinner/Spinner.stories.d.ts +11 -0
  96. package/dist/src/components/common/Switch/Switch.d.ts +15 -0
  97. package/dist/src/components/common/Switch/Switch.stories.d.ts +8 -0
  98. package/dist/src/components/common/Table/Table.d.ts +43 -0
  99. package/dist/src/components/common/Table/Table.stories.d.ts +65 -0
  100. package/dist/src/components/common/Table/TablePagination.d.ts +9 -0
  101. package/dist/src/components/common/Table/generatePagination.d.ts +1 -0
  102. package/dist/src/components/common/Table/table.test.d.ts +1 -0
  103. package/dist/src/components/common/Tabs/Tabs.d.ts +30 -0
  104. package/dist/src/components/common/TextArea/TextArea.d.ts +6 -0
  105. package/dist/src/components/common/TextArea/TextArea.stories.d.ts +17 -0
  106. package/dist/src/components/common/Tooltip/Tooltip.d.ts +15 -0
  107. package/dist/src/components/common/Tooltip/Tooltip.stories.d.ts +35 -0
  108. package/dist/src/components/common/index.d.ts +58 -0
  109. package/dist/src/components/index.d.ts +6 -0
  110. package/dist/src/constants/index.d.ts +5 -0
  111. package/dist/src/core/PlatformEvents.d.ts +13 -0
  112. package/dist/src/core/gateway/GatewayHttpHeaders.d.ts +10 -0
  113. package/dist/src/core/index.d.ts +1 -0
  114. package/dist/src/getGlobalState.d.ts +1 -0
  115. package/dist/src/hocs/authorized.d.ts +4 -0
  116. package/dist/src/hocs/extensionPoint.d.ts +17 -0
  117. package/dist/src/hocs/index.d.ts +2 -0
  118. package/dist/src/hooks/applications/ApplicationMenu.d.ts +18 -0
  119. package/dist/src/hooks/applications/PlatformApplication.d.ts +10 -0
  120. package/dist/src/hooks/applications/useApplicationIcon.d.ts +4 -0
  121. package/dist/src/hooks/applications/useApplicationJSModule.d.ts +18 -0
  122. package/dist/src/hooks/applications/useApplicationMenu.d.ts +11 -0
  123. package/dist/src/hooks/applications/useApplicationUIModule.d.ts +4 -0
  124. package/dist/src/hooks/applications/useApplications.d.ts +4 -0
  125. package/dist/src/hooks/applications/useCurrentApplication.d.ts +8 -0
  126. package/dist/src/hooks/applications/useCurrentApplication.test.d.ts +1 -0
  127. package/dist/src/hooks/applications/useCurrentApplicationName.d.ts +6 -0
  128. package/dist/src/hooks/applications/useCurrentJSModule.d.ts +9 -0
  129. package/dist/src/hooks/catalog/useCatalog.d.ts +14 -0
  130. package/dist/src/hooks/catalog/useMutableCatalog.d.ts +28 -0
  131. package/dist/src/hooks/catalog/userCatalog.test.d.ts +1 -0
  132. package/dist/src/hooks/commons/useObservable.d.ts +8 -0
  133. package/dist/src/hooks/commons/useResource.d.ts +21 -0
  134. package/dist/src/hooks/commons/useResourceActions.d.ts +56 -0
  135. package/dist/src/hooks/commons/useSubjectObservable.d.ts +11 -0
  136. package/dist/src/hooks/customizations/useDynamicFonts.d.ts +13 -0
  137. package/dist/src/hooks/customizations/useDynamicStyleSheet.d.ts +1 -0
  138. package/dist/src/hooks/customizations/useGetPlatformTheme.d.ts +3 -0
  139. package/dist/src/hooks/customizations/usePAECustomizationsLoadingState.d.ts +2 -0
  140. package/dist/src/hooks/customizations/usePlatformCustomization.d.ts +8 -0
  141. package/dist/src/hooks/customizations/utils.d.ts +2 -0
  142. package/dist/src/hooks/events/usePlatformEventListener.d.ts +2 -0
  143. package/dist/src/hooks/extensions/useExtendExtensionPoint.d.ts +11 -0
  144. package/dist/src/hooks/extensions/useExtensionPoint.d.ts +16 -0
  145. package/dist/src/hooks/habits/ApplicationEvent.d.ts +4 -0
  146. package/dist/src/hooks/habits/mapEvent.d.ts +17 -0
  147. package/dist/src/hooks/habits/trackEvents.d.ts +9 -0
  148. package/dist/src/hooks/habits/useTrackEvent.d.ts +5 -0
  149. package/dist/src/hooks/habits/useTrackEvents.d.ts +9 -0
  150. package/dist/src/hooks/habits/useTrackEvents.test.d.ts +1 -0
  151. package/dist/src/hooks/index.d.ts +42 -0
  152. package/dist/src/hooks/module/useModule.d.ts +6 -0
  153. package/dist/src/hooks/module/useModuleCommonPaths.d.ts +9 -0
  154. package/dist/src/hooks/module/useModuleConfig.d.ts +5 -0
  155. package/dist/src/hooks/module/useModuleConfigByName.d.ts +5 -0
  156. package/dist/src/hooks/module/useModuleMetadata.d.ts +8 -0
  157. package/dist/src/hooks/routing/useLocation.d.ts +7 -0
  158. package/dist/src/hooks/tenants/constants.d.ts +21 -0
  159. package/dist/src/hooks/tenants/getClientTenantStrategy.d.ts +4 -0
  160. package/dist/src/hooks/tenants/strategies/cookie.d.ts +7 -0
  161. package/dist/src/hooks/tenants/strategies/queryParams.d.ts +7 -0
  162. package/dist/src/hooks/tenants/strategies/sessionStorage.d.ts +7 -0
  163. package/dist/src/hooks/tenants/strategies/subdomain.d.ts +9 -0
  164. package/dist/src/hooks/tenants/strategies/tenantStrategy.interface.d.ts +6 -0
  165. package/dist/src/hooks/tenants/useTenants.d.ts +8 -0
  166. package/dist/src/hooks/useAppStatus.d.ts +6 -0
  167. package/dist/src/hooks/useAppsState.d.ts +18 -0
  168. package/dist/src/hooks/useAuth.d.ts +14 -0
  169. package/dist/src/hooks/useAuth.test.d.ts +1 -0
  170. package/dist/src/hooks/useHasNoSession.d.ts +2 -0
  171. package/dist/src/hooks/useNotifications.d.ts +4 -0
  172. package/dist/src/hooks/useOperations.d.ts +1 -0
  173. package/dist/src/hooks/usePAEState.d.ts +7 -0
  174. package/dist/src/hooks/useServiceBaseURL.d.ts +6 -0
  175. package/dist/src/hooks/useServiceInvoker.d.ts +20 -0
  176. package/dist/src/hooks/useServiceInvoker.test.d.ts +1 -0
  177. package/dist/src/hooks/useUIApplications.d.ts +5 -0
  178. package/dist/src/hooks/userState/UserState.d.ts +7 -0
  179. package/dist/src/hooks/userState/UserStateApiClient.d.ts +9 -0
  180. package/dist/src/hooks/userState/useUserState.d.ts +24 -0
  181. package/dist/src/index.d.ts +11 -0
  182. package/dist/src/model/ModuleMetadata.d.ts +6 -0
  183. package/dist/src/test-utils/setupTestEnvironment.d.ts +15 -0
  184. package/dist/src/types.d.ts +37 -0
  185. package/dist/src/utils/Request.d.ts +7 -0
  186. package/dist/src/utils/URL.d.ts +6 -0
  187. package/dist/src/utils/alphaColor.d.ts +1 -0
  188. package/dist/src/utils/createRootComponent.d.ts +9 -0
  189. package/dist/src/utils/fonts.d.ts +5 -0
  190. package/dist/src/utils/getApplicationUIModule.d.ts +10 -0
  191. package/dist/src/utils/getApplications.d.ts +4 -0
  192. package/dist/src/utils/getOperations.d.ts +5 -0
  193. package/dist/src/utils/hasAccess.d.ts +8 -0
  194. package/dist/src/utils/immutable.d.ts +18 -0
  195. package/dist/src/utils/index.d.ts +18 -0
  196. package/dist/src/utils/initializeMicroFrontend.d.ts +17 -0
  197. package/dist/src/utils/isValidEmail.d.ts +1 -0
  198. package/dist/src/utils/isValidEmail.test.d.ts +1 -0
  199. package/dist/src/utils/logout.d.ts +1 -0
  200. package/dist/src/utils/logout.test.d.ts +1 -0
  201. package/dist/src/utils/navigateTo.d.ts +1 -0
  202. package/dist/src/utils/promises.d.ts +4 -0
  203. package/dist/tests/renderHookWithProviders.d.ts +3 -0
  204. package/dist/tests/testUtils.d.ts +7 -0
  205. package/package.json +61 -0
  206. package/src/global.css +32 -0
@@ -0,0 +1,18 @@
1
+ export { logout } from './logout';
2
+ export { hasAccess } from './hasAccess';
3
+ export { getApplications } from './getApplications';
4
+ export { getOperations } from './getOperations';
5
+ export { navigateTo } from './navigateTo';
6
+ export { isValidEmail } from './isValidEmail';
7
+ /**
8
+ * Returns the initials from a given display name.
9
+ *
10
+ * Splits the display name by spaces and extracts the first character of each word,
11
+ * then joins them and slices the result to the specified maximum length.
12
+ * If the display name consists of a single word, it slices the word to the maximum length.
13
+ *
14
+ * @param displayName - The display name to extract initials from.
15
+ * @param maxLength - The maximum number of initials to return. Defaults to 2.
16
+ * @returns The initials as a string, or an empty string if no display name is provided.
17
+ */
18
+ export declare const getInitials: (displayName?: string, maxLength?: number) => string;
@@ -0,0 +1,17 @@
1
+ import { FC } from 'react';
2
+ import { ReactAppOrParcel, SingleSpaReactOpts } from 'single-spa-react';
3
+ import { RootComponentProps } from '../MicrofrontendProps';
4
+
5
+ export interface MicroFrontendOptions<T extends RootComponentProps> extends SingleSpaReactOpts<T> {
6
+ rootComponent: FC<T>;
7
+ }
8
+ /**
9
+ * Main function to create a PAE micro-frontend module.
10
+ * Internally we use single-spa so currently our API is pretty similar.
11
+ * But it is enriched with PAE concepts such as ModuleMetadata, the catalog, etc.
12
+ *
13
+ * All PAE micro-frontends are wrapped in PAE components that provides react context later used
14
+ * by the provided hooks.
15
+ */
16
+ declare const initializeMicroFrontend: <T extends RootComponentProps>({ rootComponent, ...opts }: MicroFrontendOptions<T>) => ReactAppOrParcel<T>;
17
+ export default initializeMicroFrontend;
@@ -0,0 +1 @@
1
+ export declare const isValidEmail: (email: string) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare function logout(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const navigateTo: (path: string) => void;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * wait the given amount of milliseconds before resolving
3
+ */
4
+ export declare const sleep: (time: number) => Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import { renderHook } from '@testing-library/react';
2
+
3
+ export declare const renderHookWithProviders: typeof renderHook;
@@ -0,0 +1,7 @@
1
+ type AuthUser = Window['__PAE_GLOBAL_STATE__']['authUser'];
2
+ type Catalog = Window['__PAE_GLOBAL_STATE__']['catalog'];
3
+ export declare function initGlobalState(): void;
4
+ export declare function mockAuthUser(authUser: Partial<AuthUser>): () => void;
5
+ export declare function mockAuthOperations(operations: string[]): () => void;
6
+ export declare function mockCatalog(catalog: Catalog): () => void;
7
+ export {};
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@bluealba/pae-ui-react-core",
3
+ "version": "3.0.2-feature-rename-ba-libraries-scope-1169",
4
+ "type": "module",
5
+ "main": "./dist/index.cjs.js",
6
+ "module": "./dist/index.esm.js",
7
+ "types": "./dist/src/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "src/global.css"
11
+ ],
12
+ "description": "React utilities for PAE",
13
+ "scripts": {
14
+ "build": "node build/build.mjs",
15
+ "build:watch": "node build/watch.mjs",
16
+ "publish-local": "node build/publish.mjs",
17
+ "publish-local:watch": "node build/publish-watch.mjs",
18
+ "publish-local:patch": "npm version patch && npm run publish",
19
+ "publish-local:minor": "npm version minor && npm run publish",
20
+ "publish-local:major": "npm version major && npm run publish",
21
+ "test": "jest",
22
+ "lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
23
+ },
24
+ "keywords": [],
25
+ "author": "Blue Alba",
26
+ "license": "PolyForm-Noncommercial-1.0.0",
27
+ "peerDependencies": {
28
+ "@tanstack/react-query": "5.79.2",
29
+ "react": "^18.3.1",
30
+ "react-dom": "18.3.1"
31
+ },
32
+ "devDependencies": {
33
+ "@bluealba/pae-core": "*",
34
+ "@testing-library/react": "^16.0.1",
35
+ "@types/js-cookie": "^3.0.6",
36
+ "@vitejs/plugin-react": "4.3.1",
37
+ "chalk": "5.3.0",
38
+ "jest-fetch-mock": "^3.0.3",
39
+ "resolvable-promise": "^3.0.0",
40
+ "vite": "5.3.6",
41
+ "vite-plugin-dts": "4.0.0-beta.2",
42
+ "vite-plugin-lib-inject-css": "^2.1.1"
43
+ },
44
+ "dependencies": {
45
+ "@radix-ui/react-slot": "^1.1.0",
46
+ "clsx": "^2.1.1",
47
+ "color-parse": "^2.0.2",
48
+ "js-cookie": "^3.0.5",
49
+ "jsonwebtoken": "^9.0.2",
50
+ "pluralize": "^8.0.0",
51
+ "ramda": "^0.30.1",
52
+ "react-hot-toast": "2.4.1",
53
+ "rxjs": "^7.8.1",
54
+ "single-spa": "^6.0.1",
55
+ "single-spa-react": "6.0.1"
56
+ },
57
+ "publishConfig": {
58
+ "@bluealba:registry": "https://registry.npmjs.org/",
59
+ "access": "public"
60
+ }
61
+ }
package/src/global.css ADDED
@@ -0,0 +1,32 @@
1
+ :root {
2
+ /* Input */
3
+ --platform-label-color: var(--platform-text-secondary-color);
4
+ --platform-input-border-color: var(--platform-lines);
5
+ --platform-input-background-color: var(--platform-background-secondary-color);
6
+ --platform-input-color: var(--platform-text-primary-color);
7
+ --platform-input-focus-border-color: var(--platform-color-primary);
8
+
9
+ /* Button */
10
+ --platform-button-base-padding: 4px 16px;
11
+ --platform-button-base-border-radius: 6px;
12
+ --platform-button-base-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
13
+ --platform-button-base-font-size: 1em;
14
+ --platform-button-base-line-height: 16px;
15
+ --platform-button-base-height: calc(2 * var(--platform-button-base-font-size));
16
+ /* Contained Primary variant */
17
+ --platform-button-contained-primary-background-color: var(--platform-color-primary);
18
+ --platform-button-contained-primary-color: #ffffff;
19
+ /* Outlined Primary variant */
20
+ --platform-button-outlined-primary-color: var(--platform-color-primary);
21
+ /* Text Primary variant */
22
+ --platform-button-text-primary-color: var(--platform-text-primary-color);
23
+
24
+ /* Contained danger variant */
25
+ --platform-button-contained-danger-background-color: var(--platform-color-danger);
26
+ --platform-button-contained-danger-color: #ffffff;
27
+ /* Outlined danger variant */
28
+ --platform-button-outlined-danger-color: var(--platform-color-danger);
29
+ /* Text danger variant */
30
+ --platform-button-text-danger-color: var(--platform-color-danger);
31
+
32
+ }