@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.
@@ -5051,14 +5051,14 @@ var defaultAriaLiveMessages = {
5051
5051
  guidance: function guidance(props) {
5052
5052
  var isSearchable = props.isSearchable,
5053
5053
  isMulti = props.isMulti,
5054
+ isDisabled = props.isDisabled,
5054
5055
  tabSelectsValue = props.tabSelectsValue,
5055
- context = props.context,
5056
- isInitialFocus = props.isInitialFocus;
5056
+ context = props.context;
5057
5057
  switch (context) {
5058
5058
  case 'menu':
5059
- 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' : '', ".");
5059
+ 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' : '', ".");
5060
5060
  case 'input':
5061
- 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' : '') : '';
5061
+ 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' : '');
5062
5062
  case 'value':
5063
5063
  return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
5064
5064
  default:
@@ -5094,18 +5094,17 @@ var defaultAriaLiveMessages = {
5094
5094
  label = _props$label2 === void 0 ? '' : _props$label2,
5095
5095
  selectValue = props.selectValue,
5096
5096
  isDisabled = props.isDisabled,
5097
- isSelected = props.isSelected,
5098
- isAppleDevice = props.isAppleDevice;
5097
+ isSelected = props.isSelected;
5099
5098
  var getArrayIndex = function getArrayIndex(arr, item) {
5100
5099
  return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
5101
5100
  };
5102
5101
  if (context === 'value' && selectValue) {
5103
5102
  return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
5104
5103
  }
5105
- if (context === 'menu' && isAppleDevice) {
5104
+ if (context === 'menu') {
5106
5105
  var disabled = isDisabled ? ' disabled' : '';
5107
- var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
5108
- return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5106
+ var status = "".concat(isSelected ? 'selected' : 'focused').concat(disabled);
5107
+ return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5109
5108
  }
5110
5109
  return '';
5111
5110
  },
@@ -5124,8 +5123,7 @@ var LiveRegion = function LiveRegion(props) {
5124
5123
  isFocused = props.isFocused,
5125
5124
  selectValue = props.selectValue,
5126
5125
  selectProps = props.selectProps,
5127
- id = props.id,
5128
- isAppleDevice = props.isAppleDevice;
5126
+ id = props.id;
5129
5127
  var ariaLiveMessages = selectProps.ariaLiveMessages,
5130
5128
  getOptionLabel = selectProps.getOptionLabel,
5131
5129
  inputValue = selectProps.inputValue,
@@ -5135,8 +5133,7 @@ var LiveRegion = function LiveRegion(props) {
5135
5133
  menuIsOpen = selectProps.menuIsOpen,
5136
5134
  options = selectProps.options,
5137
5135
  screenReaderStatus = selectProps.screenReaderStatus,
5138
- tabSelectsValue = selectProps.tabSelectsValue,
5139
- isLoading = selectProps.isLoading;
5136
+ tabSelectsValue = selectProps.tabSelectsValue;
5140
5137
  var ariaLabel = selectProps['aria-label'];
5141
5138
  var ariaLive = selectProps['aria-live'];
5142
5139
 
@@ -5189,16 +5186,15 @@ var LiveRegion = function LiveRegion(props) {
5189
5186
  isSelected: isSelected,
5190
5187
  options: focusableOptions,
5191
5188
  context: focused === focusedOption ? 'menu' : 'value',
5192
- selectValue: selectValue,
5193
- isAppleDevice: isAppleDevice
5189
+ selectValue: selectValue
5194
5190
  };
5195
5191
  focusMsg = messages.onFocus(onFocusProps);
5196
5192
  }
5197
5193
  return focusMsg;
5198
- }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
5194
+ }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
5199
5195
  var ariaResults = useMemo(function () {
5200
5196
  var resultsMsg = '';
5201
- if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
5197
+ if (menuIsOpen && options.length && messages.onFilter) {
5202
5198
  var resultsMessage = screenReaderStatus({
5203
5199
  count: focusableOptions.length
5204
5200
  });
@@ -5208,8 +5204,7 @@ var LiveRegion = function LiveRegion(props) {
5208
5204
  });
5209
5205
  }
5210
5206
  return resultsMsg;
5211
- }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
5212
- var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5207
+ }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
5213
5208
  var ariaGuidance = useMemo(function () {
5214
5209
  var guidanceMsg = '';
5215
5210
  if (messages.guidance) {
@@ -5220,28 +5215,24 @@ var LiveRegion = function LiveRegion(props) {
5220
5215
  isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
5221
5216
  isMulti: isMulti,
5222
5217
  isSearchable: isSearchable,
5223
- tabSelectsValue: tabSelectsValue,
5224
- isInitialFocus: isInitialFocus
5218
+ tabSelectsValue: tabSelectsValue
5225
5219
  });
5226
5220
  }
5227
5221
  return guidanceMsg;
5228
- }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
5222
+ }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
5223
+ var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
5229
5224
  var ScreenReaderText = jsx(Fragment, null, jsx("span", {
5230
5225
  id: "aria-selection"
5231
5226
  }, ariaSelected), jsx("span", {
5232
- id: "aria-focused"
5233
- }, ariaFocused), jsx("span", {
5234
- id: "aria-results"
5235
- }, ariaResults), jsx("span", {
5236
- id: "aria-guidance"
5237
- }, ariaGuidance));
5227
+ id: "aria-context"
5228
+ }, ariaContext));
5229
+ var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5238
5230
  return jsx(Fragment, null, jsx(A11yText$1, {
5239
5231
  id: id
5240
5232
  }, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
5241
5233
  "aria-live": ariaLive,
5242
5234
  "aria-atomic": "false",
5243
- "aria-relevant": "additions text",
5244
- role: "log"
5235
+ "aria-relevant": "additions text"
5245
5236
  }, isFocused && !isInitialFocus && ScreenReaderText));
5246
5237
  };
5247
5238
  var LiveRegion$1 = LiveRegion;
@@ -5881,30 +5872,6 @@ var RequiredInput = function RequiredInput(_ref) {
5881
5872
  };
5882
5873
  var RequiredInput$1 = RequiredInput;
5883
5874
 
5884
- /// <reference types="user-agent-data-types" />
5885
-
5886
- function testPlatform(re) {
5887
- var _window$navigator$use;
5888
- 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;
5889
- }
5890
- function isIPhone() {
5891
- return testPlatform(/^iPhone/i);
5892
- }
5893
- function isMac() {
5894
- return testPlatform(/^Mac/i);
5895
- }
5896
- function isIPad() {
5897
- return testPlatform(/^iPad/i) ||
5898
- // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
5899
- isMac() && navigator.maxTouchPoints > 1;
5900
- }
5901
- function isIOS() {
5902
- return isIPhone() || isIPad();
5903
- }
5904
- function isAppleDevice() {
5905
- return isMac() || isIOS();
5906
- }
5907
-
5908
5875
  var formatGroupLabel = function formatGroupLabel(group) {
5909
5876
  return group.label;
5910
5877
  };
@@ -6074,24 +6041,6 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
6074
6041
  return optionsAccumulator;
6075
6042
  }, []);
6076
6043
  }
6077
- function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
6078
- return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
6079
- if (categorizedOption.type === 'group') {
6080
- optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
6081
- return {
6082
- data: option.data,
6083
- id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
6084
- };
6085
- })));
6086
- } else {
6087
- optionsAccumulator.push({
6088
- data: categorizedOption.data,
6089
- id: "".concat(optionId, "-").concat(categorizedOption.index)
6090
- });
6091
- }
6092
- return optionsAccumulator;
6093
- }, []);
6094
- }
6095
6044
  function buildFocusableOptions(props, selectValue) {
6096
6045
  return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
6097
6046
  }
@@ -6129,13 +6078,6 @@ function getNextFocusedOption(state, options) {
6129
6078
  var lastFocusedOption = state.focusedOption;
6130
6079
  return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
6131
6080
  }
6132
- var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
6133
- var _focusableOptionsWith;
6134
- var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
6135
- return option.data === focusedOption;
6136
- })) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
6137
- return focusedOptionId || null;
6138
- };
6139
6081
  var getOptionLabel = function getOptionLabel(props, data) {
6140
6082
  return props.getOptionLabel(data);
6141
6083
  };
@@ -6186,8 +6128,6 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6186
6128
  _this.state = {
6187
6129
  ariaSelection: null,
6188
6130
  focusedOption: null,
6189
- focusedOptionId: null,
6190
- focusableOptionsWithIds: [],
6191
6131
  focusedValue: null,
6192
6132
  inputIsHidden: false,
6193
6133
  isFocused: false,
@@ -6195,18 +6135,17 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6195
6135
  clearFocusValueOnUpdate: false,
6196
6136
  prevWasFocused: false,
6197
6137
  inputIsHiddenAfterUpdate: undefined,
6198
- prevProps: undefined,
6199
- instancePrefix: ''
6138
+ prevProps: undefined
6200
6139
  };
6201
6140
  _this.blockOptionHover = false;
6202
6141
  _this.isComposing = false;
6203
6142
  _this.commonProps = void 0;
6204
6143
  _this.initialTouchX = 0;
6205
6144
  _this.initialTouchY = 0;
6145
+ _this.instancePrefix = '';
6206
6146
  _this.openAfterFocus = false;
6207
6147
  _this.scrollToFocusedOptionOnUpdate = false;
6208
6148
  _this.userIsDragging = void 0;
6209
- _this.isAppleDevice = isAppleDevice();
6210
6149
  _this.controlRef = null;
6211
6150
  _this.getControlRef = function (ref) {
6212
6151
  _this.controlRef = ref;
@@ -6321,12 +6260,6 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6321
6260
  removedValue: lastSelectedValue
6322
6261
  });
6323
6262
  };
6324
- _this.getFocusedOptionId = function (focusedOption) {
6325
- return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
6326
- };
6327
- _this.getFocusableOptionsWithIds = function () {
6328
- return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
6329
- };
6330
6263
  _this.getValue = function () {
6331
6264
  return _this.state.selectValue;
6332
6265
  };
@@ -6354,7 +6287,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6354
6287
  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);
6355
6288
  };
6356
6289
  _this.getElementId = function (element) {
6357
- return "".concat(_this.state.instancePrefix, "-").concat(element);
6290
+ return "".concat(_this.instancePrefix, "-").concat(element);
6358
6291
  };
6359
6292
  _this.getComponents = function () {
6360
6293
  return defaultComponents(_this.props);
@@ -6563,11 +6496,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6563
6496
  if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
6564
6497
  return;
6565
6498
  }
6566
- var options = _this.getFocusableOptions();
6567
- var focusedOptionIndex = options.indexOf(focusedOption);
6568
6499
  _this.setState({
6569
- focusedOption: focusedOption,
6570
- focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
6500
+ focusedOption: focusedOption
6571
6501
  });
6572
6502
  };
6573
6503
  _this.shouldHideSelectedOptions = function () {
@@ -6711,16 +6641,14 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6711
6641
  }
6712
6642
  event.preventDefault();
6713
6643
  };
6714
- _this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6644
+ _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6715
6645
  _this.state.selectValue = cleanValue(_props.value);
6646
+
6716
6647
  // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
6717
6648
  if (_props.menuIsOpen && _this.state.selectValue.length) {
6718
- var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
6719
6649
  var focusableOptions = _this.buildFocusableOptions();
6720
6650
  var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
6721
- _this.state.focusableOptionsWithIds = focusableOptionsWithIds;
6722
6651
  _this.state.focusedOption = focusableOptions[optionIndex];
6723
- _this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
6724
6652
  }
6725
6653
  return _this;
6726
6654
  }
@@ -6845,8 +6773,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6845
6773
  this.setState({
6846
6774
  inputIsHiddenAfterUpdate: false,
6847
6775
  focusedValue: null,
6848
- focusedOption: focusableOptions[openAtIndex],
6849
- focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
6776
+ focusedOption: focusableOptions[openAtIndex]
6850
6777
  }, function () {
6851
6778
  return _this2.onMenuOpen();
6852
6779
  });
@@ -6922,8 +6849,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6922
6849
  this.scrollToFocusedOptionOnUpdate = true;
6923
6850
  this.setState({
6924
6851
  focusedOption: options[nextFocus],
6925
- focusedValue: null,
6926
- focusedOptionId: this.getFocusedOptionId(options[nextFocus])
6852
+ focusedValue: null
6927
6853
  });
6928
6854
  }
6929
6855
  }, {
@@ -7119,10 +7045,10 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7119
7045
  'aria-label': this.props['aria-label'],
7120
7046
  'aria-labelledby': this.props['aria-labelledby'],
7121
7047
  'aria-required': required,
7122
- role: 'combobox',
7123
- 'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
7048
+ role: 'combobox'
7124
7049
  }, menuIsOpen && {
7125
- 'aria-controls': this.getElementId('listbox')
7050
+ 'aria-controls': this.getElementId('listbox'),
7051
+ 'aria-owns': this.getElementId('listbox')
7126
7052
  }), !isSearchable && {
7127
7053
  'aria-readonly': true
7128
7054
  }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
@@ -7367,11 +7293,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7367
7293
  onClick: onSelect,
7368
7294
  onMouseMove: onHover,
7369
7295
  onMouseOver: onHover,
7370
- tabIndex: -1,
7371
- role: 'option',
7372
- 'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
7296
+ tabIndex: -1
7373
7297
  };
7374
-
7375
7298
  return /*#__PURE__*/React.createElement(Option, _extends({}, commonProps, {
7376
7299
  innerProps: innerProps,
7377
7300
  data: data,
@@ -7440,7 +7363,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7440
7363
  innerRef: ref,
7441
7364
  innerProps: {
7442
7365
  onMouseDown: _this4.onMenuMouseDown,
7443
- onMouseMove: _this4.onMenuMouseMove
7366
+ onMouseMove: _this4.onMenuMouseMove,
7367
+ id: _this4.getElementId('listbox')
7444
7368
  },
7445
7369
  isLoading: isLoading,
7446
7370
  placement: placement
@@ -7455,11 +7379,6 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7455
7379
  _this4.getMenuListRef(instance);
7456
7380
  scrollTargetRef(instance);
7457
7381
  },
7458
- innerProps: {
7459
- role: 'listbox',
7460
- 'aria-multiselectable': commonProps.isMulti,
7461
- id: _this4.getElementId('listbox')
7462
- },
7463
7382
  isLoading: isLoading,
7464
7383
  maxHeight: maxHeight,
7465
7384
  focusedOption: focusedOption
@@ -7547,8 +7466,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7547
7466
  focusedValue: focusedValue,
7548
7467
  isFocused: isFocused,
7549
7468
  selectValue: selectValue,
7550
- focusableOptions: focusableOptions,
7551
- isAppleDevice: this.isAppleDevice
7469
+ focusableOptions: focusableOptions
7552
7470
  }));
7553
7471
  }
7554
7472
  }, {
@@ -7597,8 +7515,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7597
7515
  inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
7598
7516
  ariaSelection = state.ariaSelection,
7599
7517
  isFocused = state.isFocused,
7600
- prevWasFocused = state.prevWasFocused,
7601
- instancePrefix = state.instancePrefix;
7518
+ prevWasFocused = state.prevWasFocused;
7602
7519
  var options = props.options,
7603
7520
  value = props.value,
7604
7521
  menuIsOpen = props.menuIsOpen,
@@ -7608,15 +7525,11 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7608
7525
  var newMenuOptionsState = {};
7609
7526
  if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
7610
7527
  var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
7611
- var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
7612
7528
  var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
7613
7529
  var focusedOption = getNextFocusedOption(state, focusableOptions);
7614
- var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
7615
7530
  newMenuOptionsState = {
7616
7531
  selectValue: selectValue,
7617
7532
  focusedOption: focusedOption,
7618
- focusedOptionId: focusedOptionId,
7619
- focusableOptionsWithIds: focusableOptionsWithIds,
7620
7533
  focusedValue: focusedValue,
7621
7534
  clearFocusValueOnUpdate: false
7622
7535
  };
@@ -7790,11 +7703,14 @@ var Spinner = function (_a) {
7790
7703
  React__default.createElement("circle", { className: "vchasno-ui-spinner__svg__circle", cx: "50", cy: "50", r: "20", fill: "none", stroke: color, strokeWidth: "2", strokeMiterlimit: "10" }))));
7791
7704
  };
7792
7705
 
7793
- 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";
7706
+ 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";
7794
7707
  styleInject(css_248z$1);
7795
7708
 
7796
7709
  var LabelText = function (_a) {
7797
7710
  var className = _a.className, children = _a.children;
7711
+ if (!children) {
7712
+ return null;
7713
+ }
7798
7714
  return (React__default.createElement("span", { className: cn('vchasno-ui-label-text', className) },
7799
7715
  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" },
7800
7716
  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" })),