@cnc-ti/layout-basic 8.8.2 → 9.0.0
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.css +52 -12
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +175 -28
- package/dist/index.d.ts +175 -28
- package/dist/index.js +579 -338
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +567 -329
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -126,10 +126,11 @@ __export(src_exports, {
|
|
|
126
126
|
PageHeaderTitle: () => PageHeaderTitle,
|
|
127
127
|
PageHeaderTitleContent: () => PageHeaderTitleContent,
|
|
128
128
|
PeriodRangeList: () => PeriodRangeList,
|
|
129
|
-
Popover: () =>
|
|
130
|
-
PopoverContent: () =>
|
|
131
|
-
PopoverTrigger: () =>
|
|
129
|
+
Popover: () => Popover2,
|
|
130
|
+
PopoverContent: () => PopoverContent2,
|
|
131
|
+
PopoverTrigger: () => PopoverTrigger2,
|
|
132
132
|
ResultMetadata: () => ResultMetadata,
|
|
133
|
+
SIDEBAR_MOBILE_BREAKPOINT: () => SIDEBAR_MOBILE_BREAKPOINT,
|
|
133
134
|
Select: () => Select,
|
|
134
135
|
SelectContent: () => SelectContent,
|
|
135
136
|
SelectGroup: () => SelectGroup,
|
|
@@ -170,6 +171,8 @@ __export(src_exports, {
|
|
|
170
171
|
toLocalNoon: () => toLocalNoon,
|
|
171
172
|
usarAlertas: () => usarAlertas,
|
|
172
173
|
useDrawer: () => useDrawer,
|
|
174
|
+
useSidebar: () => useSidebar,
|
|
175
|
+
useSidebarBreakpoint: () => useSidebarBreakpoint,
|
|
173
176
|
validateFiles: () => validateFiles
|
|
174
177
|
});
|
|
175
178
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -3562,7 +3565,7 @@ var ModalMudancaEntidade = ({
|
|
|
3562
3565
|
// src/components/Sidebar/index.tsx
|
|
3563
3566
|
var Accordion = __toESM(require("@radix-ui/react-accordion"));
|
|
3564
3567
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
3565
|
-
var import_react5 = require("react");
|
|
3568
|
+
var import_react5 = __toESM(require("react"));
|
|
3566
3569
|
|
|
3567
3570
|
// src/components/assets/logotipo-default.tsx
|
|
3568
3571
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
@@ -3730,90 +3733,341 @@ function LogotipoDefault() {
|
|
|
3730
3733
|
);
|
|
3731
3734
|
}
|
|
3732
3735
|
|
|
3733
|
-
// src/components/
|
|
3736
|
+
// src/components/molecules/overlay/popover.tsx
|
|
3737
|
+
var React5 = __toESM(require("react"));
|
|
3738
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
3734
3739
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3740
|
+
var Popover = PopoverPrimitive.Root;
|
|
3741
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
3742
|
+
var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3743
|
+
PopoverPrimitive.Content,
|
|
3744
|
+
{
|
|
3745
|
+
ref,
|
|
3746
|
+
align,
|
|
3747
|
+
sideOffset,
|
|
3748
|
+
className: cn(
|
|
3749
|
+
"cnc-z-50 cnc-w-72 cnc-rounded-md cnc-border cnc-bg-popover cnc-p-4 cnc-text-popover-foreground cnc-shadow-md cnc-outline-none data-[state=open]:cnc-animate-in data-[state=closed]:cnc-animate-out data-[state=closed]:cnc-fade-out-0 data-[state=open]:cnc-fade-in-0 data-[state=closed]:cnc-zoom-out-95 data-[state=open]:cnc-zoom-in-95 data-[side=bottom]:cnc-slide-in-from-top-2 data-[side=left]:cnc-slide-in-from-right-2 data-[side=right]:cnc-slide-in-from-left-2 data-[side=top]:cnc-slide-in-from-bottom-2 cnc-origin-[--radix-popover-content-transform-origin]",
|
|
3750
|
+
className
|
|
3751
|
+
),
|
|
3752
|
+
...props
|
|
3753
|
+
}
|
|
3754
|
+
) }));
|
|
3755
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
3756
|
+
|
|
3757
|
+
// src/components/Sidebar/sidebar-context.tsx
|
|
3758
|
+
var React6 = __toESM(require("react"));
|
|
3759
|
+
var SidebarContext = React6.createContext(void 0);
|
|
3760
|
+
var FALLBACK = {
|
|
3761
|
+
variant: "expanded",
|
|
3762
|
+
isMobile: false,
|
|
3763
|
+
requestState: () => void 0
|
|
3764
|
+
};
|
|
3765
|
+
function useSidebar() {
|
|
3766
|
+
return React6.useContext(SidebarContext) ?? FALLBACK;
|
|
3767
|
+
}
|
|
3768
|
+
|
|
3769
|
+
// src/components/Sidebar/use-sidebar-breakpoint.ts
|
|
3770
|
+
var React7 = __toESM(require("react"));
|
|
3771
|
+
var SIDEBAR_MOBILE_BREAKPOINT = 768;
|
|
3772
|
+
function useSidebarBreakpoint(options = {}) {
|
|
3773
|
+
const {
|
|
3774
|
+
mobileBreakpoint = SIDEBAR_MOBILE_BREAKPOINT,
|
|
3775
|
+
defaultState = "expanded"
|
|
3776
|
+
} = options;
|
|
3777
|
+
const [isMobile, setIsMobile] = React7.useState(false);
|
|
3778
|
+
React7.useEffect(() => {
|
|
3779
|
+
if (typeof window === "undefined") return;
|
|
3780
|
+
const query = window.matchMedia(`(max-width: ${mobileBreakpoint - 1}px)`);
|
|
3781
|
+
const sync = () => setIsMobile(query.matches);
|
|
3782
|
+
sync();
|
|
3783
|
+
if (query.addEventListener) {
|
|
3784
|
+
query.addEventListener("change", sync);
|
|
3785
|
+
return () => query.removeEventListener("change", sync);
|
|
3786
|
+
}
|
|
3787
|
+
query.addListener(sync);
|
|
3788
|
+
return () => query.removeListener(sync);
|
|
3789
|
+
}, [mobileBreakpoint]);
|
|
3790
|
+
const getNextState = React7.useCallback(
|
|
3791
|
+
(current) => {
|
|
3792
|
+
if (isMobile) {
|
|
3793
|
+
return current === "closed" ? "expanded" : "closed";
|
|
3794
|
+
}
|
|
3795
|
+
return current === "expanded" ? "mini" : "expanded";
|
|
3796
|
+
},
|
|
3797
|
+
[isMobile]
|
|
3798
|
+
);
|
|
3799
|
+
const suggested = isMobile ? "closed" : defaultState;
|
|
3800
|
+
return { isMobile, suggested, getNextState };
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
// src/components/Sidebar/index.tsx
|
|
3804
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3805
|
+
var MINI_WIDTH = "4rem";
|
|
3806
|
+
var EXPANDED_WIDTH = "280px";
|
|
3807
|
+
function resolveVariant(variant, isOpen) {
|
|
3808
|
+
if (variant) return variant;
|
|
3809
|
+
if (isOpen === false) return "closed";
|
|
3810
|
+
return "expanded";
|
|
3811
|
+
}
|
|
3735
3812
|
function SidebarContainer({
|
|
3736
|
-
isOpen
|
|
3813
|
+
isOpen,
|
|
3814
|
+
variant,
|
|
3815
|
+
onVariantChange,
|
|
3816
|
+
mobileBreakpoint = SIDEBAR_MOBILE_BREAKPOINT,
|
|
3817
|
+
className,
|
|
3818
|
+
style,
|
|
3819
|
+
children,
|
|
3737
3820
|
...rest
|
|
3738
3821
|
}) {
|
|
3739
|
-
|
|
3822
|
+
const { isMobile } = useSidebarBreakpoint({ mobileBreakpoint });
|
|
3823
|
+
const resolved = resolveVariant(variant, isOpen);
|
|
3824
|
+
const requestState = import_react5.default.useCallback(
|
|
3825
|
+
(next) => onVariantChange?.(next),
|
|
3826
|
+
[onVariantChange]
|
|
3827
|
+
);
|
|
3828
|
+
const context = import_react5.default.useMemo(
|
|
3829
|
+
() => ({ variant: resolved, isMobile, requestState }),
|
|
3830
|
+
[resolved, isMobile, requestState]
|
|
3831
|
+
);
|
|
3832
|
+
if (resolved === "closed") {
|
|
3833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SidebarContext.Provider, { value: context });
|
|
3834
|
+
}
|
|
3835
|
+
const width = resolved === "mini" ? MINI_WIDTH : isMobile ? "100vw" : EXPANDED_WIDTH;
|
|
3836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SidebarContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3740
3837
|
"div",
|
|
3741
3838
|
{
|
|
3742
|
-
"data-is-open":
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3839
|
+
"data-is-open": true,
|
|
3840
|
+
"data-state": resolved,
|
|
3841
|
+
style: { width, ...style },
|
|
3842
|
+
className: cn(
|
|
3843
|
+
"cnc-flex cnc-flex-col cnc-h-screen cnc-overflow-hidden",
|
|
3844
|
+
"cnc-transition-all cnc-duration-300 cnc-ease-in-out",
|
|
3845
|
+
"cnc-sidebar-container cnc-bg-primary-800",
|
|
3846
|
+
className
|
|
3847
|
+
),
|
|
3848
|
+
...rest,
|
|
3849
|
+
children
|
|
3746
3850
|
}
|
|
3747
|
-
);
|
|
3851
|
+
) });
|
|
3748
3852
|
}
|
|
3749
3853
|
function SidebarImageBrand({
|
|
3750
3854
|
asChild = false,
|
|
3751
3855
|
onChangeToggle,
|
|
3856
|
+
onToggleRequest,
|
|
3857
|
+
showToggle = true,
|
|
3752
3858
|
img,
|
|
3753
3859
|
children
|
|
3754
3860
|
}) {
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3861
|
+
const { variant, isMobile, requestState } = useSidebar();
|
|
3862
|
+
const isMini = variant === "mini";
|
|
3863
|
+
const handleToggle = () => {
|
|
3864
|
+
const next = isMobile ? variant === "closed" ? "expanded" : "closed" : variant === "expanded" ? "mini" : "expanded";
|
|
3865
|
+
onChangeToggle?.();
|
|
3866
|
+
if (onToggleRequest) {
|
|
3867
|
+
onToggleRequest(next);
|
|
3868
|
+
return;
|
|
3869
|
+
}
|
|
3870
|
+
requestState(next);
|
|
3871
|
+
};
|
|
3872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3873
|
+
"div",
|
|
3874
|
+
{
|
|
3875
|
+
className: cn(
|
|
3876
|
+
"cnc-flex cnc-items-center cnc-shrink-0 cnc-bg-primary-900",
|
|
3877
|
+
"cnc-w-full cnc-max-h-[70px] cnc-py-5 cnc-px-6",
|
|
3878
|
+
"cnc-transition-all cnc-duration-300 cnc-ease-in-out",
|
|
3879
|
+
isMini ? "cnc-justify-center cnc-px-0" : "cnc-justify-between cnc-sidebar-child-w-0"
|
|
3880
|
+
),
|
|
3881
|
+
children: [
|
|
3882
|
+
!isMini && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "cnc-sidebar-child-hidden", children: asChild && !img ? children : img && img.src ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3883
|
+
"img",
|
|
3771
3884
|
{
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3885
|
+
src: img.src,
|
|
3886
|
+
alt: img?.alt,
|
|
3887
|
+
className: "cnc-w-[159px] cnc-h-[28px] cnc-object-contain"
|
|
3888
|
+
}
|
|
3889
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LogotipoDefault, {}) }),
|
|
3890
|
+
showToggle && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3891
|
+
"button",
|
|
3892
|
+
{
|
|
3893
|
+
type: "button",
|
|
3894
|
+
onClick: handleToggle,
|
|
3895
|
+
"aria-label": "Alternar barra lateral",
|
|
3896
|
+
className: cn(
|
|
3897
|
+
"hover:cnc-brightness-75 cnc-cursor-pointer",
|
|
3898
|
+
!isMini && "cnc-sidebar-child-hidden"
|
|
3899
|
+
),
|
|
3900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3901
|
+
"svg",
|
|
3782
3902
|
{
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3903
|
+
stroke: "currentColor",
|
|
3904
|
+
fill: "currentColor",
|
|
3905
|
+
strokeWidth: "0",
|
|
3906
|
+
viewBox: "0 0 512 512",
|
|
3907
|
+
className: "cnc-size-6 cnc-text-white",
|
|
3908
|
+
height: "1em",
|
|
3909
|
+
width: "1em",
|
|
3910
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3911
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3912
|
+
"path",
|
|
3913
|
+
{
|
|
3914
|
+
fill: "none",
|
|
3915
|
+
strokeLinecap: "round",
|
|
3916
|
+
strokeMiterlimit: "10",
|
|
3917
|
+
strokeWidth: "48",
|
|
3918
|
+
d: "M88 152h336M88 256h336M88 360h336"
|
|
3919
|
+
}
|
|
3920
|
+
)
|
|
3788
3921
|
}
|
|
3789
3922
|
)
|
|
3790
3923
|
}
|
|
3791
3924
|
)
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3925
|
+
]
|
|
3926
|
+
}
|
|
3927
|
+
);
|
|
3795
3928
|
}
|
|
3796
|
-
function Sidebar({ children, ...rest }) {
|
|
3797
|
-
|
|
3798
|
-
|
|
3929
|
+
function Sidebar({ children, className, ...rest }) {
|
|
3930
|
+
const { variant } = useSidebar();
|
|
3931
|
+
const isMini = variant === "mini";
|
|
3932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Accordion.Root, { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3933
|
+
"nav",
|
|
3799
3934
|
{
|
|
3800
|
-
className:
|
|
3935
|
+
className: cn(
|
|
3936
|
+
"cnc-w-full cnc-flex-1 cnc-flex cnc-flex-col cnc-py-8 cnc-bg-primary-800",
|
|
3937
|
+
"cnc-scroll-smooth cnc-overflow-y-auto cnc-overflow-x-hidden",
|
|
3938
|
+
"[&::-webkit-scrollbar]:cnc-w-1",
|
|
3939
|
+
"[&::-webkit-scrollbar-track]:cnc-bg-brand-blue-500",
|
|
3940
|
+
"[&::-webkit-scrollbar-thumb]:cnc-rounded",
|
|
3941
|
+
"[&::-webkit-scrollbar-thumb]:cnc-border",
|
|
3942
|
+
"[&::-webkit-scrollbar-thumb]:cnc-border-solid",
|
|
3943
|
+
"[&::-webkit-scrollbar-thumb]:cnc-border-brand-gray-400",
|
|
3944
|
+
"[&::-webkit-scrollbar-thumb]:cnc-bg-brand-gray-200",
|
|
3945
|
+
isMini ? "cnc-px-2" : "cnc-px-5 cnc-sidebar-child-w-0",
|
|
3946
|
+
className
|
|
3947
|
+
),
|
|
3801
3948
|
children
|
|
3802
3949
|
}
|
|
3803
3950
|
) });
|
|
3804
3951
|
}
|
|
3952
|
+
function renderIconItem(icon) {
|
|
3953
|
+
if (!icon) return null;
|
|
3954
|
+
if ((0, import_react5.isValidElement)(icon) && icon.type === "svg") {
|
|
3955
|
+
const svgIcon = icon;
|
|
3956
|
+
return (0, import_react5.cloneElement)(svgIcon, {
|
|
3957
|
+
height: 20,
|
|
3958
|
+
width: 20
|
|
3959
|
+
});
|
|
3960
|
+
}
|
|
3961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "cnc-w-5 cnc-h-5 cnc-shrink-0 cnc-flex cnc-items-center cnc-justify-center cnc-overflow-hidden", children: icon });
|
|
3962
|
+
}
|
|
3963
|
+
var legacyWarned = /* @__PURE__ */ new Set();
|
|
3964
|
+
function warnLegacyChildren(context) {
|
|
3965
|
+
if (process.env.NODE_ENV === "production") return;
|
|
3966
|
+
if (legacyWarned.has(context)) return;
|
|
3967
|
+
legacyWarned.add(context);
|
|
3968
|
+
console.warn(
|
|
3969
|
+
`[layout-basic] ${context}: passar \xEDcone e texto como "children" est\xE1 obsoleto desde a v9. Use as props "icon" e "label" \u2014 sem elas o estado "mini" n\xE3o consegue ocultar o r\xF3tulo nem exibir o tooltip.`
|
|
3970
|
+
);
|
|
3971
|
+
}
|
|
3972
|
+
function MiniTooltip({ label }) {
|
|
3973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3974
|
+
"span",
|
|
3975
|
+
{
|
|
3976
|
+
role: "tooltip",
|
|
3977
|
+
className: cn(
|
|
3978
|
+
"cnc-pointer-events-none cnc-absolute cnc-left-full cnc-top-1/2",
|
|
3979
|
+
"cnc--translate-y-1/2 cnc-ml-2 cnc-z-50 cnc-whitespace-nowrap",
|
|
3980
|
+
"cnc-rounded-md cnc-bg-gray-900 cnc-px-2.5 cnc-py-1.5",
|
|
3981
|
+
"cnc-text-xs cnc-font-medium cnc-text-white cnc-shadow-lg",
|
|
3982
|
+
"cnc-opacity-0 cnc-transition-opacity cnc-duration-150",
|
|
3983
|
+
"group-hover:cnc-opacity-100 group-focus-within:cnc-opacity-100"
|
|
3984
|
+
),
|
|
3985
|
+
children: label
|
|
3986
|
+
}
|
|
3987
|
+
);
|
|
3988
|
+
}
|
|
3805
3989
|
function SidebarNavLink({
|
|
3806
3990
|
asChild = false,
|
|
3807
3991
|
type = "primary",
|
|
3992
|
+
icon,
|
|
3993
|
+
label,
|
|
3994
|
+
ativo = false,
|
|
3995
|
+
disabled = false,
|
|
3996
|
+
keepOpenOnClick = false,
|
|
3997
|
+
className,
|
|
3998
|
+
children,
|
|
3999
|
+
onClick,
|
|
3808
4000
|
...rest
|
|
3809
4001
|
}) {
|
|
4002
|
+
const { variant, isMobile, requestState } = useSidebar();
|
|
4003
|
+
const isMini = variant === "mini";
|
|
4004
|
+
const usesLegacyChildren = !icon && !label && children != null;
|
|
4005
|
+
import_react5.default.useEffect(() => {
|
|
4006
|
+
if (usesLegacyChildren) warnLegacyChildren("SidebarNavLink");
|
|
4007
|
+
}, [usesLegacyChildren]);
|
|
3810
4008
|
const Component = asChild ? import_react_slot2.Slot : "a";
|
|
3811
|
-
|
|
4009
|
+
const handleClick = (event) => {
|
|
4010
|
+
if (disabled) {
|
|
4011
|
+
event.preventDefault();
|
|
4012
|
+
return;
|
|
4013
|
+
}
|
|
4014
|
+
onClick?.(event);
|
|
4015
|
+
if (isMobile && !keepOpenOnClick && !event.defaultPrevented) {
|
|
4016
|
+
requestState("closed");
|
|
4017
|
+
}
|
|
4018
|
+
};
|
|
4019
|
+
const content = usesLegacyChildren ? children : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
4020
|
+
renderIconItem(icon),
|
|
4021
|
+
!isMini && label != null && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "cnc-truncate", children: label })
|
|
4022
|
+
] });
|
|
4023
|
+
const link = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3812
4024
|
Component,
|
|
3813
4025
|
{
|
|
3814
4026
|
"data-type": type,
|
|
3815
|
-
|
|
3816
|
-
|
|
4027
|
+
"data-active": ativo || void 0,
|
|
4028
|
+
"aria-current": ativo ? "page" : void 0,
|
|
4029
|
+
"aria-disabled": disabled || void 0,
|
|
4030
|
+
tabIndex: disabled ? -1 : void 0,
|
|
4031
|
+
onClick: handleClick,
|
|
4032
|
+
className: cn(
|
|
4033
|
+
"cnc-sidebar-item cnc-w-full cnc-flex cnc-items-center cnc-gap-2",
|
|
4034
|
+
"cnc-text-base cnc-text-white cnc-no-underline",
|
|
4035
|
+
"cnc-transition-colors cnc-duration-200",
|
|
4036
|
+
"hover:cnc-text-blue-600",
|
|
4037
|
+
"data-[type=secondary]:cnc-pl-0 data-[type=secondary]:cnc-text-sm",
|
|
4038
|
+
"data-[type=secondary]:cnc-py-0 data-[type=secondary]:cnc-my-2",
|
|
4039
|
+
isMini ? "cnc-justify-center cnc-rounded-md cnc-px-2 cnc-py-2.5" : "cnc-py-4 cnc-sidebar-child-hidden",
|
|
4040
|
+
ativo && "cnc-bg-white/20 cnc-rounded-md",
|
|
4041
|
+
disabled && "cnc-opacity-60 cnc-pointer-events-none",
|
|
4042
|
+
className
|
|
4043
|
+
),
|
|
4044
|
+
...rest,
|
|
4045
|
+
children: content
|
|
4046
|
+
}
|
|
4047
|
+
);
|
|
4048
|
+
if (isMini && label != null) {
|
|
4049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "cnc-relative cnc-group cnc-mb-1", children: [
|
|
4050
|
+
link,
|
|
4051
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MiniTooltip, { label })
|
|
4052
|
+
] });
|
|
4053
|
+
}
|
|
4054
|
+
return link;
|
|
4055
|
+
}
|
|
4056
|
+
function ChevronIcon({ className }) {
|
|
4057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4058
|
+
"svg",
|
|
4059
|
+
{
|
|
4060
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4061
|
+
width: "24",
|
|
4062
|
+
height: "24",
|
|
4063
|
+
viewBox: "0 0 24 24",
|
|
4064
|
+
fill: "none",
|
|
4065
|
+
stroke: "currentColor",
|
|
4066
|
+
strokeWidth: "2",
|
|
4067
|
+
strokeLinecap: "round",
|
|
4068
|
+
strokeLinejoin: "round",
|
|
4069
|
+
className,
|
|
4070
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
3817
4071
|
}
|
|
3818
4072
|
);
|
|
3819
4073
|
}
|
|
@@ -3821,57 +4075,62 @@ function SidebarNavCollapse({
|
|
|
3821
4075
|
children,
|
|
3822
4076
|
title,
|
|
3823
4077
|
icon,
|
|
4078
|
+
className,
|
|
3824
4079
|
...rest
|
|
3825
4080
|
}) {
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
] }),
|
|
3832
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "cnc-w-4 cnc-h-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3833
|
-
"svg",
|
|
4081
|
+
const { variant } = useSidebar();
|
|
4082
|
+
if (variant === "mini") {
|
|
4083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Popover, { children: [
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4085
|
+
"button",
|
|
3834
4086
|
{
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
4087
|
+
type: "button",
|
|
4088
|
+
"aria-label": title,
|
|
4089
|
+
className: cn(
|
|
4090
|
+
"cnc-sidebar-item cnc-w-full cnc-mb-1 cnc-flex cnc-items-center",
|
|
4091
|
+
"cnc-justify-center cnc-rounded-md cnc-px-2 cnc-py-2.5",
|
|
4092
|
+
"cnc-text-white cnc-transition-colors cnc-duration-200",
|
|
4093
|
+
"hover:cnc-bg-white/10 hover:cnc-text-blue-600",
|
|
4094
|
+
className
|
|
4095
|
+
),
|
|
4096
|
+
children: renderIconItem(icon)
|
|
3846
4097
|
}
|
|
3847
|
-
) })
|
|
4098
|
+
) }),
|
|
4099
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4100
|
+
PopoverContent,
|
|
4101
|
+
{
|
|
4102
|
+
side: "right",
|
|
4103
|
+
align: "start",
|
|
4104
|
+
sideOffset: 8,
|
|
4105
|
+
className: "cnc-w-56 cnc-bg-primary-800 cnc-border-primary-200 cnc-p-2",
|
|
4106
|
+
children: [
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "cnc-px-2 cnc-pb-2 cnc-text-xs cnc-font-semibold cnc-text-white/70", children: title }),
|
|
4108
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "cnc-flex cnc-flex-col", children })
|
|
4109
|
+
]
|
|
4110
|
+
}
|
|
4111
|
+
)
|
|
4112
|
+
] });
|
|
4113
|
+
}
|
|
4114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Accordion.Item, { ...rest, className: cn("cnc-sidebar-item", className), children: [
|
|
4115
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Accordion.Trigger, { className: "group cnc-w-full cnc-py-4 cnc-text-base cnc-text-white cnc-flex cnc-gap-2 cnc-items-center cnc-justify-between hover:cnc-text-blue-600 cnc-sidebar-child-hidden", children: [
|
|
4116
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "cnc-flex cnc-items-center cnc-gap-2", children: [
|
|
4117
|
+
renderIconItem(icon),
|
|
4118
|
+
title
|
|
4119
|
+
] }),
|
|
4120
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "cnc-w-4 cnc-h-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChevronIcon, { className: "cnc-w-full cnc-h-full cnc-text-violet10 cnc-transition-transform cnc-duration-300 cnc-ease-[cubic-bezier(0.87,_0,_0.13,_1)] group-data-[state=open]:cnc-rotate-90" }) })
|
|
3848
4121
|
] }),
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
4122
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Accordion.Content, { className: "cnc-overflow-hidden data-[state=closed]:cnc-animate-slideUp data-[state=open]:cnc-animate-slideDown cnc-py-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "cnc-bg-white/10 cnc-rounded-md cnc-font-normal cnc-px-5 cnc-py-3", children }) })
|
|
3850
4123
|
] });
|
|
3851
4124
|
}
|
|
3852
|
-
function renderIconItem(icon) {
|
|
3853
|
-
if (!icon) return null;
|
|
3854
|
-
if ((0, import_react5.isValidElement)(icon) && icon.type === "svg") {
|
|
3855
|
-
const svgIcon = icon;
|
|
3856
|
-
return (0, import_react5.cloneElement)(svgIcon, {
|
|
3857
|
-
height: 20,
|
|
3858
|
-
width: 20
|
|
3859
|
-
});
|
|
3860
|
-
}
|
|
3861
|
-
if ((0, import_react5.isValidElement)(icon)) {
|
|
3862
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "cnc-w-5 cnc-h-5 cnc-overflow-hidden", children: icon });
|
|
3863
|
-
}
|
|
3864
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "cnc-w-5 cnc-h-5 cnc-overflow-hidden", children: icon });
|
|
3865
|
-
}
|
|
3866
4125
|
|
|
3867
4126
|
// src/components/Popover/index.tsx
|
|
3868
|
-
var
|
|
3869
|
-
var
|
|
3870
|
-
var
|
|
3871
|
-
var
|
|
3872
|
-
var
|
|
3873
|
-
var
|
|
3874
|
-
|
|
4127
|
+
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
|
|
4128
|
+
var React9 = __toESM(require("react"));
|
|
4129
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4130
|
+
var Popover2 = PopoverPrimitive2.Root;
|
|
4131
|
+
var PopoverTrigger2 = PopoverPrimitive2.Trigger;
|
|
4132
|
+
var PopoverContent2 = React9.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4133
|
+
PopoverPrimitive2.Content,
|
|
3875
4134
|
{
|
|
3876
4135
|
ref,
|
|
3877
4136
|
align,
|
|
@@ -3883,18 +4142,18 @@ var PopoverContent = React6.forwardRef(({ className, align = "center", sideOffse
|
|
|
3883
4142
|
...props
|
|
3884
4143
|
}
|
|
3885
4144
|
) }));
|
|
3886
|
-
|
|
4145
|
+
PopoverContent2.displayName = PopoverPrimitive2.Content.displayName;
|
|
3887
4146
|
|
|
3888
4147
|
// src/components/Select/index.tsx
|
|
3889
|
-
var
|
|
4148
|
+
var React10 = __toESM(require("react"));
|
|
3890
4149
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
3891
|
-
var
|
|
4150
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3892
4151
|
var Select = SelectPrimitive.Root;
|
|
3893
4152
|
var SelectGroup = SelectPrimitive.Group;
|
|
3894
4153
|
var SelectValue = SelectPrimitive.Value;
|
|
3895
4154
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3896
4155
|
var SelectViewport = SelectPrimitive.Viewport;
|
|
3897
|
-
var SelectTrigger =
|
|
4156
|
+
var SelectTrigger = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3898
4157
|
SelectPrimitive.Trigger,
|
|
3899
4158
|
{
|
|
3900
4159
|
ref,
|
|
@@ -3905,12 +4164,12 @@ var SelectTrigger = React7.forwardRef(({ className, children, ...props }, ref) =
|
|
|
3905
4164
|
...props,
|
|
3906
4165
|
children: [
|
|
3907
4166
|
children,
|
|
3908
|
-
/* @__PURE__ */ (0,
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
3909
4168
|
]
|
|
3910
4169
|
}
|
|
3911
4170
|
));
|
|
3912
4171
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
3913
|
-
var SelectScrollUpButton =
|
|
4172
|
+
var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3914
4173
|
SelectPrimitive.ScrollUpButton,
|
|
3915
4174
|
{
|
|
3916
4175
|
ref,
|
|
@@ -3919,11 +4178,11 @@ var SelectScrollUpButton = React7.forwardRef(({ className, ...props }, ref) => /
|
|
|
3919
4178
|
className
|
|
3920
4179
|
),
|
|
3921
4180
|
...props,
|
|
3922
|
-
children: /* @__PURE__ */ (0,
|
|
4181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronUp, { className: "cnc-h-4 cnc-w-4" })
|
|
3923
4182
|
}
|
|
3924
4183
|
));
|
|
3925
4184
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
3926
|
-
var SelectScrollDownButton =
|
|
4185
|
+
var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3927
4186
|
SelectPrimitive.ScrollDownButton,
|
|
3928
4187
|
{
|
|
3929
4188
|
ref,
|
|
@@ -3932,11 +4191,11 @@ var SelectScrollDownButton = React7.forwardRef(({ className, ...props }, ref) =>
|
|
|
3932
4191
|
className
|
|
3933
4192
|
),
|
|
3934
4193
|
...props,
|
|
3935
|
-
children: /* @__PURE__ */ (0,
|
|
4194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronDown, { className: "cnc-h-4 cnc-w-4" })
|
|
3936
4195
|
}
|
|
3937
4196
|
));
|
|
3938
4197
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
3939
|
-
var SelectContent =
|
|
4198
|
+
var SelectContent = React10.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3940
4199
|
SelectPrimitive.Content,
|
|
3941
4200
|
{
|
|
3942
4201
|
ref,
|
|
@@ -3948,8 +4207,8 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
3948
4207
|
position,
|
|
3949
4208
|
...props,
|
|
3950
4209
|
children: [
|
|
3951
|
-
/* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectScrollUpButton, {}),
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3953
4212
|
SelectPrimitive.Viewport,
|
|
3954
4213
|
{
|
|
3955
4214
|
className: cn(
|
|
@@ -3959,12 +4218,12 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
3959
4218
|
children
|
|
3960
4219
|
}
|
|
3961
4220
|
),
|
|
3962
|
-
/* @__PURE__ */ (0,
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectScrollDownButton, {})
|
|
3963
4222
|
]
|
|
3964
4223
|
}
|
|
3965
4224
|
) }));
|
|
3966
4225
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
3967
|
-
var SelectLabel =
|
|
4226
|
+
var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3968
4227
|
SelectPrimitive.Label,
|
|
3969
4228
|
{
|
|
3970
4229
|
ref,
|
|
@@ -3976,7 +4235,7 @@ var SelectLabel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3976
4235
|
}
|
|
3977
4236
|
));
|
|
3978
4237
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
3979
|
-
var SelectItem =
|
|
4238
|
+
var SelectItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3980
4239
|
SelectPrimitive.Item,
|
|
3981
4240
|
{
|
|
3982
4241
|
ref,
|
|
@@ -3986,13 +4245,13 @@ var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
3986
4245
|
),
|
|
3987
4246
|
...props,
|
|
3988
4247
|
children: [
|
|
3989
|
-
/* @__PURE__ */ (0,
|
|
3990
|
-
/* @__PURE__ */ (0,
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "cnc-absolute cnc-left-2 cnc-flex cnc-h-3.5 cnc-w-3.5 cnc-cnc-items-center cnc-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Check, { className: "cnc-h-4 cnc-w-4" }) }) }),
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectPrimitive.ItemText, { children })
|
|
3991
4250
|
]
|
|
3992
4251
|
}
|
|
3993
4252
|
));
|
|
3994
4253
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
3995
|
-
var SelectSeparator =
|
|
4254
|
+
var SelectSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3996
4255
|
SelectPrimitive.Separator,
|
|
3997
4256
|
{
|
|
3998
4257
|
ref,
|
|
@@ -4004,11 +4263,11 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
4004
4263
|
|
|
4005
4264
|
// src/components/Tabs/index.tsx
|
|
4006
4265
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"));
|
|
4007
|
-
var
|
|
4008
|
-
var
|
|
4266
|
+
var React11 = __toESM(require("react"));
|
|
4267
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4009
4268
|
var Tabs = TabsPrimitive.Root;
|
|
4010
|
-
var TabsList =
|
|
4011
|
-
return /* @__PURE__ */ (0,
|
|
4269
|
+
var TabsList = React11.forwardRef(({ className, ...props }, ref) => {
|
|
4270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4012
4271
|
TabsPrimitive.List,
|
|
4013
4272
|
{
|
|
4014
4273
|
ref,
|
|
@@ -4018,7 +4277,7 @@ var TabsList = React8.forwardRef(({ className, ...props }, ref) => {
|
|
|
4018
4277
|
);
|
|
4019
4278
|
});
|
|
4020
4279
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
4021
|
-
var TabsTrigger =
|
|
4280
|
+
var TabsTrigger = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4022
4281
|
TabsPrimitive.Trigger,
|
|
4023
4282
|
{
|
|
4024
4283
|
ref,
|
|
@@ -4030,8 +4289,8 @@ var TabsTrigger = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4030
4289
|
}
|
|
4031
4290
|
));
|
|
4032
4291
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
4033
|
-
var TabsContent =
|
|
4034
|
-
return /* @__PURE__ */ (0,
|
|
4292
|
+
var TabsContent = React11.forwardRef(({ className, children, ...props }, ref) => {
|
|
4293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4035
4294
|
TabsPrimitive.Content,
|
|
4036
4295
|
{
|
|
4037
4296
|
ref,
|
|
@@ -4047,24 +4306,24 @@ var TabsContent = React8.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
4047
4306
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
4048
4307
|
|
|
4049
4308
|
// src/components/atoms/forms/input.tsx
|
|
4050
|
-
var
|
|
4051
|
-
var
|
|
4052
|
-
var Input =
|
|
4309
|
+
var React12 = __toESM(require("react"));
|
|
4310
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4311
|
+
var Input = React12.forwardRef(
|
|
4053
4312
|
({ className, type, id, label, required, ...props }, ref) => {
|
|
4054
4313
|
const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
|
|
4055
|
-
return /* @__PURE__ */ (0,
|
|
4056
|
-
label && /* @__PURE__ */ (0,
|
|
4314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "cnc-w-full", children: [
|
|
4315
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4057
4316
|
"label",
|
|
4058
4317
|
{
|
|
4059
4318
|
htmlFor: idGenerate,
|
|
4060
4319
|
className: "cnc-block cnc-text-sm cnc-mb-1 cnc-font-medium cnc-text-brand-gray-600",
|
|
4061
4320
|
children: [
|
|
4062
4321
|
label,
|
|
4063
|
-
required && /* @__PURE__ */ (0,
|
|
4322
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-red-500", children: " *" })
|
|
4064
4323
|
]
|
|
4065
4324
|
}
|
|
4066
4325
|
),
|
|
4067
|
-
/* @__PURE__ */ (0,
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4068
4327
|
"input",
|
|
4069
4328
|
{
|
|
4070
4329
|
type,
|
|
@@ -4086,24 +4345,24 @@ var Input = React9.forwardRef(
|
|
|
4086
4345
|
Input.displayName = "Input";
|
|
4087
4346
|
|
|
4088
4347
|
// src/components/atoms/forms/textarea.tsx
|
|
4089
|
-
var
|
|
4090
|
-
var
|
|
4091
|
-
var Textarea =
|
|
4348
|
+
var React13 = __toESM(require("react"));
|
|
4349
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
4350
|
+
var Textarea = React13.forwardRef(
|
|
4092
4351
|
({ className, id, label, required, ...props }, ref) => {
|
|
4093
4352
|
const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
|
|
4094
|
-
return /* @__PURE__ */ (0,
|
|
4095
|
-
label && /* @__PURE__ */ (0,
|
|
4353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "cnc-w-full", children: [
|
|
4354
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
4096
4355
|
"label",
|
|
4097
4356
|
{
|
|
4098
4357
|
htmlFor: idGenerate,
|
|
4099
4358
|
className: "cnc-block cnc-text-sm cnc-mb-1 cnc-font-medium cnc-text-brand-gray-600",
|
|
4100
4359
|
children: [
|
|
4101
4360
|
label,
|
|
4102
|
-
required && /* @__PURE__ */ (0,
|
|
4361
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-red-500", children: " *" })
|
|
4103
4362
|
]
|
|
4104
4363
|
}
|
|
4105
4364
|
),
|
|
4106
|
-
/* @__PURE__ */ (0,
|
|
4365
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4107
4366
|
"textarea",
|
|
4108
4367
|
{
|
|
4109
4368
|
id: idGenerate,
|
|
@@ -4124,14 +4383,14 @@ var Textarea = React10.forwardRef(
|
|
|
4124
4383
|
Textarea.displayName = "Textarea";
|
|
4125
4384
|
|
|
4126
4385
|
// src/components/atoms/forms/checkbox.tsx
|
|
4127
|
-
var
|
|
4128
|
-
var
|
|
4129
|
-
var Checkbox =
|
|
4386
|
+
var React14 = __toESM(require("react"));
|
|
4387
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
4388
|
+
var Checkbox = React14.forwardRef(
|
|
4130
4389
|
({ className, id, label, ...props }, ref) => {
|
|
4131
4390
|
console.log();
|
|
4132
4391
|
const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
|
|
4133
|
-
return /* @__PURE__ */ (0,
|
|
4134
|
-
/* @__PURE__ */ (0,
|
|
4392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "cnc-w-full cnc-flex cnc-flex-row", children: [
|
|
4393
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
4135
4394
|
"input",
|
|
4136
4395
|
{
|
|
4137
4396
|
type: "checkbox",
|
|
@@ -4141,7 +4400,7 @@ var Checkbox = React11.forwardRef(
|
|
|
4141
4400
|
...props
|
|
4142
4401
|
}
|
|
4143
4402
|
),
|
|
4144
|
-
label && /* @__PURE__ */ (0,
|
|
4403
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
4145
4404
|
"label",
|
|
4146
4405
|
{
|
|
4147
4406
|
htmlFor: idGenerate,
|
|
@@ -4155,9 +4414,9 @@ var Checkbox = React11.forwardRef(
|
|
|
4155
4414
|
Checkbox.displayName = "Checkbox";
|
|
4156
4415
|
|
|
4157
4416
|
// src/components/atoms/forms/switch.tsx
|
|
4158
|
-
var
|
|
4159
|
-
var
|
|
4160
|
-
var Switch =
|
|
4417
|
+
var React15 = __toESM(require("react"));
|
|
4418
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
4419
|
+
var Switch = React15.forwardRef(
|
|
4161
4420
|
({
|
|
4162
4421
|
className,
|
|
4163
4422
|
id,
|
|
@@ -4171,12 +4430,12 @@ var Switch = React12.forwardRef(
|
|
|
4171
4430
|
name,
|
|
4172
4431
|
"aria-label": ariaLabel
|
|
4173
4432
|
}, ref) => {
|
|
4174
|
-
const [internalChecked, setInternalChecked] =
|
|
4433
|
+
const [internalChecked, setInternalChecked] = React15.useState(
|
|
4175
4434
|
defaultChecked ?? false
|
|
4176
4435
|
);
|
|
4177
4436
|
const isControlled = checked !== void 0;
|
|
4178
4437
|
const isChecked = isControlled ? checked : internalChecked;
|
|
4179
|
-
const reactId =
|
|
4438
|
+
const reactId = React15.useId();
|
|
4180
4439
|
const fieldId = id || reactId;
|
|
4181
4440
|
const handleToggle = () => {
|
|
4182
4441
|
if (disabled) return;
|
|
@@ -4186,8 +4445,8 @@ var Switch = React12.forwardRef(
|
|
|
4186
4445
|
}
|
|
4187
4446
|
onChange?.(newValue);
|
|
4188
4447
|
};
|
|
4189
|
-
return /* @__PURE__ */ (0,
|
|
4190
|
-
/* @__PURE__ */ (0,
|
|
4448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("cnc-flex cnc-items-center cnc-gap-2", className), children: [
|
|
4449
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4191
4450
|
"input",
|
|
4192
4451
|
{
|
|
4193
4452
|
type: "checkbox",
|
|
@@ -4199,7 +4458,7 @@ var Switch = React12.forwardRef(
|
|
|
4199
4458
|
"aria-hidden": "true"
|
|
4200
4459
|
}
|
|
4201
4460
|
),
|
|
4202
|
-
/* @__PURE__ */ (0,
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4203
4462
|
"button",
|
|
4204
4463
|
{
|
|
4205
4464
|
ref,
|
|
@@ -4217,7 +4476,7 @@ var Switch = React12.forwardRef(
|
|
|
4217
4476
|
"disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50",
|
|
4218
4477
|
isChecked ? "cnc-bg-brand-blue-400 cnc-border-brand-blue-500" : "cnc-bg-brand-gray-20 cnc-border-brand-gray-100"
|
|
4219
4478
|
),
|
|
4220
|
-
children: /* @__PURE__ */ (0,
|
|
4479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4221
4480
|
"span",
|
|
4222
4481
|
{
|
|
4223
4482
|
className: cn(
|
|
@@ -4228,14 +4487,14 @@ var Switch = React12.forwardRef(
|
|
|
4228
4487
|
)
|
|
4229
4488
|
}
|
|
4230
4489
|
),
|
|
4231
|
-
label && /* @__PURE__ */ (0,
|
|
4490
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
4232
4491
|
"label",
|
|
4233
4492
|
{
|
|
4234
4493
|
htmlFor: fieldId,
|
|
4235
4494
|
className: "cnc-text-sm cnc-font-medium cnc-text-brand-gray-600 cnc-cursor-pointer",
|
|
4236
4495
|
children: [
|
|
4237
4496
|
label,
|
|
4238
|
-
required && /* @__PURE__ */ (0,
|
|
4497
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "cnc-text-red-500", children: " *" })
|
|
4239
4498
|
]
|
|
4240
4499
|
}
|
|
4241
4500
|
)
|
|
@@ -4245,7 +4504,7 @@ var Switch = React12.forwardRef(
|
|
|
4245
4504
|
Switch.displayName = "Switch";
|
|
4246
4505
|
|
|
4247
4506
|
// src/components/atoms/display/badge.tsx
|
|
4248
|
-
var
|
|
4507
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
4249
4508
|
var Badge = ({
|
|
4250
4509
|
variant = "default",
|
|
4251
4510
|
rounded = true,
|
|
@@ -4267,7 +4526,7 @@ var Badge = ({
|
|
|
4267
4526
|
md: "cnc-text-sm cnc-px-3 cnc-py-1",
|
|
4268
4527
|
lg: "cnc-text-base cnc-px-4 cnc-py-2"
|
|
4269
4528
|
};
|
|
4270
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4271
4530
|
"span",
|
|
4272
4531
|
{
|
|
4273
4532
|
className: cn(
|
|
@@ -4283,8 +4542,8 @@ var Badge = ({
|
|
|
4283
4542
|
};
|
|
4284
4543
|
|
|
4285
4544
|
// src/components/atoms/display/avatar.tsx
|
|
4286
|
-
var
|
|
4287
|
-
var
|
|
4545
|
+
var React16 = __toESM(require("react"));
|
|
4546
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
4288
4547
|
var avatarSizeClasses = {
|
|
4289
4548
|
sm: "cnc-size-8 cnc-text-[10px]",
|
|
4290
4549
|
md: "cnc-size-12 cnc-text-xs",
|
|
@@ -4306,14 +4565,14 @@ function Avatar({
|
|
|
4306
4565
|
className,
|
|
4307
4566
|
...props
|
|
4308
4567
|
}) {
|
|
4309
|
-
const [hasError, setHasError] =
|
|
4568
|
+
const [hasError, setHasError] = React16.useState(false);
|
|
4310
4569
|
const baseClasses = cn(
|
|
4311
4570
|
"cnc-flex cnc-shrink-0 cnc-items-center cnc-justify-center cnc-overflow-hidden cnc-rounded-full cnc-border-2 cnc-border-brand-gray-50 cnc-bg-brand-gray-10 cnc-text-brand-gray-200",
|
|
4312
4571
|
avatarSizeClasses[size],
|
|
4313
4572
|
className
|
|
4314
4573
|
);
|
|
4315
4574
|
if (isLoading) {
|
|
4316
|
-
return /* @__PURE__ */ (0,
|
|
4575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4317
4576
|
"span",
|
|
4318
4577
|
{
|
|
4319
4578
|
className: cn(baseClasses, "cnc-animate-pulse cnc-bg-brand-gray-50"),
|
|
@@ -4324,7 +4583,7 @@ function Avatar({
|
|
|
4324
4583
|
);
|
|
4325
4584
|
}
|
|
4326
4585
|
const showImage = src && !hasError;
|
|
4327
|
-
return /* @__PURE__ */ (0,
|
|
4586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: baseClasses, ...props, children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4328
4587
|
"img",
|
|
4329
4588
|
{
|
|
4330
4589
|
src,
|
|
@@ -4332,7 +4591,7 @@ function Avatar({
|
|
|
4332
4591
|
className: "cnc-h-full cnc-w-full cnc-object-cover",
|
|
4333
4592
|
onError: () => setHasError(true)
|
|
4334
4593
|
}
|
|
4335
|
-
) : fallback ? /* @__PURE__ */ (0,
|
|
4594
|
+
) : fallback ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "cnc-font-bold", children: fallback }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4336
4595
|
User,
|
|
4337
4596
|
{
|
|
4338
4597
|
className: "cnc-shrink-0",
|
|
@@ -4343,12 +4602,12 @@ function Avatar({
|
|
|
4343
4602
|
}
|
|
4344
4603
|
|
|
4345
4604
|
// src/components/molecules/card.tsx
|
|
4346
|
-
var
|
|
4605
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4347
4606
|
function Card({
|
|
4348
4607
|
className,
|
|
4349
4608
|
...rest
|
|
4350
4609
|
}) {
|
|
4351
|
-
return /* @__PURE__ */ (0,
|
|
4610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4352
4611
|
"div",
|
|
4353
4612
|
{
|
|
4354
4613
|
className: cn(
|
|
@@ -4363,7 +4622,7 @@ function CardHeader({
|
|
|
4363
4622
|
className,
|
|
4364
4623
|
...rest
|
|
4365
4624
|
}) {
|
|
4366
|
-
return /* @__PURE__ */ (0,
|
|
4625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "cnc-px-6 cnc-pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4367
4626
|
"div",
|
|
4368
4627
|
{
|
|
4369
4628
|
className: cn(
|
|
@@ -4378,13 +4637,13 @@ function CardContent({
|
|
|
4378
4637
|
className,
|
|
4379
4638
|
...rest
|
|
4380
4639
|
}) {
|
|
4381
|
-
return /* @__PURE__ */ (0,
|
|
4640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("cnc-px-6 cnc-py-2", className), ...rest });
|
|
4382
4641
|
}
|
|
4383
4642
|
function CardFooter({
|
|
4384
4643
|
className,
|
|
4385
4644
|
...rest
|
|
4386
4645
|
}) {
|
|
4387
|
-
return /* @__PURE__ */ (0,
|
|
4646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4388
4647
|
"div",
|
|
4389
4648
|
{
|
|
4390
4649
|
className: cn(
|
|
@@ -4399,7 +4658,7 @@ function CardFooterItem({
|
|
|
4399
4658
|
className,
|
|
4400
4659
|
...rest
|
|
4401
4660
|
}) {
|
|
4402
|
-
return /* @__PURE__ */ (0,
|
|
4661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4403
4662
|
"div",
|
|
4404
4663
|
{
|
|
4405
4664
|
className: cn(
|
|
@@ -4413,7 +4672,7 @@ function CardFooterItem({
|
|
|
4413
4672
|
|
|
4414
4673
|
// src/components/molecules/collapsible.tsx
|
|
4415
4674
|
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
4416
|
-
var
|
|
4675
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4417
4676
|
var Collapsible = CollapsiblePrimitive.Root;
|
|
4418
4677
|
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
4419
4678
|
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
@@ -4421,16 +4680,16 @@ var AnimatedCollapsibleContent = ({
|
|
|
4421
4680
|
className,
|
|
4422
4681
|
...rest
|
|
4423
4682
|
}) => {
|
|
4424
|
-
return /* @__PURE__ */ (0,
|
|
4683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CollapsibleContent2, { className: "cnc-collapsible-content", ...rest });
|
|
4425
4684
|
};
|
|
4426
4685
|
|
|
4427
4686
|
// src/components/molecules/display/page-header.tsx
|
|
4428
|
-
var
|
|
4687
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4429
4688
|
function PageHeader({
|
|
4430
4689
|
children,
|
|
4431
4690
|
className
|
|
4432
4691
|
}) {
|
|
4433
|
-
return /* @__PURE__ */ (0,
|
|
4692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4434
4693
|
"header",
|
|
4435
4694
|
{
|
|
4436
4695
|
className: cn(
|
|
@@ -4445,7 +4704,7 @@ function PageHeaderTitleContent({
|
|
|
4445
4704
|
children,
|
|
4446
4705
|
className
|
|
4447
4706
|
}) {
|
|
4448
|
-
return /* @__PURE__ */ (0,
|
|
4707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4449
4708
|
"div",
|
|
4450
4709
|
{
|
|
4451
4710
|
className: cn(
|
|
@@ -4462,16 +4721,16 @@ function PageHeaderTitle({
|
|
|
4462
4721
|
titleAs = "h1"
|
|
4463
4722
|
}) {
|
|
4464
4723
|
const ComponentTitle = titleAs;
|
|
4465
|
-
return /* @__PURE__ */ (0,
|
|
4466
|
-
/* @__PURE__ */ (0,
|
|
4467
|
-
description && /* @__PURE__ */ (0,
|
|
4724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ComponentTitle, { className: "cnc-text-2xl cnc-font-semibold cnc-text-brand-blue-600", children: title }),
|
|
4726
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "cnc-text-sm cnc-text-brand-gray-500", children: description })
|
|
4468
4727
|
] });
|
|
4469
4728
|
}
|
|
4470
4729
|
function PageHeaderActionsContainer({
|
|
4471
4730
|
children,
|
|
4472
4731
|
className
|
|
4473
4732
|
}) {
|
|
4474
|
-
return /* @__PURE__ */ (0,
|
|
4733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4475
4734
|
"div",
|
|
4476
4735
|
{
|
|
4477
4736
|
className: cn(
|
|
@@ -4483,11 +4742,11 @@ function PageHeaderActionsContainer({
|
|
|
4483
4742
|
);
|
|
4484
4743
|
}
|
|
4485
4744
|
function Title2({ title, as: Component = "h1" }) {
|
|
4486
|
-
return /* @__PURE__ */ (0,
|
|
4745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Component, { className: "cnc-text-[24px] cnc-text-[#1F2C4D] cnc-font-bold cnc-mt-2 cnc-mb-4 text-center md:cnc-text-[28px] md:cnc-text-left", children: title });
|
|
4487
4746
|
}
|
|
4488
4747
|
|
|
4489
4748
|
// src/components/molecules/display/empty-state.tsx
|
|
4490
|
-
var
|
|
4749
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4491
4750
|
function EmptyState({
|
|
4492
4751
|
icon,
|
|
4493
4752
|
title,
|
|
@@ -4497,7 +4756,7 @@ function EmptyState({
|
|
|
4497
4756
|
className,
|
|
4498
4757
|
...props
|
|
4499
4758
|
}) {
|
|
4500
|
-
return /* @__PURE__ */ (0,
|
|
4759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4501
4760
|
"div",
|
|
4502
4761
|
{
|
|
4503
4762
|
className: cn(
|
|
@@ -4507,17 +4766,17 @@ function EmptyState({
|
|
|
4507
4766
|
),
|
|
4508
4767
|
...props,
|
|
4509
4768
|
children: [
|
|
4510
|
-
/* @__PURE__ */ (0,
|
|
4511
|
-
/* @__PURE__ */ (0,
|
|
4512
|
-
description ? /* @__PURE__ */ (0,
|
|
4513
|
-
action ? /* @__PURE__ */ (0,
|
|
4769
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "cnc-mb-3 cnc-text-brand-gray-200", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FolderOpen, { className: "cnc-h-10 cnc-w-10" }) }),
|
|
4770
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "cnc-text-sm cnc-font-medium cnc-text-brand-blue-600", children: title }),
|
|
4771
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "cnc-mt-1 cnc-max-w-md cnc-text-sm cnc-text-brand-gray-200", children: description }) : null,
|
|
4772
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "cnc-mt-4", children: action }) : null
|
|
4514
4773
|
]
|
|
4515
4774
|
}
|
|
4516
4775
|
);
|
|
4517
4776
|
}
|
|
4518
4777
|
|
|
4519
4778
|
// src/components/molecules/display/result-metadata.tsx
|
|
4520
|
-
var
|
|
4779
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4521
4780
|
function encontradosSuffix(resourceName, forceWordGender) {
|
|
4522
4781
|
if (forceWordGender === "masc") return "o";
|
|
4523
4782
|
if (forceWordGender === "fem") return "a";
|
|
@@ -4534,7 +4793,7 @@ function ResultMetadata({
|
|
|
4534
4793
|
...props
|
|
4535
4794
|
}) {
|
|
4536
4795
|
const encontradVogal = encontradosSuffix(resourceName, forceWordGender);
|
|
4537
|
-
return /* @__PURE__ */ (0,
|
|
4796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4538
4797
|
"div",
|
|
4539
4798
|
{
|
|
4540
4799
|
className: cn("cnc-mt-4 cnc-mb-4", className),
|
|
@@ -4542,10 +4801,10 @@ function ResultMetadata({
|
|
|
4542
4801
|
"aria-live": "polite",
|
|
4543
4802
|
...props,
|
|
4544
4803
|
children: [
|
|
4545
|
-
/* @__PURE__ */ (0,
|
|
4546
|
-
displayed >= truncationThreshold && /* @__PURE__ */ (0,
|
|
4804
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "cnc-text-base cnc-font-bold cnc-text-brand-blue-100", children: `${resourceName} encontrad${encontradVogal}s | ${isLoading ? "carregando ..." : total?.toLocaleString("pt-BR")}` }),
|
|
4805
|
+
displayed >= truncationThreshold && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
4547
4806
|
"Exibindo os ",
|
|
4548
|
-
/* @__PURE__ */ (0,
|
|
4807
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "cnc-font-bold", children: displayed }),
|
|
4549
4808
|
" primeiros registros. Utilize os filtros para refinar sua busca."
|
|
4550
4809
|
] })
|
|
4551
4810
|
]
|
|
@@ -4554,7 +4813,7 @@ function ResultMetadata({
|
|
|
4554
4813
|
}
|
|
4555
4814
|
|
|
4556
4815
|
// src/components/molecules/display/label-value.tsx
|
|
4557
|
-
var
|
|
4816
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4558
4817
|
function LabelValue({
|
|
4559
4818
|
label,
|
|
4560
4819
|
value,
|
|
@@ -4562,9 +4821,9 @@ function LabelValue({
|
|
|
4562
4821
|
className,
|
|
4563
4822
|
valueClassName
|
|
4564
4823
|
}) {
|
|
4565
|
-
return /* @__PURE__ */ (0,
|
|
4566
|
-
/* @__PURE__ */ (0,
|
|
4567
|
-
/* @__PURE__ */ (0,
|
|
4824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className, children: [
|
|
4825
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "cnc-mb-2 cnc-text-sm cnc-font-bold cnc-leading-4 cnc-text-primary", children: label }),
|
|
4826
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4568
4827
|
"div",
|
|
4569
4828
|
{
|
|
4570
4829
|
className: cn(
|
|
@@ -4573,7 +4832,7 @@ function LabelValue({
|
|
|
4573
4832
|
),
|
|
4574
4833
|
children: [
|
|
4575
4834
|
value ?? "-",
|
|
4576
|
-
href && /* @__PURE__ */ (0,
|
|
4835
|
+
href && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4577
4836
|
"a",
|
|
4578
4837
|
{
|
|
4579
4838
|
href,
|
|
@@ -4581,7 +4840,7 @@ function LabelValue({
|
|
|
4581
4840
|
rel: "noopener noreferrer",
|
|
4582
4841
|
className: "cnc-inline-flex cnc-items-center cnc-text-brand-blue-500 hover:cnc-opacity-80",
|
|
4583
4842
|
"aria-label": `Abrir link externo de ${label}`,
|
|
4584
|
-
children: /* @__PURE__ */ (0,
|
|
4843
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ExternalLink, { className: "cnc-size-4" })
|
|
4585
4844
|
}
|
|
4586
4845
|
)
|
|
4587
4846
|
]
|
|
@@ -4591,10 +4850,10 @@ function LabelValue({
|
|
|
4591
4850
|
}
|
|
4592
4851
|
|
|
4593
4852
|
// src/components/molecules/forms/combobox.tsx
|
|
4594
|
-
var
|
|
4853
|
+
var React18 = __toESM(require("react"));
|
|
4595
4854
|
|
|
4596
4855
|
// src/components/molecules/forms/combobox-footer.tsx
|
|
4597
|
-
var
|
|
4856
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4598
4857
|
function ComboboxDropdownFooter({
|
|
4599
4858
|
footerAction,
|
|
4600
4859
|
renderFooter,
|
|
@@ -4603,10 +4862,10 @@ function ComboboxDropdownFooter({
|
|
|
4603
4862
|
}) {
|
|
4604
4863
|
if (hidden) return null;
|
|
4605
4864
|
if (renderFooter) {
|
|
4606
|
-
return /* @__PURE__ */ (0,
|
|
4865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "cnc-border-t cnc-border-brand-gray-50 cnc-p-2", children: renderFooter({ close }) });
|
|
4607
4866
|
}
|
|
4608
4867
|
if (!footerAction) return null;
|
|
4609
|
-
return /* @__PURE__ */ (0,
|
|
4868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "cnc-border-t cnc-border-brand-gray-50 cnc-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4610
4869
|
Button,
|
|
4611
4870
|
{
|
|
4612
4871
|
type: "button",
|
|
@@ -4624,10 +4883,10 @@ function ComboboxDropdownFooter({
|
|
|
4624
4883
|
}
|
|
4625
4884
|
|
|
4626
4885
|
// src/components/molecules/overlay/command.tsx
|
|
4627
|
-
var
|
|
4886
|
+
var React17 = __toESM(require("react"));
|
|
4628
4887
|
var import_cmdk = require("cmdk");
|
|
4629
|
-
var
|
|
4630
|
-
var Command =
|
|
4888
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4889
|
+
var Command = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4631
4890
|
import_cmdk.Command,
|
|
4632
4891
|
{
|
|
4633
4892
|
ref,
|
|
@@ -4640,16 +4899,16 @@ var Command = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4640
4899
|
));
|
|
4641
4900
|
Command.displayName = import_cmdk.Command.displayName;
|
|
4642
4901
|
var CommandDialog = ({ children, ...props }) => {
|
|
4643
|
-
return /* @__PURE__ */ (0,
|
|
4902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Dialog, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DialogContent, { className: "cnc-overflow-hidden cnc-p-0", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Command, { className: "cnc-[&_cmdk-group-heading]:cnc-px-2 cnc-[&_cmdk-group-heading]:cnc-font-medium cnc-[&_cmdk-group-heading]:cnc-text-muted-foreground cnc-[&_cmdk-group]:not([hidden])~[cmdk-group]:cnc-pt-0 cnc-[&_cmdk-group]:cnc-px-2 cnc-[&_cmdk-input-wrapper]_svg:cnc-h-5 cnc-[&_cmdk-input-wrapper]_svg:cnc-w-5 cnc-[&_cmdk-input]:cnc-h-12 cnc-[&_cmdk-item]:cnc-px-2 cnc-[&_cmdk-item]:cnc-py-3 cnc-[&_cmdk-item]_svg:cnc-h-5 cnc-[&_cmdk-item]_svg:cnc-w-5", children }) }) });
|
|
4644
4903
|
};
|
|
4645
|
-
var CommandInput =
|
|
4904
|
+
var CommandInput = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4646
4905
|
"div",
|
|
4647
4906
|
{
|
|
4648
4907
|
className: "cnc-flex cnc-items-center cnc-border-b cnc-px-3",
|
|
4649
4908
|
"cmdk-input-wrapper": "",
|
|
4650
4909
|
children: [
|
|
4651
|
-
/* @__PURE__ */ (0,
|
|
4652
|
-
/* @__PURE__ */ (0,
|
|
4910
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Search, { className: "cnc-mr-2 cnc-h-4 cnc-w-4 cnc-shrink-0 cnc-opacity-50" }),
|
|
4911
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4653
4912
|
import_cmdk.Command.Input,
|
|
4654
4913
|
{
|
|
4655
4914
|
ref,
|
|
@@ -4664,7 +4923,7 @@ var CommandInput = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4664
4923
|
}
|
|
4665
4924
|
));
|
|
4666
4925
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
4667
|
-
var CommandList =
|
|
4926
|
+
var CommandList = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4668
4927
|
import_cmdk.Command.List,
|
|
4669
4928
|
{
|
|
4670
4929
|
ref,
|
|
@@ -4676,7 +4935,7 @@ var CommandList = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4676
4935
|
}
|
|
4677
4936
|
));
|
|
4678
4937
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
4679
|
-
var CommandEmpty =
|
|
4938
|
+
var CommandEmpty = React17.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4680
4939
|
import_cmdk.Command.Empty,
|
|
4681
4940
|
{
|
|
4682
4941
|
ref,
|
|
@@ -4685,7 +4944,7 @@ var CommandEmpty = React14.forwardRef((props, ref) => /* @__PURE__ */ (0, import
|
|
|
4685
4944
|
}
|
|
4686
4945
|
));
|
|
4687
4946
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
4688
|
-
var CommandGroup =
|
|
4947
|
+
var CommandGroup = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4689
4948
|
import_cmdk.Command.Group,
|
|
4690
4949
|
{
|
|
4691
4950
|
ref,
|
|
@@ -4697,7 +4956,7 @@ var CommandGroup = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4697
4956
|
}
|
|
4698
4957
|
));
|
|
4699
4958
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
4700
|
-
var CommandSeparator =
|
|
4959
|
+
var CommandSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4701
4960
|
import_cmdk.Command.Separator,
|
|
4702
4961
|
{
|
|
4703
4962
|
ref,
|
|
@@ -4706,7 +4965,7 @@ var CommandSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
4706
4965
|
}
|
|
4707
4966
|
));
|
|
4708
4967
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
4709
|
-
var CommandItem =
|
|
4968
|
+
var CommandItem = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4710
4969
|
import_cmdk.Command.Item,
|
|
4711
4970
|
{
|
|
4712
4971
|
ref,
|
|
@@ -4722,7 +4981,7 @@ var CommandShortcut = ({
|
|
|
4722
4981
|
className,
|
|
4723
4982
|
...props
|
|
4724
4983
|
}) => {
|
|
4725
|
-
return /* @__PURE__ */ (0,
|
|
4984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4726
4985
|
"span",
|
|
4727
4986
|
{
|
|
4728
4987
|
className: cn(
|
|
@@ -4735,27 +4994,6 @@ var CommandShortcut = ({
|
|
|
4735
4994
|
};
|
|
4736
4995
|
CommandShortcut.displayName = "CommandShortcut";
|
|
4737
4996
|
|
|
4738
|
-
// src/components/molecules/overlay/popover.tsx
|
|
4739
|
-
var React15 = __toESM(require("react"));
|
|
4740
|
-
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
|
|
4741
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4742
|
-
var Popover2 = PopoverPrimitive2.Root;
|
|
4743
|
-
var PopoverTrigger2 = PopoverPrimitive2.Trigger;
|
|
4744
|
-
var PopoverContent2 = React15.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4745
|
-
PopoverPrimitive2.Content,
|
|
4746
|
-
{
|
|
4747
|
-
ref,
|
|
4748
|
-
align,
|
|
4749
|
-
sideOffset,
|
|
4750
|
-
className: cn(
|
|
4751
|
-
"cnc-z-50 cnc-w-72 cnc-rounded-md cnc-border cnc-bg-popover cnc-p-4 cnc-text-popover-foreground cnc-shadow-md cnc-outline-none data-[state=open]:cnc-animate-in data-[state=closed]:cnc-animate-out data-[state=closed]:cnc-fade-out-0 data-[state=open]:cnc-fade-in-0 data-[state=closed]:cnc-zoom-out-95 data-[state=open]:cnc-zoom-in-95 data-[side=bottom]:cnc-slide-in-from-top-2 data-[side=left]:cnc-slide-in-from-right-2 data-[side=right]:cnc-slide-in-from-left-2 data-[side=top]:cnc-slide-in-from-bottom-2 cnc-origin-[--radix-popover-content-transform-origin]",
|
|
4752
|
-
className
|
|
4753
|
-
),
|
|
4754
|
-
...props
|
|
4755
|
-
}
|
|
4756
|
-
) }));
|
|
4757
|
-
PopoverContent2.displayName = PopoverPrimitive2.Content.displayName;
|
|
4758
|
-
|
|
4759
4997
|
// src/components/molecules/forms/combobox.tsx
|
|
4760
4998
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4761
4999
|
function Combobox({
|
|
@@ -4772,9 +5010,9 @@ function Combobox({
|
|
|
4772
5010
|
footerAction,
|
|
4773
5011
|
renderFooter
|
|
4774
5012
|
}) {
|
|
4775
|
-
const [open, setOpen] =
|
|
4776
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4777
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5013
|
+
const [open, setOpen] = React18.useState(false);
|
|
5014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Popover, { open, onOpenChange: setOpen, modal, children: [
|
|
5015
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4778
5016
|
Button,
|
|
4779
5017
|
{
|
|
4780
5018
|
variant: "outline",
|
|
@@ -4792,7 +5030,7 @@ function Combobox({
|
|
|
4792
5030
|
}
|
|
4793
5031
|
) }),
|
|
4794
5032
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4795
|
-
|
|
5033
|
+
PopoverContent,
|
|
4796
5034
|
{
|
|
4797
5035
|
align: "start",
|
|
4798
5036
|
className: cn(
|
|
@@ -4854,7 +5092,7 @@ function Combobox({
|
|
|
4854
5092
|
}
|
|
4855
5093
|
|
|
4856
5094
|
// src/components/molecules/forms/multi-select.tsx
|
|
4857
|
-
var
|
|
5095
|
+
var React19 = __toESM(require("react"));
|
|
4858
5096
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4859
5097
|
function MultiSelect({
|
|
4860
5098
|
options,
|
|
@@ -4871,7 +5109,7 @@ function MultiSelect({
|
|
|
4871
5109
|
footerAction,
|
|
4872
5110
|
renderFooter
|
|
4873
5111
|
}) {
|
|
4874
|
-
const [open, setOpen] =
|
|
5112
|
+
const [open, setOpen] = React19.useState(false);
|
|
4875
5113
|
const buttonText = (() => {
|
|
4876
5114
|
if (value.length === 0) return placeholder;
|
|
4877
5115
|
if (value.length === 1) {
|
|
@@ -4885,8 +5123,8 @@ function MultiSelect({
|
|
|
4885
5123
|
value.includes(optionValue) ? value.filter((item) => item !== optionValue) : [...value, optionValue]
|
|
4886
5124
|
);
|
|
4887
5125
|
};
|
|
4888
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4889
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Popover, { open, onOpenChange: setOpen, modal, children: [
|
|
5127
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4890
5128
|
Button,
|
|
4891
5129
|
{
|
|
4892
5130
|
type: "button",
|
|
@@ -4906,7 +5144,7 @@ function MultiSelect({
|
|
|
4906
5144
|
}
|
|
4907
5145
|
) }),
|
|
4908
5146
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4909
|
-
|
|
5147
|
+
PopoverContent,
|
|
4910
5148
|
{
|
|
4911
5149
|
align: "start",
|
|
4912
5150
|
className: cn(
|
|
@@ -4961,7 +5199,7 @@ function MultiSelect({
|
|
|
4961
5199
|
}
|
|
4962
5200
|
|
|
4963
5201
|
// src/components/molecules/overlay/confirm-dialog.tsx
|
|
4964
|
-
var
|
|
5202
|
+
var React20 = __toESM(require("react"));
|
|
4965
5203
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4966
5204
|
function ConfirmDialog({
|
|
4967
5205
|
open,
|
|
@@ -4980,7 +5218,7 @@ function ConfirmDialog({
|
|
|
4980
5218
|
isLoading,
|
|
4981
5219
|
className
|
|
4982
5220
|
}) {
|
|
4983
|
-
const [localLoading, setLocalLoading] =
|
|
5221
|
+
const [localLoading, setLocalLoading] = React20.useState(false);
|
|
4984
5222
|
const isBusy = isLoading ?? localLoading;
|
|
4985
5223
|
const handleConfirm = async () => {
|
|
4986
5224
|
if (isLoading !== void 0) {
|
|
@@ -5070,7 +5308,7 @@ function Tooltip({
|
|
|
5070
5308
|
}
|
|
5071
5309
|
|
|
5072
5310
|
// src/components/organisms/filter/index.tsx
|
|
5073
|
-
var
|
|
5311
|
+
var React21 = __toESM(require("react"));
|
|
5074
5312
|
var import_react_hook_form = require("react-hook-form");
|
|
5075
5313
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5076
5314
|
var INPUT_BASE_CLASSES = [
|
|
@@ -5100,7 +5338,7 @@ function buildValidationRules(field) {
|
|
|
5100
5338
|
}
|
|
5101
5339
|
};
|
|
5102
5340
|
}
|
|
5103
|
-
var FilterFieldItem =
|
|
5341
|
+
var FilterFieldItem = React21.memo(function FilterFieldItem2({
|
|
5104
5342
|
field,
|
|
5105
5343
|
register,
|
|
5106
5344
|
control,
|
|
@@ -5182,7 +5420,7 @@ var FilterFieldItem = React19.memo(function FilterFieldItem2({
|
|
|
5182
5420
|
});
|
|
5183
5421
|
function CleanButton({ control, onClean }) {
|
|
5184
5422
|
const values = (0, import_react_hook_form.useWatch)({ control });
|
|
5185
|
-
const hasActiveFilters =
|
|
5423
|
+
const hasActiveFilters = React21.useMemo(() => {
|
|
5186
5424
|
const keys = Object.keys(values);
|
|
5187
5425
|
return keys.some((key) => {
|
|
5188
5426
|
const val = values[key];
|
|
@@ -5206,7 +5444,7 @@ function CleanButton({ control, onClean }) {
|
|
|
5206
5444
|
}
|
|
5207
5445
|
);
|
|
5208
5446
|
}
|
|
5209
|
-
var Filter =
|
|
5447
|
+
var Filter = React21.forwardRef(
|
|
5210
5448
|
function Filter2({
|
|
5211
5449
|
fields,
|
|
5212
5450
|
collapsibleFields,
|
|
@@ -5216,12 +5454,12 @@ var Filter = React19.forwardRef(
|
|
|
5216
5454
|
isLoading = false,
|
|
5217
5455
|
className
|
|
5218
5456
|
}, ref) {
|
|
5219
|
-
const [isCollapsibleOpen, setIsCollapsibleOpen] =
|
|
5220
|
-
const allFields =
|
|
5457
|
+
const [isCollapsibleOpen, setIsCollapsibleOpen] = React21.useState(false);
|
|
5458
|
+
const allFields = React21.useMemo(
|
|
5221
5459
|
() => [...fields, ...collapsibleFields || []],
|
|
5222
5460
|
[fields, collapsibleFields]
|
|
5223
5461
|
);
|
|
5224
|
-
const defaultValues =
|
|
5462
|
+
const defaultValues = React21.useMemo(
|
|
5225
5463
|
() => buildDefaultValues(allFields),
|
|
5226
5464
|
[allFields]
|
|
5227
5465
|
);
|
|
@@ -5232,7 +5470,7 @@ var Filter = React19.forwardRef(
|
|
|
5232
5470
|
reset,
|
|
5233
5471
|
formState: { errors }
|
|
5234
5472
|
} = (0, import_react_hook_form.useForm)({ defaultValues });
|
|
5235
|
-
|
|
5473
|
+
React21.useEffect(() => {
|
|
5236
5474
|
if (collapsibleFields?.some((f) => errors[f.name])) {
|
|
5237
5475
|
setIsCollapsibleOpen(true);
|
|
5238
5476
|
}
|
|
@@ -5240,7 +5478,7 @@ var Filter = React19.forwardRef(
|
|
|
5240
5478
|
const onSubmit = (data) => {
|
|
5241
5479
|
onSearch(data);
|
|
5242
5480
|
};
|
|
5243
|
-
const handleClean =
|
|
5481
|
+
const handleClean = React21.useCallback(() => {
|
|
5244
5482
|
const emptyValues = {};
|
|
5245
5483
|
for (const field of allFields) {
|
|
5246
5484
|
emptyValues[field.name] = field.type === "switch" ? false : "";
|
|
@@ -5321,7 +5559,7 @@ var Filter = React19.forwardRef(
|
|
|
5321
5559
|
);
|
|
5322
5560
|
|
|
5323
5561
|
// src/components/organisms/card-list/index.tsx
|
|
5324
|
-
var
|
|
5562
|
+
var React22 = __toESM(require("react"));
|
|
5325
5563
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5326
5564
|
function CardList({
|
|
5327
5565
|
items,
|
|
@@ -5381,20 +5619,20 @@ function CardList({
|
|
|
5381
5619
|
{
|
|
5382
5620
|
className: cn("cnc-grid cnc-w-full", gap, className),
|
|
5383
5621
|
style: gridStyle,
|
|
5384
|
-
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5622
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(React22.Fragment, { children: renderCard(item, index) }, getKey ? getKey(item, index) : index))
|
|
5385
5623
|
}
|
|
5386
5624
|
);
|
|
5387
5625
|
}
|
|
5388
5626
|
|
|
5389
5627
|
// src/components/organisms/drawer/drawer.tsx
|
|
5390
5628
|
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
|
|
5391
|
-
var
|
|
5629
|
+
var React23 = __toESM(require("react"));
|
|
5392
5630
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5393
5631
|
var Drawer = DialogPrimitive2.Root;
|
|
5394
5632
|
var DrawerTrigger = DialogPrimitive2.Trigger;
|
|
5395
5633
|
var DrawerPortal = DialogPrimitive2.Portal;
|
|
5396
5634
|
var DrawerClose = DialogPrimitive2.Close;
|
|
5397
|
-
var DrawerOverlay =
|
|
5635
|
+
var DrawerOverlay = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5398
5636
|
DialogPrimitive2.Overlay,
|
|
5399
5637
|
{
|
|
5400
5638
|
ref,
|
|
@@ -5413,7 +5651,7 @@ var drawerSizeToWidth = {
|
|
|
5413
5651
|
xl: "48rem",
|
|
5414
5652
|
full: "100vw"
|
|
5415
5653
|
};
|
|
5416
|
-
var DrawerContent =
|
|
5654
|
+
var DrawerContent = React23.forwardRef(
|
|
5417
5655
|
({
|
|
5418
5656
|
className,
|
|
5419
5657
|
children,
|
|
@@ -5477,7 +5715,7 @@ var DrawerFooter = ({
|
|
|
5477
5715
|
...props
|
|
5478
5716
|
}) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("cnc-border-t cnc-p-6", className), ...props });
|
|
5479
5717
|
DrawerFooter.displayName = "DrawerFooter";
|
|
5480
|
-
var DrawerTitle =
|
|
5718
|
+
var DrawerTitle = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5481
5719
|
DialogPrimitive2.Title,
|
|
5482
5720
|
{
|
|
5483
5721
|
ref,
|
|
@@ -5489,7 +5727,7 @@ var DrawerTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5489
5727
|
}
|
|
5490
5728
|
));
|
|
5491
5729
|
DrawerTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
5492
|
-
var DrawerDescription =
|
|
5730
|
+
var DrawerDescription = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5493
5731
|
DialogPrimitive2.Description,
|
|
5494
5732
|
{
|
|
5495
5733
|
ref,
|
|
@@ -5500,24 +5738,24 @@ var DrawerDescription = React21.forwardRef(({ className, ...props }, ref) => /*
|
|
|
5500
5738
|
DrawerDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
5501
5739
|
|
|
5502
5740
|
// src/components/organisms/drawer/drawer-context.tsx
|
|
5503
|
-
var
|
|
5741
|
+
var React24 = __toESM(require("react"));
|
|
5504
5742
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5505
|
-
var DrawerContext =
|
|
5743
|
+
var DrawerContext = React24.createContext(
|
|
5506
5744
|
void 0
|
|
5507
5745
|
);
|
|
5508
5746
|
function DrawerProvider({ children }) {
|
|
5509
|
-
const [activeDrawer, setActiveDrawer] =
|
|
5510
|
-
const openDrawer =
|
|
5747
|
+
const [activeDrawer, setActiveDrawer] = React24.useState(null);
|
|
5748
|
+
const openDrawer = React24.useCallback((drawerId) => {
|
|
5511
5749
|
setActiveDrawer(drawerId);
|
|
5512
5750
|
}, []);
|
|
5513
|
-
const closeDrawer =
|
|
5751
|
+
const closeDrawer = React24.useCallback(() => {
|
|
5514
5752
|
setActiveDrawer(null);
|
|
5515
5753
|
}, []);
|
|
5516
|
-
const isOpen =
|
|
5754
|
+
const isOpen = React24.useCallback(
|
|
5517
5755
|
(drawerId) => activeDrawer === drawerId,
|
|
5518
5756
|
[activeDrawer]
|
|
5519
5757
|
);
|
|
5520
|
-
const value =
|
|
5758
|
+
const value = React24.useMemo(
|
|
5521
5759
|
() => ({ activeDrawer, openDrawer, closeDrawer, isOpen }),
|
|
5522
5760
|
[activeDrawer, openDrawer, closeDrawer, isOpen]
|
|
5523
5761
|
);
|
|
@@ -5525,9 +5763,9 @@ function DrawerProvider({ children }) {
|
|
|
5525
5763
|
}
|
|
5526
5764
|
|
|
5527
5765
|
// src/components/organisms/drawer/use-drawer.ts
|
|
5528
|
-
var
|
|
5766
|
+
var React25 = __toESM(require("react"));
|
|
5529
5767
|
function useDrawer() {
|
|
5530
|
-
const context =
|
|
5768
|
+
const context = React25.useContext(DrawerContext);
|
|
5531
5769
|
if (!context) {
|
|
5532
5770
|
throw new Error("useDrawer deve ser usado dentro de um DrawerProvider");
|
|
5533
5771
|
}
|
|
@@ -5535,7 +5773,7 @@ function useDrawer() {
|
|
|
5535
5773
|
}
|
|
5536
5774
|
|
|
5537
5775
|
// src/components/organisms/upload/file-upload.tsx
|
|
5538
|
-
var
|
|
5776
|
+
var React26 = __toESM(require("react"));
|
|
5539
5777
|
|
|
5540
5778
|
// src/components/organisms/upload/utils.ts
|
|
5541
5779
|
function formatSizeLimit(bytes) {
|
|
@@ -5710,7 +5948,7 @@ function fileToListItem(file, index) {
|
|
|
5710
5948
|
status: "pending"
|
|
5711
5949
|
};
|
|
5712
5950
|
}
|
|
5713
|
-
var FileUpload =
|
|
5951
|
+
var FileUpload = React26.forwardRef(
|
|
5714
5952
|
({
|
|
5715
5953
|
value = [],
|
|
5716
5954
|
onChange,
|
|
@@ -5731,9 +5969,9 @@ var FileUpload = React24.forwardRef(
|
|
|
5731
5969
|
listClassName,
|
|
5732
5970
|
...props
|
|
5733
5971
|
}, ref) => {
|
|
5734
|
-
const fileInputRef =
|
|
5735
|
-
const hintId =
|
|
5736
|
-
|
|
5972
|
+
const fileInputRef = React26.useRef(null);
|
|
5973
|
+
const hintId = React26.useId();
|
|
5974
|
+
React26.useImperativeHandle(ref, () => fileInputRef.current, []);
|
|
5737
5975
|
const isBusy = disabled || isLoading;
|
|
5738
5976
|
const items = value.map(fileToListItem);
|
|
5739
5977
|
const clearInput = () => {
|
|
@@ -5892,7 +6130,7 @@ function formatDayAriaLabel(date) {
|
|
|
5892
6130
|
}
|
|
5893
6131
|
|
|
5894
6132
|
// src/components/organisms/calendar/mini-month-calendar.tsx
|
|
5895
|
-
var
|
|
6133
|
+
var React27 = __toESM(require("react"));
|
|
5896
6134
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5897
6135
|
function MiniMonthCalendar({
|
|
5898
6136
|
month: monthProp,
|
|
@@ -5907,8 +6145,8 @@ function MiniMonthCalendar({
|
|
|
5907
6145
|
nextLabel = "Pr\xF3ximo m\xEAs",
|
|
5908
6146
|
className
|
|
5909
6147
|
}) {
|
|
5910
|
-
const month =
|
|
5911
|
-
const cells =
|
|
6148
|
+
const month = React27.useMemo(() => toLocalNoon(monthProp ?? /* @__PURE__ */ new Date()), [monthProp]);
|
|
6149
|
+
const cells = React27.useMemo(
|
|
5912
6150
|
() => buildMonthDays(month, selectedDate, hasItems),
|
|
5913
6151
|
[month, selectedDate, hasItems]
|
|
5914
6152
|
);
|
|
@@ -5979,7 +6217,7 @@ function MiniMonthCalendar({
|
|
|
5979
6217
|
}
|
|
5980
6218
|
|
|
5981
6219
|
// src/components/organisms/calendar/month-year-picker.tsx
|
|
5982
|
-
var
|
|
6220
|
+
var React28 = __toESM(require("react"));
|
|
5983
6221
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5984
6222
|
function MonthYearPicker({
|
|
5985
6223
|
value,
|
|
@@ -5992,9 +6230,9 @@ function MonthYearPicker({
|
|
|
5992
6230
|
triggerClassName,
|
|
5993
6231
|
contentClassName
|
|
5994
6232
|
}) {
|
|
5995
|
-
const [open, setOpen] =
|
|
5996
|
-
const [viewYear, setViewYear] =
|
|
5997
|
-
|
|
6233
|
+
const [open, setOpen] = React28.useState(false);
|
|
6234
|
+
const [viewYear, setViewYear] = React28.useState(() => value.getFullYear());
|
|
6235
|
+
React28.useEffect(() => {
|
|
5998
6236
|
if (open) setViewYear(value.getFullYear());
|
|
5999
6237
|
}, [open, value]);
|
|
6000
6238
|
const isSelectedMonth = (monthIndex) => value.getFullYear() === viewYear && value.getMonth() === monthIndex;
|
|
@@ -6004,8 +6242,8 @@ function MonthYearPicker({
|
|
|
6004
6242
|
onChange(new Date(viewYear, monthIndex, day));
|
|
6005
6243
|
setOpen(false);
|
|
6006
6244
|
};
|
|
6007
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6008
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
6246
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6009
6247
|
Button,
|
|
6010
6248
|
{
|
|
6011
6249
|
type: "button",
|
|
@@ -6031,7 +6269,7 @@ function MonthYearPicker({
|
|
|
6031
6269
|
}
|
|
6032
6270
|
) }),
|
|
6033
6271
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6034
|
-
|
|
6272
|
+
PopoverContent,
|
|
6035
6273
|
{
|
|
6036
6274
|
align: "start",
|
|
6037
6275
|
className: cn("cnc-w-72 cnc-p-4", className, contentClassName),
|
|
@@ -6080,7 +6318,7 @@ function MonthYearPicker({
|
|
|
6080
6318
|
}
|
|
6081
6319
|
|
|
6082
6320
|
// src/components/organisms/period-range-list/index.tsx
|
|
6083
|
-
var
|
|
6321
|
+
var React29 = __toESM(require("react"));
|
|
6084
6322
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6085
6323
|
var DEFAULT_LABELS = {
|
|
6086
6324
|
start: "In\xEDcio",
|
|
@@ -6141,9 +6379,9 @@ function PeriodRangeList({
|
|
|
6141
6379
|
const labels = { ...DEFAULT_LABELS, ...labelsProp };
|
|
6142
6380
|
const endAfterStart = validate?.endAfterStart ?? true;
|
|
6143
6381
|
const noDuplicates = validate?.noDuplicates ?? true;
|
|
6144
|
-
const [startDraft, setStartDraft] =
|
|
6145
|
-
const [endDraft, setEndDraft] =
|
|
6146
|
-
const periods =
|
|
6382
|
+
const [startDraft, setStartDraft] = React29.useState("");
|
|
6383
|
+
const [endDraft, setEndDraft] = React29.useState("");
|
|
6384
|
+
const periods = React29.useMemo(() => normalizePeriods(value), [value]);
|
|
6147
6385
|
const isInvalidRange = Boolean(startDraft && endDraft) && endAfterStart && startDraft >= endDraft;
|
|
6148
6386
|
const isDuplicate = Boolean(startDraft && endDraft) && noDuplicates && periods.some(
|
|
6149
6387
|
(period) => period.start === startDraft && period.end === endDraft
|
|
@@ -6260,7 +6498,7 @@ function PeriodRangeList({
|
|
|
6260
6498
|
var DateTimeRangeList = PeriodRangeList;
|
|
6261
6499
|
|
|
6262
6500
|
// src/components/organisms/header-notifications/index.tsx
|
|
6263
|
-
var
|
|
6501
|
+
var React31 = __toESM(require("react"));
|
|
6264
6502
|
|
|
6265
6503
|
// src/components/organisms/header-notifications/cliente.ts
|
|
6266
6504
|
var URL_PADRAO_NOTIFICACOES = "https://dev-apinotificacoes-b5feekb4bdfyb7c2.eastus2-01.azurewebsites.net/v1";
|
|
@@ -6514,7 +6752,7 @@ function ModalLembretes({
|
|
|
6514
6752
|
}
|
|
6515
6753
|
|
|
6516
6754
|
// src/components/organisms/header-notifications/usar-notificacoes.ts
|
|
6517
|
-
var
|
|
6755
|
+
var React30 = __toESM(require("react"));
|
|
6518
6756
|
function foiAbortado(erro) {
|
|
6519
6757
|
return erro?.name === "AbortError";
|
|
6520
6758
|
}
|
|
@@ -6527,20 +6765,20 @@ function usarNotificacoes({
|
|
|
6527
6765
|
habilitado = true,
|
|
6528
6766
|
onErro
|
|
6529
6767
|
}) {
|
|
6530
|
-
const [notificacoes, setNotificacoes] =
|
|
6531
|
-
const [carregando, setCarregando] =
|
|
6532
|
-
const notificacoesRef =
|
|
6533
|
-
const controladorRef =
|
|
6534
|
-
const jaCarregouRef =
|
|
6535
|
-
const onErroRef =
|
|
6536
|
-
|
|
6768
|
+
const [notificacoes, setNotificacoes] = React30.useState([]);
|
|
6769
|
+
const [carregando, setCarregando] = React30.useState(habilitado);
|
|
6770
|
+
const notificacoesRef = React30.useRef(notificacoes);
|
|
6771
|
+
const controladorRef = React30.useRef(null);
|
|
6772
|
+
const jaCarregouRef = React30.useRef(false);
|
|
6773
|
+
const onErroRef = React30.useRef(onErro);
|
|
6774
|
+
React30.useEffect(() => {
|
|
6537
6775
|
notificacoesRef.current = notificacoes;
|
|
6538
6776
|
}, [notificacoes]);
|
|
6539
|
-
|
|
6777
|
+
React30.useEffect(() => {
|
|
6540
6778
|
onErroRef.current = onErro;
|
|
6541
6779
|
}, [onErro]);
|
|
6542
6780
|
const chaveFiltros = JSON.stringify(filtros ?? {});
|
|
6543
|
-
const atualizar =
|
|
6781
|
+
const atualizar = React30.useCallback(() => {
|
|
6544
6782
|
if (!habilitado) return;
|
|
6545
6783
|
controladorRef.current?.abort();
|
|
6546
6784
|
const controlador = new AbortController();
|
|
@@ -6567,7 +6805,7 @@ function usarNotificacoes({
|
|
|
6567
6805
|
}
|
|
6568
6806
|
})();
|
|
6569
6807
|
}, [baseUrl, email, sistema, chaveFiltros, habilitado]);
|
|
6570
|
-
|
|
6808
|
+
React30.useEffect(() => {
|
|
6571
6809
|
if (!habilitado) {
|
|
6572
6810
|
setCarregando(false);
|
|
6573
6811
|
return;
|
|
@@ -6576,7 +6814,7 @@ function usarNotificacoes({
|
|
|
6576
6814
|
atualizar();
|
|
6577
6815
|
return () => controladorRef.current?.abort();
|
|
6578
6816
|
}, [atualizar, habilitado]);
|
|
6579
|
-
|
|
6817
|
+
React30.useEffect(() => {
|
|
6580
6818
|
if (!habilitado || !intervaloAtualizacao) return;
|
|
6581
6819
|
const temporizador = window.setInterval(() => {
|
|
6582
6820
|
if (typeof document !== "undefined" && document.hidden) return;
|
|
@@ -6584,7 +6822,7 @@ function usarNotificacoes({
|
|
|
6584
6822
|
}, intervaloAtualizacao);
|
|
6585
6823
|
return () => window.clearInterval(temporizador);
|
|
6586
6824
|
}, [atualizar, habilitado, intervaloAtualizacao]);
|
|
6587
|
-
const aplicarLeitura =
|
|
6825
|
+
const aplicarLeitura = React30.useCallback((ids) => {
|
|
6588
6826
|
const alvos = new Set(ids.map(String));
|
|
6589
6827
|
setNotificacoes(
|
|
6590
6828
|
(atuais) => atuais.map(
|
|
@@ -6592,7 +6830,7 @@ function usarNotificacoes({
|
|
|
6592
6830
|
)
|
|
6593
6831
|
);
|
|
6594
6832
|
}, []);
|
|
6595
|
-
const reverterLeitura =
|
|
6833
|
+
const reverterLeitura = React30.useCallback((anteriores) => {
|
|
6596
6834
|
const original = new Map(
|
|
6597
6835
|
anteriores.map((notificacao) => [String(notificacao.id), notificacao])
|
|
6598
6836
|
);
|
|
@@ -6607,7 +6845,7 @@ function usarNotificacoes({
|
|
|
6607
6845
|
})
|
|
6608
6846
|
);
|
|
6609
6847
|
}, []);
|
|
6610
|
-
const marcarUmaComoLida =
|
|
6848
|
+
const marcarUmaComoLida = React30.useCallback(
|
|
6611
6849
|
(id) => {
|
|
6612
6850
|
const alvo = notificacoesRef.current.find(
|
|
6613
6851
|
(notificacao) => String(notificacao.id) === String(id)
|
|
@@ -6621,7 +6859,7 @@ function usarNotificacoes({
|
|
|
6621
6859
|
},
|
|
6622
6860
|
[baseUrl, aplicarLeitura, reverterLeitura]
|
|
6623
6861
|
);
|
|
6624
|
-
const marcarComoLidas =
|
|
6862
|
+
const marcarComoLidas = React30.useCallback(
|
|
6625
6863
|
(ids) => {
|
|
6626
6864
|
const alvos = new Set(ids.map(String));
|
|
6627
6865
|
const naoLidas = notificacoesRef.current.filter(
|
|
@@ -6639,10 +6877,10 @@ function usarNotificacoes({
|
|
|
6639
6877
|
},
|
|
6640
6878
|
[baseUrl, aplicarLeitura, reverterLeitura]
|
|
6641
6879
|
);
|
|
6642
|
-
const marcarTodasComoLidas =
|
|
6880
|
+
const marcarTodasComoLidas = React30.useCallback(() => {
|
|
6643
6881
|
marcarComoLidas(notificacoesRef.current.map((notificacao) => notificacao.id));
|
|
6644
6882
|
}, [marcarComoLidas]);
|
|
6645
|
-
const marcarUmaComoNaoLida =
|
|
6883
|
+
const marcarUmaComoNaoLida = React30.useCallback(
|
|
6646
6884
|
(id) => {
|
|
6647
6885
|
const alvo = notificacoesRef.current.find(
|
|
6648
6886
|
(notificacao) => String(notificacao.id) === String(id)
|
|
@@ -6660,7 +6898,7 @@ function usarNotificacoes({
|
|
|
6660
6898
|
},
|
|
6661
6899
|
[baseUrl, reverterLeitura]
|
|
6662
6900
|
);
|
|
6663
|
-
const excluir =
|
|
6901
|
+
const excluir = React30.useCallback(
|
|
6664
6902
|
(id) => {
|
|
6665
6903
|
const alvo = notificacoesRef.current.find(
|
|
6666
6904
|
(notificacao) => String(notificacao.id) === String(id)
|
|
@@ -6721,11 +6959,11 @@ function HeaderNotifications(props) {
|
|
|
6721
6959
|
tituloLembretes,
|
|
6722
6960
|
rotuloDispensarLembretes
|
|
6723
6961
|
} = props;
|
|
6724
|
-
const [aberto, setAberto] =
|
|
6725
|
-
const [lembretesEmAlerta, setLembretesEmAlerta] =
|
|
6962
|
+
const [aberto, setAberto] = React31.useState(false);
|
|
6963
|
+
const [lembretesEmAlerta, setLembretesEmAlerta] = React31.useState(
|
|
6726
6964
|
[]
|
|
6727
6965
|
);
|
|
6728
|
-
const avaliouLembretesRef =
|
|
6966
|
+
const avaliouLembretesRef = React31.useRef(false);
|
|
6729
6967
|
const conectado = Boolean(email && sistema);
|
|
6730
6968
|
const remoto = usarNotificacoes({
|
|
6731
6969
|
email: email ?? "",
|
|
@@ -6736,17 +6974,17 @@ function HeaderNotifications(props) {
|
|
|
6736
6974
|
habilitado: conectado,
|
|
6737
6975
|
onErro
|
|
6738
6976
|
});
|
|
6739
|
-
const elegiveis =
|
|
6977
|
+
const elegiveis = React31.useMemo(
|
|
6740
6978
|
() => conectado ? selecionarVisiveis(remoto.notificacoes) : [],
|
|
6741
6979
|
[conectado, remoto.notificacoes]
|
|
6742
6980
|
);
|
|
6743
|
-
const itensRemotos =
|
|
6981
|
+
const itensRemotos = React31.useMemo(
|
|
6744
6982
|
() => elegiveis.slice(0, limite).map((notificacao) => mapearParaItem(notificacao, getHref)),
|
|
6745
6983
|
[elegiveis, limite, getHref]
|
|
6746
6984
|
);
|
|
6747
6985
|
const itens = conectado ? itensRemotos : items;
|
|
6748
6986
|
const carregandoLista = conectado ? remoto.carregando : isLoading;
|
|
6749
|
-
|
|
6987
|
+
React31.useEffect(() => {
|
|
6750
6988
|
if (!conectado || !alertarLembretes) return;
|
|
6751
6989
|
if (remoto.carregando || avaliouLembretesRef.current) return;
|
|
6752
6990
|
avaliouLembretesRef.current = true;
|
|
@@ -6912,8 +7150,8 @@ function HeaderNotifications(props) {
|
|
|
6912
7150
|
rotuloDispensar: rotuloDispensarLembretes
|
|
6913
7151
|
}
|
|
6914
7152
|
),
|
|
6915
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6916
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7153
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover2, { open: aberto, onOpenChange: alterarAbertura, children: [
|
|
7154
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6917
7155
|
"button",
|
|
6918
7156
|
{
|
|
6919
7157
|
type: "button",
|
|
@@ -6943,7 +7181,7 @@ function HeaderNotifications(props) {
|
|
|
6943
7181
|
}
|
|
6944
7182
|
) }),
|
|
6945
7183
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6946
|
-
|
|
7184
|
+
PopoverContent2,
|
|
6947
7185
|
{
|
|
6948
7186
|
align,
|
|
6949
7187
|
sideOffset: 20,
|
|
@@ -6979,10 +7217,10 @@ function HeaderNotifications(props) {
|
|
|
6979
7217
|
}
|
|
6980
7218
|
|
|
6981
7219
|
// src/alertas/alertas.tsx
|
|
6982
|
-
var
|
|
7220
|
+
var React34 = __toESM(require("react"));
|
|
6983
7221
|
|
|
6984
7222
|
// src/alertas/formulario-alerta.tsx
|
|
6985
|
-
var
|
|
7223
|
+
var React32 = __toESM(require("react"));
|
|
6986
7224
|
|
|
6987
7225
|
// src/alertas/date-utils.ts
|
|
6988
7226
|
function obterHojeDataHoraIsoLocal() {
|
|
@@ -7116,15 +7354,15 @@ function FormularioAlerta({
|
|
|
7116
7354
|
onSalvar,
|
|
7117
7355
|
onCancelar
|
|
7118
7356
|
}) {
|
|
7119
|
-
const [values, setValues] =
|
|
7357
|
+
const [values, setValues] = React32.useState(
|
|
7120
7358
|
() => alertaEmEdicao ? preencherFormDoAlerta(alertaEmEdicao) : FORM_VAZIO
|
|
7121
7359
|
);
|
|
7122
|
-
const [erro, setErro] =
|
|
7123
|
-
const [hojeDataHoraIso, setHojeDataHoraIso] =
|
|
7124
|
-
|
|
7360
|
+
const [erro, setErro] = React32.useState("");
|
|
7361
|
+
const [hojeDataHoraIso, setHojeDataHoraIso] = React32.useState("");
|
|
7362
|
+
React32.useEffect(() => {
|
|
7125
7363
|
setHojeDataHoraIso(obterHojeDataHoraIsoLocal());
|
|
7126
7364
|
}, []);
|
|
7127
|
-
|
|
7365
|
+
React32.useEffect(() => {
|
|
7128
7366
|
setValues(alertaEmEdicao ? preencherFormDoAlerta(alertaEmEdicao) : FORM_VAZIO);
|
|
7129
7367
|
setErro("");
|
|
7130
7368
|
}, [alertaEmEdicao]);
|
|
@@ -7481,7 +7719,7 @@ function AlertaItem({
|
|
|
7481
7719
|
}
|
|
7482
7720
|
|
|
7483
7721
|
// src/alertas/usar-alertas.ts
|
|
7484
|
-
var
|
|
7722
|
+
var React33 = __toESM(require("react"));
|
|
7485
7723
|
|
|
7486
7724
|
// src/alertas/cliente.ts
|
|
7487
7725
|
var ErroAlertas = class _ErroAlertas extends Error {
|
|
@@ -7533,25 +7771,25 @@ function usarAlertas({
|
|
|
7533
7771
|
habilitado = true,
|
|
7534
7772
|
onErro
|
|
7535
7773
|
}) {
|
|
7536
|
-
const [alertas, setAlertas] =
|
|
7537
|
-
const [carregando, setCarregando] =
|
|
7538
|
-
const controladorRef =
|
|
7539
|
-
const jaCarregouRef =
|
|
7540
|
-
const onErroRef =
|
|
7541
|
-
const fetchFnRef =
|
|
7542
|
-
const filtrosRef =
|
|
7543
|
-
|
|
7774
|
+
const [alertas, setAlertas] = React33.useState([]);
|
|
7775
|
+
const [carregando, setCarregando] = React33.useState(habilitado);
|
|
7776
|
+
const controladorRef = React33.useRef(null);
|
|
7777
|
+
const jaCarregouRef = React33.useRef(false);
|
|
7778
|
+
const onErroRef = React33.useRef(onErro);
|
|
7779
|
+
const fetchFnRef = React33.useRef(fetchFn);
|
|
7780
|
+
const filtrosRef = React33.useRef(filtros);
|
|
7781
|
+
React33.useEffect(() => {
|
|
7544
7782
|
onErroRef.current = onErro;
|
|
7545
7783
|
}, [onErro]);
|
|
7546
|
-
|
|
7784
|
+
React33.useEffect(() => {
|
|
7547
7785
|
fetchFnRef.current = fetchFn;
|
|
7548
7786
|
}, [fetchFn]);
|
|
7549
|
-
|
|
7787
|
+
React33.useEffect(() => {
|
|
7550
7788
|
filtrosRef.current = filtros;
|
|
7551
7789
|
}, [filtros]);
|
|
7552
7790
|
const pronto = baseUrl !== void 0 && sistema !== void 0 && email !== void 0;
|
|
7553
7791
|
const filtrosChave = filtros ? JSON.stringify(filtros) : "";
|
|
7554
|
-
const atualizar =
|
|
7792
|
+
const atualizar = React33.useCallback(() => {
|
|
7555
7793
|
if (!habilitado || !pronto) return;
|
|
7556
7794
|
controladorRef.current?.abort();
|
|
7557
7795
|
const controlador = new AbortController();
|
|
@@ -7580,7 +7818,7 @@ function usarAlertas({
|
|
|
7580
7818
|
}
|
|
7581
7819
|
})();
|
|
7582
7820
|
}, [baseUrl, sistema, email, eventoId, filtrosChave, habilitado, pronto]);
|
|
7583
|
-
|
|
7821
|
+
React33.useEffect(() => {
|
|
7584
7822
|
if (!habilitado || !pronto) {
|
|
7585
7823
|
setCarregando(false);
|
|
7586
7824
|
return;
|
|
@@ -7616,10 +7854,10 @@ function Alertas({
|
|
|
7616
7854
|
filtros,
|
|
7617
7855
|
onErro
|
|
7618
7856
|
}) {
|
|
7619
|
-
const [formAberto, setFormAberto] =
|
|
7620
|
-
const [alertaEmEdicao, setAlertaEmEdicao] =
|
|
7621
|
-
const [salvandoLocal, setSalvandoLocal] =
|
|
7622
|
-
const [removendoLocal, setRemovendoLocal] =
|
|
7857
|
+
const [formAberto, setFormAberto] = React34.useState(false);
|
|
7858
|
+
const [alertaEmEdicao, setAlertaEmEdicao] = React34.useState(null);
|
|
7859
|
+
const [salvandoLocal, setSalvandoLocal] = React34.useState(false);
|
|
7860
|
+
const [removendoLocal, setRemovendoLocal] = React34.useState(false);
|
|
7623
7861
|
const conectado = Boolean(sistema && email);
|
|
7624
7862
|
const remoto = usarAlertas({
|
|
7625
7863
|
baseUrl,
|
|
@@ -7838,6 +8076,7 @@ function Alertas({
|
|
|
7838
8076
|
PopoverContent,
|
|
7839
8077
|
PopoverTrigger,
|
|
7840
8078
|
ResultMetadata,
|
|
8079
|
+
SIDEBAR_MOBILE_BREAKPOINT,
|
|
7841
8080
|
Select,
|
|
7842
8081
|
SelectContent,
|
|
7843
8082
|
SelectGroup,
|
|
@@ -7878,6 +8117,8 @@ function Alertas({
|
|
|
7878
8117
|
toLocalNoon,
|
|
7879
8118
|
usarAlertas,
|
|
7880
8119
|
useDrawer,
|
|
8120
|
+
useSidebar,
|
|
8121
|
+
useSidebarBreakpoint,
|
|
7881
8122
|
validateFiles
|
|
7882
8123
|
});
|
|
7883
8124
|
/*! Bundled license information:
|