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.js CHANGED
@@ -744,7 +744,7 @@ var Tooltip$1 = function (_a) {
744
744
  React.createElement("span", { className: styles$s.textContent }, text)))));
745
745
  };
746
746
 
747
- 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";
747
+ 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";
748
748
  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"};
749
749
  styleInject(css_248z$u);
750
750
 
@@ -8568,26 +8568,71 @@ var SelectMult = function (_a) {
8568
8568
  !hasError && message && React.createElement("p", { className: styles$g.message }, message)));
8569
8569
  };
8570
8570
 
8571
- 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";
8571
+ 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";
8572
8572
  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"};
8573
8573
  styleInject(css_248z$f);
8574
8574
 
8575
- var selectColourStyles$1 = function (isInvalid) { return ({
8575
+ function useDarkMode() {
8576
+ var isClient = typeof document !== 'undefined';
8577
+ var _a = React.useState(function () { return isClient && document.body.classList.contains('dark-mode'); }), isDarkMode = _a[0], setIsDarkMode = _a[1];
8578
+ React.useEffect(function () {
8579
+ if (!isClient)
8580
+ return;
8581
+ var updateDarkMode = function (mutationsList) {
8582
+ for (var _i = 0, mutationsList_1 = mutationsList; _i < mutationsList_1.length; _i++) {
8583
+ var mutation = mutationsList_1[_i];
8584
+ if (mutation.type === 'attributes' &&
8585
+ mutation.attributeName === 'class') {
8586
+ setIsDarkMode(document.body.classList.contains('dark-mode'));
8587
+ }
8588
+ }
8589
+ };
8590
+ var observer = new MutationObserver(updateDarkMode);
8591
+ observer.observe(document.body, {
8592
+ attributes: true,
8593
+ attributeFilter: ['class'],
8594
+ });
8595
+ return function () { return observer.disconnect(); };
8596
+ }, [isClient]);
8597
+ return isDarkMode;
8598
+ }
8599
+
8600
+ function useIsMobile(breakpoint) {
8601
+ if (breakpoint === void 0) { breakpoint = 480; }
8602
+ var _a = React.useState(function () {
8603
+ if (typeof window === 'undefined')
8604
+ return false;
8605
+ return window.innerWidth <= breakpoint;
8606
+ }), isMobile = _a[0], setIsMobile = _a[1];
8607
+ React.useEffect(function () {
8608
+ function handleResize() {
8609
+ setIsMobile(window.innerWidth <= breakpoint);
8610
+ }
8611
+ window.addEventListener('resize', handleResize);
8612
+ handleResize();
8613
+ return function () { return window.removeEventListener('resize', handleResize); };
8614
+ }, [breakpoint]);
8615
+ return isMobile;
8616
+ }
8617
+
8618
+ var selectColourStyles$1 = function (isInvalid, isDarkMode, isMobile) { return ({
8576
8619
  control: function (styles, _a) {
8577
8620
  var isFocused = _a.isFocused;
8578
8621
  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
8579
8622
  ? "0px 0px 0px 2px #DC354580"
8580
8623
  : isFocused
8581
8624
  ? "0px 0px 0px 2px #0091ea80"
8582
- : "0px hsl(0, 0%, 96%)", backgroundColor: "white" }));
8625
+ : "0px hsl(0, 0%, 96%)", backgroundColor: isDarkMode ? "#2D2D2E" : "#fff" }));
8583
8626
  },
8584
8627
  option: function (styles, _a) {
8585
- var isDisabled = _a.isDisabled, isSelected = _a.isSelected, isFocused = _a.isFocused;
8586
- return (__assign(__assign({}, styles), { cursor: isDisabled ? "not-allowed" : "default", color: isDisabled ? "white" : "#303030CC", backgroundColor: isFocused
8587
- ? "#005a921a"
8588
- : isSelected
8589
- ? "transparent"
8590
- : "white" }));
8628
+ var isDisabled = _a.isDisabled, isFocused = _a.isFocused;
8629
+ return (__assign(__assign({}, styles), { cursor: isDisabled ? "not-allowed" : "default", color: isDisabled ? "white" : isDarkMode ? "#fff" : "#303030CC", backgroundColor: isDarkMode
8630
+ ? isFocused ? "#303030" : "#4B4B4C"
8631
+ : isFocused ? "#005A921A" : "#fff", fontSize: isMobile ? "12px" : "14px", ":hover": {
8632
+ backgroundColor: isDarkMode
8633
+ ? isFocused ? "#303030" : "#4B4B4C"
8634
+ : isFocused ? "#005A921A" : "#fff",
8635
+ } }));
8591
8636
  },
8592
8637
  multiValue: function (styles) { return (__assign(__assign({}, styles), { backgroundColor: "#005a921a", borderRadius: "9px" })); },
8593
8638
  multiValueLabel: function (styles) { return (__assign(__assign({}, styles), { color: "#30303090" })); },
@@ -8595,24 +8640,27 @@ var selectColourStyles$1 = function (isInvalid) { return ({
8595
8640
  backgroundColor: "#005a921a",
8596
8641
  color: "#30303090",
8597
8642
  } })); },
8598
- placeholder: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : "#30303066", fontSize: "14px", fontWeight: "700", lineHeight: "24px" })); },
8599
- singleValue: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : "#303030CC", fontSize: "14px", fontWeight: "700", lineHeight: "24px" })); },
8643
+ placeholder: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : isDarkMode ? "#fff" : "#30303066", fontSize: isMobile ? "12px" : "14px", fontWeight: "700", lineHeight: "24px" })); },
8644
+ singleValue: function (styles) { return (__assign(__assign({}, styles), { color: isInvalid ? "#CB0A0A" : isDarkMode ? "#fff" : "#303030CC", fontSize: isMobile ? "12px" : "14px", fontWeight: "700", lineHeight: "24px" })); },
8600
8645
  indicatorSeparator: function (styles, _a) {
8601
8646
  var hasValue = _a.hasValue;
8602
8647
  return (__assign(__assign({}, styles), { display: hasValue ? "block" : "none" }));
8603
8648
  },
8649
+ menu: function (base) { return (__assign(__assign({}, base), { backgroundColor: isDarkMode ? "#2D2D2E" : "#fff", borderRadius: "8px" })); },
8650
+ menuList: function (base) { return (__assign(__assign({}, base), { backgroundColor: isDarkMode ? "#4B4B4C" : "#fff", padding: "0.5rem 0", borderRadius: "8px" })); },
8604
8651
  }); };
8605
8652
  var BasicSelect = function (_a) {
8606
8653
  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;
8654
+ var isDarkMode = useDarkMode();
8655
+ var isMobile = useIsMobile();
8607
8656
  var CustomDropdownIndicator = function () { return (React__namespace.createElement("div", { className: styles$f.contentIcon },
8608
8657
  React__namespace.createElement(IconTriangleRecall, { className: styles$f.iconChefron }))); };
8609
8658
  return (React__namespace.createElement("div", { className: "".concat(styles$f.selectContainer) },
8610
- label && (React__namespace.createElement("label", { htmlFor: name },
8659
+ label && (React__namespace.createElement("label", { htmlFor: name, className: styles$f.labelText },
8611
8660
  label,
8612
- " ",
8613
8661
  isRequired ? React__namespace.createElement("span", { className: styles$f.errorRequired }, "*") : null)),
8614
8662
  React__namespace.createElement("div", { className: styles$f.selectElement },
8615
- React__namespace.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") })),
8663
+ React__namespace.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") })),
8616
8664
  hasError && (React__namespace.createElement("span", { className: styles$f.errorText }, "Campo obrigat\u00F3rio ou inv\u00E1lido"))));
8617
8665
  };
8618
8666