@lokalise/harmony 1.32.1 → 1.33.0-exp-louis-27.0.0.1

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 (92) hide show
  1. package/dist/harmony104.cjs.map +1 -1
  2. package/dist/harmony104.mjs.map +1 -1
  3. package/dist/harmony58.cjs +1 -18
  4. package/dist/harmony58.cjs.map +1 -1
  5. package/dist/harmony58.mjs +1 -18
  6. package/dist/harmony58.mjs.map +1 -1
  7. package/dist/harmony70.cjs +1 -1
  8. package/dist/harmony70.mjs +1 -1
  9. package/dist/harmony71.cjs +1 -1
  10. package/dist/harmony71.mjs +1 -1
  11. package/dist/harmony72.cjs +1 -1
  12. package/dist/harmony72.mjs +1 -1
  13. package/dist/harmony73.cjs +2 -2
  14. package/dist/harmony73.mjs +2 -2
  15. package/dist/harmony74.cjs +2 -2
  16. package/dist/harmony74.mjs +2 -2
  17. package/dist/harmony75.cjs +2 -2
  18. package/dist/harmony75.mjs +2 -2
  19. package/dist/harmony76.cjs +2 -2
  20. package/dist/harmony76.mjs +2 -2
  21. package/dist/harmony77.cjs +3 -3
  22. package/dist/harmony77.mjs +3 -3
  23. package/dist/harmony81.cjs +2 -2
  24. package/dist/harmony81.mjs +2 -2
  25. package/dist/harmony83.cjs +2 -2
  26. package/dist/harmony83.mjs +2 -2
  27. package/dist/harmony84.cjs +6 -12
  28. package/dist/harmony84.cjs.map +1 -1
  29. package/dist/harmony84.mjs +5 -11
  30. package/dist/harmony84.mjs.map +1 -1
  31. package/dist/harmony85.cjs +6 -9
  32. package/dist/harmony85.cjs.map +1 -1
  33. package/dist/harmony85.mjs +6 -9
  34. package/dist/harmony85.mjs.map +1 -1
  35. package/dist/harmony86.cjs +10 -12
  36. package/dist/harmony86.cjs.map +1 -1
  37. package/dist/harmony86.mjs +9 -11
  38. package/dist/harmony86.mjs.map +1 -1
  39. package/dist/harmony87.cjs +57 -21
  40. package/dist/harmony87.cjs.map +1 -1
  41. package/dist/harmony87.mjs +56 -20
  42. package/dist/harmony87.mjs.map +1 -1
  43. package/dist/harmony88.cjs +42 -6
  44. package/dist/harmony88.cjs.map +1 -1
  45. package/dist/harmony88.mjs +41 -5
  46. package/dist/harmony88.mjs.map +1 -1
  47. package/dist/harmony89.cjs +6 -10
  48. package/dist/harmony89.cjs.map +1 -1
  49. package/dist/harmony89.mjs +5 -9
  50. package/dist/harmony89.mjs.map +1 -1
  51. package/dist/harmony90.cjs +6 -6
  52. package/dist/harmony90.mjs +6 -6
  53. package/dist/harmony91.cjs +24 -57
  54. package/dist/harmony91.cjs.map +1 -1
  55. package/dist/harmony91.mjs +23 -56
  56. package/dist/harmony91.mjs.map +1 -1
  57. package/dist/harmony92.cjs +6 -42
  58. package/dist/harmony92.cjs.map +1 -1
  59. package/dist/harmony92.mjs +5 -41
  60. package/dist/harmony92.mjs.map +1 -1
  61. package/dist/harmony93.cjs +21 -5
  62. package/dist/harmony93.cjs.map +1 -1
  63. package/dist/harmony93.mjs +21 -5
  64. package/dist/harmony93.mjs.map +1 -1
  65. package/dist/harmony94.cjs +7 -4
  66. package/dist/harmony94.cjs.map +1 -1
  67. package/dist/harmony94.mjs +7 -4
  68. package/dist/harmony94.mjs.map +1 -1
  69. package/dist/harmony95.cjs +12 -24
  70. package/dist/harmony95.cjs.map +1 -1
  71. package/dist/harmony95.mjs +11 -23
  72. package/dist/harmony95.mjs.map +1 -1
  73. package/dist/harmony96.cjs +9 -3
  74. package/dist/harmony96.cjs.map +1 -1
  75. package/dist/harmony96.mjs +9 -3
  76. package/dist/harmony96.mjs.map +1 -1
  77. package/dist/harmony97.cjs +9 -19
  78. package/dist/harmony97.cjs.map +1 -1
  79. package/dist/harmony97.mjs +11 -21
  80. package/dist/harmony97.mjs.map +1 -1
  81. package/dist/harmony98.cjs +20 -11
  82. package/dist/harmony98.cjs.map +1 -1
  83. package/dist/harmony98.mjs +20 -11
  84. package/dist/harmony98.mjs.map +1 -1
  85. package/dist/types/src/features/publicApi/hooks/useGetProjectPermissionMetaQuery.d.ts +3 -3
  86. package/dist/types/src/features/publicApi/hooks/useListPermissionTemplates.d.ts +1 -1
  87. package/dist/types/src/features/publicApi/permissionTemplates.d.ts +5 -5
  88. package/dist/types/src/features/publicApi/projects.d.ts +15 -15
  89. package/dist/types/src/features/publicApi/types/permissionTemplateTypes.d.ts +8 -8
  90. package/dist/types/src/features/publicApi/types/permissionTypes.d.ts +4 -4
  91. package/dist/types/src/features/publicApi/types/projectTypes.d.ts +15 -15
  92. package/package.json +2 -2
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const ProfileMenuContext = require("./harmony93.cjs");
4
+ const ProfileMenuContext = require("./harmony89.cjs");
5
5
  const TeamMenuItem = require("./harmony75.cjs");
6
- const TeamSwitch_module = require("./harmony96.cjs");
6
+ const TeamSwitch_module = require("./harmony92.cjs");
7
7
  const TeamSwitch = ({ onSwitchTeam }) => {
8
8
  const { otherTeams } = ProfileMenuContext.useProfileMenu();
9
9
  if (otherTeams.length === 0) {
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useProfileMenu } from "./harmony93.mjs";
2
+ import { useProfileMenu } from "./harmony89.mjs";
3
3
  import { TeamMenuItem } from "./harmony75.mjs";
4
- import styles from "./harmony96.mjs";
4
+ import styles from "./harmony92.mjs";
5
5
  const TeamSwitch = ({ onSwitchTeam }) => {
6
6
  const { otherTeams } = useProfileMenu();
7
7
  if (otherTeams.length === 0) {
@@ -3,9 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const louis = require("@lokalise/louis");
5
5
  const plan = require("./harmony8.cjs");
6
- const UpgradeIcon = require("./harmony97.cjs");
7
- const ProfileMenuContext = require("./harmony93.cjs");
8
- const UpgradeMenuItem_module = require("./harmony98.cjs");
6
+ const UpgradeIcon = require("./harmony93.cjs");
7
+ const ProfileMenuContext = require("./harmony89.cjs");
8
+ const UpgradeMenuItem_module = require("./harmony94.cjs");
9
9
  const UpgradeMenuItem = ({ upgradeOptionHref }) => {
10
10
  const { planId, trialDaysLeft, showUpgradeCta } = ProfileMenuContext.useProfileMenu();
11
11
  if (!showUpgradeCta) {
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { MenuItem } from "@lokalise/louis";
3
3
  import { isFreePlan } from "./harmony8.mjs";
4
- import { UpgradeIcon } from "./harmony97.mjs";
5
- import { useProfileMenu } from "./harmony93.mjs";
6
- import styles from "./harmony98.mjs";
4
+ import { UpgradeIcon } from "./harmony93.mjs";
5
+ import { useProfileMenu } from "./harmony89.mjs";
6
+ import styles from "./harmony94.mjs";
7
7
  const UpgradeMenuItem = ({ upgradeOptionHref }) => {
8
8
  const { planId, trialDaysLeft, showUpgradeCta } = useProfileMenu();
9
9
  if (!showUpgradeCta) {
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const louis = require("@lokalise/louis");
5
5
  const clsx = require("./harmony66.cjs");
6
6
  const React = require("react");
7
- const NavItemContents = require("./harmony86.cjs");
8
- const styles_module = require("./harmony87.cjs");
7
+ const NavItemContents = require("./harmony97.cjs");
8
+ const styles_module = require("./harmony98.cjs");
9
9
  const NavigationTabsItem = React.forwardRef(
10
10
  ({ label, href = "", disabled = false, badge, onClick, novel }, ref) => /* @__PURE__ */ jsxRuntime.jsx(louis.Tooltip, { tooltip: "You do not have access to this function", show: disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
11
11
  "div",
@@ -2,8 +2,8 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { Tooltip } from "@lokalise/louis";
3
3
  import { clsx } from "./harmony66.mjs";
4
4
  import { forwardRef } from "react";
5
- import { NavItemContents } from "./harmony86.mjs";
6
- import classes from "./harmony87.mjs";
5
+ import { NavItemContents } from "./harmony97.mjs";
6
+ import classes from "./harmony98.mjs";
7
7
  const NavigationTabsItem = forwardRef(
8
8
  ({ label, href = "", disabled = false, badge, onClick, novel }, ref) => /* @__PURE__ */ jsx(Tooltip, { tooltip: "You do not have access to this function", show: disabled, children: /* @__PURE__ */ jsx(
9
9
  "div",
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const louis = require("@lokalise/louis");
5
5
  const reactTable = require("@tanstack/react-table");
6
6
  const clsx = require("./harmony66.cjs");
7
- const SortingIcon = require("./harmony84.cjs");
8
- const TableHeaderCell_module = require("./harmony85.cjs");
7
+ const SortingIcon = require("./harmony95.cjs");
8
+ const TableHeaderCell_module = require("./harmony96.cjs");
9
9
  const Cell = ({ children, align, className }) => {
10
10
  return /* @__PURE__ */ jsxRuntime.jsx(
11
11
  louis.TableHeaderCell,
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { TableHeaderCell as TableHeaderCell$1 } from "@lokalise/louis";
3
3
  import { flexRender } from "@tanstack/react-table";
4
4
  import { clsx } from "./harmony66.mjs";
5
- import { SortingIcon } from "./harmony84.mjs";
6
- import styles from "./harmony85.mjs";
5
+ import { SortingIcon } from "./harmony95.mjs";
6
+ import styles from "./harmony96.mjs";
7
7
  const Cell = ({ children, align, className }) => {
8
8
  return /* @__PURE__ */ jsx(
9
9
  TableHeaderCell$1,
@@ -1,15 +1,9 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const louis = require("@lokalise/louis");
5
- const SortingIcon = ({ direction }) => {
6
- if (direction === "asc") {
7
- return /* @__PURE__ */ jsxRuntime.jsx(louis.SortAscendingIcon, { ariaLabel: "ascending sorting" });
8
- }
9
- if (direction === "desc") {
10
- return /* @__PURE__ */ jsxRuntime.jsx(louis.SortDescendingIcon, { ariaLabel: "descending sorting" });
11
- }
12
- return /* @__PURE__ */ jsxRuntime.jsx(louis.SortIcon, { ariaLabel: "sorting" });
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const logoLink = "_logoLink_1baxb_1";
4
+ const styles = {
5
+ logoLink
13
6
  };
14
- exports.SortingIcon = SortingIcon;
7
+ exports.default = styles;
8
+ exports.logoLink = logoLink;
15
9
  //# sourceMappingURL=harmony84.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony84.cjs","sources":["../src/components/Table/components/SortingIcon.tsx"],"sourcesContent":["import { SortAscendingIcon, SortDescendingIcon, SortIcon } from '@lokalise/louis'\nimport type { SortDirection } from '@tanstack/react-table'\n\ntype SortingIconProps = {\n\tdirection: SortDirection | false\n}\n\nexport const SortingIcon = ({ direction }: SortingIconProps) => {\n\tif (direction === 'asc') {\n\t\treturn <SortAscendingIcon ariaLabel=\"ascending sorting\" />\n\t}\n\tif (direction === 'desc') {\n\t\treturn <SortDescendingIcon ariaLabel=\"descending sorting\" />\n\t}\n\treturn <SortIcon ariaLabel=\"sorting\" />\n}\n"],"names":["jsx","SortAscendingIcon","SortDescendingIcon","SortIcon"],"mappings":";;;;AAOO,MAAM,cAAc,CAAC,EAAE,gBAAkC;AAC/D,MAAI,cAAc,OAAO;AACjB,WAAAA,2BAAA,IAACC,MAAkB,mBAAA,EAAA,WAAU,oBAAoB,CAAA;AAAA,EAAA;AAEzD,MAAI,cAAc,QAAQ;AAClB,WAAAD,2BAAA,IAACE,MAAmB,oBAAA,EAAA,WAAU,qBAAqB,CAAA;AAAA,EAAA;AAEpD,SAAAF,2BAAA,IAACG,MAAS,UAAA,EAAA,WAAU,UAAU,CAAA;AACtC;;"}
1
+ {"version":3,"file":"harmony84.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,15 +1,9 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { SortAscendingIcon, SortDescendingIcon, SortIcon } from "@lokalise/louis";
3
- const SortingIcon = ({ direction }) => {
4
- if (direction === "asc") {
5
- return /* @__PURE__ */ jsx(SortAscendingIcon, { ariaLabel: "ascending sorting" });
6
- }
7
- if (direction === "desc") {
8
- return /* @__PURE__ */ jsx(SortDescendingIcon, { ariaLabel: "descending sorting" });
9
- }
10
- return /* @__PURE__ */ jsx(SortIcon, { ariaLabel: "sorting" });
1
+ const logoLink = "_logoLink_1baxb_1";
2
+ const styles = {
3
+ logoLink
11
4
  };
12
5
  export {
13
- SortingIcon
6
+ styles as default,
7
+ logoLink
14
8
  };
15
9
  //# sourceMappingURL=harmony84.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony84.mjs","sources":["../src/components/Table/components/SortingIcon.tsx"],"sourcesContent":["import { SortAscendingIcon, SortDescendingIcon, SortIcon } from '@lokalise/louis'\nimport type { SortDirection } from '@tanstack/react-table'\n\ntype SortingIconProps = {\n\tdirection: SortDirection | false\n}\n\nexport const SortingIcon = ({ direction }: SortingIconProps) => {\n\tif (direction === 'asc') {\n\t\treturn <SortAscendingIcon ariaLabel=\"ascending sorting\" />\n\t}\n\tif (direction === 'desc') {\n\t\treturn <SortDescendingIcon ariaLabel=\"descending sorting\" />\n\t}\n\treturn <SortIcon ariaLabel=\"sorting\" />\n}\n"],"names":[],"mappings":";;AAOO,MAAM,cAAc,CAAC,EAAE,gBAAkC;AAC/D,MAAI,cAAc,OAAO;AACjB,WAAA,oBAAC,mBAAkB,EAAA,WAAU,oBAAoB,CAAA;AAAA,EAAA;AAEzD,MAAI,cAAc,QAAQ;AAClB,WAAA,oBAAC,oBAAmB,EAAA,WAAU,qBAAqB,CAAA;AAAA,EAAA;AAEpD,SAAA,oBAAC,UAAS,EAAA,WAAU,UAAU,CAAA;AACtC;"}
1
+ {"version":3,"file":"harmony84.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const headerSortButton = "_headerSortButton_b5tlh_1";
4
- const centeredCell = "_centeredCell_b5tlh_15";
5
- const rightAlignedCell = "_rightAlignedCell_b5tlh_19";
3
+ const link = "_link_18vhx_1";
4
+ const active = "_active_18vhx_18";
6
5
  const styles = {
7
- headerSortButton,
8
- centeredCell,
9
- rightAlignedCell
6
+ link,
7
+ active
10
8
  };
11
- exports.centeredCell = centeredCell;
9
+ exports.active = active;
12
10
  exports.default = styles;
13
- exports.headerSortButton = headerSortButton;
14
- exports.rightAlignedCell = rightAlignedCell;
11
+ exports.link = link;
15
12
  //# sourceMappingURL=harmony85.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony85.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony85.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,15 +1,12 @@
1
- const headerSortButton = "_headerSortButton_b5tlh_1";
2
- const centeredCell = "_centeredCell_b5tlh_15";
3
- const rightAlignedCell = "_rightAlignedCell_b5tlh_19";
1
+ const link = "_link_18vhx_1";
2
+ const active = "_active_18vhx_18";
4
3
  const styles = {
5
- headerSortButton,
6
- centeredCell,
7
- rightAlignedCell
4
+ link,
5
+ active
8
6
  };
9
7
  export {
10
- centeredCell,
8
+ active,
11
9
  styles as default,
12
- headerSortButton,
13
- rightAlignedCell
10
+ link
14
11
  };
15
12
  //# sourceMappingURL=harmony85.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony85.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"harmony85.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const louis = require("@lokalise/louis");
5
- const styles_module = require("./harmony87.cjs");
6
- const NavItemContents = ({ label, badge, novel }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
7
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
9
- !!badge && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module.default.badge, "aria-label": `${badge} items requiring attention`, children: badge > 9 ? "9+" : badge })
10
- ] }),
11
- !!novel && /* @__PURE__ */ jsxRuntime.jsx(louis.Tag, { className: styles_module.default.tag, children: novel })
12
- ] });
13
- exports.NavItemContents = NavItemContents;
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const dropdownButton = "_dropdownButton_1naek_1";
4
+ const dropdownButtonActive = "_dropdownButtonActive_1naek_19";
5
+ const styles = {
6
+ dropdownButton,
7
+ dropdownButtonActive
8
+ };
9
+ exports.default = styles;
10
+ exports.dropdownButton = dropdownButton;
11
+ exports.dropdownButtonActive = dropdownButtonActive;
14
12
  //# sourceMappingURL=harmony86.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony86.cjs","sources":["../src/components/NavigationPanel/components/NavigationTabs/NavigationTabsItem/NavItemContents.tsx"],"sourcesContent":["import { Tag } from '@lokalise/louis'\n\nimport classes from './styles.module.css'\n\ninterface NavItemContentProps {\n\tlabel: string\n\tbadge?: number\n\tnovel?: string\n}\nexport const NavItemContents = ({ label, badge, novel }: NavItemContentProps) => (\n\t<div className=\"flex gap-1\">\n\t\t<div>\n\t\t\t<span>{label}</span>\n\t\t\t{!!badge && (\n\t\t\t\t<div className={classes.badge} aria-label={`${badge} items requiring attention`}>\n\t\t\t\t\t{badge > 9 ? '9+' : badge}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t\t{!!novel && <Tag className={classes.tag}>{novel}</Tag>}\n\t</div>\n)\n"],"names":["jsxs","jsx","classes","Tag"],"mappings":";;;;;AASa,MAAA,kBAAkB,CAAC,EAAE,OAAO,OAAO,YAC/CA,2BAAA,KAAC,OAAI,EAAA,WAAU,cACd,UAAA;AAAA,EAAAA,gCAAC,OACA,EAAA,UAAA;AAAA,IAAAC,2BAAAA,IAAC,UAAM,UAAM,MAAA,CAAA;AAAA,IACZ,CAAC,CAAC,SACFA,+BAAC,SAAI,WAAWC,cAAA,QAAQ,OAAO,cAAY,GAAG,KAAK,8BACjD,UAAQ,QAAA,IAAI,OAAO,MACrB,CAAA;AAAA,EAAA,GAEF;AAAA,EACC,CAAC,CAAC,SAASD,2BAAA,IAACE,aAAI,WAAWD,sBAAQ,KAAM,UAAM,MAAA,CAAA;AAAA,EACjD,CAAA;;"}
1
+ {"version":3,"file":"harmony86.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,14 +1,12 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Tag } from "@lokalise/louis";
3
- import classes from "./harmony87.mjs";
4
- const NavItemContents = ({ label, badge, novel }) => /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
5
- /* @__PURE__ */ jsxs("div", { children: [
6
- /* @__PURE__ */ jsx("span", { children: label }),
7
- !!badge && /* @__PURE__ */ jsx("div", { className: classes.badge, "aria-label": `${badge} items requiring attention`, children: badge > 9 ? "9+" : badge })
8
- ] }),
9
- !!novel && /* @__PURE__ */ jsx(Tag, { className: classes.tag, children: novel })
10
- ] });
1
+ const dropdownButton = "_dropdownButton_1naek_1";
2
+ const dropdownButtonActive = "_dropdownButtonActive_1naek_19";
3
+ const styles = {
4
+ dropdownButton,
5
+ dropdownButtonActive
6
+ };
11
7
  export {
12
- NavItemContents
8
+ styles as default,
9
+ dropdownButton,
10
+ dropdownButtonActive
13
11
  };
14
12
  //# sourceMappingURL=harmony86.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony86.mjs","sources":["../src/components/NavigationPanel/components/NavigationTabs/NavigationTabsItem/NavItemContents.tsx"],"sourcesContent":["import { Tag } from '@lokalise/louis'\n\nimport classes from './styles.module.css'\n\ninterface NavItemContentProps {\n\tlabel: string\n\tbadge?: number\n\tnovel?: string\n}\nexport const NavItemContents = ({ label, badge, novel }: NavItemContentProps) => (\n\t<div className=\"flex gap-1\">\n\t\t<div>\n\t\t\t<span>{label}</span>\n\t\t\t{!!badge && (\n\t\t\t\t<div className={classes.badge} aria-label={`${badge} items requiring attention`}>\n\t\t\t\t\t{badge > 9 ? '9+' : badge}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t\t{!!novel && <Tag className={classes.tag}>{novel}</Tag>}\n\t</div>\n)\n"],"names":[],"mappings":";;;AASa,MAAA,kBAAkB,CAAC,EAAE,OAAO,OAAO,YAC/C,qBAAC,OAAI,EAAA,WAAU,cACd,UAAA;AAAA,EAAA,qBAAC,OACA,EAAA,UAAA;AAAA,IAAA,oBAAC,UAAM,UAAM,MAAA,CAAA;AAAA,IACZ,CAAC,CAAC,SACF,oBAAC,SAAI,WAAW,QAAQ,OAAO,cAAY,GAAG,KAAK,8BACjD,UAAQ,QAAA,IAAI,OAAO,MACrB,CAAA;AAAA,EAAA,GAEF;AAAA,EACC,CAAC,CAAC,SAAS,oBAAC,OAAI,WAAW,QAAQ,KAAM,UAAM,MAAA,CAAA;AAAA,EACjD,CAAA;"}
1
+ {"version":3,"file":"harmony86.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,24 +1,60 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const badge = "_badge_1pc1v_1";
4
- const tag = "_tag_1pc1v_15";
5
- const withNavLinkStyle = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21";
6
- const disabled = "_disabled_1pc1v_57";
7
- const projectNavigationItem = "_projectNavigationItem_1pc1v_61";
8
- const projectNavigationItemDisabled = "_projectNavigationItemDisabled_1pc1v_67";
9
- const classes = {
10
- badge,
11
- tag,
12
- withNavLinkStyle,
13
- disabled,
14
- projectNavigationItem,
15
- projectNavigationItemDisabled
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const louis = require("@lokalise/louis");
5
+ const clsx = require("./harmony66.cjs");
6
+ const UpgradeIcon = require("./harmony93.cjs");
7
+ const ProfileMenuContent_module = require("./harmony102.cjs");
8
+ const ProfileMenuContext = require("./harmony89.cjs");
9
+ const ProfileMenuContent = ({ children }) => {
10
+ const {
11
+ currentTeam,
12
+ otherTeams,
13
+ showUpgradeCta,
14
+ showBillingButton,
15
+ allowTeamCreation,
16
+ isProviderAlpha,
17
+ canAccessTeamSettings,
18
+ isEndOfTrialActive,
19
+ isTeamSuspended,
20
+ isFullyAuthenticated
21
+ } = ProfileMenuContext.useProfileMenu();
22
+ return /* @__PURE__ */ jsxRuntime.jsx(
23
+ louis.Menu,
24
+ {
25
+ menuButton: () => /* @__PURE__ */ jsxRuntime.jsxs("button", { className: ProfileMenuContent_module.default.profileButton, "aria-label": "Profile menu", type: "button", children: [
26
+ (currentTeam == null ? void 0 : currentTeam.logoUrl) ? /* @__PURE__ */ jsxRuntime.jsx(
27
+ "img",
28
+ {
29
+ src: currentTeam.logoUrl,
30
+ className: clsx.clsx(ProfileMenuContent_module.default.profileImage, {
31
+ [ProfileMenuContent_module.default.profileImageHighlight]: showUpgradeCta
32
+ }),
33
+ alt: "Team Logo"
34
+ }
35
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
36
+ "div",
37
+ {
38
+ className: clsx.clsx(ProfileMenuContent_module.default.userIconWrapper, "flex-row", "align-center", "items-center", {
39
+ [ProfileMenuContent_module.default.profileImageHighlight]: showUpgradeCta
40
+ }),
41
+ children: /* @__PURE__ */ jsxRuntime.jsx(louis.UserIcon, { size: "25px" })
42
+ }
43
+ ),
44
+ showUpgradeCta && /* @__PURE__ */ jsxRuntime.jsx(UpgradeIcon.UpgradeIcon, { className: ProfileMenuContent_module.default.profileImageUpgradeIcon })
45
+ ] }),
46
+ children: /* @__PURE__ */ jsxRuntime.jsx(louis.MenuList, { placement: "right-end", className: ProfileMenuContent_module.default.menuContainer, children: children({
47
+ allowTeamCreation,
48
+ otherTeams,
49
+ canAccessTeamSettings,
50
+ isEndOfTrialActive,
51
+ isTeamSuspended,
52
+ showBillingButton,
53
+ isProviderAlpha,
54
+ isFullyAuthenticated
55
+ }) })
56
+ }
57
+ );
16
58
  };
17
- exports.badge = badge;
18
- exports.default = classes;
19
- exports.disabled = disabled;
20
- exports.projectNavigationItem = projectNavigationItem;
21
- exports.projectNavigationItemDisabled = projectNavigationItemDisabled;
22
- exports.tag = tag;
23
- exports.withNavLinkStyle = withNavLinkStyle;
59
+ exports.ProfileMenuContent = ProfileMenuContent;
24
60
  //# sourceMappingURL=harmony87.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony87.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony87.cjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuContent.tsx"],"sourcesContent":["import { Menu, MenuList, UserIcon } from '@lokalise/louis'\nimport clsx from 'clsx'\nimport type { ReactNode } from 'react'\nimport { UpgradeIcon } from '../../UpgradeIcon/UpgradeIcon'\nimport styles from './ProfileMenuContent.module.css'\nimport { useProfileMenu } from './ProfileMenuContext'\nimport type { SidebarProfileMenuRenderProps } from './types'\n\nexport type ProfileMenuContentProps = {\n\tchildren: (props: SidebarProfileMenuRenderProps) => ReactNode\n}\n\nexport const ProfileMenuContent = ({ children }: ProfileMenuContentProps) => {\n\tconst {\n\t\tcurrentTeam,\n\t\totherTeams,\n\t\tshowUpgradeCta,\n\t\tshowBillingButton,\n\t\tallowTeamCreation,\n\t\tisProviderAlpha,\n\t\tcanAccessTeamSettings,\n\t\tisEndOfTrialActive,\n\t\tisTeamSuspended,\n\t\tisFullyAuthenticated,\n\t} = useProfileMenu()\n\n\treturn (\n\t\t<Menu\n\t\t\tmenuButton={() => (\n\t\t\t\t<button className={styles.profileButton} aria-label=\"Profile menu\" type=\"button\">\n\t\t\t\t\t{currentTeam?.logoUrl ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={currentTeam.logoUrl}\n\t\t\t\t\t\t\tclassName={clsx(styles.profileImage, {\n\t\t\t\t\t\t\t\t[styles.profileImageHighlight]: showUpgradeCta,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\talt=\"Team Logo\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={clsx(styles.userIconWrapper, 'flex-row', 'align-center', 'items-center', {\n\t\t\t\t\t\t\t\t[styles.profileImageHighlight]: showUpgradeCta,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<UserIcon size={'25px'} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{showUpgradeCta && <UpgradeIcon className={styles.profileImageUpgradeIcon} />}\n\t\t\t\t</button>\n\t\t\t)}\n\t\t>\n\t\t\t<MenuList placement=\"right-end\" className={styles.menuContainer}>\n\t\t\t\t{children({\n\t\t\t\t\tallowTeamCreation,\n\t\t\t\t\totherTeams,\n\t\t\t\t\tcanAccessTeamSettings,\n\t\t\t\t\tisEndOfTrialActive,\n\t\t\t\t\tisTeamSuspended,\n\t\t\t\t\tshowBillingButton,\n\t\t\t\t\tisProviderAlpha,\n\t\t\t\t\tisFullyAuthenticated,\n\t\t\t\t})}\n\t\t\t</MenuList>\n\t\t</Menu>\n\t)\n}\n"],"names":["useProfileMenu","jsx","Menu","jsxs","styles","clsx","UserIcon","UpgradeIcon","MenuList"],"mappings":";;;;;;;;AAYO,MAAM,qBAAqB,CAAC,EAAE,eAAwC;AACtE,QAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACGA,kCAAe;AAGlB,SAAAC,2BAAA;AAAA,IAACC,MAAA;AAAA,IAAA;AAAA,MACA,YAAY,MACXC,2BAAAA,KAAC,UAAO,EAAA,WAAWC,0BAAAA,QAAO,eAAe,cAAW,gBAAe,MAAK,UACtE,UAAA;AAAA,SAAA,2CAAa,WACbH,2BAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,KAAK,YAAY;AAAA,YACjB,WAAWI,KAAAA,KAAKD,0BAAA,QAAO,cAAc;AAAA,cACpC,CAACA,0BAAAA,QAAO,qBAAqB,GAAG;AAAA,YAAA,CAChC;AAAA,YACD,KAAI;AAAA,UAAA;AAAA,QAAA,IAGLH,2BAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,WAAWI,KAAK,KAAAD,0BAAA,QAAO,iBAAiB,YAAY,gBAAgB,gBAAgB;AAAA,cACnF,CAACA,0BAAAA,QAAO,qBAAqB,GAAG;AAAA,YAAA,CAChC;AAAA,YAED,UAAAH,2BAAAA,IAACK,MAAAA,UAAS,EAAA,MAAM,OAAQ,CAAA;AAAA,UAAA;AAAA,QACzB;AAAA,QAEA,kBAAkBL,2BAAA,IAACM,YAAY,aAAA,EAAA,WAAWH,0BAAAA,QAAO,wBAAyB,CAAA;AAAA,MAAA,GAC5E;AAAA,MAGD,yCAACI,gBAAS,EAAA,WAAU,aAAY,WAAWJ,kCAAO,eAChD,UAAS,SAAA;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA,CACA,EACF,CAAA;AAAA,IAAA;AAAA,EACD;AAEF;;"}
@@ -1,24 +1,60 @@
1
- const badge = "_badge_1pc1v_1";
2
- const tag = "_tag_1pc1v_15";
3
- const withNavLinkStyle = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21";
4
- const disabled = "_disabled_1pc1v_57";
5
- const projectNavigationItem = "_projectNavigationItem_1pc1v_61";
6
- const projectNavigationItemDisabled = "_projectNavigationItemDisabled_1pc1v_67";
7
- const classes = {
8
- badge,
9
- tag,
10
- withNavLinkStyle,
11
- disabled,
12
- projectNavigationItem,
13
- projectNavigationItemDisabled
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Menu, MenuList, UserIcon } from "@lokalise/louis";
3
+ import { clsx } from "./harmony66.mjs";
4
+ import { UpgradeIcon } from "./harmony93.mjs";
5
+ import styles from "./harmony102.mjs";
6
+ import { useProfileMenu } from "./harmony89.mjs";
7
+ const ProfileMenuContent = ({ children }) => {
8
+ const {
9
+ currentTeam,
10
+ otherTeams,
11
+ showUpgradeCta,
12
+ showBillingButton,
13
+ allowTeamCreation,
14
+ isProviderAlpha,
15
+ canAccessTeamSettings,
16
+ isEndOfTrialActive,
17
+ isTeamSuspended,
18
+ isFullyAuthenticated
19
+ } = useProfileMenu();
20
+ return /* @__PURE__ */ jsx(
21
+ Menu,
22
+ {
23
+ menuButton: () => /* @__PURE__ */ jsxs("button", { className: styles.profileButton, "aria-label": "Profile menu", type: "button", children: [
24
+ (currentTeam == null ? void 0 : currentTeam.logoUrl) ? /* @__PURE__ */ jsx(
25
+ "img",
26
+ {
27
+ src: currentTeam.logoUrl,
28
+ className: clsx(styles.profileImage, {
29
+ [styles.profileImageHighlight]: showUpgradeCta
30
+ }),
31
+ alt: "Team Logo"
32
+ }
33
+ ) : /* @__PURE__ */ jsx(
34
+ "div",
35
+ {
36
+ className: clsx(styles.userIconWrapper, "flex-row", "align-center", "items-center", {
37
+ [styles.profileImageHighlight]: showUpgradeCta
38
+ }),
39
+ children: /* @__PURE__ */ jsx(UserIcon, { size: "25px" })
40
+ }
41
+ ),
42
+ showUpgradeCta && /* @__PURE__ */ jsx(UpgradeIcon, { className: styles.profileImageUpgradeIcon })
43
+ ] }),
44
+ children: /* @__PURE__ */ jsx(MenuList, { placement: "right-end", className: styles.menuContainer, children: children({
45
+ allowTeamCreation,
46
+ otherTeams,
47
+ canAccessTeamSettings,
48
+ isEndOfTrialActive,
49
+ isTeamSuspended,
50
+ showBillingButton,
51
+ isProviderAlpha,
52
+ isFullyAuthenticated
53
+ }) })
54
+ }
55
+ );
14
56
  };
15
57
  export {
16
- badge,
17
- classes as default,
18
- disabled,
19
- projectNavigationItem,
20
- projectNavigationItemDisabled,
21
- tag,
22
- withNavLinkStyle
58
+ ProfileMenuContent
23
59
  };
24
60
  //# sourceMappingURL=harmony87.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony87.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony87.mjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuContent.tsx"],"sourcesContent":["import { Menu, MenuList, UserIcon } from '@lokalise/louis'\nimport clsx from 'clsx'\nimport type { ReactNode } from 'react'\nimport { UpgradeIcon } from '../../UpgradeIcon/UpgradeIcon'\nimport styles from './ProfileMenuContent.module.css'\nimport { useProfileMenu } from './ProfileMenuContext'\nimport type { SidebarProfileMenuRenderProps } from './types'\n\nexport type ProfileMenuContentProps = {\n\tchildren: (props: SidebarProfileMenuRenderProps) => ReactNode\n}\n\nexport const ProfileMenuContent = ({ children }: ProfileMenuContentProps) => {\n\tconst {\n\t\tcurrentTeam,\n\t\totherTeams,\n\t\tshowUpgradeCta,\n\t\tshowBillingButton,\n\t\tallowTeamCreation,\n\t\tisProviderAlpha,\n\t\tcanAccessTeamSettings,\n\t\tisEndOfTrialActive,\n\t\tisTeamSuspended,\n\t\tisFullyAuthenticated,\n\t} = useProfileMenu()\n\n\treturn (\n\t\t<Menu\n\t\t\tmenuButton={() => (\n\t\t\t\t<button className={styles.profileButton} aria-label=\"Profile menu\" type=\"button\">\n\t\t\t\t\t{currentTeam?.logoUrl ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={currentTeam.logoUrl}\n\t\t\t\t\t\t\tclassName={clsx(styles.profileImage, {\n\t\t\t\t\t\t\t\t[styles.profileImageHighlight]: showUpgradeCta,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\talt=\"Team Logo\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={clsx(styles.userIconWrapper, 'flex-row', 'align-center', 'items-center', {\n\t\t\t\t\t\t\t\t[styles.profileImageHighlight]: showUpgradeCta,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<UserIcon size={'25px'} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{showUpgradeCta && <UpgradeIcon className={styles.profileImageUpgradeIcon} />}\n\t\t\t\t</button>\n\t\t\t)}\n\t\t>\n\t\t\t<MenuList placement=\"right-end\" className={styles.menuContainer}>\n\t\t\t\t{children({\n\t\t\t\t\tallowTeamCreation,\n\t\t\t\t\totherTeams,\n\t\t\t\t\tcanAccessTeamSettings,\n\t\t\t\t\tisEndOfTrialActive,\n\t\t\t\t\tisTeamSuspended,\n\t\t\t\t\tshowBillingButton,\n\t\t\t\t\tisProviderAlpha,\n\t\t\t\t\tisFullyAuthenticated,\n\t\t\t\t})}\n\t\t\t</MenuList>\n\t\t</Menu>\n\t)\n}\n"],"names":[],"mappings":";;;;;;AAYO,MAAM,qBAAqB,CAAC,EAAE,eAAwC;AACtE,QAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACG,eAAe;AAGlB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,YAAY,MACX,qBAAC,UAAO,EAAA,WAAW,OAAO,eAAe,cAAW,gBAAe,MAAK,UACtE,UAAA;AAAA,SAAA,2CAAa,WACb;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,KAAK,YAAY;AAAA,YACjB,WAAW,KAAK,OAAO,cAAc;AAAA,cACpC,CAAC,OAAO,qBAAqB,GAAG;AAAA,YAAA,CAChC;AAAA,YACD,KAAI;AAAA,UAAA;AAAA,QAAA,IAGL;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,WAAW,KAAK,OAAO,iBAAiB,YAAY,gBAAgB,gBAAgB;AAAA,cACnF,CAAC,OAAO,qBAAqB,GAAG;AAAA,YAAA,CAChC;AAAA,YAED,UAAA,oBAAC,UAAS,EAAA,MAAM,OAAQ,CAAA;AAAA,UAAA;AAAA,QACzB;AAAA,QAEA,kBAAkB,oBAAC,aAAY,EAAA,WAAW,OAAO,wBAAyB,CAAA;AAAA,MAAA,GAC5E;AAAA,MAGD,8BAAC,UAAS,EAAA,WAAU,aAAY,WAAW,OAAO,eAChD,UAAS,SAAA;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA,CACA,EACF,CAAA;AAAA,IAAA;AAAA,EACD;AAEF;"}
@@ -1,9 +1,45 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const logoLink = "_logoLink_1baxb_1";
4
- const styles = {
5
- logoLink
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const plan = require("./harmony8.cjs");
5
+ const types = require("./harmony103.cjs");
6
+ const ProfileMenuContext = require("./harmony89.cjs");
7
+ const billingRoles = [
8
+ types.SidebarTeamRoles.biller,
9
+ types.SidebarTeamRoles.owner,
10
+ types.SidebarTeamRoles.admin
11
+ ];
12
+ const teamSettingsRoles = [
13
+ types.SidebarTeamRoles.biller,
14
+ types.SidebarTeamRoles.owner,
15
+ types.SidebarTeamRoles.admin
16
+ ];
17
+ const upgradeCtaRoles = [
18
+ types.SidebarTeamRoles.biller,
19
+ types.SidebarTeamRoles.owner
20
+ ];
21
+ const ProfileMenuProvider = ({ children, config }) => {
22
+ const { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } = config;
23
+ const currentTeam = teams.find((t) => t.id === currentTeamId);
24
+ const otherTeams = teams.filter((t) => t.id !== currentTeamId);
25
+ const canChangeBilling = billingRoles.includes(userTeamRole);
26
+ const canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole);
27
+ const isOnFreeOrTrialPlan = plan.isFreePlan(planId) || plan.isTrialPlan(planId);
28
+ const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole);
29
+ const showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling;
30
+ const allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive;
31
+ const providerValue = {
32
+ ...config,
33
+ currentTeam,
34
+ otherTeams,
35
+ canChangeBilling,
36
+ canAccessTeamSettings,
37
+ isOnFreeOrTrialPlan,
38
+ showUpgradeCta,
39
+ showBillingButton,
40
+ allowTeamCreation
41
+ };
42
+ return /* @__PURE__ */ jsxRuntime.jsx(ProfileMenuContext.ProfileMenuContext.Provider, { value: providerValue, children });
6
43
  };
7
- exports.default = styles;
8
- exports.logoLink = logoLink;
44
+ exports.ProfileMenuProvider = ProfileMenuProvider;
9
45
  //# sourceMappingURL=harmony88.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony88.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"harmony88.cjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuProvider.tsx"],"sourcesContent":["import { isFreePlan, isTrialPlan } from '@utils'\nimport type { PropsWithChildren } from 'react'\nimport { type SidebarTeamRole, SidebarTeamRoles } from '../../types'\nimport { ProfileMenuContext } from './ProfileMenuContext'\nimport type { SidebarProfileMenuConfig } from './types'\n\ntype ProfileMenuProviderProps = PropsWithChildren<{\n\tconfig: SidebarProfileMenuConfig\n}>\n\nconst billingRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst teamSettingsRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst upgradeCtaRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n]\n\nexport const ProfileMenuProvider = ({ children, config }: ProfileMenuProviderProps) => {\n\tconst { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } =\n\t\tconfig\n\n\tconst currentTeam = teams.find((t) => t.id === currentTeamId)\n\n\tconst otherTeams = teams.filter((t) => t.id !== currentTeamId)\n\n\tconst canChangeBilling = billingRoles.includes(userTeamRole)\n\n\tconst canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole)\n\n\tconst isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId)\n\n\tconst showUpgradeCta =\n\t\tisFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole)\n\n\tconst showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling\n\n\tconst allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive\n\n\tconst providerValue = {\n\t\t...config,\n\t\tcurrentTeam,\n\t\totherTeams,\n\t\tcanChangeBilling,\n\t\tcanAccessTeamSettings,\n\t\tisOnFreeOrTrialPlan,\n\t\tshowUpgradeCta,\n\t\tshowBillingButton,\n\t\tallowTeamCreation,\n\t}\n\n\treturn <ProfileMenuContext.Provider value={providerValue}>{children}</ProfileMenuContext.Provider>\n}\n"],"names":["SidebarTeamRoles","isFreePlan","isTrialPlan","ProfileMenuContext"],"mappings":";;;;;;AAUA,MAAM,eAA+C;AAAA,EACpDA,MAAAA,iBAAiB;AAAA,EACjBA,MAAAA,iBAAiB;AAAA,EACjBA,uBAAiB;AAClB;AAEA,MAAM,oBAAoD;AAAA,EACzDA,MAAAA,iBAAiB;AAAA,EACjBA,MAAAA,iBAAiB;AAAA,EACjBA,uBAAiB;AAClB;AAEA,MAAM,kBAAkD;AAAA,EACvDA,MAAAA,iBAAiB;AAAA,EACjBA,uBAAiB;AAClB;AAEO,MAAM,sBAAsB,CAAC,EAAE,UAAU,aAAuC;AACtF,QAAM,EAAE,OAAO,eAAe,QAAQ,oBAAoB,sBAAsB,iBAC/E;AAED,QAAM,cAAc,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,aAAa;AAE5D,QAAM,aAAa,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,aAAa;AAEvD,QAAA,mBAAmB,aAAa,SAAS,YAAY;AAErD,QAAA,wBAAwB,kBAAkB,SAAS,YAAY;AAErE,QAAM,sBAAsBC,KAAA,WAAW,MAAM,KAAKC,KAAAA,YAAY,MAAM;AAEpE,QAAM,iBACL,wBAAwB,uBAAuB,gBAAgB,SAAS,YAAY;AAE/E,QAAA,oBAAoB,wBAAwB,yBAAyB;AAErE,QAAA,oBAAoB,wBAAwB,CAAC;AAEnD,QAAM,gBAAgB;AAAA,IACrB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,wCAAQC,mBAAAA,mBAAmB,UAAnB,EAA4B,OAAO,eAAgB,UAAS;AACrE;;"}
@@ -1,9 +1,45 @@
1
- const logoLink = "_logoLink_1baxb_1";
2
- const styles = {
3
- logoLink
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { isFreePlan, isTrialPlan } from "./harmony8.mjs";
3
+ import { SidebarTeamRoles } from "./harmony103.mjs";
4
+ import { ProfileMenuContext } from "./harmony89.mjs";
5
+ const billingRoles = [
6
+ SidebarTeamRoles.biller,
7
+ SidebarTeamRoles.owner,
8
+ SidebarTeamRoles.admin
9
+ ];
10
+ const teamSettingsRoles = [
11
+ SidebarTeamRoles.biller,
12
+ SidebarTeamRoles.owner,
13
+ SidebarTeamRoles.admin
14
+ ];
15
+ const upgradeCtaRoles = [
16
+ SidebarTeamRoles.biller,
17
+ SidebarTeamRoles.owner
18
+ ];
19
+ const ProfileMenuProvider = ({ children, config }) => {
20
+ const { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } = config;
21
+ const currentTeam = teams.find((t) => t.id === currentTeamId);
22
+ const otherTeams = teams.filter((t) => t.id !== currentTeamId);
23
+ const canChangeBilling = billingRoles.includes(userTeamRole);
24
+ const canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole);
25
+ const isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId);
26
+ const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole);
27
+ const showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling;
28
+ const allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive;
29
+ const providerValue = {
30
+ ...config,
31
+ currentTeam,
32
+ otherTeams,
33
+ canChangeBilling,
34
+ canAccessTeamSettings,
35
+ isOnFreeOrTrialPlan,
36
+ showUpgradeCta,
37
+ showBillingButton,
38
+ allowTeamCreation
39
+ };
40
+ return /* @__PURE__ */ jsx(ProfileMenuContext.Provider, { value: providerValue, children });
4
41
  };
5
42
  export {
6
- styles as default,
7
- logoLink
43
+ ProfileMenuProvider
8
44
  };
9
45
  //# sourceMappingURL=harmony88.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony88.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"harmony88.mjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuProvider.tsx"],"sourcesContent":["import { isFreePlan, isTrialPlan } from '@utils'\nimport type { PropsWithChildren } from 'react'\nimport { type SidebarTeamRole, SidebarTeamRoles } from '../../types'\nimport { ProfileMenuContext } from './ProfileMenuContext'\nimport type { SidebarProfileMenuConfig } from './types'\n\ntype ProfileMenuProviderProps = PropsWithChildren<{\n\tconfig: SidebarProfileMenuConfig\n}>\n\nconst billingRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst teamSettingsRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst upgradeCtaRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n]\n\nexport const ProfileMenuProvider = ({ children, config }: ProfileMenuProviderProps) => {\n\tconst { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } =\n\t\tconfig\n\n\tconst currentTeam = teams.find((t) => t.id === currentTeamId)\n\n\tconst otherTeams = teams.filter((t) => t.id !== currentTeamId)\n\n\tconst canChangeBilling = billingRoles.includes(userTeamRole)\n\n\tconst canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole)\n\n\tconst isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId)\n\n\tconst showUpgradeCta =\n\t\tisFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole)\n\n\tconst showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling\n\n\tconst allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive\n\n\tconst providerValue = {\n\t\t...config,\n\t\tcurrentTeam,\n\t\totherTeams,\n\t\tcanChangeBilling,\n\t\tcanAccessTeamSettings,\n\t\tisOnFreeOrTrialPlan,\n\t\tshowUpgradeCta,\n\t\tshowBillingButton,\n\t\tallowTeamCreation,\n\t}\n\n\treturn <ProfileMenuContext.Provider value={providerValue}>{children}</ProfileMenuContext.Provider>\n}\n"],"names":[],"mappings":";;;;AAUA,MAAM,eAA+C;AAAA,EACpD,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAClB;AAEA,MAAM,oBAAoD;AAAA,EACzD,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAClB;AAEA,MAAM,kBAAkD;AAAA,EACvD,iBAAiB;AAAA,EACjB,iBAAiB;AAClB;AAEO,MAAM,sBAAsB,CAAC,EAAE,UAAU,aAAuC;AACtF,QAAM,EAAE,OAAO,eAAe,QAAQ,oBAAoB,sBAAsB,iBAC/E;AAED,QAAM,cAAc,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,aAAa;AAE5D,QAAM,aAAa,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,aAAa;AAEvD,QAAA,mBAAmB,aAAa,SAAS,YAAY;AAErD,QAAA,wBAAwB,kBAAkB,SAAS,YAAY;AAErE,QAAM,sBAAsB,WAAW,MAAM,KAAK,YAAY,MAAM;AAEpE,QAAM,iBACL,wBAAwB,uBAAuB,gBAAgB,SAAS,YAAY;AAE/E,QAAA,oBAAoB,wBAAwB,yBAAyB;AAErE,QAAA,oBAAoB,wBAAwB,CAAC;AAEnD,QAAM,gBAAgB;AAAA,IACrB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,6BAAQ,mBAAmB,UAAnB,EAA4B,OAAO,eAAgB,UAAS;AACrE;"}
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const link = "_link_18vhx_1";
4
- const active = "_active_18vhx_18";
5
- const styles = {
6
- link,
7
- active
8
- };
9
- exports.active = active;
10
- exports.default = styles;
11
- exports.link = link;
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const ProfileMenuContext = React.createContext({});
5
+ const useProfileMenu = () => React.useContext(ProfileMenuContext);
6
+ exports.ProfileMenuContext = ProfileMenuContext;
7
+ exports.useProfileMenu = useProfileMenu;
12
8
  //# sourceMappingURL=harmony89.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony89.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony89.cjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { SidebarProfileMenuContextProps } from './types'\n\nexport const ProfileMenuContext = createContext({} as SidebarProfileMenuContextProps)\n\nexport const useProfileMenu = () => useContext(ProfileMenuContext)\n"],"names":["createContext","useContext"],"mappings":";;;AAGa,MAAA,qBAAqBA,MAAc,cAAA,CAAoC,CAAA;AAEvE,MAAA,iBAAiB,MAAMC,MAAAA,WAAW,kBAAkB;;;"}