@helpdice/ui 1.2.8 → 1.2.9

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.
@@ -3,8 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var Select = require('components/select');
7
- var Input = require('components/input');
8
6
  var reactDom = require('react-dom');
9
7
 
10
8
  function _interopNamespaceDefault(e) {
@@ -1089,11 +1087,11 @@ var TableCell = function TableCell(_ref) {
1089
1087
 
1090
1088
  /* "use client" */
1091
1089
 
1092
- var defaultContext$2 = {
1090
+ var defaultContext$3 = {
1093
1091
  columns: [],
1094
1092
  updateColumn: function updateColumn() {}
1095
1093
  };
1096
- var TableContext = /*#__PURE__*/React.createContext(defaultContext$2);
1094
+ var TableContext = /*#__PURE__*/React.createContext(defaultContext$3);
1097
1095
  var useTableContext = function useTableContext() {
1098
1096
  return React.useContext(TableContext);
1099
1097
  };
@@ -18559,7 +18557,7 @@ var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingL
18559
18557
  var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
18560
18558
  return "".concat(scale1x);
18561
18559
  };
18562
- var defaultContext$1 = {
18560
+ var defaultContext$2 = {
18563
18561
  getScaleProps: function getScaleProps() {
18564
18562
  return undefined;
18565
18563
  },
@@ -18585,7 +18583,7 @@ var defaultContext$1 = {
18585
18583
  },
18586
18584
  unit: '16px'
18587
18585
  };
18588
- var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$1);
18586
+ var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$2);
18589
18587
  var useScale = function useScale() {
18590
18588
  return React.useContext(ScaleContext);
18591
18589
  };
@@ -18595,6 +18593,28 @@ var useScale = function useScale() {
18595
18593
  var getId = function getId() {
18596
18594
  return Math.random().toString(32).slice(2, 10);
18597
18595
  };
18596
+ var pickChildByProps = function pickChildByProps(children, key, value) {
18597
+ var target = [];
18598
+ var isArray = Array.isArray(value);
18599
+ var withoutPropChildren = React.Children.map(children, function (item) {
18600
+ if (! /*#__PURE__*/React.isValidElement(item)) return null;
18601
+ if (!item.props) return item;
18602
+ if (isArray) {
18603
+ if (value.includes(item.props[key])) {
18604
+ target.push(item);
18605
+ return null;
18606
+ }
18607
+ return item;
18608
+ }
18609
+ if (item.props[key] === value) {
18610
+ target.push(item);
18611
+ return null;
18612
+ }
18613
+ return item;
18614
+ });
18615
+ var targetChildren = target.length >= 0 ? target : undefined;
18616
+ return [withoutPropChildren, targetChildren];
18617
+ };
18598
18618
  var isBrowser = function isBrowser() {
18599
18619
  return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
18600
18620
  };
@@ -18648,7 +18668,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
18648
18668
  return getAllScaleProps;
18649
18669
  };
18650
18670
 
18651
- var _excluded$9 = ["children"];
18671
+ var _excluded$e = ["children"];
18652
18672
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
18653
18673
  if (scale === 1) return scale;
18654
18674
  var diff = Math.abs((scale - 1) / 2);
@@ -18658,7 +18678,7 @@ var withScale = function withScale(Render) {
18658
18678
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18659
18679
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
18660
18680
  var children = _ref.children,
18661
- props = _objectWithoutProperties(_ref, _excluded$9);
18681
+ props = _objectWithoutProperties(_ref, _excluded$e);
18662
18682
  var _useTheme = useTheme(),
18663
18683
  layout = _useTheme.layout;
18664
18684
  var paddingLeft = props.paddingLeft,
@@ -18743,7 +18763,7 @@ var withScale = function withScale(Render) {
18743
18763
 
18744
18764
  var warningStack = {};
18745
18765
  var useWarning = function useWarning(message, component) {
18746
- var tag = " [".concat(component, "]") ;
18766
+ var tag = component ? " [".concat(component, "]") : ' ';
18747
18767
  var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
18748
18768
  if (typeof console === 'undefined') return;
18749
18769
  if (warningStack[log]) return;
@@ -18795,99 +18815,1459 @@ var TableColumn = function TableColumn(columnProps) {
18795
18815
  };
18796
18816
  TableColumn.displayName = 'TableColumn';
18797
18817
 
18798
- var _excluded$8 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "showFilters", "onSelected", "className", "rowClassName"];
18799
- function TableComponent(tableProps) {
18800
- /* eslint-disable @typescript-eslint/no-unused-vars */
18801
- var _ref = tableProps,
18802
- children = _ref.children,
18803
- customData = _ref.data,
18804
- _ref$initialData = _ref.initialData,
18805
- initialData = _ref$initialData === undefined ? [] : _ref$initialData,
18806
- _ref$hover = _ref.hover,
18807
- hover = _ref$hover === undefined ? true : _ref$hover,
18808
- _ref$emptyText = _ref.emptyText,
18809
- emptyText = _ref$emptyText === undefined ? '' : _ref$emptyText,
18810
- _ref$rowDraggable = _ref.rowDraggable,
18811
- rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
18812
- _ref$readOnly = _ref.readOnly,
18813
- readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
18814
- onRow = _ref.onRow,
18815
- onCell = _ref.onCell;
18816
- _ref.onChange;
18817
- var onFilters = _ref.onFilters,
18818
- _ref$showFilters = _ref.showFilters,
18819
- showFilters = _ref$showFilters === undefined ? false : _ref$showFilters,
18820
- onSelected = _ref.onSelected,
18818
+ var useCurrentState = function useCurrentState(initialState) {
18819
+ var _useState = React.useState(function () {
18820
+ return typeof initialState === 'function' ? initialState() : initialState;
18821
+ }),
18822
+ _useState2 = _slicedToArray(_useState, 2),
18823
+ state = _useState2[0],
18824
+ setState = _useState2[1];
18825
+ var ref = React.useRef(initialState);
18826
+ React.useEffect(function () {
18827
+ ref.current = state;
18828
+ }, [state]);
18829
+ var setValue = function setValue(val) {
18830
+ var result = typeof val === 'function' ? val(ref.current) : val;
18831
+ ref.current = result;
18832
+ setState(result);
18833
+ };
18834
+ return [state, setValue, ref];
18835
+ };
18836
+
18837
+ var SelectIconComponent = function SelectIconComponent() {
18838
+ return /*#__PURE__*/React.createElement("svg", {
18839
+ viewBox: "0 0 24 24",
18840
+ strokeWidth: "1",
18841
+ strokeLinecap: "round",
18842
+ strokeLinejoin: "round",
18843
+ fill: "none",
18844
+ shapeRendering: "geometricPrecision",
18845
+ className: "jsx-2742933678"
18846
+ }, /*#__PURE__*/React.createElement("path", {
18847
+ d: "M6 9l6 6 6-6",
18848
+ className: "jsx-2742933678"
18849
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
18850
+ id: "2742933678"
18851
+ }, "svg.jsx-2742933678{color:inherit;stroke:currentColor;-webkit-transition:all 200ms ease;transition:all 200ms ease;width:1.214em;height:1.214em;}"));
18852
+ };
18853
+ SelectIconComponent.displayName = 'GeistSelectIcon';
18854
+ var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
18855
+
18856
+ /* "use client" */
18857
+
18858
+ var defaultContext$1 = {
18859
+ visible: false,
18860
+ disableAll: false
18861
+ };
18862
+ var SelectContext = /*#__PURE__*/React.createContext(defaultContext$1);
18863
+ var useSelectContext = function useSelectContext() {
18864
+ return React.useContext(SelectContext);
18865
+ };
18866
+
18867
+ var useSSR = function useSSR() {
18868
+ var _useState = React.useState(false),
18869
+ _useState2 = _slicedToArray(_useState, 2),
18870
+ browser = _useState2[0],
18871
+ setBrowser = _useState2[1];
18872
+ React.useEffect(function () {
18873
+ setBrowser(isBrowser());
18874
+ }, []);
18875
+ return {
18876
+ isBrowser: browser,
18877
+ isServer: !browser
18878
+ };
18879
+ };
18880
+
18881
+ var createElement = function createElement(id) {
18882
+ var el = document.createElement('div');
18883
+ el.setAttribute('id', id);
18884
+ return el;
18885
+ };
18886
+ var usePortal = function usePortal() {
18887
+ var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
18888
+ var getContainer = arguments.length > 1 ? arguments[1] : undefined;
18889
+ var id = "helpdice-ui-".concat(selectId);
18890
+ var _useSSR = useSSR(),
18891
+ isBrowser = _useSSR.isBrowser;
18892
+ var _useState = React.useState(isBrowser ? createElement(id) : null),
18893
+ _useState2 = _slicedToArray(_useState, 2),
18894
+ elSnapshot = _useState2[0],
18895
+ setElSnapshot = _useState2[1];
18896
+ React.useEffect(function () {
18897
+ var customContainer = getContainer ? getContainer() : null;
18898
+ var parentElement = customContainer || document.body;
18899
+ var hasElement = parentElement.querySelector("#".concat(id));
18900
+ var el = hasElement || createElement(id);
18901
+ if (!hasElement) {
18902
+ parentElement.appendChild(el);
18903
+ }
18904
+ setElSnapshot(el);
18905
+ }, []);
18906
+ return elSnapshot;
18907
+ };
18908
+
18909
+ var _excluded$d = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
18910
+ var CssTransition = function CssTransition(_ref) {
18911
+ var children = _ref.children,
18821
18912
  _ref$className = _ref.className,
18822
18913
  className = _ref$className === undefined ? '' : _ref$className,
18823
- _ref$rowClassName = _ref.rowClassName,
18824
- rowClassName = _ref$rowClassName === undefined ? function () {
18825
- return '';
18826
- } : _ref$rowClassName,
18827
- props = _objectWithoutProperties(_ref, _excluded$8);
18828
- /* eslint-enable @typescript-eslint/no-unused-vars */
18829
- var _useScale = useScale(),
18830
- SCALES = _useScale.SCALES;
18831
- var ref = React.useRef(null);
18832
- var _useRealShape = useRealShape(ref),
18833
- _useRealShape2 = _slicedToArray(_useRealShape, 2),
18834
- width = _useRealShape2[0].width,
18835
- updateShape = _useRealShape2[1];
18836
- var _useState = React.useState([]),
18914
+ _ref$visible = _ref.visible,
18915
+ visible = _ref$visible === undefined ? false : _ref$visible,
18916
+ _ref$enterTime = _ref.enterTime,
18917
+ enterTime = _ref$enterTime === undefined ? 60 : _ref$enterTime,
18918
+ _ref$leaveTime = _ref.leaveTime,
18919
+ leaveTime = _ref$leaveTime === undefined ? 60 : _ref$leaveTime,
18920
+ _ref$clearTime = _ref.clearTime,
18921
+ clearTime = _ref$clearTime === undefined ? 60 : _ref$clearTime,
18922
+ _ref$name = _ref.name,
18923
+ name = _ref$name === undefined ? 'transition' : _ref$name,
18924
+ props = _objectWithoutProperties(_ref, _excluded$d);
18925
+ var _useState = React.useState(''),
18837
18926
  _useState2 = _slicedToArray(_useState, 2),
18838
- columns = _useState2[0],
18839
- setColumns = _useState2[1];
18840
- var _useState3 = React.useState(initialData),
18927
+ classes = _useState2[0],
18928
+ setClasses = _useState2[1];
18929
+ var _useState3 = React.useState(visible),
18841
18930
  _useState4 = _slicedToArray(_useState3, 2),
18842
- data = _useState4[0],
18843
- setData = _useState4[1];
18844
- var updateColumn = function updateColumn(column) {
18845
- setColumns(function (last) {
18846
- var hasColumn = last.find(function (item) {
18847
- return item.prop === column.prop;
18848
- });
18849
- if (!hasColumn) return [].concat(_toConsumableArray(last), [column]);
18850
- return last.map(function (item) {
18851
- if (item.prop !== column.prop) return item;
18852
- return column;
18853
- });
18854
- });
18855
- };
18856
- var contextValue = React.useMemo(function () {
18857
- return {
18858
- columns: columns,
18859
- updateColumn: updateColumn
18931
+ renderable = _useState4[0],
18932
+ setRenderable = _useState4[1];
18933
+ React.useEffect(function () {
18934
+ var statusClassName = visible ? 'enter' : 'leave';
18935
+ var time = visible ? enterTime : leaveTime;
18936
+ if (visible && !renderable) {
18937
+ setRenderable(true);
18938
+ }
18939
+ setClasses("".concat(name, "-").concat(statusClassName));
18940
+
18941
+ // set class to active
18942
+ var timer = setTimeout(function () {
18943
+ setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
18944
+ clearTimeout(timer);
18945
+ }, time);
18946
+
18947
+ // remove classess when animation over
18948
+ var clearClassesTimer = setTimeout(function () {
18949
+ if (!visible) {
18950
+ setClasses('');
18951
+ setRenderable(false);
18952
+ }
18953
+ clearTimeout(clearClassesTimer);
18954
+ }, time + clearTime);
18955
+ return function () {
18956
+ clearTimeout(timer);
18957
+ clearTimeout(clearClassesTimer);
18860
18958
  };
18861
- }, [columns]);
18862
- var _React$useState = React.useState({}),
18863
- _React$useState2 = _slicedToArray(_React$useState, 2),
18864
- filters = _React$useState2[0],
18865
- setFilters = _React$useState2[1];
18959
+ }, [visible, renderable]);
18960
+ if (! /*#__PURE__*/React.isValidElement(children) || !renderable) return null;
18961
+ var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
18962
+ className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
18963
+ });
18964
+ return /*#__PURE__*/React.cloneElement(children, propsTransition);
18965
+ };
18966
+ CssTransition.displayName = 'CssTransition';
18967
+
18968
+ /* "use client" */
18969
+
18970
+ var useClickAnyWhere = function useClickAnyWhere(handler) {
18866
18971
  React.useEffect(function () {
18867
- if (typeof customData === 'undefined') return;
18868
- setData(customData);
18869
- }, [customData]);
18870
- useResize(function () {
18871
- return updateShape();
18972
+ var callback = function callback(event) {
18973
+ return handler(event);
18974
+ };
18975
+ document.addEventListener('click', callback);
18976
+ return function () {
18977
+ return document.removeEventListener('click', callback);
18978
+ };
18979
+ }, [handler]);
18980
+ };
18981
+
18982
+ /* "use client" */
18983
+
18984
+ var useDOMObserver = function useDOMObserver(ref) {
18985
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
18986
+ var config = {
18987
+ attributes: false,
18988
+ childList: true,
18989
+ subtree: true
18990
+ };
18991
+ React.useEffect(function () {
18992
+ if (!ref || !ref.current) return;
18993
+ var unmount = false;
18994
+ var done = function done() {
18995
+ if (unmount) return;
18996
+ callback.apply(undefined, arguments);
18997
+ };
18998
+ var observer = new MutationObserver(done);
18999
+ observer.observe(ref.current, config);
19000
+ return function () {
19001
+ unmount = true;
19002
+ observer.disconnect();
19003
+ };
19004
+ }, [ref]);
19005
+ };
19006
+
19007
+ var getElementOffset = function getElementOffset(el) {
19008
+ if (!el) return {
19009
+ top: 0,
19010
+ left: 0
19011
+ };
19012
+ var _el$getBoundingClient = el.getBoundingClientRect(),
19013
+ top = _el$getBoundingClient.top,
19014
+ left = _el$getBoundingClient.left;
19015
+ return {
19016
+ top: top,
19017
+ left: left
19018
+ };
19019
+ };
19020
+ var defaultRect$2 = {
19021
+ top: -1e3,
19022
+ left: -1e3,
19023
+ right: -1e3,
19024
+ width: 0,
19025
+ height: 0,
19026
+ elementTop: -1e3
19027
+ };
19028
+ var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
19029
+ if (!domRect) return defaultRect$2;
19030
+ var container = getContainer ? getContainer() : null;
19031
+ var scrollElement = container || document.documentElement;
19032
+ var _getElementOffset = getElementOffset(container),
19033
+ offsetTop = _getElementOffset.top,
19034
+ offsetLeft = _getElementOffset.left;
19035
+ return _objectSpread2(_objectSpread2({}, domRect), {}, {
19036
+ width: domRect.width || domRect.right - domRect.left,
19037
+ height: domRect.height || domRect.top - domRect.bottom,
19038
+ top: domRect.bottom + scrollElement.scrollTop - offsetTop,
19039
+ left: domRect.left + scrollElement.scrollLeft - offsetLeft,
19040
+ elementTop: domRect.top + scrollElement.scrollTop - offsetTop
18872
19041
  });
18873
- var handleFilterChange = function handleFilterChange(name, value) {
18874
- setFilters(function (prevFilters) {
18875
- var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
18876
- // Call onFiltersChange to propagate filter changes to the parent
18877
- if (onFilters) {
18878
- onFilters(updatedFilters);
19042
+ };
19043
+ var getRefRect = function getRefRect(ref, getContainer) {
19044
+ if (!ref || !ref.current) return defaultRect$2;
19045
+ var rect = ref.current.getBoundingClientRect();
19046
+ return getRectFromDOMWithContainer(rect, getContainer);
19047
+ };
19048
+
19049
+ var defaultRect$1 = {
19050
+ top: -1e3,
19051
+ left: -1e3,
19052
+ right: -1e3,
19053
+ width: 0
19054
+ };
19055
+ var Dropdown = /*#__PURE__*/React.memo(function (_ref) {
19056
+ var children = _ref.children,
19057
+ parent = _ref.parent,
19058
+ visible = _ref.visible,
19059
+ disableMatchWidth = _ref.disableMatchWidth,
19060
+ getPopupContainer = _ref.getPopupContainer;
19061
+ var el = usePortal('dropdown', getPopupContainer);
19062
+ var _useState = React.useState(defaultRect$1),
19063
+ _useState2 = _slicedToArray(_useState, 2),
19064
+ rect = _useState2[0],
19065
+ setRect = _useState2[1];
19066
+ var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
19067
+ if (!parent) return null;
19068
+
19069
+ /* istanbul ignore next */
19070
+ if (process.env.NODE_ENV !== 'production') {
19071
+ if (getPopupContainer && getPopupContainer()) {
19072
+ var _el = getPopupContainer();
19073
+ var style = window.getComputedStyle(_el);
19074
+ if (style.position === 'static') {
19075
+ useWarning('The element specified by "getPopupContainer" must have "position" set.');
18879
19076
  }
18880
- return updatedFilters;
19077
+ }
19078
+ }
19079
+ var updateRect = function updateRect() {
19080
+ var _getRefRect = getRefRect(parent, getPopupContainer),
19081
+ top = _getRefRect.top,
19082
+ left = _getRefRect.left,
19083
+ right = _getRefRect.right,
19084
+ nativeWidth = _getRefRect.width;
19085
+ setRect({
19086
+ top: top,
19087
+ left: left,
19088
+ right: right,
19089
+ width: nativeWidth
18881
19090
  });
18882
19091
  };
18883
- var generateFilterInputs = function generateFilterInputs() {
18884
- return columns.map(function (col) {
18885
- var _String, _filters$filterName;
18886
- var Header = col.label,
18887
- accessor = col.filter,
18888
- options = col.options;
18889
- var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
18890
- var unq_accessor = _.uniqueId(filterName);
19092
+ useResize(updateRect);
19093
+ useClickAnyWhere(function () {
19094
+ var _getRefRect2 = getRefRect(parent, getPopupContainer),
19095
+ top = _getRefRect2.top,
19096
+ left = _getRefRect2.left;
19097
+ var shouldUpdatePosition = top !== rect.top || left !== rect.left;
19098
+ if (!shouldUpdatePosition) return;
19099
+ updateRect();
19100
+ });
19101
+ useDOMObserver(parent, function () {
19102
+ updateRect();
19103
+ });
19104
+ React.useEffect(function () {
19105
+ if (!parent || !parent.current) return;
19106
+ parent.current.addEventListener('mouseenter', updateRect);
19107
+ /* istanbul ignore next */
19108
+ return function () {
19109
+ if (!parent || !parent.current) return;
19110
+ parent.current.removeEventListener('mouseenter', updateRect);
19111
+ };
19112
+ }, [parent]);
19113
+ var clickHandler = function clickHandler(event) {
19114
+ event.stopPropagation();
19115
+ event.nativeEvent.stopImmediatePropagation();
19116
+ event.preventDefault();
19117
+ };
19118
+ var mouseDownHandler = function mouseDownHandler(event) {
19119
+ event.preventDefault();
19120
+ };
19121
+ if (!el) return null;
19122
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CssTransition, {
19123
+ visible: visible
19124
+ }, /*#__PURE__*/React.createElement("div", {
19125
+ onClick: clickHandler,
19126
+ onMouseDown: mouseDownHandler,
19127
+ className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
19128
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
19129
+ id: "1644673105",
19130
+ dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
19131
+ }, ".dropdown.__jsx-style-dynamic-selector{position:absolute;top:".concat(rect.top + 2, "px;left:").concat(rect.left, "px;z-index:1100;}.width-match.__jsx-style-dynamic-selector{width:").concat(rect.width, "px;}.disable-match.__jsx-style-dynamic-selector{min-width:").concat(rect.width, "px;}")))), el);
19132
+ });
19133
+
19134
+ var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef) {
19135
+ var visible = _ref.visible,
19136
+ children = _ref.children,
19137
+ _ref$className = _ref.className,
19138
+ className = _ref$className === undefined ? '' : _ref$className,
19139
+ _ref$dropdownStyle = _ref.dropdownStyle,
19140
+ dropdownStyle = _ref$dropdownStyle === undefined ? {} : _ref$dropdownStyle,
19141
+ disableMatchWidth = _ref.disableMatchWidth,
19142
+ getPopupContainer = _ref.getPopupContainer;
19143
+ var theme = useTheme();
19144
+ var internalDropdownRef = React.useRef(null);
19145
+ var _useSelectContext = useSelectContext(),
19146
+ ref = _useSelectContext.ref;
19147
+ var classes = useClasses('select-dropdown', className);
19148
+ React.useImperativeHandle(dropdownRef, function () {
19149
+ return internalDropdownRef.current;
19150
+ });
19151
+ return /*#__PURE__*/React.createElement(Dropdown, {
19152
+ parent: ref,
19153
+ visible: visible,
19154
+ disableMatchWidth: disableMatchWidth,
19155
+ getPopupContainer: getPopupContainer
19156
+ }, /*#__PURE__*/React.createElement("div", {
19157
+ ref: internalDropdownRef,
19158
+ style: dropdownStyle,
19159
+ className: _JSXStyle.dynamic([["2782510679", [theme.layout.radius, theme.expressiveness.shadowLarge, theme.palette.background]]]) + " " + (classes || "")
19160
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
19161
+ id: "2782510679",
19162
+ dynamic: [theme.layout.radius, theme.expressiveness.shadowLarge, theme.palette.background]
19163
+ }, ".select-dropdown.__jsx-style-dynamic-selector{border-radius:".concat(theme.layout.radius, ";box-shadow:").concat(theme.expressiveness.shadowLarge, ";background-color:").concat(theme.palette.background, ";max-height:17em;overflow-y:auto;overflow-anchor:none;padding:0.38em 0;-webkit-scroll-behavior:smooth;-moz-scroll-behavior:smooth;-ms-scroll-behavior:smooth;scroll-behavior:smooth;}"))));
19164
+ });
19165
+ SelectDropdown.displayName = 'SelectDropdown';
19166
+
19167
+ var _excluded$c = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
19168
+ var getItemLayout = function getItemLayout(val) {
19169
+ var display = val === 0 ? 'display: none;' : 'display: inherit;';
19170
+ if (typeof val === 'number') {
19171
+ var width = 100 / 24 * val;
19172
+ var ratio = width > 100 ? '100%' : width < 0 ? '0' : "".concat(width, "%");
19173
+ return {
19174
+ grow: 0,
19175
+ display: display,
19176
+ width: ratio,
19177
+ basis: ratio
19178
+ };
19179
+ }
19180
+ return {
19181
+ grow: 1,
19182
+ display: display,
19183
+ width: '100%',
19184
+ basis: '0'
19185
+ };
19186
+ };
19187
+ var GridBasicItem = function GridBasicItem(_ref) {
19188
+ var _ref$xs = _ref.xs,
19189
+ xs = _ref$xs === undefined ? false : _ref$xs,
19190
+ _ref$sm = _ref.sm,
19191
+ sm = _ref$sm === undefined ? false : _ref$sm,
19192
+ _ref$md = _ref.md,
19193
+ md = _ref$md === undefined ? false : _ref$md,
19194
+ _ref$lg = _ref.lg,
19195
+ lg = _ref$lg === undefined ? false : _ref$lg,
19196
+ _ref$xl = _ref.xl,
19197
+ xl = _ref$xl === undefined ? false : _ref$xl,
19198
+ justify = _ref.justify,
19199
+ direction = _ref.direction,
19200
+ alignItems = _ref.alignItems,
19201
+ alignContent = _ref.alignContent,
19202
+ children = _ref.children,
19203
+ _ref$className = _ref.className,
19204
+ className = _ref$className === undefined ? '' : _ref$className,
19205
+ props = _objectWithoutProperties(_ref, _excluded$c);
19206
+ var theme = useTheme();
19207
+ var _useScale = useScale(),
19208
+ SCALES = _useScale.SCALES;
19209
+ var classes = React.useMemo(function () {
19210
+ var aligns = {
19211
+ justify: justify,
19212
+ direction: direction,
19213
+ alignItems: alignItems,
19214
+ alignContent: alignContent,
19215
+ xs: xs,
19216
+ sm: sm,
19217
+ md: md,
19218
+ lg: lg,
19219
+ xl: xl
19220
+ };
19221
+ var classString = Object.keys(aligns).reduce(function (pre, name) {
19222
+ if (aligns[name] !== undefined && aligns[name] !== false) return "".concat(pre, " ").concat(name);
19223
+ return pre;
19224
+ }, '');
19225
+ return classString.trim();
19226
+ }, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
19227
+ var layout = React.useMemo(function () {
19228
+ return {
19229
+ xs: getItemLayout(xs),
19230
+ sm: getItemLayout(sm),
19231
+ md: getItemLayout(md),
19232
+ lg: getItemLayout(lg),
19233
+ xl: getItemLayout(xl)
19234
+ };
19235
+ }, [xs, sm, md, lg, xl]);
19236
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
19237
+ className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || useClasses('item', classes, className) || "")
19238
+ }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
19239
+ id: "568430467",
19240
+ dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
19241
+ }, ".item.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1, 'inherit'), ";height:").concat(SCALES.height(1, 'auto'), ";}.justify.__jsx-style-dynamic-selector{-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";}.direction.__jsx-style-dynamic-selector{-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";}.alignContent.__jsx-style-dynamic-selector{-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";}.alignItems.__jsx-style-dynamic-selector{-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";}.xs.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xs.grow, ";-webkit-flex-grow:").concat(layout.xs.grow, ";-ms-flex-positive:").concat(layout.xs.grow, ";flex-grow:").concat(layout.xs.grow, ";max-width:").concat(layout.xs.width, ";-webkit-flex-basis:").concat(layout.xs.basis, ";-ms-flex-preferred-size:").concat(layout.xs.basis, ";flex-basis:").concat(layout.xs.basis, ";").concat(layout.xs.display, ";}@media only screen and (min-width:").concat(theme.breakpoints.sm.min, "){.sm.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.sm.grow, ";-webkit-flex-grow:").concat(layout.sm.grow, ";-ms-flex-positive:").concat(layout.sm.grow, ";flex-grow:").concat(layout.sm.grow, ";max-width:").concat(layout.sm.width, ";-webkit-flex-basis:").concat(layout.sm.basis, ";-ms-flex-preferred-size:").concat(layout.sm.basis, ";flex-basis:").concat(layout.sm.basis, ";").concat(layout.sm.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.md.min, "){.md.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.md.grow, ";-webkit-flex-grow:").concat(layout.md.grow, ";-ms-flex-positive:").concat(layout.md.grow, ";flex-grow:").concat(layout.md.grow, ";max-width:").concat(layout.md.width, ";-webkit-flex-basis:").concat(layout.md.basis, ";-ms-flex-preferred-size:").concat(layout.md.basis, ";flex-basis:").concat(layout.md.basis, ";").concat(layout.md.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.lg.min, "){.lg.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.lg.grow, ";-webkit-flex-grow:").concat(layout.lg.grow, ";-ms-flex-positive:").concat(layout.lg.grow, ";flex-grow:").concat(layout.lg.grow, ";max-width:").concat(layout.lg.width, ";-webkit-flex-basis:").concat(layout.lg.basis, ";-ms-flex-preferred-size:").concat(layout.lg.basis, ";flex-basis:").concat(layout.lg.basis, ";").concat(layout.lg.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.xl.min, "){.xl.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xl.grow, ";-webkit-flex-grow:").concat(layout.xl.grow, ";-ms-flex-positive:").concat(layout.xl.grow, ";flex-grow:").concat(layout.xl.grow, ";max-width:").concat(layout.xl.width, ";-webkit-flex-basis:").concat(layout.xl.basis, ";-ms-flex-preferred-size:").concat(layout.xl.basis, ";flex-basis:").concat(layout.xl.basis, ";").concat(layout.xl.display, ";}}")));
19242
+ };
19243
+ GridBasicItem.displayName = 'GridBasicItem';
19244
+
19245
+ var _excluded$b = ["children", "className"];
19246
+ var GridComponent = function GridComponent(_ref) {
19247
+ var children = _ref.children,
19248
+ _ref$className = _ref.className,
19249
+ className = _ref$className === undefined ? '' : _ref$className,
19250
+ props = _objectWithoutProperties(_ref, _excluded$b);
19251
+ var _useScale = useScale(),
19252
+ SCALES = _useScale.SCALES;
19253
+ var _styles$className = {
19254
+ styles: /*#__PURE__*/React.createElement(_JSXStyle, {
19255
+ id: "1271839607",
19256
+ dynamic: [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]
19257
+ }, "div.__jsx-style-dynamic-selector{margin:".concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";box-sizing:border-box;padding:").concat(SCALES.pt(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pr(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pb(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pl(0, 'var(--grid-gap-unit)'), ";}")),
19258
+ className: _JSXStyle.dynamic([["1271839607", [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]]])
19259
+ },
19260
+ resolveClassName = _styles$className.className,
19261
+ styles = _styles$className.styles;
19262
+ var classes = useClasses(resolveClassName, className);
19263
+ return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
19264
+ className: classes
19265
+ }, props), children, styles);
19266
+ };
19267
+ GridComponent.displayName = 'Grid';
19268
+ var Grid = withScale(GridComponent);
19269
+
19270
+ var _excluded$a = ["gap", "wrap", "children", "className"];
19271
+ var GridContainerComponent = function GridContainerComponent(_ref) {
19272
+ var _ref$gap = _ref.gap,
19273
+ gap = _ref$gap === undefined ? 0 : _ref$gap,
19274
+ _ref$wrap = _ref.wrap,
19275
+ wrap = _ref$wrap === undefined ? 'wrap' : _ref$wrap,
19276
+ children = _ref.children,
19277
+ _ref$className = _ref.className,
19278
+ className = _ref$className === undefined ? '' : _ref$className,
19279
+ props = _objectWithoutProperties(_ref, _excluded$a);
19280
+ var _useScale = useScale(),
19281
+ unit = _useScale.unit,
19282
+ SCALES = _useScale.SCALES;
19283
+ var gapUnit = React.useMemo(function () {
19284
+ return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
19285
+ }, [gap, unit]);
19286
+ var _styles$className = {
19287
+ styles: /*#__PURE__*/React.createElement(_JSXStyle, {
19288
+ id: "3631618093",
19289
+ dynamic: [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]
19290
+ }, "div.__jsx-style-dynamic-selector{--grid-gap-unit:".concat(gapUnit, ";--grid-container-margin:calc(-1 * var(--grid-gap-unit));--grid-container-width:calc(100% + var(--grid-gap-unit) * 2);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";box-sizing:border-box;width:").concat(SCALES.width(1, 'var(--grid-container-width)'), ";margin:").concat(SCALES.mt(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mr(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mb(0, 'var(--grid-container-margin)'), " ").concat(SCALES.ml(0, 'var(--grid-container-margin)'), ";}")),
19291
+ className: _JSXStyle.dynamic([["3631618093", [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]]])
19292
+ },
19293
+ resolveClassName = _styles$className.className,
19294
+ styles = _styles$className.styles;
19295
+ var classes = useClasses(resolveClassName, className);
19296
+ return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
19297
+ className: classes
19298
+ }, props), children, styles);
19299
+ };
19300
+ GridContainerComponent.displayName = 'GridContainer';
19301
+ var GridContainer = withScale(GridContainerComponent);
19302
+
19303
+ Grid.Container = GridContainer;
19304
+
19305
+ var SelectIconClear = function SelectIconClear(_ref) {
19306
+ var onClick = _ref.onClick;
19307
+ var theme = useTheme();
19308
+ var clickHandler = function clickHandler(event) {
19309
+ event.preventDefault();
19310
+ event.stopPropagation();
19311
+ event.nativeEvent.stopImmediatePropagation();
19312
+ onClick && onClick(event);
19313
+ };
19314
+ return /*#__PURE__*/React.createElement("div", {
19315
+ onClick: clickHandler,
19316
+ className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]]) + " " + "clear-icon"
19317
+ }, /*#__PURE__*/React.createElement("svg", {
19318
+ viewBox: "0 0 24 24",
19319
+ stroke: "currentColor",
19320
+ strokeWidth: "1.5",
19321
+ strokeLinecap: "round",
19322
+ strokeLinejoin: "round",
19323
+ fill: "none",
19324
+ shapeRendering: "geometricPrecision",
19325
+ className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]])
19326
+ }, /*#__PURE__*/React.createElement("path", {
19327
+ d: "M18 6L6 18",
19328
+ className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]])
19329
+ }), /*#__PURE__*/React.createElement("path", {
19330
+ d: "M6 6l12 12",
19331
+ className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]])
19332
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
19333
+ id: "1984024521",
19334
+ dynamic: [theme.palette.accents_3, theme.palette.foreground]
19335
+ }, ".clear-icon.__jsx-style-dynamic-selector{padding:0 0 0 0.5em;margin:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;cursor:pointer;box-sizing:border-box;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s;color:".concat(theme.palette.accents_3, ";visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(theme.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:1em;height:1em;}")));
19336
+ };
19337
+ var MemoSelectIconClear = /*#__PURE__*/React.memo(SelectIconClear);
19338
+
19339
+ var SelectMultipleValue = function SelectMultipleValue(_ref) {
19340
+ var disabled = _ref.disabled,
19341
+ onClear = _ref.onClear,
19342
+ children = _ref.children;
19343
+ var theme = useTheme();
19344
+ return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement("div", {
19345
+ className: _JSXStyle.dynamic([["3357578496", [theme.layout.radius, theme.palette.accents_2, disabled ? theme.palette.accents_4 : theme.palette.accents_6]]]) + " " + "item"
19346
+ }, children, !!onClear && /*#__PURE__*/React.createElement(MemoSelectIconClear, {
19347
+ onClick: onClear
19348
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
19349
+ id: "3357578496",
19350
+ dynamic: [theme.layout.radius, theme.palette.accents_2, disabled ? theme.palette.accents_4 : theme.palette.accents_6]
19351
+ }, ".item.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;justify-items:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0 0.5em;font-size:var(--select-font-size);height:calc(var(--select-font-size) * 2);border-radius:".concat(theme.layout.radius, ";background-color:").concat(theme.palette.accents_2, ";color:").concat(disabled ? theme.palette.accents_4 : theme.palette.accents_6, ";}.item.__jsx-style-dynamic-selector>div:not(.clear-icon),.item.__jsx-style-dynamic-selector>div:not(.clear-icon):hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}")));
19352
+ };
19353
+ SelectMultipleValue.displayName = 'GeistSelectMultipleValue';
19354
+
19355
+ var getColors$2 = function getColors(palette, status) {
19356
+ var colors = {
19357
+ "default": {
19358
+ border: palette.border,
19359
+ borderActive: palette.foreground,
19360
+ iconBorder: palette.accents_5,
19361
+ placeholderColor: palette.accents_3
19362
+ },
19363
+ secondary: {
19364
+ border: palette.border,
19365
+ borderActive: palette.foreground,
19366
+ iconBorder: palette.accents_5,
19367
+ placeholderColor: palette.accents_3
19368
+ },
19369
+ success: {
19370
+ border: palette.successLight,
19371
+ borderActive: palette.successDark,
19372
+ iconBorder: palette.success,
19373
+ placeholderColor: palette.accents_3
19374
+ },
19375
+ warning: {
19376
+ border: palette.warningLight,
19377
+ borderActive: palette.warningDark,
19378
+ iconBorder: palette.warning,
19379
+ placeholderColor: palette.accents_3
19380
+ },
19381
+ error: {
19382
+ border: palette.errorLight,
19383
+ borderActive: palette.errorDark,
19384
+ iconBorder: palette.error,
19385
+ placeholderColor: palette.error
19386
+ }
19387
+ };
19388
+ if (!status) return colors["default"];
19389
+ return colors[status];
19390
+ };
19391
+
19392
+ var Ellipsis = function Ellipsis(_ref) {
19393
+ var children = _ref.children,
19394
+ height = _ref.height;
19395
+ return /*#__PURE__*/React.createElement("span", {
19396
+ className: _JSXStyle.dynamic([["822089635", [height]]])
19397
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
19398
+ id: "822089635",
19399
+ dynamic: [height]
19400
+ }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
19401
+ };
19402
+ var Ellipsis$1 = /*#__PURE__*/React.memo(Ellipsis);
19403
+
19404
+ var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
19405
+ var visible = _ref.visible,
19406
+ onBlur = _ref.onBlur,
19407
+ onFocus = _ref.onFocus;
19408
+ var ref = React.useRef(null);
19409
+ React.useImperativeHandle(inputRef, function () {
19410
+ return ref.current;
19411
+ });
19412
+ React.useEffect(function () {
19413
+ if (visible) {
19414
+ var _ref$current;
19415
+ (_ref$current = ref.current) === null || _ref$current === undefined || _ref$current.focus();
19416
+ }
19417
+ }, [visible]);
19418
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
19419
+ ref: ref,
19420
+ type: "search",
19421
+ role: "combobox",
19422
+ "aria-haspopup": "listbox",
19423
+ readOnly: true,
19424
+ unselectable: "on",
19425
+ "aria-expanded": visible,
19426
+ onBlur: onBlur,
19427
+ onFocus: onFocus,
19428
+ className: "jsx-2813108835"
19429
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
19430
+ id: "2813108835"
19431
+ }, "input.jsx-2813108835{position:fixed;top:-10000px;left:-10000px;opacity:0;z-index:-1;width:0;height:0;padding:0;font-size:0;border:none;}"));
19432
+ });
19433
+ SelectInput.displayName = 'GeistSelectInput';
19434
+
19435
+ var _excluded$9 = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
19436
+ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19437
+ var children = _ref.children,
19438
+ label = _ref.label,
19439
+ _ref$type = _ref.type,
19440
+ type = _ref$type === undefined ? 'default' : _ref$type,
19441
+ _ref$disabled = _ref.disabled,
19442
+ disabled = _ref$disabled === undefined ? false : _ref$disabled,
19443
+ init = _ref.initialValue,
19444
+ customValue = _ref.value,
19445
+ _ref$icon = _ref.icon,
19446
+ Icon = _ref$icon === undefined ? SelectIcon : _ref$icon,
19447
+ onChange = _ref.onChange,
19448
+ _ref$pure = _ref.pure,
19449
+ pure = _ref$pure === undefined ? false : _ref$pure,
19450
+ _ref$multiple = _ref.multiple,
19451
+ multiple = _ref$multiple === undefined ? false : _ref$multiple,
19452
+ _ref$clearable = _ref.clearable,
19453
+ clearable = _ref$clearable === undefined ? true : _ref$clearable,
19454
+ placeholder = _ref.placeholder,
19455
+ _ref$className = _ref.className,
19456
+ className = _ref$className === undefined ? '' : _ref$className,
19457
+ dropdownClassName = _ref.dropdownClassName,
19458
+ dropdownStyle = _ref.dropdownStyle,
19459
+ _ref$disableMatchWidt = _ref.disableMatchWidth,
19460
+ disableMatchWidth = _ref$disableMatchWidt === undefined ? false : _ref$disableMatchWidt,
19461
+ getPopupContainer = _ref.getPopupContainer,
19462
+ _ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
19463
+ onDropdownVisibleChange = _ref$onDropdownVisibl === undefined ? function () {} : _ref$onDropdownVisibl,
19464
+ props = _objectWithoutProperties(_ref, _excluded$9);
19465
+ var theme = useTheme();
19466
+ var _useScale = useScale(),
19467
+ SCALES = _useScale.SCALES;
19468
+ var ref = React.useRef(null);
19469
+ var inputRef = React.useRef(null);
19470
+ var dropdownRef = React.useRef(null);
19471
+ var _useState = React.useState(false),
19472
+ _useState2 = _slicedToArray(_useState, 2),
19473
+ visible = _useState2[0],
19474
+ setVisible = _useState2[1];
19475
+ var _useState3 = React.useState(false),
19476
+ _useState4 = _slicedToArray(_useState3, 2),
19477
+ selectFocus = _useState4[0],
19478
+ setSelectFocus = _useState4[1];
19479
+ var _useCurrentState = useCurrentState(function () {
19480
+ if (!multiple) return init;
19481
+ if (Array.isArray(init)) return init;
19482
+ return typeof init === 'undefined' ? [] : [init];
19483
+ }),
19484
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
19485
+ value = _useCurrentState2[0],
19486
+ setValue = _useCurrentState2[1],
19487
+ valueRef = _useCurrentState2[2];
19488
+ var isEmpty = React.useMemo(function () {
19489
+ if (!Array.isArray(value)) return !value;
19490
+ return value.length === 0;
19491
+ }, [value]);
19492
+ var _useMemo = React.useMemo(function () {
19493
+ return getColors$2(theme.palette, type);
19494
+ }, [theme.palette, type]),
19495
+ border = _useMemo.border,
19496
+ borderActive = _useMemo.borderActive,
19497
+ iconBorder = _useMemo.iconBorder,
19498
+ placeholderColor = _useMemo.placeholderColor;
19499
+ var updateVisible = function updateVisible(next) {
19500
+ onDropdownVisibleChange(next);
19501
+ setVisible(next);
19502
+ };
19503
+ var updateValue = function updateValue(next) {
19504
+ setValue(function (last) {
19505
+ if (!Array.isArray(last)) return next;
19506
+ if (!last.includes(next)) return [].concat(_toConsumableArray(last), [next]);
19507
+ return last.filter(function (item) {
19508
+ return item !== next;
19509
+ });
19510
+ });
19511
+ onChange && onChange(valueRef.current);
19512
+ if (!multiple) {
19513
+ updateVisible(false);
19514
+ }
19515
+ };
19516
+ var initialValue = React.useMemo(function () {
19517
+ return {
19518
+ value: value,
19519
+ visible: visible,
19520
+ updateValue: updateValue,
19521
+ updateVisible: updateVisible,
19522
+ ref: ref,
19523
+ disableAll: disabled
19524
+ };
19525
+ }, [visible, disabled, ref, value, multiple]);
19526
+ var clickHandler = function clickHandler(event) {
19527
+ event.stopPropagation();
19528
+ event.nativeEvent.stopImmediatePropagation();
19529
+ event.preventDefault();
19530
+ if (disabled) return;
19531
+ updateVisible(!visible);
19532
+ event.preventDefault();
19533
+ };
19534
+ var mouseDownHandler = function mouseDownHandler(event) {
19535
+ /* istanbul ignore next */
19536
+ if (visible) {
19537
+ event.preventDefault();
19538
+ }
19539
+ };
19540
+ React.useEffect(function () {
19541
+ if (customValue === undefined) return;
19542
+ setValue(customValue);
19543
+ }, [customValue]);
19544
+ React.useImperativeHandle(selectRef, function () {
19545
+ return {
19546
+ focus: function focus() {
19547
+ var _inputRef$current;
19548
+ return (_inputRef$current = inputRef.current) === null || _inputRef$current === undefined ? undefined : _inputRef$current.focus();
19549
+ },
19550
+ blur: function blur() {
19551
+ var _inputRef$current2;
19552
+ return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === undefined ? undefined : _inputRef$current2.blur();
19553
+ },
19554
+ scrollTo: function scrollTo(options) {
19555
+ var _dropdownRef$current;
19556
+ return (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === undefined ? undefined : _dropdownRef$current.scrollTo(options);
19557
+ }
19558
+ };
19559
+ }, [inputRef, dropdownRef]);
19560
+ var selectedChild = React.useMemo(function () {
19561
+ var _pickChildByProps = pickChildByProps(children, 'value', value),
19562
+ _pickChildByProps2 = _slicedToArray(_pickChildByProps, 2),
19563
+ optionChildren = _pickChildByProps2[1];
19564
+ return React.Children.map(optionChildren, function (child) {
19565
+ if (! /*#__PURE__*/React.isValidElement(child)) return null;
19566
+ var el = /*#__PURE__*/React.cloneElement(child); // { preventAllEvents: true }
19567
+ if (!multiple) return el;
19568
+ return /*#__PURE__*/React.createElement(SelectMultipleValue, {
19569
+ disabled: disabled,
19570
+ onClear: clearable ? function () {
19571
+ return updateValue(child.props.value);
19572
+ } : null
19573
+ }, el);
19574
+ });
19575
+ }, [value, children, multiple]);
19576
+ var onInputBlur = function onInputBlur() {
19577
+ updateVisible(false);
19578
+ setSelectFocus(false);
19579
+ };
19580
+ var classes = useClasses('select', {
19581
+ active: selectFocus || visible,
19582
+ multiple: multiple
19583
+ }, className);
19584
+ return /*#__PURE__*/React.createElement("div", {
19585
+ className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
19586
+ }, label && /*#__PURE__*/React.createElement("label", {
19587
+ style: {
19588
+ display: 'block',
19589
+ marginBottom: '0.4rem',
19590
+ fontSize: '14px',
19591
+ fontWeight: 'light'
19592
+ },
19593
+ className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
19594
+ }, label), /*#__PURE__*/React.createElement(SelectContext.Provider, {
19595
+ value: initialValue
19596
+ }, /*#__PURE__*/React.createElement("div", _extends({
19597
+ ref: ref,
19598
+ onClick: clickHandler,
19599
+ onMouseDown: mouseDownHandler
19600
+ }, props, {
19601
+ className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
19602
+ }), /*#__PURE__*/React.createElement(SelectInput, {
19603
+ ref: inputRef,
19604
+ visible: visible,
19605
+ onBlur: onInputBlur,
19606
+ onFocus: function onFocus() {
19607
+ return setSelectFocus(true);
19608
+ }
19609
+ }), isEmpty && /*#__PURE__*/React.createElement("span", {
19610
+ className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
19611
+ }, /*#__PURE__*/React.createElement(Ellipsis$1, {
19612
+ height: "var(--select-height)"
19613
+ }, placeholder)), value && !multiple && /*#__PURE__*/React.createElement("span", {
19614
+ className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
19615
+ }, selectedChild), value && multiple && /*#__PURE__*/React.createElement(Grid.Container, {
19616
+ gap: 0.5
19617
+ }, selectedChild), /*#__PURE__*/React.createElement(SelectDropdown, {
19618
+ ref: dropdownRef,
19619
+ visible: visible,
19620
+ className: dropdownClassName,
19621
+ dropdownStyle: dropdownStyle,
19622
+ disableMatchWidth: disableMatchWidth,
19623
+ getPopupContainer: getPopupContainer
19624
+ }, children), !pure && /*#__PURE__*/React.createElement("div", {
19625
+ className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
19626
+ }, /*#__PURE__*/React.createElement(Icon, {
19627
+ className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
19628
+ })))), /*#__PURE__*/React.createElement(_JSXStyle, {
19629
+ id: "3282295248",
19630
+ dynamic: [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]
19631
+ }, ".select.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";max-width:90vw;overflow:hidden;-webkit-transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;border:1px solid ").concat(border, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(disabled ? theme.palette.accents_1 : theme.palette.background, ";--select-font-size:").concat(SCALES.font(0.875), ";--select-height:").concat(SCALES.height(2.25), ";min-width:11.5em;width:").concat(SCALES.width(1, 'initial'), ";height:var(--select-height);padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.multiple.__jsx-style-dynamic-selector{height:auto;min-height:var(--select-height);padding:").concat(SCALES.pt(0.334), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0.334), " ").concat(SCALES.pl(0.667), ";}.select.active.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover{border-color:").concat(disabled ? theme.palette.border : borderActive, ";}.select.active.icon.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover .icon.__jsx-style-dynamic-selector{color:").concat(disabled ? theme.palette.accents_5 : borderActive, ";}.value.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex:1;-ms-flex:1;flex:1;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0;margin-right:1.25em;font-size:var(--select-font-size);color:").concat(disabled ? theme.palette.accents_4 : theme.palette.foreground, ";width:calc(100% - 1.25em);}.value.__jsx-style-dynamic-selector>div,.value.__jsx-style-dynamic-selector>div:hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}.placeholder.__jsx-style-dynamic-selector{color:").concat(placeholderColor, ";}.icon.__jsx-style-dynamic-selector{position:absolute;right:").concat(theme.layout.gapQuarter, ";font-size:var(--select-font-size);top:50%;bottom:0;-webkit-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);-ms-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);pointer-events:none;-webkit-transition:-webkit-transform 200ms ease;-webkit-transition:transform 200ms ease;transition:transform 200ms ease;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(iconBorder, ";}")));
19632
+ });
19633
+ SelectComponent.displayName = 'Select';
19634
+ var Select = withScale(SelectComponent);
19635
+
19636
+ var _excluded$8 = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
19637
+ var SelectOptionComponent = function SelectOptionComponent(_ref) {
19638
+ var identValue = _ref.value,
19639
+ _ref$className = _ref.className,
19640
+ className = _ref$className === undefined ? '' : _ref$className,
19641
+ children = _ref.children,
19642
+ _ref$disabled = _ref.disabled,
19643
+ disabled = _ref$disabled === undefined ? false : _ref$disabled,
19644
+ _ref$divider = _ref.divider,
19645
+ divider = _ref$divider === undefined ? false : _ref$divider,
19646
+ _ref$label = _ref.label,
19647
+ label = _ref$label === undefined ? false : _ref$label,
19648
+ _ref$preventAllEvents = _ref.preventAllEvents,
19649
+ preventAllEvents = _ref$preventAllEvents === undefined ? false : _ref$preventAllEvents,
19650
+ props = _objectWithoutProperties(_ref, _excluded$8);
19651
+ var theme = useTheme();
19652
+ var _useScale = useScale(),
19653
+ SCALES = _useScale.SCALES;
19654
+ var _useSelectContext = useSelectContext(),
19655
+ updateValue = _useSelectContext.updateValue,
19656
+ value = _useSelectContext.value,
19657
+ disableAll = _useSelectContext.disableAll;
19658
+ var isDisabled = React.useMemo(function () {
19659
+ return disabled || disableAll;
19660
+ }, [disabled, disableAll]);
19661
+ var isLabel = React.useMemo(function () {
19662
+ return label || divider;
19663
+ }, [label, divider]);
19664
+ var classes = useClasses('option', {
19665
+ divider: divider,
19666
+ label: label
19667
+ }, className);
19668
+ if (!isLabel && identValue === undefined) {
19669
+ useWarning('The props "value" is required.', 'Select Option');
19670
+ }
19671
+ var selected = React.useMemo(function () {
19672
+ if (!value) return false;
19673
+ if (typeof value === 'string') {
19674
+ return identValue === value;
19675
+ }
19676
+ return value.includes("".concat(identValue));
19677
+ }, [identValue, value]);
19678
+ var bgColor = React.useMemo(function () {
19679
+ if (isDisabled) return theme.palette.accents_1;
19680
+ return selected ? theme.palette.accents_2 : theme.palette.background;
19681
+ }, [selected, isDisabled, theme.palette]);
19682
+ var hoverBgColor = React.useMemo(function () {
19683
+ if (isDisabled || isLabel || selected) return bgColor;
19684
+ return theme.palette.accents_1;
19685
+ }, [selected, isDisabled, theme.palette, isLabel, bgColor]);
19686
+ var color = React.useMemo(function () {
19687
+ if (isDisabled) return theme.palette.accents_4;
19688
+ return selected ? theme.palette.foreground : theme.palette.accents_5;
19689
+ }, [selected, isDisabled, theme.palette]);
19690
+ var clickHandler = function clickHandler(event) {
19691
+ if (preventAllEvents) return;
19692
+ event.stopPropagation();
19693
+ event.nativeEvent.stopImmediatePropagation();
19694
+ event.preventDefault();
19695
+ if (isDisabled || isLabel) return;
19696
+ updateValue && updateValue(identValue);
19697
+ };
19698
+ return /*#__PURE__*/React.createElement("div", _extends({
19699
+ onClick: clickHandler
19700
+ }, props, {
19701
+ className: _JSXStyle.dynamic([["199367556", [bgColor, color, isDisabled ? 'not-allowed' : 'pointer', SCALES.font(0.75), SCALES.width(1, '100%'), SCALES.height(2.25), SCALES.pt(0), SCALES.pr(0.667), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBgColor, theme.palette.accents_7, theme.palette.border, SCALES.width(1, '100%'), SCALES.height(1, 0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0.5), SCALES.mr(0), SCALES.mb(0.5), SCALES.ml(0), theme.palette.accents_7, theme.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]]]) + " " + (props && props.className != null && props.className || classes || "")
19702
+ }), /*#__PURE__*/React.createElement(Ellipsis$1, {
19703
+ height: SCALES.height(2.25)
19704
+ }, children), /*#__PURE__*/React.createElement(_JSXStyle, {
19705
+ id: "199367556",
19706
+ dynamic: [bgColor, color, isDisabled ? 'not-allowed' : 'pointer', SCALES.font(0.75), SCALES.width(1, '100%'), SCALES.height(2.25), SCALES.pt(0), SCALES.pr(0.667), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBgColor, theme.palette.accents_7, theme.palette.border, SCALES.width(1, '100%'), SCALES.height(1, 0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0.5), SCALES.mr(0), SCALES.mb(0.5), SCALES.ml(0), theme.palette.accents_7, theme.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]
19707
+ }, ".option.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;max-width:100%;box-sizing:border-box;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-weight:normal;background-color:".concat(bgColor, ";color:").concat(color, ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:0;cursor:").concat(isDisabled ? 'not-allowed' : 'pointer', ";-webkit-transition:background 0.2s ease 0s,border-color 0.2s ease 0s;transition:background 0.2s ease 0s,border-color 0.2s ease 0s;--select-font-size:").concat(SCALES.font(0.75), ";font-size:var(--select-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(2.25), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.667), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.option.__jsx-style-dynamic-selector:hover{background-color:").concat(hoverBgColor, ";color:").concat(theme.palette.accents_7, ";}.divider.__jsx-style-dynamic-selector{line-height:0;overflow:hidden;border-top:1px solid ").concat(theme.palette.border, ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0.5), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0.5), " ").concat(SCALES.ml(0), ";}.label.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_7, ";border-bottom:1px solid ").concat(theme.palette.border, ";text-transform:capitalize;cursor:default;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, '100%'), ";font-weight:500;}")));
19708
+ };
19709
+ SelectOptionComponent.displayName = 'SelectOption';
19710
+ var SelectOption = withScale(SelectOptionComponent);
19711
+
19712
+ Select.Option = SelectOption;
19713
+
19714
+ var InputLabel = function InputLabel(_ref) {
19715
+ var children = _ref.children,
19716
+ isRight = _ref.isRight;
19717
+ var theme = useTheme();
19718
+ return /*#__PURE__*/React.createElement("span", {
19719
+ className: _JSXStyle.dynamic([["3089782703", [theme.layout.gapHalf, theme.palette.accents_4, theme.palette.accents_1, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border]]]) + " " + ((isRight ? 'right' : '') || "")
19720
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
19721
+ id: "3089782703",
19722
+ dynamic: [theme.layout.gapHalf, theme.palette.accents_4, theme.palette.accents_1, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border]
19723
+ }, "span.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:initial;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;pointer-events:none;margin:0;padding:0 ".concat(theme.layout.gapHalf, ";color:").concat(theme.palette.accents_4, ";background-color:").concat(theme.palette.accents_1, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";border-top:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-bottom:1px solid ").concat(theme.palette.border, ";font-size:inherit;line-height:1;}span.right.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";border-left:0;border-right:1px solid ").concat(theme.palette.border, ";}")));
19724
+ };
19725
+ var MemoInputLabel = /*#__PURE__*/React.memo(InputLabel);
19726
+
19727
+ var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
19728
+ var children = _ref.children;
19729
+ var theme = useTheme();
19730
+ return /*#__PURE__*/React.createElement("label", {
19731
+ className: _JSXStyle.dynamic([["1278828862", [theme.palette.accents_6]]])
19732
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
19733
+ id: "1278828862",
19734
+ dynamic: [theme.palette.accents_6]
19735
+ }, "label.__jsx-style-dynamic-selector{display:block;font-weight:normal;color:".concat(theme.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")));
19736
+ };
19737
+ InputBlockLabelComponent.displayName = 'GeistInputBlockLabel';
19738
+ var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
19739
+
19740
+ var InputIconComponent = function InputIconComponent(_ref) {
19741
+ var icon = _ref.icon,
19742
+ _ref$clickable = _ref.clickable,
19743
+ clickable = _ref$clickable === undefined ? false : _ref$clickable,
19744
+ onClick = _ref.onClick;
19745
+ return /*#__PURE__*/React.createElement("span", {
19746
+ onClick: onClick,
19747
+ className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon"
19748
+ }, icon, /*#__PURE__*/React.createElement(_JSXStyle, {
19749
+ id: "4247656379",
19750
+ dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']
19751
+ }, ".input-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;line-height:1;position:relative;cursor:".concat(clickable ? 'pointer' : 'default', ";pointer-events:").concat(clickable ? 'auto' : 'none', ";}.input-icon.__jsx-style-dynamic-selector svg{width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")));
19752
+ };
19753
+ InputIconComponent.displayName = 'GeistInputIcon';
19754
+ var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
19755
+
19756
+ var InputIconClear = function InputIconClear(_ref) {
19757
+ var onClick = _ref.onClick,
19758
+ disabled = _ref.disabled,
19759
+ visible = _ref.visible;
19760
+ var theme = useTheme();
19761
+ var classes = useClasses('clear-icon', {
19762
+ visible: visible
19763
+ });
19764
+ var clickHandler = function clickHandler(event) {
19765
+ event.preventDefault();
19766
+ event.stopPropagation();
19767
+ event.nativeEvent.stopImmediatePropagation();
19768
+ onClick && onClick(event);
19769
+ };
19770
+ return /*#__PURE__*/React.createElement("div", {
19771
+ onClick: clickHandler,
19772
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]]) + " " + (classes || "")
19773
+ }, /*#__PURE__*/React.createElement("svg", {
19774
+ viewBox: "0 0 24 24",
19775
+ stroke: "currentColor",
19776
+ strokeWidth: "1.5",
19777
+ strokeLinecap: "round",
19778
+ strokeLinejoin: "round",
19779
+ fill: "none",
19780
+ shapeRendering: "geometricPrecision",
19781
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
19782
+ }, /*#__PURE__*/React.createElement("path", {
19783
+ d: "M18 6L6 18",
19784
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
19785
+ }), /*#__PURE__*/React.createElement("path", {
19786
+ d: "M6 6l12 12",
19787
+ className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
19788
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
19789
+ id: "1567030211",
19790
+ dynamic: [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]
19791
+ }, ".clear-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s;margin:0;padding:0;color:").concat(theme.palette.accents_3, ";visibility:hidden;opacity:0;}.visible.__jsx-style-dynamic-selector{visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(disabled ? theme.palette.accents_3 : theme.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")));
19792
+ };
19793
+ var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
19794
+
19795
+ var getColors$1 = function getColors(palette, status) {
19796
+ var colors = {
19797
+ "default": {
19798
+ color: palette.foreground,
19799
+ borderColor: palette.border,
19800
+ hoverBorder: palette.accents_5
19801
+ },
19802
+ secondary: {
19803
+ color: palette.foreground,
19804
+ borderColor: palette.secondary,
19805
+ hoverBorder: palette.secondary
19806
+ },
19807
+ success: {
19808
+ color: palette.foreground,
19809
+ borderColor: palette.successLight,
19810
+ hoverBorder: palette.success
19811
+ },
19812
+ warning: {
19813
+ color: palette.foreground,
19814
+ borderColor: palette.warningLight,
19815
+ hoverBorder: palette.warning
19816
+ },
19817
+ error: {
19818
+ color: palette.error,
19819
+ borderColor: palette.error,
19820
+ hoverBorder: palette.errorDark
19821
+ }
19822
+ };
19823
+ if (!status) return colors["default"];
19824
+ return colors[status];
19825
+ };
19826
+
19827
+ var _excluded$7 = ["label", "labelRight", "type", "error", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
19828
+ var simulateChangeEvent = function simulateChangeEvent(el, event) {
19829
+ return _objectSpread2(_objectSpread2({}, event), {}, {
19830
+ target: el,
19831
+ currentTarget: el
19832
+ });
19833
+ };
19834
+ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
19835
+ var label = _ref.label,
19836
+ labelRight = _ref.labelRight,
19837
+ _ref$type = _ref.type,
19838
+ type = _ref$type === undefined ? 'default' : _ref$type,
19839
+ error = _ref.error,
19840
+ _ref$htmlType = _ref.htmlType,
19841
+ htmlType = _ref$htmlType === undefined ? 'text' : _ref$htmlType,
19842
+ icon = _ref.icon,
19843
+ iconRight = _ref.iconRight,
19844
+ _ref$iconClickable = _ref.iconClickable,
19845
+ iconClickable = _ref$iconClickable === undefined ? false : _ref$iconClickable,
19846
+ onIconClick = _ref.onIconClick,
19847
+ _ref$initialValue = _ref.initialValue,
19848
+ initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
19849
+ onChange = _ref.onChange,
19850
+ _ref$readOnly = _ref.readOnly,
19851
+ readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
19852
+ value = _ref.value,
19853
+ onClearClick = _ref.onClearClick,
19854
+ _ref$clearable = _ref.clearable,
19855
+ clearable = _ref$clearable === undefined ? false : _ref$clearable,
19856
+ _ref$className = _ref.className,
19857
+ className = _ref$className === undefined ? '' : _ref$className,
19858
+ onBlur = _ref.onBlur,
19859
+ onFocus = _ref.onFocus,
19860
+ _ref$autoComplete = _ref.autoComplete,
19861
+ autoComplete = _ref$autoComplete === undefined ? 'off' : _ref$autoComplete,
19862
+ _ref$placeholder = _ref.placeholder,
19863
+ placeholder = _ref$placeholder === undefined ? '' : _ref$placeholder,
19864
+ children = _ref.children,
19865
+ _ref$disabled = _ref.disabled,
19866
+ disabled = _ref$disabled === undefined ? false : _ref$disabled,
19867
+ props = _objectWithoutProperties(_ref, _excluded$7);
19868
+ var theme = useTheme();
19869
+ var _useScale = useScale(),
19870
+ SCALES = _useScale.SCALES;
19871
+ var inputRef = React.useRef(null);
19872
+ React.useImperativeHandle(ref, function () {
19873
+ return inputRef.current;
19874
+ });
19875
+ var _useState = React.useState(initialValue),
19876
+ _useState2 = _slicedToArray(_useState, 2),
19877
+ selfValue = _useState2[0],
19878
+ setSelfValue = _useState2[1];
19879
+ var _useState3 = React.useState(false),
19880
+ _useState4 = _slicedToArray(_useState3, 2),
19881
+ hover = _useState4[0],
19882
+ setHover = _useState4[1];
19883
+ var isControlledComponent = React.useMemo(function () {
19884
+ return value !== undefined;
19885
+ }, [value]);
19886
+ var labelClasses = React.useMemo(function () {
19887
+ return labelRight ? 'right-label' : label ? 'left-label' : '';
19888
+ }, [label, labelRight]);
19889
+ var iconClasses = React.useMemo(function () {
19890
+ return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
19891
+ }, [icon, iconRight]);
19892
+ var _useMemo = React.useMemo(function () {
19893
+ return getColors$1(theme.palette, type);
19894
+ }, [theme.palette, type]),
19895
+ color = _useMemo.color,
19896
+ borderColor = _useMemo.borderColor,
19897
+ hoverBorder = _useMemo.hoverBorder;
19898
+ var changeHandler = function changeHandler(event) {
19899
+ if (disabled || readOnly) return;
19900
+ setSelfValue(event.target.value);
19901
+ onChange && onChange(event);
19902
+ };
19903
+ var clearHandler = function clearHandler(event) {
19904
+ setSelfValue('');
19905
+ onClearClick && onClearClick(event);
19906
+ /* istanbul ignore next */
19907
+ if (!inputRef.current) return;
19908
+ var changeEvent = simulateChangeEvent(inputRef.current, event);
19909
+ changeEvent.target.value = '';
19910
+ onChange && onChange(changeEvent);
19911
+ inputRef.current.focus();
19912
+ };
19913
+ var focusHandler = function focusHandler(e) {
19914
+ setHover(true);
19915
+ onFocus && onFocus(e);
19916
+ };
19917
+ var blurHandler = function blurHandler(e) {
19918
+ setHover(false);
19919
+ onBlur && onBlur(e);
19920
+ };
19921
+ var iconClickHandler = function iconClickHandler(e) {
19922
+ if (disabled) return;
19923
+ onIconClick && onIconClick(e);
19924
+ };
19925
+ var iconProps = React.useMemo(function () {
19926
+ return {
19927
+ clickable: iconClickable,
19928
+ onClick: iconClickHandler
19929
+ };
19930
+ }, [iconClickable, iconClickHandler]);
19931
+ React.useEffect(function () {
19932
+ if (isControlledComponent) {
19933
+ setSelfValue(value);
19934
+ }
19935
+ });
19936
+ var controlledValue = isControlledComponent ? {
19937
+ value: selfValue
19938
+ } : {
19939
+ defaultValue: initialValue
19940
+ };
19941
+ var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
19942
+ return /*#__PURE__*/React.createElement("div", {
19943
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "with-label"
19944
+ }, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
19945
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-container', className) || "")
19946
+ }, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
19947
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-wrapper', {
19948
+ hover: hover,
19949
+ disabled: disabled
19950
+ }, labelClasses) || "")
19951
+ }, icon && /*#__PURE__*/React.createElement(InputIcon, _extends({
19952
+ icon: icon
19953
+ }, iconProps)), /*#__PURE__*/React.createElement("input", _extends({
19954
+ type: htmlType,
19955
+ ref: inputRef,
19956
+ placeholder: placeholder,
19957
+ disabled: disabled,
19958
+ readOnly: readOnly,
19959
+ onFocus: focusHandler,
19960
+ onBlur: blurHandler,
19961
+ onChange: changeHandler,
19962
+ autoComplete: autoComplete
19963
+ }, inputProps, {
19964
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || useClasses({
19965
+ disabled: disabled
19966
+ }, iconClasses) || "")
19967
+ })), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
19968
+ visible: Boolean(inputRef.current && inputRef.current.value !== ''),
19969
+ disabled: disabled || readOnly,
19970
+ onClick: clearHandler
19971
+ }), iconRight && /*#__PURE__*/React.createElement(InputIcon, _extends({
19972
+ icon: iconRight
19973
+ }, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
19974
+ isRight: true
19975
+ }, labelRight), /*#__PURE__*/React.createElement("br", {
19976
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]])
19977
+ })), error && /*#__PURE__*/React.createElement("p", {
19978
+ style: {
19979
+ marginTop: 0.4,
19980
+ marginRight: 0,
19981
+ marginLeft: 0,
19982
+ marginBottom: '0.4rem',
19983
+ textAlign: 'left'
19984
+ },
19985
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "input-error"
19986
+ }, error), /*#__PURE__*/React.createElement(_JSXStyle, {
19987
+ id: "1424341926",
19988
+ dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]
19989
+ }, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'initial'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.input-error.__jsx-style-dynamic-selector{color:#aa4a44;}.input-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:").concat(SCALES.width(1, 'initial'), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
19990
+ });
19991
+ InputComponent.displayName = 'Input';
19992
+ var Input = withScale(InputComponent);
19993
+
19994
+ var tuple = function tuple() {
19995
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
19996
+ args[_key] = arguments[_key];
19997
+ }
19998
+ return args;
19999
+ };
20000
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
20001
+ tuple('default', 'secondary', 'success', 'warning', 'error');
20002
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
20003
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
20004
+ tuple('default', 'silent', 'prevent');
20005
+ tuple('hover', 'click');
20006
+ tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
20007
+ tuple('start', 'center', 'end', 'left', 'right');
20008
+
20009
+ var _excluded$6 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
20010
+ tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
20011
+ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20012
+ var _ref$type = _ref.type,
20013
+ type = _ref$type === undefined ? 'default' : _ref$type,
20014
+ _ref$disabled = _ref.disabled,
20015
+ disabled = _ref$disabled === undefined ? false : _ref$disabled,
20016
+ _ref$readOnly = _ref.readOnly,
20017
+ readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
20018
+ onFocus = _ref.onFocus,
20019
+ onBlur = _ref.onBlur,
20020
+ _ref$className = _ref.className,
20021
+ className = _ref$className === undefined ? '' : _ref$className,
20022
+ _ref$initialValue = _ref.initialValue,
20023
+ initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
20024
+ onChange = _ref.onChange,
20025
+ value = _ref.value,
20026
+ placeholder = _ref.placeholder,
20027
+ _ref$resize = _ref.resize,
20028
+ resize = _ref$resize === undefined ? 'none' : _ref$resize,
20029
+ props = _objectWithoutProperties(_ref, _excluded$6);
20030
+ var theme = useTheme();
20031
+ var _useScale = useScale(),
20032
+ SCALES = _useScale.SCALES;
20033
+ var textareaRef = React.useRef(null);
20034
+ React.useImperativeHandle(ref, function () {
20035
+ return textareaRef.current;
20036
+ });
20037
+ var isControlledComponent = React.useMemo(function () {
20038
+ return value !== undefined;
20039
+ }, [value]);
20040
+ var _useState = React.useState(initialValue),
20041
+ _useState2 = _slicedToArray(_useState, 2),
20042
+ selfValue = _useState2[0],
20043
+ setSelfValue = _useState2[1];
20044
+ var _useState3 = React.useState(false),
20045
+ _useState4 = _slicedToArray(_useState3, 2),
20046
+ hover = _useState4[0],
20047
+ setHover = _useState4[1];
20048
+ var _useMemo = React.useMemo(function () {
20049
+ return getColors$1(theme.palette, type);
20050
+ }, [theme.palette, type]),
20051
+ color = _useMemo.color,
20052
+ borderColor = _useMemo.borderColor,
20053
+ hoverBorder = _useMemo.hoverBorder;
20054
+ var classes = useClasses('wrapper', {
20055
+ hover: hover,
20056
+ disabled: disabled
20057
+ }, className);
20058
+ var changeHandler = function changeHandler(event) {
20059
+ if (disabled || readOnly) return;
20060
+ setSelfValue(event.target.value);
20061
+ onChange && onChange(event);
20062
+ };
20063
+ var focusHandler = function focusHandler(e) {
20064
+ setHover(true);
20065
+ onFocus && onFocus(e);
20066
+ };
20067
+ var blurHandler = function blurHandler(e) {
20068
+ setHover(false);
20069
+ onBlur && onBlur(e);
20070
+ };
20071
+ React.useEffect(function () {
20072
+ if (isControlledComponent) {
20073
+ setSelfValue(value);
20074
+ }
20075
+ });
20076
+ var controlledValue = isControlledComponent ? {
20077
+ value: selfValue
20078
+ } : {
20079
+ defaultValue: initialValue
20080
+ };
20081
+ var textareaProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
20082
+ return /*#__PURE__*/React.createElement("div", {
20083
+ className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (classes || "")
20084
+ }, /*#__PURE__*/React.createElement("textarea", _extends({
20085
+ ref: textareaRef,
20086
+ disabled: disabled,
20087
+ placeholder: placeholder,
20088
+ readOnly: readOnly,
20089
+ onFocus: focusHandler,
20090
+ onBlur: blurHandler,
20091
+ onChange: changeHandler
20092
+ }, textareaProps, {
20093
+ className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (textareaProps && textareaProps.className != null && textareaProps.className || "")
20094
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
20095
+ id: "12276481",
20096
+ dynamic: [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]
20097
+ }, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;}")));
20098
+ });
20099
+ TextareaComponent.displayName = 'Textarea';
20100
+ var Textarea = withScale(TextareaComponent);
20101
+
20102
+ var PasswordIcon = function PasswordIcon(_ref) {
20103
+ var visible = _ref.visible;
20104
+ return /*#__PURE__*/React.createElement("svg", {
20105
+ viewBox: "0 0 24 24",
20106
+ stroke: "currentColor",
20107
+ strokeWidth: "1.5",
20108
+ strokeLinecap: "round",
20109
+ strokeLinejoin: "round",
20110
+ fill: "none",
20111
+ shapeRendering: "geometricPrecision",
20112
+ style: {
20113
+ color: 'currentColor'
20114
+ }
20115
+ }, !visible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
20116
+ d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"
20117
+ }), /*#__PURE__*/React.createElement("circle", {
20118
+ cx: "12",
20119
+ cy: "12",
20120
+ r: "3"
20121
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
20122
+ d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"
20123
+ }), /*#__PURE__*/React.createElement("path", {
20124
+ d: "M1 1l22 22"
20125
+ })));
20126
+ };
20127
+ var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
20128
+
20129
+ var _excluded$5 = ["hideToggle", "children"];
20130
+ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20131
+ var hideToggle = _ref.hideToggle,
20132
+ children = _ref.children,
20133
+ props = _objectWithoutProperties(_ref, _excluded$5);
20134
+ var _useScale = useScale(),
20135
+ getAllScaleProps = _useScale.getAllScaleProps;
20136
+ var inputRef = React.useRef(null);
20137
+ var _useState = React.useState(false),
20138
+ _useState2 = _slicedToArray(_useState, 2),
20139
+ visible = _useState2[0],
20140
+ setVisible = _useState2[1];
20141
+ React.useImperativeHandle(ref, function () {
20142
+ return inputRef.current;
20143
+ });
20144
+ var iconClickHandler = function iconClickHandler() {
20145
+ setVisible(function (v) {
20146
+ return !v;
20147
+ });
20148
+ /* istanbul ignore next */
20149
+ if (inputRef && inputRef.current) {
20150
+ inputRef.current.focus();
20151
+ }
20152
+ };
20153
+ var inputProps = React.useMemo(function () {
20154
+ return _objectSpread2(_objectSpread2({}, props), {}, {
20155
+ ref: inputRef,
20156
+ iconClickable: true,
20157
+ onIconClick: iconClickHandler,
20158
+ htmlType: visible ? 'text' : 'password'
20159
+ });
20160
+ }, [props, iconClickHandler, visible, inputRef]);
20161
+ var icon = React.useMemo(function () {
20162
+ if (hideToggle) return null;
20163
+ return /*#__PURE__*/React.createElement(MemoPasswordIcon, {
20164
+ visible: visible
20165
+ });
20166
+ }, [hideToggle, visible]);
20167
+ return /*#__PURE__*/React.createElement(Input, _extends({
20168
+ iconRight: icon
20169
+ }, getAllScaleProps(), inputProps), children);
20170
+ });
20171
+ InputPasswordComponent.displayName = 'InputPassword';
20172
+ var InputPassword = withScale(InputPasswordComponent);
20173
+
20174
+ /* "use client" */
20175
+ Input.Textarea = Textarea;
20176
+ Input.Password = InputPassword;
20177
+
20178
+ var _excluded$4 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "showFilters", "onSelected", "className", "rowClassName"];
20179
+ function TableComponent(tableProps) {
20180
+ /* eslint-disable @typescript-eslint/no-unused-vars */
20181
+ var _ref = tableProps,
20182
+ children = _ref.children,
20183
+ customData = _ref.data,
20184
+ _ref$initialData = _ref.initialData,
20185
+ initialData = _ref$initialData === undefined ? [] : _ref$initialData,
20186
+ _ref$hover = _ref.hover,
20187
+ hover = _ref$hover === undefined ? true : _ref$hover,
20188
+ _ref$emptyText = _ref.emptyText,
20189
+ emptyText = _ref$emptyText === undefined ? '' : _ref$emptyText,
20190
+ _ref$rowDraggable = _ref.rowDraggable,
20191
+ rowDraggable = _ref$rowDraggable === undefined ? false : _ref$rowDraggable,
20192
+ _ref$readOnly = _ref.readOnly,
20193
+ readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
20194
+ onRow = _ref.onRow,
20195
+ onCell = _ref.onCell;
20196
+ _ref.onChange;
20197
+ var onFilters = _ref.onFilters,
20198
+ _ref$showFilters = _ref.showFilters,
20199
+ showFilters = _ref$showFilters === undefined ? false : _ref$showFilters,
20200
+ onSelected = _ref.onSelected,
20201
+ _ref$className = _ref.className,
20202
+ className = _ref$className === undefined ? '' : _ref$className,
20203
+ _ref$rowClassName = _ref.rowClassName,
20204
+ rowClassName = _ref$rowClassName === undefined ? function () {
20205
+ return '';
20206
+ } : _ref$rowClassName,
20207
+ props = _objectWithoutProperties(_ref, _excluded$4);
20208
+ /* eslint-enable @typescript-eslint/no-unused-vars */
20209
+ var _useScale = useScale(),
20210
+ SCALES = _useScale.SCALES;
20211
+ var ref = React.useRef(null);
20212
+ var _useRealShape = useRealShape(ref),
20213
+ _useRealShape2 = _slicedToArray(_useRealShape, 2),
20214
+ width = _useRealShape2[0].width,
20215
+ updateShape = _useRealShape2[1];
20216
+ var _useState = React.useState([]),
20217
+ _useState2 = _slicedToArray(_useState, 2),
20218
+ columns = _useState2[0],
20219
+ setColumns = _useState2[1];
20220
+ var _useState3 = React.useState(initialData),
20221
+ _useState4 = _slicedToArray(_useState3, 2),
20222
+ data = _useState4[0],
20223
+ setData = _useState4[1];
20224
+ var updateColumn = function updateColumn(column) {
20225
+ setColumns(function (last) {
20226
+ var hasColumn = last.find(function (item) {
20227
+ return item.prop === column.prop;
20228
+ });
20229
+ if (!hasColumn) return [].concat(_toConsumableArray(last), [column]);
20230
+ return last.map(function (item) {
20231
+ if (item.prop !== column.prop) return item;
20232
+ return column;
20233
+ });
20234
+ });
20235
+ };
20236
+ var contextValue = React.useMemo(function () {
20237
+ return {
20238
+ columns: columns,
20239
+ updateColumn: updateColumn
20240
+ };
20241
+ }, [columns]);
20242
+ var _React$useState = React.useState({}),
20243
+ _React$useState2 = _slicedToArray(_React$useState, 2),
20244
+ filters = _React$useState2[0],
20245
+ setFilters = _React$useState2[1];
20246
+ React.useEffect(function () {
20247
+ if (typeof customData === 'undefined') return;
20248
+ setData(customData);
20249
+ }, [customData]);
20250
+ useResize(function () {
20251
+ return updateShape();
20252
+ });
20253
+ var handleFilterChange = function handleFilterChange(name, value) {
20254
+ setFilters(function (prevFilters) {
20255
+ var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
20256
+ // Call onFiltersChange to propagate filter changes to the parent
20257
+ if (onFilters) {
20258
+ onFilters(updatedFilters);
20259
+ }
20260
+ return updatedFilters;
20261
+ });
20262
+ };
20263
+ var generateFilterInputs = function generateFilterInputs() {
20264
+ return columns.map(function (col) {
20265
+ var _String, _filters$filterName;
20266
+ var Header = col.label,
20267
+ accessor = col.filter,
20268
+ options = col.options;
20269
+ var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
20270
+ var unq_accessor = _.uniqueId(filterName);
18891
20271
  return /*#__PURE__*/React.createElement("div", {
18892
20272
  style: {
18893
20273
  margin: '3px'
@@ -18933,14 +20313,14 @@ function TableComponent(tableProps) {
18933
20313
  }));
18934
20314
  });
18935
20315
  };
18936
- return /*#__PURE__*/React.createElement(TableContext.Provider, {
18937
- value: contextValue
18938
- }, showFilters && /*#__PURE__*/React.createElement("div", {
20316
+ return /*#__PURE__*/React.createElement("div", null, showFilters && /*#__PURE__*/React.createElement("div", {
18939
20317
  style: {
18940
20318
  display: 'flex',
18941
20319
  gap: 6
18942
20320
  }
18943
- }, generateFilterInputs()), /*#__PURE__*/React.createElement("table", _extends({
20321
+ }, generateFilterInputs()), /*#__PURE__*/React.createElement(TableContext.Provider, {
20322
+ value: contextValue
20323
+ }, /*#__PURE__*/React.createElement("table", _extends({
18944
20324
  ref: ref
18945
20325
  }, props, {
18946
20326
  className: _JSXStyle.dynamic([["2132340556", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
@@ -18960,7 +20340,7 @@ function TableComponent(tableProps) {
18960
20340
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
18961
20341
  id: "2132340556",
18962
20342
  dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
18963
- }, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}"))));
20343
+ }, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")))));
18964
20344
  }
18965
20345
  TableComponent.displayName = 'Table';
18966
20346
  TableComponent.Column = TableColumn;
@@ -28843,144 +30223,6 @@ const HelpCircle = ({ color, strokeWidth, set }) => {
28843
30223
  HelpCircle.displayName = "HelpCircle";
28844
30224
  createIcon(HelpCircle);
28845
30225
 
28846
- var _excluded$7 = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
28847
- var getItemLayout = function getItemLayout(val) {
28848
- var display = val === 0 ? 'display: none;' : 'display: inherit;';
28849
- if (typeof val === 'number') {
28850
- var width = 100 / 24 * val;
28851
- var ratio = width > 100 ? '100%' : width < 0 ? '0' : "".concat(width, "%");
28852
- return {
28853
- grow: 0,
28854
- display: display,
28855
- width: ratio,
28856
- basis: ratio
28857
- };
28858
- }
28859
- return {
28860
- grow: 1,
28861
- display: display,
28862
- width: '100%',
28863
- basis: '0'
28864
- };
28865
- };
28866
- var GridBasicItem = function GridBasicItem(_ref) {
28867
- var _ref$xs = _ref.xs,
28868
- xs = _ref$xs === undefined ? false : _ref$xs,
28869
- _ref$sm = _ref.sm,
28870
- sm = _ref$sm === undefined ? false : _ref$sm,
28871
- _ref$md = _ref.md,
28872
- md = _ref$md === undefined ? false : _ref$md,
28873
- _ref$lg = _ref.lg,
28874
- lg = _ref$lg === undefined ? false : _ref$lg,
28875
- _ref$xl = _ref.xl,
28876
- xl = _ref$xl === undefined ? false : _ref$xl,
28877
- justify = _ref.justify,
28878
- direction = _ref.direction,
28879
- alignItems = _ref.alignItems,
28880
- alignContent = _ref.alignContent,
28881
- children = _ref.children,
28882
- _ref$className = _ref.className,
28883
- className = _ref$className === undefined ? '' : _ref$className,
28884
- props = _objectWithoutProperties(_ref, _excluded$7);
28885
- var theme = useTheme();
28886
- var _useScale = useScale(),
28887
- SCALES = _useScale.SCALES;
28888
- var classes = React.useMemo(function () {
28889
- var aligns = {
28890
- justify: justify,
28891
- direction: direction,
28892
- alignItems: alignItems,
28893
- alignContent: alignContent,
28894
- xs: xs,
28895
- sm: sm,
28896
- md: md,
28897
- lg: lg,
28898
- xl: xl
28899
- };
28900
- var classString = Object.keys(aligns).reduce(function (pre, name) {
28901
- if (aligns[name] !== undefined && aligns[name] !== false) return "".concat(pre, " ").concat(name);
28902
- return pre;
28903
- }, '');
28904
- return classString.trim();
28905
- }, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
28906
- var layout = React.useMemo(function () {
28907
- return {
28908
- xs: getItemLayout(xs),
28909
- sm: getItemLayout(sm),
28910
- md: getItemLayout(md),
28911
- lg: getItemLayout(lg),
28912
- xl: getItemLayout(xl)
28913
- };
28914
- }, [xs, sm, md, lg, xl]);
28915
- return /*#__PURE__*/React.createElement("div", _extends({}, props, {
28916
- className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || useClasses('item', classes, className) || "")
28917
- }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
28918
- id: "568430467",
28919
- dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
28920
- }, ".item.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1, 'inherit'), ";height:").concat(SCALES.height(1, 'auto'), ";}.justify.__jsx-style-dynamic-selector{-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";}.direction.__jsx-style-dynamic-selector{-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";}.alignContent.__jsx-style-dynamic-selector{-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";}.alignItems.__jsx-style-dynamic-selector{-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";}.xs.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xs.grow, ";-webkit-flex-grow:").concat(layout.xs.grow, ";-ms-flex-positive:").concat(layout.xs.grow, ";flex-grow:").concat(layout.xs.grow, ";max-width:").concat(layout.xs.width, ";-webkit-flex-basis:").concat(layout.xs.basis, ";-ms-flex-preferred-size:").concat(layout.xs.basis, ";flex-basis:").concat(layout.xs.basis, ";").concat(layout.xs.display, ";}@media only screen and (min-width:").concat(theme.breakpoints.sm.min, "){.sm.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.sm.grow, ";-webkit-flex-grow:").concat(layout.sm.grow, ";-ms-flex-positive:").concat(layout.sm.grow, ";flex-grow:").concat(layout.sm.grow, ";max-width:").concat(layout.sm.width, ";-webkit-flex-basis:").concat(layout.sm.basis, ";-ms-flex-preferred-size:").concat(layout.sm.basis, ";flex-basis:").concat(layout.sm.basis, ";").concat(layout.sm.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.md.min, "){.md.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.md.grow, ";-webkit-flex-grow:").concat(layout.md.grow, ";-ms-flex-positive:").concat(layout.md.grow, ";flex-grow:").concat(layout.md.grow, ";max-width:").concat(layout.md.width, ";-webkit-flex-basis:").concat(layout.md.basis, ";-ms-flex-preferred-size:").concat(layout.md.basis, ";flex-basis:").concat(layout.md.basis, ";").concat(layout.md.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.lg.min, "){.lg.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.lg.grow, ";-webkit-flex-grow:").concat(layout.lg.grow, ";-ms-flex-positive:").concat(layout.lg.grow, ";flex-grow:").concat(layout.lg.grow, ";max-width:").concat(layout.lg.width, ";-webkit-flex-basis:").concat(layout.lg.basis, ";-ms-flex-preferred-size:").concat(layout.lg.basis, ";flex-basis:").concat(layout.lg.basis, ";").concat(layout.lg.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.xl.min, "){.xl.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xl.grow, ";-webkit-flex-grow:").concat(layout.xl.grow, ";-ms-flex-positive:").concat(layout.xl.grow, ";flex-grow:").concat(layout.xl.grow, ";max-width:").concat(layout.xl.width, ";-webkit-flex-basis:").concat(layout.xl.basis, ";-ms-flex-preferred-size:").concat(layout.xl.basis, ";flex-basis:").concat(layout.xl.basis, ";").concat(layout.xl.display, ";}}")));
28921
- };
28922
- GridBasicItem.displayName = 'GridBasicItem';
28923
-
28924
- var _excluded$6 = ["gap", "wrap", "children", "className"];
28925
- var GridContainerComponent = function GridContainerComponent(_ref) {
28926
- var _ref$gap = _ref.gap,
28927
- gap = _ref$gap === undefined ? 0 : _ref$gap,
28928
- _ref$wrap = _ref.wrap,
28929
- wrap = _ref$wrap === undefined ? 'wrap' : _ref$wrap,
28930
- children = _ref.children,
28931
- _ref$className = _ref.className,
28932
- className = _ref$className === undefined ? '' : _ref$className,
28933
- props = _objectWithoutProperties(_ref, _excluded$6);
28934
- var _useScale = useScale(),
28935
- unit = _useScale.unit,
28936
- SCALES = _useScale.SCALES;
28937
- var gapUnit = React.useMemo(function () {
28938
- return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
28939
- }, [gap, unit]);
28940
- var _styles$className = {
28941
- styles: /*#__PURE__*/React.createElement(_JSXStyle, {
28942
- id: "3631618093",
28943
- dynamic: [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]
28944
- }, "div.__jsx-style-dynamic-selector{--grid-gap-unit:".concat(gapUnit, ";--grid-container-margin:calc(-1 * var(--grid-gap-unit));--grid-container-width:calc(100% + var(--grid-gap-unit) * 2);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";box-sizing:border-box;width:").concat(SCALES.width(1, 'var(--grid-container-width)'), ";margin:").concat(SCALES.mt(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mr(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mb(0, 'var(--grid-container-margin)'), " ").concat(SCALES.ml(0, 'var(--grid-container-margin)'), ";}")),
28945
- className: _JSXStyle.dynamic([["3631618093", [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]]])
28946
- },
28947
- resolveClassName = _styles$className.className,
28948
- styles = _styles$className.styles;
28949
- var classes = useClasses(resolveClassName, className);
28950
- return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
28951
- className: classes
28952
- }, props), children, styles);
28953
- };
28954
- GridContainerComponent.displayName = 'GridContainer';
28955
- var GridContainer = withScale(GridContainerComponent);
28956
-
28957
- var _excluded$5 = ["children", "className"];
28958
- var GridComponent = function GridComponent(_ref) {
28959
- var children = _ref.children,
28960
- _ref$className = _ref.className,
28961
- className = _ref$className === undefined ? '' : _ref$className,
28962
- props = _objectWithoutProperties(_ref, _excluded$5);
28963
- var _useScale = useScale(),
28964
- SCALES = _useScale.SCALES;
28965
- var _styles$className = {
28966
- styles: /*#__PURE__*/React.createElement(_JSXStyle, {
28967
- id: "1271839607",
28968
- dynamic: [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]
28969
- }, "div.__jsx-style-dynamic-selector{margin:".concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";box-sizing:border-box;padding:").concat(SCALES.pt(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pr(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pb(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pl(0, 'var(--grid-gap-unit)'), ";}")),
28970
- className: _JSXStyle.dynamic([["1271839607", [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]]])
28971
- },
28972
- resolveClassName = _styles$className.className,
28973
- styles = _styles$className.styles;
28974
- var classes = useClasses(resolveClassName, className);
28975
- return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
28976
- className: classes
28977
- }, props), children, styles);
28978
- };
28979
- GridComponent.displayName = 'Grid';
28980
- var Grid = withScale(GridComponent);
28981
-
28982
- Grid.Container = GridContainer;
28983
-
28984
30226
  var ButtonDrip = function ButtonDrip(_ref) {
28985
30227
  var _ref$x = _ref.x,
28986
30228
  x = _ref$x === undefined ? 0 : _ref$x,
@@ -29035,7 +30277,7 @@ var ButtonDrip = function ButtonDrip(_ref) {
29035
30277
  };
29036
30278
  ButtonDrip.displayName = 'ButtonDrip';
29037
30279
 
29038
- var _excluded$4 = ["children", "type", "color", "className", "spaceRatio"];
30280
+ var _excluded$3 = ["children", "type", "color", "className", "spaceRatio"];
29039
30281
  var getIconBgColor = function getIconBgColor(type, palette, color) {
29040
30282
  var colors = {
29041
30283
  "default": palette.accents_6,
@@ -29055,7 +30297,7 @@ var LoadingComponent = function LoadingComponent(_ref) {
29055
30297
  className = _ref$className === undefined ? '' : _ref$className,
29056
30298
  _ref$spaceRatio = _ref.spaceRatio,
29057
30299
  spaceRatio = _ref$spaceRatio === undefined ? 1 : _ref$spaceRatio,
29058
- props = _objectWithoutProperties(_ref, _excluded$4);
30300
+ props = _objectWithoutProperties(_ref, _excluded$3);
29059
30301
  var theme = useTheme();
29060
30302
  var _useScale = useScale(),
29061
30303
  SCALES = _useScale.SCALES;
@@ -29095,7 +30337,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
29095
30337
  };
29096
30338
  ButtonLoading.displayName = 'GeistButtonLoading';
29097
30339
 
29098
- var _excluded$3 = ["isRight", "isSingle", "children", "className"];
30340
+ var _excluded$2 = ["isRight", "isSingle", "children", "className"];
29099
30341
  var ButtonIcon = function ButtonIcon(_ref) {
29100
30342
  var _ref$isRight = _ref.isRight,
29101
30343
  isRight = _ref$isRight === undefined ? false : _ref$isRight,
@@ -29103,7 +30345,7 @@ var ButtonIcon = function ButtonIcon(_ref) {
29103
30345
  children = _ref.children,
29104
30346
  _ref$className = _ref.className,
29105
30347
  className = _ref$className === undefined ? '' : _ref$className,
29106
- props = _objectWithoutProperties(_ref, _excluded$3);
30348
+ props = _objectWithoutProperties(_ref, _excluded$2);
29107
30349
  var classes = useClasses('icon', {
29108
30350
  right: isRight,
29109
30351
  single: isSingle
@@ -29385,7 +30627,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
29385
30627
  return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
29386
30628
  };
29387
30629
 
29388
- var _excluded$2 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
30630
+ var _excluded$1 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
29389
30631
  var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
29390
30632
  var theme = useTheme();
29391
30633
  var _useScale = useScale(),
@@ -29431,7 +30673,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
29431
30673
  _filteredProps$classN = filteredProps.className,
29432
30674
  className = _filteredProps$classN === undefined ? '' : _filteredProps$classN;
29433
30675
  filteredProps.crossOrigin;
29434
- var props = _objectWithoutProperties(filteredProps, _excluded$2);
30676
+ var props = _objectWithoutProperties(filteredProps, _excluded$1);
29435
30677
  /* eslint-enable @typescript-eslint/no-unused-vars */
29436
30678
 
29437
30679
  var _useMemo = React.useMemo(function () {
@@ -29500,121 +30742,6 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
29500
30742
  ButtonComponent.displayName = 'Button';
29501
30743
  var Button = withScale(ButtonComponent);
29502
30744
 
29503
- var useSSR = function useSSR() {
29504
- var _useState = React.useState(false),
29505
- _useState2 = _slicedToArray(_useState, 2),
29506
- browser = _useState2[0],
29507
- setBrowser = _useState2[1];
29508
- React.useEffect(function () {
29509
- setBrowser(isBrowser());
29510
- }, []);
29511
- return {
29512
- isBrowser: browser,
29513
- isServer: !browser
29514
- };
29515
- };
29516
-
29517
- var createElement = function createElement(id) {
29518
- var el = document.createElement('div');
29519
- el.setAttribute('id', id);
29520
- return el;
29521
- };
29522
- var usePortal = function usePortal() {
29523
- var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
29524
- var getContainer = arguments.length > 1 ? arguments[1] : undefined;
29525
- var id = "helpdice-ui-".concat(selectId);
29526
- var _useSSR = useSSR(),
29527
- isBrowser = _useSSR.isBrowser;
29528
- var _useState = React.useState(isBrowser ? createElement(id) : null),
29529
- _useState2 = _slicedToArray(_useState, 2),
29530
- elSnapshot = _useState2[0],
29531
- setElSnapshot = _useState2[1];
29532
- React.useEffect(function () {
29533
- var customContainer = getContainer ? getContainer() : null;
29534
- var parentElement = customContainer || document.body;
29535
- var hasElement = parentElement.querySelector("#".concat(id));
29536
- var el = hasElement || createElement(id);
29537
- if (!hasElement) {
29538
- parentElement.appendChild(el);
29539
- }
29540
- setElSnapshot(el);
29541
- }, []);
29542
- return elSnapshot;
29543
- };
29544
-
29545
- var _excluded$1 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
29546
- var CssTransition = function CssTransition(_ref) {
29547
- var children = _ref.children,
29548
- _ref$className = _ref.className,
29549
- className = _ref$className === undefined ? '' : _ref$className,
29550
- _ref$visible = _ref.visible,
29551
- visible = _ref$visible === undefined ? false : _ref$visible,
29552
- _ref$enterTime = _ref.enterTime,
29553
- enterTime = _ref$enterTime === undefined ? 60 : _ref$enterTime,
29554
- _ref$leaveTime = _ref.leaveTime,
29555
- leaveTime = _ref$leaveTime === undefined ? 60 : _ref$leaveTime,
29556
- _ref$clearTime = _ref.clearTime,
29557
- clearTime = _ref$clearTime === undefined ? 60 : _ref$clearTime,
29558
- _ref$name = _ref.name,
29559
- name = _ref$name === undefined ? 'transition' : _ref$name,
29560
- props = _objectWithoutProperties(_ref, _excluded$1);
29561
- var _useState = React.useState(''),
29562
- _useState2 = _slicedToArray(_useState, 2),
29563
- classes = _useState2[0],
29564
- setClasses = _useState2[1];
29565
- var _useState3 = React.useState(visible),
29566
- _useState4 = _slicedToArray(_useState3, 2),
29567
- renderable = _useState4[0],
29568
- setRenderable = _useState4[1];
29569
- React.useEffect(function () {
29570
- var statusClassName = visible ? 'enter' : 'leave';
29571
- var time = visible ? enterTime : leaveTime;
29572
- if (visible && !renderable) {
29573
- setRenderable(true);
29574
- }
29575
- setClasses("".concat(name, "-").concat(statusClassName));
29576
-
29577
- // set class to active
29578
- var timer = setTimeout(function () {
29579
- setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
29580
- clearTimeout(timer);
29581
- }, time);
29582
-
29583
- // remove classess when animation over
29584
- var clearClassesTimer = setTimeout(function () {
29585
- if (!visible) {
29586
- setClasses('');
29587
- setRenderable(false);
29588
- }
29589
- clearTimeout(clearClassesTimer);
29590
- }, time + clearTime);
29591
- return function () {
29592
- clearTimeout(timer);
29593
- clearTimeout(clearClassesTimer);
29594
- };
29595
- }, [visible, renderable]);
29596
- if (! /*#__PURE__*/React.isValidElement(children) || !renderable) return null;
29597
- var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
29598
- className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
29599
- });
29600
- return /*#__PURE__*/React.cloneElement(children, propsTransition);
29601
- };
29602
- CssTransition.displayName = 'CssTransition';
29603
-
29604
- /* "use client" */
29605
-
29606
- var useClickAnyWhere = function useClickAnyWhere(handler) {
29607
- React.useEffect(function () {
29608
- var callback = function callback(event) {
29609
- return handler(event);
29610
- };
29611
- document.addEventListener('click', callback);
29612
- return function () {
29613
- return document.removeEventListener('click', callback);
29614
- };
29615
- }, [handler]);
29616
- };
29617
-
29618
30745
  var getColors = function getColors(type, palette) {
29619
30746
  var colors = {
29620
30747
  "default": palette.background,