@oliasoft-open-source/react-ui-library 4.0.0-beta-9 → 4.0.0-beta-11

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.
package/dist/index.js CHANGED
@@ -11619,32 +11619,32 @@ Badge.propTypes = {
11619
11619
  margin: propTypes$1.exports.string,
11620
11620
  small: propTypes$1.exports.bool
11621
11621
  };
11622
- const inputInTable$b = "_inputInTable_1z38r_1";
11623
- const inputHover$b = "_inputHover_1z38r_13";
11624
- const inputFocus$b = "_inputFocus_1z38r_18";
11625
- const inputError$b = "_inputError_1z38r_25";
11626
- const inputWarning$b = "_inputWarning_1z38r_26";
11627
- const inputDisabled$b = "_inputDisabled_1z38r_61";
11628
- const hideScrollbars$b = "_hideScrollbars_1z38r_67";
11629
- const button$3 = "_button_1z38r_100";
11630
- const active$7 = "_active_1z38r_137";
11631
- const green$1 = "_green_1z38r_137";
11632
- const red$1 = "_red_1z38r_137";
11633
- const orange$1 = "_orange_1z38r_137";
11634
- const icon$4 = "_icon_1z38r_149";
11635
- const iconOnly = "_iconOnly_1z38r_154";
11636
- const basic = "_basic_1z38r_164";
11637
- const muted$2 = "_muted_1z38r_170";
11638
- const disabled$7 = "_disabled_1z38r_182";
11639
- const small$c = "_small_1z38r_192";
11640
- const pill = "_pill_1z38r_197";
11641
- const round = "_round_1z38r_198";
11642
- const error$8 = "_error_1z38r_268";
11643
- const warning$c = "_warning_1z38r_285";
11644
- const inverted$1 = "_inverted_1z38r_302";
11645
- const groupOrderFirst$4 = "_groupOrderFirst_1z38r_332";
11646
- const groupOrderMiddle$4 = "_groupOrderMiddle_1z38r_333";
11647
- const groupOrderLast$4 = "_groupOrderLast_1z38r_334";
11622
+ const inputInTable$b = "_inputInTable_4glow_1";
11623
+ const inputHover$b = "_inputHover_4glow_13";
11624
+ const inputFocus$b = "_inputFocus_4glow_18";
11625
+ const inputError$b = "_inputError_4glow_25";
11626
+ const inputWarning$b = "_inputWarning_4glow_26";
11627
+ const inputDisabled$b = "_inputDisabled_4glow_61";
11628
+ const hideScrollbars$b = "_hideScrollbars_4glow_67";
11629
+ const button$3 = "_button_4glow_100";
11630
+ const active$7 = "_active_4glow_137";
11631
+ const green$1 = "_green_4glow_137";
11632
+ const red$1 = "_red_4glow_137";
11633
+ const orange$1 = "_orange_4glow_137";
11634
+ const icon$4 = "_icon_4glow_149";
11635
+ const iconOnly = "_iconOnly_4glow_154";
11636
+ const basic = "_basic_4glow_164";
11637
+ const muted$2 = "_muted_4glow_170";
11638
+ const disabled$7 = "_disabled_4glow_182";
11639
+ const small$c = "_small_4glow_192";
11640
+ const pill = "_pill_4glow_197";
11641
+ const round = "_round_4glow_198";
11642
+ const error$8 = "_error_4glow_265";
11643
+ const warning$c = "_warning_4glow_282";
11644
+ const inverted$1 = "_inverted_4glow_299";
11645
+ const groupOrderFirst$4 = "_groupOrderFirst_4glow_329";
11646
+ const groupOrderMiddle$4 = "_groupOrderMiddle_4glow_330";
11647
+ const groupOrderLast$4 = "_groupOrderLast_4glow_331";
11648
11648
  const buttonStyles = {
11649
11649
  inputInTable: inputInTable$b,
11650
11650
  inputHover: inputHover$b,
@@ -11871,7 +11871,8 @@ const Button = ({
11871
11871
  groupOrder,
11872
11872
  loading,
11873
11873
  error: error2,
11874
- warning: warning2
11874
+ warning: warning2,
11875
+ active: active2
11875
11876
  }) => {
11876
11877
  const disabledContext = useContext(DisabledContext);
11877
11878
  const buttonLabel2 = trigger2 === "Button" ? label2 : trigger2 === "DropDownButton" ? /* @__PURE__ */ jsxRuntime.exports.jsxs("span", {
@@ -11906,7 +11907,8 @@ const Button = ({
11906
11907
  loading,
11907
11908
  disabled: disabled2,
11908
11909
  error: error2,
11909
- warning: warning2
11910
+ warning: warning2,
11911
+ active: active2
11910
11912
  })
11911
11913
  });
11912
11914
  };
@@ -11991,7 +11993,8 @@ const Trigger$1 = React__default.forwardRef(
11991
11993
  groupOrder,
11992
11994
  loading,
11993
11995
  error: error2,
11994
- warning: warning2
11996
+ warning: warning2,
11997
+ active: isOpen2
11995
11998
  }) : trigger2 === "Text" ? /* @__PURE__ */ jsxRuntime.exports.jsx(Text$1, {
11996
11999
  label: label2,
11997
12000
  title: title2,
@@ -27452,23 +27455,23 @@ Page.propTypes = {
27452
27455
  scroll: propTypes$1.exports.bool,
27453
27456
  top: propTypes$1.exports.oneOfType([propTypes$1.exports.number, propTypes$1.exports.string])
27454
27457
  };
27455
- const inputInTable$6 = "_inputInTable_brru0_1";
27456
- const inputHover$6 = "_inputHover_brru0_13";
27457
- const inputFocus$6 = "_inputFocus_brru0_18";
27458
- const inputError$6 = "_inputError_brru0_25";
27459
- const inputWarning$6 = "_inputWarning_brru0_26";
27460
- const inputDisabled$6 = "_inputDisabled_brru0_61";
27461
- const hideScrollbars$6 = "_hideScrollbars_brru0_67";
27462
- const select = "_select_brru0_77";
27463
- const isInTable$2 = "_isInTable_brru0_121";
27464
- const unSelected = "_unSelected_brru0_133";
27465
- const error$3 = "_error_brru0_140";
27466
- const warning$5 = "_warning_brru0_157";
27467
- const small$6 = "_small_brru0_174";
27468
- const right$3 = "_right_brru0_182";
27469
- const groupOrderFirst$1 = "_groupOrderFirst_brru0_193";
27470
- const groupOrderMiddle$1 = "_groupOrderMiddle_brru0_194";
27471
- const groupOrderLast$1 = "_groupOrderLast_brru0_198";
27458
+ const inputInTable$6 = "_inputInTable_1cli0_1";
27459
+ const inputHover$6 = "_inputHover_1cli0_13";
27460
+ const inputFocus$6 = "_inputFocus_1cli0_18";
27461
+ const inputError$6 = "_inputError_1cli0_25";
27462
+ const inputWarning$6 = "_inputWarning_1cli0_26";
27463
+ const inputDisabled$6 = "_inputDisabled_1cli0_61";
27464
+ const hideScrollbars$6 = "_hideScrollbars_1cli0_67";
27465
+ const select = "_select_1cli0_77";
27466
+ const isInTable$2 = "_isInTable_1cli0_121";
27467
+ const unSelected = "_unSelected_1cli0_133";
27468
+ const error$3 = "_error_1cli0_140";
27469
+ const warning$5 = "_warning_1cli0_157";
27470
+ const small$6 = "_small_1cli0_174";
27471
+ const right$3 = "_right_1cli0_182";
27472
+ const groupOrderFirst$1 = "_groupOrderFirst_1cli0_193";
27473
+ const groupOrderMiddle$1 = "_groupOrderMiddle_1cli0_194";
27474
+ const groupOrderLast$1 = "_groupOrderLast_1cli0_198";
27472
27475
  const styles$n = {
27473
27476
  inputInTable: inputInTable$6,
27474
27477
  inputHover: inputHover$6,
@@ -28548,6 +28551,58 @@ const Section = ({
28548
28551
  });
28549
28552
  }
28550
28553
  };
28554
+ const getTextWidth = (text2, font) => {
28555
+ const element = document.createElement("canvas");
28556
+ const context2 = element.getContext("2d");
28557
+ context2.font = font;
28558
+ return context2.measureText(text2).width;
28559
+ };
28560
+ const FONT_SIZE = "14px";
28561
+ const FONT_SIZE_SMALL = "12px";
28562
+ const FONT_FAMILY = "Roobert";
28563
+ const FONT_FAMILY_FALLBACK = "sans-serif";
28564
+ const PADDING = 10;
28565
+ const PADDING_SMALL = 7;
28566
+ const TOGGLE_SIZE = 38;
28567
+ const TOGGLE_SIZE_SMALL = 24;
28568
+ const TAG_PADDING = 5;
28569
+ const TAG_PADDING_SMALL = 3;
28570
+ const TAG_BORDER_WIDTH = 1;
28571
+ const TAG_MARGIN = 2;
28572
+ const MAX_OPTIONS_LENGTH = 10;
28573
+ const getFont = (small2 = false, isFontLoaded = false) => {
28574
+ const fontSize = small2 ? FONT_SIZE_SMALL : FONT_SIZE;
28575
+ const fontFamily = isFontLoaded ? FONT_FAMILY : FONT_FAMILY_FALLBACK;
28576
+ return `${fontSize} ${fontFamily}`;
28577
+ };
28578
+ const getExtraOptionWidth = (small2 = false, scrollbar = false) => {
28579
+ const SCROLLBAR_WIDTH = 17;
28580
+ return (small2 ? PADDING_SMALL : PADDING) + (small2 ? TOGGLE_SIZE_SMALL : TOGGLE_SIZE) + (scrollbar ? SCROLLBAR_WIDTH : 0);
28581
+ };
28582
+ const getWidestOptionWidth = (options, small2, isFontLoaded, placeholder3) => {
28583
+ const font = getFont(small2, isFontLoaded);
28584
+ const placeholderWidth = placeholder3 ? getTextWidth(placeholder3, font) : 0;
28585
+ const widestTextWidth = Math.ceil(
28586
+ options.reduce((acc, option2) => {
28587
+ var _a, _b;
28588
+ const optionActionsWidth = ((_b = (_a = option2 == null ? void 0 : option2.actions) == null ? void 0 : _a.length) != null ? _b : 0) * 24;
28589
+ const optionIconWidth = option2.icon ? (small2 ? FONT_SIZE_SMALL : FONT_SIZE) + 7 : 0;
28590
+ const optionsText = `${option2.label} ${option2.details || ""}`;
28591
+ const optionWidth = getTextWidth(optionsText, font) + optionActionsWidth + optionIconWidth;
28592
+ acc = optionWidth > acc ? optionWidth : acc;
28593
+ return acc;
28594
+ }, placeholderWidth)
28595
+ );
28596
+ const hasScrollbar = (options == null ? void 0 : options.length) > MAX_OPTIONS_LENGTH;
28597
+ const extraWidth = getExtraOptionWidth(small2, hasScrollbar);
28598
+ return widestTextWidth + extraWidth;
28599
+ };
28600
+ const getMultiOptionWidth = (option2, small2, isFontLoaded) => {
28601
+ const font = getFont(true, isFontLoaded);
28602
+ const textWidth = getTextWidth(option2.label, font);
28603
+ const extraWidth = (small2 ? TAG_PADDING_SMALL : TAG_PADDING) * 2 + TAG_BORDER_WIDTH * 2 + TAG_MARGIN;
28604
+ return Math.ceil(textWidth + extraWidth);
28605
+ };
28551
28606
  const Layer = ({
28552
28607
  listRef,
28553
28608
  isMulti: isMulti2,
@@ -28580,7 +28635,7 @@ const Layer = ({
28580
28635
  })
28581
28636
  }) : /* @__PURE__ */ jsxRuntime.exports.jsx(FixedSizeList, {
28582
28637
  ref: listRef,
28583
- height: sections.length < 10 ? optionHeight * sections.length : optionHeight * 10,
28638
+ height: sections.length < MAX_OPTIONS_LENGTH ? optionHeight * sections.length : optionHeight * MAX_OPTIONS_LENGTH,
28584
28639
  itemCount: sections.length,
28585
28640
  itemSize: optionHeight,
28586
28641
  width,
@@ -28601,37 +28656,37 @@ const Layer = ({
28601
28656
  })
28602
28657
  });
28603
28658
  };
28604
- const inputInTable$5 = "_inputInTable_1dpp2_1";
28605
- const inputHover$5 = "_inputHover_1dpp2_13";
28606
- const inputFocus$5 = "_inputFocus_1dpp2_18";
28607
- const inputError$5 = "_inputError_1dpp2_25";
28608
- const inputWarning$5 = "_inputWarning_1dpp2_26";
28609
- const inputDisabled$5 = "_inputDisabled_1dpp2_61";
28610
- const hideScrollbars$5 = "_hideScrollbars_1dpp2_67";
28611
- const trigger$1 = "_trigger_1dpp2_81";
28612
- const isInTable$1 = "_isInTable_1dpp2_97";
28613
- const input = "_input_1dpp2_1";
28614
- const isOpen = "_isOpen_1dpp2_118";
28615
- const error$2 = "_error_1dpp2_126";
28616
- const warning$4 = "_warning_1dpp2_143";
28617
- const disabled$3 = "_disabled_1dpp2_160";
28618
- const icons = "_icons_1dpp2_166";
28619
- const clearAll = "_clearAll_1dpp2_173";
28620
- const iconOpen = "_iconOpen_1dpp2_174";
28621
- const small$4 = "_small_1dpp2_183";
28622
- const triggerInputContainer = "_triggerInputContainer_1dpp2_192";
28623
- const right$2 = "_right_1dpp2_201";
28624
- const multiOptions = "_multiOptions_1dpp2_214";
28625
- const multiOption = "_multiOption_1dpp2_214";
28626
- const label$4 = "_label_1dpp2_246";
28627
- const closeMultiOption = "_closeMultiOption_1dpp2_249";
28628
- const focus = "_focus_1dpp2_260";
28629
- const selectedSingleValue = "_selectedSingleValue_1dpp2_264";
28630
- const placeHolder = "_placeHolder_1dpp2_265";
28631
- const groupOrderFirst = "_groupOrderFirst_1dpp2_304";
28632
- const groupOrderMiddle = "_groupOrderMiddle_1dpp2_305";
28633
- const groupOrderLast = "_groupOrderLast_1dpp2_309";
28634
- const detailedLabel = "_detailedLabel_1dpp2_314";
28659
+ const inputInTable$5 = "_inputInTable_1nzsx_1";
28660
+ const inputHover$5 = "_inputHover_1nzsx_13";
28661
+ const inputFocus$5 = "_inputFocus_1nzsx_18";
28662
+ const inputError$5 = "_inputError_1nzsx_25";
28663
+ const inputWarning$5 = "_inputWarning_1nzsx_26";
28664
+ const inputDisabled$5 = "_inputDisabled_1nzsx_61";
28665
+ const hideScrollbars$5 = "_hideScrollbars_1nzsx_67";
28666
+ const trigger$1 = "_trigger_1nzsx_77";
28667
+ const isInTable$1 = "_isInTable_1nzsx_93";
28668
+ const input = "_input_1nzsx_1";
28669
+ const isOpen = "_isOpen_1nzsx_114";
28670
+ const error$2 = "_error_1nzsx_122";
28671
+ const warning$4 = "_warning_1nzsx_139";
28672
+ const disabled$3 = "_disabled_1nzsx_156";
28673
+ const icons = "_icons_1nzsx_162";
28674
+ const clearAll = "_clearAll_1nzsx_169";
28675
+ const iconOpen = "_iconOpen_1nzsx_170";
28676
+ const small$4 = "_small_1nzsx_178";
28677
+ const triggerInputContainer = "_triggerInputContainer_1nzsx_186";
28678
+ const right$2 = "_right_1nzsx_195";
28679
+ const multiOptions = "_multiOptions_1nzsx_208";
28680
+ const multiOption = "_multiOption_1nzsx_208";
28681
+ const label$4 = "_label_1nzsx_240";
28682
+ const closeMultiOption = "_closeMultiOption_1nzsx_243";
28683
+ const focus = "_focus_1nzsx_254";
28684
+ const selectedSingleValue = "_selectedSingleValue_1nzsx_258";
28685
+ const placeHolder = "_placeHolder_1nzsx_259";
28686
+ const groupOrderFirst = "_groupOrderFirst_1nzsx_298";
28687
+ const groupOrderMiddle = "_groupOrderMiddle_1nzsx_299";
28688
+ const groupOrderLast = "_groupOrderLast_1nzsx_303";
28689
+ const detailedLabel = "_detailedLabel_1nzsx_308";
28635
28690
  const styles$l = {
28636
28691
  inputInTable: inputInTable$5,
28637
28692
  inputHover: inputHover$5,
@@ -28665,56 +28720,6 @@ const styles$l = {
28665
28720
  groupOrderLast,
28666
28721
  detailedLabel
28667
28722
  };
28668
- const getTextWidth = (text2, font) => {
28669
- const element = document.createElement("canvas");
28670
- const context2 = element.getContext("2d");
28671
- context2.font = font;
28672
- return context2.measureText(text2).width;
28673
- };
28674
- const FONT_SIZE = "14px";
28675
- const FONT_SIZE_SMALL = "12px";
28676
- const FONT_FAMILY = "Roobert";
28677
- const FONT_FAMILY_FALLBACK = "sans-serif";
28678
- const PADDING = 14;
28679
- const PADDING_SMALL = 7;
28680
- const TOGGLE_SIZE = 38;
28681
- const TOGGLE_SIZE_SMALL = 24;
28682
- const TAG_PADDING = 5;
28683
- const TAG_PADDING_SMALL = 3;
28684
- const TAG_BORDER_WIDTH = 1;
28685
- const TAG_MARGIN = 2;
28686
- const getFont = (small2 = false, isFontLoaded = false) => {
28687
- const fontSize = small2 ? FONT_SIZE_SMALL : FONT_SIZE;
28688
- const fontFamily = isFontLoaded ? FONT_FAMILY : FONT_FAMILY_FALLBACK;
28689
- return `${fontSize} ${fontFamily}`;
28690
- };
28691
- const getExtraOptionWidth = (small2 = false, scrollbar = false) => {
28692
- const SCROLLBAR_WIDTH = 17;
28693
- return (small2 ? PADDING_SMALL : PADDING) + (small2 ? TOGGLE_SIZE_SMALL : TOGGLE_SIZE) + (scrollbar ? SCROLLBAR_WIDTH : 0);
28694
- };
28695
- const getWidestOptionWidth = (options, small2, isFontLoaded, placeholder3) => {
28696
- const font = getFont(small2, isFontLoaded);
28697
- const placeholderWidth = placeholder3 ? getTextWidth(placeholder3, font) : 0;
28698
- const widestTextWidth = Math.ceil(
28699
- options.reduce((acc, option2) => {
28700
- var _a, _b;
28701
- const optionActionsWidth = ((_b = (_a = option2 == null ? void 0 : option2.actions) == null ? void 0 : _a.length) != null ? _b : 0) * 24;
28702
- const optionIconWidth = option2.icon ? (small2 ? FONT_SIZE_SMALL : FONT_SIZE) + 7 : 0;
28703
- const optionsText = `${option2.label} ${option2.details || ""}`;
28704
- const optionWidth = getTextWidth(optionsText, font) + optionActionsWidth + optionIconWidth;
28705
- acc = optionWidth > acc ? optionWidth : acc;
28706
- return acc;
28707
- }, placeholderWidth)
28708
- );
28709
- const extraWidth = getExtraOptionWidth(small2, true);
28710
- return widestTextWidth + extraWidth;
28711
- };
28712
- const getMultiOptionWidth = (option2, small2, isFontLoaded) => {
28713
- const font = getFont(true, isFontLoaded);
28714
- const textWidth = getTextWidth(option2.label, font);
28715
- const extraWidth = (small2 ? TAG_PADDING_SMALL : TAG_PADDING) * 2 + TAG_BORDER_WIDTH * 2 + TAG_MARGIN;
28716
- return Math.ceil(textWidth + extraWidth);
28717
- };
28718
28723
  const MultiSelectedOptions = ({ selectedOptions, small: small2, width }) => {
28719
28724
  const isFontLoaded = useFontsReady();
28720
28725
  const [displayedOptions, setDisplayedOptions] = useState([]);