pge-front-common 14.0.49 → 14.0.51

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/lib/index.esm.js CHANGED
@@ -724,7 +724,7 @@ var Tooltip$1 = function (_a) {
724
724
  React__default.createElement("span", { className: styles$s.textContent }, text)))));
725
725
  };
726
726
 
727
- var css_248z$u = ".textarea-module__inputContainer___lpM5d {\r\n color: var(--color-input);\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__label___qDTpX {\r\n color: var(--color-label);\r\n font-size: var(--font-size-16, 16px);\r\n font-weight: var(--input-font-weight);\r\n line-height: var(--input-line-height);\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__labelRequired___bl2ew::after {\r\n content: \" *\";\r\n color: var(--color-danger);\r\n}\r\n\r\n.textarea-module__labelError___f0hpM {\r\n color: var(--color-danger);\r\n}\r\n\r\n.textarea-module__inputWrapper___WFx7P {\r\n background-color: #fff;\r\n cursor: pointer;\r\n width: 100%;\r\n border-radius: var(--input-border-radius);\r\n border: var(--input-border);\r\n font-family: var(--font-open-sans-serif);\r\n font-size: var(--input-font-size);\r\n font-weight: var(--input-font-weight);\r\n line-height: var(--input-line-height);\r\n text-align: left;\r\n}\r\n\r\n.textarea-module__inputWrapperError___0gA5w {\r\n border: var(--input-border-danger) !important;\r\n outline: var(--input-outline-danger) !important;\r\n}\r\n\r\n.textarea-module__inputWrapper___WFx7P:focus,\r\n.textarea-module__inputWrapper___WFx7P:focus-visible,\r\n.textarea-module__inputWrapper___WFx7P:focus-within {\r\n border: var(--input-border-focus);\r\n outline: var(--input-outline-focus);\r\n box-shadow: 0px 0px 0px 2px #0091ea80;\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc {\r\n display: flex;\r\n align-items: flex-start;\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea {\r\n padding: 8px 0;\r\n font-size: var(--font-size-14, 14px);\r\n font-weight: 700;\r\n flex: 1;\r\n}\r\n\r\n.textarea-module__messageContainer___akVKQ {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__messageWrapper___2mdmw {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 4px;\r\n}\r\n\r\n.textarea-module__counter___zHZ86 {\r\n font-size: var(--font-size-12, 12px);\r\n color: var(--color-label);\r\n font-weight: 700;\r\n text-align: right;\r\n min-width: 60px;\r\n}\r\n\r\n.textarea-module__styledInput___fPp-f {\r\n color: var(--color-input);\r\n cursor: pointer;\r\n width: 100%;\r\n border: none;\r\n border-radius: 8px;\r\n padding: 8px 0;\r\n resize: none;\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea::placeholder {\r\n font-weight: 700;\r\n color: var(--input-placeholder-color);\r\n font-size: var(--font-size-14, 14px);\r\n line-height: 24px;\r\n font-family: var(--font-open-sans-serif);\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea:focus {\r\n color: var(--input-placeholder-focus, #303030cc);\r\n outline: none;\r\n border: 1px solid #1a95b0;\r\n box-shadow: 0px 0px 0px 2px #0091ea80;\r\n font-size: var(--font-size-14, 14px);\r\n font-weight: 700;\r\n background-color: var(--input-bg-color);\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea:disabled {\r\n background-color: #eeeeee;\r\n border-radius: 8px;\r\n cursor: not-allowed;\r\n}\r\n\r\n.textarea-module__styledInput___fPp-f:focus,\r\n.textarea-module__styledInput___fPp-f:focus-visible,\r\n.textarea-module__styledInput___fPp-f:focus-within {\r\n outline: none;\r\n}\r\n\r\n.textarea-module__message___ys-dL {\r\n color: var(--color-label);\r\n margin-left: 8px;\r\n font-family: var(--font-open-sans-serif);\r\n font-size: 12px;\r\n font-weight: 700;\r\n line-height: 15px;\r\n text-align: left;\r\n}\r\n\r\n.textarea-module__messageError___ubeLK {\r\n color: var(--color-danger);\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc svg {\r\n padding-left: 8px;\r\n margin-top: 11px;\r\n}\r\n";
727
+ var css_248z$u = ".textarea-module__inputContainer___lpM5d {\r\n color: var(--color-input);\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__label___qDTpX {\r\n color: var(--color-label);\r\n font-size: var(--font-size-16, 16px);\r\n font-weight: var(--input-font-weight);\r\n line-height: var(--input-line-height);\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__labelRequired___bl2ew::after {\r\n content: \" *\";\r\n color: var(--color-danger);\r\n}\r\n\r\n.textarea-module__labelError___f0hpM {\r\n color: var(--color-danger);\r\n}\r\n\r\n.textarea-module__inputWrapper___WFx7P {\r\n background-color: #fff;\r\n cursor: pointer;\r\n width: 100%;\r\n border-radius: var(--input-border-radius);\r\n border: var(--input-border);\r\n font-family: var(--font-open-sans-serif);\r\n font-size: var(--input-font-size);\r\n font-weight: var(--input-font-weight);\r\n line-height: var(--input-line-height);\r\n text-align: left;\r\n}\r\n\r\n.textarea-module__inputWrapperError___0gA5w {\r\n border: var(--input-border-danger) !important;\r\n outline: var(--input-outline-danger) !important;\r\n}\r\n\r\n.textarea-module__inputWrapper___WFx7P:focus,\r\n.textarea-module__inputWrapper___WFx7P:focus-visible,\r\n.textarea-module__inputWrapper___WFx7P:focus-within {\r\n border: var(--input-border-focus);\r\n outline: var(--input-outline-focus);\r\n box-shadow: 0px 0px 0px 2px #0091ea80;\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc {\r\n display: flex;\r\n align-items: flex-start;\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea {\r\n padding: 8px 0;\r\n font-size: var(--font-size-14, 14px);\r\n font-weight: 700;\r\n flex: 1;\r\n background-color: var(--input-bg-color);\r\n color: var(--input-placeholder-focus, #303030cc);\r\n}\r\n\r\n.textarea-module__messageContainer___akVKQ {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n width: 100%;\r\n}\r\n\r\n.textarea-module__messageWrapper___2mdmw {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 4px;\r\n}\r\n\r\n.textarea-module__counter___zHZ86 {\r\n font-size: var(--font-size-12, 12px);\r\n color: var(--color-label);\r\n font-weight: 700;\r\n text-align: right;\r\n min-width: 60px;\r\n}\r\n\r\n.textarea-module__styledInput___fPp-f {\r\n color: var(--color-input);\r\n cursor: pointer;\r\n width: 100%;\r\n border: none;\r\n border-radius: 8px;\r\n padding: 8px 0;\r\n resize: none;\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea::placeholder {\r\n font-weight: 700;\r\n color: var(--input-placeholder-color);\r\n font-size: var(--font-size-14, 14px);\r\n line-height: 24px;\r\n font-family: var(--font-open-sans-serif);\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea:focus {\r\n color: var(--input-placeholder-focus, #303030cc);\r\n outline: none;\r\n border: 1px solid #1a95b0;\r\n box-shadow: 0px 0px 0px 2px #0091ea80;\r\n font-size: var(--font-size-14, 14px);\r\n font-weight: 700;\r\n background-color: var(--input-bg-color);\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc textarea:disabled {\r\n background-color: #eeeeee;\r\n border-radius: 8px;\r\n cursor: not-allowed;\r\n}\r\n\r\n.textarea-module__styledInput___fPp-f:focus,\r\n.textarea-module__styledInput___fPp-f:focus-visible,\r\n.textarea-module__styledInput___fPp-f:focus-within {\r\n outline: none;\r\n}\r\n\r\n.textarea-module__message___ys-dL {\r\n color: var(--color-label);\r\n margin-left: 8px;\r\n font-family: var(--font-open-sans-serif);\r\n font-size: 12px;\r\n font-weight: 700;\r\n line-height: 15px;\r\n text-align: left;\r\n}\r\n\r\n.textarea-module__messageError___ubeLK {\r\n color: var(--color-danger);\r\n}\r\n\r\n.textarea-module__inputContent___kdVmc svg {\r\n padding-left: 8px;\r\n margin-top: 11px;\r\n}\r\n";
728
728
  var styles$r = {"inputContainer":"textarea-module__inputContainer___lpM5d","label":"textarea-module__label___qDTpX","labelRequired":"textarea-module__labelRequired___bl2ew","labelError":"textarea-module__labelError___f0hpM","inputWrapper":"textarea-module__inputWrapper___WFx7P","inputWrapperError":"textarea-module__inputWrapperError___0gA5w","inputContent":"textarea-module__inputContent___kdVmc","messageContainer":"textarea-module__messageContainer___akVKQ","messageWrapper":"textarea-module__messageWrapper___2mdmw","counter":"textarea-module__counter___zHZ86","styledInput":"textarea-module__styledInput___fPp-f","message":"textarea-module__message___ys-dL","messageError":"textarea-module__messageError___ubeLK"};
729
729
  styleInject(css_248z$u);
730
730
 
@@ -8548,26 +8548,71 @@ var SelectMult = function (_a) {
8548
8548
  !hasError && message && React__default.createElement("p", { className: styles$g.message }, message)));
8549
8549
  };
8550
8550
 
8551
- var css_248z$f = ".styles-module__selectContainer___uFP2d {\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n}\r\n\r\n.styles-module__selectContainer___uFP2d label {\r\n font-size: var(--font-size-16);\r\n font-weight: 700;\r\n line-height: 24px;\r\n color: var(--color-label);\r\n}\r\n\r\n.styles-module__errorText___grCcq {\r\n font-size: 12px;\r\n font-weight: 700;\r\n line-height: 15px;\r\n text-align: left;\r\n color: var(--color-danger);\r\n margin-left: 8px;\r\n}\r\n\r\n.styles-module__errorRequired___PNeLN {\r\n font-size: var(--font-size-16);\r\n font-weight: 700;\r\n line-height: 24px;\r\n text-align: left;\r\n color: var(--color-danger);\r\n}\r\n\r\n.styles-module__contentIcon___SAMFM {\r\n display: flex;\r\n align-items: center;\r\n padding: 8px;\r\n}\r\n\r\n.styles-module__iconChefron___Cp81j {\r\n color: var(--color-label);\r\n}\r\n";
8551
+ var css_248z$f = ".styles-module__selectContainer___uFP2d {\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n}\r\n\r\n.styles-module__selectContainer___uFP2d label {\r\n font-size: var(--font-size-16);\r\n font-weight: 700;\r\n line-height: 24px;\r\n color: var(--color-label);\r\n}\r\n\r\n@media (max-width: 480px) {\r\n .styles-module__selectContainer___uFP2d label {\r\n font-size: var(--font-size-12);\r\n }\r\n}\r\n\r\n.styles-module__errorText___grCcq {\r\n font-size: var(--font-size-12);\r\n font-weight: 700;\r\n line-height: 15px;\r\n text-align: left;\r\n color: var(--color-danger);\r\n margin-left: 8px;\r\n}\r\n\r\n.styles-module__errorRequired___PNeLN {\r\n font-size: var(--font-size-16);\r\n font-weight: 700;\r\n line-height: 24px;\r\n text-align: left;\r\n color: var(--color-danger);\r\n}\r\n\r\n.styles-module__contentIcon___SAMFM {\r\n display: flex;\r\n align-items: center;\r\n padding: 8px;\r\n}\r\n\r\n.styles-module__iconChefron___Cp81j {\r\n color: var(--color-label);\r\n}\r\n";
8552
8552
  var styles$f = {"selectContainer":"styles-module__selectContainer___uFP2d","errorText":"styles-module__errorText___grCcq","errorRequired":"styles-module__errorRequired___PNeLN","contentIcon":"styles-module__contentIcon___SAMFM","iconChefron":"styles-module__iconChefron___Cp81j"};
8553
8553
  styleInject(css_248z$f);
8554
8554
 
8555
- var selectColourStyles$1 = function (isInvalid) { return ({
8555
+ function useDarkMode() {
8556
+ var isClient = typeof document !== 'undefined';
8557
+ var _a = useState(function () { return isClient && document.body.classList.contains('dark-mode'); }), isDarkMode = _a[0], setIsDarkMode = _a[1];
8558
+ useEffect(function () {
8559
+ if (!isClient)
8560
+ return;
8561
+ var updateDarkMode = function (mutationsList) {
8562
+ for (var _i = 0, mutationsList_1 = mutationsList; _i < mutationsList_1.length; _i++) {
8563
+ var mutation = mutationsList_1[_i];
8564
+ if (mutation.type === 'attributes' &&
8565
+ mutation.attributeName === 'class') {
8566
+ setIsDarkMode(document.body.classList.contains('dark-mode'));
8567
+ }
8568
+ }
8569
+ };
8570
+ var observer = new MutationObserver(updateDarkMode);
8571
+ observer.observe(document.body, {
8572
+ attributes: true,
8573
+ attributeFilter: ['class'],
8574
+ });
8575
+ return function () { return observer.disconnect(); };
8576
+ }, [isClient]);
8577
+ return isDarkMode;
8578
+ }
8579
+
8580
+ function useIsMobile(breakpoint) {
8581
+ if (breakpoint === void 0) { breakpoint = 480; }
8582
+ var _a = useState(function () {
8583
+ if (typeof window === 'undefined')
8584
+ return false;
8585
+ return window.innerWidth <= breakpoint;
8586
+ }), isMobile = _a[0], setIsMobile = _a[1];
8587
+ useEffect(function () {
8588
+ function handleResize() {
8589
+ setIsMobile(window.innerWidth <= breakpoint);
8590
+ }
8591
+ window.addEventListener('resize', handleResize);
8592
+ handleResize();
8593
+ return function () { return window.removeEventListener('resize', handleResize); };
8594
+ }, [breakpoint]);
8595
+ return isMobile;
8596
+ }
8597
+
8598
+ var selectColourStyles$1 = function (isInvalid, isDarkMode, isMobile) { return ({
8556
8599
  control: function (styles, _a) {
8557
8600
  var isFocused = _a.isFocused;
8558
8601
  return (__assign(__assign({}, styles), { alignItems: "center", cursor: "pointer", display: "flex", flexWrap: "wrap", justifyContent: "space-between", minHeight: "48px", outline: "0", position: "relative", transition: "all 100ms", borderColor: isInvalid ? "#CB0A0A" : isFocused ? "#1a95b0" : "#cfcfcffc", borderRadius: "9px", borderStyle: "solid", borderWidth: "1px", boxSizing: "border-box", boxShadow: isInvalid
8559
8602
  ? "0px 0px 0px 2px #DC354580"
8560
8603
  : isFocused
8561
8604
  ? "0px 0px 0px 2px #0091ea80"
8562
- : "0px hsl(0, 0%, 96%)", backgroundColor: "white" }));
8605
+ : "0px hsl(0, 0%, 96%)", backgroundColor: isDarkMode ? "#2D2D2E" : "#fff" }));
8563
8606
  },
8564
8607
  option: function (styles, _a) {
8565
- var isDisabled = _a.isDisabled, isSelected = _a.isSelected, isFocused = _a.isFocused;
8566
- return (__assign(__assign({}, styles), { cursor: isDisabled ? "not-allowed" : "default", color: isDisabled ? "white" : "#303030CC", backgroundColor: isFocused
8567
- ? "#005a921a"
8568
- : isSelected
8569
- ? "transparent"
8570
- : "white" }));
8608
+ var isDisabled = _a.isDisabled, isFocused = _a.isFocused;
8609
+ return (__assign(__assign({}, styles), { cursor: isDisabled ? "not-allowed" : "default", color: isDisabled ? "white" : isDarkMode ? "#fff" : "#303030CC", backgroundColor: isDarkMode
8610
+ ? isFocused ? "#303030" : "#4B4B4C"
8611
+ : isFocused ? "#005A921A" : "#fff", fontSize: isMobile ? "12px" : "14px", ":hover": {
8612
+ backgroundColor: isDarkMode
8613
+ ? isFocused ? "#303030" : "#4B4B4C"
8614
+ : isFocused ? "#005A921A" : "#fff",
8615
+ } }));
8571
8616
  },
8572
8617
  multiValue: function (styles) { return (__assign(__assign({}, styles), { backgroundColor: "#005a921a", borderRadius: "9px" })); },
8573
8618
  multiValueLabel: function (styles) { return (__assign(__assign({}, styles), { color: "#30303090" })); },
@@ -8575,24 +8620,27 @@ var selectColourStyles$1 = function (isInvalid) { return ({
8575
8620
  backgroundColor: "#005a921a",
8576
8621
  color: "#30303090",
8577
8622
  } })); },
8578
- placeholder: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : "#30303066", fontSize: "14px", fontWeight: "700", lineHeight: "24px" })); },
8579
- singleValue: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : "#303030CC", fontSize: "14px", fontWeight: "700", lineHeight: "24px" })); },
8623
+ placeholder: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : isDarkMode ? "#fff" : "#30303066", fontSize: isMobile ? "12px" : "14px", fontWeight: "700", lineHeight: "24px" })); },
8624
+ singleValue: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : isDarkMode ? "#fff" : "#303030CC", fontSize: isMobile ? "12px" : "14px", fontWeight: "700", lineHeight: "24px" })); },
8580
8625
  indicatorSeparator: function (styles, _a) {
8581
8626
  var hasValue = _a.hasValue;
8582
8627
  return (__assign(__assign({}, styles), { display: hasValue ? "block" : "none" }));
8583
8628
  },
8629
+ menu: function (base) { return (__assign(__assign({}, base), { backgroundColor: isDarkMode ? "#2D2D2E" : "#fff", borderRadius: "8px" })); },
8630
+ menuList: function (base) { return (__assign(__assign({}, base), { backgroundColor: isDarkMode ? "#4B4B4C" : "#fff", padding: "0.5rem 0", borderRadius: "8px" })); },
8584
8631
  }); };
8585
8632
  var BasicSelect = function (_a) {
8586
8633
  var name = _a.name, optionsSelect = _a.optionsSelect, placeholder = _a.placeholder, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, label = _a.label, _c = _a.hasError, hasError = _c === void 0 ? false : _c, handleChange = _a.handleChange, isRequired = _a.isRequired, value = _a.value;
8634
+ var isDarkMode = useDarkMode();
8635
+ var isMobile = useIsMobile();
8587
8636
  var CustomDropdownIndicator = function () { return (React.createElement("div", { className: styles$f.contentIcon },
8588
8637
  React.createElement(IconTriangleRecall, { className: styles$f.iconChefron }))); };
8589
8638
  return (React.createElement("div", { className: "".concat(styles$f.selectContainer) },
8590
- label && (React.createElement("label", { htmlFor: name },
8639
+ label && (React.createElement("label", { htmlFor: name, className: styles$f.labelText },
8591
8640
  label,
8592
- " ",
8593
8641
  isRequired ? React.createElement("span", { className: styles$f.errorRequired }, "*") : null)),
8594
8642
  React.createElement("div", { className: styles$f.selectElement },
8595
- React.createElement(StateManagedSelect$1, { inputId: name, isMulti: false, isDisabled: isDisabled, options: optionsSelect, value: optionsSelect.find(function (opt) { return opt.value === value; }) || value, onChange: handleChange, placeholder: placeholder, styles: selectColourStyles$1(hasError), isClearable: true, isSearchable: true, noOptionsMessage: function () { return "Nenhuma opção disponível"; }, components: { DropdownIndicator: CustomDropdownIndicator }, "aria-label": typeof label === 'string' ? label : (placeholder || "Campo para seleção") })),
8643
+ React.createElement(StateManagedSelect$1, { inputId: name, isMulti: false, isDisabled: isDisabled, options: optionsSelect, value: optionsSelect.find(function (opt) { return opt.value === value; }) || value, onChange: handleChange, placeholder: placeholder, styles: selectColourStyles$1(hasError, isDarkMode, isMobile), isClearable: true, isSearchable: true, noOptionsMessage: function () { return "Nenhuma opção disponível"; }, components: { DropdownIndicator: CustomDropdownIndicator }, "aria-label": typeof label === 'string' ? label : (placeholder || "Campo para seleção") })),
8596
8644
  hasError && (React.createElement("span", { className: styles$f.errorText }, "Campo obrigat\u00F3rio ou inv\u00E1lido"))));
8597
8645
  };
8598
8646