@semcore/select 4.50.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,99 @@
1
- import K from "@babel/runtime/helpers/esm/slicedToArray";
1
+ import B from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import M from "@babel/runtime/helpers/esm/extends";
3
3
  import J from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import u from "@babel/runtime/helpers/esm/objectSpread2";
5
5
  import Q from "@babel/runtime/helpers/esm/classCallCheck";
6
6
  import V from "@babel/runtime/helpers/esm/createClass";
7
- import A from "@babel/runtime/helpers/esm/assertThisInitialized";
7
+ import D from "@babel/runtime/helpers/esm/assertThisInitialized";
8
8
  import y from "@babel/runtime/helpers/esm/get";
9
9
  import C from "@babel/runtime/helpers/esm/getPrototypeOf";
10
10
  import U from "@babel/runtime/helpers/esm/inherits";
11
11
  import X from "@babel/runtime/helpers/esm/createSuper";
12
- import x from "@babel/runtime/helpers/esm/defineProperty";
13
- import { sstyled as F } from "@semcore/utils/lib/core/index";
14
- import q, { assignProps as S, sstyled as R } from "@semcore/core";
15
- import m from "react";
12
+ import b from "@babel/runtime/helpers/esm/defineProperty";
13
+ import { sstyled as w, createComponent as F, lastInteraction as q, assignProps as S } from "@semcore/core";
14
+ import g from "react";
16
15
  import Y from "classnames";
17
16
  import f from "@semcore/dropdown-menu";
18
- import w, { enhance as ee, selectedIndexContext as te, AbstractDropdown as re } from "@semcore/dropdown";
17
+ import T, { enhance as ee, selectedIndexContext as te, AbstractDropdown as re } from "@semcore/dropdown";
19
18
  import { ButtonTrigger as I } from "@semcore/base-trigger";
20
- import ie from "@semcore/divider";
21
- import oe, { isAdvanceMode as k } from "@semcore/utils/lib/findComponent";
22
- import ne from "@semcore/utils/lib/logger";
23
- import ae from "@semcore/utils/lib/enhances/resolveColorEnhance";
24
- import le from "@semcore/utils/lib/addonTextChildren";
25
- import D from "./InputSearch.mjs";
19
+ import ne from "@semcore/divider";
20
+ import ie, { isAdvanceMode as k } from "@semcore/core/lib/utils/findComponent";
21
+ import oe from "@semcore/core/lib/utils/logger";
22
+ import le from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
23
+ import ae from "@semcore/core/lib/utils/addonTextChildren";
24
+ import z from "./InputSearch.mjs";
26
25
  import { useBox as de } from "@semcore/flex-box";
27
26
  import { selectContext as se } from "./context.mjs";
28
27
  import { localizedMessages as ce } from "./translations/__intergalactic-dynamic-locales.mjs";
29
28
  import { isInputTriggerTag as _e } from "@semcore/popper";
30
- import { callAllEventHandlers as N } from "@semcore/utils/lib/assignProps";
31
- var me = ["Children", "options", "multiselect", "value", "uid", "forcedAdvancedMode"], ge = (
29
+ import { callAllEventHandlers as N } from "@semcore/core/lib/utils/assignProps";
30
+ var ge = ["Children", "options", "multiselect", "value", "uid", "forcedAdvancedMode"], he = (
32
31
  /*__reshadow_css_start__*/
33
- (F.insert(
32
+ (w.insert(
34
33
  /*__inner_css_start__*/
35
- '.___SOptionCheckbox_1v5md_gg_{margin-top:var(--intergalactic-spacing-05x, 2px);margin-right:var(--intergalactic-spacing-2x, 8px);margin-bottom:auto;position:relative;flex-shrink:0;width:16px;height:16px}.___SOptionCheckbox_1v5md_gg_::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:var(--intergalactic-bg-primary-neutral, #ffffff);border:1px solid;border-radius:var(--intergalactic-addon-rounded, 4px);border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SOptionCheckbox_1v5md_gg_::after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;margin:0 var(--intergalactic-spacing-05x, 2px);background-repeat:no-repeat;background-position:center center}.___SOptionCheckbox_1v5md_gg_.__selected_1v5md_gg_::after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNyIgdmlld0JveD0iMCAwIDEwIDciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik04LjI1IDFMNCA1LjI1TDEuNzUgMyIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==)}.___SOptionCheckbox_1v5md_gg_._size_l_1v5md_gg_{width:20px;height:20px}.___SOptionCheckbox_1v5md_gg_._size_l_1v5md_gg_.__selected_1v5md_gg_::after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMSAxLjVMNC43NSA3Ljc1TDEgNCIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==)}.___SOptionCheckbox_1v5md_gg_.__indeterminate_1v5md_gg_:before,.___SOptionCheckbox_1v5md_gg_.__selected_1v5md_gg_:before{background-color:var(--intergalactic-control-primary-info, #008ff8);border-color:var(--intergalactic-control-primary-info, #008ff8)}.___SOptionCheckbox_1v5md_gg_.__theme_1v5md_gg_:before{border-color:var(--theme_1v5md)}.___SOptionCheckbox_1v5md_gg_.__theme_1v5md_gg_.__indeterminate_1v5md_gg_:before,.___SOptionCheckbox_1v5md_gg_.__theme_1v5md_gg_.__selected_1v5md_gg_:before{background-color:var(--theme_1v5md);border-color:var(--theme_1v5md)}.___SOptionCheckbox_1v5md_gg_.__selected_1v5md_gg_{background-color:var(--intergalactic-dropdown-menu-item-selected, rgba(196, 229, 254, 0.7))}@media (hover:hover){.___SOptionCheckbox_1v5md_gg_.__selected_1v5md_gg_:hover{background-color:var(--intergalactic-dropdown-menu-item-selected-hover, #c4e5fe)}}.___SOptionCheckbox_1v5md_gg_.__indeterminate_1v5md_gg_:after{background-color:#fff;background-image:none;margin:auto;border-radius:1px}.___SOptionCheckbox_1v5md_gg_.__indeterminate_1v5md_gg_._size_l_1v5md_gg_:after{width:12px;height:2px}.___SOptionCheckbox_1v5md_gg_.__indeterminate_1v5md_gg_._size_m_1v5md_gg_:after{width:8px;height:2px}',
36
- "1v5md_gg_"
34
+ '.___SOptionCheckbox_1dlne_gg_{margin-top:var(--intergalactic-spacing-05x, 2px);margin-right:var(--intergalactic-spacing-2x, 8px);margin-bottom:auto;position:relative;flex-shrink:0;width:16px;height:16px}.___SOptionCheckbox_1dlne_gg_::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:var(--intergalactic-bg-primary-neutral, #ffffff);border:1px solid;border-radius:var(--intergalactic-addon-rounded, 4px);border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SOptionCheckbox_1dlne_gg_::after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;margin:0 var(--intergalactic-spacing-05x, 2px);background-repeat:no-repeat;background-position:center center}.___SOptionCheckbox_1dlne_gg_.__selected_1dlne_gg_::after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNyIgdmlld0JveD0iMCAwIDEwIDciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik04LjI1IDFMNCA1LjI1TDEuNzUgMyIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==)}.___SOptionCheckbox_1dlne_gg_._size_l_1dlne_gg_{width:20px;height:20px}.___SOptionCheckbox_1dlne_gg_._size_l_1dlne_gg_.__selected_1dlne_gg_::after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMSAxLjVMNC43NSA3Ljc1TDEgNCIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==)}.___SOptionCheckbox_1dlne_gg_.__indeterminate_1dlne_gg_:before,.___SOptionCheckbox_1dlne_gg_.__selected_1dlne_gg_:before{background-color:var(--intergalactic-control-primary-info, #008ff8);border-color:var(--intergalactic-control-primary-info, #008ff8)}.___SOptionCheckbox_1dlne_gg_.__theme_1dlne_gg_:before{border-color:var(--theme_1dlne)}.___SOptionCheckbox_1dlne_gg_.__theme_1dlne_gg_.__indeterminate_1dlne_gg_:before,.___SOptionCheckbox_1dlne_gg_.__theme_1dlne_gg_.__selected_1dlne_gg_:before{background-color:var(--theme_1dlne);border-color:var(--theme_1dlne)}.___SOptionCheckbox_1dlne_gg_.__selected_1dlne_gg_{background-color:var(--intergalactic-dropdown-menu-item-selected, rgba(196, 229, 254, 0.7))}@media (hover:hover){.___SOptionCheckbox_1dlne_gg_.__selected_1dlne_gg_:hover{background-color:var(--intergalactic-dropdown-menu-item-selected-hover, #c4e5fe)}}.___SOptionCheckbox_1dlne_gg_.__indeterminate_1dlne_gg_:after{background-color:#fff;background-image:none;margin:auto;border-radius:1px}.___SOptionCheckbox_1dlne_gg_.__indeterminate_1dlne_gg_._size_l_1dlne_gg_:after{width:12px;height:2px}.___SOptionCheckbox_1dlne_gg_.__indeterminate_1dlne_gg_._size_m_1dlne_gg_:after{width:8px;height:2px}',
35
+ "1dlne_gg_"
37
36
  ), {
38
- __SOptionCheckbox: "___SOptionCheckbox_1v5md_gg_",
39
- _selected: "__selected_1v5md_gg_",
40
- _size_l: "_size_l_1v5md_gg_",
41
- _indeterminate: "__indeterminate_1v5md_gg_",
42
- _theme: "__theme_1v5md_gg_",
43
- "--theme": "--theme_1v5md",
44
- _size_m: "_size_m_1v5md_gg_"
37
+ __SOptionCheckbox: "___SOptionCheckbox_1dlne_gg_",
38
+ _selected: "__selected_1dlne_gg_",
39
+ _size_l: "_size_l_1dlne_gg_",
40
+ _indeterminate: "__indeterminate_1dlne_gg_",
41
+ _theme: "__theme_1dlne_gg_",
42
+ "--theme": "--theme_1dlne",
43
+ _size_m: "_size_m_1dlne_gg_"
45
44
  })
46
45
  );
47
- function E(i, l) {
48
- return Array.isArray(i) ? i.includes(l) : l === i;
46
+ function E(n, a) {
47
+ return Array.isArray(n) ? n.includes(a) : a === n;
49
48
  }
50
- function ue(i) {
51
- return Array.isArray(i) ? i.length === 0 : i === null;
49
+ function ue(n) {
50
+ return Array.isArray(n) ? n.length === 0 : n === null;
52
51
  }
53
- function $(i) {
54
- return i ? [] : null;
52
+ function $(n) {
53
+ return n ? [] : null;
55
54
  }
56
- var O = /* @__PURE__ */ function(i) {
57
- U(o, i);
58
- var l = X(o);
59
- function o() {
60
- var n;
61
- Q(this, o);
55
+ var O = /* @__PURE__ */ function(n) {
56
+ U(i, n);
57
+ var a = X(i);
58
+ function i() {
59
+ var o;
60
+ Q(this, i);
62
61
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
63
62
  t[r] = arguments[r];
64
- return n = l.call.apply(l, [this].concat(t)), x(A(n), "role", "listbox"), x(A(n), "bindHandlerOptionClick", function(a, d) {
63
+ return o = a.call.apply(a, [this].concat(t)), b(D(o), "role", "listbox"), b(D(o), "bindHandlerOptionClick", function(l, d) {
65
64
  return function(s) {
66
- var _ = a, g = n.asProps, c = g.value, v = g.multiselect;
67
- Array.isArray(c) && (c.includes(a) ? _ = c.filter(function(p) {
68
- return p !== a;
69
- }) : _ = c.concat(a)), n.handlers.value(_, s), v || (n.handlers.visible(!1), s.preventDefault());
65
+ var c = l, h = o.asProps, _ = h.value, v = h.multiselect;
66
+ Array.isArray(_) && (_.includes(l) ? c = _.filter(function(m) {
67
+ return m !== l;
68
+ }) : c = _.concat(l)), o.handlers.value(c, s), v || (o.handlers.visible(!1), s.preventDefault());
70
69
  };
71
- }), x(A(n), "handlerClear", function(a) {
72
- var d = n.asProps.value, s = $(Array.isArray(d));
73
- n.handlers.value(s, a), n.handlers.visible(!1);
74
- }), n;
70
+ }), b(D(o), "handlerClear", function(l) {
71
+ var d = o.asProps.value, s = $(Array.isArray(d));
72
+ o.handlers.value(s, l), o.handlers.visible(!1);
73
+ }), o;
75
74
  }
76
- return V(o, [{
75
+ return V(i, [{
77
76
  key: "itemRef",
78
77
  value: function(e, t, r) {
79
- y(C(o.prototype), "itemRef", this).call(this, e, t, r);
80
- var a = this.asProps.highlightedIndex, d = t === a;
78
+ y(C(i.prototype), "itemRef", this).call(this, e, t, r);
79
+ var l = this.asProps.highlightedIndex, d = t === l;
81
80
  d && this.scrollToNode(r);
82
81
  }
83
82
  }, {
84
83
  key: "uncontrolledProps",
85
84
  value: function() {
86
85
  var e = this;
87
- return u(u({}, y(C(o.prototype), "uncontrolledProps", this).call(this)), {}, {
86
+ return u(u({}, y(C(i.prototype), "uncontrolledProps", this).call(this)), {}, {
88
87
  visible: [null, function(t) {
89
88
  if (t === !0) {
90
- var r = k(e.asProps.Children, [h.InputSearch.displayName], !0), a = r ? null : e.props.defaultHighlightedIndex;
91
- e.handlers.highlightedIndex(a), setTimeout(function() {
92
- var d, s, _ = (d = e.menuRef.current) === null || d === void 0 ? void 0 : d.querySelectorAll('[role="option"]'), g = (s = e.menuRef.current) === null || s === void 0 ? void 0 : s.querySelector('[aria-selected="true"]');
93
- if (g && _) {
94
- e.scrollToNode(g);
95
- for (var c = 0; c < _.length; c++)
96
- if (_[c] === g) {
97
- e.handlers.highlightedIndex(c);
89
+ var r = k(e.asProps.Children, [p.InputSearch.displayName], !0), l = r ? null : e.props.defaultHighlightedIndex;
90
+ e.handlers.highlightedIndex(l), setTimeout(function() {
91
+ var d, s, c = (d = e.menuRef.current) === null || d === void 0 ? void 0 : d.querySelectorAll('[role="option"]'), h = (s = e.menuRef.current) === null || s === void 0 ? void 0 : s.querySelector('[aria-selected="true"]');
92
+ if (h && c) {
93
+ e.scrollToNode(h);
94
+ for (var _ = 0; _ < c.length; _++)
95
+ if (c[_] === h) {
96
+ e.handlers.highlightedIndex(_);
98
97
  break;
99
98
  }
100
99
  }
@@ -107,32 +106,32 @@ var O = /* @__PURE__ */ function(i) {
107
106
  }, {
108
107
  key: "getTriggerProps",
109
108
  value: function() {
110
- var e = this, t = this.asProps, r = t.disabled, a = t.visible, d = t.state, s = t.placeholder, _ = t.value, g = t.options, c = t.forwardRef, v = t.name, p = t.multiselect, b = t.getI18nText, T = t.highlightedIndex, P = t.uid, G = t.Children, Z = t.children, z = k(G, [h.Menu.displayName], !0) || !Z, j = z ? "igc-".concat(P, "-list") : "igc-".concat(P, "-popper");
111
- return u(u({}, y(C(o.prototype), "getTriggerProps", this).call(this)), {}, {
109
+ var e = this, t = this.asProps, r = t.disabled, l = t.visible, d = t.state, s = t.placeholder, c = t.value, h = t.options, _ = t.forwardRef, v = t.name, m = t.multiselect, x = t.getI18nText, P = t.highlightedIndex, A = t.uid, G = t.Children, Z = t.children, R = k(G, [p.Menu.displayName], !0) || !Z, j = R ? "igc-".concat(A, "-list") : "igc-".concat(A, "-popper");
110
+ return u(u({}, y(C(i.prototype), "getTriggerProps", this).call(this)), {}, {
112
111
  onKeyDown: N(this.handlePreventCommonKeyDown.bind(this), this.handleOpenKeyDown.bind(this), this.handleArrowKeyDown.bind(this)),
113
- "aria-controls": a ? j : void 0,
114
- "aria-haspopup": z ? "listbox" : "dialog",
112
+ "aria-controls": l ? j : void 0,
113
+ "aria-haspopup": R ? "listbox" : "dialog",
115
114
  "aria-disabled": r ? "true" : "false",
116
- "aria-activedescendant": a && T !== null && this.itemRefs[T] ? "igc-".concat(P, "-option-").concat(T) : void 0,
117
- empty: ue(_),
118
- value: _,
115
+ "aria-activedescendant": l && P !== null && this.itemRefs[P] ? "igc-".concat(A, "-option-").concat(P) : void 0,
116
+ empty: ue(c),
117
+ value: c,
119
118
  name: v,
120
- $hiddenRef: c,
121
- multiselect: p,
119
+ $hiddenRef: _,
120
+ multiselect: m,
122
121
  state: d,
123
122
  placeholder: s,
124
123
  disabled: r,
125
- active: a,
124
+ active: l,
126
125
  onClear: this.handlerClear,
127
- children: this.renderChildrenTrigger(_, g),
128
- getI18nText: b,
126
+ children: this.renderChildrenTrigger(c, h),
127
+ getI18nText: x,
129
128
  onBlur: function() {
130
129
  e.asProps.visible && (e.prevHighlightedIndex = e.asProps.highlightedIndex, e.handlers.highlightedIndex(null));
131
130
  },
132
131
  onFocus: function() {
133
132
  if (e.asProps.visible) {
134
- var B = e.prevHighlightedIndex;
135
- e.handlers.highlightedIndex(B);
133
+ var W = e.prevHighlightedIndex;
134
+ e.handlers.highlightedIndex(W);
136
135
  }
137
136
  }
138
137
  });
@@ -141,32 +140,32 @@ var O = /* @__PURE__ */ function(i) {
141
140
  key: "getListProps",
142
141
  value: function() {
143
142
  var e = this.asProps.multiselect;
144
- return u(u({}, y(C(o.prototype), "getListProps", this).call(this)), {}, {
143
+ return u(u({}, y(C(i.prototype), "getListProps", this).call(this)), {}, {
145
144
  "aria-multiselectable": e ? "true" : void 0
146
145
  });
147
146
  }
148
147
  }, {
149
148
  key: "getPopperProps",
150
149
  value: function() {
151
- return u(u({}, y(C(o.prototype), "getPopperProps", this).call(this)), {}, {
150
+ return u(u({}, y(C(i.prototype), "getPopperProps", this).call(this)), {}, {
152
151
  onKeyDown: N(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this), this.handleArrowKeyDown.bind(this))
153
152
  });
154
153
  }
155
154
  }, {
156
155
  key: "getOptionProps",
157
156
  value: function(e, t) {
158
- var r, a = this, d = this.asProps, s = d.value, _ = d.highlightedIndex, g = d.focusSourceRef, c = d.size, v = c === void 0 ? "m" : c, p = t === _ && g.current === "keyboard" && !e.disabled, b = (r = e.selected) !== null && r !== void 0 ? r : E(s, e.value);
159
- return u(u({}, y(C(o.prototype), "getItemProps", this).call(this, e, t)), {}, {
160
- highlighted: p,
161
- selected: b,
162
- "aria-selected": b ? "true" : "false",
157
+ var r, l = this, d = this.asProps, s = d.value, c = d.highlightedIndex, h = d.size, _ = h === void 0 ? "m" : h, v = t === c && q.isKeyboard() && !e.disabled, m = (r = e.selected) !== null && r !== void 0 ? r : E(s, e.value);
158
+ return u(u({}, y(C(i.prototype), "getItemProps", this).call(this, e, t)), {}, {
159
+ highlighted: v,
160
+ selected: m,
161
+ "aria-selected": m ? "true" : "false",
163
162
  "aria-disabled": e.disabled ? "true" : "false",
164
163
  role: "option",
165
164
  onClick: this.bindHandlerOptionClick(e.value, t),
166
165
  ref: function(P) {
167
- return a.itemRef(e, t, P);
166
+ return l.itemRef(e, t, P);
168
167
  },
169
- size: v
168
+ size: _
170
169
  });
171
170
  }
172
171
  }, {
@@ -189,125 +188,125 @@ var O = /* @__PURE__ */ function(i) {
189
188
  }, {
190
189
  key: "renderChildrenTrigger",
191
190
  value: function(e, t) {
192
- return t ? [].concat(e).reduce(function(r, a) {
191
+ return t ? [].concat(e).reduce(function(r, l) {
193
192
  var d = t.find(function(s) {
194
- return E(a, s.value);
193
+ return E(l, s.value);
195
194
  });
196
195
  return d && (r.length && r.push(", "), r.push(d.label || d.value)), r;
197
- }, []) : Array.isArray(e) ? e.reduce(function(r, a) {
198
- return r.length && r.push(", "), r.push(a), r;
196
+ }, []) : Array.isArray(e) ? e.reduce(function(r, l) {
197
+ return r.length && r.push(", "), r.push(l), r;
199
198
  }, []) : e;
200
199
  }
201
200
  }, {
202
201
  key: "render",
203
202
  value: function() {
204
- var e = this.asProps, t = this.asProps, r = t.Children, a = t.options, d = t.multiselect;
203
+ var e = this.asProps, t = this.asProps, r = t.Children, l = t.options, d = t.multiselect;
205
204
  t.value;
206
- var s = t.uid, _ = t.forcedAdvancedMode, g = J(t, me), c = _ || oe(r, [h.Trigger.displayName, h.Popper.displayName]);
207
- if (ne.warn(a && c, "Don't use at the same time 'options' property and '<Select.Trigger/>/<Select.Popper/>'", g["data-ui-name"] || h.displayName), this.itemProps = [], a) {
205
+ var s = t.uid, c = t.forcedAdvancedMode, h = J(t, ge), _ = c || ie(r, [p.Trigger.displayName, p.Popper.displayName]);
206
+ if (oe.warn(l && _, "Don't use at the same time 'options' property and '<Select.Trigger/>/<Select.Popper/>'", h["data-ui-name"] || p.displayName), this.itemProps = [], l) {
208
207
  var v = this.asProps;
209
- return /* @__PURE__ */ m.createElement(f, S({}, v), /* @__PURE__ */ m.createElement(h.Trigger, g), /* @__PURE__ */ m.createElement(h.Menu, null, a.map(function(p, b) {
210
- return /* @__PURE__ */ m.createElement(h.Option, M({
211
- key: p.value,
212
- id: "igc-".concat(s, "-option-").concat(b)
213
- }, p), d && /* @__PURE__ */ m.createElement(h.Option.Checkbox, null), p.children);
208
+ return /* @__PURE__ */ g.createElement(f, S({}, v), /* @__PURE__ */ g.createElement(p.Trigger, h), /* @__PURE__ */ g.createElement(p.Menu, null, l.map(function(m, x) {
209
+ return /* @__PURE__ */ g.createElement(p.Option, M({
210
+ key: m.value,
211
+ id: "igc-".concat(s, "-option-").concat(x)
212
+ }, m), d && /* @__PURE__ */ g.createElement(p.Option.Checkbox, null), m.children);
214
213
  })));
215
214
  }
216
- return /* @__PURE__ */ m.createElement(f, S({}, e), /* @__PURE__ */ m.createElement(r, null));
215
+ return /* @__PURE__ */ g.createElement(f, S({}, e), /* @__PURE__ */ g.createElement(r, null));
217
216
  }
218
- }]), o;
217
+ }]), i;
219
218
  }(re);
220
- x(O, "displayName", "Select");
221
- x(O, "style", ge);
222
- x(O, "enhance", Object.values(ee).concat([ae()]));
223
- x(O, "defaultProps", function(i) {
224
- var l, o, n, e, t = i.children && k(i.children, [h.InputSearch.displayName], !0), r = t ? null : 0;
219
+ b(O, "displayName", "Select");
220
+ b(O, "style", he);
221
+ b(O, "enhance", Object.values(ee).concat([le()]));
222
+ b(O, "defaultProps", function(n) {
223
+ var a, i, o, e, t = n.children && k(n.children, [p.InputSearch.displayName], !0), r = t ? null : 0;
225
224
  return {
226
- placeholder: i.multiselect ? "Select options" : "Select option",
225
+ placeholder: n.multiselect ? "Select options" : "Select option",
227
226
  size: "m",
228
- defaultValue: $(i.multiselect),
227
+ defaultValue: $(n.multiselect),
229
228
  defaultVisible: !1,
230
- defaultHighlightedIndex: (l = i.highlightedIndex) !== null && l !== void 0 ? l : r,
231
- defaultSelectedIndex: (o = i.selectedIndex) !== null && o !== void 0 ? o : r,
229
+ defaultHighlightedIndex: (a = n.highlightedIndex) !== null && a !== void 0 ? a : r,
230
+ defaultSelectedIndex: (i = n.selectedIndex) !== null && i !== void 0 ? i : r,
232
231
  scrollToSelected: !0,
233
232
  i18n: ce,
234
233
  locale: "en",
235
- interaction: (n = i.interaction) !== null && n !== void 0 ? n : "click",
234
+ interaction: (o = n.interaction) !== null && o !== void 0 ? o : "click",
236
235
  inlineActions: !1,
237
- timeout: (e = i.timeout) !== null && e !== void 0 ? e : 0
236
+ timeout: (e = n.timeout) !== null && e !== void 0 ? e : 0
238
237
  };
239
238
  });
240
- function he(i) {
241
- var l = arguments[0], o, n = i.Children, e = i.name, t = i.value, r = i.styles, a = i.$hiddenRef, d = i.tag, s = d === void 0 ? I : d, _ = i.getI18nText, g = _e(s), c = w.Trigger;
242
- return o = R(r), /* @__PURE__ */ m.createElement(c, o.cn("SSelectTrigger", u({}, S({
239
+ function pe(n) {
240
+ var a = arguments[0], i, o = n.Children, e = n.name, t = n.value, r = n.styles, l = n.$hiddenRef, d = n.tag, s = d === void 0 ? I : d, c = n.getI18nText, h = _e(s), _ = T.Trigger;
241
+ return i = w(r), /* @__PURE__ */ g.createElement(_, i.cn("SSelectTrigger", u({}, S({
243
242
  tag: s,
244
- placeholder: _("selectPlaceholder"),
243
+ placeholder: c("selectPlaceholder"),
245
244
  role: "combobox",
246
- "aria-autocomplete": g && "list" || void 0
247
- }, l))), le(n, s.Text || I.Text, s.Value || I.Text, s.Addon || I.Addon, !0), e && /* @__PURE__ */ m.createElement("input", o.cn("input", {
245
+ "aria-autocomplete": h && "list" || void 0
246
+ }, a))), ae(o, s.Text || I.Text, s.Value || I.Text, s.Addon || I.Addon, !0), e && /* @__PURE__ */ g.createElement("input", i.cn("input", {
248
247
  type: "hidden",
249
248
  defaultValue: t,
250
249
  name: e,
251
- ref: a
250
+ ref: l
252
251
  })));
253
252
  }
254
- var L = /* @__PURE__ */ m.createContext({});
255
- function pe(i) {
256
- var l = arguments[0], o, n = w.Item, e = i.styles, t = i.Children, r = k(t, [h.Option.Checkbox.displayName]), a = k(t, [h.Option.Content.displayName]);
257
- return o = R(e), /* @__PURE__ */ m.createElement(n, o.cn("SSelectOption", u({}, S({}, l))), /* @__PURE__ */ m.createElement(L.Provider, {
258
- value: i
259
- }, r && !a ? /* @__PURE__ */ m.createElement(h.Option.Content, null, /* @__PURE__ */ m.createElement(t, o.cn("Children", {}))) : /* @__PURE__ */ m.createElement(t, o.cn("Children", {}))));
253
+ var L = /* @__PURE__ */ g.createContext({});
254
+ function me(n) {
255
+ var a = arguments[0], i, o = T.Item, e = n.styles, t = n.Children, r = k(t, [p.Option.Checkbox.displayName]), l = k(t, [p.Option.Content.displayName]);
256
+ return i = w(e), /* @__PURE__ */ g.createElement(o, i.cn("SSelectOption", u({}, S({}, a))), /* @__PURE__ */ g.createElement(L.Provider, {
257
+ value: n
258
+ }, r && !l ? /* @__PURE__ */ g.createElement(p.Option.Content, null, /* @__PURE__ */ g.createElement(t, i.cn("Children", {}))) : /* @__PURE__ */ g.createElement(t, i.cn("Children", {}))));
260
259
  }
261
- function ve(i) {
262
- var l = m.useContext(L), o = m.useMemo(function() {
260
+ function ve(n) {
261
+ var a = g.useContext(L), i = g.useMemo(function() {
263
262
  return u({
264
- selected: l == null ? void 0 : l.selected,
265
- disabled: l == null ? void 0 : l.disabled,
266
- size: l == null ? void 0 : l.size
267
- }, i || {});
268
- }, [i, l]), n = de(o, o.forwardRef), e = K(n, 2), t = e[0], r = e[1], a = o.size, d = o.theme, s = o.selected, _ = o.resolveColor, g = o.indeterminate, c = R(o.styles), v = c.cn("SOptionCheckbox", {
269
- size: a,
270
- "use:theme": _(d),
271
- indeterminate: g,
263
+ selected: a == null ? void 0 : a.selected,
264
+ disabled: a == null ? void 0 : a.disabled,
265
+ size: a == null ? void 0 : a.size
266
+ }, n || {});
267
+ }, [n, a]), o = de(i, i.forwardRef), e = B(o, 2), t = e[0], r = e[1], l = i.size, d = i.theme, s = i.selected, c = i.resolveColor, h = i.indeterminate, _ = w(i.styles), v = _.cn("SOptionCheckbox", {
268
+ size: l,
269
+ "use:theme": c(d),
270
+ indeterminate: h,
272
271
  selected: s
273
- }), p = v.className, b = v.style;
274
- return /* @__PURE__ */ m.createElement(t, M({}, r, {
275
- className: Y(p, r.className) || void 0,
276
- style: u(u({}, b), r.style),
272
+ }), m = v.className, x = v.style;
273
+ return /* @__PURE__ */ g.createElement(t, M({}, r, {
274
+ className: Y(m, r.className) || void 0,
275
+ style: u(u({}, x), r.style),
277
276
  tabIndex: -1
278
277
  }));
279
278
  }
280
279
  var H = function() {
281
- var l = arguments[0];
282
- return /* @__PURE__ */ m.createElement(D, S({}, l));
283
- }, h = q(O, {
284
- Trigger: [he, {
280
+ var a = arguments[0];
281
+ return /* @__PURE__ */ g.createElement(z, S({}, a));
282
+ }, p = F(O, {
283
+ Trigger: [pe, {
285
284
  Addon: I.Addon,
286
285
  Text: I.Text
287
286
  }],
288
- Popper: w.Popper,
287
+ Popper: T.Popper,
289
288
  List: f.List,
290
289
  Menu: f.Menu,
291
- Option: [pe, {
290
+ Option: [me, {
292
291
  Addon: f.Item.Addon,
293
292
  Content: f.Item.Content,
294
293
  Hint: f.Item.Hint,
295
294
  Checkbox: ve
296
295
  }],
297
- Group: w.Group,
296
+ Group: T.Group,
298
297
  OptionTitle: f.ItemTitle,
299
298
  OptionHint: f.ItemHint,
300
- Divider: ie,
301
- InputSearch: [H, D._______childrenComponents],
302
- Input: [H, D._______childrenComponents]
299
+ Divider: ne,
300
+ InputSearch: [H, z._______childrenComponents],
301
+ Input: [H, z._______childrenComponents]
303
302
  }, {
304
303
  parent: f,
305
304
  context: se
306
- }), Ve = function(l) {
307
- return l;
305
+ }), Qe = function(a) {
306
+ return a;
308
307
  };
309
- h.selectedIndexContext = te;
308
+ p.selectedIndexContext = te;
310
309
  export {
311
- h as default,
312
- Ve as wrapSelect
310
+ p as default,
311
+ Qe as wrapSelect
313
312
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/select",
3
3
  "description": "Semrush Select Component",
4
- "version": "4.50.1",
4
+ "version": "16.0.0-prerelease.2",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -13,23 +13,20 @@
13
13
  "types": "./lib/types/index.d.ts"
14
14
  },
15
15
  "dependencies": {
16
- "@semcore/base-trigger": "4.52.1",
17
- "@semcore/button": "5.42.1",
18
- "@semcore/checkbox": "7.44.1",
19
- "@semcore/divider": "4.40.1",
20
- "@semcore/dropdown-menu": "4.46.1",
21
- "@semcore/dropdown": "4.43.1",
22
- "@semcore/popper": "5.46.1",
23
- "@semcore/flex-box": "5.41.1",
24
- "@semcore/icon": "4.60.1",
25
- "@semcore/input": "4.42.1",
26
- "@semcore/utils": "4.48.1",
16
+ "@semcore/base-trigger": "16.0.0-prerelease.2",
17
+ "@semcore/button": "16.0.0-prerelease.2",
18
+ "@semcore/checkbox": "16.0.0-prerelease.2",
19
+ "@semcore/divider": "16.0.0-prerelease.2",
20
+ "@semcore/dropdown-menu": "16.0.0-prerelease.2",
21
+ "@semcore/dropdown": "16.0.0-prerelease.2",
22
+ "@semcore/icon": "16.0.0-prerelease.2",
23
+ "@semcore/input": "16.0.0-prerelease.2",
24
+ "@semcore/popper": "16.0.0-prerelease.2",
25
+ "@semcore/flex-box": "16.0.0-prerelease.2",
27
26
  "classnames": "2.2.6"
28
27
  },
29
28
  "peerDependencies": {
30
- "@semcore/core": "^2.17.5",
31
- "react": "16.8 - 18",
32
- "react-dom": "16.8 - 18"
29
+ "@semcore/base-components": "^16.0.0-prerelease.2"
33
30
  },
34
31
  "repository": {
35
32
  "type": "git",