@sunggang/ui-lib 0.2.0 → 0.2.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/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { useMemo as useMemo$1, useRef, useReducer, useEffect, useCallback as useCallback$1, forwardRef, useImperativeHandle, Fragment, useLayoutEffect, useContext, useState, Component, createRef } from 'react';
3
+ import React__default, { useMemo as useMemo$1, useRef, useReducer, useEffect, useCallback as useCallback$1, forwardRef, useImperativeHandle, Fragment, useLayoutEffect, useContext, useState, createContext, Component, createRef } from 'react';
4
4
  import { Icon } from '@iconify/react';
5
5
  import ReactDOM, { unstable_batchedUpdates } from 'react-dom';
6
6
  import * as SwitchPrimitives from '@radix-ui/react-switch';
@@ -1118,13 +1118,13 @@ var PropTypes = propTypes$1.exports;
1118
1118
  * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and how to use it.
1119
1119
  *
1120
1120
  * @internal
1121
- */ function _array_like_to_array$a(arr, len) {
1121
+ */ function _array_like_to_array$b(arr, len) {
1122
1122
  if (len == null || len > arr.length) len = arr.length;
1123
1123
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1124
1124
  return arr2;
1125
1125
  }
1126
- function _array_without_holes$4(arr) {
1127
- if (Array.isArray(arr)) return _array_like_to_array$a(arr);
1126
+ function _array_without_holes$5(arr) {
1127
+ if (Array.isArray(arr)) return _array_like_to_array$b(arr);
1128
1128
  }
1129
1129
  function _class_call_check$2(instance, Constructor) {
1130
1130
  if (!(instance instanceof Constructor)) {
@@ -1152,22 +1152,22 @@ function _instanceof$c(left, right) {
1152
1152
  return left instanceof right;
1153
1153
  }
1154
1154
  }
1155
- function _iterable_to_array$4(iter) {
1155
+ function _iterable_to_array$5(iter) {
1156
1156
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1157
1157
  }
1158
- function _non_iterable_spread$4() {
1158
+ function _non_iterable_spread$5() {
1159
1159
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1160
1160
  }
1161
- function _to_consumable_array$4(arr) {
1162
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$4();
1161
+ function _to_consumable_array$5(arr) {
1162
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$5();
1163
1163
  }
1164
- function _unsupported_iterable_to_array$a(o, minLen) {
1164
+ function _unsupported_iterable_to_array$b(o, minLen) {
1165
1165
  if (!o) return;
1166
- if (typeof o === "string") return _array_like_to_array$a(o, minLen);
1166
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
1167
1167
  var n = Object.prototype.toString.call(o).slice(8, -1);
1168
1168
  if (n === "Object" && o.constructor) n = o.constructor.name;
1169
1169
  if (n === "Map" || n === "Set") return Array.from(n);
1170
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
1170
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
1171
1171
  }
1172
1172
  var Watchdog = /*#__PURE__*/ function() {
1173
1173
  function Watchdog(config) {
@@ -1273,7 +1273,7 @@ var Watchdog = /*#__PURE__*/ function() {
1273
1273
  var callback = _step.value;
1274
1274
  callback.apply(this, [
1275
1275
  null
1276
- ].concat(_to_consumable_array$4(args)));
1276
+ ].concat(_to_consumable_array$5(args)));
1277
1277
  }
1278
1278
  } catch (err) {
1279
1279
  _didIteratorError = true;
@@ -3754,12 +3754,12 @@ var now$1 = now;
3754
3754
  /**
3755
3755
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3756
3756
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
3757
- */ function _array_like_to_array$9(arr, len) {
3757
+ */ function _array_like_to_array$a(arr, len) {
3758
3758
  if (len == null || len > arr.length) len = arr.length;
3759
3759
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3760
3760
  return arr2;
3761
3761
  }
3762
- function _array_with_holes$6(arr) {
3762
+ function _array_with_holes$7(arr) {
3763
3763
  if (Array.isArray(arr)) return arr;
3764
3764
  }
3765
3765
  function _assert_this_initialized$1(self) {
@@ -3787,7 +3787,7 @@ function _create_class$1(Constructor, protoProps, staticProps) {
3787
3787
  if (staticProps) _defineProperties$2(Constructor, staticProps);
3788
3788
  return Constructor;
3789
3789
  }
3790
- function _define_property$a(obj, key, value) {
3790
+ function _define_property$c(obj, key, value) {
3791
3791
  if (key in obj) {
3792
3792
  Object.defineProperty(obj, key, {
3793
3793
  value: value,
@@ -3835,7 +3835,7 @@ function _inherits$2(subClass, superClass) {
3835
3835
  });
3836
3836
  if (superClass) _set_prototype_of$1(subClass, superClass);
3837
3837
  }
3838
- function _iterable_to_array_limit$6(arr, i) {
3838
+ function _iterable_to_array_limit$7(arr, i) {
3839
3839
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3840
3840
  if (_i == null) return;
3841
3841
  var _arr = [];
@@ -3859,10 +3859,10 @@ function _iterable_to_array_limit$6(arr, i) {
3859
3859
  }
3860
3860
  return _arr;
3861
3861
  }
3862
- function _non_iterable_rest$6() {
3862
+ function _non_iterable_rest$7() {
3863
3863
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3864
3864
  }
3865
- function _object_spread$a(target) {
3865
+ function _object_spread$c(target) {
3866
3866
  for(var i = 1; i < arguments.length; i++){
3867
3867
  var source = arguments[i] != null ? arguments[i] : {};
3868
3868
  var ownKeys = Object.keys(source);
@@ -3872,12 +3872,12 @@ function _object_spread$a(target) {
3872
3872
  }));
3873
3873
  }
3874
3874
  ownKeys.forEach(function(key) {
3875
- _define_property$a(target, key, source[key]);
3875
+ _define_property$c(target, key, source[key]);
3876
3876
  });
3877
3877
  }
3878
3878
  return target;
3879
3879
  }
3880
- function ownKeys$a(object, enumerableOnly) {
3880
+ function ownKeys$c(object, enumerableOnly) {
3881
3881
  var keys = Object.keys(object);
3882
3882
  if (Object.getOwnPropertySymbols) {
3883
3883
  var symbols = Object.getOwnPropertySymbols(object);
@@ -3890,12 +3890,12 @@ function ownKeys$a(object, enumerableOnly) {
3890
3890
  }
3891
3891
  return keys;
3892
3892
  }
3893
- function _object_spread_props$7(target, source) {
3893
+ function _object_spread_props$9(target, source) {
3894
3894
  source = source != null ? source : {};
3895
3895
  if (Object.getOwnPropertyDescriptors) {
3896
3896
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3897
3897
  } else {
3898
- ownKeys$a(Object(source)).forEach(function(key) {
3898
+ ownKeys$c(Object(source)).forEach(function(key) {
3899
3899
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3900
3900
  });
3901
3901
  }
@@ -3941,8 +3941,8 @@ function _set_prototype_of$1(o, p) {
3941
3941
  };
3942
3942
  return _set_prototype_of$1(o, p);
3943
3943
  }
3944
- function _sliced_to_array$6(arr, i) {
3945
- return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$6();
3944
+ function _sliced_to_array$7(arr, i) {
3945
+ return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$7();
3946
3946
  }
3947
3947
  function _super_prop_base$1(object, property) {
3948
3948
  while(!Object.prototype.hasOwnProperty.call(object, property)){
@@ -3955,13 +3955,13 @@ function _type_of$a(obj) {
3955
3955
  "@swc/helpers - typeof";
3956
3956
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
3957
3957
  }
3958
- function _unsupported_iterable_to_array$9(o, minLen) {
3958
+ function _unsupported_iterable_to_array$a(o, minLen) {
3959
3959
  if (!o) return;
3960
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
3960
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
3961
3961
  var n = Object.prototype.toString.call(o).slice(8, -1);
3962
3962
  if (n === "Object" && o.constructor) n = o.constructor.name;
3963
3963
  if (n === "Map" || n === "Set") return Array.from(n);
3964
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
3964
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
3965
3965
  }
3966
3966
  function _is_native_reflect_construct$1() {
3967
3967
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
@@ -4109,7 +4109,7 @@ var EditorWatchdog = /*#__PURE__*/ function(Watchdog) {
4109
4109
  try {
4110
4110
  // Traverse through the roots saved when the editor crashed and set up the discussed values.
4111
4111
  for(var _iterator = Object.entries(_this._data.roots)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4112
- var _step_value = _sliced_to_array$6(_step.value, 2), rootName = _step_value[0], rootData = _step_value[1];
4112
+ var _step_value = _sliced_to_array$7(_step.value, 2), rootName = _step_value[0], rootData = _step_value[1];
4113
4113
  if (rootData.isLoaded) {
4114
4114
  existingRoots[rootName] = "";
4115
4115
  rootsAttributes[rootName] = oldRootsAttributes[rootName] || {};
@@ -4131,7 +4131,7 @@ var EditorWatchdog = /*#__PURE__*/ function(Watchdog) {
4131
4131
  }
4132
4132
  }
4133
4133
  }
4134
- var updatedConfig = _object_spread_props$7(_object_spread$a({}, _this._config), {
4134
+ var updatedConfig = _object_spread_props$9(_object_spread$c({}, _this._config), {
4135
4135
  extraPlugins: _this._config.extraPlugins || [],
4136
4136
  lazyRoots: lazyRoots,
4137
4137
  rootsAttributes: rootsAttributes,
@@ -4469,14 +4469,14 @@ var EditorWatchdog = /*#__PURE__*/ function(Watchdog) {
4469
4469
  var _this = this;
4470
4470
  var editor = this.editor;
4471
4471
  Object.entries(this._data.roots).forEach(function(param) {
4472
- var _param = _sliced_to_array$6(param, 2), rootName = _param[0], _param_ = _param[1], content = _param_.content, attributes = _param_.attributes;
4472
+ var _param = _sliced_to_array$7(param, 2), rootName = _param[0], _param_ = _param[1], content = _param_.content, attributes = _param_.attributes;
4473
4473
  var parsedNodes = JSON.parse(content);
4474
4474
  var parsedAttributes = JSON.parse(attributes);
4475
4475
  var rootElement = editor.model.document.getRoot(rootName);
4476
4476
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4477
4477
  try {
4478
4478
  for(var _iterator = parsedAttributes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4479
- var _step_value = _sliced_to_array$6(_step.value, 2), key = _step_value[0], value = _step_value[1];
4479
+ var _step_value = _sliced_to_array$7(_step.value, 2), key = _step_value[0], value = _step_value[1];
4480
4480
  writer.setAttribute(key, value, rootElement);
4481
4481
  }
4482
4482
  } catch (err) {
@@ -4516,7 +4516,7 @@ var EditorWatchdog = /*#__PURE__*/ function(Watchdog) {
4516
4516
  }
4517
4517
  });
4518
4518
  Object.entries(this._data.markers).forEach(function(param) {
4519
- var _param = _sliced_to_array$6(param, 2), markerName = _param[0], markerOptions = _param[1];
4519
+ var _param = _sliced_to_array$7(param, 2), markerName = _param[0], markerOptions = _param[1];
4520
4520
  var document = editor.model.document;
4521
4521
  var _markerOptions_rangeJSON = markerOptions.rangeJSON, start = _markerOptions_rangeJSON.start, end = _markerOptions_rangeJSON.end, options = _object_without_properties$7(markerOptions, [
4522
4522
  "rangeJSON"
@@ -4525,7 +4525,7 @@ var EditorWatchdog = /*#__PURE__*/ function(Watchdog) {
4525
4525
  var startPosition = writer.createPositionFromPath(root, start.path, start.stickiness);
4526
4526
  var endPosition = writer.createPositionFromPath(root, end.path, end.stickiness);
4527
4527
  var range = writer.createRange(startPosition, endPosition);
4528
- writer.addMarker(markerName, _object_spread$a({
4528
+ writer.addMarker(markerName, _object_spread$c({
4529
4529
  range: range
4530
4530
  }, options));
4531
4531
  });
@@ -4547,7 +4547,7 @@ var EditorWatchdog = /*#__PURE__*/ function(Watchdog) {
4547
4547
  var commentThread = commentsRepository.getCommentThread(commentThreadData.threadId);
4548
4548
  commentThread.remove();
4549
4549
  }
4550
- commentsRepository.addCommentThread(_object_spread$a({
4550
+ commentsRepository.addCommentThread(_object_spread$c({
4551
4551
  channelId: channelId
4552
4552
  }, commentThreadData));
4553
4553
  });
@@ -72785,30 +72785,30 @@ function setObjProp(f, key, value) {
72785
72785
  });
72786
72786
  }
72787
72787
 
72788
- function _array_like_to_array$8(arr, len) {
72788
+ function _array_like_to_array$9(arr, len) {
72789
72789
  if (len == null || len > arr.length) len = arr.length;
72790
72790
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
72791
72791
  return arr2;
72792
72792
  }
72793
- function _array_without_holes$3(arr) {
72794
- if (Array.isArray(arr)) return _array_like_to_array$8(arr);
72793
+ function _array_without_holes$4(arr) {
72794
+ if (Array.isArray(arr)) return _array_like_to_array$9(arr);
72795
72795
  }
72796
- function _iterable_to_array$3(iter) {
72796
+ function _iterable_to_array$4(iter) {
72797
72797
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
72798
72798
  }
72799
- function _non_iterable_spread$3() {
72799
+ function _non_iterable_spread$4() {
72800
72800
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
72801
72801
  }
72802
- function _to_consumable_array$3(arr) {
72803
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$3();
72802
+ function _to_consumable_array$4(arr) {
72803
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$4();
72804
72804
  }
72805
- function _unsupported_iterable_to_array$8(o, minLen) {
72805
+ function _unsupported_iterable_to_array$9(o, minLen) {
72806
72806
  if (!o) return;
72807
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
72807
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
72808
72808
  var n = Object.prototype.toString.call(o).slice(8, -1);
72809
72809
  if (n === "Object" && o.constructor) n = o.constructor.name;
72810
72810
  if (n === "Map" || n === "Set") return Array.from(n);
72811
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
72811
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
72812
72812
  }
72813
72813
  function _ts_generator(thisArg, body) {
72814
72814
  var f, y, t, g, _ = {
@@ -73065,7 +73065,7 @@ function toFilePromises(item) {
73065
73065
  }
73066
73066
  function flatten$2(items) {
73067
73067
  return items.reduce(function(acc, files) {
73068
- return _to_consumable_array$3(acc).concat(_to_consumable_array$3(Array.isArray(files) ? flatten$2(files) : [
73068
+ return _to_consumable_array$4(acc).concat(_to_consumable_array$4(Array.isArray(files) ? flatten$2(files) : [
73069
73069
  files
73070
73070
  ]));
73071
73071
  }, []);
@@ -73245,7 +73245,7 @@ function _iterableToArray$2(iter) {
73245
73245
  function _arrayWithoutHoles$2(arr) {
73246
73246
  if (Array.isArray(arr)) return _arrayLikeToArray$2(arr);
73247
73247
  }
73248
- function ownKeys$9(object, enumerableOnly) {
73248
+ function ownKeys$b(object, enumerableOnly) {
73249
73249
  var keys = Object.keys(object);
73250
73250
  if (Object.getOwnPropertySymbols) {
73251
73251
  var symbols = Object.getOwnPropertySymbols(object);
@@ -73258,9 +73258,9 @@ function ownKeys$9(object, enumerableOnly) {
73258
73258
  function _objectSpread$1(target) {
73259
73259
  for(var i = 1; i < arguments.length; i++){
73260
73260
  var source = null != arguments[i] ? arguments[i] : {};
73261
- i % 2 ? ownKeys$9(Object(source), !0).forEach(function(key) {
73261
+ i % 2 ? ownKeys$b(Object(source), !0).forEach(function(key) {
73262
73262
  _defineProperty$3(target, key, source[key]);
73263
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function(key) {
73263
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$b(Object(source)).forEach(function(key) {
73264
73264
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
73265
73265
  });
73266
73266
  }
@@ -73667,7 +73667,7 @@ function _iterableToArrayLimit$1(arr, i) {
73667
73667
  function _arrayWithHoles$1(arr) {
73668
73668
  if (Array.isArray(arr)) return arr;
73669
73669
  }
73670
- function ownKeys$8(object, enumerableOnly) {
73670
+ function ownKeys$a(object, enumerableOnly) {
73671
73671
  var keys = Object.keys(object);
73672
73672
  if (Object.getOwnPropertySymbols) {
73673
73673
  var symbols = Object.getOwnPropertySymbols(object);
@@ -73680,9 +73680,9 @@ function ownKeys$8(object, enumerableOnly) {
73680
73680
  function _objectSpread(target) {
73681
73681
  for(var i = 1; i < arguments.length; i++){
73682
73682
  var source = null != arguments[i] ? arguments[i] : {};
73683
- i % 2 ? ownKeys$8(Object(source), !0).forEach(function(key) {
73683
+ i % 2 ? ownKeys$a(Object(source), !0).forEach(function(key) {
73684
73684
  _defineProperty$2(target, key, source[key]);
73685
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function(key) {
73685
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function(key) {
73686
73686
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
73687
73687
  });
73688
73688
  }
@@ -74684,7 +74684,7 @@ function _defineProperty$1(e, r, t) {
74684
74684
  }) : e[r] = t, e;
74685
74685
  }
74686
74686
 
74687
- function ownKeys$7(e, r) {
74687
+ function ownKeys$9(e, r) {
74688
74688
  var t = Object.keys(e);
74689
74689
  if (Object.getOwnPropertySymbols) {
74690
74690
  var o = Object.getOwnPropertySymbols(e);
@@ -74697,9 +74697,9 @@ function ownKeys$7(e, r) {
74697
74697
  function _objectSpread2$7(e) {
74698
74698
  for(var r = 1; r < arguments.length; r++){
74699
74699
  var t = null != arguments[r] ? arguments[r] : {};
74700
- r % 2 ? ownKeys$7(Object(t), !0).forEach(function(r) {
74700
+ r % 2 ? ownKeys$9(Object(t), !0).forEach(function(r) {
74701
74701
  _defineProperty$1(e, r, t[r]);
74702
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function(r) {
74702
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function(r) {
74703
74703
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
74704
74704
  });
74705
74705
  }
@@ -84065,7 +84065,7 @@ var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, nu
84065
84065
  })(Droppable);
84066
84066
  ConnectedDroppable.defaultProps = defaultProps;
84067
84067
 
84068
- function _define_property$9(obj, key, value) {
84068
+ function _define_property$b(obj, key, value) {
84069
84069
  if (key in obj) {
84070
84070
  Object.defineProperty(obj, key, {
84071
84071
  value: value,
@@ -84078,7 +84078,7 @@ function _define_property$9(obj, key, value) {
84078
84078
  }
84079
84079
  return obj;
84080
84080
  }
84081
- function _object_spread$9(target) {
84081
+ function _object_spread$b(target) {
84082
84082
  for(var i = 1; i < arguments.length; i++){
84083
84083
  var source = arguments[i] != null ? arguments[i] : {};
84084
84084
  var ownKeys = Object.keys(source);
@@ -84088,12 +84088,12 @@ function _object_spread$9(target) {
84088
84088
  }));
84089
84089
  }
84090
84090
  ownKeys.forEach(function(key) {
84091
- _define_property$9(target, key, source[key]);
84091
+ _define_property$b(target, key, source[key]);
84092
84092
  });
84093
84093
  }
84094
84094
  return target;
84095
84095
  }
84096
- function ownKeys$6(object, enumerableOnly) {
84096
+ function ownKeys$8(object, enumerableOnly) {
84097
84097
  var keys = Object.keys(object);
84098
84098
  if (Object.getOwnPropertySymbols) {
84099
84099
  var symbols = Object.getOwnPropertySymbols(object);
@@ -84106,12 +84106,12 @@ function ownKeys$6(object, enumerableOnly) {
84106
84106
  }
84107
84107
  return keys;
84108
84108
  }
84109
- function _object_spread_props$6(target, source) {
84109
+ function _object_spread_props$8(target, source) {
84110
84110
  source = source != null ? source : {};
84111
84111
  if (Object.getOwnPropertyDescriptors) {
84112
84112
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
84113
84113
  } else {
84114
- ownKeys$6(Object(source)).forEach(function(key) {
84114
+ ownKeys$8(Object(source)).forEach(function(key) {
84115
84115
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
84116
84116
  });
84117
84117
  }
@@ -84125,7 +84125,7 @@ var DragDropImages = function(param) {
84125
84125
  droppableId: "droppable-imageUrls",
84126
84126
  direction: "horizontal",
84127
84127
  children: function(provided) {
84128
- return /*#__PURE__*/ jsxs("div", _object_spread_props$6(_object_spread$9({
84128
+ return /*#__PURE__*/ jsxs("div", _object_spread_props$8(_object_spread$b({
84129
84129
  ref: provided.innerRef
84130
84130
  }, provided.droppableProps), {
84131
84131
  className: "flex gap-2 overflow-auto",
@@ -84135,7 +84135,7 @@ var DragDropImages = function(param) {
84135
84135
  draggableId: item === null || item === void 0 ? void 0 : item.id,
84136
84136
  index: index,
84137
84137
  children: function(provided) {
84138
- return /*#__PURE__*/ jsxs("div", _object_spread_props$6(_object_spread$9({
84138
+ return /*#__PURE__*/ jsxs("div", _object_spread_props$8(_object_spread$b({
84139
84139
  ref: provided.innerRef
84140
84140
  }, provided.draggableProps, provided.dragHandleProps), {
84141
84141
  className: "w-24 my-2 rounded-lg bg-gray-200",
@@ -84175,18 +84175,18 @@ var DragDropImages = function(param) {
84175
84175
  });
84176
84176
  };
84177
84177
 
84178
- function _array_like_to_array$7(arr, len) {
84178
+ function _array_like_to_array$8(arr, len) {
84179
84179
  if (len == null || len > arr.length) len = arr.length;
84180
84180
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
84181
84181
  return arr2;
84182
84182
  }
84183
- function _array_with_holes$5(arr) {
84183
+ function _array_with_holes$6(arr) {
84184
84184
  if (Array.isArray(arr)) return arr;
84185
84185
  }
84186
- function _array_without_holes$2(arr) {
84187
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
84186
+ function _array_without_holes$3(arr) {
84187
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
84188
84188
  }
84189
- function _define_property$8(obj, key, value) {
84189
+ function _define_property$a(obj, key, value) {
84190
84190
  if (key in obj) {
84191
84191
  Object.defineProperty(obj, key, {
84192
84192
  value: value,
@@ -84199,10 +84199,10 @@ function _define_property$8(obj, key, value) {
84199
84199
  }
84200
84200
  return obj;
84201
84201
  }
84202
- function _iterable_to_array$2(iter) {
84202
+ function _iterable_to_array$3(iter) {
84203
84203
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
84204
84204
  }
84205
- function _iterable_to_array_limit$5(arr, i) {
84205
+ function _iterable_to_array_limit$6(arr, i) {
84206
84206
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
84207
84207
  if (_i == null) return;
84208
84208
  var _arr = [];
@@ -84226,13 +84226,13 @@ function _iterable_to_array_limit$5(arr, i) {
84226
84226
  }
84227
84227
  return _arr;
84228
84228
  }
84229
- function _non_iterable_rest$5() {
84229
+ function _non_iterable_rest$6() {
84230
84230
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
84231
84231
  }
84232
- function _non_iterable_spread$2() {
84232
+ function _non_iterable_spread$3() {
84233
84233
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
84234
84234
  }
84235
- function _object_spread$8(target) {
84235
+ function _object_spread$a(target) {
84236
84236
  for(var i = 1; i < arguments.length; i++){
84237
84237
  var source = arguments[i] != null ? arguments[i] : {};
84238
84238
  var ownKeys = Object.keys(source);
@@ -84242,12 +84242,12 @@ function _object_spread$8(target) {
84242
84242
  }));
84243
84243
  }
84244
84244
  ownKeys.forEach(function(key) {
84245
- _define_property$8(target, key, source[key]);
84245
+ _define_property$a(target, key, source[key]);
84246
84246
  });
84247
84247
  }
84248
84248
  return target;
84249
84249
  }
84250
- function ownKeys$5(object, enumerableOnly) {
84250
+ function ownKeys$7(object, enumerableOnly) {
84251
84251
  var keys = Object.keys(object);
84252
84252
  if (Object.getOwnPropertySymbols) {
84253
84253
  var symbols = Object.getOwnPropertySymbols(object);
@@ -84260,34 +84260,34 @@ function ownKeys$5(object, enumerableOnly) {
84260
84260
  }
84261
84261
  return keys;
84262
84262
  }
84263
- function _object_spread_props$5(target, source) {
84263
+ function _object_spread_props$7(target, source) {
84264
84264
  source = source != null ? source : {};
84265
84265
  if (Object.getOwnPropertyDescriptors) {
84266
84266
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
84267
84267
  } else {
84268
- ownKeys$5(Object(source)).forEach(function(key) {
84268
+ ownKeys$7(Object(source)).forEach(function(key) {
84269
84269
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
84270
84270
  });
84271
84271
  }
84272
84272
  return target;
84273
84273
  }
84274
- function _sliced_to_array$5(arr, i) {
84275
- return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$5();
84274
+ function _sliced_to_array$6(arr, i) {
84275
+ return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$6();
84276
84276
  }
84277
- function _to_consumable_array$2(arr) {
84278
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$2();
84277
+ function _to_consumable_array$3(arr) {
84278
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$3();
84279
84279
  }
84280
- function _unsupported_iterable_to_array$7(o, minLen) {
84280
+ function _unsupported_iterable_to_array$8(o, minLen) {
84281
84281
  if (!o) return;
84282
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
84282
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
84283
84283
  var n = Object.prototype.toString.call(o).slice(8, -1);
84284
84284
  if (n === "Object" && o.constructor) n = o.constructor.name;
84285
84285
  if (n === "Map" || n === "Set") return Array.from(n);
84286
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
84286
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
84287
84287
  }
84288
84288
  var DropImage = function(param) {
84289
84289
  var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls;
84290
- var _useState = _sliced_to_array$5(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
84290
+ var _useState = _sliced_to_array$6(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
84291
84291
  useEffect(function() {
84292
84292
  setPreviewFiles(imageUrls);
84293
84293
  }, [
@@ -84317,17 +84317,17 @@ var DropImage = function(param) {
84317
84317
  newFiles.push(dropFile);
84318
84318
  });
84319
84319
  setPreviewFiles(function(prev) {
84320
- return _to_consumable_array$2(prev).concat(_to_consumable_array$2(newFiles));
84320
+ return _to_consumable_array$3(prev).concat(_to_consumable_array$3(newFiles));
84321
84321
  });
84322
84322
  }
84323
84323
  }), getRootProps = _useDropzone.getRootProps, getInputProps = _useDropzone.getInputProps; _useDropzone.isDragActive; _useDropzone.isDragAccept; _useDropzone.isDragReject;
84324
84324
  var onDragEnd = function(result) {
84325
84325
  if (!result.destination) return;
84326
- var newItems = _to_consumable_array$2(previewFiles);
84327
- var _newItems_splice = _sliced_to_array$5(newItems.splice(result.source.index, 1), 1), reorderedItem = _newItems_splice[0];
84326
+ var newItems = _to_consumable_array$3(previewFiles);
84327
+ var _newItems_splice = _sliced_to_array$6(newItems.splice(result.source.index, 1), 1), reorderedItem = _newItems_splice[0];
84328
84328
  newItems.splice(result.destination.index, 0, reorderedItem);
84329
84329
  var reSortItem = newItems.map(function(item, index) {
84330
- return _object_spread_props$5(_object_spread$8({}, item), {
84330
+ return _object_spread_props$7(_object_spread$a({}, item), {
84331
84331
  index: index + 1
84332
84332
  });
84333
84333
  });
@@ -84337,16 +84337,16 @@ var DropImage = function(param) {
84337
84337
  var handleRemove = function(item) {
84338
84338
  var currentItem = previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.indexOf(item);
84339
84339
  previewFiles.splice(currentItem, 1);
84340
- setImageUrls(_to_consumable_array$2(previewFiles));
84340
+ setImageUrls(_to_consumable_array$3(previewFiles));
84341
84341
  };
84342
84342
  return /*#__PURE__*/ jsxs("section", {
84343
84343
  className: "w-full",
84344
84344
  children: [
84345
- /*#__PURE__*/ jsxs("div", _object_spread_props$5(_object_spread$8({}, getRootProps({
84345
+ /*#__PURE__*/ jsxs("div", _object_spread_props$7(_object_spread$a({}, getRootProps({
84346
84346
  className: "dropzone"
84347
84347
  })), {
84348
84348
  children: [
84349
- /*#__PURE__*/ jsx("input", _object_spread$8({}, getInputProps())),
84349
+ /*#__PURE__*/ jsx("input", _object_spread$a({}, getInputProps())),
84350
84350
  /*#__PURE__*/ jsx("div", {
84351
84351
  className: "flex justify-between",
84352
84352
  children: /*#__PURE__*/ jsx("div", {
@@ -84393,6 +84393,916 @@ var DropImage = function(param) {
84393
84393
  });
84394
84394
  };
84395
84395
 
84396
+ var COLORS = [
84397
+ "blue",
84398
+ "orange",
84399
+ "yellow",
84400
+ "red",
84401
+ "purple",
84402
+ "amber",
84403
+ "lime",
84404
+ "green",
84405
+ "emerald",
84406
+ "teal",
84407
+ "cyan",
84408
+ "sky",
84409
+ "violet",
84410
+ "indigo",
84411
+ "purple",
84412
+ "fuchsia",
84413
+ "pink",
84414
+ "rose"
84415
+ ];
84416
+ var DEFAULT_THEME = "blue";
84417
+ var THEME_DATA = {
84418
+ bg: {
84419
+ blue: "bg-blue-500",
84420
+ orange: "bg-orange-500",
84421
+ yellow: "bg-yellow-500",
84422
+ red: "bg-red-500",
84423
+ purple: "bg-purple-500",
84424
+ amber: "bg-amber-500",
84425
+ lime: "bg-lime-500",
84426
+ green: "bg-green-500",
84427
+ emerald: "bg-emerald-500",
84428
+ teal: "bg-teal-500",
84429
+ cyan: "bg-cyan-500",
84430
+ sky: "bg-sky-500",
84431
+ indigo: "bg-indigo-500",
84432
+ violet: "bg-violet-500",
84433
+ fuchsia: "bg-fuchsia-500",
84434
+ pink: "bg-pink-500",
84435
+ rose: "bg-rose-500"
84436
+ },
84437
+ bgHover: {
84438
+ blue: "hover:bg-blue-100",
84439
+ orange: "hover:bg-orange-100",
84440
+ yellow: "hover:bg-yellow-100",
84441
+ red: "hover:bg-red-100",
84442
+ purple: "hover:bg-purple-100",
84443
+ amber: "hover:bg-amber-100",
84444
+ lime: "hover:bg-lime-100",
84445
+ green: "hover:bg-green-100",
84446
+ emerald: "hover:bg-emerald-100",
84447
+ teal: "hover:bg-teal-100",
84448
+ cyan: "hover:bg-cyan-100",
84449
+ sky: "hover:bg-sky-100",
84450
+ indigo: "hover:bg-indigo-100",
84451
+ violet: "hover:bg-violet-100",
84452
+ fuchsia: "hover:bg-fuchsia-100",
84453
+ pink: "hover:bg-pink-100",
84454
+ rose: "hover:bg-rose-100"
84455
+ },
84456
+ ring: {
84457
+ blue: "focus:ring-blue-500/20",
84458
+ orange: "focus:ring-orange-500/20",
84459
+ yellow: "focus:ring-yellow-500/20",
84460
+ red: "focus:ring-red-500/20",
84461
+ purple: "focus:ring-purple-500/20",
84462
+ amber: "focus:ring-amber-500/20",
84463
+ lime: "focus:ring-lime-500/20",
84464
+ green: "focus:ring-green-500/20",
84465
+ emerald: "focus:ring-emerald-500/20",
84466
+ teal: "focus:ring-teal-500/20",
84467
+ cyan: "focus:ring-cyan-500/20",
84468
+ sky: "focus:ring-sky-500/20",
84469
+ indigo: "focus:ring-indigo-500/20",
84470
+ violet: "focus:ring-violet-500/20",
84471
+ fuchsia: "focus:ring-fuchsia-500/20",
84472
+ pink: "focus:ring-pink-500/20",
84473
+ rose: "focus:ring-rose-500/20"
84474
+ },
84475
+ borderFocus: {
84476
+ blue: "focus:border-blue-500",
84477
+ orange: "focus:border-orange-500",
84478
+ yellow: "focus:border-yellow-500",
84479
+ red: "focus:border-red-500",
84480
+ purple: "focus:border-purple-500",
84481
+ amber: "focus:border-amber-500",
84482
+ lime: "focus:border-lime-500",
84483
+ green: "focus:border-green-500",
84484
+ emerald: "focus:border-emerald-500",
84485
+ teal: "focus:border-teal-500",
84486
+ cyan: "focus:border-cyan-500",
84487
+ sky: "focus:border-sky-500",
84488
+ indigo: "focus:border-indigo-500",
84489
+ violet: "focus:border-violet-500",
84490
+ fuchsia: "focus:border-fuchsia-500",
84491
+ pink: "focus:border-pink-500",
84492
+ rose: "focus:border-rose-500"
84493
+ },
84494
+ text: {
84495
+ blue: "text-blue-500",
84496
+ orange: "text-orange-500",
84497
+ yellow: "text-yellow-500",
84498
+ red: "text-red-500",
84499
+ purple: "text-purple-500",
84500
+ amber: "text-amber-500",
84501
+ lime: "text-lime-500",
84502
+ green: "text-green-500",
84503
+ emerald: "text-emerald-500",
84504
+ teal: "text-teal-500",
84505
+ cyan: "text-cyan-500",
84506
+ sky: "text-sky-500",
84507
+ indigo: "text-indigo-500",
84508
+ violet: "text-violet-500",
84509
+ fuchsia: "text-fuchsia-500",
84510
+ pink: "text-pink-500",
84511
+ rose: "text-rose-500"
84512
+ },
84513
+ textHover: {
84514
+ blue: "hover:text-blue-500",
84515
+ orange: "hover:text-orange-500",
84516
+ yellow: "hover:text-yellow-500",
84517
+ red: "hover:text-red-500",
84518
+ purple: "hover:text-purple-500",
84519
+ amber: "hover:text-amber-500",
84520
+ lime: "hover:text-lime-500",
84521
+ green: "hover:text-green-500",
84522
+ emerald: "hover:text-emerald-500",
84523
+ teal: "hover:text-teal-500",
84524
+ cyan: "hover:text-cyan-500",
84525
+ sky: "hover:text-sky-500",
84526
+ indigo: "hover:text-indigo-500",
84527
+ violet: "hover:text-violet-500",
84528
+ fuchsia: "hover:text-fuchsia-500",
84529
+ pink: "hover:text-pink-500",
84530
+ rose: "hover:text-rose-500"
84531
+ }
84532
+ };
84533
+
84534
+ function useOnClickOutside(ref, handler) {
84535
+ useEffect(function() {
84536
+ var listener = function(event) {
84537
+ if (!ref.current || ref.current.contains(event.target)) {
84538
+ return;
84539
+ }
84540
+ handler(event);
84541
+ };
84542
+ document.addEventListener("mousedown", listener);
84543
+ document.addEventListener("touchstart", listener);
84544
+ return function() {
84545
+ document.removeEventListener("mousedown", listener);
84546
+ document.removeEventListener("touchstart", listener);
84547
+ };
84548
+ }, [
84549
+ ref,
84550
+ handler
84551
+ ]);
84552
+ }
84553
+
84554
+ var CloseIcon = function(param) {
84555
+ var _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
84556
+ return /*#__PURE__*/ jsx("svg", {
84557
+ className: className,
84558
+ fill: "currentColor",
84559
+ viewBox: "0 0 20 20",
84560
+ xmlns: "http://www.w3.org/2000/svg",
84561
+ children: /*#__PURE__*/ jsx("path", {
84562
+ fillRule: "evenodd",
84563
+ d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
84564
+ clipRule: "evenodd"
84565
+ })
84566
+ });
84567
+ };
84568
+ var ChevronIcon = function(param) {
84569
+ var _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
84570
+ return /*#__PURE__*/ jsx("svg", {
84571
+ className: className,
84572
+ fill: "currentColor",
84573
+ viewBox: "0 0 20 20",
84574
+ xmlns: "http://www.w3.org/2000/svg",
84575
+ children: /*#__PURE__*/ jsx("path", {
84576
+ fillRule: "evenodd",
84577
+ d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
84578
+ clipRule: "evenodd"
84579
+ })
84580
+ });
84581
+ };
84582
+ var SearchIcon = function(param) {
84583
+ var _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
84584
+ return /*#__PURE__*/ jsx("svg", {
84585
+ className: className,
84586
+ fill: "none",
84587
+ stroke: "currentColor",
84588
+ viewBox: "0 0 24 24",
84589
+ xmlns: "http://www.w3.org/2000/svg",
84590
+ children: /*#__PURE__*/ jsx("path", {
84591
+ strokeLinecap: "round",
84592
+ strokeLinejoin: "round",
84593
+ strokeWidth: 2,
84594
+ d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
84595
+ })
84596
+ });
84597
+ };
84598
+
84599
+ var SelectContext = /*#__PURE__*/ createContext({
84600
+ value: null,
84601
+ handleValueChange: function(selected) {
84602
+ console.log("selected:", selected);
84603
+ },
84604
+ formatGroupLabel: null,
84605
+ formatOptionLabel: null,
84606
+ classNames: undefined
84607
+ });
84608
+ var useSelectContext = function() {
84609
+ return useContext(SelectContext);
84610
+ };
84611
+ var SelectProvider = function(param) {
84612
+ var value = param.value, handleValueChange = param.handleValueChange, otherData = param.otherData, children = param.children;
84613
+ var store = useMemo$1(function() {
84614
+ return {
84615
+ value: value,
84616
+ handleValueChange: handleValueChange,
84617
+ formatGroupLabel: otherData && typeof otherData.formatGroupLabel === "function" ? otherData.formatGroupLabel : null,
84618
+ formatOptionLabel: otherData && typeof otherData.formatOptionLabel === "function" ? otherData.formatOptionLabel : null,
84619
+ classNames: (otherData === null || otherData === void 0 ? void 0 : otherData.classNames) || undefined
84620
+ };
84621
+ }, [
84622
+ handleValueChange,
84623
+ otherData,
84624
+ value
84625
+ ]);
84626
+ return /*#__PURE__*/ jsx(SelectContext.Provider, {
84627
+ value: store,
84628
+ children: children
84629
+ });
84630
+ };
84631
+
84632
+ var DisabledItem = function(param) {
84633
+ var children = param.children;
84634
+ var classNames = useContext(SelectContext).classNames;
84635
+ return /*#__PURE__*/ jsx("div", {
84636
+ className: classNames && classNames.listDisabledItem ? classNames.listDisabledItem : "px-2 py-2 cursor-not-allowed truncate text-gray-400 select-none",
84637
+ children: children
84638
+ });
84639
+ };
84640
+
84641
+ function _define_property$9(obj, key, value) {
84642
+ if (key in obj) {
84643
+ Object.defineProperty(obj, key, {
84644
+ value: value,
84645
+ enumerable: true,
84646
+ configurable: true,
84647
+ writable: true
84648
+ });
84649
+ } else {
84650
+ obj[key] = value;
84651
+ }
84652
+ return obj;
84653
+ }
84654
+ function _object_spread$9(target) {
84655
+ for(var i = 1; i < arguments.length; i++){
84656
+ var source = arguments[i] != null ? arguments[i] : {};
84657
+ var ownKeys = Object.keys(source);
84658
+ if (typeof Object.getOwnPropertySymbols === "function") {
84659
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
84660
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
84661
+ }));
84662
+ }
84663
+ ownKeys.forEach(function(key) {
84664
+ _define_property$9(target, key, source[key]);
84665
+ });
84666
+ }
84667
+ return target;
84668
+ }
84669
+ function ownKeys$6(object, enumerableOnly) {
84670
+ var keys = Object.keys(object);
84671
+ if (Object.getOwnPropertySymbols) {
84672
+ var symbols = Object.getOwnPropertySymbols(object);
84673
+ if (enumerableOnly) {
84674
+ symbols = symbols.filter(function(sym) {
84675
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
84676
+ });
84677
+ }
84678
+ keys.push.apply(keys, symbols);
84679
+ }
84680
+ return keys;
84681
+ }
84682
+ function _object_spread_props$6(target, source) {
84683
+ source = source != null ? source : {};
84684
+ if (Object.getOwnPropertyDescriptors) {
84685
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
84686
+ } else {
84687
+ ownKeys$6(Object(source)).forEach(function(key) {
84688
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
84689
+ });
84690
+ }
84691
+ return target;
84692
+ }
84693
+ var Item = function(param) {
84694
+ var item = param.item, primaryColor = param.primaryColor;
84695
+ var _useSelectContext = useSelectContext(), classNames = _useSelectContext.classNames, value = _useSelectContext.value, handleValueChange = _useSelectContext.handleValueChange, formatOptionLabel = _useSelectContext.formatOptionLabel;
84696
+ var isSelected = useMemo$1(function() {
84697
+ return value !== null && !Array.isArray(value) && value.value === item.value;
84698
+ }, [
84699
+ item.value,
84700
+ value
84701
+ ]);
84702
+ var textHoverColor = useMemo$1(function() {
84703
+ if (COLORS.includes(primaryColor)) {
84704
+ return THEME_DATA.textHover[primaryColor];
84705
+ }
84706
+ return THEME_DATA.textHover[DEFAULT_THEME];
84707
+ }, [
84708
+ primaryColor
84709
+ ]);
84710
+ var bgColor = useMemo$1(function() {
84711
+ if (COLORS.includes(primaryColor)) {
84712
+ return THEME_DATA.bg[primaryColor];
84713
+ }
84714
+ return THEME_DATA.bg[DEFAULT_THEME];
84715
+ }, [
84716
+ primaryColor
84717
+ ]);
84718
+ var bgHoverColor = useMemo$1(function() {
84719
+ if (COLORS.includes(primaryColor)) {
84720
+ return THEME_DATA.bgHover[primaryColor];
84721
+ }
84722
+ return THEME_DATA.bgHover[DEFAULT_THEME];
84723
+ }, [
84724
+ primaryColor
84725
+ ]);
84726
+ var getItemClass = useCallback$1(function() {
84727
+ var baseClass = "block transition duration-200 px-2 py-2 cursor-pointer select-none truncate rounded";
84728
+ var selectedClass = isSelected ? "text-white ".concat(bgColor) : "text-gray-500 ".concat(bgHoverColor, " ").concat(textHoverColor);
84729
+ return classNames && classNames.listItem ? classNames.listItem({
84730
+ isSelected: isSelected
84731
+ }) : "".concat(baseClass, " ").concat(selectedClass);
84732
+ }, [
84733
+ bgColor,
84734
+ bgHoverColor,
84735
+ classNames,
84736
+ isSelected,
84737
+ textHoverColor
84738
+ ]);
84739
+ return /*#__PURE__*/ jsx(Fragment$1, {
84740
+ children: formatOptionLabel ? /*#__PURE__*/ jsx("div", {
84741
+ onClick: function() {
84742
+ return handleValueChange(item);
84743
+ },
84744
+ children: formatOptionLabel(_object_spread_props$6(_object_spread$9({}, item), {
84745
+ isSelected: isSelected
84746
+ }))
84747
+ }) : /*#__PURE__*/ jsx(Fragment$1, {
84748
+ children: item.disabled ? /*#__PURE__*/ jsx(DisabledItem, {
84749
+ children: item.label
84750
+ }) : /*#__PURE__*/ jsx("li", {
84751
+ tabIndex: 0,
84752
+ onKeyDown: function(e) {
84753
+ if (e.key === " " || e.key === "Enter") {
84754
+ handleValueChange(item);
84755
+ }
84756
+ },
84757
+ "aria-selected": isSelected,
84758
+ role: "option",
84759
+ onClick: function() {
84760
+ return handleValueChange(item);
84761
+ },
84762
+ className: getItemClass(),
84763
+ children: item.label
84764
+ })
84765
+ })
84766
+ });
84767
+ };
84768
+
84769
+ var GroupItem = function(param) {
84770
+ var item = param.item, primaryColor = param.primaryColor;
84771
+ var _useSelectContext = useSelectContext(), classNames = _useSelectContext.classNames, formatGroupLabel = _useSelectContext.formatGroupLabel;
84772
+ return /*#__PURE__*/ jsx(Fragment$1, {
84773
+ children: item.options.length > 0 && /*#__PURE__*/ jsxs(Fragment$1, {
84774
+ children: [
84775
+ formatGroupLabel ? /*#__PURE__*/ jsx(Fragment$1, {
84776
+ children: formatGroupLabel(item)
84777
+ }) : /*#__PURE__*/ jsx("div", {
84778
+ className: (classNames === null || classNames === void 0 ? void 0 : classNames.listGroupLabel) ? classNames.listGroupLabel : "pr-2 py-2 cursor-default select-none truncate font-bold text-gray-700",
84779
+ children: item.label
84780
+ }),
84781
+ item.options.map(function(item, index) {
84782
+ return /*#__PURE__*/ jsx(Item, {
84783
+ primaryColor: primaryColor,
84784
+ item: item
84785
+ }, index);
84786
+ })
84787
+ ]
84788
+ })
84789
+ });
84790
+ };
84791
+
84792
+ var Options = function(param) {
84793
+ var list = param.list, noOptionsMessage = param.noOptionsMessage, text = param.text, isMultiple = param.isMultiple, value = param.value, _param_primaryColor = param.primaryColor, primaryColor = _param_primaryColor === void 0 ? DEFAULT_THEME : _param_primaryColor;
84794
+ var classNames = useContext(SelectContext).classNames;
84795
+ var filterByText = useCallback$1(function() {
84796
+ var filterItem = function(item) {
84797
+ return item.label.toLowerCase().indexOf(text.toLowerCase()) > -1;
84798
+ };
84799
+ var result = list.map(function(item) {
84800
+ if ("options" in item) {
84801
+ return {
84802
+ label: item.label,
84803
+ options: item.options.filter(filterItem)
84804
+ };
84805
+ }
84806
+ return item;
84807
+ });
84808
+ result = result.filter(function(item) {
84809
+ if ("options" in item) {
84810
+ return item.options.length > 0;
84811
+ }
84812
+ return filterItem(item);
84813
+ });
84814
+ return result;
84815
+ }, [
84816
+ text,
84817
+ list
84818
+ ]);
84819
+ var removeValues = useCallback$1(function(array) {
84820
+ if (!isMultiple) {
84821
+ return array;
84822
+ }
84823
+ if (Array.isArray(value)) {
84824
+ var valueId = value.map(function(item) {
84825
+ return item.value;
84826
+ });
84827
+ var filterItem = function(item) {
84828
+ return !valueId.includes(item.value);
84829
+ };
84830
+ var newArray = array.map(function(item) {
84831
+ if ("options" in item) {
84832
+ return {
84833
+ label: item.label,
84834
+ options: item.options.filter(filterItem)
84835
+ };
84836
+ }
84837
+ return item;
84838
+ });
84839
+ newArray = newArray.filter(function(item) {
84840
+ if ("options" in item) {
84841
+ return item.options.length > 0;
84842
+ } else {
84843
+ return filterItem(item);
84844
+ }
84845
+ });
84846
+ return newArray;
84847
+ }
84848
+ return array;
84849
+ }, [
84850
+ isMultiple,
84851
+ value
84852
+ ]);
84853
+ var filterResult = useMemo$1(function() {
84854
+ return removeValues(filterByText());
84855
+ }, [
84856
+ filterByText,
84857
+ removeValues
84858
+ ]);
84859
+ return /*#__PURE__*/ jsxs("div", {
84860
+ role: "options",
84861
+ className: classNames && classNames.list ? classNames.list : "max-h-72 overflow-y-auto",
84862
+ children: [
84863
+ filterResult.map(function(item, index) {
84864
+ return /*#__PURE__*/ jsx(React__default.Fragment, {
84865
+ children: "options" in item ? /*#__PURE__*/ jsxs(Fragment$1, {
84866
+ children: [
84867
+ /*#__PURE__*/ jsx("div", {
84868
+ className: "px-2.5",
84869
+ children: /*#__PURE__*/ jsx(GroupItem, {
84870
+ primaryColor: primaryColor || DEFAULT_THEME,
84871
+ item: item
84872
+ })
84873
+ }),
84874
+ index + 1 < filterResult.length && /*#__PURE__*/ jsx("hr", {
84875
+ className: "my-1"
84876
+ })
84877
+ ]
84878
+ }) : /*#__PURE__*/ jsx("div", {
84879
+ className: "px-2.5",
84880
+ children: /*#__PURE__*/ jsx(Item, {
84881
+ primaryColor: primaryColor || DEFAULT_THEME,
84882
+ item: item
84883
+ })
84884
+ })
84885
+ }, index);
84886
+ }),
84887
+ filterResult.length === 0 && /*#__PURE__*/ jsx(DisabledItem, {
84888
+ children: noOptionsMessage
84889
+ })
84890
+ ]
84891
+ });
84892
+ };
84893
+
84894
+ var SearchInput = /*#__PURE__*/ forwardRef(function SearchInput(param, ref) {
84895
+ var _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "" : _param_placeholder, _param_value = param.value, value = _param_value === void 0 ? "" : _param_value, onChange = param.onChange, _param_name = param.name, name = _param_name === void 0 ? "" : _param_name;
84896
+ var classNames = useContext(SelectContext).classNames;
84897
+ return /*#__PURE__*/ jsxs("div", {
84898
+ className: classNames && classNames.searchContainer ? classNames.searchContainer : "relative py-1 px-2.5",
84899
+ children: [
84900
+ /*#__PURE__*/ jsx(SearchIcon, {
84901
+ className: classNames && classNames.searchIcon ? classNames.searchIcon : "absolute w-5 h-5 mt-2.5 pb-0.5 ml-2 text-gray-500"
84902
+ }),
84903
+ /*#__PURE__*/ jsx("input", {
84904
+ ref: ref,
84905
+ className: classNames && classNames.searchBox ? classNames.searchBox : "w-full py-2 pl-8 text-sm text-gray-500 bg-gray-100 border border-gray-200 rounded focus:border-gray-200 focus:ring-0 focus:outline-none",
84906
+ type: "text",
84907
+ placeholder: placeholder,
84908
+ value: value,
84909
+ onChange: onChange,
84910
+ name: name
84911
+ })
84912
+ ]
84913
+ });
84914
+ });
84915
+
84916
+ var Spinner = function(param) {
84917
+ var _param_primaryColor = param.primaryColor, primaryColor = _param_primaryColor === void 0 ? DEFAULT_THEME : _param_primaryColor;
84918
+ var spinnerColor = useMemo$1(function() {
84919
+ if (COLORS.includes(primaryColor)) {
84920
+ return THEME_DATA.text[primaryColor];
84921
+ }
84922
+ return THEME_DATA.text[DEFAULT_THEME];
84923
+ }, [
84924
+ primaryColor
84925
+ ]);
84926
+ return /*#__PURE__*/ jsxs("svg", {
84927
+ className: "animate-spin mr-0.5 h-5 w-5 ".concat(spinnerColor),
84928
+ xmlns: "http://www.w3.org/2000/svg",
84929
+ fill: "none",
84930
+ viewBox: "0 0 24 24",
84931
+ children: [
84932
+ /*#__PURE__*/ jsx("circle", {
84933
+ className: "opacity-25",
84934
+ cx: "12",
84935
+ cy: "12",
84936
+ r: "10",
84937
+ stroke: "currentColor",
84938
+ strokeWidth: "4"
84939
+ }),
84940
+ /*#__PURE__*/ jsx("path", {
84941
+ className: "opacity-75",
84942
+ fill: "currentColor",
84943
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
84944
+ })
84945
+ ]
84946
+ });
84947
+ };
84948
+
84949
+ function _array_like_to_array$7(arr, len) {
84950
+ if (len == null || len > arr.length) len = arr.length;
84951
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
84952
+ return arr2;
84953
+ }
84954
+ function _array_with_holes$5(arr) {
84955
+ if (Array.isArray(arr)) return arr;
84956
+ }
84957
+ function _array_without_holes$2(arr) {
84958
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
84959
+ }
84960
+ function _define_property$8(obj, key, value) {
84961
+ if (key in obj) {
84962
+ Object.defineProperty(obj, key, {
84963
+ value: value,
84964
+ enumerable: true,
84965
+ configurable: true,
84966
+ writable: true
84967
+ });
84968
+ } else {
84969
+ obj[key] = value;
84970
+ }
84971
+ return obj;
84972
+ }
84973
+ function _iterable_to_array$2(iter) {
84974
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
84975
+ }
84976
+ function _iterable_to_array_limit$5(arr, i) {
84977
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
84978
+ if (_i == null) return;
84979
+ var _arr = [];
84980
+ var _n = true;
84981
+ var _d = false;
84982
+ var _s, _e;
84983
+ try {
84984
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
84985
+ _arr.push(_s.value);
84986
+ if (i && _arr.length === i) break;
84987
+ }
84988
+ } catch (err) {
84989
+ _d = true;
84990
+ _e = err;
84991
+ } finally{
84992
+ try {
84993
+ if (!_n && _i["return"] != null) _i["return"]();
84994
+ } finally{
84995
+ if (_d) throw _e;
84996
+ }
84997
+ }
84998
+ return _arr;
84999
+ }
85000
+ function _non_iterable_rest$5() {
85001
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
85002
+ }
85003
+ function _non_iterable_spread$2() {
85004
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
85005
+ }
85006
+ function _object_spread$8(target) {
85007
+ for(var i = 1; i < arguments.length; i++){
85008
+ var source = arguments[i] != null ? arguments[i] : {};
85009
+ var ownKeys = Object.keys(source);
85010
+ if (typeof Object.getOwnPropertySymbols === "function") {
85011
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
85012
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
85013
+ }));
85014
+ }
85015
+ ownKeys.forEach(function(key) {
85016
+ _define_property$8(target, key, source[key]);
85017
+ });
85018
+ }
85019
+ return target;
85020
+ }
85021
+ function ownKeys$5(object, enumerableOnly) {
85022
+ var keys = Object.keys(object);
85023
+ if (Object.getOwnPropertySymbols) {
85024
+ var symbols = Object.getOwnPropertySymbols(object);
85025
+ if (enumerableOnly) {
85026
+ symbols = symbols.filter(function(sym) {
85027
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
85028
+ });
85029
+ }
85030
+ keys.push.apply(keys, symbols);
85031
+ }
85032
+ return keys;
85033
+ }
85034
+ function _object_spread_props$5(target, source) {
85035
+ source = source != null ? source : {};
85036
+ if (Object.getOwnPropertyDescriptors) {
85037
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
85038
+ } else {
85039
+ ownKeys$5(Object(source)).forEach(function(key) {
85040
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
85041
+ });
85042
+ }
85043
+ return target;
85044
+ }
85045
+ function _sliced_to_array$5(arr, i) {
85046
+ return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$5();
85047
+ }
85048
+ function _to_consumable_array$2(arr) {
85049
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$2();
85050
+ }
85051
+ function _unsupported_iterable_to_array$7(o, minLen) {
85052
+ if (!o) return;
85053
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
85054
+ var n = Object.prototype.toString.call(o).slice(8, -1);
85055
+ if (n === "Object" && o.constructor) n = o.constructor.name;
85056
+ if (n === "Map" || n === "Set") return Array.from(n);
85057
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
85058
+ }
85059
+ var DropDown = function(param) {
85060
+ var _param_options = param.options, options = _param_options === void 0 ? [] : _param_options, _param_value = param.value, value = _param_value === void 0 ? null : _param_value, onChange = param.onChange, onSearchInputChange = param.onSearchInputChange, _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "Select..." : _param_placeholder, _param_searchInputPlaceholder = param.searchInputPlaceholder, searchInputPlaceholder = _param_searchInputPlaceholder === void 0 ? "Search..." : _param_searchInputPlaceholder, _param_isMultiple = param.isMultiple, isMultiple = _param_isMultiple === void 0 ? false : _param_isMultiple, _param_isClearable = param.isClearable, isClearable = _param_isClearable === void 0 ? false : _param_isClearable, _param_isSearchable = param.isSearchable, isSearchable = _param_isSearchable === void 0 ? false : _param_isSearchable, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, _param_menuIsOpen = param.menuIsOpen, menuIsOpen = _param_menuIsOpen === void 0 ? false : _param_menuIsOpen, _param_noOptionsMessage = param.noOptionsMessage, noOptionsMessage = _param_noOptionsMessage === void 0 ? "No options found" : _param_noOptionsMessage, _param_primaryColor = param.primaryColor, primaryColor = _param_primaryColor === void 0 ? DEFAULT_THEME : _param_primaryColor, _param_formatGroupLabel = param.formatGroupLabel, formatGroupLabel = _param_formatGroupLabel === void 0 ? null : _param_formatGroupLabel, _param_formatOptionLabel = param.formatOptionLabel, formatOptionLabel = _param_formatOptionLabel === void 0 ? null : _param_formatOptionLabel, classNames = param.classNames;
85061
+ var _useState = _sliced_to_array$5(useState(menuIsOpen), 2), open = _useState[0], setOpen = _useState[1];
85062
+ var _useState1 = _sliced_to_array$5(useState(options), 2), list = _useState1[0], setList = _useState1[1];
85063
+ var _useState2 = _sliced_to_array$5(useState(""), 2), inputValue = _useState2[0], setInputValue = _useState2[1];
85064
+ var ref = useRef(null);
85065
+ var searchBoxRef = useRef(null);
85066
+ useEffect(function() {
85067
+ var formatItem = function(item) {
85068
+ if ("disabled" in item) return item;
85069
+ return _object_spread_props$5(_object_spread$8({}, item), {
85070
+ disabled: false
85071
+ });
85072
+ };
85073
+ setList(options.map(function(item) {
85074
+ if ("options" in item) {
85075
+ return {
85076
+ label: item.label,
85077
+ options: item.options.map(formatItem)
85078
+ };
85079
+ } else {
85080
+ return formatItem(item);
85081
+ }
85082
+ }));
85083
+ }, [
85084
+ options
85085
+ ]);
85086
+ useEffect(function() {
85087
+ if (isSearchable) {
85088
+ if (open) {
85089
+ var _searchBoxRef_current;
85090
+ (_searchBoxRef_current = searchBoxRef.current) === null || _searchBoxRef_current === void 0 ? void 0 : _searchBoxRef_current.select();
85091
+ } else {
85092
+ setInputValue("");
85093
+ }
85094
+ }
85095
+ }, [
85096
+ open,
85097
+ isSearchable
85098
+ ]);
85099
+ var toggle = useCallback$1(function() {
85100
+ if (!isDisabled) {
85101
+ setOpen(!open);
85102
+ }
85103
+ }, [
85104
+ isDisabled,
85105
+ open
85106
+ ]);
85107
+ var closeDropDown = useCallback$1(function() {
85108
+ if (open) setOpen(false);
85109
+ }, [
85110
+ open
85111
+ ]);
85112
+ useOnClickOutside(ref, function() {
85113
+ closeDropDown();
85114
+ });
85115
+ var onPressEnterOrSpace = useCallback$1(function(e) {
85116
+ e.preventDefault();
85117
+ if ((e.code === "Enter" || e.code === "Space") && !isDisabled) {
85118
+ toggle();
85119
+ }
85120
+ }, [
85121
+ isDisabled,
85122
+ toggle
85123
+ ]);
85124
+ var handleValueChange = useCallback$1(function(selected) {
85125
+ var update = function update() {
85126
+ if (!isMultiple && !Array.isArray(value)) {
85127
+ closeDropDown();
85128
+ onChange(selected);
85129
+ }
85130
+ if (isMultiple && (Array.isArray(value) || value === null)) {
85131
+ onChange(value === null ? [
85132
+ selected
85133
+ ] : _to_consumable_array$2(value).concat([
85134
+ selected
85135
+ ]));
85136
+ }
85137
+ };
85138
+ if (selected !== value) {
85139
+ update();
85140
+ }
85141
+ }, [
85142
+ closeDropDown,
85143
+ isMultiple,
85144
+ onChange,
85145
+ value
85146
+ ]);
85147
+ var clearValue = useCallback$1(function(e) {
85148
+ e.stopPropagation();
85149
+ onChange(null);
85150
+ }, [
85151
+ onChange
85152
+ ]);
85153
+ var removeItem = useCallback$1(function(e, item) {
85154
+ if (isMultiple && Array.isArray(value) && value.length) {
85155
+ e.stopPropagation();
85156
+ var result = value.filter(function(current) {
85157
+ return item.value !== current.value;
85158
+ });
85159
+ onChange(result.length ? result : null);
85160
+ }
85161
+ }, [
85162
+ isMultiple,
85163
+ onChange,
85164
+ value
85165
+ ]);
85166
+ var getSelectClass = useCallback$1(function() {
85167
+ var ringColor = THEME_DATA.ring[DEFAULT_THEME];
85168
+ if (COLORS.includes(primaryColor)) {
85169
+ ringColor = THEME_DATA.ring[primaryColor];
85170
+ }
85171
+ var borderFocus = THEME_DATA.borderFocus[DEFAULT_THEME];
85172
+ if (COLORS.includes(primaryColor)) {
85173
+ borderFocus = THEME_DATA.borderFocus[primaryColor];
85174
+ }
85175
+ var baseClass = "flex text-sm text-gray-500 border border-gray-300 rounded shadow-sm transition-all duration-300 focus:outline-none";
85176
+ var defaultClass = "".concat(baseClass, " ").concat(isDisabled ? "bg-gray-200" : "bg-white hover:border-gray-400 ".concat(borderFocus, " focus:ring ").concat(ringColor));
85177
+ return classNames && classNames.menuButton ? classNames.menuButton({
85178
+ isDisabled: isDisabled
85179
+ }) : defaultClass;
85180
+ }, [
85181
+ classNames,
85182
+ isDisabled,
85183
+ primaryColor
85184
+ ]);
85185
+ var getTagItemClass = useCallback$1(function(item) {
85186
+ var baseClasse = "bg-gray-200 border rounded-sm flex space-x-1";
85187
+ var disabledClass = isDisabled ? "border-gray-500 px-1" : "pl-1";
85188
+ return (classNames === null || classNames === void 0 ? void 0 : classNames.tagItem) ? classNames.tagItem({
85189
+ item: item,
85190
+ isDisabled: isDisabled
85191
+ }) : "".concat(baseClasse, " ").concat(disabledClass);
85192
+ }, [
85193
+ classNames,
85194
+ isDisabled
85195
+ ]);
85196
+ return /*#__PURE__*/ jsx(SelectProvider, {
85197
+ otherData: {
85198
+ formatGroupLabel: formatGroupLabel,
85199
+ formatOptionLabel: formatOptionLabel,
85200
+ classNames: classNames
85201
+ },
85202
+ value: value,
85203
+ handleValueChange: handleValueChange,
85204
+ children: /*#__PURE__*/ jsxs("div", {
85205
+ className: "relative w-full",
85206
+ ref: ref,
85207
+ children: [
85208
+ /*#__PURE__*/ jsxs("div", {
85209
+ "aria-expanded": open,
85210
+ onKeyDown: onPressEnterOrSpace,
85211
+ onClick: toggle,
85212
+ className: getSelectClass(),
85213
+ children: [
85214
+ /*#__PURE__*/ jsx("div", {
85215
+ className: "grow pl-2.5 py-2 pr-2 flex flex-wrap gap-1",
85216
+ children: !isMultiple ? /*#__PURE__*/ jsx("p", {
85217
+ className: "truncate cursor-default select-none",
85218
+ children: value && !Array.isArray(value) ? value.label : placeholder
85219
+ }) : /*#__PURE__*/ jsxs(Fragment$1, {
85220
+ children: [
85221
+ value === null && placeholder,
85222
+ Array.isArray(value) && value.map(function(item, index) {
85223
+ return /*#__PURE__*/ jsxs("div", {
85224
+ className: getTagItemClass(item),
85225
+ children: [
85226
+ /*#__PURE__*/ jsx("p", {
85227
+ className: (classNames === null || classNames === void 0 ? void 0 : classNames.tagItemText) ? classNames.tagItemText : "text-gray-600 truncate cursor-default select-none",
85228
+ children: item.label
85229
+ }),
85230
+ !isDisabled && /*#__PURE__*/ jsx("div", {
85231
+ role: "button",
85232
+ tabIndex: 0,
85233
+ onClick: function(e) {
85234
+ return removeItem(e, item);
85235
+ },
85236
+ className: (classNames === null || classNames === void 0 ? void 0 : classNames.tagItemIconContainer) ? classNames.tagItemIconContainer : "flex items-center px-1 cursor-pointer rounded-r-sm hover:bg-red-200 hover:text-red-600",
85237
+ children: /*#__PURE__*/ jsx(CloseIcon, {
85238
+ className: (classNames === null || classNames === void 0 ? void 0 : classNames.tagItemIcon) ? classNames.tagItemIcon : "w-3 h-3 mt-0.5"
85239
+ })
85240
+ })
85241
+ ]
85242
+ }, index);
85243
+ })
85244
+ ]
85245
+ })
85246
+ }),
85247
+ /*#__PURE__*/ jsxs("div", {
85248
+ className: "flex flex-none items-center py-1.5",
85249
+ children: [
85250
+ loading && /*#__PURE__*/ jsx("div", {
85251
+ className: "px-1.5",
85252
+ children: /*#__PURE__*/ jsx(Spinner, {
85253
+ primaryColor: primaryColor
85254
+ })
85255
+ }),
85256
+ isClearable && !isDisabled && value !== null && /*#__PURE__*/ jsx("div", {
85257
+ className: "px-1.5 cursor-pointer",
85258
+ onClick: clearValue,
85259
+ children: /*#__PURE__*/ jsx(CloseIcon, {
85260
+ className: (classNames === null || classNames === void 0 ? void 0 : classNames.closeIcon) ? classNames.closeIcon : "w-5 h-5 p-0.5"
85261
+ })
85262
+ }),
85263
+ /*#__PURE__*/ jsx("div", {
85264
+ className: "h-full",
85265
+ children: /*#__PURE__*/ jsx("span", {
85266
+ className: "w-px h-full inline-block text-white bg-gray-300 text-opacity-0"
85267
+ })
85268
+ }),
85269
+ /*#__PURE__*/ jsx("div", {
85270
+ className: "px-1.5",
85271
+ children: /*#__PURE__*/ jsx(ChevronIcon, {
85272
+ className: "transition duration-300 w-6 h-6 p-0.5".concat(open ? " transform rotate-90 text-gray-500" : " text-gray-300")
85273
+ })
85274
+ })
85275
+ ]
85276
+ })
85277
+ ]
85278
+ }),
85279
+ open && !isDisabled && /*#__PURE__*/ jsxs("div", {
85280
+ className: (classNames === null || classNames === void 0 ? void 0 : classNames.menu) ? classNames.menu : "absolute z-10 w-full bg-white shadow-lg border rounded py-1 mt-1.5 text-sm text-gray-700",
85281
+ children: [
85282
+ isSearchable && /*#__PURE__*/ jsx(SearchInput, {
85283
+ ref: searchBoxRef,
85284
+ value: inputValue,
85285
+ placeholder: searchInputPlaceholder,
85286
+ onChange: function(e) {
85287
+ if (onSearchInputChange && typeof onSearchInputChange === "function") onSearchInputChange(e);
85288
+ setInputValue(e.target.value);
85289
+ }
85290
+ }),
85291
+ /*#__PURE__*/ jsx(Options, {
85292
+ list: list,
85293
+ noOptionsMessage: noOptionsMessage,
85294
+ text: inputValue,
85295
+ isMultiple: isMultiple,
85296
+ value: value,
85297
+ primaryColor: primaryColor || DEFAULT_THEME
85298
+ })
85299
+ ]
85300
+ })
85301
+ ]
85302
+ })
85303
+ });
85304
+ };
85305
+
84396
85306
  var ModalContent = function(param) {
84397
85307
  var title = param.title, setModal = param.setModal, children = param.children, onClick = param.onClick, _param_notice = param.notice, notice = _param_notice === void 0 ? false : _param_notice;
84398
85308
  return /*#__PURE__*/ jsxs("form", {
@@ -106940,4 +107850,4 @@ function DnDCalendar(props) {
106940
107850
  });
106941
107851
  }
106942
107852
 
106943
- export { BaseTable, BigCalender, CkEditor, CustomUpload, DataTable, DateRangePicker, DnDCalendar, DropImage, ReactDateRange, Regex, Spin, Switch, UiLibrary, decryptByEcPay, encryptByEcPay, verifyId, verifyTaxId };
107853
+ export { BaseTable, BigCalender, CkEditor, CustomUpload, DataTable, DateRangePicker, DnDCalendar, DropDown, DropImage, ReactDateRange, Regex, Spin, Switch, UiLibrary, decryptByEcPay, encryptByEcPay, verifyId, verifyTaxId };