@vchasno/ui-kit 0.3.14 → 0.3.16

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.
@@ -4984,14 +4984,14 @@ var defaultAriaLiveMessages = {
4984
4984
  guidance: function guidance(props) {
4985
4985
  var isSearchable = props.isSearchable,
4986
4986
  isMulti = props.isMulti,
4987
+ isDisabled = props.isDisabled,
4987
4988
  tabSelectsValue = props.tabSelectsValue,
4988
- context = props.context,
4989
- isInitialFocus = props.isInitialFocus;
4989
+ context = props.context;
4990
4990
  switch (context) {
4991
4991
  case 'menu':
4992
- return "Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
4992
+ return "Use Up and Down to choose options".concat(isDisabled ? '' : ', press Enter to select the currently focused option', ", press Escape to exit the menu").concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
4993
4993
  case 'input':
4994
- return isInitialFocus ? "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '') : '';
4994
+ return "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '');
4995
4995
  case 'value':
4996
4996
  return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
4997
4997
  default:
@@ -5027,18 +5027,17 @@ var defaultAriaLiveMessages = {
5027
5027
  label = _props$label2 === void 0 ? '' : _props$label2,
5028
5028
  selectValue = props.selectValue,
5029
5029
  isDisabled = props.isDisabled,
5030
- isSelected = props.isSelected,
5031
- isAppleDevice = props.isAppleDevice;
5030
+ isSelected = props.isSelected;
5032
5031
  var getArrayIndex = function getArrayIndex(arr, item) {
5033
5032
  return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
5034
5033
  };
5035
5034
  if (context === 'value' && selectValue) {
5036
5035
  return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
5037
5036
  }
5038
- if (context === 'menu' && isAppleDevice) {
5037
+ if (context === 'menu') {
5039
5038
  var disabled = isDisabled ? ' disabled' : '';
5040
- var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
5041
- return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5039
+ var status = "".concat(isSelected ? 'selected' : 'focused').concat(disabled);
5040
+ return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5042
5041
  }
5043
5042
  return '';
5044
5043
  },
@@ -5057,8 +5056,7 @@ var LiveRegion = function LiveRegion(props) {
5057
5056
  isFocused = props.isFocused,
5058
5057
  selectValue = props.selectValue,
5059
5058
  selectProps = props.selectProps,
5060
- id = props.id,
5061
- isAppleDevice = props.isAppleDevice;
5059
+ id = props.id;
5062
5060
  var ariaLiveMessages = selectProps.ariaLiveMessages,
5063
5061
  getOptionLabel = selectProps.getOptionLabel,
5064
5062
  inputValue = selectProps.inputValue,
@@ -5068,8 +5066,7 @@ var LiveRegion = function LiveRegion(props) {
5068
5066
  menuIsOpen = selectProps.menuIsOpen,
5069
5067
  options = selectProps.options,
5070
5068
  screenReaderStatus = selectProps.screenReaderStatus,
5071
- tabSelectsValue = selectProps.tabSelectsValue,
5072
- isLoading = selectProps.isLoading;
5069
+ tabSelectsValue = selectProps.tabSelectsValue;
5073
5070
  var ariaLabel = selectProps['aria-label'];
5074
5071
  var ariaLive = selectProps['aria-live'];
5075
5072
 
@@ -5122,16 +5119,15 @@ var LiveRegion = function LiveRegion(props) {
5122
5119
  isSelected: isSelected,
5123
5120
  options: focusableOptions,
5124
5121
  context: focused === focusedOption ? 'menu' : 'value',
5125
- selectValue: selectValue,
5126
- isAppleDevice: isAppleDevice
5122
+ selectValue: selectValue
5127
5123
  };
5128
5124
  focusMsg = messages.onFocus(onFocusProps);
5129
5125
  }
5130
5126
  return focusMsg;
5131
- }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
5127
+ }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
5132
5128
  var ariaResults = useMemo(function () {
5133
5129
  var resultsMsg = '';
5134
- if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
5130
+ if (menuIsOpen && options.length && messages.onFilter) {
5135
5131
  var resultsMessage = screenReaderStatus({
5136
5132
  count: focusableOptions.length
5137
5133
  });
@@ -5141,8 +5137,7 @@ var LiveRegion = function LiveRegion(props) {
5141
5137
  });
5142
5138
  }
5143
5139
  return resultsMsg;
5144
- }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
5145
- var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5140
+ }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
5146
5141
  var ariaGuidance = useMemo(function () {
5147
5142
  var guidanceMsg = '';
5148
5143
  if (messages.guidance) {
@@ -5153,28 +5148,24 @@ var LiveRegion = function LiveRegion(props) {
5153
5148
  isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
5154
5149
  isMulti: isMulti,
5155
5150
  isSearchable: isSearchable,
5156
- tabSelectsValue: tabSelectsValue,
5157
- isInitialFocus: isInitialFocus
5151
+ tabSelectsValue: tabSelectsValue
5158
5152
  });
5159
5153
  }
5160
5154
  return guidanceMsg;
5161
- }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
5155
+ }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
5156
+ var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
5162
5157
  var ScreenReaderText = jsx(Fragment, null, jsx("span", {
5163
5158
  id: "aria-selection"
5164
5159
  }, ariaSelected), jsx("span", {
5165
- id: "aria-focused"
5166
- }, ariaFocused), jsx("span", {
5167
- id: "aria-results"
5168
- }, ariaResults), jsx("span", {
5169
- id: "aria-guidance"
5170
- }, ariaGuidance));
5160
+ id: "aria-context"
5161
+ }, ariaContext));
5162
+ var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5171
5163
  return jsx(Fragment, null, jsx(A11yText$1, {
5172
5164
  id: id
5173
5165
  }, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
5174
5166
  "aria-live": ariaLive,
5175
5167
  "aria-atomic": "false",
5176
- "aria-relevant": "additions text",
5177
- role: "log"
5168
+ "aria-relevant": "additions text"
5178
5169
  }, isFocused && !isInitialFocus && ScreenReaderText));
5179
5170
  };
5180
5171
  var LiveRegion$1 = LiveRegion;
@@ -5814,30 +5805,6 @@ var RequiredInput = function RequiredInput(_ref) {
5814
5805
  };
5815
5806
  var RequiredInput$1 = RequiredInput;
5816
5807
 
5817
- /// <reference types="user-agent-data-types" />
5818
-
5819
- function testPlatform(re) {
5820
- var _window$navigator$use;
5821
- return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false;
5822
- }
5823
- function isIPhone() {
5824
- return testPlatform(/^iPhone/i);
5825
- }
5826
- function isMac() {
5827
- return testPlatform(/^Mac/i);
5828
- }
5829
- function isIPad() {
5830
- return testPlatform(/^iPad/i) ||
5831
- // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
5832
- isMac() && navigator.maxTouchPoints > 1;
5833
- }
5834
- function isIOS() {
5835
- return isIPhone() || isIPad();
5836
- }
5837
- function isAppleDevice() {
5838
- return isMac() || isIOS();
5839
- }
5840
-
5841
5808
  var formatGroupLabel = function formatGroupLabel(group) {
5842
5809
  return group.label;
5843
5810
  };
@@ -6007,24 +5974,6 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
6007
5974
  return optionsAccumulator;
6008
5975
  }, []);
6009
5976
  }
6010
- function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
6011
- return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
6012
- if (categorizedOption.type === 'group') {
6013
- optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
6014
- return {
6015
- data: option.data,
6016
- id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
6017
- };
6018
- })));
6019
- } else {
6020
- optionsAccumulator.push({
6021
- data: categorizedOption.data,
6022
- id: "".concat(optionId, "-").concat(categorizedOption.index)
6023
- });
6024
- }
6025
- return optionsAccumulator;
6026
- }, []);
6027
- }
6028
5977
  function buildFocusableOptions(props, selectValue) {
6029
5978
  return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
6030
5979
  }
@@ -6062,13 +6011,6 @@ function getNextFocusedOption(state, options) {
6062
6011
  var lastFocusedOption = state.focusedOption;
6063
6012
  return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
6064
6013
  }
6065
- var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
6066
- var _focusableOptionsWith;
6067
- var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
6068
- return option.data === focusedOption;
6069
- })) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
6070
- return focusedOptionId || null;
6071
- };
6072
6014
  var getOptionLabel = function getOptionLabel(props, data) {
6073
6015
  return props.getOptionLabel(data);
6074
6016
  };
@@ -6119,8 +6061,6 @@ var Select = /*#__PURE__*/function (_Component) {
6119
6061
  _this.state = {
6120
6062
  ariaSelection: null,
6121
6063
  focusedOption: null,
6122
- focusedOptionId: null,
6123
- focusableOptionsWithIds: [],
6124
6064
  focusedValue: null,
6125
6065
  inputIsHidden: false,
6126
6066
  isFocused: false,
@@ -6128,18 +6068,17 @@ var Select = /*#__PURE__*/function (_Component) {
6128
6068
  clearFocusValueOnUpdate: false,
6129
6069
  prevWasFocused: false,
6130
6070
  inputIsHiddenAfterUpdate: undefined,
6131
- prevProps: undefined,
6132
- instancePrefix: ''
6071
+ prevProps: undefined
6133
6072
  };
6134
6073
  _this.blockOptionHover = false;
6135
6074
  _this.isComposing = false;
6136
6075
  _this.commonProps = void 0;
6137
6076
  _this.initialTouchX = 0;
6138
6077
  _this.initialTouchY = 0;
6078
+ _this.instancePrefix = '';
6139
6079
  _this.openAfterFocus = false;
6140
6080
  _this.scrollToFocusedOptionOnUpdate = false;
6141
6081
  _this.userIsDragging = void 0;
6142
- _this.isAppleDevice = isAppleDevice();
6143
6082
  _this.controlRef = null;
6144
6083
  _this.getControlRef = function (ref) {
6145
6084
  _this.controlRef = ref;
@@ -6254,12 +6193,6 @@ var Select = /*#__PURE__*/function (_Component) {
6254
6193
  removedValue: lastSelectedValue
6255
6194
  });
6256
6195
  };
6257
- _this.getFocusedOptionId = function (focusedOption) {
6258
- return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
6259
- };
6260
- _this.getFocusableOptionsWithIds = function () {
6261
- return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
6262
- };
6263
6196
  _this.getValue = function () {
6264
6197
  return _this.state.selectValue;
6265
6198
  };
@@ -6287,7 +6220,7 @@ var Select = /*#__PURE__*/function (_Component) {
6287
6220
  return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
6288
6221
  };
6289
6222
  _this.getElementId = function (element) {
6290
- return "".concat(_this.state.instancePrefix, "-").concat(element);
6223
+ return "".concat(_this.instancePrefix, "-").concat(element);
6291
6224
  };
6292
6225
  _this.getComponents = function () {
6293
6226
  return defaultComponents(_this.props);
@@ -6496,11 +6429,8 @@ var Select = /*#__PURE__*/function (_Component) {
6496
6429
  if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
6497
6430
  return;
6498
6431
  }
6499
- var options = _this.getFocusableOptions();
6500
- var focusedOptionIndex = options.indexOf(focusedOption);
6501
6432
  _this.setState({
6502
- focusedOption: focusedOption,
6503
- focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
6433
+ focusedOption: focusedOption
6504
6434
  });
6505
6435
  };
6506
6436
  _this.shouldHideSelectedOptions = function () {
@@ -6644,16 +6574,14 @@ var Select = /*#__PURE__*/function (_Component) {
6644
6574
  }
6645
6575
  event.preventDefault();
6646
6576
  };
6647
- _this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6577
+ _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6648
6578
  _this.state.selectValue = cleanValue(_props.value);
6579
+
6649
6580
  // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
6650
6581
  if (_props.menuIsOpen && _this.state.selectValue.length) {
6651
- var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
6652
6582
  var focusableOptions = _this.buildFocusableOptions();
6653
6583
  var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
6654
- _this.state.focusableOptionsWithIds = focusableOptionsWithIds;
6655
6584
  _this.state.focusedOption = focusableOptions[optionIndex];
6656
- _this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
6657
6585
  }
6658
6586
  return _this;
6659
6587
  }
@@ -6778,8 +6706,7 @@ var Select = /*#__PURE__*/function (_Component) {
6778
6706
  this.setState({
6779
6707
  inputIsHiddenAfterUpdate: false,
6780
6708
  focusedValue: null,
6781
- focusedOption: focusableOptions[openAtIndex],
6782
- focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
6709
+ focusedOption: focusableOptions[openAtIndex]
6783
6710
  }, function () {
6784
6711
  return _this2.onMenuOpen();
6785
6712
  });
@@ -6855,8 +6782,7 @@ var Select = /*#__PURE__*/function (_Component) {
6855
6782
  this.scrollToFocusedOptionOnUpdate = true;
6856
6783
  this.setState({
6857
6784
  focusedOption: options[nextFocus],
6858
- focusedValue: null,
6859
- focusedOptionId: this.getFocusedOptionId(options[nextFocus])
6785
+ focusedValue: null
6860
6786
  });
6861
6787
  }
6862
6788
  }, {
@@ -7052,10 +6978,10 @@ var Select = /*#__PURE__*/function (_Component) {
7052
6978
  'aria-label': this.props['aria-label'],
7053
6979
  'aria-labelledby': this.props['aria-labelledby'],
7054
6980
  'aria-required': required,
7055
- role: 'combobox',
7056
- 'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
6981
+ role: 'combobox'
7057
6982
  }, menuIsOpen && {
7058
- 'aria-controls': this.getElementId('listbox')
6983
+ 'aria-controls': this.getElementId('listbox'),
6984
+ 'aria-owns': this.getElementId('listbox')
7059
6985
  }), !isSearchable && {
7060
6986
  'aria-readonly': true
7061
6987
  }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
@@ -7300,11 +7226,8 @@ var Select = /*#__PURE__*/function (_Component) {
7300
7226
  onClick: onSelect,
7301
7227
  onMouseMove: onHover,
7302
7228
  onMouseOver: onHover,
7303
- tabIndex: -1,
7304
- role: 'option',
7305
- 'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
7229
+ tabIndex: -1
7306
7230
  };
7307
-
7308
7231
  return /*#__PURE__*/React.createElement(Option, _extends({}, commonProps, {
7309
7232
  innerProps: innerProps,
7310
7233
  data: data,
@@ -7373,7 +7296,8 @@ var Select = /*#__PURE__*/function (_Component) {
7373
7296
  innerRef: ref,
7374
7297
  innerProps: {
7375
7298
  onMouseDown: _this4.onMenuMouseDown,
7376
- onMouseMove: _this4.onMenuMouseMove
7299
+ onMouseMove: _this4.onMenuMouseMove,
7300
+ id: _this4.getElementId('listbox')
7377
7301
  },
7378
7302
  isLoading: isLoading,
7379
7303
  placement: placement
@@ -7388,11 +7312,6 @@ var Select = /*#__PURE__*/function (_Component) {
7388
7312
  _this4.getMenuListRef(instance);
7389
7313
  scrollTargetRef(instance);
7390
7314
  },
7391
- innerProps: {
7392
- role: 'listbox',
7393
- 'aria-multiselectable': commonProps.isMulti,
7394
- id: _this4.getElementId('listbox')
7395
- },
7396
7315
  isLoading: isLoading,
7397
7316
  maxHeight: maxHeight,
7398
7317
  focusedOption: focusedOption
@@ -7480,8 +7399,7 @@ var Select = /*#__PURE__*/function (_Component) {
7480
7399
  focusedValue: focusedValue,
7481
7400
  isFocused: isFocused,
7482
7401
  selectValue: selectValue,
7483
- focusableOptions: focusableOptions,
7484
- isAppleDevice: this.isAppleDevice
7402
+ focusableOptions: focusableOptions
7485
7403
  }));
7486
7404
  }
7487
7405
  }, {
@@ -7530,8 +7448,7 @@ var Select = /*#__PURE__*/function (_Component) {
7530
7448
  inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
7531
7449
  ariaSelection = state.ariaSelection,
7532
7450
  isFocused = state.isFocused,
7533
- prevWasFocused = state.prevWasFocused,
7534
- instancePrefix = state.instancePrefix;
7451
+ prevWasFocused = state.prevWasFocused;
7535
7452
  var options = props.options,
7536
7453
  value = props.value,
7537
7454
  menuIsOpen = props.menuIsOpen,
@@ -7541,15 +7458,11 @@ var Select = /*#__PURE__*/function (_Component) {
7541
7458
  var newMenuOptionsState = {};
7542
7459
  if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
7543
7460
  var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
7544
- var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
7545
7461
  var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
7546
7462
  var focusedOption = getNextFocusedOption(state, focusableOptions);
7547
- var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
7548
7463
  newMenuOptionsState = {
7549
7464
  selectValue: selectValue,
7550
7465
  focusedOption: focusedOption,
7551
- focusedOptionId: focusedOptionId,
7552
- focusableOptionsWithIds: focusableOptionsWithIds,
7553
7466
  focusedValue: focusedValue,
7554
7467
  clearFocusValueOnUpdate: false
7555
7468
  };
@@ -7879,11 +7792,14 @@ var Spinner = function (_a) {
7879
7792
  React__default.createElement("circle", { className: "vchasno-ui-spinner__svg__circle", cx: "50", cy: "50", r: "20", fill: "none", stroke: color, strokeWidth: "2", strokeMiterlimit: "10" }))));
7880
7793
  };
7881
7794
 
7882
- var css_248z$1 = ".vchasno-ui-label-text {\n position: absolute;\n z-index: 2;\n top: 50%;\n left: 12px;\n display: inline-flex;\n max-width: calc(100% - 20px);\n align-self: flex-start;\n padding: 4px;\n background-color: #fff;\n color: var(--vchasno-ui-label-color-default);\n font-size: var(--vchasno-ui-input-font-size);\n gap: 3px;\n line-height: calc(var(--vchasno-ui-input-font-size) * 1.2);\n pointer-events: none;\n text-overflow: ellipsis;\n transform: translate(0, -50%);\n transition:\n color var(--vchasno-ui-transition-duration-sec, 0.3s),\n top 0.3s,\n font-size 0.3s;\n white-space: nowrap;\n}\n\n.vchasno-ui-select .vchasno-ui-label-text {\n max-width: calc(100% - 40px);\n}\n\n.vchasno-ui-select__floating-label,\n[class^='vchasno-ui-']:not(:placeholder-shown) + .vchasno-ui-label-text,\n[class^='vchasno-ui-']:focus:not(.--disabled) + .vchasno-ui-label-text {\n top: 0;\n font-size: 12px;\n}\n\nlabel[class^='vchasno-ui-']:not(.--error):focus-within .vchasno-ui-label-text {\n color: var(--vchasno-ui-label-color-focused);\n}\n\nlabel[class^='vchasno-ui-']:not(.--disabled).--error .vchasno-ui-label-text {\n color: var(--vchasno-ui-input-color-error);\n}\n\nlabel[class^='vchasno-ui-']:not(.--disabled).--required .vchasno-ui-label-text:hover {\n cursor: text;\n}\n\n.vchasno-ui-label-text sup {\n position: relative;\n top: -0.2em;\n display: none;\n color: var(--vchasno-ui-input-color-error);\n font-size: calc(var(--vchasno-ui-input-font-size) * 1.4);\n vertical-align: top;\n}\n\nlabel[class^='vchasno-ui-'].--required .vchasno-ui-label-text sup {\n display: inline-block;\n}\n\n.vchasno-ui-label-text__title-icon {\n display: none;\n color: var(--vchasno-ui-label-color-default);\n transform: scale(0.8);\n}\n\n.vchasno-ui-input[title] .vchasno-ui-label-text__title-icon {\n display: block;\n}\n\n.vchasno-ui-label-text__content {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
7795
+ var css_248z$1 = ".vchasno-ui-label-text {\n position: absolute;\n z-index: 1;\n top: 50%;\n left: 12px;\n display: inline-flex;\n max-width: calc(100% - 20px);\n align-self: flex-start;\n padding: 0 4px;\n background-color: var(--vchasno-ui-input-bg-color);\n color: var(--vchasno-ui-label-color-default);\n font-size: var(--vchasno-ui-input-font-size);\n gap: 3px;\n line-height: calc(var(--vchasno-ui-input-font-size) * 1.2);\n pointer-events: none;\n text-overflow: ellipsis;\n transform: translate(0, -50%);\n transition:\n color var(--vchasno-ui-transition-duration-sec, 0.3s),\n top 0.3s,\n font-size 0.3s;\n white-space: nowrap;\n}\n\n.vchasno-ui-select .vchasno-ui-label-text {\n max-width: calc(100% - 40px);\n}\n\n.vchasno-ui-select__floating-label,\n[class^='vchasno-ui-']:not(:placeholder-shown) + .vchasno-ui-label-text,\n[class^='vchasno-ui-']:focus:not(.--disabled) + .vchasno-ui-label-text {\n top: 0;\n font-size: 12px;\n}\n\nlabel[class^='vchasno-ui-']:not(.--error):focus-within .vchasno-ui-label-text {\n color: var(--vchasno-ui-label-color-focused);\n}\n\nlabel[class^='vchasno-ui-']:not(.--disabled).--error .vchasno-ui-label-text {\n color: var(--vchasno-ui-input-color-error);\n}\n\nlabel[class^='vchasno-ui-']:not(.--disabled).--required .vchasno-ui-label-text:hover {\n cursor: text;\n}\n\n.vchasno-ui-label-text sup {\n position: relative;\n top: -0.2em;\n display: none;\n color: var(--vchasno-ui-input-color-error);\n font-size: calc(var(--vchasno-ui-input-font-size) * 1.4);\n vertical-align: top;\n}\n\nlabel[class^='vchasno-ui-'].--required .vchasno-ui-label-text sup {\n display: inline-block;\n}\n\n.vchasno-ui-label-text__title-icon {\n display: none;\n color: var(--vchasno-ui-label-color-default);\n transform: scale(0.8);\n}\n\n.vchasno-ui-input[title] .vchasno-ui-label-text__title-icon {\n display: block;\n}\n\n.vchasno-ui-label-text__content {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
7883
7796
  styleInject(css_248z$1);
7884
7797
 
7885
7798
  var LabelText = function (_a) {
7886
7799
  var className = _a.className, children = _a.children;
7800
+ if (!children) {
7801
+ return null;
7802
+ }
7887
7803
  return (React__default.createElement("span", { className: cn('vchasno-ui-label-text', className) },
7888
7804
  React__default.createElement("svg", { className: "vchasno-ui-label-text__title-icon", width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
7889
7805
  React__default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15 7.5C15 11.6422 11.6423 15 7.5 15C3.3577 15 0 11.6422 0 7.5C0 3.35781 3.3577 0 7.5 0C11.6423 0 15 3.35781 15 7.5ZM5.87799 5.82184H8.52997V11.4711C8.52997 12.0179 8.08667 12.4612 7.53983 12.4612C6.99299 12.4612 6.54968 12.0179 6.54968 11.4711V7.57782H5.87799C5.39309 7.57782 5 7.18473 5 6.69983C5 6.21493 5.39309 5.82184 5.87799 5.82184ZM6.26221 3.66559C6.26221 3.50973 6.2899 3.36436 6.34483 3.22949C6.40431 3.09045 6.48466 2.97036 6.58636 2.86924C6.68805 2.76812 6.80655 2.6881 6.94229 2.62907C7.00404 2.603 7.06759 2.58269 7.13342 2.56813C7.21696 2.54984 7.30367 2.54059 7.39356 2.54059C7.54611 2.54059 7.69002 2.57004 7.82577 2.62907C7.86254 2.64499 7.89795 2.66248 7.932 2.68144C8.02416 2.73279 8.10724 2.79543 8.1817 2.86924C8.28339 2.97036 8.36375 3.09045 8.42322 3.22949C8.4541 3.29981 8.47725 3.37294 8.49178 3.44889C8.5054 3.51876 8.51221 3.59099 8.51221 3.66559C8.51221 3.74956 8.50358 3.83116 8.48633 3.91027C8.4718 3.97799 8.45046 4.0439 8.42322 4.108C8.36375 4.24287 8.28339 4.36081 8.1817 4.46194C8.12949 4.51374 8.07319 4.56001 8.01236 4.60076C7.95425 4.63947 7.89205 4.67333 7.82577 4.70211C7.69002 4.76113 7.54611 4.79059 7.39356 4.79059C7.31411 4.79059 7.23739 4.78348 7.16339 4.76914C7.08666 4.75447 7.01311 4.73213 6.94229 4.70211C6.80655 4.64308 6.68805 4.56306 6.58636 4.46194C6.48466 4.36081 6.40431 4.24287 6.34483 4.108C6.2899 3.96896 6.26221 3.82145 6.26221 3.66559Z", fill: "currentColor" })),