@ballistix.digital/react-components 1.1.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import { ArrowPathIcon, ChevronDownIcon, EllipsisVerticalIcon, ExclamationCircleIcon, ChevronDoubleLeftIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDoubleRightIcon, ChevronUpIcon, ChevronUpDownIcon, HomeIcon, ArrowLongLeftIcon, ArrowLongRightIcon } from '@heroicons/react/20/solid';
3
- import { isArray, map, set, get, noop as noop$1, indexOf, toSafeInteger, pick, isEmpty, some, compact as compact$1, forEach, assign, includes, intersection, trim, lastIndexOf } from 'lodash';
3
+ import { isArray, map, set, get, noop as noop$1, indexOf, toSafeInteger, pick, isEmpty, some, compact as compact$1, forEach, assign, includes, intersection, delay, trim, lastIndexOf } from 'lodash';
4
4
  import get$1 from 'lodash/get';
5
5
  import React, { useState, useMemo, Children, Fragment, useEffect, useCallback, useRef, forwardRef, useImperativeHandle, useReducer, createElement, PureComponent, Component } from 'react';
6
6
  import { library } from '@fortawesome/fontawesome-svg-core';
@@ -10,7 +10,7 @@ import { far } from '@fortawesome/pro-regular-svg-icons';
10
10
  import { fas } from '@fortawesome/pro-solid-svg-icons';
11
11
  import { fat } from '@fortawesome/pro-thin-svg-icons';
12
12
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
13
- import { Menu, Transition, Dialog, Popover, Switch } from '@headlessui/react';
13
+ import { Menu, Transition, Dialog, Popover, Switch as Switch$1 } from '@headlessui/react';
14
14
  import { useMask } from '@react-input/mask';
15
15
  import { ViewColumnsIcon, ChevronDownIcon as ChevronDownIcon$1, TableCellsIcon, XMarkIcon, PlusIcon } from '@heroicons/react/24/outline';
16
16
  import { useReactTable, getCoreRowModel, flexRender, createColumnHelper as createColumnHelper$1 } from '@tanstack/react-table';
@@ -155,10 +155,10 @@ var deepCopyObject = function (object) {
155
155
  var AvatarElement = function (props) {
156
156
  var src = props.src, placeholder = props.placeholder, children = props.children, url = props.url, _a = props.size, size = _a === void 0 ? 'md' : _a, _b = props.figure, figure = _b === void 0 ? 'block' : _b, status = props.status, isDisabled = props.isDisabled, isLoading = props.isLoading, stylesOverrides = props.styles;
157
157
  var handleGenerateStyle = function () {
158
- var result = deepCopyObject(styles$u.base);
159
- var keys = calculateNestedKeys(styles$u.base);
158
+ var result = deepCopyObject(styles$v.base);
159
+ var keys = calculateNestedKeys(styles$v.base);
160
160
  keys.forEach(function (key) {
161
- set(result, key, toClassName(get(styles$u.base, key), size && get(styles$u[size], key), figure && get(styles$u[figure], key), status && get(styles$u[status], key), isDisabled && get(styles$u.disabled, key), isLoading && get(styles$u.loading, key), get(stylesOverrides, key)));
161
+ set(result, key, toClassName(get(styles$v.base, key), size && get(styles$v[size], key), figure && get(styles$v[figure], key), status && get(styles$v[status], key), isDisabled && get(styles$v.disabled, key), isLoading && get(styles$v.loading, key), get(stylesOverrides, key)));
162
162
  });
163
163
  return result;
164
164
  };
@@ -254,7 +254,7 @@ var online = {
254
254
  var blocked = {
255
255
  indicator: 'bg-red-400',
256
256
  };
257
- var styles$u = {
257
+ var styles$v = {
258
258
  base: base$r,
259
259
  xs: xs$4,
260
260
  sm: sm$5,
@@ -312,10 +312,10 @@ var BadgeElement$1 = function (props) {
312
312
  var title = props.title, message = props.message, _a = props.type, type = _a === void 0 ? 'generic' : _a, _b = props.onClose, onClose = _b === void 0 ? noop$1 : _b, _c = props.onCollapse, onCollapse = _c === void 0 ? noop$1 : _c, _d = props.isCollapsible, isCollapsible = _d === void 0 ? false : _d, stylesOverrides = props.styles, iconAccessorOverride = props.iconAccessor;
313
313
  var _e = useState(false), isCollapsed = _e[0], setIsCollapsed = _e[1];
314
314
  var handleGenerateStyle = function () {
315
- var result = deepCopyObject(styles$t.base);
316
- var keys = calculateNestedKeys(styles$t.base);
315
+ var result = deepCopyObject(styles$u.base);
316
+ var keys = calculateNestedKeys(styles$u.base);
317
317
  keys.forEach(function (key) {
318
- set(result, key, toClassName(get(styles$t.base, key), type && get(styles$t[type], key), get(stylesOverrides, key)));
318
+ set(result, key, toClassName(get(styles$u.base, key), type && get(styles$u[type], key), get(stylesOverrides, key)));
319
319
  });
320
320
  return result;
321
321
  };
@@ -400,7 +400,7 @@ var info = {
400
400
  title: 'text-blue-500',
401
401
  },
402
402
  };
403
- var styles$t = {
403
+ var styles$u = {
404
404
  base: base$q,
405
405
  generic: generic,
406
406
  error: error$1,
@@ -412,10 +412,10 @@ var styles$t = {
412
412
  var BadgeElement = function (props) {
413
413
  var children = props.children, _a = props.color, color = _a === void 0 ? 'gray' : _a, _b = props.type, type = _b === void 0 ? 'normal' : _b, _c = props.size, size = _c === void 0 ? 'sm' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, isDisabled = props.isDisabled, isLoading = props.isLoading, onClose = props.onClose, stylesOverrides = props.styles, dataCy = props.dataCy;
414
414
  var handleGenerateStyle = function () {
415
- var result = deepCopyObject(styles$s.base);
416
- var keys = calculateNestedKeys(styles$s.base);
415
+ var result = deepCopyObject(styles$t.base);
416
+ var keys = calculateNestedKeys(styles$t.base);
417
417
  keys.forEach(function (key) {
418
- set(result, key, toClassName(get(styles$s.base, key), type && get(styles$s[type], key), color && get(styles$s[color], key), size && get(styles$s[size], key), figure && get(styles$s[figure], key), isDisabled && get(styles$s.disabled, key), isLoading && get(styles$s.loading, key), get(stylesOverrides, key)));
418
+ set(result, key, toClassName(get(styles$t.base, key), type && get(styles$t[type], key), color && get(styles$t[color], key), size && get(styles$t[size], key), figure && get(styles$t[figure], key), isDisabled && get(styles$t.disabled, key), isLoading && get(styles$t.loading, key), get(stylesOverrides, key)));
419
419
  });
420
420
  return result;
421
421
  };
@@ -510,7 +510,7 @@ var disabled$9 = {
510
510
  var loading$1 = {
511
511
  container: 'cursor-progress',
512
512
  };
513
- var styles$s = {
513
+ var styles$t = {
514
514
  base: base$p,
515
515
  normal: normal$8,
516
516
  indicator: indicator,
@@ -537,10 +537,10 @@ var styles$s = {
537
537
  var ButtonElement = function (props) {
538
538
  var children = props.children, innerRef = props.innerRef, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, dataCy = props.dataCy, _b = props.type, type = _b === void 0 ? 'primary' : _b, _c = props.size, size = _c === void 0 ? 'md' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, _e = props.status, status = _e === void 0 ? 'idle' : _e, isDisabled = props.isDisabled, stylesOverrides = props.styles, onClick = props.onClick;
539
539
  var handleGenerateStyle = function () {
540
- var result = deepCopyObject(styles$r.base);
541
- var keys = calculateNestedKeys(styles$r.base);
540
+ var result = deepCopyObject(styles$s.base);
541
+ var keys = calculateNestedKeys(styles$s.base);
542
542
  keys.forEach(function (key) {
543
- set(result, key, toClassName(get(styles$r.base, key), type && get(styles$r[type], key), size && get(styles$r[size], key), figure && get(styles$r[figure], key), status && get(styles$r[status], key), isDisabled && get(styles$r.disabled, key), get(stylesOverrides, key)));
543
+ set(result, key, toClassName(get(styles$s.base, key), type && get(styles$s[type], key), size && get(styles$s[size], key), figure && get(styles$s[figure], key), status && get(styles$s[status], key), isDisabled && get(styles$s.disabled, key), get(stylesOverrides, key)));
544
544
  });
545
545
  return result;
546
546
  };
@@ -602,7 +602,7 @@ var error = {
602
602
  var disabled$8 = {
603
603
  container: '!opacity-20 !cursor-not-allowed',
604
604
  };
605
- var styles$r = {
605
+ var styles$s = {
606
606
  base: base$o,
607
607
  primary: primary,
608
608
  secondary: secondary,
@@ -624,10 +624,10 @@ var styles$r = {
624
624
  var ButtonGroupElement = function (props) {
625
625
  var children = props.children, stylesOverrides = props.styles;
626
626
  var handleGenerateStyle = function () {
627
- var result = deepCopyObject(styles$q.base);
628
- var keys = calculateNestedKeys(styles$q.base);
627
+ var result = deepCopyObject(styles$r.base);
628
+ var keys = calculateNestedKeys(styles$r.base);
629
629
  keys.forEach(function (key) {
630
- set(result, key, toClassName(get(styles$q.base, key), get(stylesOverrides, key)));
630
+ set(result, key, toClassName(get(styles$r.base, key), get(stylesOverrides, key)));
631
631
  });
632
632
  return result;
633
633
  };
@@ -651,17 +651,17 @@ var base$n = {
651
651
  button: '-ml-px relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
652
652
  lastButton: '-ml-px relative inline-flex items-center px-4 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
653
653
  };
654
- var styles$q = {
654
+ var styles$r = {
655
655
  base: base$n,
656
656
  };
657
657
 
658
658
  var Container$3 = function (props) {
659
659
  var children = props.children, label = props.label, trigger = props.trigger, dataCy = props.dataCy, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom-left' : _b, _c = props.isEscapingOverflow, isEscapingOverflow = _c === void 0 ? false : _c, stylesOverrides = props.styles;
660
660
  var handleGenerateStyle = function () {
661
- var result = deepCopyObject(styles$p.base);
662
- var keys = calculateNestedKeys(styles$p.base);
661
+ var result = deepCopyObject(styles$q.base);
662
+ var keys = calculateNestedKeys(styles$q.base);
663
663
  keys.forEach(function (key) {
664
- set(result, key, toClassName(get(styles$p.base, key), type && get(styles$p[type], key), direction && get(styles$p[direction], key), get(stylesOverrides, key)));
664
+ set(result, key, toClassName(get(styles$q.base, key), type && get(styles$q[type], key), direction && get(styles$q[direction], key), get(stylesOverrides, key)));
665
665
  });
666
666
  return result;
667
667
  };
@@ -695,7 +695,7 @@ var topLeft = {
695
695
  var topRight = {
696
696
  items: 'origin-bottom-left left-0 bottom-0',
697
697
  };
698
- var styles$p = {
698
+ var styles$q = {
699
699
  base: base$m,
700
700
  button: button,
701
701
  compact: compact,
@@ -715,10 +715,10 @@ var InputGroupForm = function (props) {
715
715
  replacement: (_a = {}, _a[(_b = mask === null || mask === void 0 ? void 0 : mask.replacementCharacter) !== null && _b !== void 0 ? _b : 'X'] = /\d|\D/, _a),
716
716
  });
717
717
  var handleGenerateStyle = function () {
718
- var result = deepCopyObject(styles$o.base);
719
- var keys = calculateNestedKeys(styles$o.base);
718
+ var result = deepCopyObject(styles$p.base);
719
+ var keys = calculateNestedKeys(styles$p.base);
720
720
  keys.forEach(function (key) {
721
- set(result, key, toClassName(get(styles$o.base, key), leading !== undefined && get(styles$o.leading, key), trailing !== undefined && get(styles$o.trailing, key), type && get(styles$o[type], key), isTouched === true && !isValid && get(styles$o.invalid, key), isDisabled && get(styles$o.disabled, key), get(stylesOverrides, key)));
721
+ set(result, key, toClassName(get(styles$p.base, key), leading !== undefined && get(styles$p.leading, key), trailing !== undefined && get(styles$p.trailing, key), type && get(styles$p[type], key), isTouched === true && !isValid && get(styles$p.invalid, key), isDisabled && get(styles$p.disabled, key), get(stylesOverrides, key)));
722
722
  });
723
723
  return result;
724
724
  };
@@ -794,7 +794,7 @@ var invalid$5 = {
794
794
  var disabled$7 = {
795
795
  input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
796
796
  };
797
- var styles$o = {
797
+ var styles$p = {
798
798
  base: base$l,
799
799
  leading: leading$5,
800
800
  trailing: trailing$5,
@@ -810,10 +810,10 @@ var styles$o = {
810
810
  var ContainerLayout = function (props) {
811
811
  var children = props.children, _a = props.type, type = _a === void 0 ? 'break' : _a, stylesOverrides = props.styles;
812
812
  var handleGenerateStyle = function () {
813
- var result = deepCopyObject(styles$n.base);
814
- var keys = calculateNestedKeys(styles$n.base);
813
+ var result = deepCopyObject(styles$o.base);
814
+ var keys = calculateNestedKeys(styles$o.base);
815
815
  keys.forEach(function (key) {
816
- set(result, key, toClassName(get(styles$n.base, key), type && get(styles$n[type], key), get(stylesOverrides, key)));
816
+ set(result, key, toClassName(get(styles$o.base, key), type && get(styles$o[type], key), get(stylesOverrides, key)));
817
817
  });
818
818
  return result;
819
819
  };
@@ -850,7 +850,7 @@ var center$3 = {
850
850
  var fill$1 = {
851
851
  container: 'max-w-7xl mx-auto sm:px-6 lg:px-8',
852
852
  };
853
- var styles$n = {
853
+ var styles$o = {
854
854
  base: base$k,
855
855
  break: breakStyles,
856
856
  center: center$3,
@@ -860,10 +860,10 @@ var styles$n = {
860
860
  var DividerLayout = function (props) {
861
861
  var children = props.children, _a = props.type, type = _a === void 0 ? 'left' : _a, stylesOverrides = props.styles;
862
862
  var handleGenerateStyle = function () {
863
- var result = deepCopyObject(styles$m.base);
864
- var keys = calculateNestedKeys(styles$m.base);
863
+ var result = deepCopyObject(styles$n.base);
864
+ var keys = calculateNestedKeys(styles$n.base);
865
865
  keys.forEach(function (key) {
866
- set(result, key, toClassName(get(styles$m.base, key), type && get(styles$m[type], key), get(stylesOverrides, key)));
866
+ set(result, key, toClassName(get(styles$n.base, key), type && get(styles$n[type], key), get(stylesOverrides, key)));
867
867
  });
868
868
  return result;
869
869
  };
@@ -887,7 +887,7 @@ var center$2 = {
887
887
  var right = {
888
888
  body: 'justify-end',
889
889
  };
890
- var styles$m = {
890
+ var styles$n = {
891
891
  base: base$j,
892
892
  left: left,
893
893
  center: center$2,
@@ -897,10 +897,10 @@ var styles$m = {
897
897
  var ListContainerLayout = function (props) {
898
898
  var children = props.children, _a = props.type, type = _a === void 0 ? 'fill' : _a, stylesOverrides = props.styles;
899
899
  var handleGenerateStyle = function () {
900
- var result = deepCopyObject(styles$l.base);
901
- var keys = calculateNestedKeys(styles$l.base);
900
+ var result = deepCopyObject(styles$m.base);
901
+ var keys = calculateNestedKeys(styles$m.base);
902
902
  keys.forEach(function (key) {
903
- set(result, key, toClassName(get(styles$l.base, key), type && get(styles$l[type], key), get(stylesOverrides, key)));
903
+ set(result, key, toClassName(get(styles$m.base, key), type && get(styles$m[type], key), get(stylesOverrides, key)));
904
904
  });
905
905
  return result;
906
906
  };
@@ -942,7 +942,7 @@ var cardSticky = {
942
942
  list: 'space-y-3',
943
943
  item: 'bg-white shadow overflow-hidden px-4 py-4 sm:px-6 sm:rounded-md',
944
944
  };
945
- var styles$l = {
945
+ var styles$m = {
946
946
  base: base$i,
947
947
  fill: fill,
948
948
  'fill-sticky': fillSticky,
@@ -955,10 +955,10 @@ var styles$l = {
955
955
  var MediaObjectLayout = function (props) {
956
956
  var title = props.title, paragraph = props.paragraph, customFigure = props.figure, _a = props.type, type = _a === void 0 ? 'top' : _a, stylesOverrides = props.styles;
957
957
  var handleGenerateStyle = function () {
958
- var result = deepCopyObject(styles$k.base);
959
- var keys = calculateNestedKeys(styles$k.base);
958
+ var result = deepCopyObject(styles$l.base);
959
+ var keys = calculateNestedKeys(styles$l.base);
960
960
  keys.forEach(function (key) {
961
- set(result, key, toClassName(get(styles$k.base, key), type && get(styles$k[type], key), get(stylesOverrides, key)));
961
+ set(result, key, toClassName(get(styles$l.base, key), type && get(styles$l[type], key), get(stylesOverrides, key)));
962
962
  });
963
963
  return result;
964
964
  };
@@ -1031,7 +1031,7 @@ var wideReversed = {
1031
1031
  figure: 'mb-4 md:mb-0 sm:mr-4 sm:mb-4',
1032
1032
  svg: 'h-32 w-full sm:w-32',
1033
1033
  };
1034
- var styles$k = {
1034
+ var styles$l = {
1035
1035
  base: base$h,
1036
1036
  top: top,
1037
1037
  'top-reversed': topReversed,
@@ -1050,10 +1050,10 @@ var styles$k = {
1050
1050
  var Container$2 = function (props) {
1051
1051
  var children = props.children, _a = props.type, type = _a === void 0 ? 'normal' : _a, stylesOverrides = props.styles;
1052
1052
  var handleGenerateStyle = function () {
1053
- var result = deepCopyObject(styles$j.base);
1054
- var keys = calculateNestedKeys(styles$j.base);
1053
+ var result = deepCopyObject(styles$k.base);
1054
+ var keys = calculateNestedKeys(styles$k.base);
1055
1055
  keys.forEach(function (key) {
1056
- set(result, key, toClassName(get(styles$j.base, key), type && get(styles$j[type], key), get(stylesOverrides, key)));
1056
+ set(result, key, toClassName(get(styles$k.base, key), type && get(styles$k[type], key), get(stylesOverrides, key)));
1057
1057
  });
1058
1058
  return result;
1059
1059
  };
@@ -1063,10 +1063,10 @@ var Container$2 = function (props) {
1063
1063
  var Section = function (props) {
1064
1064
  var children = props.children, stylesOverrides = props.styles;
1065
1065
  var handleGenerateStyle = function () {
1066
- var result = deepCopyObject(styles$j.base);
1067
- var keys = calculateNestedKeys(styles$j.base);
1066
+ var result = deepCopyObject(styles$k.base);
1067
+ var keys = calculateNestedKeys(styles$k.base);
1068
1068
  keys.forEach(function (key) {
1069
- set(result, key, toClassName(get(styles$j.base, key), get(stylesOverrides, key)));
1069
+ set(result, key, toClassName(get(styles$k.base, key), get(stylesOverrides, key)));
1070
1070
  });
1071
1071
  return result;
1072
1072
  };
@@ -1088,7 +1088,7 @@ var normal$6 = {
1088
1088
  var sticky$1 = {
1089
1089
  container: 'sm:rounded-lg',
1090
1090
  };
1091
- var styles$j = {
1091
+ var styles$k = {
1092
1092
  base: base$g,
1093
1093
  normal: normal$6,
1094
1094
  sticky: sticky$1,
@@ -1194,6 +1194,79 @@ var useExcel = function () {
1194
1194
  };
1195
1195
  };
1196
1196
 
1197
+ var SelectMenuForm = function (props) {
1198
+ var _a;
1199
+ var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.isRequired, isRequired = _c === void 0 ? false : _c, isLoading = props.isLoading, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, isDisabled = props.isDisabled, _e = props.isClearable, isClearable = _e === void 0 ? true : _e, _f = props.isMultiple, isMultiple = _f === void 0 ? false : _f, _g = props.isSearchable, isSearchable = _g === void 0 ? true : _g, _h = props.isSolo, isSolo = _h === void 0 ? false : _h, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
1200
+ var _j = useState(true), isFocus = _j[0], setIsFocus = _j[1];
1201
+ var _k = useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
1202
+ var isValid = error === undefined;
1203
+ var selectDataCy = "form-select-".concat(name);
1204
+ var errorDataCy = "form-select-error-".concat(name);
1205
+ var handleGenerateStyle = function () {
1206
+ var result = deepCopyObject(styles$j.base);
1207
+ var keys = calculateNestedKeys(styles$j.base);
1208
+ keys.forEach(function (key) {
1209
+ set(result, key, toClassName(get(styles$j.base, key), get(styles$j['normal'], key), isTouched === true && !isValid && get(styles$j.invalid, key), isDisabled && get(styles$j.disabled, key), get(stylesOverrides, key)));
1210
+ });
1211
+ return result;
1212
+ };
1213
+ var handleChange = function (selectValue) {
1214
+ setState(selectValue);
1215
+ onChange && onChange(selectValue);
1216
+ setIsFocus(false);
1217
+ };
1218
+ var styles = handleGenerateStyle();
1219
+ // Simulate onClear event.
1220
+ useEffect(function () {
1221
+ if (state === null && !isFocus) {
1222
+ onClear && onClear(name);
1223
+ }
1224
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1225
+ }, [state]);
1226
+ // Simulate onBlur event.
1227
+ useEffect(function () {
1228
+ if (!isFocus) {
1229
+ onBlur && onBlur();
1230
+ }
1231
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1232
+ }, [isFocus]);
1233
+ // listen to value changes.
1234
+ useEffect(function () {
1235
+ setState(value);
1236
+ }, [value]);
1237
+ return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.container, children: [jsx("div", { "data-cy": selectDataCy, children: jsx(Select, { primaryColor: "primary",
1238
+ //
1239
+ placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsx("p", { className: styles.emptyState, children: (_a = placeholder === null || placeholder === void 0 ? void 0 : placeholder.emptyState) !== null && _a !== void 0 ? _a : 'No results found' })), searchInputPlaceholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.searchInput,
1240
+ //
1241
+ loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
1242
+ //
1243
+ options: options,
1244
+ //
1245
+ value: state, onChange: handleChange, onSearchInputChange: onSearchInputChange,
1246
+ //
1247
+ classNames: {
1248
+ menuButton: function () {
1249
+ return toClassName(styles.input, state === null && '[&>*]:!text-gray-300 ', state === null &&
1250
+ !isValid &&
1251
+ isTouched &&
1252
+ '[&>*]:!text-red-300');
1253
+ },
1254
+ menu: styles.menu,
1255
+ tagItem: function () { return styles.tagItem; },
1256
+ tagItemText: styles.tagItemText,
1257
+ tagItemIconContainer: styles.tagItemIconContainer,
1258
+ tagItemIcon: styles.tagItemIcon,
1259
+ list: styles.list,
1260
+ listItem: function () { return styles.listItem; },
1261
+ listDisabledItem: styles.listDisabledItem,
1262
+ listGroupLabel: styles.listGroupLabel,
1263
+ searchContainer: styles.searchContainer,
1264
+ searchBox: styles.searchBox,
1265
+ searchIcon: styles.searchIcon,
1266
+ closeIcon: styles.closeIcon,
1267
+ } }) }), !isSolo && (jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && (jsx("p", { className: styles.error, "data-cy": errorDataCy, children: JSON.stringify(error).replaceAll('"', '') }))] }))] })] }));
1268
+ };
1269
+
1197
1270
  var base$f = {
1198
1271
  container: '',
1199
1272
  head: 'flex justify-between',
@@ -1272,7 +1345,7 @@ var invalid$4 = {
1272
1345
  var disabled$6 = {
1273
1346
  input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200',
1274
1347
  };
1275
- var styles$i = {
1348
+ var styles$j = {
1276
1349
  base: base$f,
1277
1350
  leading: leading$4,
1278
1351
  trailing: trailing$4,
@@ -1285,79 +1358,6 @@ var styles$i = {
1285
1358
  disabled: disabled$6,
1286
1359
  };
1287
1360
 
1288
- var SelectMenuForm = function (props) {
1289
- var _a;
1290
- var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.isRequired, isRequired = _c === void 0 ? false : _c, isLoading = props.isLoading, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, isDisabled = props.isDisabled, _e = props.isClearable, isClearable = _e === void 0 ? true : _e, _f = props.isMultiple, isMultiple = _f === void 0 ? false : _f, _g = props.isSearchable, isSearchable = _g === void 0 ? true : _g, _h = props.isSolo, isSolo = _h === void 0 ? false : _h, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
1291
- var _j = useState(true), isFocus = _j[0], setIsFocus = _j[1];
1292
- var _k = useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
1293
- var isValid = error === undefined;
1294
- var selectDataCy = "form-select-".concat(name);
1295
- var errorDataCy = "form-select-error-".concat(name);
1296
- var handleGenerateStyle = function () {
1297
- var result = deepCopyObject(styles$i.base);
1298
- var keys = calculateNestedKeys(styles$i.base);
1299
- keys.forEach(function (key) {
1300
- set(result, key, toClassName(get(styles$i.base, key), get(styles$i['normal'], key), isTouched === true && !isValid && get(styles$i.invalid, key), isDisabled && get(styles$i.disabled, key), get(stylesOverrides, key)));
1301
- });
1302
- return result;
1303
- };
1304
- var handleChange = function (selectValue) {
1305
- setState(selectValue);
1306
- onChange && onChange(selectValue);
1307
- setIsFocus(false);
1308
- };
1309
- var styles = handleGenerateStyle();
1310
- // Simulate onClear event.
1311
- useEffect(function () {
1312
- if (state === null && !isFocus) {
1313
- onClear && onClear(name);
1314
- }
1315
- // eslint-disable-next-line react-hooks/exhaustive-deps
1316
- }, [state]);
1317
- // Simulate onBlur event.
1318
- useEffect(function () {
1319
- if (!isFocus) {
1320
- onBlur && onBlur();
1321
- }
1322
- // eslint-disable-next-line react-hooks/exhaustive-deps
1323
- }, [isFocus]);
1324
- // listen to value changes.
1325
- useEffect(function () {
1326
- setState(value);
1327
- }, [value]);
1328
- return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.container, children: [jsx("div", { "data-cy": selectDataCy, children: jsx(Select, { primaryColor: "primary",
1329
- //
1330
- placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsx("p", { className: styles.emptyState, children: (_a = placeholder === null || placeholder === void 0 ? void 0 : placeholder.emptyState) !== null && _a !== void 0 ? _a : 'No results found' })), searchInputPlaceholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.searchInput,
1331
- //
1332
- loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
1333
- //
1334
- options: options,
1335
- //
1336
- value: state, onChange: handleChange, onSearchInputChange: onSearchInputChange,
1337
- //
1338
- classNames: {
1339
- menuButton: function () {
1340
- return toClassName(styles.input, state === null && '[&>*]:!text-gray-300 ', state === null &&
1341
- !isValid &&
1342
- isTouched &&
1343
- '[&>*]:!text-red-300');
1344
- },
1345
- menu: styles.menu,
1346
- tagItem: function () { return styles.tagItem; },
1347
- tagItemText: styles.tagItemText,
1348
- tagItemIconContainer: styles.tagItemIconContainer,
1349
- tagItemIcon: styles.tagItemIcon,
1350
- list: styles.list,
1351
- listItem: function () { return styles.listItem; },
1352
- listDisabledItem: styles.listDisabledItem,
1353
- listGroupLabel: styles.listGroupLabel,
1354
- searchContainer: styles.searchContainer,
1355
- searchBox: styles.searchBox,
1356
- searchIcon: styles.searchIcon,
1357
- closeIcon: styles.closeIcon,
1358
- } }) }), !isSolo && (jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && (jsx("p", { className: styles.error, "data-cy": errorDataCy, children: JSON.stringify(error).replaceAll('"', '') }))] }))] })] }));
1359
- };
1360
-
1361
1361
  var PanelPaginationNavigation = function (props) {
1362
1362
  var defaultValue = props.current, _a = props.min, min = _a === void 0 ? 1 : _a, _b = props.max, max = _b === void 0 ? 20 : _b, stylesOverrides = props.styles, pageSizeOptions = props.pageSizeOptions, defaultPageSize = props.defaultPageSize, _c = props.onChangePageSize, onChangePageSize = _c === void 0 ? noop$1 : _c, children = props.children, onChange = props.onChange;
1363
1363
  var _d = useState(1), current = _d[0], setCurrent = _d[1];
@@ -1380,10 +1380,10 @@ var PanelPaginationNavigation = function (props) {
1380
1380
  return options;
1381
1381
  }, [pageSize, pageSizeOptions]);
1382
1382
  var handleGenerateStyle = function () {
1383
- var result = deepCopyObject(styles$h.base);
1384
- var keys = calculateNestedKeys(styles$h.base);
1383
+ var result = deepCopyObject(styles$i.base);
1384
+ var keys = calculateNestedKeys(styles$i.base);
1385
1385
  keys.forEach(function (key) {
1386
- set(result, key, toClassName(get(styles$h.base, key), get(stylesOverrides, key)));
1386
+ set(result, key, toClassName(get(styles$i.base, key), get(stylesOverrides, key)));
1387
1387
  });
1388
1388
  return result;
1389
1389
  };
@@ -1454,7 +1454,7 @@ var base$e = {
1454
1454
  icon: 'w-5 h-5',
1455
1455
  pageSizeList: '!overflow-hidden',
1456
1456
  };
1457
- var styles$h = {
1457
+ var styles$i = {
1458
1458
  base: base$e,
1459
1459
  };
1460
1460
 
@@ -1463,10 +1463,10 @@ var TableList = function (props) {
1463
1463
  var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, defaultVisibility = props.defaultVisibility, _f = props.type, type = _f === void 0 ? 'normal' : _f, isLoading = props.isLoading, _g = props.isStriped, isStriped = _g === void 0 ? false : _g, _h = props.hasStickyHeader, hasStickyHeader = _h === void 0 ? false : _h, _j = props.hasVerticalSeparators, hasVerticalSeparators = _j === void 0 ? false : _j, _k = props.areControlsVisible, areControlsVisible = _k === void 0 ? true : _k, customControls = props.customControls, _l = props.exportFileName, exportFileName = _l === void 0 ? 'table-export' : _l, stylesOverrides = props.styles, onChange = props.onChange, onPaginate = props.onPaginate;
1464
1464
  var _m = useExcel(), generate = _m.generate, write = _m.write;
1465
1465
  var handleGenerateStyle = function () {
1466
- var result = deepCopyObject(styles$g.base);
1467
- var keys = calculateNestedKeys(styles$g.base);
1466
+ var result = deepCopyObject(styles$h.base);
1467
+ var keys = calculateNestedKeys(styles$h.base);
1468
1468
  keys.forEach(function (key) {
1469
- set(result, key, toClassName(get(styles$g.base, key), type && get(styles$g[type], key), hasStickyHeader && get(styles$g.sticky, key), hasVerticalSeparators && get(styles$g.separated, key), areControlsVisible && get(styles$g.controlled, key), get(stylesOverrides, key)));
1469
+ set(result, key, toClassName(get(styles$h.base, key), type && get(styles$h[type], key), hasStickyHeader && get(styles$h.sticky, key), hasVerticalSeparators && get(styles$h.separated, key), areControlsVisible && get(styles$h.controlled, key), get(stylesOverrides, key)));
1470
1470
  });
1471
1471
  return result;
1472
1472
  };
@@ -1703,7 +1703,7 @@ var controlled = {
1703
1703
  container: '!flex',
1704
1704
  },
1705
1705
  };
1706
- var styles$g = {
1706
+ var styles$h = {
1707
1707
  base: base$d,
1708
1708
  normal: normal$4,
1709
1709
  panel: panel$1,
@@ -1760,10 +1760,10 @@ var TableList2 = function (props) {
1760
1760
  var _k = useState({}), columnVisibility = _k[0], setColumnVisibility = _k[1];
1761
1761
  var _l = useState([]), columnOrder = _l[0], setColumnOrder = _l[1];
1762
1762
  var handleGenerateStyle = function () {
1763
- var result = deepCopyObject(styles$f.base);
1764
- var keys = calculateNestedKeys(styles$f.base);
1763
+ var result = deepCopyObject(styles$g.base);
1764
+ var keys = calculateNestedKeys(styles$g.base);
1765
1765
  keys.forEach(function (key) {
1766
- set(result, key, toClassName(get(styles$f.base, key),
1766
+ set(result, key, toClassName(get(styles$g.base, key),
1767
1767
  // type && get(defaultStyles[type], key),
1768
1768
  // hasStickyHeader && get(defaultStyles.sticky, key),
1769
1769
  // hasVerticalSeparators && get(defaultStyles.separated, key),
@@ -1956,7 +1956,7 @@ var base$c = {
1956
1956
  },
1957
1957
  foot: '',
1958
1958
  };
1959
- var styles$f = {
1959
+ var styles$g = {
1960
1960
  base: base$c,
1961
1961
  };
1962
1962
 
@@ -1967,10 +1967,10 @@ var createColumnHelper = function () {
1967
1967
  var BreadcrumbsNavigation = function (props) {
1968
1968
  var _a = props.href, href = _a === void 0 ? '/' : _a, pages = props.pages, _b = props.type, type = _b === void 0 ? 'slashes' : _b, customSeparator = props.separator, stylesOverrides = props.styles;
1969
1969
  var handleGenerateStyle = function () {
1970
- var result = deepCopyObject(styles$e.base);
1971
- var keys = calculateNestedKeys(styles$e.base);
1970
+ var result = deepCopyObject(styles$f.base);
1971
+ var keys = calculateNestedKeys(styles$f.base);
1972
1972
  keys.forEach(function (key) {
1973
- set$1(result, key, toClassName(get$1(styles$e.base, key), type && get$1(styles$e[type], key), get$1(stylesOverrides, key)));
1973
+ set$1(result, key, toClassName(get$1(styles$f.base, key), type && get$1(styles$f[type], key), get$1(stylesOverrides, key)));
1974
1974
  });
1975
1975
  return result;
1976
1976
  };
@@ -2091,7 +2091,7 @@ var bar = {
2091
2091
  link: '',
2092
2092
  },
2093
2093
  };
2094
- var styles$e = {
2094
+ var styles$f = {
2095
2095
  base: base$b,
2096
2096
  slashes: slashes,
2097
2097
  chevrons: chevrons,
@@ -2103,10 +2103,10 @@ var PagePaginationNavigation = function (props) {
2103
2103
  var _a = props.min, min = _a === void 0 ? 1 : _a, _b = props.max, max = _b === void 0 ? 20 : _b, stylesOverrides = props.styles, onChange = props.onChange;
2104
2104
  var _c = useState(2), current = _c[0], setCurrent = _c[1];
2105
2105
  var handleGenerateStyle = function () {
2106
- var result = deepCopyObject(styles$d.base);
2107
- var keys = calculateNestedKeys(styles$d.base);
2106
+ var result = deepCopyObject(styles$e.base);
2107
+ var keys = calculateNestedKeys(styles$e.base);
2108
2108
  keys.forEach(function (key) {
2109
- set(result, key, toClassName(get(styles$d.base, key), get(stylesOverrides, key)));
2109
+ set(result, key, toClassName(get(styles$e.base, key), get(stylesOverrides, key)));
2110
2110
  });
2111
2111
  return result;
2112
2112
  };
@@ -2169,7 +2169,7 @@ var base$a = {
2169
2169
  },
2170
2170
  divider: 'inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-gray-500',
2171
2171
  };
2172
- var styles$d = {
2172
+ var styles$e = {
2173
2173
  base: base$a,
2174
2174
  };
2175
2175
 
@@ -2177,10 +2177,10 @@ var Container$1 = function (props) {
2177
2177
  var children = props.children, stylesOverrides = props.styles;
2178
2178
  var _a = useState(''), active = _a[0], setActive = _a[1];
2179
2179
  var handleGenerateStyle = function () {
2180
- var result = deepCopyObject(styles$c.base);
2181
- var keys = calculateNestedKeys(styles$c.base);
2180
+ var result = deepCopyObject(styles$d.base);
2181
+ var keys = calculateNestedKeys(styles$d.base);
2182
2182
  keys.forEach(function (key) {
2183
- set(result, key, toClassName(get(styles$c.base, key), get(stylesOverrides, key)));
2183
+ set(result, key, toClassName(get(styles$d.base, key), get(stylesOverrides, key)));
2184
2184
  });
2185
2185
  return result;
2186
2186
  };
@@ -2190,10 +2190,10 @@ var Container$1 = function (props) {
2190
2190
  var List$1 = function (props) {
2191
2191
  var name = props.name, children = props.children, active = props.active, setActive = props.setActive, stylesOverrides = props.styles;
2192
2192
  var handleGenerateStyle = function () {
2193
- var result = deepCopyObject(styles$c.base);
2194
- var keys = calculateNestedKeys(styles$c.base);
2193
+ var result = deepCopyObject(styles$d.base);
2194
+ var keys = calculateNestedKeys(styles$d.base);
2195
2195
  keys.forEach(function (key) {
2196
- set(result, key, toClassName(get(styles$c.base, key), get(stylesOverrides, key)));
2196
+ set(result, key, toClassName(get(styles$d.base, key), get(stylesOverrides, key)));
2197
2197
  });
2198
2198
  return result;
2199
2199
  };
@@ -2239,10 +2239,10 @@ var List$1 = function (props) {
2239
2239
  var Item$1 = function (props) {
2240
2240
  var children = props.children, _a = props.as, LinkComponent = _a === void 0 ? 'a' : _a, _b = props.type, type = _b === void 0 ? 'underline' : _b, href = props.href, isCurrent = props.isCurrent, onClick = props.onClick, stylesOverrides = props.styles, isLoading = props.isLoading;
2241
2241
  var handleGenerateStyle = function () {
2242
- var result = deepCopyObject(styles$c.base);
2243
- var keys = calculateNestedKeys(styles$c.base);
2242
+ var result = deepCopyObject(styles$d.base);
2243
+ var keys = calculateNestedKeys(styles$d.base);
2244
2244
  keys.forEach(function (key) {
2245
- set(result, key, toClassName(get(styles$c.base, key), type && get(styles$c[type], key), get(stylesOverrides, key)));
2245
+ set(result, key, toClassName(get(styles$d.base, key), type && get(styles$d[type], key), get(stylesOverrides, key)));
2246
2246
  });
2247
2247
  return result;
2248
2248
  };
@@ -2300,7 +2300,7 @@ var buttons = {
2300
2300
  inactive: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300',
2301
2301
  },
2302
2302
  };
2303
- var styles$c = {
2303
+ var styles$d = {
2304
2304
  base: base$9,
2305
2305
  underline: underline,
2306
2306
  pills: pills,
@@ -2328,11 +2328,11 @@ var List = function (props) {
2328
2328
  setActive && setActive(tab === null || tab === void 0 ? void 0 : tab.props.accessor);
2329
2329
  // eslint-disable-next-line react-hooks/exhaustive-deps
2330
2330
  }, []);
2331
- return (jsx("nav", { className: toClassName(styles$b.list, stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.list), children: children }));
2331
+ return (jsx("nav", { className: toClassName(styles$c.list, stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.list), children: children }));
2332
2332
  };
2333
2333
  var Item = function (props) {
2334
2334
  var children = props.children, href = props.href, isCurrent = props.isCurrent, _a = props.linkComponent, LinkComponent = _a === void 0 ? 'a' : _a, onClick = props.onClick;
2335
- return (jsx(LinkComponent, { href: href, className: toClassName(styles$b.item[isCurrent ? 'active' : 'notActive'], styles$b.item.base), onClick: onClick, children: children }));
2335
+ return (jsx(LinkComponent, { href: href, className: toClassName(styles$c.item[isCurrent ? 'active' : 'notActive'], styles$c.item.base), onClick: onClick, children: children }));
2336
2336
  };
2337
2337
  var View = function (props) {
2338
2338
  var children = props.children;
@@ -2345,7 +2345,7 @@ var VerticalNavigation = {
2345
2345
  View: View,
2346
2346
  };
2347
2347
 
2348
- var styles$b = {
2348
+ var styles$c = {
2349
2349
  container: '',
2350
2350
  list: 'space-y-1',
2351
2351
  item: {
@@ -2363,10 +2363,10 @@ var ModalOverlay = function (props) {
2363
2363
  handleClose: function () { return setIsOpen(false); },
2364
2364
  }); }, []);
2365
2365
  var handleGenerateStyle = function () {
2366
- var result = deepCopyObject(styles$a.base);
2367
- var keys = calculateNestedKeys(styles$a.base);
2366
+ var result = deepCopyObject(styles$b.base);
2367
+ var keys = calculateNestedKeys(styles$b.base);
2368
2368
  keys.forEach(function (key) {
2369
- set(result, key, toClassName(get(styles$a.base, key), size && get(styles$a[size], key), get(stylesOverrides, key)));
2369
+ set(result, key, toClassName(get(styles$b.base, key), size && get(styles$b[size], key), get(stylesOverrides, key)));
2370
2370
  });
2371
2371
  return result;
2372
2372
  };
@@ -2438,7 +2438,7 @@ var xl$2 = {
2438
2438
  container: 'sm:max-w-4xl',
2439
2439
  },
2440
2440
  };
2441
- var styles$a = {
2441
+ var styles$b = {
2442
2442
  base: base$8,
2443
2443
  xs: xs$2,
2444
2444
  sm: sm$2,
@@ -2450,10 +2450,10 @@ var styles$a = {
2450
2450
  var NotificationOverlayContainer = function (_a) {
2451
2451
  var children = _a.children, stylesOverrides = _a.styles;
2452
2452
  var handleGenerateStyle = function () {
2453
- var result = deepCopyObject(styles$9.base);
2454
- var keys = calculateNestedKeys(styles$9.base);
2453
+ var result = deepCopyObject(styles$a.base);
2454
+ var keys = calculateNestedKeys(styles$a.base);
2455
2455
  keys.forEach(function (key) {
2456
- set(result, key, toClassName(get(styles$9.base, key), get(stylesOverrides, key)));
2456
+ set(result, key, toClassName(get(styles$a.base, key), get(stylesOverrides, key)));
2457
2457
  });
2458
2458
  return result;
2459
2459
  };
@@ -2468,10 +2468,10 @@ var NotificationOverlayItem = function (props) {
2468
2468
  onClose: function () { return setIsOpen(false); },
2469
2469
  }); }, []);
2470
2470
  var handleGenerateStyle = function () {
2471
- var result = deepCopyObject(styles$9.base);
2472
- var keys = calculateNestedKeys(styles$9.base);
2471
+ var result = deepCopyObject(styles$a.base);
2472
+ var keys = calculateNestedKeys(styles$a.base);
2473
2473
  keys.forEach(function (key) {
2474
- set(result, key, toClassName(get(styles$9.base, key), size && get(styles$9[size], key), get(stylesOverrides, key)));
2474
+ set(result, key, toClassName(get(styles$a.base, key), size && get(styles$a[size], key), get(stylesOverrides, key)));
2475
2475
  });
2476
2476
  return result;
2477
2477
  };
@@ -2543,7 +2543,7 @@ var xl$1 = {
2543
2543
  },
2544
2544
  },
2545
2545
  };
2546
- var styles$9 = {
2546
+ var styles$a = {
2547
2547
  base: base$7,
2548
2548
  xs: xs$1,
2549
2549
  sm: sm$1,
@@ -2560,10 +2560,10 @@ var SlideOverOverlay = function (props) {
2560
2560
  handleClose: function () { return setIsOpen(false); },
2561
2561
  }); }, []);
2562
2562
  var handleGenerateStyle = function () {
2563
- var result = deepCopyObject(styles$8.base);
2564
- var keys = calculateNestedKeys(styles$8.base);
2563
+ var result = deepCopyObject(styles$9.base);
2564
+ var keys = calculateNestedKeys(styles$9.base);
2565
2565
  keys.forEach(function (key) {
2566
- set(result, key, toClassName(get(styles$8.base, key), size && get(styles$8[size], key), get(stylesOverrides, key)));
2566
+ set(result, key, toClassName(get(styles$9.base, key), size && get(styles$9[size], key), get(stylesOverrides, key)));
2567
2567
  });
2568
2568
  return result;
2569
2569
  };
@@ -2626,7 +2626,7 @@ var xl = {
2626
2626
  container: 'sm:max-w-4xl',
2627
2627
  },
2628
2628
  };
2629
- var styles$8 = {
2629
+ var styles$9 = {
2630
2630
  base: base$6,
2631
2631
  xs: xs,
2632
2632
  sm: sm,
@@ -2650,10 +2650,10 @@ var TableColumnOptionsCustom = function (props) {
2650
2650
  setColumnOrder(ids);
2651
2651
  }, []);
2652
2652
  var handleGenerateStyle = function () {
2653
- var result = deepCopyObject(styles$7);
2654
- var keys = calculateNestedKeys(styles$7);
2653
+ var result = deepCopyObject(styles$8);
2654
+ var keys = calculateNestedKeys(styles$8);
2655
2655
  keys.forEach(function (key) {
2656
- set(result, key, toClassName(get(styles$7, key), get(stylesOverrides, key)));
2656
+ set(result, key, toClassName(get(styles$8, key), get(stylesOverrides, key)));
2657
2657
  });
2658
2658
  return result;
2659
2659
  };
@@ -2675,7 +2675,7 @@ var TableColumnOptionsCustom = function (props) {
2675
2675
  })] })] }));
2676
2676
  };
2677
2677
 
2678
- var styles$7 = {
2678
+ var styles$8 = {
2679
2679
  controls: {
2680
2680
  container: 'flex-row justify-between z-10 relative mb-4 gap-2 hidden',
2681
2681
  content: 'absolute rounded-md z-20 bg-white w-fit -translate-x-1/2 my-2 flex flex-col border-[1px]',
@@ -2724,10 +2724,10 @@ var DateMenuForm = function (props) {
2724
2724
  }, 50);
2725
2725
  }, [onBlur, onChange]);
2726
2726
  var handleGenerateStyle = function () {
2727
- var result = deepCopyObject(styles$6.base);
2728
- var keys = calculateNestedKeys(styles$6.base);
2727
+ var result = deepCopyObject(styles$7.base);
2728
+ var keys = calculateNestedKeys(styles$7.base);
2729
2729
  keys.forEach(function (key) {
2730
- set(result, key, toClassName(get(styles$6.base, key), type && get(styles$6[type], key), isTouched === true && !isValid && get(styles$6.invalid, key), isDisabled && get(styles$6.disabled, key), get(stylesOverrides, key)));
2730
+ set(result, key, toClassName(get(styles$7.base, key), type && get(styles$7[type], key), isTouched === true && !isValid && get(styles$7.invalid, key), isDisabled && get(styles$7.disabled, key), get(stylesOverrides, key)));
2731
2731
  });
2732
2732
  return result;
2733
2733
  };
@@ -2852,7 +2852,7 @@ var invalid$3 = {
2852
2852
  var disabled$5 = {
2853
2853
  input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
2854
2854
  };
2855
- var styles$6 = {
2855
+ var styles$7 = {
2856
2856
  base: base$5,
2857
2857
  leading: leading$3,
2858
2858
  trailing: trailing$3,
@@ -2868,12 +2868,12 @@ var styles$6 = {
2868
2868
  var CheckboxInputGroupForm = function (props) {
2869
2869
  var name = props.name, form = props.form, options = props.options, values = props.values, isDisabled = props.isDisabled, stylesOverrides = props.styles;
2870
2870
  var handleGenerateStyle = function () {
2871
- var result = deepCopyObject(styles$5.base);
2872
- var keys = calculateNestedKeys(styles$5.base);
2871
+ var result = deepCopyObject(styles$6.base);
2872
+ var keys = calculateNestedKeys(styles$6.base);
2873
2873
  keys.forEach(function (key) {
2874
- set(result, key, toClassName(get(styles$5.base, key),
2874
+ set(result, key, toClassName(get(styles$6.base, key),
2875
2875
  // isTouched === true && !isValid && get(defaultStyles.invalid, key),
2876
- isDisabled && get(styles$5.disabled, key), get(stylesOverrides, key)));
2876
+ isDisabled && get(styles$6.disabled, key), get(stylesOverrides, key)));
2877
2877
  });
2878
2878
  return result;
2879
2879
  };
@@ -2910,7 +2910,7 @@ var disabled$4 = {
2910
2910
  input: 'block rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
2911
2911
  },
2912
2912
  };
2913
- var styles$5 = {
2913
+ var styles$6 = {
2914
2914
  base: base$4,
2915
2915
  disabled: disabled$4,
2916
2916
  };
@@ -2918,12 +2918,10 @@ var styles$5 = {
2918
2918
  var CheckboxInputForm = function (props) {
2919
2919
  var name = props.name, value = props.value, title = props.title, description = props.description, isIndeterminable = props.isIndeterminable, isDisabled = props.isDisabled, onChange = props.onChange, stylesOverrides = props.styles;
2920
2920
  var handleGenerateStyle = function () {
2921
- var result = deepCopyObject(styles$4.base);
2922
- var keys = calculateNestedKeys(styles$4.base);
2921
+ var result = deepCopyObject(styles$5.base);
2922
+ var keys = calculateNestedKeys(styles$5.base);
2923
2923
  keys.forEach(function (key) {
2924
- set(result, key, toClassName(get(styles$4.base, key),
2925
- // isTouched === true && !isValid && get(defaultStyles.invalid, key),
2926
- isDisabled && get(styles$4.disabled, key), get(stylesOverrides, key)));
2924
+ set(result, key, toClassName(get(styles$5.base, key), isDisabled && get(styles$5.disabled, key), get(stylesOverrides, key)));
2927
2925
  });
2928
2926
  return result;
2929
2927
  };
@@ -2952,7 +2950,7 @@ var CheckboxInputForm = function (props) {
2952
2950
  inputRef.current.indeterminate = value === null;
2953
2951
  }
2954
2952
  }, [isIndeterminable, value]);
2955
- return (jsxs("div", { className: styles.container, children: [jsx("div", { className: styles.head, children: jsx("input", { ref: inputRef, name: name, "data-cy": "form-".concat(name, "-checkbox"), "aria-describedby": "".concat(name, "-description"), type: "checkbox", checked: !!value, className: styles.input, disabled: isDisabled, onChange: handleToggle }) }), jsxs("div", { className: styles.body, children: [jsx("label", { htmlFor: "comments", className: styles.label, children: title }), description && (jsx("p", { id: "comments-description", className: styles.description, children: description }))] })] }));
2953
+ return (jsxs("div", { className: styles.container, children: [jsx("div", { className: styles.head, children: jsx("input", { ref: inputRef, name: name, "data-cy": "form-".concat(name, "-checkbox"), "aria-describedby": "".concat(name, "-description"), type: "checkbox", checked: !!value, className: styles.input, disabled: isDisabled, onChange: handleToggle }) }), jsxs("div", { className: styles.body, children: [jsx("label", { htmlFor: name, className: styles.label, children: title }), description && (jsx("p", { id: "".concat(name, "-description"), className: styles.description, children: description }))] })] }));
2956
2954
  };
2957
2955
 
2958
2956
  var base$3 = {
@@ -2966,11 +2964,55 @@ var base$3 = {
2966
2964
  var disabled$3 = {
2967
2965
  input: 'block rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-500 disabled:text-gray-500 disabled:ring-gray-200',
2968
2966
  };
2969
- var styles$4 = {
2967
+ var styles$5 = {
2970
2968
  base: base$3,
2971
2969
  disabled: disabled$3,
2972
2970
  };
2973
2971
 
2972
+ var Switch = function (props) {
2973
+ var name = props.name, label = props.label, description = props.description, isDisabled = props.isDisabled, _a = props.isRequired, isRequired = _a === void 0 ? false : _a, required = props.required, _b = props.isTouched, isTouched = _b === void 0 ? false : _b, error = props.error, value = props.value, stylesOverrides = props.styles, onChange = props.onChange, iconAccessorChecked = props.iconAccessorChecked, iconAccessorUnchecked = props.iconAccessorUnchecked;
2974
+ var inputDataCy = "form-input-".concat(name);
2975
+ var errorDataCy = "form-input-error-".concat(name);
2976
+ var handleGenerateStyle = function () {
2977
+ var result = deepCopyObject(styles$4);
2978
+ var keys = calculateNestedKeys(styles$4);
2979
+ forEach(keys, function (key) {
2980
+ set(result, key, toClassName(get(styles$4, key), get(stylesOverrides, key)));
2981
+ });
2982
+ return result;
2983
+ };
2984
+ var styles = handleGenerateStyle();
2985
+ return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsx("div", { className: styles.container, children: jsx("div", { "data-cy": inputDataCy, children: jsxs(Switch$1, { checked: value, disabled: isDisabled, onChange: function (value) { return delay(function () { return onChange(value); }, 200); }, className: toClassName(styles.switch.base, value ? styles.switch.checked : styles.switch.unchecked, isDisabled && styles.switch.disabled), children: [jsxs("span", { className: styles.switch.screenreader, children: ["Switch setting for ", name] }), jsx("span", { className: toClassName(styles.toggle.base, value ? styles.toggle.checked : styles.toggle.unchecked), children: iconAccessorChecked && iconAccessorUnchecked && (jsxs(Fragment$1, { children: [jsx("span", { className: toClassName(value ? styles.icon.hidden : styles.icon.shown, styles.icon.base), "aria-hidden": "true", children: jsx(IconElement, { accessor: iconAccessorUnchecked, className: styles.icon.icon }) }), jsx("span", { className: toClassName(value ? styles.icon.shown : styles.icon.hidden, styles.icon.base), "aria-hidden": "true", children: jsx(IconElement, { accessor: iconAccessorChecked, className: styles.icon.icon }) })] })) })] }) }) }), jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && (jsx("p", { className: styles.error, "data-cy": errorDataCy, children: error }))] })] }));
2986
+ };
2987
+
2988
+ var styles$4 = {
2989
+ label: 'block font-medium text-gray-900 leading-6 text-sm mb-2 mr-1',
2990
+ container: '',
2991
+ head: 'flex justify-between',
2992
+ hint: 'text-xs text-gray-500',
2993
+ foot: '',
2994
+ description: 'text-gray-400 text-xs mt-1',
2995
+ switch: {
2996
+ base: 'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out',
2997
+ screenreader: 'sr-only',
2998
+ checked: 'bg-primary-600 focus:outline-none focus:ring-0 focus:ring-primary-600 focus:ring-offset-2',
2999
+ unchecked: 'bg-gray-200 focus:outline-none focus:ring-0 focus:ring-primary-600 focus:ring-offset-2',
3000
+ disabled: 'opacity-50 !cursor-not-allowed',
3001
+ },
3002
+ toggle: {
3003
+ base: 'pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out',
3004
+ checked: 'translate-x-5',
3005
+ unchecked: 'translate-x-0',
3006
+ },
3007
+ icon: {
3008
+ base: 'absolute inset-0 flex h-full w-full items-center justify-center transition-opacity',
3009
+ hidden: 'opacity-0 ease-out duration-100',
3010
+ shown: 'opacity-100 ease-in duration-200',
3011
+ icon: 'h-3 w-3',
3012
+ },
3013
+ error: 'text-red-500 text-xs ml-0 mt-2',
3014
+ };
3015
+
2974
3016
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2975
3017
 
2976
3018
  function getDefaultExportFromCjs (x) {
@@ -9738,7 +9780,7 @@ var OpeningHourItem = function (props) {
9738
9780
  };
9739
9781
  onUpdate && onUpdate(params);
9740
9782
  }
9741
- } }), jsxs("div", { className: "flex flex-col", children: [jsx("p", { className: "text-xs font-medium pb-1 mt-4", children: "Closed" }), jsxs(Switch, { checked: form.values.closed, onChange: function () {
9783
+ } }), jsxs("div", { className: "flex flex-col", children: [jsx("p", { className: "text-xs font-medium pb-1 mt-4", children: "Closed" }), jsxs(Switch$1, { checked: form.values.closed, onChange: function () {
9742
9784
  var _a, _b, _c, _d;
9743
9785
  form.setFieldValue('closed', !form.values.closed);
9744
9786
  if (!isCreating) {
@@ -10962,5 +11004,5 @@ var styles = {
10962
11004
  disabled: disabled,
10963
11005
  };
10964
11006
 
10965
- export { AddressInputGroupForm, BadgeElement$1 as AlertElement, AvatarElement, BadgeElement, BreadcrumbsNavigation, ButtonElement, ButtonGroupElement, CheckboxInputForm as CheckboxInput, ContainerLayout, DateMenuForm, DividerLayout, DropdownElement, FileInputGroupForm, IconElement, InputGroupForm, ListContainerLayout, MediaObjectLayout, ModalOverlay, NotificationOverlay, OpeningsHourInputGroupForm, PagePaginationNavigation, LayoutPanel as PanelLayout, PanelPaginationNavigation, SelectMenuForm, SlideOverOverlay, TabNavigation, TableColumnOptionsCustom, TableExcelExportCustom as TableExportCustom, TableList, TableList2, VerticalNavigation, CheckboxInputGroupForm as __DEPRECATED__CheckboxInputGroupForm, createColumnHelper, fromSelectMenuOptionToStringValue, useExcel };
11007
+ export { AddressInputGroupForm, BadgeElement$1 as AlertElement, AvatarElement, BadgeElement, BreadcrumbsNavigation, ButtonElement, ButtonGroupElement, CheckboxInputForm as CheckboxInput, ContainerLayout, DateMenuForm, DividerLayout, DropdownElement, FileInputGroupForm, IconElement, InputGroupForm, ListContainerLayout, MediaObjectLayout, ModalOverlay, NotificationOverlay, OpeningsHourInputGroupForm, PagePaginationNavigation, LayoutPanel as PanelLayout, PanelPaginationNavigation, SelectMenuForm, SlideOverOverlay, Switch as SwitchForm, TabNavigation, TableColumnOptionsCustom, TableExcelExportCustom as TableExportCustom, TableList, TableList2, VerticalNavigation, CheckboxInputGroupForm as __DEPRECATED__CheckboxInputGroupForm, createColumnHelper, fromSelectMenuOptionToStringValue, useExcel };
10966
11008
  //# sourceMappingURL=index.esm.js.map