@astral/features 4.0.0-alpha.7 → 4.0.0-alpha.9

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 (49) hide show
  1. package/node/productSwitcher/components/AstralProductSwitcher/stories/Example.story.d.ts +5 -0
  2. package/node/productSwitcher/components/AstralProductSwitcher/stories/Example.story.js +10 -0
  3. package/node/productSwitcher/components/AstralProductSwitcher/stories/Group.story.d.ts +8 -0
  4. package/node/productSwitcher/components/AstralProductSwitcher/stories/Group.story.js +14 -0
  5. package/node/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.d.ts +6 -0
  6. package/node/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.js +19 -0
  7. package/node/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.d.ts +8 -0
  8. package/node/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.js +14 -0
  9. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/index.d.ts +2 -0
  10. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/index.js +18 -0
  11. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.d.ts +27 -0
  12. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.js +119 -0
  13. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.d.ts +59 -0
  14. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.js +54 -0
  15. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.d.ts +5 -0
  16. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.js +9 -0
  17. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.d.ts +6 -0
  18. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.js +16 -0
  19. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/index.d.ts +2 -0
  20. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/index.js +18 -0
  21. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.d.ts +27 -0
  22. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.js +119 -0
  23. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.d.ts +47 -0
  24. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.js +58 -0
  25. package/package.json +2 -2
  26. package/productSwitcher/components/AstralProductSwitcher/stories/Example.story.d.ts +5 -0
  27. package/productSwitcher/components/AstralProductSwitcher/stories/Example.story.js +6 -0
  28. package/productSwitcher/components/AstralProductSwitcher/stories/Group.story.d.ts +8 -0
  29. package/productSwitcher/components/AstralProductSwitcher/stories/Group.story.js +10 -0
  30. package/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.d.ts +6 -0
  31. package/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.js +16 -0
  32. package/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.d.ts +8 -0
  33. package/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.js +10 -0
  34. package/productSwitcher/components/AstralProductSwitcher/stories/common/index.d.ts +2 -0
  35. package/productSwitcher/components/AstralProductSwitcher/stories/common/index.js +2 -0
  36. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.d.ts +27 -0
  37. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.js +116 -0
  38. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.d.ts +59 -0
  39. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.js +50 -0
  40. package/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.d.ts +5 -0
  41. package/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.js +5 -0
  42. package/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.d.ts +6 -0
  43. package/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.js +13 -0
  44. package/productSwitcher/components/IdentityProductSwitcher/stories/common/index.d.ts +2 -0
  45. package/productSwitcher/components/IdentityProductSwitcher/stories/common/index.js +2 -0
  46. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.d.ts +27 -0
  47. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.js +116 -0
  48. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.d.ts +47 -0
  49. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.js +54 -0
@@ -0,0 +1,54 @@
1
+ import { ASTRAL_PRODUCTS, ECO_PRODUCTS, IDENTITY_URL } from './mockData';
2
+ export const createProductsMockResponse = ({ searchParams }) => {
3
+ switch (searchParams.tenantId) {
4
+ case 'astral': {
5
+ return {
6
+ data: ASTRAL_PRODUCTS,
7
+ meta: {
8
+ totalCount: ASTRAL_PRODUCTS.length,
9
+ },
10
+ };
11
+ }
12
+ case 'eco': {
13
+ return {
14
+ data: ECO_PRODUCTS,
15
+ meta: {
16
+ totalCount: ECO_PRODUCTS.length,
17
+ },
18
+ };
19
+ }
20
+ default: {
21
+ return {
22
+ data: [],
23
+ meta: {
24
+ totalCount: 0,
25
+ },
26
+ };
27
+ }
28
+ }
29
+ };
30
+ export const MOCK_FETCH_IDENTITY_PRODUCTS = [
31
+ {
32
+ url: `${IDENTITY_URL}/api/products/widget?tenantId=*`,
33
+ method: 'GET',
34
+ status: 200,
35
+ response: createProductsMockResponse,
36
+ },
37
+ ];
38
+ export const MOCK_FETCH_IDENTITY_TENANTS = [
39
+ {
40
+ url: `${IDENTITY_URL}/api/tenants/widget`,
41
+ method: 'GET',
42
+ status: 200,
43
+ response: [
44
+ {
45
+ id: 'astral',
46
+ name: 'Астрал',
47
+ },
48
+ {
49
+ id: 'eco',
50
+ name: 'Экосистема',
51
+ },
52
+ ],
53
+ },
54
+ ];