@cnc-ti/layout-basic 8.8.1 → 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 +182 -29
- package/dist/index.d.ts +182 -29
- package/dist/index.js +584 -339
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +572 -330
- 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);
|
|
@@ -3349,7 +3352,8 @@ var availableApps = {
|
|
|
3349
3352
|
CDD: { name: "Or\xE1culoS", url: process.env.NEXT_PUBLIC_CDD_APP_URL ?? "https://oraculos.cnc.org.br/", icon: "fa-solid fa-database", color: "#00B8D9" }
|
|
3350
3353
|
};
|
|
3351
3354
|
function AppsMenu({
|
|
3352
|
-
apps = Object.keys(availableApps).map((key) => ({ code: key, url: availableApps[key].url }))
|
|
3355
|
+
apps = Object.keys(availableApps).map((key) => ({ code: key, url: availableApps[key].url })),
|
|
3356
|
+
show = false
|
|
3353
3357
|
}) {
|
|
3354
3358
|
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
3355
3359
|
const menuRef = (0, import_react4.useRef)(null);
|
|
@@ -3371,6 +3375,9 @@ function AppsMenu({
|
|
|
3371
3375
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
3372
3376
|
};
|
|
3373
3377
|
}, [isOpen]);
|
|
3378
|
+
if (!show) {
|
|
3379
|
+
return null;
|
|
3380
|
+
}
|
|
3374
3381
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cnc-relative cnc-flex cnc-items-center cnc-h-full", ref: menuRef, children: [
|
|
3375
3382
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3376
3383
|
"button",
|
|
@@ -3558,7 +3565,7 @@ var ModalMudancaEntidade = ({
|
|
|
3558
3565
|
// src/components/Sidebar/index.tsx
|
|
3559
3566
|
var Accordion = __toESM(require("@radix-ui/react-accordion"));
|
|
3560
3567
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
3561
|
-
var import_react5 = require("react");
|
|
3568
|
+
var import_react5 = __toESM(require("react"));
|
|
3562
3569
|
|
|
3563
3570
|
// src/components/assets/logotipo-default.tsx
|
|
3564
3571
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
@@ -3726,90 +3733,341 @@ function LogotipoDefault() {
|
|
|
3726
3733
|
);
|
|
3727
3734
|
}
|
|
3728
3735
|
|
|
3729
|
-
// src/components/
|
|
3736
|
+
// src/components/molecules/overlay/popover.tsx
|
|
3737
|
+
var React5 = __toESM(require("react"));
|
|
3738
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
3730
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
|
+
}
|
|
3731
3812
|
function SidebarContainer({
|
|
3732
|
-
isOpen
|
|
3813
|
+
isOpen,
|
|
3814
|
+
variant,
|
|
3815
|
+
onVariantChange,
|
|
3816
|
+
mobileBreakpoint = SIDEBAR_MOBILE_BREAKPOINT,
|
|
3817
|
+
className,
|
|
3818
|
+
style,
|
|
3819
|
+
children,
|
|
3733
3820
|
...rest
|
|
3734
3821
|
}) {
|
|
3735
|
-
|
|
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)(
|
|
3736
3837
|
"div",
|
|
3737
3838
|
{
|
|
3738
|
-
"data-is-open":
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
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
|
|
3742
3850
|
}
|
|
3743
|
-
);
|
|
3851
|
+
) });
|
|
3744
3852
|
}
|
|
3745
3853
|
function SidebarImageBrand({
|
|
3746
3854
|
asChild = false,
|
|
3747
3855
|
onChangeToggle,
|
|
3856
|
+
onToggleRequest,
|
|
3857
|
+
showToggle = true,
|
|
3748
3858
|
img,
|
|
3749
3859
|
children
|
|
3750
3860
|
}) {
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
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",
|
|
3767
3884
|
{
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
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",
|
|
3778
3902
|
{
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
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
|
+
)
|
|
3784
3921
|
}
|
|
3785
3922
|
)
|
|
3786
3923
|
}
|
|
3787
3924
|
)
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3925
|
+
]
|
|
3926
|
+
}
|
|
3927
|
+
);
|
|
3791
3928
|
}
|
|
3792
|
-
function Sidebar({ children, ...rest }) {
|
|
3793
|
-
|
|
3794
|
-
|
|
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",
|
|
3795
3934
|
{
|
|
3796
|
-
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
|
+
),
|
|
3797
3948
|
children
|
|
3798
3949
|
}
|
|
3799
3950
|
) });
|
|
3800
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
|
+
}
|
|
3801
3989
|
function SidebarNavLink({
|
|
3802
3990
|
asChild = false,
|
|
3803
3991
|
type = "primary",
|
|
3992
|
+
icon,
|
|
3993
|
+
label,
|
|
3994
|
+
ativo = false,
|
|
3995
|
+
disabled = false,
|
|
3996
|
+
keepOpenOnClick = false,
|
|
3997
|
+
className,
|
|
3998
|
+
children,
|
|
3999
|
+
onClick,
|
|
3804
4000
|
...rest
|
|
3805
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]);
|
|
3806
4008
|
const Component = asChild ? import_react_slot2.Slot : "a";
|
|
3807
|
-
|
|
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)(
|
|
3808
4024
|
Component,
|
|
3809
4025
|
{
|
|
3810
4026
|
"data-type": type,
|
|
3811
|
-
|
|
3812
|
-
|
|
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" })
|
|
3813
4071
|
}
|
|
3814
4072
|
);
|
|
3815
4073
|
}
|
|
@@ -3817,57 +4075,62 @@ function SidebarNavCollapse({
|
|
|
3817
4075
|
children,
|
|
3818
4076
|
title,
|
|
3819
4077
|
icon,
|
|
4078
|
+
className,
|
|
3820
4079
|
...rest
|
|
3821
4080
|
}) {
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
] }),
|
|
3828
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "cnc-w-4 cnc-h-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3829
|
-
"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",
|
|
3830
4086
|
{
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
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)
|
|
3842
4097
|
}
|
|
3843
|
-
) })
|
|
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" }) })
|
|
3844
4121
|
] }),
|
|
3845
|
-
/* @__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 }) })
|
|
3846
4123
|
] });
|
|
3847
4124
|
}
|
|
3848
|
-
function renderIconItem(icon) {
|
|
3849
|
-
if (!icon) return null;
|
|
3850
|
-
if ((0, import_react5.isValidElement)(icon) && icon.type === "svg") {
|
|
3851
|
-
const svgIcon = icon;
|
|
3852
|
-
return (0, import_react5.cloneElement)(svgIcon, {
|
|
3853
|
-
height: 20,
|
|
3854
|
-
width: 20
|
|
3855
|
-
});
|
|
3856
|
-
}
|
|
3857
|
-
if ((0, import_react5.isValidElement)(icon)) {
|
|
3858
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "cnc-w-5 cnc-h-5 cnc-overflow-hidden", children: icon });
|
|
3859
|
-
}
|
|
3860
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "cnc-w-5 cnc-h-5 cnc-overflow-hidden", children: icon });
|
|
3861
|
-
}
|
|
3862
4125
|
|
|
3863
4126
|
// src/components/Popover/index.tsx
|
|
3864
|
-
var
|
|
3865
|
-
var
|
|
3866
|
-
var
|
|
3867
|
-
var
|
|
3868
|
-
var
|
|
3869
|
-
var
|
|
3870
|
-
|
|
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,
|
|
3871
4134
|
{
|
|
3872
4135
|
ref,
|
|
3873
4136
|
align,
|
|
@@ -3879,18 +4142,18 @@ var PopoverContent = React6.forwardRef(({ className, align = "center", sideOffse
|
|
|
3879
4142
|
...props
|
|
3880
4143
|
}
|
|
3881
4144
|
) }));
|
|
3882
|
-
|
|
4145
|
+
PopoverContent2.displayName = PopoverPrimitive2.Content.displayName;
|
|
3883
4146
|
|
|
3884
4147
|
// src/components/Select/index.tsx
|
|
3885
|
-
var
|
|
4148
|
+
var React10 = __toESM(require("react"));
|
|
3886
4149
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
3887
|
-
var
|
|
4150
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3888
4151
|
var Select = SelectPrimitive.Root;
|
|
3889
4152
|
var SelectGroup = SelectPrimitive.Group;
|
|
3890
4153
|
var SelectValue = SelectPrimitive.Value;
|
|
3891
4154
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3892
4155
|
var SelectViewport = SelectPrimitive.Viewport;
|
|
3893
|
-
var SelectTrigger =
|
|
4156
|
+
var SelectTrigger = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3894
4157
|
SelectPrimitive.Trigger,
|
|
3895
4158
|
{
|
|
3896
4159
|
ref,
|
|
@@ -3901,12 +4164,12 @@ var SelectTrigger = React7.forwardRef(({ className, children, ...props }, ref) =
|
|
|
3901
4164
|
...props,
|
|
3902
4165
|
children: [
|
|
3903
4166
|
children,
|
|
3904
|
-
/* @__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" }) })
|
|
3905
4168
|
]
|
|
3906
4169
|
}
|
|
3907
4170
|
));
|
|
3908
4171
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
3909
|
-
var SelectScrollUpButton =
|
|
4172
|
+
var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3910
4173
|
SelectPrimitive.ScrollUpButton,
|
|
3911
4174
|
{
|
|
3912
4175
|
ref,
|
|
@@ -3915,11 +4178,11 @@ var SelectScrollUpButton = React7.forwardRef(({ className, ...props }, ref) => /
|
|
|
3915
4178
|
className
|
|
3916
4179
|
),
|
|
3917
4180
|
...props,
|
|
3918
|
-
children: /* @__PURE__ */ (0,
|
|
4181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronUp, { className: "cnc-h-4 cnc-w-4" })
|
|
3919
4182
|
}
|
|
3920
4183
|
));
|
|
3921
4184
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
3922
|
-
var SelectScrollDownButton =
|
|
4185
|
+
var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3923
4186
|
SelectPrimitive.ScrollDownButton,
|
|
3924
4187
|
{
|
|
3925
4188
|
ref,
|
|
@@ -3928,11 +4191,11 @@ var SelectScrollDownButton = React7.forwardRef(({ className, ...props }, ref) =>
|
|
|
3928
4191
|
className
|
|
3929
4192
|
),
|
|
3930
4193
|
...props,
|
|
3931
|
-
children: /* @__PURE__ */ (0,
|
|
4194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChevronDown, { className: "cnc-h-4 cnc-w-4" })
|
|
3932
4195
|
}
|
|
3933
4196
|
));
|
|
3934
4197
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
3935
|
-
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)(
|
|
3936
4199
|
SelectPrimitive.Content,
|
|
3937
4200
|
{
|
|
3938
4201
|
ref,
|
|
@@ -3944,8 +4207,8 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
3944
4207
|
position,
|
|
3945
4208
|
...props,
|
|
3946
4209
|
children: [
|
|
3947
|
-
/* @__PURE__ */ (0,
|
|
3948
|
-
/* @__PURE__ */ (0,
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectScrollUpButton, {}),
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3949
4212
|
SelectPrimitive.Viewport,
|
|
3950
4213
|
{
|
|
3951
4214
|
className: cn(
|
|
@@ -3955,12 +4218,12 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
3955
4218
|
children
|
|
3956
4219
|
}
|
|
3957
4220
|
),
|
|
3958
|
-
/* @__PURE__ */ (0,
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectScrollDownButton, {})
|
|
3959
4222
|
]
|
|
3960
4223
|
}
|
|
3961
4224
|
) }));
|
|
3962
4225
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
3963
|
-
var SelectLabel =
|
|
4226
|
+
var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3964
4227
|
SelectPrimitive.Label,
|
|
3965
4228
|
{
|
|
3966
4229
|
ref,
|
|
@@ -3972,7 +4235,7 @@ var SelectLabel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3972
4235
|
}
|
|
3973
4236
|
));
|
|
3974
4237
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
3975
|
-
var SelectItem =
|
|
4238
|
+
var SelectItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3976
4239
|
SelectPrimitive.Item,
|
|
3977
4240
|
{
|
|
3978
4241
|
ref,
|
|
@@ -3982,13 +4245,13 @@ var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
3982
4245
|
),
|
|
3983
4246
|
...props,
|
|
3984
4247
|
children: [
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
3986
|
-
/* @__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 })
|
|
3987
4250
|
]
|
|
3988
4251
|
}
|
|
3989
4252
|
));
|
|
3990
4253
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
3991
|
-
var SelectSeparator =
|
|
4254
|
+
var SelectSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3992
4255
|
SelectPrimitive.Separator,
|
|
3993
4256
|
{
|
|
3994
4257
|
ref,
|
|
@@ -4000,11 +4263,11 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
4000
4263
|
|
|
4001
4264
|
// src/components/Tabs/index.tsx
|
|
4002
4265
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"));
|
|
4003
|
-
var
|
|
4004
|
-
var
|
|
4266
|
+
var React11 = __toESM(require("react"));
|
|
4267
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4005
4268
|
var Tabs = TabsPrimitive.Root;
|
|
4006
|
-
var TabsList =
|
|
4007
|
-
return /* @__PURE__ */ (0,
|
|
4269
|
+
var TabsList = React11.forwardRef(({ className, ...props }, ref) => {
|
|
4270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4008
4271
|
TabsPrimitive.List,
|
|
4009
4272
|
{
|
|
4010
4273
|
ref,
|
|
@@ -4014,7 +4277,7 @@ var TabsList = React8.forwardRef(({ className, ...props }, ref) => {
|
|
|
4014
4277
|
);
|
|
4015
4278
|
});
|
|
4016
4279
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
4017
|
-
var TabsTrigger =
|
|
4280
|
+
var TabsTrigger = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4018
4281
|
TabsPrimitive.Trigger,
|
|
4019
4282
|
{
|
|
4020
4283
|
ref,
|
|
@@ -4026,8 +4289,8 @@ var TabsTrigger = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4026
4289
|
}
|
|
4027
4290
|
));
|
|
4028
4291
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
4029
|
-
var TabsContent =
|
|
4030
|
-
return /* @__PURE__ */ (0,
|
|
4292
|
+
var TabsContent = React11.forwardRef(({ className, children, ...props }, ref) => {
|
|
4293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4031
4294
|
TabsPrimitive.Content,
|
|
4032
4295
|
{
|
|
4033
4296
|
ref,
|
|
@@ -4043,24 +4306,24 @@ var TabsContent = React8.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
4043
4306
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
4044
4307
|
|
|
4045
4308
|
// src/components/atoms/forms/input.tsx
|
|
4046
|
-
var
|
|
4047
|
-
var
|
|
4048
|
-
var Input =
|
|
4309
|
+
var React12 = __toESM(require("react"));
|
|
4310
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4311
|
+
var Input = React12.forwardRef(
|
|
4049
4312
|
({ className, type, id, label, required, ...props }, ref) => {
|
|
4050
4313
|
const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
|
|
4051
|
-
return /* @__PURE__ */ (0,
|
|
4052
|
-
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)(
|
|
4053
4316
|
"label",
|
|
4054
4317
|
{
|
|
4055
4318
|
htmlFor: idGenerate,
|
|
4056
4319
|
className: "cnc-block cnc-text-sm cnc-mb-1 cnc-font-medium cnc-text-brand-gray-600",
|
|
4057
4320
|
children: [
|
|
4058
4321
|
label,
|
|
4059
|
-
required && /* @__PURE__ */ (0,
|
|
4322
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-red-500", children: " *" })
|
|
4060
4323
|
]
|
|
4061
4324
|
}
|
|
4062
4325
|
),
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4064
4327
|
"input",
|
|
4065
4328
|
{
|
|
4066
4329
|
type,
|
|
@@ -4082,24 +4345,24 @@ var Input = React9.forwardRef(
|
|
|
4082
4345
|
Input.displayName = "Input";
|
|
4083
4346
|
|
|
4084
4347
|
// src/components/atoms/forms/textarea.tsx
|
|
4085
|
-
var
|
|
4086
|
-
var
|
|
4087
|
-
var Textarea =
|
|
4348
|
+
var React13 = __toESM(require("react"));
|
|
4349
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
4350
|
+
var Textarea = React13.forwardRef(
|
|
4088
4351
|
({ className, id, label, required, ...props }, ref) => {
|
|
4089
4352
|
const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
|
|
4090
|
-
return /* @__PURE__ */ (0,
|
|
4091
|
-
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)(
|
|
4092
4355
|
"label",
|
|
4093
4356
|
{
|
|
4094
4357
|
htmlFor: idGenerate,
|
|
4095
4358
|
className: "cnc-block cnc-text-sm cnc-mb-1 cnc-font-medium cnc-text-brand-gray-600",
|
|
4096
4359
|
children: [
|
|
4097
4360
|
label,
|
|
4098
|
-
required && /* @__PURE__ */ (0,
|
|
4361
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-red-500", children: " *" })
|
|
4099
4362
|
]
|
|
4100
4363
|
}
|
|
4101
4364
|
),
|
|
4102
|
-
/* @__PURE__ */ (0,
|
|
4365
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4103
4366
|
"textarea",
|
|
4104
4367
|
{
|
|
4105
4368
|
id: idGenerate,
|
|
@@ -4120,14 +4383,14 @@ var Textarea = React10.forwardRef(
|
|
|
4120
4383
|
Textarea.displayName = "Textarea";
|
|
4121
4384
|
|
|
4122
4385
|
// src/components/atoms/forms/checkbox.tsx
|
|
4123
|
-
var
|
|
4124
|
-
var
|
|
4125
|
-
var Checkbox =
|
|
4386
|
+
var React14 = __toESM(require("react"));
|
|
4387
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
4388
|
+
var Checkbox = React14.forwardRef(
|
|
4126
4389
|
({ className, id, label, ...props }, ref) => {
|
|
4127
4390
|
console.log();
|
|
4128
4391
|
const idGenerate = id ? id : label && `field-${Date.now()}-${Math.random() * 1e5}`;
|
|
4129
|
-
return /* @__PURE__ */ (0,
|
|
4130
|
-
/* @__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)(
|
|
4131
4394
|
"input",
|
|
4132
4395
|
{
|
|
4133
4396
|
type: "checkbox",
|
|
@@ -4137,7 +4400,7 @@ var Checkbox = React11.forwardRef(
|
|
|
4137
4400
|
...props
|
|
4138
4401
|
}
|
|
4139
4402
|
),
|
|
4140
|
-
label && /* @__PURE__ */ (0,
|
|
4403
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
4141
4404
|
"label",
|
|
4142
4405
|
{
|
|
4143
4406
|
htmlFor: idGenerate,
|
|
@@ -4151,9 +4414,9 @@ var Checkbox = React11.forwardRef(
|
|
|
4151
4414
|
Checkbox.displayName = "Checkbox";
|
|
4152
4415
|
|
|
4153
4416
|
// src/components/atoms/forms/switch.tsx
|
|
4154
|
-
var
|
|
4155
|
-
var
|
|
4156
|
-
var Switch =
|
|
4417
|
+
var React15 = __toESM(require("react"));
|
|
4418
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
4419
|
+
var Switch = React15.forwardRef(
|
|
4157
4420
|
({
|
|
4158
4421
|
className,
|
|
4159
4422
|
id,
|
|
@@ -4167,12 +4430,12 @@ var Switch = React12.forwardRef(
|
|
|
4167
4430
|
name,
|
|
4168
4431
|
"aria-label": ariaLabel
|
|
4169
4432
|
}, ref) => {
|
|
4170
|
-
const [internalChecked, setInternalChecked] =
|
|
4433
|
+
const [internalChecked, setInternalChecked] = React15.useState(
|
|
4171
4434
|
defaultChecked ?? false
|
|
4172
4435
|
);
|
|
4173
4436
|
const isControlled = checked !== void 0;
|
|
4174
4437
|
const isChecked = isControlled ? checked : internalChecked;
|
|
4175
|
-
const reactId =
|
|
4438
|
+
const reactId = React15.useId();
|
|
4176
4439
|
const fieldId = id || reactId;
|
|
4177
4440
|
const handleToggle = () => {
|
|
4178
4441
|
if (disabled) return;
|
|
@@ -4182,8 +4445,8 @@ var Switch = React12.forwardRef(
|
|
|
4182
4445
|
}
|
|
4183
4446
|
onChange?.(newValue);
|
|
4184
4447
|
};
|
|
4185
|
-
return /* @__PURE__ */ (0,
|
|
4186
|
-
/* @__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)(
|
|
4187
4450
|
"input",
|
|
4188
4451
|
{
|
|
4189
4452
|
type: "checkbox",
|
|
@@ -4195,7 +4458,7 @@ var Switch = React12.forwardRef(
|
|
|
4195
4458
|
"aria-hidden": "true"
|
|
4196
4459
|
}
|
|
4197
4460
|
),
|
|
4198
|
-
/* @__PURE__ */ (0,
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4199
4462
|
"button",
|
|
4200
4463
|
{
|
|
4201
4464
|
ref,
|
|
@@ -4213,7 +4476,7 @@ var Switch = React12.forwardRef(
|
|
|
4213
4476
|
"disabled:cnc-cursor-not-allowed disabled:cnc-opacity-50",
|
|
4214
4477
|
isChecked ? "cnc-bg-brand-blue-400 cnc-border-brand-blue-500" : "cnc-bg-brand-gray-20 cnc-border-brand-gray-100"
|
|
4215
4478
|
),
|
|
4216
|
-
children: /* @__PURE__ */ (0,
|
|
4479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4217
4480
|
"span",
|
|
4218
4481
|
{
|
|
4219
4482
|
className: cn(
|
|
@@ -4224,14 +4487,14 @@ var Switch = React12.forwardRef(
|
|
|
4224
4487
|
)
|
|
4225
4488
|
}
|
|
4226
4489
|
),
|
|
4227
|
-
label && /* @__PURE__ */ (0,
|
|
4490
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
4228
4491
|
"label",
|
|
4229
4492
|
{
|
|
4230
4493
|
htmlFor: fieldId,
|
|
4231
4494
|
className: "cnc-text-sm cnc-font-medium cnc-text-brand-gray-600 cnc-cursor-pointer",
|
|
4232
4495
|
children: [
|
|
4233
4496
|
label,
|
|
4234
|
-
required && /* @__PURE__ */ (0,
|
|
4497
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "cnc-text-red-500", children: " *" })
|
|
4235
4498
|
]
|
|
4236
4499
|
}
|
|
4237
4500
|
)
|
|
@@ -4241,7 +4504,7 @@ var Switch = React12.forwardRef(
|
|
|
4241
4504
|
Switch.displayName = "Switch";
|
|
4242
4505
|
|
|
4243
4506
|
// src/components/atoms/display/badge.tsx
|
|
4244
|
-
var
|
|
4507
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
4245
4508
|
var Badge = ({
|
|
4246
4509
|
variant = "default",
|
|
4247
4510
|
rounded = true,
|
|
@@ -4263,7 +4526,7 @@ var Badge = ({
|
|
|
4263
4526
|
md: "cnc-text-sm cnc-px-3 cnc-py-1",
|
|
4264
4527
|
lg: "cnc-text-base cnc-px-4 cnc-py-2"
|
|
4265
4528
|
};
|
|
4266
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
4267
4530
|
"span",
|
|
4268
4531
|
{
|
|
4269
4532
|
className: cn(
|
|
@@ -4279,8 +4542,8 @@ var Badge = ({
|
|
|
4279
4542
|
};
|
|
4280
4543
|
|
|
4281
4544
|
// src/components/atoms/display/avatar.tsx
|
|
4282
|
-
var
|
|
4283
|
-
var
|
|
4545
|
+
var React16 = __toESM(require("react"));
|
|
4546
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
4284
4547
|
var avatarSizeClasses = {
|
|
4285
4548
|
sm: "cnc-size-8 cnc-text-[10px]",
|
|
4286
4549
|
md: "cnc-size-12 cnc-text-xs",
|
|
@@ -4302,14 +4565,14 @@ function Avatar({
|
|
|
4302
4565
|
className,
|
|
4303
4566
|
...props
|
|
4304
4567
|
}) {
|
|
4305
|
-
const [hasError, setHasError] =
|
|
4568
|
+
const [hasError, setHasError] = React16.useState(false);
|
|
4306
4569
|
const baseClasses = cn(
|
|
4307
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",
|
|
4308
4571
|
avatarSizeClasses[size],
|
|
4309
4572
|
className
|
|
4310
4573
|
);
|
|
4311
4574
|
if (isLoading) {
|
|
4312
|
-
return /* @__PURE__ */ (0,
|
|
4575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4313
4576
|
"span",
|
|
4314
4577
|
{
|
|
4315
4578
|
className: cn(baseClasses, "cnc-animate-pulse cnc-bg-brand-gray-50"),
|
|
@@ -4320,7 +4583,7 @@ function Avatar({
|
|
|
4320
4583
|
);
|
|
4321
4584
|
}
|
|
4322
4585
|
const showImage = src && !hasError;
|
|
4323
|
-
return /* @__PURE__ */ (0,
|
|
4586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: baseClasses, ...props, children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4324
4587
|
"img",
|
|
4325
4588
|
{
|
|
4326
4589
|
src,
|
|
@@ -4328,7 +4591,7 @@ function Avatar({
|
|
|
4328
4591
|
className: "cnc-h-full cnc-w-full cnc-object-cover",
|
|
4329
4592
|
onError: () => setHasError(true)
|
|
4330
4593
|
}
|
|
4331
|
-
) : fallback ? /* @__PURE__ */ (0,
|
|
4594
|
+
) : fallback ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "cnc-font-bold", children: fallback }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4332
4595
|
User,
|
|
4333
4596
|
{
|
|
4334
4597
|
className: "cnc-shrink-0",
|
|
@@ -4339,12 +4602,12 @@ function Avatar({
|
|
|
4339
4602
|
}
|
|
4340
4603
|
|
|
4341
4604
|
// src/components/molecules/card.tsx
|
|
4342
|
-
var
|
|
4605
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4343
4606
|
function Card({
|
|
4344
4607
|
className,
|
|
4345
4608
|
...rest
|
|
4346
4609
|
}) {
|
|
4347
|
-
return /* @__PURE__ */ (0,
|
|
4610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4348
4611
|
"div",
|
|
4349
4612
|
{
|
|
4350
4613
|
className: cn(
|
|
@@ -4359,7 +4622,7 @@ function CardHeader({
|
|
|
4359
4622
|
className,
|
|
4360
4623
|
...rest
|
|
4361
4624
|
}) {
|
|
4362
|
-
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)(
|
|
4363
4626
|
"div",
|
|
4364
4627
|
{
|
|
4365
4628
|
className: cn(
|
|
@@ -4374,13 +4637,13 @@ function CardContent({
|
|
|
4374
4637
|
className,
|
|
4375
4638
|
...rest
|
|
4376
4639
|
}) {
|
|
4377
|
-
return /* @__PURE__ */ (0,
|
|
4640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("cnc-px-6 cnc-py-2", className), ...rest });
|
|
4378
4641
|
}
|
|
4379
4642
|
function CardFooter({
|
|
4380
4643
|
className,
|
|
4381
4644
|
...rest
|
|
4382
4645
|
}) {
|
|
4383
|
-
return /* @__PURE__ */ (0,
|
|
4646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4384
4647
|
"div",
|
|
4385
4648
|
{
|
|
4386
4649
|
className: cn(
|
|
@@ -4395,7 +4658,7 @@ function CardFooterItem({
|
|
|
4395
4658
|
className,
|
|
4396
4659
|
...rest
|
|
4397
4660
|
}) {
|
|
4398
|
-
return /* @__PURE__ */ (0,
|
|
4661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4399
4662
|
"div",
|
|
4400
4663
|
{
|
|
4401
4664
|
className: cn(
|
|
@@ -4409,7 +4672,7 @@ function CardFooterItem({
|
|
|
4409
4672
|
|
|
4410
4673
|
// src/components/molecules/collapsible.tsx
|
|
4411
4674
|
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
4412
|
-
var
|
|
4675
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4413
4676
|
var Collapsible = CollapsiblePrimitive.Root;
|
|
4414
4677
|
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
4415
4678
|
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
@@ -4417,16 +4680,16 @@ var AnimatedCollapsibleContent = ({
|
|
|
4417
4680
|
className,
|
|
4418
4681
|
...rest
|
|
4419
4682
|
}) => {
|
|
4420
|
-
return /* @__PURE__ */ (0,
|
|
4683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CollapsibleContent2, { className: "cnc-collapsible-content", ...rest });
|
|
4421
4684
|
};
|
|
4422
4685
|
|
|
4423
4686
|
// src/components/molecules/display/page-header.tsx
|
|
4424
|
-
var
|
|
4687
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4425
4688
|
function PageHeader({
|
|
4426
4689
|
children,
|
|
4427
4690
|
className
|
|
4428
4691
|
}) {
|
|
4429
|
-
return /* @__PURE__ */ (0,
|
|
4692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4430
4693
|
"header",
|
|
4431
4694
|
{
|
|
4432
4695
|
className: cn(
|
|
@@ -4441,7 +4704,7 @@ function PageHeaderTitleContent({
|
|
|
4441
4704
|
children,
|
|
4442
4705
|
className
|
|
4443
4706
|
}) {
|
|
4444
|
-
return /* @__PURE__ */ (0,
|
|
4707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4445
4708
|
"div",
|
|
4446
4709
|
{
|
|
4447
4710
|
className: cn(
|
|
@@ -4458,16 +4721,16 @@ function PageHeaderTitle({
|
|
|
4458
4721
|
titleAs = "h1"
|
|
4459
4722
|
}) {
|
|
4460
4723
|
const ComponentTitle = titleAs;
|
|
4461
|
-
return /* @__PURE__ */ (0,
|
|
4462
|
-
/* @__PURE__ */ (0,
|
|
4463
|
-
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 })
|
|
4464
4727
|
] });
|
|
4465
4728
|
}
|
|
4466
4729
|
function PageHeaderActionsContainer({
|
|
4467
4730
|
children,
|
|
4468
4731
|
className
|
|
4469
4732
|
}) {
|
|
4470
|
-
return /* @__PURE__ */ (0,
|
|
4733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4471
4734
|
"div",
|
|
4472
4735
|
{
|
|
4473
4736
|
className: cn(
|
|
@@ -4479,11 +4742,11 @@ function PageHeaderActionsContainer({
|
|
|
4479
4742
|
);
|
|
4480
4743
|
}
|
|
4481
4744
|
function Title2({ title, as: Component = "h1" }) {
|
|
4482
|
-
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 });
|
|
4483
4746
|
}
|
|
4484
4747
|
|
|
4485
4748
|
// src/components/molecules/display/empty-state.tsx
|
|
4486
|
-
var
|
|
4749
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4487
4750
|
function EmptyState({
|
|
4488
4751
|
icon,
|
|
4489
4752
|
title,
|
|
@@ -4493,7 +4756,7 @@ function EmptyState({
|
|
|
4493
4756
|
className,
|
|
4494
4757
|
...props
|
|
4495
4758
|
}) {
|
|
4496
|
-
return /* @__PURE__ */ (0,
|
|
4759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4497
4760
|
"div",
|
|
4498
4761
|
{
|
|
4499
4762
|
className: cn(
|
|
@@ -4503,17 +4766,17 @@ function EmptyState({
|
|
|
4503
4766
|
),
|
|
4504
4767
|
...props,
|
|
4505
4768
|
children: [
|
|
4506
|
-
/* @__PURE__ */ (0,
|
|
4507
|
-
/* @__PURE__ */ (0,
|
|
4508
|
-
description ? /* @__PURE__ */ (0,
|
|
4509
|
-
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
|
|
4510
4773
|
]
|
|
4511
4774
|
}
|
|
4512
4775
|
);
|
|
4513
4776
|
}
|
|
4514
4777
|
|
|
4515
4778
|
// src/components/molecules/display/result-metadata.tsx
|
|
4516
|
-
var
|
|
4779
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4517
4780
|
function encontradosSuffix(resourceName, forceWordGender) {
|
|
4518
4781
|
if (forceWordGender === "masc") return "o";
|
|
4519
4782
|
if (forceWordGender === "fem") return "a";
|
|
@@ -4530,7 +4793,7 @@ function ResultMetadata({
|
|
|
4530
4793
|
...props
|
|
4531
4794
|
}) {
|
|
4532
4795
|
const encontradVogal = encontradosSuffix(resourceName, forceWordGender);
|
|
4533
|
-
return /* @__PURE__ */ (0,
|
|
4796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4534
4797
|
"div",
|
|
4535
4798
|
{
|
|
4536
4799
|
className: cn("cnc-mt-4 cnc-mb-4", className),
|
|
@@ -4538,10 +4801,10 @@ function ResultMetadata({
|
|
|
4538
4801
|
"aria-live": "polite",
|
|
4539
4802
|
...props,
|
|
4540
4803
|
children: [
|
|
4541
|
-
/* @__PURE__ */ (0,
|
|
4542
|
-
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: [
|
|
4543
4806
|
"Exibindo os ",
|
|
4544
|
-
/* @__PURE__ */ (0,
|
|
4807
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "cnc-font-bold", children: displayed }),
|
|
4545
4808
|
" primeiros registros. Utilize os filtros para refinar sua busca."
|
|
4546
4809
|
] })
|
|
4547
4810
|
]
|
|
@@ -4550,7 +4813,7 @@ function ResultMetadata({
|
|
|
4550
4813
|
}
|
|
4551
4814
|
|
|
4552
4815
|
// src/components/molecules/display/label-value.tsx
|
|
4553
|
-
var
|
|
4816
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4554
4817
|
function LabelValue({
|
|
4555
4818
|
label,
|
|
4556
4819
|
value,
|
|
@@ -4558,9 +4821,9 @@ function LabelValue({
|
|
|
4558
4821
|
className,
|
|
4559
4822
|
valueClassName
|
|
4560
4823
|
}) {
|
|
4561
|
-
return /* @__PURE__ */ (0,
|
|
4562
|
-
/* @__PURE__ */ (0,
|
|
4563
|
-
/* @__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)(
|
|
4564
4827
|
"div",
|
|
4565
4828
|
{
|
|
4566
4829
|
className: cn(
|
|
@@ -4569,7 +4832,7 @@ function LabelValue({
|
|
|
4569
4832
|
),
|
|
4570
4833
|
children: [
|
|
4571
4834
|
value ?? "-",
|
|
4572
|
-
href && /* @__PURE__ */ (0,
|
|
4835
|
+
href && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4573
4836
|
"a",
|
|
4574
4837
|
{
|
|
4575
4838
|
href,
|
|
@@ -4577,7 +4840,7 @@ function LabelValue({
|
|
|
4577
4840
|
rel: "noopener noreferrer",
|
|
4578
4841
|
className: "cnc-inline-flex cnc-items-center cnc-text-brand-blue-500 hover:cnc-opacity-80",
|
|
4579
4842
|
"aria-label": `Abrir link externo de ${label}`,
|
|
4580
|
-
children: /* @__PURE__ */ (0,
|
|
4843
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ExternalLink, { className: "cnc-size-4" })
|
|
4581
4844
|
}
|
|
4582
4845
|
)
|
|
4583
4846
|
]
|
|
@@ -4587,10 +4850,10 @@ function LabelValue({
|
|
|
4587
4850
|
}
|
|
4588
4851
|
|
|
4589
4852
|
// src/components/molecules/forms/combobox.tsx
|
|
4590
|
-
var
|
|
4853
|
+
var React18 = __toESM(require("react"));
|
|
4591
4854
|
|
|
4592
4855
|
// src/components/molecules/forms/combobox-footer.tsx
|
|
4593
|
-
var
|
|
4856
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4594
4857
|
function ComboboxDropdownFooter({
|
|
4595
4858
|
footerAction,
|
|
4596
4859
|
renderFooter,
|
|
@@ -4599,10 +4862,10 @@ function ComboboxDropdownFooter({
|
|
|
4599
4862
|
}) {
|
|
4600
4863
|
if (hidden) return null;
|
|
4601
4864
|
if (renderFooter) {
|
|
4602
|
-
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 }) });
|
|
4603
4866
|
}
|
|
4604
4867
|
if (!footerAction) return null;
|
|
4605
|
-
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)(
|
|
4606
4869
|
Button,
|
|
4607
4870
|
{
|
|
4608
4871
|
type: "button",
|
|
@@ -4620,10 +4883,10 @@ function ComboboxDropdownFooter({
|
|
|
4620
4883
|
}
|
|
4621
4884
|
|
|
4622
4885
|
// src/components/molecules/overlay/command.tsx
|
|
4623
|
-
var
|
|
4886
|
+
var React17 = __toESM(require("react"));
|
|
4624
4887
|
var import_cmdk = require("cmdk");
|
|
4625
|
-
var
|
|
4626
|
-
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)(
|
|
4627
4890
|
import_cmdk.Command,
|
|
4628
4891
|
{
|
|
4629
4892
|
ref,
|
|
@@ -4636,16 +4899,16 @@ var Command = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4636
4899
|
));
|
|
4637
4900
|
Command.displayName = import_cmdk.Command.displayName;
|
|
4638
4901
|
var CommandDialog = ({ children, ...props }) => {
|
|
4639
|
-
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 }) }) });
|
|
4640
4903
|
};
|
|
4641
|
-
var CommandInput =
|
|
4904
|
+
var CommandInput = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4642
4905
|
"div",
|
|
4643
4906
|
{
|
|
4644
4907
|
className: "cnc-flex cnc-items-center cnc-border-b cnc-px-3",
|
|
4645
4908
|
"cmdk-input-wrapper": "",
|
|
4646
4909
|
children: [
|
|
4647
|
-
/* @__PURE__ */ (0,
|
|
4648
|
-
/* @__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)(
|
|
4649
4912
|
import_cmdk.Command.Input,
|
|
4650
4913
|
{
|
|
4651
4914
|
ref,
|
|
@@ -4660,7 +4923,7 @@ var CommandInput = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4660
4923
|
}
|
|
4661
4924
|
));
|
|
4662
4925
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
4663
|
-
var CommandList =
|
|
4926
|
+
var CommandList = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4664
4927
|
import_cmdk.Command.List,
|
|
4665
4928
|
{
|
|
4666
4929
|
ref,
|
|
@@ -4672,7 +4935,7 @@ var CommandList = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4672
4935
|
}
|
|
4673
4936
|
));
|
|
4674
4937
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
4675
|
-
var CommandEmpty =
|
|
4938
|
+
var CommandEmpty = React17.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4676
4939
|
import_cmdk.Command.Empty,
|
|
4677
4940
|
{
|
|
4678
4941
|
ref,
|
|
@@ -4681,7 +4944,7 @@ var CommandEmpty = React14.forwardRef((props, ref) => /* @__PURE__ */ (0, import
|
|
|
4681
4944
|
}
|
|
4682
4945
|
));
|
|
4683
4946
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
4684
|
-
var CommandGroup =
|
|
4947
|
+
var CommandGroup = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4685
4948
|
import_cmdk.Command.Group,
|
|
4686
4949
|
{
|
|
4687
4950
|
ref,
|
|
@@ -4693,7 +4956,7 @@ var CommandGroup = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4693
4956
|
}
|
|
4694
4957
|
));
|
|
4695
4958
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
4696
|
-
var CommandSeparator =
|
|
4959
|
+
var CommandSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4697
4960
|
import_cmdk.Command.Separator,
|
|
4698
4961
|
{
|
|
4699
4962
|
ref,
|
|
@@ -4702,7 +4965,7 @@ var CommandSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
4702
4965
|
}
|
|
4703
4966
|
));
|
|
4704
4967
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
4705
|
-
var CommandItem =
|
|
4968
|
+
var CommandItem = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4706
4969
|
import_cmdk.Command.Item,
|
|
4707
4970
|
{
|
|
4708
4971
|
ref,
|
|
@@ -4718,7 +4981,7 @@ var CommandShortcut = ({
|
|
|
4718
4981
|
className,
|
|
4719
4982
|
...props
|
|
4720
4983
|
}) => {
|
|
4721
|
-
return /* @__PURE__ */ (0,
|
|
4984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4722
4985
|
"span",
|
|
4723
4986
|
{
|
|
4724
4987
|
className: cn(
|
|
@@ -4731,27 +4994,6 @@ var CommandShortcut = ({
|
|
|
4731
4994
|
};
|
|
4732
4995
|
CommandShortcut.displayName = "CommandShortcut";
|
|
4733
4996
|
|
|
4734
|
-
// src/components/molecules/overlay/popover.tsx
|
|
4735
|
-
var React15 = __toESM(require("react"));
|
|
4736
|
-
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
|
|
4737
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4738
|
-
var Popover2 = PopoverPrimitive2.Root;
|
|
4739
|
-
var PopoverTrigger2 = PopoverPrimitive2.Trigger;
|
|
4740
|
-
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)(
|
|
4741
|
-
PopoverPrimitive2.Content,
|
|
4742
|
-
{
|
|
4743
|
-
ref,
|
|
4744
|
-
align,
|
|
4745
|
-
sideOffset,
|
|
4746
|
-
className: cn(
|
|
4747
|
-
"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]",
|
|
4748
|
-
className
|
|
4749
|
-
),
|
|
4750
|
-
...props
|
|
4751
|
-
}
|
|
4752
|
-
) }));
|
|
4753
|
-
PopoverContent2.displayName = PopoverPrimitive2.Content.displayName;
|
|
4754
|
-
|
|
4755
4997
|
// src/components/molecules/forms/combobox.tsx
|
|
4756
4998
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4757
4999
|
function Combobox({
|
|
@@ -4768,9 +5010,9 @@ function Combobox({
|
|
|
4768
5010
|
footerAction,
|
|
4769
5011
|
renderFooter
|
|
4770
5012
|
}) {
|
|
4771
|
-
const [open, setOpen] =
|
|
4772
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4773
|
-
/* @__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)(
|
|
4774
5016
|
Button,
|
|
4775
5017
|
{
|
|
4776
5018
|
variant: "outline",
|
|
@@ -4788,7 +5030,7 @@ function Combobox({
|
|
|
4788
5030
|
}
|
|
4789
5031
|
) }),
|
|
4790
5032
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4791
|
-
|
|
5033
|
+
PopoverContent,
|
|
4792
5034
|
{
|
|
4793
5035
|
align: "start",
|
|
4794
5036
|
className: cn(
|
|
@@ -4850,7 +5092,7 @@ function Combobox({
|
|
|
4850
5092
|
}
|
|
4851
5093
|
|
|
4852
5094
|
// src/components/molecules/forms/multi-select.tsx
|
|
4853
|
-
var
|
|
5095
|
+
var React19 = __toESM(require("react"));
|
|
4854
5096
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4855
5097
|
function MultiSelect({
|
|
4856
5098
|
options,
|
|
@@ -4867,7 +5109,7 @@ function MultiSelect({
|
|
|
4867
5109
|
footerAction,
|
|
4868
5110
|
renderFooter
|
|
4869
5111
|
}) {
|
|
4870
|
-
const [open, setOpen] =
|
|
5112
|
+
const [open, setOpen] = React19.useState(false);
|
|
4871
5113
|
const buttonText = (() => {
|
|
4872
5114
|
if (value.length === 0) return placeholder;
|
|
4873
5115
|
if (value.length === 1) {
|
|
@@ -4881,8 +5123,8 @@ function MultiSelect({
|
|
|
4881
5123
|
value.includes(optionValue) ? value.filter((item) => item !== optionValue) : [...value, optionValue]
|
|
4882
5124
|
);
|
|
4883
5125
|
};
|
|
4884
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4885
|
-
/* @__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)(
|
|
4886
5128
|
Button,
|
|
4887
5129
|
{
|
|
4888
5130
|
type: "button",
|
|
@@ -4902,7 +5144,7 @@ function MultiSelect({
|
|
|
4902
5144
|
}
|
|
4903
5145
|
) }),
|
|
4904
5146
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4905
|
-
|
|
5147
|
+
PopoverContent,
|
|
4906
5148
|
{
|
|
4907
5149
|
align: "start",
|
|
4908
5150
|
className: cn(
|
|
@@ -4957,7 +5199,7 @@ function MultiSelect({
|
|
|
4957
5199
|
}
|
|
4958
5200
|
|
|
4959
5201
|
// src/components/molecules/overlay/confirm-dialog.tsx
|
|
4960
|
-
var
|
|
5202
|
+
var React20 = __toESM(require("react"));
|
|
4961
5203
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4962
5204
|
function ConfirmDialog({
|
|
4963
5205
|
open,
|
|
@@ -4976,7 +5218,7 @@ function ConfirmDialog({
|
|
|
4976
5218
|
isLoading,
|
|
4977
5219
|
className
|
|
4978
5220
|
}) {
|
|
4979
|
-
const [localLoading, setLocalLoading] =
|
|
5221
|
+
const [localLoading, setLocalLoading] = React20.useState(false);
|
|
4980
5222
|
const isBusy = isLoading ?? localLoading;
|
|
4981
5223
|
const handleConfirm = async () => {
|
|
4982
5224
|
if (isLoading !== void 0) {
|
|
@@ -5066,7 +5308,7 @@ function Tooltip({
|
|
|
5066
5308
|
}
|
|
5067
5309
|
|
|
5068
5310
|
// src/components/organisms/filter/index.tsx
|
|
5069
|
-
var
|
|
5311
|
+
var React21 = __toESM(require("react"));
|
|
5070
5312
|
var import_react_hook_form = require("react-hook-form");
|
|
5071
5313
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5072
5314
|
var INPUT_BASE_CLASSES = [
|
|
@@ -5096,7 +5338,7 @@ function buildValidationRules(field) {
|
|
|
5096
5338
|
}
|
|
5097
5339
|
};
|
|
5098
5340
|
}
|
|
5099
|
-
var FilterFieldItem =
|
|
5341
|
+
var FilterFieldItem = React21.memo(function FilterFieldItem2({
|
|
5100
5342
|
field,
|
|
5101
5343
|
register,
|
|
5102
5344
|
control,
|
|
@@ -5178,7 +5420,7 @@ var FilterFieldItem = React19.memo(function FilterFieldItem2({
|
|
|
5178
5420
|
});
|
|
5179
5421
|
function CleanButton({ control, onClean }) {
|
|
5180
5422
|
const values = (0, import_react_hook_form.useWatch)({ control });
|
|
5181
|
-
const hasActiveFilters =
|
|
5423
|
+
const hasActiveFilters = React21.useMemo(() => {
|
|
5182
5424
|
const keys = Object.keys(values);
|
|
5183
5425
|
return keys.some((key) => {
|
|
5184
5426
|
const val = values[key];
|
|
@@ -5202,7 +5444,7 @@ function CleanButton({ control, onClean }) {
|
|
|
5202
5444
|
}
|
|
5203
5445
|
);
|
|
5204
5446
|
}
|
|
5205
|
-
var Filter =
|
|
5447
|
+
var Filter = React21.forwardRef(
|
|
5206
5448
|
function Filter2({
|
|
5207
5449
|
fields,
|
|
5208
5450
|
collapsibleFields,
|
|
@@ -5212,12 +5454,12 @@ var Filter = React19.forwardRef(
|
|
|
5212
5454
|
isLoading = false,
|
|
5213
5455
|
className
|
|
5214
5456
|
}, ref) {
|
|
5215
|
-
const [isCollapsibleOpen, setIsCollapsibleOpen] =
|
|
5216
|
-
const allFields =
|
|
5457
|
+
const [isCollapsibleOpen, setIsCollapsibleOpen] = React21.useState(false);
|
|
5458
|
+
const allFields = React21.useMemo(
|
|
5217
5459
|
() => [...fields, ...collapsibleFields || []],
|
|
5218
5460
|
[fields, collapsibleFields]
|
|
5219
5461
|
);
|
|
5220
|
-
const defaultValues =
|
|
5462
|
+
const defaultValues = React21.useMemo(
|
|
5221
5463
|
() => buildDefaultValues(allFields),
|
|
5222
5464
|
[allFields]
|
|
5223
5465
|
);
|
|
@@ -5228,7 +5470,7 @@ var Filter = React19.forwardRef(
|
|
|
5228
5470
|
reset,
|
|
5229
5471
|
formState: { errors }
|
|
5230
5472
|
} = (0, import_react_hook_form.useForm)({ defaultValues });
|
|
5231
|
-
|
|
5473
|
+
React21.useEffect(() => {
|
|
5232
5474
|
if (collapsibleFields?.some((f) => errors[f.name])) {
|
|
5233
5475
|
setIsCollapsibleOpen(true);
|
|
5234
5476
|
}
|
|
@@ -5236,7 +5478,7 @@ var Filter = React19.forwardRef(
|
|
|
5236
5478
|
const onSubmit = (data) => {
|
|
5237
5479
|
onSearch(data);
|
|
5238
5480
|
};
|
|
5239
|
-
const handleClean =
|
|
5481
|
+
const handleClean = React21.useCallback(() => {
|
|
5240
5482
|
const emptyValues = {};
|
|
5241
5483
|
for (const field of allFields) {
|
|
5242
5484
|
emptyValues[field.name] = field.type === "switch" ? false : "";
|
|
@@ -5317,7 +5559,7 @@ var Filter = React19.forwardRef(
|
|
|
5317
5559
|
);
|
|
5318
5560
|
|
|
5319
5561
|
// src/components/organisms/card-list/index.tsx
|
|
5320
|
-
var
|
|
5562
|
+
var React22 = __toESM(require("react"));
|
|
5321
5563
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5322
5564
|
function CardList({
|
|
5323
5565
|
items,
|
|
@@ -5377,20 +5619,20 @@ function CardList({
|
|
|
5377
5619
|
{
|
|
5378
5620
|
className: cn("cnc-grid cnc-w-full", gap, className),
|
|
5379
5621
|
style: gridStyle,
|
|
5380
|
-
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))
|
|
5381
5623
|
}
|
|
5382
5624
|
);
|
|
5383
5625
|
}
|
|
5384
5626
|
|
|
5385
5627
|
// src/components/organisms/drawer/drawer.tsx
|
|
5386
5628
|
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
|
|
5387
|
-
var
|
|
5629
|
+
var React23 = __toESM(require("react"));
|
|
5388
5630
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5389
5631
|
var Drawer = DialogPrimitive2.Root;
|
|
5390
5632
|
var DrawerTrigger = DialogPrimitive2.Trigger;
|
|
5391
5633
|
var DrawerPortal = DialogPrimitive2.Portal;
|
|
5392
5634
|
var DrawerClose = DialogPrimitive2.Close;
|
|
5393
|
-
var DrawerOverlay =
|
|
5635
|
+
var DrawerOverlay = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5394
5636
|
DialogPrimitive2.Overlay,
|
|
5395
5637
|
{
|
|
5396
5638
|
ref,
|
|
@@ -5409,7 +5651,7 @@ var drawerSizeToWidth = {
|
|
|
5409
5651
|
xl: "48rem",
|
|
5410
5652
|
full: "100vw"
|
|
5411
5653
|
};
|
|
5412
|
-
var DrawerContent =
|
|
5654
|
+
var DrawerContent = React23.forwardRef(
|
|
5413
5655
|
({
|
|
5414
5656
|
className,
|
|
5415
5657
|
children,
|
|
@@ -5473,7 +5715,7 @@ var DrawerFooter = ({
|
|
|
5473
5715
|
...props
|
|
5474
5716
|
}) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("cnc-border-t cnc-p-6", className), ...props });
|
|
5475
5717
|
DrawerFooter.displayName = "DrawerFooter";
|
|
5476
|
-
var DrawerTitle =
|
|
5718
|
+
var DrawerTitle = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5477
5719
|
DialogPrimitive2.Title,
|
|
5478
5720
|
{
|
|
5479
5721
|
ref,
|
|
@@ -5485,7 +5727,7 @@ var DrawerTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5485
5727
|
}
|
|
5486
5728
|
));
|
|
5487
5729
|
DrawerTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
5488
|
-
var DrawerDescription =
|
|
5730
|
+
var DrawerDescription = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5489
5731
|
DialogPrimitive2.Description,
|
|
5490
5732
|
{
|
|
5491
5733
|
ref,
|
|
@@ -5496,24 +5738,24 @@ var DrawerDescription = React21.forwardRef(({ className, ...props }, ref) => /*
|
|
|
5496
5738
|
DrawerDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
5497
5739
|
|
|
5498
5740
|
// src/components/organisms/drawer/drawer-context.tsx
|
|
5499
|
-
var
|
|
5741
|
+
var React24 = __toESM(require("react"));
|
|
5500
5742
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5501
|
-
var DrawerContext =
|
|
5743
|
+
var DrawerContext = React24.createContext(
|
|
5502
5744
|
void 0
|
|
5503
5745
|
);
|
|
5504
5746
|
function DrawerProvider({ children }) {
|
|
5505
|
-
const [activeDrawer, setActiveDrawer] =
|
|
5506
|
-
const openDrawer =
|
|
5747
|
+
const [activeDrawer, setActiveDrawer] = React24.useState(null);
|
|
5748
|
+
const openDrawer = React24.useCallback((drawerId) => {
|
|
5507
5749
|
setActiveDrawer(drawerId);
|
|
5508
5750
|
}, []);
|
|
5509
|
-
const closeDrawer =
|
|
5751
|
+
const closeDrawer = React24.useCallback(() => {
|
|
5510
5752
|
setActiveDrawer(null);
|
|
5511
5753
|
}, []);
|
|
5512
|
-
const isOpen =
|
|
5754
|
+
const isOpen = React24.useCallback(
|
|
5513
5755
|
(drawerId) => activeDrawer === drawerId,
|
|
5514
5756
|
[activeDrawer]
|
|
5515
5757
|
);
|
|
5516
|
-
const value =
|
|
5758
|
+
const value = React24.useMemo(
|
|
5517
5759
|
() => ({ activeDrawer, openDrawer, closeDrawer, isOpen }),
|
|
5518
5760
|
[activeDrawer, openDrawer, closeDrawer, isOpen]
|
|
5519
5761
|
);
|
|
@@ -5521,9 +5763,9 @@ function DrawerProvider({ children }) {
|
|
|
5521
5763
|
}
|
|
5522
5764
|
|
|
5523
5765
|
// src/components/organisms/drawer/use-drawer.ts
|
|
5524
|
-
var
|
|
5766
|
+
var React25 = __toESM(require("react"));
|
|
5525
5767
|
function useDrawer() {
|
|
5526
|
-
const context =
|
|
5768
|
+
const context = React25.useContext(DrawerContext);
|
|
5527
5769
|
if (!context) {
|
|
5528
5770
|
throw new Error("useDrawer deve ser usado dentro de um DrawerProvider");
|
|
5529
5771
|
}
|
|
@@ -5531,7 +5773,7 @@ function useDrawer() {
|
|
|
5531
5773
|
}
|
|
5532
5774
|
|
|
5533
5775
|
// src/components/organisms/upload/file-upload.tsx
|
|
5534
|
-
var
|
|
5776
|
+
var React26 = __toESM(require("react"));
|
|
5535
5777
|
|
|
5536
5778
|
// src/components/organisms/upload/utils.ts
|
|
5537
5779
|
function formatSizeLimit(bytes) {
|
|
@@ -5706,7 +5948,7 @@ function fileToListItem(file, index) {
|
|
|
5706
5948
|
status: "pending"
|
|
5707
5949
|
};
|
|
5708
5950
|
}
|
|
5709
|
-
var FileUpload =
|
|
5951
|
+
var FileUpload = React26.forwardRef(
|
|
5710
5952
|
({
|
|
5711
5953
|
value = [],
|
|
5712
5954
|
onChange,
|
|
@@ -5727,9 +5969,9 @@ var FileUpload = React24.forwardRef(
|
|
|
5727
5969
|
listClassName,
|
|
5728
5970
|
...props
|
|
5729
5971
|
}, ref) => {
|
|
5730
|
-
const fileInputRef =
|
|
5731
|
-
const hintId =
|
|
5732
|
-
|
|
5972
|
+
const fileInputRef = React26.useRef(null);
|
|
5973
|
+
const hintId = React26.useId();
|
|
5974
|
+
React26.useImperativeHandle(ref, () => fileInputRef.current, []);
|
|
5733
5975
|
const isBusy = disabled || isLoading;
|
|
5734
5976
|
const items = value.map(fileToListItem);
|
|
5735
5977
|
const clearInput = () => {
|
|
@@ -5888,7 +6130,7 @@ function formatDayAriaLabel(date) {
|
|
|
5888
6130
|
}
|
|
5889
6131
|
|
|
5890
6132
|
// src/components/organisms/calendar/mini-month-calendar.tsx
|
|
5891
|
-
var
|
|
6133
|
+
var React27 = __toESM(require("react"));
|
|
5892
6134
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5893
6135
|
function MiniMonthCalendar({
|
|
5894
6136
|
month: monthProp,
|
|
@@ -5903,8 +6145,8 @@ function MiniMonthCalendar({
|
|
|
5903
6145
|
nextLabel = "Pr\xF3ximo m\xEAs",
|
|
5904
6146
|
className
|
|
5905
6147
|
}) {
|
|
5906
|
-
const month =
|
|
5907
|
-
const cells =
|
|
6148
|
+
const month = React27.useMemo(() => toLocalNoon(monthProp ?? /* @__PURE__ */ new Date()), [monthProp]);
|
|
6149
|
+
const cells = React27.useMemo(
|
|
5908
6150
|
() => buildMonthDays(month, selectedDate, hasItems),
|
|
5909
6151
|
[month, selectedDate, hasItems]
|
|
5910
6152
|
);
|
|
@@ -5975,7 +6217,7 @@ function MiniMonthCalendar({
|
|
|
5975
6217
|
}
|
|
5976
6218
|
|
|
5977
6219
|
// src/components/organisms/calendar/month-year-picker.tsx
|
|
5978
|
-
var
|
|
6220
|
+
var React28 = __toESM(require("react"));
|
|
5979
6221
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5980
6222
|
function MonthYearPicker({
|
|
5981
6223
|
value,
|
|
@@ -5988,9 +6230,9 @@ function MonthYearPicker({
|
|
|
5988
6230
|
triggerClassName,
|
|
5989
6231
|
contentClassName
|
|
5990
6232
|
}) {
|
|
5991
|
-
const [open, setOpen] =
|
|
5992
|
-
const [viewYear, setViewYear] =
|
|
5993
|
-
|
|
6233
|
+
const [open, setOpen] = React28.useState(false);
|
|
6234
|
+
const [viewYear, setViewYear] = React28.useState(() => value.getFullYear());
|
|
6235
|
+
React28.useEffect(() => {
|
|
5994
6236
|
if (open) setViewYear(value.getFullYear());
|
|
5995
6237
|
}, [open, value]);
|
|
5996
6238
|
const isSelectedMonth = (monthIndex) => value.getFullYear() === viewYear && value.getMonth() === monthIndex;
|
|
@@ -6000,8 +6242,8 @@ function MonthYearPicker({
|
|
|
6000
6242
|
onChange(new Date(viewYear, monthIndex, day));
|
|
6001
6243
|
setOpen(false);
|
|
6002
6244
|
};
|
|
6003
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6004
|
-
/* @__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)(
|
|
6005
6247
|
Button,
|
|
6006
6248
|
{
|
|
6007
6249
|
type: "button",
|
|
@@ -6027,7 +6269,7 @@ function MonthYearPicker({
|
|
|
6027
6269
|
}
|
|
6028
6270
|
) }),
|
|
6029
6271
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6030
|
-
|
|
6272
|
+
PopoverContent,
|
|
6031
6273
|
{
|
|
6032
6274
|
align: "start",
|
|
6033
6275
|
className: cn("cnc-w-72 cnc-p-4", className, contentClassName),
|
|
@@ -6076,7 +6318,7 @@ function MonthYearPicker({
|
|
|
6076
6318
|
}
|
|
6077
6319
|
|
|
6078
6320
|
// src/components/organisms/period-range-list/index.tsx
|
|
6079
|
-
var
|
|
6321
|
+
var React29 = __toESM(require("react"));
|
|
6080
6322
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6081
6323
|
var DEFAULT_LABELS = {
|
|
6082
6324
|
start: "In\xEDcio",
|
|
@@ -6137,9 +6379,9 @@ function PeriodRangeList({
|
|
|
6137
6379
|
const labels = { ...DEFAULT_LABELS, ...labelsProp };
|
|
6138
6380
|
const endAfterStart = validate?.endAfterStart ?? true;
|
|
6139
6381
|
const noDuplicates = validate?.noDuplicates ?? true;
|
|
6140
|
-
const [startDraft, setStartDraft] =
|
|
6141
|
-
const [endDraft, setEndDraft] =
|
|
6142
|
-
const periods =
|
|
6382
|
+
const [startDraft, setStartDraft] = React29.useState("");
|
|
6383
|
+
const [endDraft, setEndDraft] = React29.useState("");
|
|
6384
|
+
const periods = React29.useMemo(() => normalizePeriods(value), [value]);
|
|
6143
6385
|
const isInvalidRange = Boolean(startDraft && endDraft) && endAfterStart && startDraft >= endDraft;
|
|
6144
6386
|
const isDuplicate = Boolean(startDraft && endDraft) && noDuplicates && periods.some(
|
|
6145
6387
|
(period) => period.start === startDraft && period.end === endDraft
|
|
@@ -6256,7 +6498,7 @@ function PeriodRangeList({
|
|
|
6256
6498
|
var DateTimeRangeList = PeriodRangeList;
|
|
6257
6499
|
|
|
6258
6500
|
// src/components/organisms/header-notifications/index.tsx
|
|
6259
|
-
var
|
|
6501
|
+
var React31 = __toESM(require("react"));
|
|
6260
6502
|
|
|
6261
6503
|
// src/components/organisms/header-notifications/cliente.ts
|
|
6262
6504
|
var URL_PADRAO_NOTIFICACOES = "https://dev-apinotificacoes-b5feekb4bdfyb7c2.eastus2-01.azurewebsites.net/v1";
|
|
@@ -6510,7 +6752,7 @@ function ModalLembretes({
|
|
|
6510
6752
|
}
|
|
6511
6753
|
|
|
6512
6754
|
// src/components/organisms/header-notifications/usar-notificacoes.ts
|
|
6513
|
-
var
|
|
6755
|
+
var React30 = __toESM(require("react"));
|
|
6514
6756
|
function foiAbortado(erro) {
|
|
6515
6757
|
return erro?.name === "AbortError";
|
|
6516
6758
|
}
|
|
@@ -6523,20 +6765,20 @@ function usarNotificacoes({
|
|
|
6523
6765
|
habilitado = true,
|
|
6524
6766
|
onErro
|
|
6525
6767
|
}) {
|
|
6526
|
-
const [notificacoes, setNotificacoes] =
|
|
6527
|
-
const [carregando, setCarregando] =
|
|
6528
|
-
const notificacoesRef =
|
|
6529
|
-
const controladorRef =
|
|
6530
|
-
const jaCarregouRef =
|
|
6531
|
-
const onErroRef =
|
|
6532
|
-
|
|
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(() => {
|
|
6533
6775
|
notificacoesRef.current = notificacoes;
|
|
6534
6776
|
}, [notificacoes]);
|
|
6535
|
-
|
|
6777
|
+
React30.useEffect(() => {
|
|
6536
6778
|
onErroRef.current = onErro;
|
|
6537
6779
|
}, [onErro]);
|
|
6538
6780
|
const chaveFiltros = JSON.stringify(filtros ?? {});
|
|
6539
|
-
const atualizar =
|
|
6781
|
+
const atualizar = React30.useCallback(() => {
|
|
6540
6782
|
if (!habilitado) return;
|
|
6541
6783
|
controladorRef.current?.abort();
|
|
6542
6784
|
const controlador = new AbortController();
|
|
@@ -6563,7 +6805,7 @@ function usarNotificacoes({
|
|
|
6563
6805
|
}
|
|
6564
6806
|
})();
|
|
6565
6807
|
}, [baseUrl, email, sistema, chaveFiltros, habilitado]);
|
|
6566
|
-
|
|
6808
|
+
React30.useEffect(() => {
|
|
6567
6809
|
if (!habilitado) {
|
|
6568
6810
|
setCarregando(false);
|
|
6569
6811
|
return;
|
|
@@ -6572,7 +6814,7 @@ function usarNotificacoes({
|
|
|
6572
6814
|
atualizar();
|
|
6573
6815
|
return () => controladorRef.current?.abort();
|
|
6574
6816
|
}, [atualizar, habilitado]);
|
|
6575
|
-
|
|
6817
|
+
React30.useEffect(() => {
|
|
6576
6818
|
if (!habilitado || !intervaloAtualizacao) return;
|
|
6577
6819
|
const temporizador = window.setInterval(() => {
|
|
6578
6820
|
if (typeof document !== "undefined" && document.hidden) return;
|
|
@@ -6580,7 +6822,7 @@ function usarNotificacoes({
|
|
|
6580
6822
|
}, intervaloAtualizacao);
|
|
6581
6823
|
return () => window.clearInterval(temporizador);
|
|
6582
6824
|
}, [atualizar, habilitado, intervaloAtualizacao]);
|
|
6583
|
-
const aplicarLeitura =
|
|
6825
|
+
const aplicarLeitura = React30.useCallback((ids) => {
|
|
6584
6826
|
const alvos = new Set(ids.map(String));
|
|
6585
6827
|
setNotificacoes(
|
|
6586
6828
|
(atuais) => atuais.map(
|
|
@@ -6588,7 +6830,7 @@ function usarNotificacoes({
|
|
|
6588
6830
|
)
|
|
6589
6831
|
);
|
|
6590
6832
|
}, []);
|
|
6591
|
-
const reverterLeitura =
|
|
6833
|
+
const reverterLeitura = React30.useCallback((anteriores) => {
|
|
6592
6834
|
const original = new Map(
|
|
6593
6835
|
anteriores.map((notificacao) => [String(notificacao.id), notificacao])
|
|
6594
6836
|
);
|
|
@@ -6603,7 +6845,7 @@ function usarNotificacoes({
|
|
|
6603
6845
|
})
|
|
6604
6846
|
);
|
|
6605
6847
|
}, []);
|
|
6606
|
-
const marcarUmaComoLida =
|
|
6848
|
+
const marcarUmaComoLida = React30.useCallback(
|
|
6607
6849
|
(id) => {
|
|
6608
6850
|
const alvo = notificacoesRef.current.find(
|
|
6609
6851
|
(notificacao) => String(notificacao.id) === String(id)
|
|
@@ -6617,7 +6859,7 @@ function usarNotificacoes({
|
|
|
6617
6859
|
},
|
|
6618
6860
|
[baseUrl, aplicarLeitura, reverterLeitura]
|
|
6619
6861
|
);
|
|
6620
|
-
const marcarComoLidas =
|
|
6862
|
+
const marcarComoLidas = React30.useCallback(
|
|
6621
6863
|
(ids) => {
|
|
6622
6864
|
const alvos = new Set(ids.map(String));
|
|
6623
6865
|
const naoLidas = notificacoesRef.current.filter(
|
|
@@ -6635,10 +6877,10 @@ function usarNotificacoes({
|
|
|
6635
6877
|
},
|
|
6636
6878
|
[baseUrl, aplicarLeitura, reverterLeitura]
|
|
6637
6879
|
);
|
|
6638
|
-
const marcarTodasComoLidas =
|
|
6880
|
+
const marcarTodasComoLidas = React30.useCallback(() => {
|
|
6639
6881
|
marcarComoLidas(notificacoesRef.current.map((notificacao) => notificacao.id));
|
|
6640
6882
|
}, [marcarComoLidas]);
|
|
6641
|
-
const marcarUmaComoNaoLida =
|
|
6883
|
+
const marcarUmaComoNaoLida = React30.useCallback(
|
|
6642
6884
|
(id) => {
|
|
6643
6885
|
const alvo = notificacoesRef.current.find(
|
|
6644
6886
|
(notificacao) => String(notificacao.id) === String(id)
|
|
@@ -6656,7 +6898,7 @@ function usarNotificacoes({
|
|
|
6656
6898
|
},
|
|
6657
6899
|
[baseUrl, reverterLeitura]
|
|
6658
6900
|
);
|
|
6659
|
-
const excluir =
|
|
6901
|
+
const excluir = React30.useCallback(
|
|
6660
6902
|
(id) => {
|
|
6661
6903
|
const alvo = notificacoesRef.current.find(
|
|
6662
6904
|
(notificacao) => String(notificacao.id) === String(id)
|
|
@@ -6717,11 +6959,11 @@ function HeaderNotifications(props) {
|
|
|
6717
6959
|
tituloLembretes,
|
|
6718
6960
|
rotuloDispensarLembretes
|
|
6719
6961
|
} = props;
|
|
6720
|
-
const [aberto, setAberto] =
|
|
6721
|
-
const [lembretesEmAlerta, setLembretesEmAlerta] =
|
|
6962
|
+
const [aberto, setAberto] = React31.useState(false);
|
|
6963
|
+
const [lembretesEmAlerta, setLembretesEmAlerta] = React31.useState(
|
|
6722
6964
|
[]
|
|
6723
6965
|
);
|
|
6724
|
-
const avaliouLembretesRef =
|
|
6966
|
+
const avaliouLembretesRef = React31.useRef(false);
|
|
6725
6967
|
const conectado = Boolean(email && sistema);
|
|
6726
6968
|
const remoto = usarNotificacoes({
|
|
6727
6969
|
email: email ?? "",
|
|
@@ -6732,17 +6974,17 @@ function HeaderNotifications(props) {
|
|
|
6732
6974
|
habilitado: conectado,
|
|
6733
6975
|
onErro
|
|
6734
6976
|
});
|
|
6735
|
-
const elegiveis =
|
|
6977
|
+
const elegiveis = React31.useMemo(
|
|
6736
6978
|
() => conectado ? selecionarVisiveis(remoto.notificacoes) : [],
|
|
6737
6979
|
[conectado, remoto.notificacoes]
|
|
6738
6980
|
);
|
|
6739
|
-
const itensRemotos =
|
|
6981
|
+
const itensRemotos = React31.useMemo(
|
|
6740
6982
|
() => elegiveis.slice(0, limite).map((notificacao) => mapearParaItem(notificacao, getHref)),
|
|
6741
6983
|
[elegiveis, limite, getHref]
|
|
6742
6984
|
);
|
|
6743
6985
|
const itens = conectado ? itensRemotos : items;
|
|
6744
6986
|
const carregandoLista = conectado ? remoto.carregando : isLoading;
|
|
6745
|
-
|
|
6987
|
+
React31.useEffect(() => {
|
|
6746
6988
|
if (!conectado || !alertarLembretes) return;
|
|
6747
6989
|
if (remoto.carregando || avaliouLembretesRef.current) return;
|
|
6748
6990
|
avaliouLembretesRef.current = true;
|
|
@@ -6908,8 +7150,8 @@ function HeaderNotifications(props) {
|
|
|
6908
7150
|
rotuloDispensar: rotuloDispensarLembretes
|
|
6909
7151
|
}
|
|
6910
7152
|
),
|
|
6911
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6912
|
-
/* @__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)(
|
|
6913
7155
|
"button",
|
|
6914
7156
|
{
|
|
6915
7157
|
type: "button",
|
|
@@ -6939,7 +7181,7 @@ function HeaderNotifications(props) {
|
|
|
6939
7181
|
}
|
|
6940
7182
|
) }),
|
|
6941
7183
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6942
|
-
|
|
7184
|
+
PopoverContent2,
|
|
6943
7185
|
{
|
|
6944
7186
|
align,
|
|
6945
7187
|
sideOffset: 20,
|
|
@@ -6975,10 +7217,10 @@ function HeaderNotifications(props) {
|
|
|
6975
7217
|
}
|
|
6976
7218
|
|
|
6977
7219
|
// src/alertas/alertas.tsx
|
|
6978
|
-
var
|
|
7220
|
+
var React34 = __toESM(require("react"));
|
|
6979
7221
|
|
|
6980
7222
|
// src/alertas/formulario-alerta.tsx
|
|
6981
|
-
var
|
|
7223
|
+
var React32 = __toESM(require("react"));
|
|
6982
7224
|
|
|
6983
7225
|
// src/alertas/date-utils.ts
|
|
6984
7226
|
function obterHojeDataHoraIsoLocal() {
|
|
@@ -7112,15 +7354,15 @@ function FormularioAlerta({
|
|
|
7112
7354
|
onSalvar,
|
|
7113
7355
|
onCancelar
|
|
7114
7356
|
}) {
|
|
7115
|
-
const [values, setValues] =
|
|
7357
|
+
const [values, setValues] = React32.useState(
|
|
7116
7358
|
() => alertaEmEdicao ? preencherFormDoAlerta(alertaEmEdicao) : FORM_VAZIO
|
|
7117
7359
|
);
|
|
7118
|
-
const [erro, setErro] =
|
|
7119
|
-
const [hojeDataHoraIso, setHojeDataHoraIso] =
|
|
7120
|
-
|
|
7360
|
+
const [erro, setErro] = React32.useState("");
|
|
7361
|
+
const [hojeDataHoraIso, setHojeDataHoraIso] = React32.useState("");
|
|
7362
|
+
React32.useEffect(() => {
|
|
7121
7363
|
setHojeDataHoraIso(obterHojeDataHoraIsoLocal());
|
|
7122
7364
|
}, []);
|
|
7123
|
-
|
|
7365
|
+
React32.useEffect(() => {
|
|
7124
7366
|
setValues(alertaEmEdicao ? preencherFormDoAlerta(alertaEmEdicao) : FORM_VAZIO);
|
|
7125
7367
|
setErro("");
|
|
7126
7368
|
}, [alertaEmEdicao]);
|
|
@@ -7477,7 +7719,7 @@ function AlertaItem({
|
|
|
7477
7719
|
}
|
|
7478
7720
|
|
|
7479
7721
|
// src/alertas/usar-alertas.ts
|
|
7480
|
-
var
|
|
7722
|
+
var React33 = __toESM(require("react"));
|
|
7481
7723
|
|
|
7482
7724
|
// src/alertas/cliente.ts
|
|
7483
7725
|
var ErroAlertas = class _ErroAlertas extends Error {
|
|
@@ -7529,25 +7771,25 @@ function usarAlertas({
|
|
|
7529
7771
|
habilitado = true,
|
|
7530
7772
|
onErro
|
|
7531
7773
|
}) {
|
|
7532
|
-
const [alertas, setAlertas] =
|
|
7533
|
-
const [carregando, setCarregando] =
|
|
7534
|
-
const controladorRef =
|
|
7535
|
-
const jaCarregouRef =
|
|
7536
|
-
const onErroRef =
|
|
7537
|
-
const fetchFnRef =
|
|
7538
|
-
const filtrosRef =
|
|
7539
|
-
|
|
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(() => {
|
|
7540
7782
|
onErroRef.current = onErro;
|
|
7541
7783
|
}, [onErro]);
|
|
7542
|
-
|
|
7784
|
+
React33.useEffect(() => {
|
|
7543
7785
|
fetchFnRef.current = fetchFn;
|
|
7544
7786
|
}, [fetchFn]);
|
|
7545
|
-
|
|
7787
|
+
React33.useEffect(() => {
|
|
7546
7788
|
filtrosRef.current = filtros;
|
|
7547
7789
|
}, [filtros]);
|
|
7548
7790
|
const pronto = baseUrl !== void 0 && sistema !== void 0 && email !== void 0;
|
|
7549
7791
|
const filtrosChave = filtros ? JSON.stringify(filtros) : "";
|
|
7550
|
-
const atualizar =
|
|
7792
|
+
const atualizar = React33.useCallback(() => {
|
|
7551
7793
|
if (!habilitado || !pronto) return;
|
|
7552
7794
|
controladorRef.current?.abort();
|
|
7553
7795
|
const controlador = new AbortController();
|
|
@@ -7576,7 +7818,7 @@ function usarAlertas({
|
|
|
7576
7818
|
}
|
|
7577
7819
|
})();
|
|
7578
7820
|
}, [baseUrl, sistema, email, eventoId, filtrosChave, habilitado, pronto]);
|
|
7579
|
-
|
|
7821
|
+
React33.useEffect(() => {
|
|
7580
7822
|
if (!habilitado || !pronto) {
|
|
7581
7823
|
setCarregando(false);
|
|
7582
7824
|
return;
|
|
@@ -7612,10 +7854,10 @@ function Alertas({
|
|
|
7612
7854
|
filtros,
|
|
7613
7855
|
onErro
|
|
7614
7856
|
}) {
|
|
7615
|
-
const [formAberto, setFormAberto] =
|
|
7616
|
-
const [alertaEmEdicao, setAlertaEmEdicao] =
|
|
7617
|
-
const [salvandoLocal, setSalvandoLocal] =
|
|
7618
|
-
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);
|
|
7619
7861
|
const conectado = Boolean(sistema && email);
|
|
7620
7862
|
const remoto = usarAlertas({
|
|
7621
7863
|
baseUrl,
|
|
@@ -7834,6 +8076,7 @@ function Alertas({
|
|
|
7834
8076
|
PopoverContent,
|
|
7835
8077
|
PopoverTrigger,
|
|
7836
8078
|
ResultMetadata,
|
|
8079
|
+
SIDEBAR_MOBILE_BREAKPOINT,
|
|
7837
8080
|
Select,
|
|
7838
8081
|
SelectContent,
|
|
7839
8082
|
SelectGroup,
|
|
@@ -7874,6 +8117,8 @@ function Alertas({
|
|
|
7874
8117
|
toLocalNoon,
|
|
7875
8118
|
usarAlertas,
|
|
7876
8119
|
useDrawer,
|
|
8120
|
+
useSidebar,
|
|
8121
|
+
useSidebarBreakpoint,
|
|
7877
8122
|
validateFiles
|
|
7878
8123
|
});
|
|
7879
8124
|
/*! Bundled license information:
|