labsense-ui-kit 1.2.86 → 1.2.88

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.
@@ -14,6 +14,7 @@ export declare const DropdownMenu: import("styled-components/dist/types").IStyle
14
14
  $top?: string | undefined;
15
15
  $bottom?: string | undefined;
16
16
  $optionsAvailable: boolean;
17
+ $dropDownPosition?: "center" | "left" | "right" | undefined;
17
18
  }>> & string;
18
19
  interface Option {
19
20
  label: string;
@@ -73,6 +74,7 @@ interface SelectOption {
73
74
  gap: string;
74
75
  node: React.ReactNode;
75
76
  };
77
+ dropDownPosition?: 'left' | 'center' | 'right';
76
78
  }
77
79
  declare const SelectOption: React.FC<SelectOption>;
78
80
  export default SelectOption;
package/dist/index.js CHANGED
@@ -7182,6 +7182,7 @@ var OptionComponent = function OptionComponent(_ref9) {
7182
7182
  _ref9$searchBox = _ref9.searchBox,
7183
7183
  searchBox = _ref9$searchBox === void 0 ? true : _ref9$searchBox,
7184
7184
  NoOptionsText = _ref9.NoOptionsText;
7185
+ var themeColors = useTheme();
7185
7186
  var _useState = React.useState(''),
7186
7187
  searchQuery = _useState[0],
7187
7188
  setSearchQuery = _useState[1];
@@ -7217,7 +7218,7 @@ var OptionComponent = function OptionComponent(_ref9) {
7217
7218
  placeholder: placeholder,
7218
7219
  value: searchQuery,
7219
7220
  onChange: handleSearchChange,
7220
- "$inputColor": searchbarTextColor,
7221
+ "$inputColor": searchbarTextColor || themeColors.vms.text.white,
7221
7222
  "$placeholderColor": placeholderColor
7222
7223
  })), React__default.createElement(OptionContainer, null, SortedOptions.length > 0 ? SortedOptions.map(function (option, id) {
7223
7224
  return React__default.createElement(OptionItem, {
@@ -7783,7 +7784,7 @@ var LabelText$1 = styled__default.div(_templateObject5$5 || (_templateObject5$5
7783
7784
  return $disabled ? theme.vms.text.medium : $color || theme.vms.text.medium;
7784
7785
  });
7785
7786
  var NoOptions = styled__default(Span)(_templateObject6$5 || (_templateObject6$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n height: 100%;\n padding: 12px;\n font-size: 14px;\n font-weight: 400;\n"])));
7786
- var DropdownMenu$1 = styled__default.div(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteralLoose(["\n height: auto;\n max-height: 170px;\n border: ", ";\n border-radius: ", ";\n min-width: 100%;\n width: ", ";\n background: ", ";\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n overflow: hidden; \n position: absolute;\n z-index: 1;\n ", "\n ", "\n z-index: 2;\n"])), function (_ref24) {
7787
+ var DropdownMenu$1 = styled__default.div(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteralLoose(["\n height: auto;\n max-height: 170px;\n border: ", ";\n border-radius: ", ";\n min-width: 100%;\n width: ", ";\n background: ", ";\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n position: absolute;\n z-index: 2;\n ", "\n ", "\n\n ", "\n"])), function (_ref24) {
7787
7788
  var theme = _ref24.theme;
7788
7789
  return "1px solid " + theme.vms.border.light;
7789
7790
  }, function (_ref25) {
@@ -7802,79 +7803,91 @@ var DropdownMenu$1 = styled__default.div(_templateObject7$3 || (_templateObject7
7802
7803
  }, function (_ref29) {
7803
7804
  var $bottom = _ref29.$bottom;
7804
7805
  return $bottom && "bottom: " + $bottom + ";";
7806
+ }, function (_ref30) {
7807
+ var $dropDownPosition = _ref30.$dropDownPosition;
7808
+ switch ($dropDownPosition) {
7809
+ case 'center':
7810
+ return "\n left: 50%;\n transform: translateX(-50%);\n ";
7811
+ case 'right':
7812
+ return "\n right: 0;\n left: auto;\n ";
7813
+ default:
7814
+ return "\n left: 0;\n ";
7815
+ }
7805
7816
  });
7806
7817
  var OptionsWrapper = styled__default.div(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n max-height: 150px; \n overflow-y: auto;\n scrollbar-width: thin;\n width: 100%;\n"])));
7807
- var SearchContainer$1 = styled__default.div(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n width: 100%;\n background: ", ";\n border: ", ";\n border-bottom: ", ";\n border-radius: ", ";\n padding: 10px 12px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 8px;\n position: sticky;\n top: 0;\n z-index: 10; \n"])), function (_ref30) {
7808
- var $background = _ref30.$background,
7809
- theme = _ref30.theme;
7818
+ var SearchContainer$1 = styled__default.div(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n width: 100%;\n background: ", ";\n border: ", ";\n border-bottom: ", ";\n border-radius: ", ";\n padding: 10px 12px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 8px;\n position: sticky;\n top: 0;\n z-index: 10; \n"])), function (_ref31) {
7819
+ var $background = _ref31.$background,
7820
+ theme = _ref31.theme;
7810
7821
  return $background || theme.vms.accent.light_2;
7811
- }, function (_ref31) {
7812
- var $border = _ref31.$border;
7813
- return $border || 'none';
7814
7822
  }, function (_ref32) {
7815
- var theme = _ref32.theme;
7816
- return "1px solid " + theme.vms.border.light;
7823
+ var $border = _ref32.$border;
7824
+ return $border || 'none';
7817
7825
  }, function (_ref33) {
7818
- var $borderRadius = _ref33.$borderRadius;
7826
+ var theme = _ref33.theme;
7827
+ return "1px solid " + theme.vms.border.light;
7828
+ }, function (_ref34) {
7829
+ var $borderRadius = _ref34.$borderRadius;
7819
7830
  return $borderRadius || '8px 8px 0 0';
7820
7831
  });
7821
- var SearchBar$1 = styled__default.input(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n font-weight: 400;\n font-style: normal;\n font-size: 14px;\n line-height: normal;\n background: transparent;\n color: ", ";\n outline: none;\n \n &::placeholder {\n color: ", ";\n font-style: italic;\n }\n"])), function (_ref34) {
7822
- var $inputColor = _ref34.$inputColor,
7823
- theme = _ref34.theme;
7824
- return $inputColor || theme.vms.text.medium;
7825
- }, function (_ref35) {
7826
- var $placeholderColor = _ref35.$placeholderColor,
7832
+ var SearchBar$1 = styled__default.input(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n font-weight: 400;\n font-style: normal;\n font-size: 14px;\n line-height: normal;\n background: transparent;\n color: ", ";\n outline: none;\n \n &::placeholder {\n color: ", ";\n font-style: italic;\n }\n"])), function (_ref35) {
7833
+ var $inputColor = _ref35.$inputColor,
7827
7834
  theme = _ref35.theme;
7835
+ return $inputColor || theme.vms.text.medium;
7836
+ }, function (_ref36) {
7837
+ var $placeholderColor = _ref36.$placeholderColor,
7838
+ theme = _ref36.theme;
7828
7839
  return $placeholderColor || theme.vms.text.light;
7829
7840
  });
7830
- var SelectOption = function SelectOption(_ref36) {
7841
+ var SelectOption = function SelectOption(_ref37) {
7831
7842
  var _options$find;
7832
- var title = _ref36.title,
7833
- titlecolor = _ref36.titlecolor,
7834
- titleWeight = _ref36.titleWeight,
7835
- options = _ref36.options,
7836
- value = _ref36.value,
7837
- onChange = _ref36.onChange,
7838
- _ref36$disabled = _ref36.disabled,
7839
- disabled = _ref36$disabled === void 0 ? false : _ref36$disabled,
7840
- size = _ref36.size,
7841
- width = _ref36.width,
7842
- _ref36$labelText = _ref36.labelText,
7843
- labelText = _ref36$labelText === void 0 ? 'Select' : _ref36$labelText,
7844
- border = _ref36.border,
7845
- background = _ref36.background,
7846
- _ref36$padding = _ref36.padding,
7847
- padding = _ref36$padding === void 0 ? '0px' : _ref36$padding,
7848
- borderRadius = _ref36.borderRadius,
7849
- optionColor = _ref36.optionColor,
7850
- optionFontSize = _ref36.optionFontSize,
7851
- optionFontWeight = _ref36.optionFontWeight,
7852
- optionBackgroundColor = _ref36.optionBackgroundColor,
7853
- menuBackground = _ref36.menuBackground,
7854
- optionsBorderRadius = _ref36.optionsBorderRadius,
7855
- color = _ref36.color,
7856
- required = _ref36.required,
7857
- _ref36$NoOptionsText = _ref36.NoOptionsText,
7858
- NoOptionsText = _ref36$NoOptionsText === void 0 ? 'No Options Available' : _ref36$NoOptionsText,
7859
- positionRef = _ref36.positionRef,
7860
- fontStyle = _ref36.fontStyle,
7861
- icon = _ref36.icon,
7862
- _ref36$searchBox = _ref36.searchBox,
7863
- searchBox = _ref36$searchBox === void 0 ? true : _ref36$searchBox,
7864
- searchBoxBackground = _ref36.searchBoxBackground,
7865
- searchBoxBorder = _ref36.searchBoxBorder,
7866
- searchBoxBorderRadius = _ref36.searchBoxBorderRadius,
7867
- searchIcon = _ref36.searchIcon,
7868
- _ref36$placeholderTex = _ref36.placeholderText,
7869
- placeholderText = _ref36$placeholderTex === void 0 ? 'Search...' : _ref36$placeholderTex,
7870
- iconColor = _ref36.iconColor,
7871
- placeholderColor = _ref36.placeholderColor,
7872
- inputColor = _ref36.inputColor,
7873
- _ref36$iconSize = _ref36.iconSize,
7874
- iconSize = _ref36$iconSize === void 0 ? 16 : _ref36$iconSize,
7875
- _ref36$allowDeselect = _ref36.allowDeselect,
7876
- allowDeselect = _ref36$allowDeselect === void 0 ? true : _ref36$allowDeselect,
7877
- titleRightNode = _ref36.titleRightNode;
7843
+ var title = _ref37.title,
7844
+ titlecolor = _ref37.titlecolor,
7845
+ titleWeight = _ref37.titleWeight,
7846
+ options = _ref37.options,
7847
+ value = _ref37.value,
7848
+ onChange = _ref37.onChange,
7849
+ _ref37$disabled = _ref37.disabled,
7850
+ disabled = _ref37$disabled === void 0 ? false : _ref37$disabled,
7851
+ size = _ref37.size,
7852
+ width = _ref37.width,
7853
+ _ref37$labelText = _ref37.labelText,
7854
+ labelText = _ref37$labelText === void 0 ? 'Select' : _ref37$labelText,
7855
+ border = _ref37.border,
7856
+ background = _ref37.background,
7857
+ _ref37$padding = _ref37.padding,
7858
+ padding = _ref37$padding === void 0 ? '0px' : _ref37$padding,
7859
+ borderRadius = _ref37.borderRadius,
7860
+ optionColor = _ref37.optionColor,
7861
+ optionFontSize = _ref37.optionFontSize,
7862
+ optionFontWeight = _ref37.optionFontWeight,
7863
+ optionBackgroundColor = _ref37.optionBackgroundColor,
7864
+ menuBackground = _ref37.menuBackground,
7865
+ optionsBorderRadius = _ref37.optionsBorderRadius,
7866
+ color = _ref37.color,
7867
+ required = _ref37.required,
7868
+ _ref37$NoOptionsText = _ref37.NoOptionsText,
7869
+ NoOptionsText = _ref37$NoOptionsText === void 0 ? 'No Options Available' : _ref37$NoOptionsText,
7870
+ positionRef = _ref37.positionRef,
7871
+ fontStyle = _ref37.fontStyle,
7872
+ icon = _ref37.icon,
7873
+ _ref37$searchBox = _ref37.searchBox,
7874
+ searchBox = _ref37$searchBox === void 0 ? true : _ref37$searchBox,
7875
+ searchBoxBackground = _ref37.searchBoxBackground,
7876
+ searchBoxBorder = _ref37.searchBoxBorder,
7877
+ searchBoxBorderRadius = _ref37.searchBoxBorderRadius,
7878
+ searchIcon = _ref37.searchIcon,
7879
+ _ref37$placeholderTex = _ref37.placeholderText,
7880
+ placeholderText = _ref37$placeholderTex === void 0 ? 'Search...' : _ref37$placeholderTex,
7881
+ iconColor = _ref37.iconColor,
7882
+ placeholderColor = _ref37.placeholderColor,
7883
+ inputColor = _ref37.inputColor,
7884
+ _ref37$iconSize = _ref37.iconSize,
7885
+ iconSize = _ref37$iconSize === void 0 ? 16 : _ref37$iconSize,
7886
+ _ref37$allowDeselect = _ref37.allowDeselect,
7887
+ allowDeselect = _ref37$allowDeselect === void 0 ? true : _ref37$allowDeselect,
7888
+ titleRightNode = _ref37.titleRightNode,
7889
+ _ref37$dropDownPositi = _ref37.dropDownPosition,
7890
+ dropDownPosition = _ref37$dropDownPositi === void 0 ? 'left' : _ref37$dropDownPositi;
7878
7891
  var themeColors = useTheme();
7879
7892
  var _useState = React.useState(false),
7880
7893
  dropUp = _useState[0],
@@ -8003,7 +8016,8 @@ var SelectOption = function SelectOption(_ref36) {
8003
8016
  "$optionsBorderRadius": optionsBorderRadius,
8004
8017
  "$optionsAvailable": options.length > 0,
8005
8018
  "$top": dropUp ? 'auto' : '126%',
8006
- "$bottom": dropUp ? '126%' : 'auto'
8019
+ "$bottom": dropUp ? '126%' : 'auto',
8020
+ "$dropDownPosition": dropDownPosition
8007
8021
  }, showSearchBox && React__default.createElement(SearchContainer$1, {
8008
8022
  "$background": searchBoxBackground,
8009
8023
  "$border": searchBoxBorder,