@semcore/dropdown-menu 4.46.1 → 16.0.0-prerelease.2

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.
@@ -1,100 +1,98 @@
1
- import X from "@babel/runtime/helpers/esm/toConsumableArray";
2
- import Y from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import T from "@babel/runtime/helpers/esm/slicedToArray";
4
- import O from "@babel/runtime/helpers/esm/extends";
1
+ import Q from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import X from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import N from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import W from "@babel/runtime/helpers/esm/extends";
5
5
  import u from "@babel/runtime/helpers/esm/objectSpread2";
6
- import Z from "@babel/runtime/helpers/esm/classCallCheck";
7
- import ee from "@babel/runtime/helpers/esm/createClass";
8
- import V from "@babel/runtime/helpers/esm/assertThisInitialized";
9
- import w from "@babel/runtime/helpers/esm/get";
10
- import I from "@babel/runtime/helpers/esm/getPrototypeOf";
11
- import te from "@babel/runtime/helpers/esm/inherits";
12
- import re from "@babel/runtime/helpers/esm/createSuper";
13
- import C from "@babel/runtime/helpers/esm/defineProperty";
14
- import { sstyled as ne } from "@semcore/utils/lib/core/index";
15
- import oe, { assignProps as m, sstyled as y } from "@semcore/core";
6
+ import Y from "@babel/runtime/helpers/esm/classCallCheck";
7
+ import Z from "@babel/runtime/helpers/esm/createClass";
8
+ import O from "@babel/runtime/helpers/esm/assertThisInitialized";
9
+ import x from "@babel/runtime/helpers/esm/get";
10
+ import y from "@babel/runtime/helpers/esm/getPrototypeOf";
11
+ import ee from "@babel/runtime/helpers/esm/inherits";
12
+ import te from "@babel/runtime/helpers/esm/createSuper";
13
+ import M from "@babel/runtime/helpers/esm/defineProperty";
14
+ import { sstyled as b, createComponent as ne, assignProps as f, lastInteraction as re } from "@semcore/core";
16
15
  import i from "react";
17
- import ie from "classnames";
18
- import D, { enhance as ae, selectedIndexContext as W, AbstractDropdown as _e } from "@semcore/dropdown";
19
- import { useBox as de, Flex as N } from "@semcore/flex-box";
16
+ import oe from "classnames";
17
+ import D, { enhance as ie, selectedIndexContext as q, AbstractDropdown as ae } from "@semcore/dropdown";
18
+ import { useBox as _e, Flex as z } from "@semcore/flex-box";
20
19
  import k, { hideScrollBarsFromScreenReadersContext as se } from "@semcore/scroll-area";
21
- import { useUID as le } from "@semcore/utils/lib/uniqueID";
22
- import { localizedMessages as ge } from "./translations/__intergalactic-dynamic-locales.mjs";
23
- import { useFocusSource as ue } from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
24
- import { isAdvanceMode as A } from "@semcore/utils/lib/findComponent";
25
- import { forkRef as G } from "@semcore/utils/lib/ref";
26
- import { callAllEventHandlers as E } from "@semcore/utils/lib/assignProps";
27
- import ce from "@semcore/button";
28
- import { Text as fe } from "@semcore/typography";
29
- var me = ["className"], he = (
20
+ import { useUID as ge } from "@semcore/core/lib/utils/uniqueID";
21
+ import { localizedMessages as de } from "./translations/__intergalactic-dynamic-locales.mjs";
22
+ import { isAdvanceMode as L } from "@semcore/core/lib/utils/findComponent";
23
+ import { forkRef as G } from "@semcore/core/lib/utils/ref";
24
+ import { callAllEventHandlers as A } from "@semcore/core/lib/utils/assignProps";
25
+ import le from "@semcore/button";
26
+ import { Text as ue } from "@semcore/typography";
27
+ var ce = ["className"], pe = (
30
28
  /*__reshadow_css_start__*/
31
- (ne.insert(
29
+ (b.insert(
32
30
  /*__inner_css_start__*/
33
- `.___SDropdownMenuList_1xqfd_gg_{max-height:240px;padding:var(--intergalactic-spacing-1x, 4px)0;position:relative;min-height:26px;min-width:32px;box-sizing:content-box;z-index:0;color:var(--intergalactic-text-primary, #191b23)}.___SDropdownMenuList_1xqfd_gg_ .___SShadowHorizontal_1xqfd_gg_:after,.___SDropdownMenuList_1xqfd_gg_ .___SShadowHorizontal_1xqfd_gg_:before{width:16px;height:100%;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_1xqfd_gg_ .___SShadowHorizontal_1xqfd_gg_._position_median_1xqfd_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,
31
+ `.___SDropdownMenuList_g9pft_gg_{max-height:240px;padding:var(--intergalactic-spacing-1x, 4px)0;position:relative;min-height:26px;min-width:32px;box-sizing:content-box;z-index:0;color:var(--intergalactic-text-primary, #191b23)}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_:after,.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_:before{width:16px;height:100%;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_median_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,
34
32
  linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
35
- )}.___SDropdownMenuList_1xqfd_gg_ .___SShadowHorizontal_1xqfd_gg_._position_median_1xqfd_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,
33
+ )}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_median_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,
36
34
  linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
37
- )}.___SDropdownMenuList_1xqfd_gg_ .___SShadowHorizontal_1xqfd_gg_._position_start_1xqfd_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,
35
+ )}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_start_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,
38
36
  linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
39
- )}.___SDropdownMenuList_1xqfd_gg_ .___SShadowHorizontal_1xqfd_gg_._position_end_1xqfd_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,
37
+ )}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_end_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,
40
38
  linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
41
- )}.___SDropdownMenuList_1xqfd_gg_ .___SShadowVertical_1xqfd_gg_:after,.___SDropdownMenuList_1xqfd_gg_ .___SShadowVertical_1xqfd_gg_:before{width:100%;height:16px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_1xqfd_gg_ .___SShadowVertical_1xqfd_gg_._position_median_1xqfd_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,
39
+ )}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_:after,.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_:before{width:100%;height:16px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_median_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,
42
40
  linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
43
- )}.___SDropdownMenuList_1xqfd_gg_ .___SShadowVertical_1xqfd_gg_._position_median_1xqfd_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,
41
+ )}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_median_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,
44
42
  linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
45
- )}.___SDropdownMenuList_1xqfd_gg_ .___SShadowVertical_1xqfd_gg_._position_start_1xqfd_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,
43
+ )}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_start_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,
46
44
  linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
47
- )}.___SDropdownMenuList_1xqfd_gg_ .___SShadowVertical_1xqfd_gg_._position_end_1xqfd_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,
45
+ )}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_end_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,
48
46
  linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
49
- )}.___SDropdownMenuItemContainer_1xqfd_gg_.__nesting-trigger_1xqfd_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_1xqfd_gg_,.___SItemContentText_1xqfd_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_1xqfd_gg_:first-child,.___SItemContentText_1xqfd_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_1xqfd_gg_:last-child,.___SItemContentText_1xqfd_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_1xqfd_gg_,.___SDropdownMenuNesting_1xqfd_gg_._size_l_1xqfd_gg_,.___SDropdownMenuNesting_1xqfd_gg_._size_m_1xqfd_gg_{padding:0}.___SDropdownMenuNesting_1xqfd_gg_.__highlighted_1xqfd_gg_{z-index:1;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5)) inset}.___SDropdownNestingItem_1xqfd_gg_._size_l_1xqfd_gg_,.___SDropdownNestingItem_1xqfd_gg_._size_m_1xqfd_gg_{padding-right:0}.___SDropdownNestingItem_1xqfd_gg_ .___SDropdownMenuItemContainer_1xqfd_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemContent_1xqfd_gg_:focus{outline:0}.___SItemHint_1xqfd_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}`,
50
- "1xqfd_gg_"
47
+ )}.___SDropdownMenuItemContainer_g9pft_gg_.__nesting-trigger_g9pft_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_g9pft_gg_,.___SItemContentText_g9pft_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_g9pft_gg_:first-child,.___SItemContentText_g9pft_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_g9pft_gg_:last-child,.___SItemContentText_g9pft_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_g9pft_gg_,.___SDropdownMenuNesting_g9pft_gg_._size_l_g9pft_gg_,.___SDropdownMenuNesting_g9pft_gg_._size_m_g9pft_gg_{padding:0}.___SDropdownMenuNesting_g9pft_gg_.__highlighted_g9pft_gg_{z-index:1;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5)) inset}.___SDropdownNestingItem_g9pft_gg_._size_l_g9pft_gg_,.___SDropdownNestingItem_g9pft_gg_._size_m_g9pft_gg_{padding-right:0}.___SDropdownNestingItem_g9pft_gg_ .___SDropdownMenuItemContainer_g9pft_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemContent_g9pft_gg_:focus{outline:0}.___SItemHint_g9pft_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}`,
48
+ "g9pft_gg_"
51
49
  ), {
52
- __SDropdownMenuItemContainer: "___SDropdownMenuItemContainer_1xqfd_gg_",
53
- "_nesting-trigger": "__nesting-trigger_1xqfd_gg_",
54
- __SDropdownMenuNesting: "___SDropdownMenuNesting_1xqfd_gg_",
55
- _size_l: "_size_l_1xqfd_gg_",
56
- _size_m: "_size_m_1xqfd_gg_",
57
- _highlighted: "__highlighted_1xqfd_gg_",
58
- __SDropdownNestingItem: "___SDropdownNestingItem_1xqfd_gg_",
59
- __SItemContent: "___SItemContent_1xqfd_gg_",
60
- __SItemHint: "___SItemHint_1xqfd_gg_",
61
- __SDropdownMenuList: "___SDropdownMenuList_1xqfd_gg_",
62
- __SShadowHorizontal: "___SShadowHorizontal_1xqfd_gg_",
63
- _position_median: "_position_median_1xqfd_gg_",
64
- _position_start: "_position_start_1xqfd_gg_",
65
- _position_end: "_position_end_1xqfd_gg_",
66
- __SShadowVertical: "___SShadowVertical_1xqfd_gg_",
67
- __SDropdownMenuItemAddon: "___SDropdownMenuItemAddon_1xqfd_gg_",
68
- __SItemContentText: "___SItemContentText_1xqfd_gg_"
50
+ __SDropdownMenuItemContainer: "___SDropdownMenuItemContainer_g9pft_gg_",
51
+ "_nesting-trigger": "__nesting-trigger_g9pft_gg_",
52
+ __SDropdownMenuNesting: "___SDropdownMenuNesting_g9pft_gg_",
53
+ _size_l: "_size_l_g9pft_gg_",
54
+ _size_m: "_size_m_g9pft_gg_",
55
+ _highlighted: "__highlighted_g9pft_gg_",
56
+ __SDropdownNestingItem: "___SDropdownNestingItem_g9pft_gg_",
57
+ __SItemContent: "___SItemContent_g9pft_gg_",
58
+ __SItemHint: "___SItemHint_g9pft_gg_",
59
+ __SDropdownMenuList: "___SDropdownMenuList_g9pft_gg_",
60
+ __SShadowHorizontal: "___SShadowHorizontal_g9pft_gg_",
61
+ _position_median: "_position_median_g9pft_gg_",
62
+ _position_start: "_position_start_g9pft_gg_",
63
+ _position_end: "_position_end_g9pft_gg_",
64
+ __SShadowVertical: "___SShadowVertical_g9pft_gg_",
65
+ __SDropdownMenuItemAddon: "___SDropdownMenuItemAddon_g9pft_gg_",
66
+ __SItemContentText: "___SItemContentText_g9pft_gg_"
69
67
  })
70
68
  ), U = function(_) {
71
69
  var t = _.children;
72
70
  return /* @__PURE__ */ i.createElement(se.Provider, {
73
71
  value: !0
74
72
  }, t);
75
- }, z = /* @__PURE__ */ i.createContext({}), M = /* @__PURE__ */ function(n) {
76
- te(t, n);
77
- var _ = re(t);
73
+ }, H = /* @__PURE__ */ i.createContext({}), P = /* @__PURE__ */ function(r) {
74
+ ee(t, r);
75
+ var _ = te(t);
78
76
  function t() {
79
77
  var a;
80
- Z(this, t);
81
- for (var r = arguments.length, o = new Array(r), e = 0; e < r; e++)
78
+ Y(this, t);
79
+ for (var n = arguments.length, o = new Array(n), e = 0; e < n; e++)
82
80
  o[e] = arguments[e];
83
- return a = _.call.apply(_, [this].concat(o)), C(V(a), "actionsRef", /* @__PURE__ */ i.createRef()), C(V(a), "role", "menu"), a;
81
+ return a = _.call.apply(_, [this].concat(o)), M(O(a), "actionsRef", /* @__PURE__ */ i.createRef()), M(O(a), "role", "menu"), a;
84
82
  }
85
- return ee(t, [{
83
+ return Z(t, [{
86
84
  key: "uncontrolledProps",
87
85
  value: function() {
88
- var r = this;
89
- return u(u({}, w(I(t.prototype), "uncontrolledProps", this).call(this)), {}, {
86
+ var n = this;
87
+ return u(u({}, x(y(t.prototype), "uncontrolledProps", this).call(this)), {}, {
90
88
  visible: [null, function(o) {
91
89
  o === !0 && setTimeout(function() {
92
- var e, d, s = (e = r.menuRef.current) === null || e === void 0 ? void 0 : e.querySelectorAll('[role="menuitemcheckbox"], [role="menuitemradio"]'), l = (d = r.menuRef.current) === null || d === void 0 ? void 0 : d.querySelector('[aria-checked="true"]');
93
- if (l && s && r.asProps.itemsCount === void 0) {
94
- r.scrollToNode(l, !0);
95
- for (var f = 0; f < s.length; f++)
96
- if (s[f] === l) {
97
- r.handlers.highlightedIndex(f);
90
+ var e, s, g = (e = n.menuRef.current) === null || e === void 0 ? void 0 : e.querySelectorAll('[role="menuitemcheckbox"], [role="menuitemradio"]'), d = (s = n.menuRef.current) === null || s === void 0 ? void 0 : s.querySelector('[aria-checked="true"]');
91
+ if (d && g && n.asProps.itemsCount === void 0) {
92
+ n.scrollToNode(d, !0);
93
+ for (var p = 0; p < g.length; p++)
94
+ if (g[p] === d) {
95
+ n.handlers.highlightedIndex(p);
98
96
  break;
99
97
  }
100
98
  }
@@ -104,31 +102,31 @@ var me = ["className"], he = (
104
102
  }
105
103
  }, {
106
104
  key: "itemRef",
107
- value: function(r, o, e) {
108
- w(I(t.prototype), "itemRef", this).call(this, r, o, e), e === document.activeElement && w(I(t.prototype), "scrollToNode", this).call(this, e);
105
+ value: function(n, o, e) {
106
+ x(y(t.prototype), "itemRef", this).call(this, n, o, e), e === document.activeElement && x(y(t.prototype), "scrollToNode", this).call(this, e);
109
107
  }
110
108
  }, {
111
109
  key: "getTriggerProps",
112
110
  value: function() {
113
- var r = this.asProps, o = r.Children, e = r.uid, d = r.visible, s = A(o, [v.Menu.displayName]), l = s ? "igc-".concat(e, "-list") : "igc-".concat(e, "-popper");
114
- return u(u({}, w(I(t.prototype), "getTriggerProps", this).call(this)), {}, {
115
- onKeyDown: E(this.handlePreventCommonKeyDown.bind(this), this.handleOpenKeyDown.bind(this), this.handleKeyDownForMenu("trigger")),
116
- "aria-controls": d ? l : void 0,
117
- "aria-haspopup": s ? "true" : "dialog"
111
+ var n = this.asProps, o = n.Children, e = n.uid, s = n.visible, g = L(o, [v.Menu.displayName]), d = g ? "igc-".concat(e, "-list") : "igc-".concat(e, "-popper");
112
+ return u(u({}, x(y(t.prototype), "getTriggerProps", this).call(this)), {}, {
113
+ onKeyDown: A(this.handlePreventCommonKeyDown.bind(this), this.handleOpenKeyDown.bind(this), this.handleKeyDownForMenu("trigger")),
114
+ "aria-controls": s ? d : void 0,
115
+ "aria-haspopup": g ? "true" : "dialog"
118
116
  });
119
117
  }
120
118
  }, {
121
119
  key: "getListProps",
122
120
  value: function() {
123
- return u(u({}, w(I(t.prototype), "getListProps", this).call(this)), {}, {
124
- onKeyDown: E(this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu("list"), this.handleArrowKeyDown.bind(this))
121
+ return u(u({}, x(y(t.prototype), "getListProps", this).call(this)), {}, {
122
+ onKeyDown: A(this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu("list"), this.handleArrowKeyDown.bind(this))
125
123
  });
126
124
  }
127
125
  }, {
128
126
  key: "getPopperProps",
129
127
  value: function() {
130
- return u(u({}, w(I(t.prototype), "getPopperProps", this).call(this)), {}, {
131
- onKeyDown: E(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this))
128
+ return u(u({}, x(y(t.prototype), "getPopperProps", this).call(this)), {}, {
129
+ onKeyDown: A(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this))
132
130
  });
133
131
  }
134
132
  }, {
@@ -136,251 +134,249 @@ var me = ["className"], he = (
136
134
  value: function() {
137
135
  return u(u({}, this.getListProps()), {}, {
138
136
  ref: this.actionsRef,
139
- onKeyDown: E(this.handlePreventTabOnActions.bind(this), this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu("list"), this.handleArrowKeyDown.bind(this))
137
+ onKeyDown: A(this.handlePreventTabOnActions.bind(this), this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu("list"), this.handleArrowKeyDown.bind(this))
140
138
  });
141
139
  }
142
140
  }, {
143
141
  key: "getItemProps",
144
- value: function(r, o) {
145
- var e, d = this, s = this.asProps, l = s.highlightedIndex, f = s.visible, g = (e = r.index) !== null && e !== void 0 ? e : o, h = g === l, c = u(u({}, w(I(t.prototype), "getItemProps", this).call(this, r, g)), {}, {
146
- tabIndex: h && f ? 0 : -1,
147
- ref: function(S) {
148
- return d.itemRef(r, g, S);
142
+ value: function(n, o) {
143
+ var e, s = this, g = this.asProps, d = g.highlightedIndex, p = g.visible, l = (e = n.index) !== null && e !== void 0 ? e : o, m = l === d, c = u(u({}, x(y(t.prototype), "getItemProps", this).call(this, n, l)), {}, {
144
+ tabIndex: m && p ? 0 : -1,
145
+ ref: function(I) {
146
+ return s.itemRef(n, l, I);
149
147
  },
150
148
  actionsRef: this.actionsRef
151
149
  });
152
- if (r.tag === ce) {
153
- var p, x, b;
154
- c.use = (p = r.use) !== null && p !== void 0 ? p : "tertiary", c.theme = (x = r.theme) !== null && x !== void 0 ? x : "muted", c.size = (b = r.size) !== null && b !== void 0 ? b : "s";
150
+ if (n.tag === le) {
151
+ var h, w, S;
152
+ c.use = (h = n.use) !== null && h !== void 0 ? h : "tertiary", c.theme = (w = n.theme) !== null && w !== void 0 ? w : "muted", c.size = (S = n.size) !== null && S !== void 0 ? S : "s", c.innerOutline = !1;
155
153
  }
156
- return r.selected && (c["aria-checked"] = !0), w(I(t.prototype), "childRole", this) === "menuitemradio" && (c.onClick = function() {
157
- d.handlers.visible(!1);
154
+ return n.selected && (c["aria-checked"] = !0), x(y(t.prototype), "childRole", this) === "menuitemradio" && (c.onClick = function() {
155
+ s.handlers.visible(!1);
158
156
  }), c;
159
157
  }
160
158
  }, {
161
159
  key: "handleKeyDownForMenu",
162
- value: function(r) {
160
+ value: function(n) {
163
161
  var o = this;
164
162
  return function(e) {
165
- var d, s, l = o.asProps, f = l.visible, g = l.placement, h = l.inlineActions;
166
- if (r === "list" && !((d = o.menuRef.current) !== null && d !== void 0 && d.contains(e.target)) && !h)
163
+ var s, g, d = o.asProps, p = d.visible, l = d.placement, m = d.inlineActions;
164
+ if (n === "list" && !((s = o.menuRef.current) !== null && s !== void 0 && s.contains(e.target)) && !m)
167
165
  return e.stopPropagation(), !1;
168
- var c = e.key === "ArrowRight" && (g == null ? void 0 : g.startsWith("right")) || e.key === "ArrowLeft" && (g == null ? void 0 : g.startsWith("left")), p = e.key === "ArrowLeft" && (g == null ? void 0 : g.startsWith("right")) || e.key === "ArrowRight" && (g == null ? void 0 : g.startsWith("left")) || e.key === "Escape", x = (s = e.target.getAttribute("role")) === null || s === void 0 ? void 0 : s.startsWith(w(I(t.prototype), "childRole", o));
169
- if (r === "trigger" && (!f || h) && c && x)
166
+ var c = e.key === "ArrowRight" && (l == null ? void 0 : l.startsWith("right")) || e.key === "ArrowLeft" && (l == null ? void 0 : l.startsWith("left")), h = e.key === "ArrowLeft" && (l == null ? void 0 : l.startsWith("right")) || e.key === "ArrowRight" && (l == null ? void 0 : l.startsWith("left")) || e.key === "Escape", w = (g = e.target.getAttribute("role")) === null || g === void 0 ? void 0 : g.startsWith(x(y(t.prototype), "childRole", o));
167
+ if (n === "trigger" && (!p || m) && c && w)
170
168
  return o.handlers.visible(!0), o.handlers.highlightedIndex(0), setTimeout(function() {
171
- var q, S = o.asProps.highlightedIndex;
172
- (q = o.itemRefs[S]) === null || q === void 0 || q.focus();
169
+ var C, I = o.asProps.highlightedIndex;
170
+ (C = o.itemRefs[I]) === null || C === void 0 || C.focus();
173
171
  }, 0), e.preventDefault(), e.stopPropagation(), !1;
174
- if (r === "list" && f && p && x && (!h || h && (e.key === "Escape" || o.asProps.highlightedIndex === 0))) {
175
- var b;
176
- return o.handlers.visible(!1), (b = o.triggerRef.current) === null || b === void 0 || b.focus(), e.preventDefault(), e.stopPropagation(), !1;
172
+ if (n === "list" && p && h && w && (!m || m && (e.key === "Escape" || o.asProps.highlightedIndex === 0))) {
173
+ var S;
174
+ return o.handlers.visible(!1), (S = o.triggerRef.current) === null || S === void 0 || S.focus(), e.preventDefault(), e.stopPropagation(), !1;
177
175
  }
178
176
  };
179
177
  }
180
178
  }, {
181
179
  key: "handlePreventTabOnActions",
182
- value: function(r) {
183
- if (r.key === "Tab")
184
- return r.stopPropagation(), r.preventDefault(), !1;
180
+ value: function(n) {
181
+ if (n.key === "Tab")
182
+ return n.stopPropagation(), n.preventDefault(), !1;
185
183
  }
186
184
  }, {
187
185
  key: "render",
188
186
  value: function() {
189
- var r = this.asProps, o = this.asProps, e = o.Children, d = o.selectedIndex, s = o.interaction, l = o.timeout;
190
- return this.itemProps = [], /* @__PURE__ */ i.createElement(W.Provider, {
191
- value: d
192
- }, /* @__PURE__ */ i.createElement(D, m({
193
- timeout: l || (s === "hover" ? [0, 100] : void 0)
194
- }, r), /* @__PURE__ */ i.createElement(e, null)));
187
+ var n = this.asProps, o = this.asProps, e = o.Children, s = o.selectedIndex, g = o.interaction, d = o.timeout;
188
+ return this.itemProps = [], /* @__PURE__ */ i.createElement(q.Provider, {
189
+ value: s
190
+ }, /* @__PURE__ */ i.createElement(D, f({
191
+ timeout: d || (g === "hover" ? [0, 100] : void 0)
192
+ }, n), /* @__PURE__ */ i.createElement(e, null)));
195
193
  }
196
194
  }]), t;
197
- }(_e);
198
- C(M, "displayName", "DropdownMenu");
199
- C(M, "style", he);
200
- C(M, "enhance", Object.values(ae));
201
- C(M, "defaultProps", {
195
+ }(ae);
196
+ M(P, "displayName", "DropdownMenu");
197
+ M(P, "style", pe);
198
+ M(P, "enhance", Object.values(ie));
199
+ M(P, "defaultProps", {
202
200
  size: "m",
203
201
  defaultVisible: !1,
204
202
  defaultHighlightedIndex: 0,
205
203
  defaultSelectedIndex: 0,
206
- i18n: ge,
204
+ i18n: de,
207
205
  locale: "en",
208
206
  interaction: "click",
209
207
  inlineActions: !1,
210
208
  placement: "bottom-start",
211
209
  timeout: 0
212
210
  });
213
- C(M, "nestedMenuInteraction", {
211
+ M(P, "nestedMenuInteraction", {
214
212
  trigger: [["onClick", "onMouseEnter"], ["onClick", "onMouseLeave"]],
215
213
  popper: [["onMouseEnter"], ["onMouseLeave"]]
216
214
  });
217
- function pe(n) {
218
- var _ = arguments[0], t, a = n.styles, r = n.Children, o = k;
219
- return t = y(a), /* @__PURE__ */ i.createElement(U, t.cn("ListBoxContextProvider", {}), /* @__PURE__ */ i.createElement(o, t.cn("SDropdownMenuList", u({}, m({
215
+ function fe(r) {
216
+ var _ = arguments[0], t, a = r.styles, n = r.Children, o = k;
217
+ return t = b(a), /* @__PURE__ */ i.createElement(U, t.cn("ListBoxContextProvider", {}), /* @__PURE__ */ i.createElement(o, t.cn("SDropdownMenuList", u({}, f({
220
218
  shadow: !0
221
219
  }, _))), /* @__PURE__ */ i.createElement(k.Container, {
222
220
  tabIndex: void 0
223
- }, /* @__PURE__ */ i.createElement(r, t.cn("Children", {}))), /* @__PURE__ */ i.createElement(k.Bar, {
221
+ }, /* @__PURE__ */ i.createElement(n, t.cn("Children", {}))), /* @__PURE__ */ i.createElement(k.Bar, {
224
222
  orientation: "horizontal"
225
223
  }), /* @__PURE__ */ i.createElement(k.Bar, {
226
224
  orientation: "vertical"
227
225
  })));
228
226
  }
229
- function ve(n) {
230
- var _ = arguments[0], t, a = n.styles, r = N;
231
- return t = y(a), /* @__PURE__ */ i.createElement(r, t.cn("SDropdownMenuActions", u({}, m({}, _))));
227
+ function me(r) {
228
+ var _ = arguments[0], t, a = r.styles, n = z;
229
+ return t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SDropdownMenuActions", u({}, f({}, _))));
232
230
  }
233
- function xe(n) {
234
- var _ = arguments[0], t = n.visible, a = n.disablePortal, r = n.ignorePortalsStacking, o = n.disableEnforceFocus, e = n.interaction, d = n.autoFocus, s = n.animationsDisabled, l = {
231
+ function he(r) {
232
+ var _ = arguments[0], t = r.visible, a = r.disablePortal, n = r.ignorePortalsStacking, o = r.disableEnforceFocus, e = r.interaction, s = r.autoFocus, g = r.animationsDisabled, d = {
235
233
  visible: t,
236
234
  disablePortal: a,
237
- ignorePortalsStacking: r,
235
+ ignorePortalsStacking: n,
238
236
  disableEnforceFocus: o,
239
237
  interaction: e,
240
- autoFocus: d,
241
- animationsDisabled: s
238
+ autoFocus: s,
239
+ animationsDisabled: g
242
240
  };
243
- return /* @__PURE__ */ i.createElement(U, null, /* @__PURE__ */ i.createElement(v.Popper, O({}, l, {
241
+ return /* @__PURE__ */ i.createElement(U, null, /* @__PURE__ */ i.createElement(v.Popper, W({}, d, {
244
242
  role: null
245
- }), /* @__PURE__ */ i.createElement(v.List, m({}, _))));
243
+ }), /* @__PURE__ */ i.createElement(v.List, f({}, _))));
246
244
  }
247
- function be(n) {
248
- var _ = arguments[0], t, a = n.id, r = n.styles, o = n.disabled, e = n.Children, d = n.forwardRef, s = n.role, l = n.tabIndex, f = n.actionsRef, g = n["aria-checked"], h = D.Item, c = i.useRef(), p = i.useState(!1), x = T(p, 2), b = x[0], q = x[1], S = {
245
+ function ve(r) {
246
+ var _ = arguments[0], t, a = r.id, n = r.styles, o = r.disabled, e = r.Children, s = r.forwardRef, g = r.role, d = r.tabIndex, p = r.actionsRef, l = r["aria-checked"], m = D.Item, c = i.useRef(), h = i.useState(!1), w = N(h, 2), S = w[0], C = w[1], I = {
249
247
  contentId: a,
250
- ref: G(d, c),
251
- role: s,
252
- tabIndex: l,
253
- ariaChecked: g
254
- }, H = [], L = A(e, [v.displayName], !0), K = A(e, [v.Item.Hint.displayName], !0), P = A(e, [v.Item.Content.displayName], !0) || L || K;
255
- if (K) {
256
- var F = "igc-".concat(le(), "-option-hint");
257
- S.hintId = F, H.push(F);
248
+ ref: G(s, c),
249
+ role: g,
250
+ tabIndex: d,
251
+ ariaChecked: l
252
+ }, K = [], T = L(e, [v.displayName], !0), B = L(e, [v.Item.Hint.displayName], !0), R = L(e, [v.Item.Content.displayName], !0) || T || B;
253
+ if (B) {
254
+ var F = "igc-".concat(ge(), "-option-hint");
255
+ I.hintId = F, K.push(F);
258
256
  }
259
- L && (S.hasSubMenu = !0), S.ariaDescribes = H, i.useEffect(function() {
260
- var B = function(R) {
261
- R.target === c.current && (q(!0), L && R.stopPropagation());
262
- }, $ = function(R) {
263
- R.target === c.current && (q(!1), f.current && (c.current.tabIndex = -1));
257
+ return T && (I.hasSubMenu = !0), I.ariaDescribes = K, i.useEffect(function() {
258
+ var V = function(E) {
259
+ E.target === c.current && (C(!0), T && E.stopPropagation());
260
+ }, $ = function(E) {
261
+ E.target === c.current && (C(!1), p.current && (c.current.tabIndex = -1));
264
262
  };
265
- return document.addEventListener("focus", B, {
263
+ return document.addEventListener("focus", V, {
266
264
  capture: !0
267
265
  }), document.addEventListener("blur", $, {
268
266
  capture: !0
269
267
  }), function() {
270
- document.removeEventListener("focus", B, {
268
+ document.removeEventListener("focus", V, {
271
269
  capture: !0
272
270
  }), document.removeEventListener("blur", $, {
273
271
  capture: !0
274
272
  });
275
273
  };
276
- }, [c.current]);
277
- var J = ue();
278
- return t = y(r), /* @__PURE__ */ i.createElement(z.Provider, {
279
- value: S
280
- }, /* @__PURE__ */ i.createElement(h, t.cn("SDropdownMenuItemContainer", u({}, m({
281
- ref: P ? void 0 : S.ref,
282
- "use:highlighted": !o && b && J.current === "keyboard",
283
- "use:role": P ? void 0 : s,
284
- "use:id": P ? void 0 : a,
285
- "use:tabIndex": P ? void 0 : l,
286
- "use:aria-checked": P ? void 0 : g
274
+ }, [c.current]), t = b(n), /* @__PURE__ */ i.createElement(H.Provider, {
275
+ value: I
276
+ }, /* @__PURE__ */ i.createElement(m, t.cn("SDropdownMenuItemContainer", u({}, f({
277
+ ref: R ? void 0 : I.ref,
278
+ "use:highlighted": !o && S && re.isKeyboard(),
279
+ "use:role": R ? void 0 : g,
280
+ "use:id": R ? void 0 : a,
281
+ "use:tabIndex": R ? void 0 : d,
282
+ "use:aria-checked": R ? void 0 : l
287
283
  }, _))), /* @__PURE__ */ i.createElement(e, t.cn("Children", {}))));
288
284
  }
289
- function j(n) {
290
- var _ = de(n, n.forwardRef), t = T(_, 2), a = t[0], r = t[1], o = r.className, e = Y(r, me), d = y(n.styles);
291
- return /* @__PURE__ */ i.createElement(a, O({
292
- className: ie(d.cn("SDropdownMenuItemAddon", n).className, o) || void 0
285
+ function j(r) {
286
+ var _ = _e(r, r.forwardRef), t = N(_, 2), a = t[0], n = t[1], o = n.className, e = X(n, ce), s = b(r.styles);
287
+ return /* @__PURE__ */ i.createElement(a, W({
288
+ className: oe(s.cn("SDropdownMenuItemAddon", r).className, o) || void 0
293
289
  }, e));
294
290
  }
295
- function Se() {
296
- var n = arguments[0];
297
- return /* @__PURE__ */ i.createElement(D.Trigger, m({}, n));
291
+ function be() {
292
+ var r = arguments[0];
293
+ return /* @__PURE__ */ i.createElement(D.Trigger, f({}, r));
298
294
  }
299
- function we(n) {
300
- var _ = arguments[0], t, a = n.styles, r = N, o = i.useRef(), e = i.useContext(z), d = void 0;
301
- e.hasSubMenu && (d = "true");
302
- var s = i.useState(new Set(e.ariaDescribes)), l = T(s, 2), f = l[0], g = l[1];
295
+ function we(r) {
296
+ var _ = arguments[0], t, a = r.styles, n = z, o = i.useRef(), e = i.useContext(H), s = void 0;
297
+ e.hasSubMenu && (s = "true");
298
+ var g = i.useState(new Set(e.ariaDescribes)), d = N(g, 2), p = d[0], l = d[1];
303
299
  return i.useEffect(function() {
304
- var h = o.current, c = h == null ? void 0 : h.parentElement;
305
- c.getAttribute("aria-haspopup") === "true" && c.getAttribute("aria-describedby") && g(function(p) {
306
- return p.add(c.getAttribute("aria-describedby")), new Set(p);
300
+ var m = o.current, c = m == null ? void 0 : m.parentElement;
301
+ c.getAttribute("aria-haspopup") === "true" && c.getAttribute("aria-describedby") && l(function(h) {
302
+ return h.add(c.getAttribute("aria-describedby")), new Set(h);
307
303
  });
308
- }, [e.ariaDescribes]), t = y(a), /* @__PURE__ */ i.createElement(r, t.cn("SItemContent", u({}, m({
304
+ }, [e.ariaDescribes]), t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SItemContent", u({}, f({
309
305
  role: e.role,
310
306
  id: e.contentId,
311
307
  tabIndex: e.tabIndex,
312
308
  ref: G(e.ref, o),
313
- "use:aria-describedby": X(f).join(" "),
309
+ "use:aria-describedby": Q(p).join(" "),
314
310
  "aria-haspopup": e.hasSubMenu ? "true" : void 0,
315
- "aria-expanded": d,
311
+ "aria-expanded": s,
316
312
  "aria-checked": e.ariaChecked,
317
313
  alignItems: "center",
318
314
  justifyContent: e.hasSubMenu ? "space-between" : void 0
319
315
  }, _))));
320
316
  }
321
- function Ie(n) {
322
- var _ = arguments[0], t, a = n.styles, r = fe;
323
- return t = y(a), /* @__PURE__ */ i.createElement(r, t.cn("SItemContentText", u({}, m({}, _))));
317
+ function Se(r) {
318
+ var _ = arguments[0], t, a = r.styles, n = ue;
319
+ return t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SItemContentText", u({}, f({}, _))));
324
320
  }
325
- function ye(n) {
326
- var _ = arguments[0], t, a = n.styles, r = N, o = i.useContext(z), e = o.hintId;
327
- return t = y(a), /* @__PURE__ */ i.createElement(r, t.cn("SItemHint", u({}, m({
321
+ function Ie(r) {
322
+ var _ = arguments[0], t, a = r.styles, n = z, o = i.useContext(H), e = o.hintId;
323
+ return t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SItemHint", u({}, f({
328
324
  id: e,
329
325
  "aria-hidden": "true"
330
326
  }, _))));
331
327
  }
332
- function De(n) {
328
+ function xe(r) {
333
329
  var _ = arguments[0], t, a = D.Item;
334
- return t = y(n.styles), /* @__PURE__ */ i.createElement(a, t.cn("SDropdownMenuItemContainer", u({}, m({
330
+ return t = b(r.styles), /* @__PURE__ */ i.createElement(a, t.cn("SDropdownMenuItemContainer", u({}, f({
335
331
  variant: "hint"
336
332
  }, _))));
337
333
  }
338
- function qe(n) {
334
+ function ye(r) {
339
335
  var _ = arguments[0], t, a = D.Item;
340
- return t = y(n.styles), /* @__PURE__ */ i.createElement(a, t.cn("SDropdownMenuItemContainer", u({}, m({
336
+ return t = b(r.styles), /* @__PURE__ */ i.createElement(a, t.cn("SDropdownMenuItemContainer", u({}, f({
341
337
  variant: "title"
342
338
  }, _))));
343
339
  }
344
- function Ce(n) {
345
- var _ = arguments[0], t = n.forwardRef;
346
- return /* @__PURE__ */ i.createElement(v.Item, m({
340
+ function De(r) {
341
+ var _ = arguments[0], t = r.forwardRef;
342
+ return /* @__PURE__ */ i.createElement(v.Item, f({
347
343
  ref: t
348
344
  }, _));
349
345
  }
350
- function Me(n) {
351
- var _ = arguments[0], t = n.forwardRef;
352
- return /* @__PURE__ */ i.createElement(v.Item.Content, m({
346
+ function Ce(r) {
347
+ var _ = arguments[0], t = r.forwardRef;
348
+ return /* @__PURE__ */ i.createElement(v.Item.Content, f({
353
349
  tag: v.Trigger,
354
350
  ref: t,
355
351
  "use:role": "menuitem"
356
352
  }, _));
357
353
  }
358
- var v = oe(M, {
359
- Trigger: Se,
354
+ var v = ne(P, {
355
+ Trigger: be,
360
356
  Popper: D.Popper,
361
- List: pe,
362
- Actions: ve,
363
- Menu: xe,
364
- Item: [be, {
357
+ List: fe,
358
+ Actions: me,
359
+ Menu: he,
360
+ Item: [ve, {
365
361
  Addon: j,
366
362
  Content: we,
367
- Text: Ie,
368
- Hint: ye
363
+ Text: Se,
364
+ Hint: Ie
369
365
  }],
370
366
  /**
371
367
  * @deprecated. Use just Item. See examples on
372
368
  */
373
- Nesting: [Ce, {
374
- Trigger: Me,
369
+ Nesting: [De, {
370
+ Trigger: Ce,
375
371
  Addon: j
376
372
  }],
377
- ItemTitle: qe,
378
- ItemHint: De,
373
+ ItemTitle: ye,
374
+ ItemHint: xe,
379
375
  Group: D.Group
380
376
  }, {
381
377
  parent: [D]
382
378
  });
383
- v.selectedIndexContext = W;
379
+ v.selectedIndexContext = q;
384
380
  export {
385
381
  v as default
386
382
  };