@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.
@@ -9,6 +9,7 @@ export interface InputProps extends Partial<WithLabel & WithHint & LoadingFeedba
9
9
  startElement?: string | React.ReactElement;
10
10
  endElement?: string | React.ReactElement;
11
11
  labelProps?: InputHTMLAttributes<HTMLLabelElement>;
12
+ hideEmptyMeta?: boolean;
12
13
  children: React.ReactHTMLElement<HTMLInputElement> | React.ReactElement | JSX.Element[];
13
14
  }
14
15
  export declare const Input: React.FC<InputProps>;
@@ -5004,14 +5004,14 @@ var defaultAriaLiveMessages = {
5004
5004
  guidance: function guidance(props) {
5005
5005
  var isSearchable = props.isSearchable,
5006
5006
  isMulti = props.isMulti,
5007
+ isDisabled = props.isDisabled,
5007
5008
  tabSelectsValue = props.tabSelectsValue,
5008
- context = props.context,
5009
- isInitialFocus = props.isInitialFocus;
5009
+ context = props.context;
5010
5010
  switch (context) {
5011
5011
  case 'menu':
5012
- 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' : '', ".");
5012
+ 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' : '', ".");
5013
5013
  case 'input':
5014
- 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' : '') : '';
5014
+ 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' : '');
5015
5015
  case 'value':
5016
5016
  return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
5017
5017
  default:
@@ -5047,18 +5047,17 @@ var defaultAriaLiveMessages = {
5047
5047
  label = _props$label2 === void 0 ? '' : _props$label2,
5048
5048
  selectValue = props.selectValue,
5049
5049
  isDisabled = props.isDisabled,
5050
- isSelected = props.isSelected,
5051
- isAppleDevice = props.isAppleDevice;
5050
+ isSelected = props.isSelected;
5052
5051
  var getArrayIndex = function getArrayIndex(arr, item) {
5053
5052
  return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
5054
5053
  };
5055
5054
  if (context === 'value' && selectValue) {
5056
5055
  return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
5057
5056
  }
5058
- if (context === 'menu' && isAppleDevice) {
5057
+ if (context === 'menu') {
5059
5058
  var disabled = isDisabled ? ' disabled' : '';
5060
- var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
5061
- return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5059
+ var status = "".concat(isSelected ? 'selected' : 'focused').concat(disabled);
5060
+ return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5062
5061
  }
5063
5062
  return '';
5064
5063
  },
@@ -5077,8 +5076,7 @@ var LiveRegion = function LiveRegion(props) {
5077
5076
  isFocused = props.isFocused,
5078
5077
  selectValue = props.selectValue,
5079
5078
  selectProps = props.selectProps,
5080
- id = props.id,
5081
- isAppleDevice = props.isAppleDevice;
5079
+ id = props.id;
5082
5080
  var ariaLiveMessages = selectProps.ariaLiveMessages,
5083
5081
  getOptionLabel = selectProps.getOptionLabel,
5084
5082
  inputValue = selectProps.inputValue,
@@ -5088,8 +5086,7 @@ var LiveRegion = function LiveRegion(props) {
5088
5086
  menuIsOpen = selectProps.menuIsOpen,
5089
5087
  options = selectProps.options,
5090
5088
  screenReaderStatus = selectProps.screenReaderStatus,
5091
- tabSelectsValue = selectProps.tabSelectsValue,
5092
- isLoading = selectProps.isLoading;
5089
+ tabSelectsValue = selectProps.tabSelectsValue;
5093
5090
  var ariaLabel = selectProps['aria-label'];
5094
5091
  var ariaLive = selectProps['aria-live'];
5095
5092
 
@@ -5142,16 +5139,15 @@ var LiveRegion = function LiveRegion(props) {
5142
5139
  isSelected: isSelected,
5143
5140
  options: focusableOptions,
5144
5141
  context: focused === focusedOption ? 'menu' : 'value',
5145
- selectValue: selectValue,
5146
- isAppleDevice: isAppleDevice
5142
+ selectValue: selectValue
5147
5143
  };
5148
5144
  focusMsg = messages.onFocus(onFocusProps);
5149
5145
  }
5150
5146
  return focusMsg;
5151
- }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
5147
+ }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
5152
5148
  var ariaResults = React.useMemo(function () {
5153
5149
  var resultsMsg = '';
5154
- if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
5150
+ if (menuIsOpen && options.length && messages.onFilter) {
5155
5151
  var resultsMessage = screenReaderStatus({
5156
5152
  count: focusableOptions.length
5157
5153
  });
@@ -5161,8 +5157,7 @@ var LiveRegion = function LiveRegion(props) {
5161
5157
  });
5162
5158
  }
5163
5159
  return resultsMsg;
5164
- }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
5165
- var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5160
+ }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
5166
5161
  var ariaGuidance = React.useMemo(function () {
5167
5162
  var guidanceMsg = '';
5168
5163
  if (messages.guidance) {
@@ -5173,28 +5168,24 @@ var LiveRegion = function LiveRegion(props) {
5173
5168
  isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
5174
5169
  isMulti: isMulti,
5175
5170
  isSearchable: isSearchable,
5176
- tabSelectsValue: tabSelectsValue,
5177
- isInitialFocus: isInitialFocus
5171
+ tabSelectsValue: tabSelectsValue
5178
5172
  });
5179
5173
  }
5180
5174
  return guidanceMsg;
5181
- }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
5175
+ }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
5176
+ var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
5182
5177
  var ScreenReaderText = jsx(React.Fragment, null, jsx("span", {
5183
5178
  id: "aria-selection"
5184
5179
  }, ariaSelected), jsx("span", {
5185
- id: "aria-focused"
5186
- }, ariaFocused), jsx("span", {
5187
- id: "aria-results"
5188
- }, ariaResults), jsx("span", {
5189
- id: "aria-guidance"
5190
- }, ariaGuidance));
5180
+ id: "aria-context"
5181
+ }, ariaContext));
5182
+ var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5191
5183
  return jsx(React.Fragment, null, jsx(A11yText$1, {
5192
5184
  id: id
5193
5185
  }, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
5194
5186
  "aria-live": ariaLive,
5195
5187
  "aria-atomic": "false",
5196
- "aria-relevant": "additions text",
5197
- role: "log"
5188
+ "aria-relevant": "additions text"
5198
5189
  }, isFocused && !isInitialFocus && ScreenReaderText));
5199
5190
  };
5200
5191
  var LiveRegion$1 = LiveRegion;
@@ -5834,30 +5825,6 @@ var RequiredInput = function RequiredInput(_ref) {
5834
5825
  };
5835
5826
  var RequiredInput$1 = RequiredInput;
5836
5827
 
5837
- /// <reference types="user-agent-data-types" />
5838
-
5839
- function testPlatform(re) {
5840
- var _window$navigator$use;
5841
- 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;
5842
- }
5843
- function isIPhone() {
5844
- return testPlatform(/^iPhone/i);
5845
- }
5846
- function isMac() {
5847
- return testPlatform(/^Mac/i);
5848
- }
5849
- function isIPad() {
5850
- return testPlatform(/^iPad/i) ||
5851
- // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
5852
- isMac() && navigator.maxTouchPoints > 1;
5853
- }
5854
- function isIOS() {
5855
- return isIPhone() || isIPad();
5856
- }
5857
- function isAppleDevice() {
5858
- return isMac() || isIOS();
5859
- }
5860
-
5861
5828
  var formatGroupLabel = function formatGroupLabel(group) {
5862
5829
  return group.label;
5863
5830
  };
@@ -6027,24 +5994,6 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
6027
5994
  return optionsAccumulator;
6028
5995
  }, []);
6029
5996
  }
6030
- function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
6031
- return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
6032
- if (categorizedOption.type === 'group') {
6033
- optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
6034
- return {
6035
- data: option.data,
6036
- id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
6037
- };
6038
- })));
6039
- } else {
6040
- optionsAccumulator.push({
6041
- data: categorizedOption.data,
6042
- id: "".concat(optionId, "-").concat(categorizedOption.index)
6043
- });
6044
- }
6045
- return optionsAccumulator;
6046
- }, []);
6047
- }
6048
5997
  function buildFocusableOptions(props, selectValue) {
6049
5998
  return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
6050
5999
  }
@@ -6082,13 +6031,6 @@ function getNextFocusedOption(state, options) {
6082
6031
  var lastFocusedOption = state.focusedOption;
6083
6032
  return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
6084
6033
  }
6085
- var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
6086
- var _focusableOptionsWith;
6087
- var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
6088
- return option.data === focusedOption;
6089
- })) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
6090
- return focusedOptionId || null;
6091
- };
6092
6034
  var getOptionLabel = function getOptionLabel(props, data) {
6093
6035
  return props.getOptionLabel(data);
6094
6036
  };
@@ -6139,8 +6081,6 @@ var Select = /*#__PURE__*/function (_Component) {
6139
6081
  _this.state = {
6140
6082
  ariaSelection: null,
6141
6083
  focusedOption: null,
6142
- focusedOptionId: null,
6143
- focusableOptionsWithIds: [],
6144
6084
  focusedValue: null,
6145
6085
  inputIsHidden: false,
6146
6086
  isFocused: false,
@@ -6148,18 +6088,17 @@ var Select = /*#__PURE__*/function (_Component) {
6148
6088
  clearFocusValueOnUpdate: false,
6149
6089
  prevWasFocused: false,
6150
6090
  inputIsHiddenAfterUpdate: undefined,
6151
- prevProps: undefined,
6152
- instancePrefix: ''
6091
+ prevProps: undefined
6153
6092
  };
6154
6093
  _this.blockOptionHover = false;
6155
6094
  _this.isComposing = false;
6156
6095
  _this.commonProps = void 0;
6157
6096
  _this.initialTouchX = 0;
6158
6097
  _this.initialTouchY = 0;
6098
+ _this.instancePrefix = '';
6159
6099
  _this.openAfterFocus = false;
6160
6100
  _this.scrollToFocusedOptionOnUpdate = false;
6161
6101
  _this.userIsDragging = void 0;
6162
- _this.isAppleDevice = isAppleDevice();
6163
6102
  _this.controlRef = null;
6164
6103
  _this.getControlRef = function (ref) {
6165
6104
  _this.controlRef = ref;
@@ -6274,12 +6213,6 @@ var Select = /*#__PURE__*/function (_Component) {
6274
6213
  removedValue: lastSelectedValue
6275
6214
  });
6276
6215
  };
6277
- _this.getFocusedOptionId = function (focusedOption) {
6278
- return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
6279
- };
6280
- _this.getFocusableOptionsWithIds = function () {
6281
- return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
6282
- };
6283
6216
  _this.getValue = function () {
6284
6217
  return _this.state.selectValue;
6285
6218
  };
@@ -6307,7 +6240,7 @@ var Select = /*#__PURE__*/function (_Component) {
6307
6240
  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);
6308
6241
  };
6309
6242
  _this.getElementId = function (element) {
6310
- return "".concat(_this.state.instancePrefix, "-").concat(element);
6243
+ return "".concat(_this.instancePrefix, "-").concat(element);
6311
6244
  };
6312
6245
  _this.getComponents = function () {
6313
6246
  return defaultComponents(_this.props);
@@ -6516,11 +6449,8 @@ var Select = /*#__PURE__*/function (_Component) {
6516
6449
  if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
6517
6450
  return;
6518
6451
  }
6519
- var options = _this.getFocusableOptions();
6520
- var focusedOptionIndex = options.indexOf(focusedOption);
6521
6452
  _this.setState({
6522
- focusedOption: focusedOption,
6523
- focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
6453
+ focusedOption: focusedOption
6524
6454
  });
6525
6455
  };
6526
6456
  _this.shouldHideSelectedOptions = function () {
@@ -6664,16 +6594,14 @@ var Select = /*#__PURE__*/function (_Component) {
6664
6594
  }
6665
6595
  event.preventDefault();
6666
6596
  };
6667
- _this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6597
+ _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6668
6598
  _this.state.selectValue = cleanValue(_props.value);
6599
+
6669
6600
  // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
6670
6601
  if (_props.menuIsOpen && _this.state.selectValue.length) {
6671
- var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
6672
6602
  var focusableOptions = _this.buildFocusableOptions();
6673
6603
  var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
6674
- _this.state.focusableOptionsWithIds = focusableOptionsWithIds;
6675
6604
  _this.state.focusedOption = focusableOptions[optionIndex];
6676
- _this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
6677
6605
  }
6678
6606
  return _this;
6679
6607
  }
@@ -6798,8 +6726,7 @@ var Select = /*#__PURE__*/function (_Component) {
6798
6726
  this.setState({
6799
6727
  inputIsHiddenAfterUpdate: false,
6800
6728
  focusedValue: null,
6801
- focusedOption: focusableOptions[openAtIndex],
6802
- focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
6729
+ focusedOption: focusableOptions[openAtIndex]
6803
6730
  }, function () {
6804
6731
  return _this2.onMenuOpen();
6805
6732
  });
@@ -6875,8 +6802,7 @@ var Select = /*#__PURE__*/function (_Component) {
6875
6802
  this.scrollToFocusedOptionOnUpdate = true;
6876
6803
  this.setState({
6877
6804
  focusedOption: options[nextFocus],
6878
- focusedValue: null,
6879
- focusedOptionId: this.getFocusedOptionId(options[nextFocus])
6805
+ focusedValue: null
6880
6806
  });
6881
6807
  }
6882
6808
  }, {
@@ -7072,10 +6998,10 @@ var Select = /*#__PURE__*/function (_Component) {
7072
6998
  'aria-label': this.props['aria-label'],
7073
6999
  'aria-labelledby': this.props['aria-labelledby'],
7074
7000
  'aria-required': required,
7075
- role: 'combobox',
7076
- 'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
7001
+ role: 'combobox'
7077
7002
  }, menuIsOpen && {
7078
- 'aria-controls': this.getElementId('listbox')
7003
+ 'aria-controls': this.getElementId('listbox'),
7004
+ 'aria-owns': this.getElementId('listbox')
7079
7005
  }), !isSearchable && {
7080
7006
  'aria-readonly': true
7081
7007
  }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
@@ -7320,11 +7246,8 @@ var Select = /*#__PURE__*/function (_Component) {
7320
7246
  onClick: onSelect,
7321
7247
  onMouseMove: onHover,
7322
7248
  onMouseOver: onHover,
7323
- tabIndex: -1,
7324
- role: 'option',
7325
- 'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
7249
+ tabIndex: -1
7326
7250
  };
7327
-
7328
7251
  return /*#__PURE__*/React__namespace.createElement(Option, _extends({}, commonProps, {
7329
7252
  innerProps: innerProps,
7330
7253
  data: data,
@@ -7393,7 +7316,8 @@ var Select = /*#__PURE__*/function (_Component) {
7393
7316
  innerRef: ref,
7394
7317
  innerProps: {
7395
7318
  onMouseDown: _this4.onMenuMouseDown,
7396
- onMouseMove: _this4.onMenuMouseMove
7319
+ onMouseMove: _this4.onMenuMouseMove,
7320
+ id: _this4.getElementId('listbox')
7397
7321
  },
7398
7322
  isLoading: isLoading,
7399
7323
  placement: placement
@@ -7408,11 +7332,6 @@ var Select = /*#__PURE__*/function (_Component) {
7408
7332
  _this4.getMenuListRef(instance);
7409
7333
  scrollTargetRef(instance);
7410
7334
  },
7411
- innerProps: {
7412
- role: 'listbox',
7413
- 'aria-multiselectable': commonProps.isMulti,
7414
- id: _this4.getElementId('listbox')
7415
- },
7416
7335
  isLoading: isLoading,
7417
7336
  maxHeight: maxHeight,
7418
7337
  focusedOption: focusedOption
@@ -7500,8 +7419,7 @@ var Select = /*#__PURE__*/function (_Component) {
7500
7419
  focusedValue: focusedValue,
7501
7420
  isFocused: isFocused,
7502
7421
  selectValue: selectValue,
7503
- focusableOptions: focusableOptions,
7504
- isAppleDevice: this.isAppleDevice
7422
+ focusableOptions: focusableOptions
7505
7423
  }));
7506
7424
  }
7507
7425
  }, {
@@ -7550,8 +7468,7 @@ var Select = /*#__PURE__*/function (_Component) {
7550
7468
  inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
7551
7469
  ariaSelection = state.ariaSelection,
7552
7470
  isFocused = state.isFocused,
7553
- prevWasFocused = state.prevWasFocused,
7554
- instancePrefix = state.instancePrefix;
7471
+ prevWasFocused = state.prevWasFocused;
7555
7472
  var options = props.options,
7556
7473
  value = props.value,
7557
7474
  menuIsOpen = props.menuIsOpen,
@@ -7561,15 +7478,11 @@ var Select = /*#__PURE__*/function (_Component) {
7561
7478
  var newMenuOptionsState = {};
7562
7479
  if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
7563
7480
  var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
7564
- var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
7565
7481
  var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
7566
7482
  var focusedOption = getNextFocusedOption(state, focusableOptions);
7567
- var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
7568
7483
  newMenuOptionsState = {
7569
7484
  selectValue: selectValue,
7570
7485
  focusedOption: focusedOption,
7571
- focusedOptionId: focusedOptionId,
7572
- focusableOptionsWithIds: focusableOptionsWithIds,
7573
7486
  focusedValue: focusedValue,
7574
7487
  clearFocusValueOnUpdate: false
7575
7488
  };
@@ -7899,11 +7812,14 @@ var Spinner = function (_a) {
7899
7812
  React.createElement("circle", { className: "vchasno-ui-spinner__svg__circle", cx: "50", cy: "50", r: "20", fill: "none", stroke: color, strokeWidth: "2", strokeMiterlimit: "10" }))));
7900
7813
  };
7901
7814
 
7902
- 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";
7815
+ 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";
7903
7816
  styleInject(css_248z$1);
7904
7817
 
7905
7818
  var LabelText = function (_a) {
7906
7819
  var className = _a.className, children = _a.children;
7820
+ if (!children) {
7821
+ return null;
7822
+ }
7907
7823
  return (React.createElement("span", { className: cn('vchasno-ui-label-text', className) },
7908
7824
  React.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" },
7909
7825
  React.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" })),