@reapit/elements 5.0.0-beta.28 → 5.0.0-beta.29

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 (104) hide show
  1. package/dist/js/components/app-switcher/__test__/config.test.d.ts +2 -0
  2. package/dist/js/components/app-switcher/__test__/config.test.d.ts.map +1 -0
  3. package/dist/js/components/app-switcher/__test__/get-displayable-products-for-explore-group.test.d.ts +2 -0
  4. package/dist/js/components/app-switcher/__test__/get-displayable-products-for-explore-group.test.d.ts.map +1 -0
  5. package/dist/js/components/app-switcher/__test__/get-displayable-products-for-your-apps-group.test.d.ts +2 -0
  6. package/dist/js/components/app-switcher/__test__/get-displayable-products-for-your-apps-group.test.d.ts.map +1 -0
  7. package/dist/js/components/app-switcher/app-avatar/app-avatar.d.ts +11 -5
  8. package/dist/js/components/app-switcher/app-avatar/app-avatar.d.ts.map +1 -1
  9. package/dist/js/components/app-switcher/app-avatar/app-avatar.stories.d.ts +14 -3
  10. package/dist/js/components/app-switcher/app-avatar/app-avatar.stories.d.ts.map +1 -1
  11. package/dist/js/components/app-switcher/app-avatar/index.d.ts +2 -0
  12. package/dist/js/components/app-switcher/app-avatar/index.d.ts.map +1 -0
  13. package/dist/js/components/app-switcher/app-switcher.d.ts +24 -13
  14. package/dist/js/components/app-switcher/app-switcher.d.ts.map +1 -1
  15. package/dist/js/components/app-switcher/app-switcher.stories.d.ts +65 -3
  16. package/dist/js/components/app-switcher/app-switcher.stories.d.ts.map +1 -1
  17. package/dist/js/components/app-switcher/config.d.ts +62 -0
  18. package/dist/js/components/app-switcher/config.d.ts.map +1 -0
  19. package/dist/js/components/app-switcher/explore-menu-group/explore-menu-group.d.ts +4 -4
  20. package/dist/js/components/app-switcher/explore-menu-group/explore-menu-group.d.ts.map +1 -1
  21. package/dist/js/components/app-switcher/explore-menu-group/explore-menu-group.stories.d.ts +5 -0
  22. package/dist/js/components/app-switcher/explore-menu-group/explore-menu-group.stories.d.ts.map +1 -1
  23. package/dist/js/components/app-switcher/get-displayable-products-for-explore-group.d.ts +8 -0
  24. package/dist/js/components/app-switcher/get-displayable-products-for-explore-group.d.ts.map +1 -0
  25. package/dist/js/components/app-switcher/get-displayable-products-for-your-apps-group.d.ts +8 -0
  26. package/dist/js/components/app-switcher/get-displayable-products-for-your-apps-group.d.ts.map +1 -0
  27. package/dist/js/components/app-switcher/index.d.ts +9 -0
  28. package/dist/js/components/app-switcher/index.d.ts.map +1 -1
  29. package/dist/js/components/app-switcher/menu-group-has-access-context.d.ts +3 -0
  30. package/dist/js/components/app-switcher/menu-group-has-access-context.d.ts.map +1 -0
  31. package/dist/js/components/app-switcher/menu-item/menu-item.d.ts +17 -8
  32. package/dist/js/components/app-switcher/menu-item/menu-item.d.ts.map +1 -1
  33. package/dist/js/components/app-switcher/menu-item/menu-item.stories.d.ts +579 -0
  34. package/dist/js/components/app-switcher/menu-item/menu-item.stories.d.ts.map +1 -0
  35. package/dist/js/components/app-switcher/menu-item/styles.d.ts +3 -4
  36. package/dist/js/components/app-switcher/menu-item/styles.d.ts.map +1 -1
  37. package/dist/js/components/app-switcher/nav-icon-button/index.d.ts +2 -0
  38. package/dist/js/components/app-switcher/nav-icon-button/index.d.ts.map +1 -0
  39. package/dist/js/components/app-switcher/nav-icon-button/nav-icon-button.d.ts +1 -1
  40. package/dist/js/components/app-switcher/nav-icon-button/nav-icon-button.d.ts.map +1 -1
  41. package/dist/js/components/app-switcher/nav-icon-button/nav-icon-button.stories.d.ts +16 -0
  42. package/dist/js/components/app-switcher/nav-icon-button/nav-icon-button.stories.d.ts.map +1 -0
  43. package/dist/js/components/app-switcher/product-menu-item/__test__/product-menu-item.test.d.ts +2 -0
  44. package/dist/js/components/app-switcher/product-menu-item/__test__/product-menu-item.test.d.ts.map +1 -0
  45. package/dist/js/components/app-switcher/product-menu-item/index.d.ts +2 -0
  46. package/dist/js/components/app-switcher/product-menu-item/index.d.ts.map +1 -0
  47. package/dist/js/components/app-switcher/product-menu-item/product-menu-item.d.ts +19 -0
  48. package/dist/js/components/app-switcher/product-menu-item/product-menu-item.d.ts.map +1 -0
  49. package/dist/js/components/app-switcher/product-menu-item/product-menu-item.stories.d.ts +571 -0
  50. package/dist/js/components/app-switcher/product-menu-item/product-menu-item.stories.d.ts.map +1 -0
  51. package/dist/js/components/app-switcher/your-apps-menu-group/your-apps-menu-group.d.ts +4 -4
  52. package/dist/js/components/app-switcher/your-apps-menu-group/your-apps-menu-group.d.ts.map +1 -1
  53. package/dist/js/components/app-switcher/your-apps-menu-group/your-apps-menu-group.stories.d.ts +5 -0
  54. package/dist/js/components/app-switcher/your-apps-menu-group/your-apps-menu-group.stories.d.ts.map +1 -1
  55. package/dist/js/components/menu/menu.atoms.d.ts +4 -1
  56. package/dist/js/components/menu/menu.atoms.d.ts.map +1 -1
  57. package/dist/js/components/menu/menu.molecules.d.ts +2 -0
  58. package/dist/js/components/menu/menu.molecules.d.ts.map +1 -1
  59. package/dist/js/components/menu/menu.stories.d.ts.map +1 -1
  60. package/dist/js/components/menu/styles.d.ts +3 -0
  61. package/dist/js/components/menu/styles.d.ts.map +1 -1
  62. package/dist/js/components/side-bar/menu-group/menu-group-summary.d.ts.map +1 -1
  63. package/dist/js/components/side-bar/menu-group/menu-group.d.ts +11 -1
  64. package/dist/js/components/side-bar/menu-group/menu-group.d.ts.map +1 -1
  65. package/dist/js/components/side-bar/menu-group/menu-group.stories.d.ts +7 -0
  66. package/dist/js/components/side-bar/menu-group/menu-group.stories.d.ts.map +1 -1
  67. package/dist/js/components/side-bar/menu-group/should-be-open.d.ts +2 -0
  68. package/dist/js/components/side-bar/menu-group/should-be-open.d.ts.map +1 -0
  69. package/dist/js/components/side-bar/menu-group/styles.d.ts.map +1 -1
  70. package/dist/js/components/side-bar/menu-group/use-menu-group-controller.d.ts.map +1 -1
  71. package/dist/js/index.cjs +2 -2
  72. package/dist/js/index.d.ts +1 -0
  73. package/dist/js/index.d.ts.map +1 -1
  74. package/dist/js/index.js +1534 -1433
  75. package/dist/js/style.css +1 -1
  76. package/dist/js/types/core.d.ts +1 -0
  77. package/dist/js/types/core.d.ts.map +1 -1
  78. package/package.json +1 -1
  79. package/dist/js/components/app-switcher/appNames.d.ts +0 -8
  80. package/dist/js/components/app-switcher/appNames.d.ts.map +0 -1
  81. package/dist/js/components/app-switcher/menu-group-context.d.ts +0 -3
  82. package/dist/js/components/app-switcher/menu-group-context.d.ts.map +0 -1
  83. package/dist/js/components/app-switcher/menu-items/__test__/menu-items.test.d.ts +0 -2
  84. package/dist/js/components/app-switcher/menu-items/__test__/menu-items.test.d.ts.map +0 -1
  85. package/dist/js/components/app-switcher/menu-items/auto-responder-menu-item.d.ts +0 -6
  86. package/dist/js/components/app-switcher/menu-items/auto-responder-menu-item.d.ts.map +0 -1
  87. package/dist/js/components/app-switcher/menu-items/keyWhere-menu-item.d.ts +0 -6
  88. package/dist/js/components/app-switcher/menu-items/keyWhere-menu-item.d.ts.map +0 -1
  89. package/dist/js/components/app-switcher/menu-items/menu-items.stories.d.ts +0 -17
  90. package/dist/js/components/app-switcher/menu-items/menu-items.stories.d.ts.map +0 -1
  91. package/dist/js/components/app-switcher/menu-items/reapit-forms-menu-item.d.ts +0 -6
  92. package/dist/js/components/app-switcher/menu-items/reapit-forms-menu-item.d.ts.map +0 -1
  93. package/dist/js/components/app-switcher/menu-items/reapit-letting-menu-item.d.ts +0 -6
  94. package/dist/js/components/app-switcher/menu-items/reapit-letting-menu-item.d.ts.map +0 -1
  95. package/dist/js/components/app-switcher/menu-items/reapit-pm-menu-item.d.ts +0 -6
  96. package/dist/js/components/app-switcher/menu-items/reapit-pm-menu-item.d.ts.map +0 -1
  97. package/dist/js/components/app-switcher/menu-items/reapit-proposal-menu-item.d.ts +0 -6
  98. package/dist/js/components/app-switcher/menu-items/reapit-proposal-menu-item.d.ts.map +0 -1
  99. package/dist/js/components/app-switcher/menu-items/reapit-sales-menu-item.d.ts +0 -6
  100. package/dist/js/components/app-switcher/menu-items/reapit-sales-menu-item.d.ts.map +0 -1
  101. package/dist/js/components/app-switcher/menu-items/reapit-websites-menu-item.d.ts +0 -6
  102. package/dist/js/components/app-switcher/menu-items/reapit-websites-menu-item.d.ts.map +0 -1
  103. package/dist/js/components/app-switcher/nav-icon-button/nav-icon.stories.d.ts +0 -11
  104. package/dist/js/components/app-switcher/nav-icon-button/nav-icon.stories.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.test.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/__test__/components/app-switcher/__test__/config.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=get-displayable-products-for-explore-group.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-displayable-products-for-explore-group.test.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/__test__/components/app-switcher/__test__/get-displayable-products-for-explore-group.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=get-displayable-products-for-your-apps-group.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-displayable-products-for-your-apps-group.test.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/__test__/components/app-switcher/__test__/get-displayable-products-for-your-apps-group.test.ts"],"names":[],"mappings":""}
@@ -1,8 +1,14 @@
1
- import { AppName } from '../appNames';
2
- type AppAvatarProps = {
3
- appName: AppName;
1
+ import { SupportedProductId } from '../config';
2
+ interface AppAvatarProps {
3
+ /** Whether the currently logged in user has access to the specified product or not */
4
4
  hasAccess: boolean;
5
- };
6
- export default function AppAvatar({ appName, hasAccess }: AppAvatarProps): import("react/jsx-runtime").JSX.Element;
5
+ /** The specific product whose avatar should be displayed. */
6
+ productId: SupportedProductId;
7
+ }
8
+ /**
9
+ * An avatar/logo for Reapit products. The visual appearance of the avatar changes based on the current user's
10
+ * access to the product. When user's do not have access, the avatar will be greyed out.
11
+ */
12
+ export declare function AppAvatar({ hasAccess, productId }: AppAvatarProps): import("react/jsx-runtime").JSX.Element;
7
13
  export {};
8
14
  //# sourceMappingURL=app-avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-avatar.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/app-avatar/components/app-switcher/app-avatar/app-avatar.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,cAAc,2CAoBvE"}
1
+ {"version":3,"file":"app-avatar.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/app-avatar/components/app-switcher/app-avatar/app-avatar.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEnD,UAAU,cAAc;IACtB,sFAAsF;IACtF,SAAS,EAAE,OAAO,CAAA;IAClB,6DAA6D;IAC7D,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,cAAc,2CAoBjE"}
@@ -1,8 +1,19 @@
1
+ import { AppAvatar } from './app-avatar';
1
2
  import { Meta, StoryObj } from '@storybook/react';
2
- import { default as AppAvatar } from './app-avatar';
3
3
  declare const meta: Meta<typeof AppAvatar>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
- export declare const BasicUsageWhenTheAvatarIsAccessible: Story;
7
- export declare const BasicUsageWhenTheAvatarIsInaccessible: Story;
6
+ /**
7
+ * When the user has access to the product, the avatar will appear in the primary colour.
8
+ */
9
+ export declare const Example: Story;
10
+ /**
11
+ * When the user does not have access to the product, the avatar will be greyed out.
12
+ */
13
+ export declare const Inaccessible: Story;
14
+ /**
15
+ * All supported products are displayed here. Each product has two avatars: one for when the user has access
16
+ * and one for when they do not.
17
+ */
18
+ export declare const AllProducts: Story;
8
19
  //# sourceMappingURL=app-avatar.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-avatar.stories.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/app-avatar/components/app-switcher/app-avatar/app-avatar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,SAAS,MAAM,cAAc,CAAA;AAapC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAUC,CAAA;AAElC,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,mCAAmC,EAAE,KAKjD,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,KAKnD,CAAA"}
1
+ {"version":3,"file":"app-avatar.stories.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/app-avatar/components/app-switcher/app-avatar/app-avatar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAKtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAUC,CAAA;AAElC,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KA0BzB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './app-avatar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/app-avatar/components/app-switcher/app-avatar/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
@@ -1,18 +1,29 @@
1
- import { HTMLAttributes } from 'react';
2
1
  import { AppSwitcherExploreMenuGroup } from './explore-menu-group';
2
+ import { AppSwitcherMenuItem } from './menu-item';
3
+ import { AppSwitcherProductMenuItem } from './product-menu-item';
3
4
  import { AppSwitcherYourAppsMenuGroup } from './your-apps-menu-group';
4
- declare function AppSwitcher({ children }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
5
- declare namespace AppSwitcher {
6
- var YourAppsMenuGroup: typeof AppSwitcherYourAppsMenuGroup;
5
+ import { ReactNode } from 'react';
6
+ interface AppSwitcherProps {
7
+ /**
8
+ * The menu groups and their items. Should typically be `AppSwitcher.ExploreMenuGroup`,
9
+ * `AppSwitcher.YourAppsMenuGroup`, and `AppSwitcher.ProductMenuItem` components */
10
+ children: ReactNode;
11
+ }
12
+ /**
13
+ * The App Switcher is a menu that enables users to switch between, or explore, Reapit products. It shows both
14
+ * the products the current user has access to (in the Your Apps group), and other apps from Reapit (in the
15
+ * Explore group).
16
+ */
17
+ export declare function AppSwitcher({ children }: AppSwitcherProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare namespace AppSwitcher {
19
+ var AppAvatar: typeof import("./app-avatar").AppAvatar;
20
+ var Divider: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
21
  var ExploreMenuGroup: typeof AppSwitcherExploreMenuGroup;
8
- var ReapitPMMenuItem: typeof import("./menu-items/reapit-pm-menu-item").default;
9
- var ReapitSalesMenuItem: typeof import("./menu-items/reapit-sales-menu-item").default;
10
- var ReapitLettingMenuItem: typeof import("./menu-items/reapit-letting-menu-item").default;
11
- var ReapitFormsMenuItem: typeof import("./menu-items/reapit-forms-menu-item").default;
12
- var ReapitWebsitesMenuItem: typeof import("./menu-items/reapit-websites-menu-item").default;
13
- var ReapitProposalsMenuItem: typeof import("./menu-items/reapit-proposal-menu-item").default;
14
- var KeyWhereMenuItem: typeof import("./menu-items/keyWhere-menu-item").default;
15
- var AutoResponderMenuItem: typeof import("./menu-items/auto-responder-menu-item").default;
22
+ var MenuItem: typeof AppSwitcherMenuItem;
23
+ var ProductMenuItem: typeof AppSwitcherProductMenuItem;
24
+ var YourAppsMenuGroup: typeof AppSwitcherYourAppsMenuGroup;
25
+ var getDisplayableProductsForExploreGroup: typeof import("./get-displayable-products-for-explore-group").getDisplayableProductsForExploreGroup;
26
+ var getDisplayableProductsForYourAppsGroup: typeof import("./get-displayable-products-for-your-apps-group").getDisplayableProductsForYourAppsGroup;
16
27
  }
17
- export { AppSwitcher };
28
+ export {};
18
29
  //# sourceMappingURL=app-switcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-switcher.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/app-switcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAUlE,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAErE,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,cAAc,CAAC,cAAc,CAAC,2CAShE;kBATQ,WAAW;;;;;;;;;;;;AAuBpB,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"app-switcher.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/app-switcher.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAMrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,UAAU,gBAAgB;IACxB;;uFAEmF;IACnF,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CASzD;yBATe,WAAW"}
@@ -1,11 +1,73 @@
1
- import { Decorator, StoryObj } from '@storybook/react';
2
1
  import { AppSwitcher } from './app-switcher';
2
+ import { StoryObj } from '@storybook/react';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: typeof AppSwitcher;
6
- decorators: Decorator[];
6
+ argTypes: {
7
+ children: {
8
+ control: boolean;
9
+ };
10
+ };
7
11
  };
8
12
  export default meta;
9
13
  type Story = StoryObj<typeof meta>;
10
- export declare const Default: Story;
14
+ /**
15
+ * The UI for the App Switcher is built by composing subcomponents like `AppSwitcher.ProductMenuItem`,
16
+ * `AppSwitcher.YourAppsMenuGroup`, `AppSwitcher.ExploreMenuGroup`, and `AppSwitcher.Divider`. This composition
17
+ * is manual, but it's important to note that the order of the products in the menu, as well as which products
18
+ * are approved for display is not handled automatically by these subcomponents.
19
+ *
20
+ * Instead, there are two utility functions, `getDisplayableProductsForYourAppsGroup` and
21
+ * `getDisplayableProductsForExploreGroup`, that can be used to obtain the list of product IDs for each group based
22
+ * on the currently logged-in user has access to, according to Reapit Connect. A practical exmaple of how to do this
23
+ * is shown in the "All Accessible" and "None Accessible" stories below.
24
+ */
25
+ export declare const Example: Story;
26
+ /**
27
+ * When the user has access to all "displayable" products, they will all be displayed in the Your Apps menu group.
28
+ * A user can have access to more products than those that are supported by the App Switcher, so the list of
29
+ * product for display in the "Your Apps" menu group should be filtered using
30
+ * `getDisplayableProductsForYourAppsGroup`.
31
+ *
32
+ * The following snippet shows how `getDisplayableProductsForYourAppsGroup` can be used to render the Your Apps
33
+ * menu group with the correct products. This is the same logic employed by this story.
34
+ *
35
+ * ```tsx
36
+ * const ids = AppSwitcher.getDisplayableProductsForYourAppsGroup(accessibleProductIds)
37
+ *
38
+ * return ids.length > 0 && (
39
+ * <AppSwitcher.ExploreMenuGroup>
40
+ * {ids.map((productId) => (
41
+ * <AppSwitcher.Product key={productId} productId={productId} url={href} />
42
+ * ))}
43
+ * </AppSwitcher.ExploreMenuGroup>
44
+ * )
45
+ * ```
46
+ */
47
+ export declare const AllAccessible: StoryObj<{
48
+ accessibleProductIds: string[];
49
+ }>;
50
+ /**
51
+ * If the user has access to none of the "displayable" products, all displayable products will be shown in
52
+ * the Explore menu group. This scenario should not be encountered in practice, as the `AppSwitcher` should only
53
+ * be visible to users who have access to at least one product that is integrated with Reapit Connect.
54
+ *
55
+ * The following example shows how `getDisplayableProductsForExploreGroup` can be used to render the Your Apps
56
+ * menu group with the correct products. This is the same logic employed by this story.
57
+ *
58
+ * ```tsx
59
+ * const ids = AppSwitcher.getDisplayableProductsForExploreGroup(accessibleProductIds)
60
+ *
61
+ * return ids.length > 0 && (
62
+ * <AppSwitcher.YourAppsMenuGroup>
63
+ * {ids.map((productId) => (
64
+ * <AppSwitcher.Product key={productId} productId={productId} url={href} />
65
+ * ))}
66
+ * </AppSwitcher.YourAppsMenuGroup>
67
+ * )
68
+ * ```
69
+ */
70
+ export declare const NoneAccessible: StoryObj<{
71
+ accessibleProductIds: string[];
72
+ }>;
11
73
  //# sourceMappingURL=app-switcher.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-switcher.stories.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/app-switcher.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAW5C,QAAA,MAAM,IAAI;;;;CAI0B,CAAA;AAEpC,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAOlC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAA"}
1
+ {"version":3,"file":"app-switcher.stories.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/app-switcher.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAG5C,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,QAAA,MAAM,IAAI;;;;;;;;CAQ0B,CAAA;AAEpC,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAIlC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC;IAAE,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAAE,CAuCtE,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC;IAAE,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAAE,CAKvE,CAAA"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * React Connect product IDs that are supported by the App Switcher. A supported product has a logo available
3
+ * through `AppAvatar` and a related config in the `productConfigs` object.
4
+ */
5
+ export type SupportedProductId = 'agentBox' | 'autoResponder' | 'consoleCloud' | 'ireWeb' | 'keywhere' | 'reapitForms' | 'reapitWebsites' | 'reapitProposals';
6
+ export interface ProductConfig {
7
+ appName: string;
8
+ supplementaryInfo: string;
9
+ }
10
+ /**
11
+ * The configuration for each product that is supported by the App Switcher.
12
+ *
13
+ * **IMPORTANT:** Products should only be added here if they are intended to be available in the App Switcher
14
+ * in the future. Similarly, product config content for existing products should only be changed if explicitly
15
+ * approved by the Product and Design teams.
16
+ */
17
+ export declare const productConfigs: {
18
+ readonly consoleCloud: {
19
+ readonly appName: "Reapit PM";
20
+ readonly supplementaryInfo: "Property Management";
21
+ };
22
+ readonly agentBox: {
23
+ readonly appName: "Reapit Sales";
24
+ readonly supplementaryInfo: "Real Estate CRM";
25
+ };
26
+ readonly ireWeb: {
27
+ readonly appName: "Reapit Lettings";
28
+ readonly supplementaryInfo: "Lettings Management";
29
+ };
30
+ readonly reapitForms: {
31
+ readonly appName: "Reapit Forms";
32
+ readonly supplementaryInfo: "Documents & Digital Signing";
33
+ };
34
+ readonly reapitWebsites: {
35
+ readonly appName: "Reapit Websites";
36
+ readonly supplementaryInfo: "Bespoke Website Design";
37
+ };
38
+ readonly reapitProposals: {
39
+ readonly appName: "Reapit Proposals";
40
+ readonly supplementaryInfo: "Interactive Digital Proposals";
41
+ };
42
+ readonly keywhere: {
43
+ readonly appName: "KeyWhere";
44
+ readonly supplementaryInfo: "Real-time Key Management";
45
+ };
46
+ readonly autoResponder: {
47
+ readonly appName: "Auto Responder";
48
+ readonly supplementaryInfo: "Automated Email Marketing";
49
+ };
50
+ };
51
+ /**
52
+ * The order of products in this array determines the order they will be displayed in the App Switcher.
53
+ * This array also implicitly defines the subset of supported products that are also "displayable". That is,
54
+ * the products that are permitted to be displayed in the App Switcher across all consumers of the App Switcher
55
+ * component.
56
+ *
57
+ * **IMPORTANT:** DO NOT add products to this array unless they are Reapit Connect SSO capable and the
58
+ * product is approved for use via the App Switcher. Further, the order of the products in this array is defined
59
+ * by the Product and Design teams and should not be changed without their explicit approval.
60
+ */
61
+ export declare const productDisplayOrder_DO_NOT_ADD_PRODUCTS_TO_THIS_UNLESS_APPROVED_FOR_DISPLAY_AND_SSO_CAPABLE: ["ireWeb", "consoleCloud", "keywhere"];
62
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,eAAe,GACf,cAAc,GACd,QAAQ,GACR,UAAU,GACV,aAAa,GACb,gBAAgB,GAChB,iBAAiB,CAAA;AAErB,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BmC,CAAA;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,2FAA2F,wCAI/D,CAAA"}
@@ -1,7 +1,7 @@
1
- import { default as React } from 'react';
2
- type AppSwitcherMenuGroupProps = {
3
- children: React.ReactNode;
4
- };
1
+ import { ReactNode } from 'react';
2
+ interface AppSwitcherMenuGroupProps {
3
+ children: ReactNode;
4
+ }
5
5
  declare function AppSwitcherExploreMenuGroup({ children }: AppSwitcherMenuGroupProps): import("react/jsx-runtime").JSX.Element;
6
6
  export { AppSwitcherExploreMenuGroup };
7
7
  //# sourceMappingURL=explore-menu-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"explore-menu-group.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/explore-menu-group/components/app-switcher/explore-menu-group/explore-menu-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,iBAAS,2BAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAM3E;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAA"}
1
+ {"version":3,"file":"explore-menu-group.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/explore-menu-group/components/app-switcher/explore-menu-group/explore-menu-group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,UAAU,yBAAyB;IACjC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,iBAAS,2BAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAQ3E;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAA"}
@@ -3,6 +3,11 @@ import { AppSwitcherExploreMenuGroup } from './explore-menu-group';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: typeof AppSwitcherExploreMenuGroup;
6
+ argTypes: {
7
+ children: {
8
+ control: boolean;
9
+ };
10
+ };
6
11
  decorators: Decorator[];
7
12
  };
8
13
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"explore-menu-group.stories.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/explore-menu-group/components/app-switcher/explore-menu-group/explore-menu-group.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAUlE,QAAA,MAAM,IAAI;;;;CAI0C,CAAA;AAEpD,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAA"}
1
+ {"version":3,"file":"explore-menu-group.stories.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/explore-menu-group/components/app-switcher/explore-menu-group/explore-menu-group.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAUlE,QAAA,MAAM,IAAI;;;;;;;;;CAS0C,CAAA;AAEpD,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { SupportedProductId } from './config';
2
+ /**
3
+ * Returns the product IDs that should be displayed in the "Explore" menu group of the app switcher. These will
4
+ * be the products that the user DOES NOT have access to according to Reapit Connect. If the list includes product
5
+ * IDs that are not supported by, or approved for display in, the app switcher, those IDs will be silently ignored.
6
+ */
7
+ export declare function getDisplayableProductsForExploreGroup(accessibleProductIds: string[]): SupportedProductId[];
8
+ //# sourceMappingURL=get-displayable-products-for-explore-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-displayable-products-for-explore-group.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/get-displayable-products-for-explore-group.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAElD;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,oBAAoB,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAI1G"}
@@ -0,0 +1,8 @@
1
+ import { SupportedProductId } from './config';
2
+ /**
3
+ * Returns the product IDs that should be displayed in the "Your Apps" menu group of the app switcher. These will
4
+ * be the products that the user has access to according to Reapit Connect. If the list includes product IDs that are
5
+ * not supported by, or approved for display in, the app switcher, those IDs will be silently ignored.
6
+ */
7
+ export declare function getDisplayableProductsForYourAppsGroup(accessibleProductIds: string[]): SupportedProductId[];
8
+ //# sourceMappingURL=get-displayable-products-for-your-apps-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-displayable-products-for-your-apps-group.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/get-displayable-products-for-your-apps-group.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAElD;;;;GAIG;AACH,wBAAgB,sCAAsC,CAAC,oBAAoB,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAI3G"}
@@ -1,3 +1,12 @@
1
1
  export * from './styles';
2
+ export * from './app-avatar';
3
+ export * from './app-switcher';
4
+ export * from './explore-menu-group';
5
+ export * from './get-displayable-products-for-explore-group';
6
+ export * from './get-displayable-products-for-your-apps-group';
7
+ export * from './menu-group-has-access-context';
2
8
  export * from './menu-item';
9
+ export * from './nav-icon-button';
10
+ export * from './product-menu-item';
11
+ export * from './your-apps-menu-group';
3
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,8CAA8C,CAAA;AAC5D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,iCAAiC,CAAA;AAC/C,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const AppSwitcherMenuGroupHasAccessContext: import('react').Context<boolean>;
2
+ export declare function useAppSwitcherMenuGroupHasAccessContext(): boolean;
3
+ //# sourceMappingURL=menu-group-has-access-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-group-has-access-context.d.ts","sourceRoot":"/","sources":["../../../../components/app-switcher/components/app-switcher/menu-group-has-access-context.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,oCAAoC,kCAAgC,CAAA;AAEjF,wBAAgB,uCAAuC,YAEtD"}
@@ -1,9 +1,18 @@
1
- type AppSwitcherMenuItemProps = {
2
- logo: React.ReactNode;
3
- appName: string;
4
- description: string;
5
- url: string;
6
- };
7
- declare function AppSwitcherMenuItem({ logo, appName, description, url }: AppSwitcherMenuItemProps): import("react/jsx-runtime").JSX.Element;
8
- export { AppSwitcherMenuItem };
1
+ import { ProductConfig } from '../config';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ type AttributesToOmit = 'aria-labelledby' | 'aria-describedby';
4
+ export interface AppSwitcherMenuItemProps extends ProductConfig, Omit<HTMLAttributes<HTMLAnchorElement>, AttributesToOmit> {
5
+ avatar: ReactNode;
6
+ href: string;
7
+ }
8
+ /**
9
+ * A basic menu item for the App Switcher. Displays a product's logo, name, and supplementary info. Typically,
10
+ * consumers will use the higher-level `AppSwitcher.ProductMenuItem` component instead, as it provides a more
11
+ * convenient "on-rails" interface that ties a specific product ID to the approved logo, name and
12
+ * supplementary info.
13
+ *
14
+ * The product's URL is always opened in a new tab.
15
+ */
16
+ export declare function AppSwitcherMenuItem({ avatar: logo, appName, href, supplementaryInfo, ...rest }: AppSwitcherMenuItemProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
9
18
  //# sourceMappingURL=menu-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/menu-item/components/app-switcher/menu-item/menu-item.tsx"],"names":[],"mappings":"AAQA,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,iBAAS,mBAAmB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,wBAAwB,2CAUzF;AACD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"menu-item.d.ts","sourceRoot":"/","sources":["../../../../../components/app-switcher/menu-item/components/app-switcher/menu-item/menu-item.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,KAAK,gBAAgB,GAAG,iBAAiB,GAAG,kBAAkB,CAAA;AAE9D,MAAM,WAAW,wBACf,SAAQ,aAAa,EACnB,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IAC3D,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EAAE,IAAI,EACZ,OAAO,EACP,IAAI,EACJ,iBAAiB,EACjB,GAAG,IAAI,EACR,EAAE,wBAAwB,2CAoB1B"}