@economic/taco 1.23.0 → 1.24.0

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 (134) hide show
  1. package/dist/components/Header/Header.d.ts +28 -0
  2. package/dist/components/Header/components/AgreementSelector.d.ts +18 -0
  3. package/dist/components/Header/components/Agreements/AgreementDetails.d.ts +20 -0
  4. package/dist/components/Header/components/Button.d.ts +11 -0
  5. package/dist/components/Header/components/Link.d.ts +21 -0
  6. package/dist/components/Header/components/Logo.d.ts +3 -0
  7. package/dist/components/Header/components/MenuButton.d.ts +5 -0
  8. package/dist/components/Header/components/PrimaryNavigation.d.ts +3 -0
  9. package/dist/components/Header/components/SecondaryNavigation.d.ts +3 -0
  10. package/dist/components/Layout/Layout.d.ts +16 -0
  11. package/dist/components/Layout/components/Content.d.ts +3 -0
  12. package/dist/components/Layout/components/Context.d.ts +6 -0
  13. package/dist/components/Layout/components/Page.d.ts +3 -0
  14. package/dist/components/Layout/components/Sidebar.d.ts +3 -0
  15. package/dist/components/Layout/components/Top.d.ts +7 -0
  16. package/dist/components/Navigation2/Navigation2.d.ts +17 -0
  17. package/dist/components/Navigation2/components/Content.d.ts +3 -0
  18. package/dist/components/Navigation2/components/Group.d.ts +9 -0
  19. package/dist/components/Navigation2/components/Link.d.ts +24 -0
  20. package/dist/components/Navigation2/components/Section.d.ts +7 -0
  21. package/dist/components/Provider/Localization.d.ts +27 -17
  22. package/dist/esm/packages/taco/src/components/Card/Card.js +1 -1
  23. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Header/Header.js +30 -0
  25. package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -0
  26. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +134 -0
  27. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -0
  28. package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js +73 -0
  29. package/dist/esm/packages/taco/src/components/Header/components/Agreements/AgreementDetails.js.map +1 -0
  30. package/dist/esm/packages/taco/src/components/Header/components/Button.js +23 -0
  31. package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -0
  32. package/dist/esm/packages/taco/src/components/Header/components/Link.js +48 -0
  33. package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -0
  34. package/dist/esm/packages/taco/src/components/Header/components/Logo.js +73 -0
  35. package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -0
  36. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +16 -0
  37. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -0
  38. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +134 -0
  39. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -0
  40. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +13 -0
  41. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -0
  42. package/dist/esm/packages/taco/src/components/Layout/Layout.js +28 -0
  43. package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -0
  44. package/dist/esm/packages/taco/src/components/Layout/components/Content.js +13 -0
  45. package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -0
  46. package/dist/esm/packages/taco/src/components/Layout/components/Context.js +9 -0
  47. package/dist/esm/packages/taco/src/components/Layout/components/Context.js.map +1 -0
  48. package/dist/esm/packages/taco/src/components/Layout/components/Page.js +13 -0
  49. package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -0
  50. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +83 -0
  51. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -0
  52. package/dist/esm/packages/taco/src/components/Layout/components/Top.js +15 -0
  53. package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -0
  54. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +31 -0
  55. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -0
  56. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +19 -0
  57. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -0
  58. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +46 -0
  59. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -0
  60. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +71 -0
  61. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -0
  62. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +24 -0
  63. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -0
  64. package/dist/esm/packages/taco/src/components/Provider/Localization.js +18 -11
  65. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  66. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +4 -1
  67. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
  68. package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +3 -1
  69. package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js.map +1 -1
  70. package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js +6 -0
  71. package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js.map +1 -0
  72. package/dist/esm/packages/taco/src/hooks/useMatchMedia.js +18 -0
  73. package/dist/esm/packages/taco/src/hooks/useMatchMedia.js.map +1 -0
  74. package/dist/esm/packages/taco/src/index.js +9 -0
  75. package/dist/esm/packages/taco/src/index.js.map +1 -1
  76. package/dist/esm/packages/taco/src/primitives/Collection/Collection.js +3 -0
  77. package/dist/esm/packages/taco/src/primitives/Collection/Collection.js.map +1 -0
  78. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +4 -1
  79. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
  80. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +1 -0
  81. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
  82. package/dist/hooks/useIsLargeScreen.d.ts +1 -0
  83. package/dist/hooks/useMatchMedia.d.ts +1 -0
  84. package/dist/index.d.ts +7 -0
  85. package/dist/taco.cjs.development.js +809 -17
  86. package/dist/taco.cjs.development.js.map +1 -1
  87. package/dist/taco.cjs.production.min.js +1 -1
  88. package/dist/taco.cjs.production.min.js.map +1 -1
  89. package/package.json +2 -2
  90. package/types.json +538 -101
  91. package/dist/components/Accordion/Accordion.stories.d.ts +0 -26
  92. package/dist/components/Alert/Alert.stories.d.ts +0 -36
  93. package/dist/components/AlertDialog/AlertDialog.stories.d.ts +0 -10
  94. package/dist/components/Backdrop/Backdrop.stories.d.ts +0 -7
  95. package/dist/components/BadgeIcon/BadgeIcon.stories.d.ts +0 -12
  96. package/dist/components/Banner/Banner.stories.d.ts +0 -5
  97. package/dist/components/Button/Button.stories.d.ts +0 -77
  98. package/dist/components/Calendar/Calendar.stories.d.ts +0 -13
  99. package/dist/components/Card/Card.stories.d.ts +0 -12
  100. package/dist/components/Datepicker/Datepicker.stories.d.ts +0 -43
  101. package/dist/components/Dialog/Dialog.stories.d.ts +0 -57
  102. package/dist/components/Field/Field.stories.d.ts +0 -14
  103. package/dist/components/Form/Form.stories.d.ts +0 -14
  104. package/dist/components/Group/Group.stories.d.ts +0 -23
  105. package/dist/components/Hanger/Hanger.stories.d.ts +0 -11
  106. package/dist/components/HoverCard/HoverCard.stories.d.ts +0 -16
  107. package/dist/components/Icon/Icon.stories.d.ts +0 -8
  108. package/dist/components/IconButton/IconButton.stories.d.ts +0 -12
  109. package/dist/components/Input/Input.stories.d.ts +0 -17
  110. package/dist/components/Listbox/Listbox.stories.d.ts +0 -44
  111. package/dist/components/Menu/Menu.stories.d.ts +0 -73
  112. package/dist/components/Navigation/Navigation.stories.d.ts +0 -7
  113. package/dist/components/Pagination/Pagination.stories.d.ts +0 -28
  114. package/dist/components/Popover/Popover.stories.d.ts +0 -29
  115. package/dist/components/Progress/Progress.stories.d.ts +0 -9
  116. package/dist/components/RadioGroup/RadioGroup.stories.d.ts +0 -49
  117. package/dist/components/ScrollArea/ScrollArea.stories.d.ts +0 -8
  118. package/dist/components/SearchInput/SearchInput.stories.d.ts +0 -38
  119. package/dist/components/Select/Select.stories.d.ts +0 -35
  120. package/dist/components/Select2/Select2.stories.d.ts +0 -57
  121. package/dist/components/Spinner/Spinner.stories.d.ts +0 -15
  122. package/dist/components/Table/Table.stories.d.ts +0 -32
  123. package/dist/components/Table2/Table2.stories.d.ts +0 -48
  124. package/dist/components/Tabs/Tabs.stories.d.ts +0 -19
  125. package/dist/components/Tag/Tag.stories.d.ts +0 -9
  126. package/dist/components/Textarea/Textarea.stories.d.ts +0 -40
  127. package/dist/components/Toast/Toast.stories.d.ts +0 -12
  128. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -26
  129. package/dist/components/Tour/Tour.stories.d.ts +0 -11
  130. package/dist/css/Typography.stories.d.ts +0 -6
  131. package/dist/hooks/useIsRefOverflowing.d.ts +0 -2
  132. package/dist/primitives/Collection/Collection.stories.d.ts +0 -8
  133. package/dist/primitives/Listbox2/Listbox2.stories.d.ts +0 -16
  134. package/dist/primitives/Sortable/Sortable.stories.d.ts +0 -14
@@ -44,6 +44,7 @@ var utilities = require('@dnd-kit/utilities');
44
44
  var TabsPrimitive = require('@radix-ui/react-tabs');
45
45
  var Joyride = require('react-joyride');
46
46
  var Joyride__default = _interopDefault(Joyride);
47
+ var reactPortal = require('@radix-ui/react-portal');
47
48
 
48
49
  const AVAILABLE_COLORS = ['green', 'yellow', 'red', 'blue', 'purple', 'brown', 'pink', 'orange', 'grey', 'transparent'];
49
50
  const getColorByState = state => {
@@ -3718,6 +3719,9 @@ const IconButton = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
3718
3719
  });
3719
3720
 
3720
3721
  const defaultLocalisationTexts = {
3722
+ banner: {
3723
+ close: 'Close'
3724
+ },
3721
3725
  calendar: {
3722
3726
  months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
3723
3727
  weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
@@ -3738,21 +3742,25 @@ const defaultLocalisationTexts = {
3738
3742
  expand: 'Show calendar',
3739
3743
  shortcuts: 'Shortcuts'
3740
3744
  },
3745
+ dialog: {
3746
+ close: 'Close',
3747
+ drag: 'Drag'
3748
+ },
3741
3749
  hanger: {
3742
3750
  close: 'Close'
3743
3751
  },
3744
- banner: {
3745
- close: 'Close'
3752
+ header: {
3753
+ addAgreement: 'Add agreement',
3754
+ logout: 'Log off',
3755
+ more: 'More',
3756
+ new: 'New',
3757
+ search: 'Search for agreement...'
3746
3758
  },
3747
3759
  listbox: {
3748
3760
  loading: 'Loading results...',
3749
3761
  empty: 'No results found',
3750
3762
  allOption: 'All'
3751
3763
  },
3752
- dialog: {
3753
- close: 'Close',
3754
- drag: 'Drag'
3755
- },
3756
3764
  pagination: {
3757
3765
  label: 'Pagination',
3758
3766
  pageSize: 'Items per page',
@@ -3863,6 +3871,11 @@ const defaultLocalisationTexts = {
3863
3871
  collapseRow: 'Collapse current row'
3864
3872
  }
3865
3873
  },
3874
+ searchInput: {
3875
+ button: 'Search',
3876
+ placeholder: 'Search...',
3877
+ clear: 'Clear'
3878
+ },
3866
3879
  select: {
3867
3880
  allOptionsSelected: 'All'
3868
3881
  },
@@ -3887,11 +3900,6 @@ const defaultLocalisationTexts = {
3887
3900
  last: 'Done',
3888
3901
  next: 'Next',
3889
3902
  open: 'Open'
3890
- },
3891
- searchInput: {
3892
- button: 'Search',
3893
- placeholder: 'Search...',
3894
- clear: 'Clear'
3895
3903
  }
3896
3904
  };
3897
3905
  const defaultLocalizationContext = {
@@ -4116,7 +4124,7 @@ const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
4116
4124
  menu,
4117
4125
  children
4118
4126
  } = props;
4119
- const className = cn('bg-white flex flex-col rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]', props.className);
4127
+ const className = cn('bg-white flex flex-col rounded-xl border border-solid border-radius-[12px] border-grey-300 hover:border-grey-500', props.className);
4120
4128
  return /*#__PURE__*/React.createElement("div", {
4121
4129
  className: className,
4122
4130
  "data-taco": "card",
@@ -5960,12 +5968,15 @@ const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
5960
5968
  };
5961
5969
  const handleKeyDown = event => {
5962
5970
  var _props$onKeyDown;
5971
+ (_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
5972
+ if (event.isDefaultPrevented()) {
5973
+ return;
5974
+ }
5963
5975
  if (event.key === 'Enter') {
5964
5976
  event.preventDefault();
5965
5977
  handleClick();
5966
5978
  return;
5967
5979
  }
5968
- (_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
5969
5980
  };
5970
5981
  return /*#__PURE__*/React.createElement(Input, Object.assign({
5971
5982
  "aria-label": texts.searchInput.placeholder,
@@ -7766,7 +7777,10 @@ const Root = /*#__PURE__*/React__default.forwardRef(function CollectionRoot(prop
7766
7777
  if (internalRef.current) {
7767
7778
  const options = getOptionsFromCollection(internalRef.current, querySelector);
7768
7779
  if (options.length && options.length !== lastLengthRef.current) {
7769
- const selected = internalRef.current.querySelectorAll(`[aria-selected]`);
7780
+ let selected = internalRef.current.querySelectorAll(`[aria-current="true"]`);
7781
+ if (selected.length === 0) {
7782
+ selected = internalRef.current.querySelectorAll(`[aria-selected]`);
7783
+ }
7770
7784
  if (selected.length === 1) {
7771
7785
  if (options) {
7772
7786
  const firstSelected = selected.item(0);
@@ -7870,6 +7884,13 @@ const isSkippableItem = element => {
7870
7884
  return element.getAttribute('role') === 'presentation' || !!element.hasAttribute('disabled') || !!element.getAttribute('aria-disabled') || !!element.getAttribute('aria-hidden');
7871
7885
  };
7872
7886
 
7887
+
7888
+
7889
+ var Collection = {
7890
+ __proto__: null,
7891
+ Root: Root
7892
+ };
7893
+
7873
7894
  const Listbox2Context = /*#__PURE__*/React__default.createContext({});
7874
7895
  const useListbox2Context = () => React__default.useContext(Listbox2Context);
7875
7896
 
@@ -8900,7 +8921,7 @@ const Create = props => {
8900
8921
  }, searchQuery)));
8901
8922
  };
8902
8923
 
8903
- const Collection = props => {
8924
+ const Collection$1 = props => {
8904
8925
  const {
8905
8926
  children
8906
8927
  } = props;
@@ -9096,7 +9117,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
9096
9117
  setValue: setValue,
9097
9118
  tabIndex: -1,
9098
9119
  value: value
9099
- }, /*#__PURE__*/React__default.createElement(Collection, null, filteredChildren), onCreate ? /*#__PURE__*/React__default.createElement(Create, {
9120
+ }, /*#__PURE__*/React__default.createElement(Collection$1, null, filteredChildren), onCreate ? /*#__PURE__*/React__default.createElement(Create, {
9100
9121
  onCreate: onCreate,
9101
9122
  options: flattenedChildren
9102
9123
  }) : null))))));
@@ -13049,12 +13070,13 @@ const ExpandedRow = ({
13049
13070
 
13050
13071
  const useBoundaryOverflowDetection = (ref, dependencies = []) => {
13051
13072
  const [boundaryIndex, setBoundaryIndex] = React__default.useState();
13073
+ const dimensions = useBoundingClientRectListener(ref, dependencies);
13052
13074
  React__default.useEffect(() => {
13053
13075
  if (ref.current) {
13054
13076
  const boundaryChildIndex = getIndexOfFirstChildOverflowingParent(ref.current);
13055
13077
  setBoundaryIndex(boundaryChildIndex);
13056
13078
  }
13057
- }, [ref, ...dependencies]);
13079
+ }, [ref, dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, ...dependencies]);
13058
13080
  return boundaryIndex;
13059
13081
  };
13060
13082
 
@@ -14235,6 +14257,768 @@ const Tour = props => {
14235
14257
  };
14236
14258
  Tour.Step = TourStep;
14237
14259
 
14260
+ const Button$3 = /*#__PURE__*/React__default.forwardRef(function Button(props, ref) {
14261
+ const {
14262
+ as = 'li',
14263
+ ...attributes
14264
+ } = props;
14265
+ const className = cn(getButtonClasses$1(), props.className);
14266
+ const Tag = as;
14267
+ return /*#__PURE__*/React__default.createElement(Tag, {
14268
+ className: "contents"
14269
+ }, /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, attributes, {
14270
+ appearance: "discrete",
14271
+ className: className,
14272
+ ref: ref
14273
+ })));
14274
+ });
14275
+ const getButtonClasses$1 = () => cn('!h-9 !w-9 flex-shrink-0 flex-grow-0 cursor-pointer !rounded-full relative', 'focus:!outline-none focus:!shadow-none focus-visible:!yt-focus-dark ', 'bg-transparent hover:bg-white/[.08] focus:bg-white/[.08] aria-current-page:bg-white/[.08]', '!text-white hover:text-white focus:text-white');
14276
+
14277
+ const Link$1 = /*#__PURE__*/React__default.forwardRef(function Link(props, ref) {
14278
+ const {
14279
+ as = 'li',
14280
+ children,
14281
+ icon,
14282
+ isNew,
14283
+ tooltip,
14284
+ ...otherProps
14285
+ } = props;
14286
+ const {
14287
+ texts
14288
+ } = useLocalization();
14289
+ const Tag = as;
14290
+ const className = cn(getLinkClasses(icon), 'relative', props.className);
14291
+ let link = /*#__PURE__*/React__default.createElement("a", Object.assign({}, otherProps, {
14292
+ className: className,
14293
+ ref: ref,
14294
+ tabIndex: 0
14295
+ }), icon ? /*#__PURE__*/React__default.createElement(Icon, {
14296
+ name: icon
14297
+ }) : null, children, isNew ? /*#__PURE__*/React__default.createElement(Badge, {
14298
+ color: "blue",
14299
+ small: true,
14300
+ className: "absolute top-0 right-0 -mt-1.5 -mr-2.5 !h-3 !px-0.5 text-[0.55rem] font-normal"
14301
+ }, texts.header.new) : null);
14302
+ if (tooltip) {
14303
+ link = /*#__PURE__*/React__default.createElement(Tooltip, {
14304
+ title: tooltip
14305
+ }, link);
14306
+ }
14307
+ return /*#__PURE__*/React__default.createElement(Tag, {
14308
+ className: "contents"
14309
+ }, link);
14310
+ });
14311
+ const getLinkClasses = (icon = undefined) => cn('flex h-8 flex-shrink-0 flex-grow-0 cursor-pointer items-center justify-center ', 'focus:!shadow-none focus:!outline-none focus-visible:!yt-focus-dark', 'bg-transparent hover:bg-white/[.08] focus:bg-white/[.08] aria-current-page:bg-white/[.08]', '!text-white hover:text-white focus:text-white', {
14312
+ '!rounded-full !h-9 !w-9': icon,
14313
+ 'whitespace-nowrap px-3 rounded text-sm hidden lg:flex': !icon
14314
+ });
14315
+
14316
+ const Logo = /*#__PURE__*/React__default.forwardRef(function Logo(props, ref) {
14317
+ const className = cn('-mr-[156px] xs:-mr-14 md:!mr-0 h-9 shrink-0 w-[180px]', props.className);
14318
+ return /*#__PURE__*/React__default.createElement("svg", Object.assign({}, props, {
14319
+ className: className,
14320
+ ref: ref,
14321
+ viewBox: "0 0 127 13",
14322
+ xmlns: "http://www.w3.org/2000/svg"
14323
+ }), /*#__PURE__*/React__default.createElement("g", {
14324
+ className: "fill-white"
14325
+ }, /*#__PURE__*/React__default.createElement("path", {
14326
+ className: "fill-white",
14327
+ d: "M5.716016 1.34924242c3.029712.25015152 6.374384 1.74121213 8.2804 3.86060606 2.4384 2.71227273 1.603248 5.42454542-1.877568 6.05681822-3.480816.6322727-8.2804-1.0498485-10.720832-3.76212125C-.471424 5.42848485-.41656 3.35242424 1.27 2.2080303l9.67232 6.92742425-5.226304-7.78621213z",
14328
+ fillRule: "nonzero"
14329
+ }), /*#__PURE__*/React__default.createElement("g", {
14330
+ className: "hidden md:flex"
14331
+ }, /*#__PURE__*/React__default.createElement("path", {
14332
+ d: "M53.67528 11.2509091l-1.2192-4.72727274c-.176784-.56333333-.24384-1.12666666-.36576-1.6880303h-.026416c-.107696.57515152-.148336 1.13848485-.308864 1.71363636l-1.22936 4.70954548h-2.101088l2.822448-9.87409093h1.647952l2.942336 9.86424243-2.162048.0019697z",
14333
+ fillRule: "nonzero"
14334
+ }), /*#__PURE__*/React__default.createElement("path", {
14335
+ d: "M21.553424 1.38469697l1.2192 4.72727273c.174752.56333333.241808 1.12469697.363728 1.6880303h.026416c.107696-.57515152.148336-1.13848485.310896-1.71363636l1.2192-4.70954546h2.105152L23.9776 11.2410606h-1.64592l-2.938272-9.85636363h2.160016z",
14336
+ fillRule: "nonzero"
14337
+ }), /*#__PURE__*/React__default.createElement("path", {
14338
+ fillRule: "nonzero",
14339
+ d: "M28.313888 1.38666667h2.01168v9.86424243h-2.01168z"
14340
+ }), /*#__PURE__*/React__default.createElement("path", {
14341
+ fillRule: "nonzero",
14342
+ d: "M41.694608 1.38666667l.983488 5.82045454h.026416l.808736-5.82045454h2.700528l1.0668 9.86424243h-2.064512l-.485648-7.10469698h-.028448l-.323088 2.43257576-.865632 4.67212122h-1.550416l-.98552-4.72333334L40.64 4.32939394v-.18318182h-.026416l-.296672 7.10469698h-2.160016l.890016-9.86424243z"
14343
+ }), /*#__PURE__*/React__default.createElement("path", {
14344
+ d: "M35.310064 1.38469697c-.3577988.27917284-.6303655.64756811-.788416 1.06560606-.526288 1.22909091.036576 2.16666667.534416 3.00575758.073152.12409091.148336.24818181.217424.37227272 1.085088 1.80424243 1.515872 3.13378788.705104 5.02863637-.056896.1339394-.191008.3939394-.191008.3939394h-2.424176c.3204254-.2482168.5741848-.5678542.739648-.9316667.556768-1.30196967-.099568-2.49166664-.735584-3.64393937-.764032-1.37878788-1.552448-2.81863636-.715264-4.78045455.079248-.18712121.254-.50424242.254-.50424242l2.403856-.00590909z",
14345
+ fillRule: "nonzero"
14346
+ }))), /*#__PURE__*/React__default.createElement("g", {
14347
+ className: "xs:flex xs:-translate-x-[40px] hidden md:!translate-x-0"
14348
+ }, /*#__PURE__*/React__default.createElement("path", {
14349
+ className: "stroke-white",
14350
+ d: "M61.496448 0v12.8680303",
14351
+ strokeWidth: "1.68"
14352
+ }), /*#__PURE__*/React__default.createElement("g", {
14353
+ className: "fill-white"
14354
+ }, /*#__PURE__*/React__default.createElement("path", {
14355
+ d: "M70.841616 9.70863636c-.999744 0-1.7888373-.29479798-2.36728-.88439394-.5784427-.58959596-.867664-1.40964646-.867664-2.46015151 0-1.05707071.2709333-1.89681818.8128-2.51924243.5304376-.61728629 1.3256457-.96197654 2.15392-.93363636.7626734-.03509605 1.5014967.26264579 2.013712.81151515.4944533.53969697.7410027 1.25272728.739648 2.13909091v.62833334h-4.659376c.022352.77015151.221488 1.35318181.6096 1.7530303.388112.39984848.916432.59090909 1.607312.59090909.743701-.00293405 1.4788698-.15377248 2.160016-.44318182v.88636364c-.3298144.14174433-.6736336.25063692-1.02616.325-.3855929.07188992-.7778273.1048941-1.170432.09848485m-.27432-5.95242425c-.4900374-.02138848-.9649513.16736328-1.298448.51606061-.3477231.40033357-.5485505.90121019-.570992 1.42409091h3.53568c0-.62636364-.14224-1.1069697-.430784-1.43984849-.3103282-.34233825-.7661196-.52691285-1.235456-.50030303",
14356
+ fillRule: "nonzero"
14357
+ }), /*#__PURE__*/React__default.createElement("path", {
14358
+ d: "M75.053952 6.25575758c-.0151689-.21657791.0536783-.43083638.19304-.60075758.1381463-.1429001.3347885-.21871211.536448-.20681818.2081607-.01140173.4114497.0638378.5588.20681818.2680858.35762602.2680858.84191943 0 1.19954545-.3018073.26987298-.7638609.27916874-1.07696.02166667-.1529999-.17086259-.2265151-.39533511-.2032-.62045454",
14359
+ fillRule: "nonzero"
14360
+ }), /*#__PURE__*/React__default.createElement("path", {
14361
+ d: "M81.586832 9.70863636c-.979424 0-1.73736-.29217171-2.273808-.87651515-.536448-.58434343-.8073813-1.41095959-.8128-2.47984848 0-1.09777778.2709333-1.94540404.8128-2.54287879.5418667-.59747475 1.318768-.89686869 2.330704-.89818182.3279782-.00003668.654999.03430434.97536.10242424.2639542.04817256.5206342.12824173.764032.23833334l-.31496.845c-.2397537-.0929503-.4871838-.16608946-.739648-.21863637-.2330197-.05435362-.4715521-.08342113-.7112-.08666666-1.373632 0-2.060448.84959596-2.060448 2.54878788 0 .80494949.1673013 1.42343434.501904 1.85545454.33528.42939394.83312.64606061 1.491488.64606061.5966181-.00678768 1.1861142-.12655871 1.735328-.35257576v.87848485c-.5339642.24467285-1.120715.3615322-1.710944.34075757",
14362
+ fillRule: "nonzero"
14363
+ }), /*#__PURE__*/React__default.createElement("path", {
14364
+ d: "M90.690192 6.30893939c0 1.06757576-.278384 1.90207071-.835152 2.50348485-.556768.60141414-1.3241867.90146465-2.302256.90015152-.5660565.00980534-1.1238362-.13269357-1.611376-.41166667-.4744234-.28111893-.8520726-.69243374-1.085088-1.18181818-.2674171-.5661279-.3987341-1.18372355-.384048-1.80621212 0-1.06888889.2756747-1.90207071.827024-2.49954546.5513493-.59747474 1.316736-.89555555 2.29616-.89424242.8559447-.03726298 1.6841715.29875604 2.257552.91590909.556768.61060606.8358293 1.43656566.837184 2.47787879m-5.155184 0c0 .83777778.17272 1.47595959.51816 1.91454545.34544.43858586.85344.65787879 1.524.65787879s1.1799147-.21863636 1.528064-.65590909.522224-1.07611111.522224-1.91651515c0-.83515152-.1740747-1.46873738-.522224-1.90075758-.3481493-.4320202-.861568-.64868687-1.540256-.65-.67056 0-1.176528.21469697-1.517904.64015152-.341376.42545454-.512064 1.06363636-.512064 1.91060606",
14365
+ fillRule: "nonzero"
14366
+ }), /*#__PURE__*/React__default.createElement("path", {
14367
+ d: "M96.989392 9.58848485V5.34575758c0-.53444445-.1253067-.9329798-.37592-1.19560606-.251968-.2639394-.644144-.3939394-1.180592-.3939394-.707136 0-1.225296.18580808-1.55448.55742424-.329184.37161617-.493776.98419192-.493776 1.83772728v3.43909091h-1.02616V3.03136364h.83312l.168656.89621212h.048768c.213947-.32669621.5199877-.58712571.881888-.75045455.3956439-.18075251.8285923-.27169306 1.265936-.26590909.8128 0 1.4257867.19040404 1.83896.57121212.4131733.38080808.6163733.99010101.6096 1.82787879v4.27818182h-1.016z",
14368
+ fillRule: "nonzero"
14369
+ }), /*#__PURE__*/React__default.createElement("path", {
14370
+ d: "M105.759504 6.30893939c0 1.06757576-.277707 1.90207071-.83312 2.50348485-.555413.60141414-1.322832.90146465-2.302256.90015152-.566147.01053143-1.124127-.1320188-1.611376-.41166667-.474546-.2815508-.852738-.69268701-1.08712-1.18181818-.2666505-.56630799-.397268-1.18388155-.382016-1.80621212 0-1.06888889.2756747-1.90207071.827024-2.49954546.551349-.59747474 1.316736-.89555555 2.29616-.89424242.948267 0 1.700107.30530303 2.25552.91590909.555413.61060606.834475 1.43525253.837184 2.47393939m-5.155184 0c0 .83777778.17272 1.4759596.51816 1.91454546.34544.43924242.855472.65787879 1.526032.65787879.589088.03526465 1.159066-.20939357 1.528064-.65590909.348149-.43727273.521547-1.07611112.520192-1.91651516-.001355-.84040404-.174752-1.4739899-.520192-1.90075757-.349504-.43333334-.861568-.65-1.540256-.65-.678688 0-1.17856.21469697-1.519936.64015151-.341376.42545455-.512064 1.06363637-.512064 1.91060606",
14371
+ fillRule: "nonzero"
14372
+ }), /*#__PURE__*/React__default.createElement("path", {
14373
+ d: "M116.1796 9.58848485V5.32409091c0-.52525253-.115147-.91919192-.34544-1.18181818-.229616-.26-.58928-.3939394-1.074928-.3939394-.635339 0-1.109472.1779293-1.4224.53378788-.312928.35585859-.465328.90212121-.4572 1.63878788v3.66166667h-1.016V5.32409091c0-.52525253-.115824-.91919192-.347472-1.18181818-.229616-.26-.58928-.3939394-1.078992-.3939394-.642112 0-1.113536.1969697-1.410208.55939394-.296672.36242425-.449072.98484849-.449072 1.83575758v3.43909091h-1.016V3.03136364h.83312l.166624.89621212h.0508c.192326-.31859024.474248-.57752095.8128-.74651515.36534-.18279258.771528-.27547583 1.182624-.26984849 1.05664 0 1.748197.3709596 2.074672 1.11287879h.048768c.20551-.34688729.509496-.62924665.875792-.81348485.403616-.20402984.853472-.30695163 1.308608-.29939394.765387 0 1.338411.19040404 1.719072.57121212.380661.38080808.570992.99010101.570992 1.82787879v4.27818182h-1.02616z",
14374
+ fillRule: "nonzero"
14375
+ }), /*#__PURE__*/React__default.createElement("path", {
14376
+ d: "M119.16664 1.25272727c-.016875-.18221767.045768-.36295537.17272-.49833333.243232-.21393452.614272-.21393452.857504 0 .129279.13353172.194239.31385023.178816.49636364.015568.18371514-.049334.36530074-.178816.50030303-.240531.22061195-.616973.22061195-.857504 0-.125769-.13683457-.188192-.31765204-.17272-.50030303v.00196969zm1.111504 8.33378788h-1.02616V3.03136364h1.02616v6.55515151z",
14377
+ fillRule: "nonzero"
14378
+ }), /*#__PURE__*/React__default.createElement("path", {
14379
+ d: "M125.091952 9.70863636c-.979424 0-1.738037-.29217171-2.27584-.87651515-.537803-.58434343-.808736-1.41095959-.8128-2.47984848 0-1.09777778.270933-1.94540404.8128-2.54287879.541867-.59747475 1.318768-.89686869 2.330704-.89818182.327978-.00003668.654999.03430434.97536.10242424.264596.04821437.521943.12827865.766064.23833334l-.31496.845c-.239852-.09267891-.487258-.16581103-.739648-.21863637-.233047-.05421-.471563-.08327549-.7112-.08666666-1.373632 0-2.061125.84959596-2.06248 2.54878788 0 .80494949.167979 1.42343434.503936 1.85545454.33528.42939394.83312.64606061 1.491488.64606061.595961-.00679074 1.184792-.12656681 1.733296-.35257576v.87848485c-.533172.24487796-1.119318.3617557-1.708912.34075757",
14380
+ fillRule: "nonzero"
14381
+ }))));
14382
+ });
14383
+
14384
+ const getChildWidths = parent => {
14385
+ const widths = [];
14386
+ for (let index = 0; index < parent.children.length; index++) {
14387
+ const childRect = parent.children[index].getBoundingClientRect();
14388
+ widths.push(childRect.width);
14389
+ }
14390
+ return widths;
14391
+ };
14392
+ const ChildrenWidth = ({
14393
+ setWidth,
14394
+ children
14395
+ }) => {
14396
+ const ref = React__default.useRef(null);
14397
+ const [show, setShow] = React__default.useState(true);
14398
+ React__default.useEffect(() => {
14399
+ // Calculate the width of children, and then hides the portal
14400
+ if (ref.current && show) {
14401
+ setWidth(getChildWidths(ref.current));
14402
+ setShow(false);
14403
+ }
14404
+ }, [show]);
14405
+ React__default.useEffect(() => {
14406
+ // If children changes, then we render the children to calculate their width
14407
+ if (!show) {
14408
+ setShow(true);
14409
+ }
14410
+ }, [children]);
14411
+ return show ? /*#__PURE__*/React__default.createElement(reactPortal.Portal, {
14412
+ className: cn('invisible absolute z-[-10] flex translate-x-[-1000px]'),
14413
+ ref: ref
14414
+ }, children) : null;
14415
+ };
14416
+ const useBoundaryIndex = (wrapperWidth, buttonRef, childWidths) => {
14417
+ // Primary navigation has a gap of gap-1, so we need to take the gap value in account as well
14418
+ // left gap + right gap = 8px
14419
+ const GAP = 8;
14420
+ return React__default.useMemo(() => {
14421
+ if (childWidths.length && wrapperWidth && buttonRef.current) {
14422
+ const realWidth = wrapperWidth - buttonRef.current.getBoundingClientRect().width - GAP;
14423
+ let boundary;
14424
+ let total = 0;
14425
+ childWidths.every((width, index) => {
14426
+ const nextWidth = total + width + GAP;
14427
+ if (nextWidth > realWidth) {
14428
+ boundary = index;
14429
+ return false;
14430
+ }
14431
+ total = nextWidth;
14432
+ return true;
14433
+ });
14434
+ return boundary;
14435
+ }
14436
+ return undefined;
14437
+ }, [childWidths, wrapperWidth]);
14438
+ };
14439
+ const PrimaryNavigation = /*#__PURE__*/React__default.forwardRef(function PrimaryNavigation(props, ref) {
14440
+ var _rect$width;
14441
+ const {
14442
+ texts
14443
+ } = useLocalization();
14444
+ const internalRef = useMergedRef(ref);
14445
+ const rect = useBoundingClientRectListener(internalRef);
14446
+ const buttonRef = React__default.useRef(null);
14447
+ const [childWidths, setChildWidths] = React__default.useState([]);
14448
+ const boundaryIndex = useBoundaryIndex((_rect$width = rect === null || rect === void 0 ? void 0 : rect.width) !== null && _rect$width !== void 0 ? _rect$width : 0, buttonRef, childWidths);
14449
+ const className = cn('flex h-full w-full flex-grow items-center overflow-hidden active:outline-none relative', props.className);
14450
+ const moreButtonClassName = cn(getLinkClasses(), '!bg-transparent aria-expanded:!bg-white/[.08]');
14451
+ const [visibleChildren, hiddenChildren] = React__default.useMemo(() => {
14452
+ const visibleChildren = [];
14453
+ const hiddenChildren = [];
14454
+ React__default.Children.forEach(props.children, (child, index) => {
14455
+ if ( /*#__PURE__*/React__default.isValidElement(child) && !!child) {
14456
+ if (boundaryIndex && index >= boundaryIndex) {
14457
+ hiddenChildren.push(child);
14458
+ } else {
14459
+ visibleChildren.push(child);
14460
+ }
14461
+ }
14462
+ });
14463
+ return [visibleChildren, hiddenChildren];
14464
+ }, [boundaryIndex, props.children]);
14465
+ return /*#__PURE__*/React__default.createElement("nav", Object.assign({}, props, {
14466
+ className: className,
14467
+ ref: internalRef
14468
+ }), /*#__PURE__*/React__default.createElement("ul", {
14469
+ className: "mb-0 flex h-full w-full items-center gap-1 overflow-hidden px-1"
14470
+ }, visibleChildren, /*#__PURE__*/React__default.createElement("li", {
14471
+ className: cn({
14472
+ invisible: boundaryIndex === undefined
14473
+ })
14474
+ }, /*#__PURE__*/React__default.createElement(Button$1, {
14475
+ className: moreButtonClassName,
14476
+ menu: menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, {
14477
+ className: "hidden lg:block"
14478
+ }, hiddenChildren.map((child, index) => {
14479
+ const href = child.props.to || child.props.href;
14480
+ const target = href !== null && href !== void 0 && href.startsWith('http') ? '_blank' : '_self';
14481
+ // Removing className prop so that custom styling cannot be applied on Menu.Link
14482
+ const {
14483
+ as,
14484
+ className: _,
14485
+ ...otherProps
14486
+ } = child.props;
14487
+ if (as) {
14488
+ return /*#__PURE__*/React__default.cloneElement(child, {
14489
+ as: Menu$1.Link,
14490
+ key: index,
14491
+ target,
14492
+ ...otherProps
14493
+ });
14494
+ }
14495
+ return /*#__PURE__*/React__default.createElement(Menu$1.Link, Object.assign({
14496
+ key: index,
14497
+ target: target
14498
+ }, otherProps));
14499
+ }))),
14500
+ ref: buttonRef
14501
+ }, texts.header.more))), /*#__PURE__*/React__default.createElement(ChildrenWidth, {
14502
+ setWidth: setChildWidths
14503
+ }, props.children));
14504
+ });
14505
+
14506
+ const SecondaryNavigation = /*#__PURE__*/React__default.forwardRef(function SecondaryNavigation(props, ref) {
14507
+ const className = cn('flex h-full items-center gap-2 mb-0', props.className);
14508
+ return /*#__PURE__*/React__default.createElement("ul", Object.assign({}, props, {
14509
+ className: className,
14510
+ ref: ref
14511
+ }));
14512
+ });
14513
+
14514
+ const MenuButton = /*#__PURE__*/React__default.forwardRef(function MenuButton(props, ref) {
14515
+ const className = cn(getButtonClasses$1(), 'ml-1 -mr-1 !bg-transparent hover:!bg-white/[.08] focus:!bg-white/[.08]] lg:hidden');
14516
+ return /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, props, {
14517
+ className: className,
14518
+ icon: "menu",
14519
+ ref: ref
14520
+ }));
14521
+ });
14522
+
14523
+ const AgreementDetails = props => {
14524
+ const {
14525
+ children,
14526
+ className: customClassName,
14527
+ fallbackImageSrc,
14528
+ ...agreement
14529
+ } = props;
14530
+ const className = cn('w-full rounded flex w-full px-1.5 xl:px-2 gap-2 overflow-hidden text-left items-center', customClassName);
14531
+ let badge;
14532
+ if (agreement.isAdministrator) {
14533
+ badge = /*#__PURE__*/React__default.createElement(Badge, {
14534
+ color: "blue",
14535
+ small: true,
14536
+ className: "ml-2"
14537
+ }, "Admin");
14538
+ } else if (agreement.isDeveloper) {
14539
+ badge = /*#__PURE__*/React__default.createElement(Badge, {
14540
+ color: "blue",
14541
+ small: true,
14542
+ className: "ml-2"
14543
+ }, "Developer");
14544
+ }
14545
+ return /*#__PURE__*/React__default.createElement("span", {
14546
+ className: className
14547
+ }, /*#__PURE__*/React__default.createElement(Image, {
14548
+ fallbackSrc: fallbackImageSrc,
14549
+ src: agreement.imageSrc,
14550
+ title: `${agreement.name} - ${agreement.number} ${agreement.userId}`
14551
+ }), /*#__PURE__*/React__default.createElement("span", {
14552
+ className: "flex flex-col overflow-hidden"
14553
+ }, /*#__PURE__*/React__default.createElement("span", {
14554
+ className: "flex truncate text-white",
14555
+ title: agreement.name
14556
+ }, /*#__PURE__*/React__default.createElement("span", {
14557
+ className: "truncate"
14558
+ }, agreement.name), ' ', agreement.secure ? /*#__PURE__*/React__default.createElement(Icon, {
14559
+ name: "secure-tick",
14560
+ className: "ml-1 mt-0.5 mb-0.5 !h-4 !w-4 flex-shrink-0 flex-grow-0"
14561
+ }) : null), /*#__PURE__*/React__default.createElement("span", {
14562
+ className: "text-grey-100 whitespace-nowrap text-xs"
14563
+ }, agreement.number, " ", agreement.userId, " ", badge)), children);
14564
+ };
14565
+ const Image = /*#__PURE__*/React__default.forwardRef(function AccountImage(props, ref) {
14566
+ const {
14567
+ src,
14568
+ fallbackSrc,
14569
+ ...otherProps
14570
+ } = props;
14571
+ const [loaded, setLoaded] = React__default.useState(false);
14572
+ const handleLoad = () => setLoaded(true);
14573
+ const handleError = event => {
14574
+ event.target.src = fallbackSrc;
14575
+ };
14576
+ const className = cn('h-9 w-9 rounded-full shrink-0 group-focus:yt-focus-dark xl:group-focus:shadow-none', {
14577
+ visible: loaded
14578
+ }, props.className);
14579
+ return /*#__PURE__*/React__default.createElement("img", Object.assign({}, otherProps, {
14580
+ className: className,
14581
+ src: src,
14582
+ onLoad: handleLoad,
14583
+ onError: handleError,
14584
+ alt: "Company logo",
14585
+ ref: ref
14586
+ }));
14587
+ });
14588
+
14589
+ const Container$1 = props => {
14590
+ return /*#__PURE__*/React__default.createElement("div", {
14591
+ className: "-ml-3 flex flex-shrink-0 flex-grow-0 items-center gap-2 xl:ml-auto xl:w-64 xl:pr-2"
14592
+ }, /*#__PURE__*/React__default.createElement("span", {
14593
+ className: "hidden h-8 w-px flex-shrink-0 flex-grow-0 bg-white/[0.3] xl:flex"
14594
+ }), props.children);
14595
+ };
14596
+ function AgreementDisplay(props) {
14597
+ const {
14598
+ currentAgreement,
14599
+ fallbackImageSrc
14600
+ } = props;
14601
+ return /*#__PURE__*/React__default.createElement(Container$1, null, /*#__PURE__*/React__default.createElement(AgreementDetails, Object.assign({}, currentAgreement, {
14602
+ className: "h-12 [&>span>span]:hidden xl:[&>span>span]:flex ",
14603
+ fallbackImageSrc: fallbackImageSrc
14604
+ })));
14605
+ }
14606
+ function AgreementSelector(props) {
14607
+ const {
14608
+ agreements,
14609
+ currentAgreement,
14610
+ fallbackImageSrc,
14611
+ filterAgreement = () => true,
14612
+ filterClientAgreement = () => true,
14613
+ onAddAgreement: handleAddAgreement,
14614
+ onChangeAgreement,
14615
+ onLogout: handleLogout,
14616
+ open: prop,
14617
+ setOpen: onChange
14618
+ } = props;
14619
+ const {
14620
+ texts
14621
+ } = useLocalization();
14622
+ const collectionRef = React__default.useRef(null);
14623
+ const [open, setOpen] = reactUseControllableState.useControllableState({
14624
+ onChange,
14625
+ prop
14626
+ });
14627
+ const [search, setSearch] = React__default.useState('');
14628
+ React__default.useEffect(() => {
14629
+ setSearch('');
14630
+ }, [open]);
14631
+ const handleKeyDown = event => {
14632
+ if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter') {
14633
+ var _collectionRef$curren;
14634
+ event.preventDefault();
14635
+ (_collectionRef$curren = collectionRef.current) === null || _collectionRef$curren === void 0 ? void 0 : _collectionRef$curren.dispatchEvent(createCustomKeyboardEvent(event));
14636
+ }
14637
+ };
14638
+ const handleChangeAgreement = agreement => {
14639
+ onChangeAgreement(agreement);
14640
+ setOpen(false);
14641
+ };
14642
+ return /*#__PURE__*/React__default.createElement(Container$1, null, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Root, {
14643
+ open: open,
14644
+ onOpenChange: setOpen
14645
+ }, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Trigger, {
14646
+ className: "xl:focus-visible:yt-focus-dark [&:focus-visible_img]:yt-focus-dark w-full rounded outline-none xl:[&:focus-visible_img]:shadow-none"
14647
+ }, /*#__PURE__*/React__default.createElement(AgreementDetails, Object.assign({}, currentAgreement, {
14648
+ className: "h-12 flex-grow xl:hover:bg-white/[0.16] [&>span>span]:hidden xl:[&>span>span]:flex [[aria-current='true']>&]:bg-white/[0.16]",
14649
+ fallbackImageSrc: fallbackImageSrc
14650
+ }), agreements ? /*#__PURE__*/React__default.createElement(Icon, {
14651
+ className: "ml-auto hidden flex-shrink-0 flex-grow-0 text-white xl:flex",
14652
+ name: open ? 'chevron-up' : 'chevron-down'
14653
+ }) : null)), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Content, {
14654
+ className: "z-[996] mt-2 flex h-[calc(100vh_-_theme(spacing.16))] w-64 flex-col gap-1 bg-blue-900"
14655
+ }, /*#__PURE__*/React__default.createElement(SearchInput, {
14656
+ autoFocus: true,
14657
+ className: "focus-visible:!yt-focus-dark mx-2 !border-transparent !bg-white/[0.08] !text-white hover:!bg-white/[0.16] hover:!shadow-none focus:!bg-white/[0.16] active:!bg-white/[0.16] [&+div>button]:!text-white",
14658
+ onChange: event => setSearch(event.target.value),
14659
+ onKeyDown: handleKeyDown,
14660
+ placeholder: texts.header.search
14661
+ }), /*#__PURE__*/React__default.createElement(Root, {
14662
+ querySelector: "button",
14663
+ className: "-my-1 flex w-full flex-grow flex-col gap-1 overflow-auto px-2 py-1 outline-none",
14664
+ ref: collectionRef,
14665
+ tabIndex: -1
14666
+ }, agreements === null || agreements === void 0 ? void 0 : agreements.filter(agreement => filterAgreement(agreement, filterBySearchValue(search))).map(agreement => {
14667
+ const button = createAgreementButton(agreement, fallbackImageSrc, handleChangeAgreement, isCurrentAgreement(agreement, currentAgreement));
14668
+ if (agreement.clients) {
14669
+ return /*#__PURE__*/React__default.createElement("span", {
14670
+ className: "flex flex-col gap-px [&>*:first-child>span]:!rounded-t [&>*:last-child>span]:!rounded-b [&>*>span]:!rounded-none",
14671
+ key: `${agreement.number}_${agreement.userId}_clients`
14672
+ }, filterBySearchValue(search)(agreement) ? button : null, agreement.clients.filter(agreement => filterClientAgreement(agreement, filterBySearchValue(search))).map(clientAgreement => createAgreementButton(clientAgreement, fallbackImageSrc, handleChangeAgreement, isCurrentAgreement(clientAgreement, currentAgreement))));
14673
+ }
14674
+ return button;
14675
+ })), handleAddAgreement ? /*#__PURE__*/React__default.createElement(Button$1, {
14676
+ className: "focus-visible:!yt-focus-dark my-1 mx-2 !h-9 shrink-0 !bg-white/[0.08] !text-white hover:!bg-white/[0.16]",
14677
+ onClick: handleAddAgreement
14678
+ }, texts.header.addAgreement) : null, /*#__PURE__*/React__default.createElement("hr", {
14679
+ className: "my-0 h-px w-full bg-white/[0.08]"
14680
+ }), /*#__PURE__*/React__default.createElement("a", {
14681
+ className: "focus-visible:yt-focus-dark mx-2 mb-2 flex h-8 shrink-0 items-center justify-center rounded text-white hover:cursor-pointer hover:text-white hover:underline focus-visible:outline-none",
14682
+ onClick: handleLogout,
14683
+ tabIndex: 0
14684
+ }, texts.header.logout))));
14685
+ }
14686
+ const filterBySearchValue = search => agreement => {
14687
+ if (!search || !search.length) {
14688
+ return true;
14689
+ }
14690
+ const matchesAgreementNumber = String(agreement.number).indexOf(search) > -1;
14691
+ const matchesCompanyName = agreement.name.toLowerCase().indexOf(search.toLowerCase()) > -1;
14692
+ return matchesAgreementNumber || matchesCompanyName;
14693
+ };
14694
+ const isCurrentAgreement = (agreement, currentAgreement) => {
14695
+ return agreement.number === currentAgreement.number && agreement.userId === currentAgreement.userId;
14696
+ };
14697
+ const createAgreementButton = (agreement, fallbackImageSrc, onChangeAgreement, isCurrentAgreement = false) => /*#__PURE__*/React__default.createElement("button", {
14698
+ "aria-current": isCurrentAgreement ? 'true' : undefined,
14699
+ className: "focus:yt-focus-dark w-full rounded outline-none",
14700
+ key: `${agreement.number}_${agreement.userId}`,
14701
+ onClick: () => onChangeAgreement(agreement),
14702
+ onKeyDown: () => onChangeAgreement(agreement),
14703
+ tabIndex: 0
14704
+ }, /*#__PURE__*/React__default.createElement(AgreementDetails, Object.assign({}, agreement, {
14705
+ className: "h-14 bg-white/[0.08] xl:hover:bg-white/[0.16] [[aria-current='true']>&]:bg-white/[0.16]",
14706
+ fallbackImageSrc: fallbackImageSrc
14707
+ })));
14708
+
14709
+ const Header$2 = /*#__PURE__*/React__default.forwardRef(function Header(props, ref) {
14710
+ const className = cn('bg-blue-900 flex h-16 w-full shrink-0 items-center gap-4 pl-2', '[&>a:focus-visible]:yt-focus-dark [&>a]:px-2 [&>a]:rounded [&>a]:h-[calc(100%-14px)]',
14711
+ // styles for logo wrapped inside an anchor
14712
+ props.className);
14713
+ return /*#__PURE__*/React__default.createElement("header", Object.assign({}, props, {
14714
+ className: className,
14715
+ ref: ref
14716
+ }));
14717
+ });
14718
+ Header$2.AgreementDisplay = AgreementDisplay;
14719
+ Header$2.AgreementSelector = AgreementSelector;
14720
+ Header$2.Button = Button$3;
14721
+ Header$2.Link = Link$1;
14722
+ Header$2.Logo = Logo;
14723
+ Header$2.PrimaryNavigation = PrimaryNavigation;
14724
+ Header$2.SecondaryNavigation = SecondaryNavigation;
14725
+ Header$2.MenuButton = MenuButton;
14726
+
14727
+ const LayoutContext = /*#__PURE__*/React__default.createContext({
14728
+ sidebarOpen: false,
14729
+ setSidebarOpen: () => undefined
14730
+ });
14731
+
14732
+ const Content$8 = /*#__PURE__*/React__default.forwardRef(function LayoutContent(props, ref) {
14733
+ const className = cn('flex-grow overflow-y-auto bg-white flex flex-shrink flex-col relative', props.className);
14734
+ return /*#__PURE__*/React__default.createElement("main", Object.assign({}, props, {
14735
+ className: className,
14736
+ ref: ref
14737
+ }));
14738
+ });
14739
+
14740
+ const useMatchMedia = (query, defaultMatches = false) => {
14741
+ const [matches, setMatches] = React__default.useState(defaultMatches);
14742
+ const handleChange = React__default.useCallback(event => setMatches(event.matches), []);
14743
+ React__default.useEffect(() => {
14744
+ const mediaQuery = window.matchMedia(query);
14745
+ setMatches(mediaQuery.matches);
14746
+ mediaQuery.addEventListener('change', handleChange);
14747
+ return () => {
14748
+ mediaQuery.removeEventListener('change', handleChange);
14749
+ };
14750
+ }, []);
14751
+ return matches;
14752
+ };
14753
+
14754
+ const useIsLargeScreen = () => useMatchMedia('(min-width: 1024px)', window.innerWidth > 1024);
14755
+
14756
+ const SidebarBackdrop = /*#__PURE__*/React__default.forwardRef(function SidebarBackdrop(props, ref) {
14757
+ const internalRef = useMergedRef(ref);
14758
+ React__default.useEffect(() => {
14759
+ if (internalRef.current) {
14760
+ internalRef.current.style.opacity = '1'; // Trigger the animation
14761
+ }
14762
+
14763
+ return () => {
14764
+ if (internalRef.current) {
14765
+ internalRef.current.style.opacity = '0'; // Reset to the initial value
14766
+ }
14767
+ };
14768
+ }, []);
14769
+ return /*#__PURE__*/React__default.createElement(Backdrop, Object.assign({}, props, {
14770
+ className: "absolute z-[1] opacity-0 transition-opacity duration-300",
14771
+ ref: internalRef
14772
+ }));
14773
+ });
14774
+ const Sidebar = /*#__PURE__*/React__default.forwardRef(function LayoutSidebar(props, ref) {
14775
+ const {
14776
+ children,
14777
+ ...attributes
14778
+ } = props;
14779
+ const {
14780
+ sidebarOpen,
14781
+ setSidebarOpen
14782
+ } = React__default.useContext(LayoutContext);
14783
+ const isLargeScreen = useIsLargeScreen();
14784
+ const isSmallScreen = !isLargeScreen;
14785
+ // if it's a large screen we override the open state and make it always visible
14786
+ const isVisible = isLargeScreen || sidebarOpen;
14787
+ // ensures the menu is always closed by default when resizing to a smaller window size
14788
+ React__default.useEffect(() => {
14789
+ setSidebarOpen(isLargeScreen);
14790
+ }, [isLargeScreen]);
14791
+ React__default.useEffect(() => {
14792
+ const handleEscapeKey = event => {
14793
+ if (event.key === 'Escape') {
14794
+ event.preventDefault();
14795
+ event.stopPropagation();
14796
+ setSidebarOpen(false);
14797
+ }
14798
+ };
14799
+ if (isSmallScreen && sidebarOpen) {
14800
+ window.addEventListener('keydown', handleEscapeKey);
14801
+ }
14802
+ return () => {
14803
+ window.removeEventListener('keydown', handleEscapeKey);
14804
+ };
14805
+ }, [isSmallScreen, sidebarOpen]);
14806
+ const showBackdrop = isSmallScreen && sidebarOpen === true;
14807
+ const className = cn('bg-grey-50 h-full w-64 flex-shrink-0 flex-grow-0', {
14808
+ 'transition-[transform] duration-300 absolute z-10 aria-hidden:-translate-x-64': isSmallScreen,
14809
+ 'border-r-2 border-black/[.08] ': !showBackdrop
14810
+ }, props.className);
14811
+ const toggleSidebar = () => setSidebarOpen(open => !open);
14812
+ const content = typeof children === 'function' ? children({
14813
+ isLargeScreen,
14814
+ open: sidebarOpen,
14815
+ toggleSidebar
14816
+ }) : children;
14817
+ if (!content) {
14818
+ return null;
14819
+ }
14820
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("nav", Object.assign({}, attributes, {
14821
+ "data-responsive": isSmallScreen,
14822
+ "aria-hidden": !isVisible,
14823
+ className: className,
14824
+ ref: ref
14825
+ }), content), showBackdrop ? /*#__PURE__*/React__default.createElement(SidebarBackdrop, {
14826
+ onClick: () => setSidebarOpen(false)
14827
+ }) : null);
14828
+ });
14829
+
14830
+ const Top = props => {
14831
+ const {
14832
+ setSidebarOpen
14833
+ } = React__default.useContext(LayoutContext);
14834
+ const toggleSidebar = () => setSidebarOpen(open => !open);
14835
+ return typeof props.children === 'function' ? props.children({
14836
+ toggleSidebar
14837
+ }) : props.children;
14838
+ };
14839
+
14840
+ const Page = /*#__PURE__*/React__default.forwardRef(function LayoutPage(props, ref) {
14841
+ const className = cn('flex flex-grow overflow-hidden relative', props.className);
14842
+ return /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
14843
+ className: className,
14844
+ ref: ref
14845
+ }));
14846
+ });
14847
+
14848
+ const Layout$1 = /*#__PURE__*/React__default.forwardRef(function Layout(props, ref) {
14849
+ const [sidebarOpen, setSidebarOpen] = React__default.useState(false);
14850
+ const className = cn('flex h-screen w-screen flex-col overflow-hidden relative', props.className);
14851
+ return /*#__PURE__*/React__default.createElement(LayoutContext.Provider, {
14852
+ value: {
14853
+ sidebarOpen,
14854
+ setSidebarOpen
14855
+ }
14856
+ }, /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
14857
+ className: className,
14858
+ ref: ref
14859
+ })));
14860
+ });
14861
+ Layout$1.Top = Top;
14862
+ Layout$1.Page = Page;
14863
+ Layout$1.Sidebar = Sidebar;
14864
+ Layout$1.Content = Content$8;
14865
+
14866
+ const Group$3 = /*#__PURE__*/React__default.forwardRef(function Group(props, ref) {
14867
+ const {
14868
+ children,
14869
+ defaultExpanded = false,
14870
+ heading,
14871
+ onClick,
14872
+ ...attributes
14873
+ } = props;
14874
+ const [expanded, setExpanded] = React__default.useState(defaultExpanded);
14875
+ const className = cn('flex w-full cursor-pointer items-center rounded px-3 font-bold text-left leading-8 hover:bg-black/[.06] focus-visible:yt-focus-dark', attributes.className);
14876
+ const handleClick = event => {
14877
+ setExpanded(!expanded);
14878
+ if (onClick) {
14879
+ onClick(event);
14880
+ }
14881
+ };
14882
+ return /*#__PURE__*/React__default.createElement("li", {
14883
+ role: "none",
14884
+ className: "[[role=menubar]>&]:px-3"
14885
+ }, /*#__PURE__*/React__default.createElement("button", Object.assign({}, attributes, {
14886
+ "aria-haspopup": "menu",
14887
+ "aria-expanded": expanded,
14888
+ "data-taco": "navigation2-group",
14889
+ className: className,
14890
+ onClick: handleClick,
14891
+ ref: ref,
14892
+ role: "menuitem"
14893
+ }), /*#__PURE__*/React__default.createElement(Icon, {
14894
+ className: "-ml-2 !h-5 !w-5",
14895
+ name: expanded ? 'chevron-down-solid' : 'chevron-right-solid'
14896
+ }), /*#__PURE__*/React__default.createElement("span", {
14897
+ className: "flex-grow truncate"
14898
+ }, heading)), /*#__PURE__*/React__default.createElement("ul", {
14899
+ className: cn('mb-0 flex flex-col gap-y-px pt-px', {
14900
+ hidden: !expanded
14901
+ }),
14902
+ role: "menu"
14903
+ }, children));
14904
+ });
14905
+
14906
+ const getNavigationLinkClasses = (isDraggedOver = false) => cn('group relative flex w-full items-center rounded leading-8 !text-black px-2 focus-visible:yt-focus-dark',
14907
+ // override styles for links that are children of collapsible menus
14908
+ 'font-bold [[role=menu]>li>&]:font-normal [[role=menu]>li>&]:pl-5',
14909
+ // override styles to adjust icons included in menu links
14910
+ '[&_[data-taco="icon"]]:!h-5 [&_[data-taco="icon"]]:!w-5',
14911
+ // override styles to adjust badges included in menu links
14912
+ '[&>span_[data-taco="badge"]]:mr-2.5 [[role=menu]>li>&>span_[data-taco="badge"]]:mr-2', {
14913
+ 'hover:bg-black/[.06] aria-current-page:bg-blue-500/[.1]': !isDraggedOver,
14914
+ '!bg-blue-500 !text-white [&>*]:!text-white': isDraggedOver
14915
+ });
14916
+ const Link$2 = /*#__PURE__*/React__default.forwardRef(function Link(props, ref) {
14917
+ const {
14918
+ active,
14919
+ children,
14920
+ icon,
14921
+ menu,
14922
+ onDrop,
14923
+ total,
14924
+ ...attributes
14925
+ } = props;
14926
+ const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);
14927
+ const className = cn(getNavigationLinkClasses(isDraggedOver), attributes.className);
14928
+ const listClassName = cn('[[role=menubar]>&]:px-3', {
14929
+ '[&>*]:pointer-events-none': isDraggedOver
14930
+ });
14931
+ return /*#__PURE__*/React__default.createElement("li", Object.assign({}, dropTargetProps, {
14932
+ className: listClassName,
14933
+ "data-taco": "navigation2-link-item",
14934
+ role: "none"
14935
+ }), /*#__PURE__*/React__default.createElement("a", Object.assign({}, attributes, {
14936
+ "aria-current": active ? 'page' : undefined,
14937
+ className: className,
14938
+ "data-taco": "navigation2-link",
14939
+ ref: ref,
14940
+ role: "menuitem",
14941
+ tabIndex: 0
14942
+ }), icon ? /*#__PURE__*/React__default.createElement(Icon, {
14943
+ className: "mr-1.5 [[role=menu]>li>a>&]:mr-0.5 [[role=menu]>li>a>&]:-ml-1.5",
14944
+ name: icon
14945
+ }) : null, /*#__PURE__*/React__default.createElement("span", {
14946
+ className: "flex flex-grow items-center truncate"
14947
+ }, children), menu ? /*#__PURE__*/React__default.createElement(IconButton, {
14948
+ appearance: "discrete",
14949
+ icon: "more",
14950
+ "aria-label": "More",
14951
+ rounded: true,
14952
+ className: cn('-mr-1.5 hidden flex-shrink-0 flex-grow-0 transition-none group-hover:flex aria-expanded:flex', {
14953
+ 'absolute right-0 !mr-0.5': total !== undefined
14954
+ }),
14955
+ menu: menu,
14956
+ onClick: event => {
14957
+ event.preventDefault();
14958
+ event.stopPropagation();
14959
+ }
14960
+ }) : null, total !== undefined ? /*#__PURE__*/React__default.createElement(Badge, {
14961
+ className: cn('flex-shrink-0 flex-grow-0 !font-normal', {
14962
+ 'group-hover:hidden [[aria-expanded="true"]+&]:hidden ': menu
14963
+ }),
14964
+ color: "transparent"
14965
+ }, total) : null));
14966
+ });
14967
+
14968
+ const Section = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
14969
+ const {
14970
+ children,
14971
+ heading,
14972
+ ...attributes
14973
+ } = props;
14974
+ const className = cn('w-full overflow-auto px-3 py-2 -mt-3 border-grey-200 [[data-taco="navigation2-link-item"]+&]:mt-2 bg-grey-50', '[[data-taco="navigation2-link-item"]+&]:border-t-2 [[data-taco="navigation2-section"]+&]:border-t-2', '[[data-taco="navigation2-link-item"]+&]:pt-2 [[data-taco="navigation2-section"]+&]:pt-2', props.className);
14975
+ return /*#__PURE__*/React__default.createElement("li", Object.assign({}, attributes, {
14976
+ className: className,
14977
+ "data-taco": "navigation2-section",
14978
+ ref: ref,
14979
+ role: "none"
14980
+ }), heading ? /*#__PURE__*/React__default.createElement("span", {
14981
+ className: "text-grey-500 mb-px truncate pl-5 text-xs font-bold uppercase leading-8 lg:hidden"
14982
+ }, heading) : null, /*#__PURE__*/React__default.createElement("ul", {
14983
+ className: "mb-0 flex flex-col gap-y-px"
14984
+ }, children));
14985
+ });
14986
+
14987
+ const Content$9 = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
14988
+ const {
14989
+ children,
14990
+ ...attributes
14991
+ } = props;
14992
+ const className = cn('w-full overflow-auto p-3 mt-auto border-grey-200 flex-shrink-0 z-10 bg-grey-50', '[[data-taco="navigation2-link"]+&]:border-t-2 [[data-taco="navigation2-section"]+&]:border-t-2', props.className);
14993
+ return /*#__PURE__*/React__default.createElement("li", Object.assign({}, attributes, {
14994
+ className: className,
14995
+ "data-taco": "navigation2-content",
14996
+ ref: ref,
14997
+ role: "none"
14998
+ }), children);
14999
+ });
15000
+
15001
+ const Navigation2 = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
15002
+ const {
15003
+ children,
15004
+ ...attributes
15005
+ } = props;
15006
+ const className = cn('mb-0 flex h-full flex-col gap-y-px overflow-auto pt-2 pb-0 w-full bg-grey-50', props.className);
15007
+ return /*#__PURE__*/React__default.createElement("ul", Object.assign({}, attributes, {
15008
+ className: className,
15009
+ "data-taco": "navigation2",
15010
+ ref: ref,
15011
+ role: "menubar",
15012
+ style: {
15013
+ opacity: 0.999
15014
+ }
15015
+ }), children);
15016
+ });
15017
+ Navigation2.Group = Group$3;
15018
+ Navigation2.Link = Link$2;
15019
+ Navigation2.Section = Section;
15020
+ Navigation2.Content = Content$9;
15021
+
14238
15022
  const useOnClickOutside = (ref, callback) => {
14239
15023
  React__default.useEffect(() => {
14240
15024
  const listener = event => {
@@ -14265,6 +15049,7 @@ exports.Button = Button$1;
14265
15049
  exports.Calendar = Calendar$1;
14266
15050
  exports.Card = Card;
14267
15051
  exports.Checkbox = Checkbox;
15052
+ exports.CollectionPrimitive = Collection;
14268
15053
  exports.Combobox = Combobox;
14269
15054
  exports.Datepicker = Datepicker;
14270
15055
  exports.Dialog = Dialog;
@@ -14272,16 +15057,19 @@ exports.Field = Field;
14272
15057
  exports.Form = Form;
14273
15058
  exports.Group = Group;
14274
15059
  exports.Hanger = Hanger;
15060
+ exports.Header = Header$2;
14275
15061
  exports.HoverCard = HoverCard;
14276
15062
  exports.Icon = Icon;
14277
15063
  exports.IconButton = IconButton;
14278
15064
  exports.Input = Input;
15065
+ exports.Layout = Layout$1;
14279
15066
  exports.Listbox = Listbox;
14280
15067
  exports.LocalizationContext = LocalizationContext;
14281
15068
  exports.LocalizationProvider = LocalizationProvider;
14282
15069
  exports.Menu = Menu$1;
14283
15070
  exports.MultiListbox = MultiListbox;
14284
15071
  exports.Navigation = Navigation;
15072
+ exports.Navigation2 = Navigation2;
14285
15073
  exports.PaginatedTable = PaginatedTable;
14286
15074
  exports.Pagination = Pagination;
14287
15075
  exports.Popover = Popover;
@@ -14312,6 +15100,7 @@ exports.defaultLocalisationTexts = defaultLocalisationTexts;
14312
15100
  exports.findByValue = findByValue$1;
14313
15101
  exports.format = format;
14314
15102
  exports.getByRowIndexPath = getByRowIndexPath;
15103
+ exports.getNavigationLinkClasses = getNavigationLinkClasses;
14315
15104
  exports.getNextIndexFromKey = getNextIndexFromKey;
14316
15105
  exports.getParentRowIndexPath = getParentRowIndexPath;
14317
15106
  exports.getRadioGroupItemValueAsString = getRadioGroupItemValueAsString;
@@ -14323,11 +15112,14 @@ exports.parseFromCustomString = parseFromCustomString;
14323
15112
  exports.parseFromISOString = parseFromISOString;
14324
15113
  exports.removeChildTableRow = removeChildTableRow;
14325
15114
  exports.setByRowIndexPath = setByRowIndexPath;
15115
+ exports.useBoundaryOverflowDetection = useBoundaryOverflowDetection;
14326
15116
  exports.useBoundingClientRectListener = useBoundingClientRectListener;
14327
15117
  exports.useDropTarget = useDropTarget;
15118
+ exports.useIsLargeScreen = useIsLargeScreen;
14328
15119
  exports.useListKeyboardNavigation = useListKeyboardNavigation;
14329
15120
  exports.useListScrollTo = useListScrollTo;
14330
15121
  exports.useLocalization = useLocalization;
15122
+ exports.useMatchMedia = useMatchMedia;
14331
15123
  exports.useMergedRef = useMergedRef;
14332
15124
  exports.useOnClickOutside = useOnClickOutside;
14333
15125
  exports.usePagination = usePagination;