@loomhq/lens 12.1.0 → 12.1.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.
package/dist/esm/index.js CHANGED
@@ -3246,9 +3246,9 @@ TextButton.displayName = "TextButton";
3246
3246
  var text_button_default = TextButton;
3247
3247
 
3248
3248
  // src/components/select/select.tsx
3249
- import styled17 from "@emotion/styled";
3249
+ import styled18 from "@emotion/styled";
3250
3250
  import Downshift from "downshift";
3251
- import React22, { useEffect as useEffect2, useState } from "react";
3251
+ import React23, { useEffect as useEffect2, useState } from "react";
3252
3252
  import { useLayer } from "react-laag";
3253
3253
  import ResizeObserver from "resize-observer-polyfill";
3254
3254
 
@@ -3282,8 +3282,8 @@ function SvgChevronDown() {
3282
3282
  }
3283
3283
 
3284
3284
  // src/components/menu/menu.tsx
3285
- import styled16 from "@emotion/styled";
3286
- import React21 from "react";
3285
+ import styled17 from "@emotion/styled";
3286
+ import React22 from "react";
3287
3287
 
3288
3288
  // src/components/icon/available-icons/check.tsx
3289
3289
  import CheckMarkIcon from "@atlaskit/icon/core/check-mark";
@@ -3292,6 +3292,56 @@ function SvgCheck() {
3292
3292
  return /* @__PURE__ */ React20.createElement(CheckMarkIcon, { label: "", testId: "ads-refreshed-icon" });
3293
3293
  }
3294
3294
 
3295
+ // src/components/align/align.tsx
3296
+ import styled16 from "@emotion/styled";
3297
+ import React21 from "react";
3298
+ var alignmentsPlaceItems = {
3299
+ topLeft: "start",
3300
+ topCenter: "start center",
3301
+ topRight: "start end",
3302
+ centerLeft: "center start",
3303
+ center: "center",
3304
+ centerRight: "center end",
3305
+ bottomLeft: "end start",
3306
+ bottomCenter: "end center",
3307
+ bottomRight: "end"
3308
+ };
3309
+ var getPlaceItems = (alignment) => {
3310
+ if (Array.isArray(alignment)) {
3311
+ return alignment.map(
3312
+ (alignmentArrayItem) => alignmentsPlaceItems[alignmentArrayItem]
3313
+ );
3314
+ }
3315
+ if (typeof alignment === "object") {
3316
+ const alignmentsPlaceItemsObject = {};
3317
+ Object.entries(alignment).forEach(([key, value]) => {
3318
+ return alignmentsPlaceItemsObject[key] = alignmentsPlaceItems[value];
3319
+ });
3320
+ return alignmentsPlaceItemsObject;
3321
+ }
3322
+ return alignmentsPlaceItems[alignment];
3323
+ };
3324
+ var AlignWrapper = styled16.div`
3325
+ width: 100%;
3326
+ height: 100%;
3327
+ display: grid;
3328
+ ${(props) => getResponsiveOneOf("place-items", getPlaceItems(props.alignment))};
3329
+ `;
3330
+ var Align = (_a) => {
3331
+ var _b = _a, {
3332
+ children,
3333
+ alignment = "center",
3334
+ htmlTag = "div"
3335
+ } = _b, props = __objRest(_b, [
3336
+ "children",
3337
+ "alignment",
3338
+ "htmlTag"
3339
+ ]);
3340
+ return /* @__PURE__ */ React21.createElement(AlignWrapper, __spreadValues({ alignment, as: htmlTag }, props), children);
3341
+ };
3342
+ var availableAlignments2 = Object.keys(alignmentsPlaceItems);
3343
+ var align_default = Align;
3344
+
3295
3345
  // src/components/menu/menu.tsx
3296
3346
  var menuPositions = {
3297
3347
  left: "bottom-start",
@@ -3301,7 +3351,7 @@ var menuPositions = {
3301
3351
  leftSide: "left-start",
3302
3352
  rightSide: "right-start"
3303
3353
  };
3304
- var MenuWrapper = styled16.ul`
3354
+ var MenuWrapper = styled17.ul`
3305
3355
  background-color: ${getColorValue("overlay")};
3306
3356
  list-style: none;
3307
3357
  padding: ${u(1.5)};
@@ -3315,7 +3365,7 @@ var MenuWrapper = styled16.ul`
3315
3365
  ${getShadow("medium")};
3316
3366
  ${getRadius("250")};
3317
3367
  `;
3318
- var MenuItemWrapper = styled16.li`
3368
+ var MenuItemWrapper = styled17.li`
3319
3369
  display: ${({ hidden }) => hidden ? "none" : "grid"};
3320
3370
  grid-auto-flow: column;
3321
3371
  grid-template-columns: ${(props) => props.columns};
@@ -3341,6 +3391,13 @@ var MenuItemWrapper = styled16.li`
3341
3391
  }
3342
3392
  `};
3343
3393
  `;
3394
+ var Image = styled17.img`
3395
+ height: 100%;
3396
+ width: auto;
3397
+ min-width: 100%;
3398
+ min-height: 100%;
3399
+ object-fit: cover;
3400
+ `;
3344
3401
  var MenuItem = (_a) => {
3345
3402
  var _b = _a, {
3346
3403
  isDisabled,
@@ -3361,7 +3418,7 @@ var MenuItem = (_a) => {
3361
3418
  const iconColumn = icon ? "auto" : "";
3362
3419
  const columns = `${iconColumn} 1fr ${checkColumn}`;
3363
3420
  const color = isDisabled ? "disabledContent" : void 0;
3364
- return /* @__PURE__ */ React21.createElement(
3421
+ return /* @__PURE__ */ React22.createElement(
3365
3422
  MenuItemWrapper,
3366
3423
  __spreadValues({
3367
3424
  isHighlighted,
@@ -3369,9 +3426,9 @@ var MenuItem = (_a) => {
3369
3426
  columns,
3370
3427
  hasDivider
3371
3428
  }, props),
3372
- icon && /* @__PURE__ */ React21.createElement(icon_default, { icon, color }),
3373
- /* @__PURE__ */ React21.createElement(text_default, { color, hasEllipsis: true }, children),
3374
- isSelected && /* @__PURE__ */ React21.createElement(icon_default, { icon: /* @__PURE__ */ React21.createElement(SvgCheck, null), color })
3429
+ icon && (typeof icon === "string" ? /* @__PURE__ */ React22.createElement(container_default, { radius: "50", width: 3, height: 3, overflow: "hidden" }, /* @__PURE__ */ React22.createElement(align_default, { alignment: "center" }, /* @__PURE__ */ React22.createElement(Image, { src: icon, alt: "" }))) : /* @__PURE__ */ React22.createElement(icon_default, { icon, color })),
3430
+ /* @__PURE__ */ React22.createElement(text_default, { color, hasEllipsis: true }, children),
3431
+ isSelected && /* @__PURE__ */ React22.createElement(icon_default, { icon: /* @__PURE__ */ React22.createElement(SvgCheck, null), color })
3375
3432
  );
3376
3433
  };
3377
3434
  var Menu = (_a) => {
@@ -3392,7 +3449,7 @@ var Menu = (_a) => {
3392
3449
  "children",
3393
3450
  "downshiftMenuProps"
3394
3451
  ]);
3395
- return /* @__PURE__ */ React21.createElement(
3452
+ return /* @__PURE__ */ React22.createElement(
3396
3453
  MenuWrapper,
3397
3454
  __spreadValues(__spreadValues({
3398
3455
  zIndex,
@@ -3407,10 +3464,10 @@ var Menu = (_a) => {
3407
3464
  var menu_default = Menu;
3408
3465
 
3409
3466
  // src/components/select/select.tsx
3410
- var SelectWrapper = styled17.div`
3467
+ var SelectWrapper = styled18.div`
3411
3468
  position: relative;
3412
3469
  `;
3413
- var SelectHeaderWrapper = styled17.button`
3470
+ var SelectHeaderWrapper = styled18.button`
3414
3471
  appearance: none;
3415
3472
  font: inherit;
3416
3473
  text-align: left;
@@ -3447,11 +3504,37 @@ var SelectHeaderWrapper = styled17.button`
3447
3504
  cursor: default;
3448
3505
  }
3449
3506
  `;
3507
+ var Image2 = styled18.img`
3508
+ height: 100%;
3509
+ width: auto;
3510
+ min-width: 100%;
3511
+ min-height: 100%;
3512
+ object-fit: cover;
3513
+ `;
3514
+ var Group = styled18.ul`
3515
+ list-style: none;
3516
+ margin: 0;
3517
+ padding: 0;
3518
+ `;
3519
+ var isGrouped = (options) => Array.isArray(options) && options.length > 0 && "group" in options[0];
3450
3520
  var getSelectedOptionObject = ({ options, selectedOptionValue }) => {
3451
- const selectedOptionArray = options.filter(
3452
- (option) => option.value === selectedOptionValue
3453
- );
3454
- return selectedOptionArray[0] || { icon: null, title: null };
3521
+ if (!options || !selectedOptionValue) {
3522
+ return { icon: null, title: null };
3523
+ }
3524
+ if (isGrouped(options)) {
3525
+ for (const option of options) {
3526
+ const foundItem = option.items.find(
3527
+ (item) => item.value === selectedOptionValue
3528
+ );
3529
+ if (foundItem) {
3530
+ return foundItem;
3531
+ }
3532
+ }
3533
+ } else {
3534
+ const foundItem = options.find((item) => item.value === selectedOptionValue);
3535
+ return foundItem || { icon: null, title: null };
3536
+ }
3537
+ return { icon: null, title: null };
3455
3538
  };
3456
3539
  var getIcon = ({ options, selectedItem, selectedOptionValue }) => {
3457
3540
  if (selectedItem) {
@@ -3500,14 +3583,13 @@ var SelectHeader = ({
3500
3583
  getInputProps,
3501
3584
  ariaMenuName
3502
3585
  }) => {
3503
- const hasIcon = Boolean(
3504
- getIcon({ options, selectedItem, selectedOptionValue })
3505
- );
3586
+ const icon = getIcon({ options, selectedItem, selectedOptionValue });
3587
+ const hasIcon = Boolean(icon);
3506
3588
  const hasPlaceholder = !selectedOptionValue && !selectedItem;
3507
3589
  const iconColumn = hasIcon ? "auto" : "";
3508
3590
  const columns = `${iconColumn} 1fr auto`;
3509
3591
  const color = isDisabled ? "disabledContent" : void 0;
3510
- return /* @__PURE__ */ React22.createElement(
3592
+ return /* @__PURE__ */ React23.createElement(
3511
3593
  SelectHeaderWrapper,
3512
3594
  __spreadProps(__spreadValues(__spreadValues({}, getToggleButtonProps()), getHeaderAccessibilityProps({
3513
3595
  selectedItem,
@@ -3519,20 +3601,20 @@ var SelectHeader = ({
3519
3601
  disabled: isDisabled,
3520
3602
  columns
3521
3603
  }),
3522
- hasIcon && /* @__PURE__ */ React22.createElement(
3604
+ hasIcon && (typeof icon === "string" ? /* @__PURE__ */ React23.createElement(container_default, { radius: "50", width: 3, height: 3, overflow: "hidden" }, /* @__PURE__ */ React23.createElement(align_default, { alignment: "center" }, /* @__PURE__ */ React23.createElement(Image2, { src: icon, alt: "" }))) : /* @__PURE__ */ React23.createElement(
3523
3605
  icon_default,
3524
3606
  {
3525
3607
  icon: getIcon({ options, selectedItem, selectedOptionValue }),
3526
3608
  color
3527
3609
  }
3528
- ),
3529
- /* @__PURE__ */ React22.createElement(text_default, { hasEllipsis: true, color: hasPlaceholder ? "bodyDimmed" : "inherit" }, getTitle({
3610
+ )),
3611
+ /* @__PURE__ */ React23.createElement(text_default, { hasEllipsis: true, color: hasPlaceholder ? "bodyDimmed" : "inherit" }, getTitle({
3530
3612
  options,
3531
3613
  selectedItem,
3532
3614
  selectedOptionValue,
3533
3615
  selectPlaceholder
3534
3616
  })),
3535
- /* @__PURE__ */ React22.createElement(icon_default, { icon: /* @__PURE__ */ React22.createElement(SvgChevronDown, null), color })
3617
+ /* @__PURE__ */ React23.createElement(icon_default, { icon: /* @__PURE__ */ React23.createElement(SvgChevronDown, null), color })
3536
3618
  );
3537
3619
  };
3538
3620
  var CustomHeader = ({
@@ -3578,12 +3660,88 @@ var CustomHeader = ({
3578
3660
  };
3579
3661
  return trigger(triggerContent, buttonProps());
3580
3662
  };
3581
- var getSelectedOption = (value, options) => options.find((o) => o.value === value);
3663
+ var getSelectedOption = (value, options) => {
3664
+ if (isGrouped(options)) {
3665
+ for (const option of options) {
3666
+ const foundItem = option.items.find((item) => item.value === value);
3667
+ if (foundItem) {
3668
+ return foundItem;
3669
+ }
3670
+ }
3671
+ } else {
3672
+ return options.find((item) => item.value === value);
3673
+ }
3674
+ };
3582
3675
  var didSelectedOptionValueChange = (selectedOptionValue, prevSelectedItem) => {
3583
3676
  return Boolean(
3584
3677
  prevSelectedItem && selectedOptionValue !== prevSelectedItem.value
3585
3678
  );
3586
3679
  };
3680
+ var renderOption = (item, index, selectedItem, selectedOptionValue, highlightedIndex, getItemProps) => {
3681
+ const isSelected = !selectedItem && item.value === selectedOptionValue || selectedItem && selectedItem.value === item.value;
3682
+ return /* @__PURE__ */ React23.createElement(
3683
+ MenuItem,
3684
+ __spreadProps(__spreadValues({
3685
+ key: index,
3686
+ getItemProps,
3687
+ icon: item.icon,
3688
+ hidden: item.hidden
3689
+ }, getItemProps({
3690
+ key: `${item.value}-${index}`,
3691
+ index,
3692
+ item,
3693
+ disabled: item.isDisabled,
3694
+ "aria-selected": isSelected
3695
+ })), {
3696
+ isDisabled: item.isDisabled,
3697
+ hasDivider: item.hasDivider,
3698
+ isHighlighted: highlightedIndex === index,
3699
+ isSelected
3700
+ }),
3701
+ item.title
3702
+ );
3703
+ };
3704
+ var SelectMenu = (_a) => {
3705
+ var _b = _a, {
3706
+ options,
3707
+ selectedItem,
3708
+ selectedOptionValue,
3709
+ highlightedIndex,
3710
+ getItemProps
3711
+ } = _b, menuProps = __objRest(_b, [
3712
+ "options",
3713
+ "selectedItem",
3714
+ "selectedOptionValue",
3715
+ "highlightedIndex",
3716
+ "getItemProps"
3717
+ ]);
3718
+ if (!isGrouped(options)) {
3719
+ return /* @__PURE__ */ React23.createElement(menu_default, __spreadValues({}, menuProps), options.map(
3720
+ (item, index) => renderOption(
3721
+ item,
3722
+ index,
3723
+ selectedItem,
3724
+ selectedOptionValue,
3725
+ highlightedIndex,
3726
+ getItemProps
3727
+ )
3728
+ ));
3729
+ }
3730
+ let downshiftIndex = 0;
3731
+ return /* @__PURE__ */ React23.createElement(menu_default, __spreadValues({}, menuProps), options.map((group) => {
3732
+ const groupId = `group-${group.group.replace(/\s+/g, "-")}`;
3733
+ return /* @__PURE__ */ React23.createElement("li", { key: groupId }, /* @__PURE__ */ React23.createElement(spacer_default, { left: "medium", top: "small", bottom: "xsmall" }, /* @__PURE__ */ React23.createElement(text_default, { id: groupId, size: "body-sm", fontWeight: "bold" }, group.group)), /* @__PURE__ */ React23.createElement(Group, { role: "group", "aria-labelledby": groupId }, group.items.map((item) => {
3734
+ return renderOption(
3735
+ item,
3736
+ downshiftIndex++,
3737
+ selectedItem,
3738
+ selectedOptionValue,
3739
+ highlightedIndex,
3740
+ getItemProps
3741
+ );
3742
+ })));
3743
+ }));
3744
+ };
3587
3745
  var Select = (_a) => {
3588
3746
  var _b = _a, {
3589
3747
  container,
@@ -3666,7 +3824,7 @@ var Select = (_a) => {
3666
3824
  }
3667
3825
  return changes;
3668
3826
  };
3669
- return /* @__PURE__ */ React22.createElement(SelectWrapper, __spreadValues({}, props), /* @__PURE__ */ React22.createElement(Downshift, __spreadProps(__spreadValues({}, downshiftProps), { stateReducer }), ({
3827
+ return /* @__PURE__ */ React23.createElement(SelectWrapper, __spreadValues({}, props), /* @__PURE__ */ React23.createElement(Downshift, __spreadProps(__spreadValues({}, downshiftProps), { stateReducer }), ({
3670
3828
  getItemProps,
3671
3829
  getInputProps,
3672
3830
  getMenuProps,
@@ -3678,7 +3836,7 @@ var Select = (_a) => {
3678
3836
  }) => {
3679
3837
  return (
3680
3838
  // Don't set the role to combobox to ensure a consistent experience for screen readers
3681
- /* @__PURE__ */ React22.createElement("div", { role: null }, /* @__PURE__ */ React22.createElement("div", __spreadValues({}, triggerProps), trigger ? /* @__PURE__ */ React22.createElement(
3839
+ /* @__PURE__ */ React23.createElement("div", { role: null }, /* @__PURE__ */ React23.createElement("div", __spreadValues({}, triggerProps), trigger ? /* @__PURE__ */ React23.createElement(
3682
3840
  CustomHeader,
3683
3841
  {
3684
3842
  getToggleButtonProps,
@@ -3691,7 +3849,7 @@ var Select = (_a) => {
3691
3849
  getInputProps,
3692
3850
  ariaMenuName
3693
3851
  }
3694
- ) : /* @__PURE__ */ React22.createElement(
3852
+ ) : /* @__PURE__ */ React23.createElement(
3695
3853
  SelectHeader,
3696
3854
  {
3697
3855
  getToggleButtonProps,
@@ -3705,7 +3863,7 @@ var Select = (_a) => {
3705
3863
  ariaMenuName
3706
3864
  }
3707
3865
  )), downshiftIsOpen && isOpen && renderLayer(
3708
- /* @__PURE__ */ React22.createElement(
3866
+ /* @__PURE__ */ React23.createElement(
3709
3867
  "div",
3710
3868
  __spreadProps(__spreadValues({}, layerProps), {
3711
3869
  style: __spreadProps(__spreadValues({}, layerProps.style), {
@@ -3713,40 +3871,20 @@ var Select = (_a) => {
3713
3871
  width: menuMinWidth ? "auto" : triggerBounds == null ? void 0 : triggerBounds.width
3714
3872
  })
3715
3873
  }),
3716
- /* @__PURE__ */ React22.createElement(
3717
- menu_default,
3874
+ /* @__PURE__ */ React23.createElement(
3875
+ SelectMenu,
3718
3876
  {
3877
+ options,
3878
+ selectedItem: selectedItem2,
3879
+ selectedOptionValue,
3880
+ highlightedIndex,
3881
+ getItemProps,
3719
3882
  position: menuPosition,
3720
3883
  downshiftMenuProps: getMenuProps,
3721
3884
  maxWidth: menuMaxWidth,
3722
3885
  maxHeight: menuMaxHeight,
3723
3886
  minWidth: menuMinWidth
3724
- },
3725
- options.map((item, index) => {
3726
- const isSelected = !selectedItem2 && item.value === selectedOptionValue || selectedItem2 && selectedItem2.value === item.value;
3727
- return /* @__PURE__ */ React22.createElement(
3728
- MenuItem,
3729
- __spreadProps(__spreadValues({
3730
- key: index,
3731
- getItemProps,
3732
- icon: item.icon,
3733
- hidden: item.hidden
3734
- }, getItemProps({
3735
- key: `${item.value}-${index}`,
3736
- index,
3737
- item,
3738
- disabled: item.isDisabled,
3739
- "aria-selected": isSelected
3740
- // Downshift sets aria-selected to true on hover, which makes screen readers narrate that the item is selected when it is really not, so we override aria-selected here
3741
- })), {
3742
- isDisabled: item.isDisabled,
3743
- hasDivider: item.hasDivider,
3744
- isHighlighted: highlightedIndex === index,
3745
- isSelected
3746
- }),
3747
- item.title
3748
- );
3749
- })
3887
+ }
3750
3888
  )
3751
3889
  )
3752
3890
  ))
@@ -3756,8 +3894,8 @@ var Select = (_a) => {
3756
3894
  var select_default = Select;
3757
3895
 
3758
3896
  // src/components/backdrop/backdrop.tsx
3759
- import styled18 from "@emotion/styled";
3760
- import React23 from "react";
3897
+ import styled19 from "@emotion/styled";
3898
+ import React24 from "react";
3761
3899
  import { useTransition } from "transition-hook";
3762
3900
 
3763
3901
  // src/hooks/use-prevent-scroll.ts
@@ -3823,7 +3961,7 @@ var use_prevent_scroll_default = usePreventScroll;
3823
3961
 
3824
3962
  // src/components/backdrop/backdrop.tsx
3825
3963
  var duration = 300;
3826
- var BackdropWrapper = styled18.div`
3964
+ var BackdropWrapper = styled19.div`
3827
3965
  position: fixed;
3828
3966
  top: 0;
3829
3967
  left: 0;
@@ -3833,7 +3971,7 @@ var BackdropWrapper = styled18.div`
3833
3971
  z-index: ${(props) => props.zIndex};
3834
3972
  overflow: hidden;
3835
3973
  `;
3836
- var ChildrenWrapper = styled18.div`
3974
+ var ChildrenWrapper = styled19.div`
3837
3975
  overflow: auto;
3838
3976
  height: 100%;
3839
3977
  `;
@@ -3851,7 +3989,7 @@ var Backdrop = (_a) => {
3851
3989
  ]);
3852
3990
  const { stage, shouldMount } = useTransition(isOpen, duration);
3853
3991
  use_prevent_scroll_default("html", isOpen);
3854
- return /* @__PURE__ */ React23.createElement(React23.Fragment, null, shouldMount && /* @__PURE__ */ React23.createElement(
3992
+ return /* @__PURE__ */ React24.createElement(React24.Fragment, null, shouldMount && /* @__PURE__ */ React24.createElement(
3855
3993
  BackdropWrapper,
3856
3994
  __spreadValues({
3857
3995
  backgroundColor,
@@ -3861,31 +3999,31 @@ var Backdrop = (_a) => {
3861
3999
  opacity: stage === "enter" ? 1 : 0
3862
4000
  }
3863
4001
  }, props),
3864
- /* @__PURE__ */ React23.createElement(ChildrenWrapper, null, children)
4002
+ /* @__PURE__ */ React24.createElement(ChildrenWrapper, null, children)
3865
4003
  ));
3866
4004
  };
3867
4005
  var backdrop_default = Backdrop;
3868
4006
 
3869
4007
  // src/components/modal/modal.tsx
3870
- import styled19 from "@emotion/styled";
4008
+ import styled20 from "@emotion/styled";
3871
4009
  import FocusTrap from "focus-trap-react";
3872
- import React25, { useEffect as useEffect3 } from "react";
4010
+ import React26, { useEffect as useEffect3 } from "react";
3873
4011
 
3874
4012
  // src/components/icon/available-icons/close.tsx
3875
4013
  import CloseIcon from "@atlaskit/icon/core/close";
3876
- import * as React24 from "react";
4014
+ import * as React25 from "react";
3877
4015
  function SvgClose() {
3878
- return /* @__PURE__ */ React24.createElement(CloseIcon, { label: "", testId: "ads-refreshed-icon" });
4016
+ return /* @__PURE__ */ React25.createElement(CloseIcon, { label: "", testId: "ads-refreshed-icon" });
3879
4017
  }
3880
4018
 
3881
4019
  // src/components/modal/modal.tsx
3882
4020
  var DEFAULT_MODAL_CARD_HEIGHT = "70vh";
3883
- var ContentWrapper = styled19.div`
4021
+ var ContentWrapper = styled20.div`
3884
4022
  display: grid;
3885
4023
  grid-template-rows: ${(props) => props.rows};
3886
4024
  position: relative;
3887
4025
  `;
3888
- var ModalCardWrapper = styled19.dialog`
4026
+ var ModalCardWrapper = styled20.dialog`
3889
4027
  top: ${(props) => getPlacement(getSizeValue(props.maxHeight), props.placement).top};
3890
4028
  background-color: ${getColorValue("overlay")};
3891
4029
  color: ${getColorValue("body")};
@@ -3908,27 +4046,27 @@ var ModalCardWrapper = styled19.dialog`
3908
4046
  background: var(--lns-color-overlay);
3909
4047
  }
3910
4048
  `;
3911
- var CloseIconSection = styled19.div`
4049
+ var CloseIconSection = styled20.div`
3912
4050
  position: absolute;
3913
4051
  top: ${u(1.5)};
3914
4052
  right: ${u(1.5)};
3915
4053
  z-index: 1;
3916
4054
  `;
3917
- var RightButtonsSection = styled19.div`
4055
+ var RightButtonsSection = styled20.div`
3918
4056
  margin-left: auto;
3919
4057
 
3920
4058
  * {
3921
4059
  vertical-align: middle;
3922
4060
  }
3923
4061
  `;
3924
- var TitleSection = styled19.div`
4062
+ var TitleSection = styled20.div`
3925
4063
  padding-left: var(--lns-space-xlarge);
3926
4064
  padding-right: var(--lns-space-xlarge);
3927
4065
  padding-top: var(--lns-space-xlarge);
3928
4066
  padding-bottom: ${(props) => props.bottom};
3929
4067
  flex-shrink: 0;
3930
4068
  `;
3931
- var ButtonsSection = styled19.div`
4069
+ var ButtonsSection = styled20.div`
3932
4070
  padding-left: var(--lns-space-xlarge);
3933
4071
  padding-right: var(--lns-space-xlarge);
3934
4072
  padding-bottom: var(--lns-space-xlarge);
@@ -3938,7 +4076,7 @@ var ButtonsSection = styled19.div`
3938
4076
  justify-content: space-between;
3939
4077
  align-items: center;
3940
4078
  `;
3941
- var ChildrenSection2 = styled19.div`
4079
+ var ChildrenSection2 = styled20.div`
3942
4080
  display: flex;
3943
4081
  flex-direction: column;
3944
4082
  overflow: auto;
@@ -3950,7 +4088,7 @@ var ChildrenSection2 = styled19.div`
3950
4088
  border-color: ${getColorValue("border")};
3951
4089
  border-width: ${(props) => props.hasDividers ? "1px 0" : "0"};
3952
4090
  `;
3953
- var ModalCardChildrenSection = styled19.div`
4091
+ var ModalCardChildrenSection = styled20.div`
3954
4092
  overflow: auto;
3955
4093
 
3956
4094
  ${(props) => getMaxHeight(props.maxHeight)};
@@ -4006,7 +4144,7 @@ var ModalCard = (_a) => {
4006
4144
  };
4007
4145
  }, [isOpen, onCloseClick]);
4008
4146
  use_prevent_scroll_default("html", isOpen);
4009
- return /* @__PURE__ */ React25.createElement(
4147
+ return /* @__PURE__ */ React26.createElement(
4010
4148
  FocusTrap,
4011
4149
  {
4012
4150
  active: isOpen,
@@ -4015,7 +4153,7 @@ var ModalCard = (_a) => {
4015
4153
  allowOutsideClick: true
4016
4154
  }
4017
4155
  },
4018
- /* @__PURE__ */ React25.createElement(
4156
+ /* @__PURE__ */ React26.createElement(
4019
4157
  ModalCardWrapper,
4020
4158
  __spreadValues({
4021
4159
  open: isOpen,
@@ -4029,15 +4167,15 @@ var ModalCard = (_a) => {
4029
4167
  "aria-modal": ariaModal,
4030
4168
  "aria-labelledby": ariaLabelledBy
4031
4169
  }, props),
4032
- !removeClose && onCloseClick && /* @__PURE__ */ React25.createElement(CloseIconSection, null, /* @__PURE__ */ React25.createElement(
4170
+ !removeClose && onCloseClick && /* @__PURE__ */ React26.createElement(CloseIconSection, null, /* @__PURE__ */ React26.createElement(
4033
4171
  icon_button_default,
4034
4172
  {
4035
4173
  altText: "Close",
4036
- icon: /* @__PURE__ */ React25.createElement(SvgClose, null),
4174
+ icon: /* @__PURE__ */ React26.createElement(SvgClose, null),
4037
4175
  onClick: onCloseClick
4038
4176
  }
4039
4177
  )),
4040
- /* @__PURE__ */ React25.createElement(
4178
+ /* @__PURE__ */ React26.createElement(
4041
4179
  ModalCardChildrenSection,
4042
4180
  {
4043
4181
  tabIndex: removeClose ? 0 : -1,
@@ -4048,7 +4186,7 @@ var ModalCard = (_a) => {
4048
4186
  )
4049
4187
  );
4050
4188
  };
4051
- var Modal = React25.forwardRef(
4189
+ var Modal = React26.forwardRef(
4052
4190
  (_a, ref) => {
4053
4191
  var _b = _a, {
4054
4192
  children,
@@ -4102,14 +4240,14 @@ var Modal = React25.forwardRef(
4102
4240
  }
4103
4241
  onCloseClick(e);
4104
4242
  };
4105
- return /* @__PURE__ */ React25.createElement(backdrop_default, __spreadValues({ isOpen, zIndex }, props), /* @__PURE__ */ React25.createElement(
4243
+ return /* @__PURE__ */ React26.createElement(backdrop_default, __spreadValues({ isOpen, zIndex }, props), /* @__PURE__ */ React26.createElement(
4106
4244
  container_default,
4107
4245
  {
4108
4246
  height: "100%",
4109
4247
  onClick: closeClickHandler,
4110
4248
  onKeyDown
4111
4249
  },
4112
- /* @__PURE__ */ React25.createElement(
4250
+ /* @__PURE__ */ React26.createElement(
4113
4251
  ModalCard,
4114
4252
  {
4115
4253
  ref,
@@ -4123,19 +4261,19 @@ var Modal = React25.forwardRef(
4123
4261
  ariaModal,
4124
4262
  ariaLabelledBy: (_a2 = ariaLabelledBy != null ? ariaLabelledBy : titleId) != null ? _a2 : void 0
4125
4263
  },
4126
- /* @__PURE__ */ React25.createElement(
4264
+ /* @__PURE__ */ React26.createElement(
4127
4265
  ContentWrapper,
4128
4266
  {
4129
4267
  rows: `${title ? "auto " : ""} ${children ? "1fr " : ""} ${hasButtons ? "auto" : ""}`
4130
4268
  },
4131
- title && /* @__PURE__ */ React25.createElement(
4269
+ title && /* @__PURE__ */ React26.createElement(
4132
4270
  TitleSection,
4133
4271
  {
4134
4272
  bottom: children ? "var(--lns-space-medium)" : "var(--lns-space-xlarge)"
4135
4273
  },
4136
- /* @__PURE__ */ React25.createElement(text_default, { htmlTag: "h1", variant: "title", id: titleId }, title)
4274
+ /* @__PURE__ */ React26.createElement(text_default, { htmlTag: "h1", variant: "title", id: titleId }, title)
4137
4275
  ),
4138
- /* @__PURE__ */ React25.createElement(
4276
+ /* @__PURE__ */ React26.createElement(
4139
4277
  ChildrenSection2,
4140
4278
  {
4141
4279
  noPadding,
@@ -4145,14 +4283,14 @@ var Modal = React25.forwardRef(
4145
4283
  },
4146
4284
  children && children
4147
4285
  ),
4148
- hasButtons && /* @__PURE__ */ React25.createElement(
4286
+ hasButtons && /* @__PURE__ */ React26.createElement(
4149
4287
  ButtonsSection,
4150
4288
  {
4151
4289
  top: children ? "var(--lns-space-xlarge)" : 0,
4152
4290
  hasDividers
4153
4291
  },
4154
4292
  alternativeButton,
4155
- /* @__PURE__ */ React25.createElement(RightButtonsSection, null, secondaryButton && /* @__PURE__ */ React25.createElement(spacer_default, { right: "small", isInline: true }, secondaryButton), mainButton)
4293
+ /* @__PURE__ */ React26.createElement(RightButtonsSection, null, secondaryButton && /* @__PURE__ */ React26.createElement(spacer_default, { right: "small", isInline: true }, secondaryButton), mainButton)
4156
4294
  )
4157
4295
  )
4158
4296
  )
@@ -4161,56 +4299,6 @@ var Modal = React25.forwardRef(
4161
4299
  );
4162
4300
  var modal_default = Modal;
4163
4301
 
4164
- // src/components/align/align.tsx
4165
- import styled20 from "@emotion/styled";
4166
- import React26 from "react";
4167
- var alignmentsPlaceItems = {
4168
- topLeft: "start",
4169
- topCenter: "start center",
4170
- topRight: "start end",
4171
- centerLeft: "center start",
4172
- center: "center",
4173
- centerRight: "center end",
4174
- bottomLeft: "end start",
4175
- bottomCenter: "end center",
4176
- bottomRight: "end"
4177
- };
4178
- var getPlaceItems = (alignment) => {
4179
- if (Array.isArray(alignment)) {
4180
- return alignment.map(
4181
- (alignmentArrayItem) => alignmentsPlaceItems[alignmentArrayItem]
4182
- );
4183
- }
4184
- if (typeof alignment === "object") {
4185
- const alignmentsPlaceItemsObject = {};
4186
- Object.entries(alignment).forEach(([key, value]) => {
4187
- return alignmentsPlaceItemsObject[key] = alignmentsPlaceItems[value];
4188
- });
4189
- return alignmentsPlaceItemsObject;
4190
- }
4191
- return alignmentsPlaceItems[alignment];
4192
- };
4193
- var AlignWrapper = styled20.div`
4194
- width: 100%;
4195
- height: 100%;
4196
- display: grid;
4197
- ${(props) => getResponsiveOneOf("place-items", getPlaceItems(props.alignment))};
4198
- `;
4199
- var Align = (_a) => {
4200
- var _b = _a, {
4201
- children,
4202
- alignment = "center",
4203
- htmlTag = "div"
4204
- } = _b, props = __objRest(_b, [
4205
- "children",
4206
- "alignment",
4207
- "htmlTag"
4208
- ]);
4209
- return /* @__PURE__ */ React26.createElement(AlignWrapper, __spreadValues({ alignment, as: htmlTag }, props), children);
4210
- };
4211
- var availableAlignments2 = Object.keys(alignmentsPlaceItems);
4212
- var align_default = Align;
4213
-
4214
4302
  // src/components/link/link.tsx
4215
4303
  import { css as css3 } from "@emotion/react";
4216
4304
  import styled21 from "@emotion/styled";
@@ -5331,6 +5419,7 @@ var Tooltip = (_a) => {
5331
5419
  });
5332
5420
  const [isOverTooltip, setIsOverTooltip] = useState4(false);
5333
5421
  const [isOpen, setIsOpen] = useState4(false);
5422
+ const [enterOrSpaceKeyDown, setEnterOrSpaceKeyDown] = useState4(false);
5334
5423
  const focusRef = useRef2();
5335
5424
  const isTooltipDisabled = !content || isDisabled;
5336
5425
  useEffect8(() => {
@@ -5342,7 +5431,7 @@ var Tooltip = (_a) => {
5342
5431
  if (show || keepTooltipOpenOnHover) {
5343
5432
  setIsOpen(true);
5344
5433
  }
5345
- if (!show && !keepTooltipOpenOnHover) {
5434
+ if (!show && !keepTooltipOpenOnHover && !enterOrSpaceKeyDown) {
5346
5435
  setIsOpen(false);
5347
5436
  }
5348
5437
  }, [
@@ -5352,15 +5441,18 @@ var Tooltip = (_a) => {
5352
5441
  isTooltipDisabled,
5353
5442
  keepOpen,
5354
5443
  setIsOpen,
5355
- show
5444
+ show,
5445
+ enterOrSpaceKeyDown
5356
5446
  ]);
5357
5447
  const handleFocus = () => {
5448
+ setEnterOrSpaceKeyDown(false);
5358
5449
  if (!isTooltipDisabled) {
5359
5450
  setIsOpen(true);
5360
5451
  }
5361
5452
  };
5362
5453
  const handleBlur = () => {
5363
5454
  setIsOpen(false);
5455
+ setEnterOrSpaceKeyDown(false);
5364
5456
  };
5365
5457
  useEffect8(() => {
5366
5458
  if (!isOpen) {
@@ -5388,6 +5480,9 @@ var Tooltip = (_a) => {
5388
5480
  return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(
5389
5481
  TooltipChildren,
5390
5482
  __spreadProps(__spreadValues(__spreadValues({}, triggerProps), hoverProps), {
5483
+ onClick: () => {
5484
+ setEnterOrSpaceKeyDown(true);
5485
+ },
5391
5486
  onFocus: handleFocus,
5392
5487
  onBlur: handleBlur,
5393
5488
  isInline,