@zeo-app/design-system 0.2.1 → 0.4.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.
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface IconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
3
+ /** Nome do glifo no Material Symbols Outlined (ex.: "settings") */
4
+ name: string;
5
+ size?: number;
6
+ fill?: boolean;
7
+ }
8
+ export declare function Icon({ name, size, fill, className, style, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ interface IconProps {
2
+ size?: number;
3
+ className?: string;
4
+ }
5
+ export declare const RadierIcon: ({ size, className }: IconProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const TubulaoIcon: ({ size, className }: IconProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const PosteIcon: ({ size, className }: IconProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ export { Icon } from './Icon';
2
+ export type { IconProps } from './Icon';
3
+ export { RadierIcon, TubulaoIcon, PosteIcon } from './ModuleIcons';
@@ -8,5 +8,17 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
8
8
  iconLeft?: string;
9
9
  iconRight?: string;
10
10
  onIconRightClick?: () => void;
11
+ /**
12
+ * Ativa o modo numérico com unidade (ex: "kg", "%"): aplica máscara de
13
+ * decimais e exibe o sufixo quando o campo não está em foco. Quando
14
+ * definido, `value`/`defaultValue` devem ser `number | ''` e o valor
15
+ * parseado é reportado via `onValueChange` (o `onChange` nativo continua
16
+ * disparando normalmente).
17
+ */
18
+ unit?: string;
19
+ /** Casas decimais exibidas no modo `unit`. Padrão: 0. */
20
+ decimals?: number;
21
+ /** Valor numérico parseado, disparado no blur quando `unit` está definido. */
22
+ onValueChange?: (value: number | '') => void;
11
23
  }
12
24
  export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ export interface AppNavbarProps {
3
+ onToggleMenu: () => void;
4
+ /** Início da barra, ao lado do hambúrguer (ex.: `NavbarTitle`). */
5
+ start?: ReactNode;
6
+ /** Busca (ex.: `NavbarSearch`). */
7
+ search?: ReactNode;
8
+ /** Botões de ação à direita (ex.: ajuda, notificações). */
9
+ actions?: ReactNode;
10
+ userMenu?: ReactNode;
11
+ /** Rótulo acessível do botão de menu. */
12
+ toggleMenuLabel?: string;
13
+ }
14
+ export declare function AppNavbar({ onToggleMenu, start, search, actions, userMenu, toggleMenuLabel, }: AppNavbarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ShellContext {
3
+ isExpanded: boolean;
4
+ toggle: () => void;
5
+ }
6
+ /** Conteúdo estático ou função que recebe o estado de expansão da sidebar. */
7
+ export type ShellSlot = ReactNode | ((ctx: ShellContext) => ReactNode);
8
+ export interface AppShellLayoutProps {
9
+ sidebar: ShellSlot;
10
+ navbar: ShellSlot;
11
+ children: ReactNode;
12
+ /** Estado inicial quando não controlado. */
13
+ defaultExpanded?: boolean;
14
+ /** Modo controlado: se informado, o layout não guarda estado próprio. */
15
+ isExpanded?: boolean;
16
+ onToggle?: () => void;
17
+ }
18
+ export declare function AppShellLayout({ sidebar, navbar, children, defaultExpanded, isExpanded: controlled, onToggle, }: AppShellLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,60 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SidebarItemData {
3
+ id: string;
4
+ label: string;
5
+ icon: ReactNode;
6
+ href?: string;
7
+ /** Item visível, mas não navegável. */
8
+ disabled?: boolean;
9
+ /** Texto do tooltip de um item desabilitado (ex.: "Você não tem acesso a este módulo"). */
10
+ disabledReason?: string;
11
+ }
12
+ export interface SidebarSectionData {
13
+ id: string;
14
+ /** Título da seção; só aparece com a sidebar expandida. */
15
+ label?: string;
16
+ items: SidebarItemData[];
17
+ /** `bottom` ancora a seção no rodapé da sidebar, separada por uma linha. */
18
+ placement?: 'top' | 'bottom';
19
+ }
20
+ export interface SidebarLinkProps {
21
+ item: SidebarItemData;
22
+ href: string;
23
+ className: string;
24
+ children: ReactNode;
25
+ }
26
+ export interface AppSidebarProps {
27
+ sections: SidebarSectionData[];
28
+ /** Id do item ativo. O DS não lê o router: quem sabe a rota é o app. */
29
+ activeId?: string;
30
+ isExpanded: boolean;
31
+ /** `href` torna o logo um link (entre módulos, full page load — ex.: seletor de módulos). */
32
+ logo: {
33
+ src: string;
34
+ alt?: string;
35
+ href?: string;
36
+ };
37
+ /**
38
+ * Renderiza o link de um item. O padrão é `<a href>`, correto entre módulos
39
+ * (full page load). Use para links internos do roteador do app.
40
+ */
41
+ renderLink?: (props: SidebarLinkProps) => ReactNode;
42
+ }
43
+ interface SidebarItemProps {
44
+ item: SidebarItemData;
45
+ isActive: boolean;
46
+ isExpanded: boolean;
47
+ renderLink?: AppSidebarProps['renderLink'];
48
+ }
49
+ export declare function SidebarItem({ item, isActive, isExpanded, renderLink }: SidebarItemProps): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
50
+ interface SidebarSectionProps {
51
+ section: SidebarSectionData;
52
+ /** Posição entre as seções do topo; a partir da segunda há espaçamento extra. */
53
+ index?: number;
54
+ activeId?: string;
55
+ isExpanded: boolean;
56
+ renderLink?: AppSidebarProps['renderLink'];
57
+ }
58
+ export declare function SidebarSection({ section, index, activeId, isExpanded, renderLink }: SidebarSectionProps): import("react/jsx-runtime").JSX.Element;
59
+ export declare function AppSidebar({ sections, activeId, isExpanded, logo, renderLink }: AppSidebarProps): import("react/jsx-runtime").JSX.Element;
60
+ export {};
@@ -0,0 +1,13 @@
1
+ export interface HelpMenuLabels {
2
+ help: string;
3
+ documentation: string;
4
+ faq: string;
5
+ changelog: string;
6
+ contactUs: string;
7
+ }
8
+ export interface HelpMenuProps {
9
+ labels?: Partial<HelpMenuLabels>;
10
+ /** Destino de cada item. Sem destino o item aponta para `#`. */
11
+ hrefs?: Partial<Record<'documentation' | 'faq' | 'changelog' | 'contactUs', string>>;
12
+ }
13
+ export declare function HelpMenu({ labels, hrefs }: HelpMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ export interface NavbarTitleProps {
3
+ module: string;
4
+ project?: string;
5
+ }
6
+ export declare function NavbarTitle({ module, project }: NavbarTitleProps): import("react/jsx-runtime").JSX.Element;
7
+ export interface NavbarSearchProps {
8
+ value: string;
9
+ onChange: (value: string) => void;
10
+ placeholder: string;
11
+ /** Texto do atalho exibido no campo (ex.: "Ctrl + K"). */
12
+ shortcutHint?: string;
13
+ /** Se verdadeiro, Ctrl/Cmd + K dá foco no campo. */
14
+ focusShortcut?: boolean;
15
+ }
16
+ export declare function NavbarSearch({ value, onChange, placeholder, shortcutHint, focusShortcut }: NavbarSearchProps): import("react/jsx-runtime").JSX.Element;
17
+ export interface NavbarIconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
18
+ icon: ReactNode;
19
+ /** Rótulo acessível (obrigatório: o botão não tem texto). */
20
+ label: string;
21
+ /** Ponto indicador de pendência. */
22
+ badge?: boolean;
23
+ }
24
+ export declare function NavbarIconButton({ icon, label, badge, className, type, ...rest }: NavbarIconButtonProps): import("react/jsx-runtime").JSX.Element;
25
+ export interface NotificationsBellProps {
26
+ /** Há notificações não lidas (mostra o ponto). */
27
+ hasUnread?: boolean;
28
+ /** Contagem de não lidas; se maior que zero, equivale a `hasUnread`. */
29
+ count?: number;
30
+ onClick?: () => void;
31
+ label?: string;
32
+ }
33
+ export declare function NotificationsBell({ hasUnread, count, onClick, label }: NotificationsBellProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ export interface UserMenuLabels {
2
+ myAccount: string;
3
+ logout: string;
4
+ /** Rótulo acessível do avatar quando não há nome. */
5
+ user: string;
6
+ }
7
+ export interface UserMenuProps {
8
+ name: string;
9
+ email: string;
10
+ /** Nome curto exibido ao lado do avatar (ex.: primeiro nome). */
11
+ shortName?: string;
12
+ profilePicUrl?: string;
13
+ onMyAccount: () => void;
14
+ /**
15
+ * Chamado ao clicar em "Sair", depois de fechar o menu.
16
+ *
17
+ * ORDEM IMPORTA: quem implementa deve fazer o logout primeiro e só DEPOIS limpar o cache
18
+ * do React Query (`await logout(); queryClient.clear()`). Limpar antes dispara refetch das
19
+ * queries montadas com a sessão ainda válida, repopulando o cache com os dados de quem está
20
+ * saindo; como o login seguinte é navegação SPA, esses dados aparecem para o próximo usuário.
21
+ */
22
+ onLogout: () => void | Promise<void>;
23
+ labels?: Partial<UserMenuLabels>;
24
+ }
25
+ export declare function UserMenu({ name, email, shortName, profilePicUrl, onMyAccount, onLogout, labels }: UserMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export { AppShellLayout } from './AppShellLayout';
2
+ export type { AppShellLayoutProps, ShellContext, ShellSlot } from './AppShellLayout';
3
+ export { AppSidebar, SidebarSection, SidebarItem } from './AppSidebar';
4
+ export type { AppSidebarProps, SidebarItemData, SidebarSectionData, SidebarLinkProps, } from './AppSidebar';
5
+ export { AppNavbar } from './AppNavbar';
6
+ export type { AppNavbarProps } from './AppNavbar';
7
+ export { NavbarTitle, NavbarSearch, NavbarIconButton, NotificationsBell } from './NavbarParts';
8
+ export type { NavbarTitleProps, NavbarSearchProps, NavbarIconButtonProps, NotificationsBellProps, } from './NavbarParts';
9
+ export { UserMenu } from './UserMenu';
10
+ export type { UserMenuProps, UserMenuLabels } from './UserMenu';
11
+ export { HelpMenu } from './HelpMenu';
12
+ export type { HelpMenuProps, HelpMenuLabels } from './HelpMenu';
13
+ export { useDismiss } from './useDismiss';
14
+ export { MODULE_CATALOG, resolveModuleAccess } from './moduleCatalog';
15
+ export type { ModuleAccess, ModuleCatalogEntry, ModuleId, ModuleStatus } from './moduleCatalog';
@@ -0,0 +1,34 @@
1
+ import { ComponentType } from 'react';
2
+ /** Slugs dos módulos da plataforma; batem com os `slug` do KKWeb-auth. */
3
+ export type ModuleId = 'tower' | 'antennas' | 'rooftop' | 'radier' | 'caisson_foundation' | 'pole' | 'dashboards';
4
+ export type ModuleStatus = 'active' | 'coming_soon' | 'in_development';
5
+ export interface ModuleCatalogEntry {
6
+ id: ModuleId;
7
+ status: ModuleStatus;
8
+ /** Glifo do Material Symbols, usado quando não há `IconComponent`. */
9
+ iconName: string;
10
+ /** Ícone de produto próprio (SVG), quando existe. */
11
+ IconComponent?: ComponentType<{
12
+ size?: number;
13
+ className?: string;
14
+ }>;
15
+ /** Chave de tradução do nome do módulo; o texto é do app (i18n). */
16
+ labelKey: string;
17
+ }
18
+ /**
19
+ * Catálogo estático dos módulos. Não conhece URL (infraestrutura, vem do env de cada app)
20
+ * nem permissão (vem do `/auth/me`): o app injeta as duas coisas antes de montar a sidebar.
21
+ */
22
+ export declare const MODULE_CATALOG: readonly ModuleCatalogEntry[];
23
+ export interface ModuleAccess<T extends ModuleCatalogEntry = ModuleCatalogEntry> {
24
+ module: T;
25
+ /** O usuário tem permissão para abrir o módulo. */
26
+ hasAccess: boolean;
27
+ }
28
+ /**
29
+ * Aplica a regra de exibição da sidebar: módulo que a empresa não tem (`moduleIds`) some;
30
+ * o que a empresa tem e o usuário não (`accessibleModuleIds`) vem com `hasAccess: false`,
31
+ * para o app mostrá-lo desabilitado. Os módulos em `accessibleModuleIds` entram mesmo fora de
32
+ * `moduleIds`, porque o super_admin recebe todos os ativos sem ter empresa.
33
+ */
34
+ export declare function resolveModuleAccess<T extends ModuleCatalogEntry>(modules: readonly T[], moduleIds: readonly string[], accessibleModuleIds: readonly string[]): ModuleAccess<T>[];
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ /** Fecha um popover no Escape e no clique fora do container. */
3
+ export declare function useDismiss(ref: RefObject<HTMLElement | null>, isOpen: boolean, onDismiss: () => void): void;
@@ -7,12 +7,13 @@ export * from './ButtonGroup';
7
7
  export * from './Card';
8
8
  export * from './Dropdown';
9
9
  export * from './FormElements';
10
+ export * from './Icon';
10
11
  export * from './Input';
11
12
  export * from './Modal';
12
13
  export * from './Pagination';
13
14
  export * from './ProgressBar';
15
+ export * from './Shell';
14
16
  export * from './Spinner';
15
17
  export * from './Table';
16
18
  export * from './Tabs';
17
19
  export * from './Tooltip';
18
- export * from './UnitInput';
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),ee=require("react-dom"),te={info:{container:"bg-blue-50 border-blue-200 text-blue-800",icon:"text-blue-500",defaultIcon:"info"},success:{container:"bg-green-50 border-green-200 text-green-800",icon:"text-green-500",defaultIcon:"check_circle"},warning:{container:"bg-yellow-50 border-yellow-200 text-yellow-800",icon:"text-yellow-500",defaultIcon:"warning"},danger:{container:"bg-red-50 border-red-200 text-red-800",icon:"text-red-500",defaultIcon:"error"}};function re({variant:t="info",title:r,children:s,onClose:n,icon:a,className:o="",...i}){const l=te[t],f=a??l.defaultIcon;return e.jsxs("div",{role:"alert",className:["flex gap-3 p-4 rounded-lg border",l.container,o].filter(Boolean).join(" "),...i,children:[e.jsx("span",{className:`material-symbols-outlined text-[20px] shrink-0 mt-0.5 ${l.icon}`,children:f}),e.jsxs("div",{className:"flex-1 min-w-0",children:[r&&e.jsx("p",{className:"font-semibold text-sm mb-0.5",children:r}),e.jsx("div",{className:"text-sm leading-relaxed",children:s})]}),n&&e.jsx("button",{onClick:n,className:"shrink-0 opacity-70 hover:opacity-100 transition-opacity","aria-label":"Fechar alerta",children:e.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]})}const se={xs:"w-6 h-6 text-[10px]",sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base",xl:"w-16 h-16 text-lg"},ne={xs:"w-1.5 h-1.5",sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3",xl:"w-3.5 h-3.5"},ae={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-yellow-400"};function oe(t){return t.split(" ").slice(0,2).map(r=>r[0]).join("").toUpperCase()}function le(t){const r=["bg-orange-100 text-orange-700","bg-blue-100 text-blue-700","bg-green-100 text-green-700","bg-purple-100 text-purple-700","bg-pink-100 text-pink-700","bg-teal-100 text-teal-700"],s=t.charCodeAt(0)%r.length;return r[s]}function ie({src:t,alt:r="",name:s,size:n="md",status:a,className:o="",...i}){return e.jsxs("div",{className:["relative inline-flex shrink-0",o].filter(Boolean).join(" "),...i,children:[e.jsx("div",{className:["rounded-full overflow-hidden flex items-center justify-center font-semibold",se[n],!t&&s?le(s):"bg-surface-container"].filter(Boolean).join(" "),children:t?e.jsx("img",{src:t,alt:r||s,className:"w-full h-full object-cover"}):s?oe(s):e.jsx("span",{className:"material-symbols-outlined text-on-surface-variant",style:{fontSize:"60%"},children:"person"})}),a&&e.jsx("span",{className:["absolute bottom-0 right-0 rounded-full border-2 border-white",ne[n],ae[a]].filter(Boolean).join(" ")})]})}const ce={default:"bg-surface-container text-on-surface-variant",primary:"bg-orange-100 text-orange-700",success:"bg-green-100 text-green-700",warning:"bg-yellow-100 text-yellow-700",danger:"bg-red-100 text-red-700",info:"bg-blue-100 text-blue-700"},de={default:"bg-on-surface-variant",primary:"bg-orange-500",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},ue={sm:"px-2 py-0.5 text-xs gap-1",md:"px-2.5 py-1 text-xs gap-1.5"};function xe({variant:t="default",size:r="md",dot:s=!1,icon:n,children:a,className:o="",...i}){return e.jsxs("span",{className:["inline-flex items-center font-medium rounded-full",ce[t],ue[r],o].filter(Boolean).join(" "),...i,children:[s&&e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${de[t]}`}),n&&!s&&e.jsx("span",{className:"material-symbols-outlined text-[12px]",children:n}),a]})}function fe({items:t,className:r="",...s}){return e.jsx("nav",{"aria-label":"Breadcrumb",className:r,...s,children:e.jsx("ol",{className:"inline-flex items-center gap-1.5 text-sm flex-wrap",children:t.map((n,a)=>{const o=a===t.length-1;return e.jsxs("li",{className:"flex items-center gap-1.5",children:[a>0&&e.jsx("span",{className:"material-symbols-outlined text-[16px] text-on-surface-variant select-none",children:"chevron_right"}),o?e.jsxs("span",{"aria-current":"page",className:"font-semibold text-on-surface flex items-center gap-1",children:[n.icon&&e.jsx("span",{className:"material-symbols-outlined text-[18px] leading-none",children:n.icon}),n.label]}):e.jsxs("a",{href:n.href??"#",className:"text-on-surface-variant hover:text-zeo-orange transition-colors flex items-center gap-1",children:[n.icon&&e.jsx("span",{className:"material-symbols-outlined text-[18px] leading-none",children:n.icon}),n.label]})]},a)})})})}const me={primary:"bg-zeo-orange text-white hover:bg-orange-700 active:bg-orange-800 focus:shadow-zeo-focus border-transparent",secondary:"bg-white text-on-surface border-outline-variant hover:bg-surface-container-low active:bg-surface-container focus:shadow-zeo-focus",ghost:"bg-transparent text-on-surface-variant border-transparent hover:bg-surface-container-low active:bg-surface-container focus:shadow-zeo-focus",danger:"bg-error text-on-error border-transparent hover:bg-red-700 active:bg-red-800 focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]",success:"bg-tertiary text-on-tertiary border-transparent hover:bg-green-800 active:bg-green-900 focus:shadow-[0_0_0_4px_rgba(0,108,73,0.15)]"},pe={sm:"px-3 py-1.5 text-sm gap-1.5 h-8",md:"px-4 py-2 text-sm gap-2 h-10",lg:"px-5 py-2.5 text-base gap-2 h-11"},_={sm:"text-[16px]",md:"text-[18px]",lg:"text-[20px]"},A=d.forwardRef(({variant:t="primary",size:r="md",loading:s=!1,iconLeft:n,iconRight:a,fullWidth:o=!1,disabled:i,children:l,className:f="",...u},x)=>{const m=i||s;return e.jsxs("button",{ref:x,disabled:m,className:["inline-flex items-center justify-center font-medium rounded border transition-all duration-200 select-none","focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed",me[t],pe[r],o?"w-full":"",f].filter(Boolean).join(" "),...u,children:[s?e.jsx("span",{className:`material-symbols-outlined animate-spin ${_[r]}`,children:"progress_activity"}):n&&e.jsx("span",{className:`material-symbols-outlined ${_[r]}`,children:n}),l,!s&&a&&e.jsx("span",{className:`material-symbols-outlined ${_[r]}`,children:a})]})});A.displayName="Button";function be({children:t,attached:r=!1,className:s="",...n}){return e.jsx("div",{role:"group",className:["inline-flex",r?"[&>button]:rounded-none [&>button:first-child]:rounded-l [&>button:last-child]:rounded-r [&>button:not(:first-child)]:-ml-px":"gap-2",s].filter(Boolean).join(" "),...n,children:t})}const he={elevated:"bg-white shadow-theme-lg border border-surface-container-high",outlined:"bg-white border border-outline-variant",filled:"bg-surface-container-low border border-transparent"},ge={none:"",sm:"p-4",md:"p-5",lg:"p-6"};function we({variant:t="elevated",padding:r="md",children:s,className:n="",...a}){return e.jsx("div",{className:["rounded-xl overflow-hidden",he[t],n].filter(Boolean).join(" "),...a,children:e.jsx("div",{className:ge[r],children:s})})}function je({title:t,subtitle:r,action:s,icon:n,className:a="",...o}){return e.jsxs("div",{className:["flex items-start justify-between gap-4 pb-4",a].filter(Boolean).join(" "),...o,children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n&&e.jsx("span",{className:"material-symbols-outlined text-on-surface-variant text-[24px] shrink-0",children:n}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold text-on-surface truncate",children:t}),r&&e.jsx("p",{className:"text-sm text-on-surface-variant mt-0.5",children:r})]})]}),s&&e.jsx("div",{className:"shrink-0",children:s})]})}function ve({children:t,className:r="",...s}){return e.jsx("div",{className:["flex items-center justify-end gap-3 pt-4 border-t border-surface-container-high",r].filter(Boolean).join(" "),...s,children:t})}const B=8,M=4;function ye({trigger:t,items:r,align:s="right",className:n="",...a}){const[o,i]=d.useState(!1),[l,f]=d.useState(null),u=d.useRef(null),x=d.useRef(null),m=d.useCallback(()=>{var N;const c=u.current;if(!c)return;const p=c.getBoundingClientRect(),b=(N=x.current)==null?void 0:N.getBoundingClientRect(),w=(b==null?void 0:b.width)??180,h=(b==null?void 0:b.height)??0,j=window.innerHeight-p.bottom,g=p.top,C=j<h+B&&g>j?p.top-h-M:p.bottom+M,y=s==="right"?p.right-w:p.left,z=window.innerWidth-w-B,T=Math.min(Math.max(y,B),Math.max(z,B));f({top:C,left:T})},[s]);return d.useLayoutEffect(()=>{o&&m()},[o,m]),d.useEffect(()=>{if(!o)return;const c=()=>m();return window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[o,m]),d.useEffect(()=>{const c=p=>{var j,g;const b=p.target,w=(j=u.current)==null?void 0:j.contains(b),h=(g=x.current)==null?void 0:g.contains(b);!w&&!h&&i(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),d.useEffect(()=>{const c=p=>{p.key==="Escape"&&i(!1)};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),e.jsxs("div",{ref:u,className:["relative inline-block",n].filter(Boolean).join(" "),...a,children:[e.jsx("div",{onClick:()=>i(c=>!c),children:t}),o&&ee.createPortal(e.jsx("div",{ref:x,className:"fixed z-[100] min-w-[180px] bg-white border border-surface-container-high rounded-xl shadow-theme-lg py-1",style:{top:(l==null?void 0:l.top)??0,left:(l==null?void 0:l.left)??0,visibility:l?"visible":"hidden"},role:"menu",children:r.map((c,p)=>e.jsxs("div",{children:[e.jsxs("button",{role:"menuitem",disabled:c.disabled,onClick:()=>{var b;c.disabled||((b=c.onClick)==null||b.call(c),i(!1))},className:["w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors text-left",c.danger?"text-error hover:bg-red-50":"text-on-surface hover:bg-surface-container-low",c.disabled?"opacity-40 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" "),children:[c.icon&&e.jsx("span",{className:"material-symbols-outlined text-[18px] opacity-70",children:c.icon}),c.label]}),c.dividerAfter&&e.jsx("div",{className:"my-1 border-t border-surface-container-high"})]},p))}),document.body)]})}const H=d.forwardRef(({label:t,hint:r,error:s,options:n,placeholder:a,disabled:o,className:i="",id:l,...f},u)=>{const x=l??(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&e.jsx("label",{htmlFor:x,className:"text-sm font-medium text-on-surface",children:t}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{ref:u,id:x,disabled:o,className:["w-full appearance-none bg-white border rounded px-3 py-2 text-sm pr-9 transition-all duration-200","text-on-surface focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",s?"border-error":"border-outline-variant","disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",i].filter(Boolean).join(" "),...f,children:[a&&e.jsx("option",{value:"",disabled:!0,children:a}),n.map(m=>e.jsx("option",{value:m.value,disabled:m.disabled,children:m.label},m.value))]}),e.jsx("span",{className:"material-symbols-outlined absolute right-3 top-1/2 -translate-y-1/2 text-[18px] text-on-surface-variant pointer-events-none",children:"expand_more"})]}),s&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),s]}),!s&&r&&e.jsx("p",{className:"text-xs text-on-surface-variant",children:r})]})});H.displayName="Select";const q=d.forwardRef(({label:t,hint:r,error:s,disabled:n,className:a="",id:o,rows:i=4,...l},f)=>{const u=o??(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&e.jsx("label",{htmlFor:u,className:"text-sm font-medium text-on-surface",children:t}),e.jsx("textarea",{ref:f,id:u,rows:i,disabled:n,className:["w-full bg-white border rounded px-3 py-2 text-sm resize-y transition-all duration-200","text-on-surface placeholder:text-on-surface-variant","focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",s?"border-error":"border-outline-variant","disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",a].filter(Boolean).join(" "),...l}),s&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),s]}),!s&&r&&e.jsx("p",{className:"text-xs text-on-surface-variant",children:r})]})});q.displayName="Textarea";const Ne={square:"rounded-[2px]",rounded:"rounded-[4px]",circle:"rounded-full"},D=d.forwardRef(({label:t,description:r,error:s,disabled:n,className:a="",id:o,shape:i="square",color:l="#FF6B00",...f},u)=>{const x=o??`checkbox-${t==null?void 0:t.toLowerCase().replace(/\s+/g,"-")}`;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("label",{htmlFor:x,className:["flex items-start gap-3 cursor-pointer",n?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:"relative mt-0.5 shrink-0 w-4 h-4",children:[e.jsx("input",{ref:u,type:"checkbox",id:x,disabled:n,className:["absolute inset-0 w-full h-full opacity-0 cursor-pointer peer disabled:cursor-not-allowed",a].filter(Boolean).join(" "),...f}),e.jsx("div",{className:["w-4 h-4 border-2 border-outline-variant transition-colors pointer-events-none","bg-white peer-checked:bg-[var(--cb-color)] peer-checked:border-[var(--cb-color)]","peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--cb-color)]/30 peer-focus-visible:ring-offset-0",Ne[i]].filter(Boolean).join(" "),style:{"--cb-color":l}}),e.jsx("svg",{viewBox:"0 0 12 10",width:"10",height:"8",fill:"none","aria-hidden":"true",className:"absolute inset-0 m-auto pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity",children:e.jsx("polyline",{points:"1,5 4.5,8.5 11,1.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-on-surface leading-tight",children:t}),r&&e.jsx("span",{className:"text-xs text-on-surface-variant mt-0.5",children:r})]})]}),s&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1 ml-7",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),s]})]})});D.displayName="Checkbox";const G=d.forwardRef(({label:t,description:r,disabled:s,className:n="",id:a,...o},i)=>{const l=a??`radio-${t==null?void 0:t.toLowerCase().replace(/\s+/g,"-")}`;return e.jsxs("label",{htmlFor:l,className:["flex items-start gap-3 cursor-pointer",s?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsx("input",{ref:i,type:"radio",id:l,disabled:s,className:["mt-0.5 w-4 h-4 border-outline-variant text-zeo-orange shrink-0","focus:ring-2 focus:ring-zeo-orange/30 focus:ring-offset-0","disabled:cursor-not-allowed",n].filter(Boolean).join(" "),...o}),t&&e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-on-surface leading-tight",children:t}),r&&e.jsx("span",{className:"text-xs text-on-surface-variant mt-0.5",children:r})]})]})});G.displayName="Radio";const U=d.forwardRef(({label:t,description:r,disabled:s,className:n="",id:a,...o},i)=>{const l=a??`switch-${t==null?void 0:t.toLowerCase().replace(/\s+/g,"-")}`;return e.jsxs("label",{htmlFor:l,className:["flex items-start gap-3 cursor-pointer select-none",s?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:"relative mt-0.5 shrink-0",children:[e.jsx("input",{ref:i,type:"checkbox",id:l,disabled:s,className:"sr-only peer",...o}),e.jsx("div",{className:"w-10 h-6 bg-surface-container-high rounded-full peer-checked:bg-zeo-orange transition-colors duration-200 peer-focus:ring-2 peer-focus:ring-zeo-orange/30"}),e.jsx("div",{className:"absolute top-1 left-1 w-4 h-4 bg-white rounded-full shadow transition-transform duration-200 peer-checked:translate-x-4"})]}),t&&e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-on-surface leading-tight",children:t}),r&&e.jsx("span",{className:"text-xs text-on-surface-variant mt-0.5",children:r})]})]})});U.displayName="Switch";const Ce={sm:"px-3 py-1.5 text-sm h-8",md:"px-3 py-2 text-sm h-10",lg:"px-4 py-2.5 text-base h-11"},S={sm:"text-[16px]",md:"text-[18px]",lg:"text-[20px]"},V=d.forwardRef(({label:t,hint:r,error:s,inputSize:n="md",iconLeft:a,iconRight:o,onIconRightClick:i,disabled:l,className:f="",id:u,...x},m)=>{const c=u??(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&e.jsx("label",{htmlFor:c,className:"text-sm font-medium text-on-surface",children:t}),e.jsxs("div",{className:"relative flex items-center",children:[a&&e.jsx("span",{className:`material-symbols-outlined absolute left-3 text-on-surface-variant pointer-events-none ${S[n]}`,children:a}),e.jsx("input",{ref:m,id:c,disabled:l,className:["w-full bg-white border rounded transition-all duration-200","text-on-surface placeholder:text-on-surface-variant","focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",s?"border-error focus:border-error focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]":"border-outline-variant","disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",Ce[n],a?"pl-9":"",o?"pr-9":"",f].filter(Boolean).join(" "),...x}),o&&e.jsx("span",{className:["material-symbols-outlined absolute right-3 text-on-surface-variant",S[n],i?"cursor-pointer hover:text-on-surface":"pointer-events-none"].filter(Boolean).join(" "),onClick:i,children:o})]}),s&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),s]}),!s&&r&&e.jsx("p",{className:"text-xs text-on-surface-variant",children:r})]})});V.displayName="Input";const ke={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-2xl",full:"max-w-[calc(100vw-2rem)]"};function Be({open:t,onClose:r,size:s="md",children:n}){return d.useEffect(()=>{if(!t)return;const a=o=>{o.key==="Escape"&&r()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,r]),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","aria-modal":"true",role:"dialog",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:r,"aria-hidden":"true"}),e.jsx("div",{className:["relative w-full bg-white rounded-2xl shadow-theme-lg z-10 flex flex-col max-h-[90vh]",ke[s]].filter(Boolean).join(" "),children:n})]}):null}function ze({title:t,subtitle:r,onClose:s,className:n="",...a}){return e.jsxs("div",{className:["flex items-start justify-between gap-4 p-6 border-b border-surface-container-high",n].filter(Boolean).join(" "),...a,children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-on-surface",children:t}),r&&e.jsx("p",{className:"text-sm text-on-surface-variant mt-0.5",children:r})]}),s&&e.jsx("button",{onClick:s,className:"p-1 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-low rounded-lg transition-all -mt-1 -mr-1","aria-label":"Fechar modal",children:e.jsx("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]})}function Te({children:t,className:r="",...s}){return e.jsx("div",{className:["p-6 overflow-y-auto flex-1",r].filter(Boolean).join(" "),...s,children:t})}function $e({children:t,className:r="",...s}){return e.jsx("div",{className:["flex items-center justify-end gap-3 p-6 border-t border-surface-container-high",r].filter(Boolean).join(" "),...s,children:t})}function _e(t,r){return r<=7?Array.from({length:r},(s,n)=>n+1):t<=4?[1,2,3,4,5,"...",r]:t>=r-3?[1,"...",r-4,r-3,r-2,r-1,r]:[1,"...",t-1,t,t+1,"...",r]}function Ie({currentPage:t,totalPages:r,totalItems:s,itemsPerPage:n=10,onPageChange:a,variant:o="full",className:i="",...l}){const f=_e(t,r),u=(t-1)*n+1,x=Math.min(t*n,s??t*n),m="inline-flex items-center justify-center text-sm font-medium rounded transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-zeo-orange/30 disabled:opacity-40 disabled:cursor-not-allowed select-none",c=`${m} w-9 h-9`,p="bg-zeo-orange text-white",b="text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface",w=`${m} px-3 h-9 gap-1.5 border border-surface-container-high text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface`;return e.jsxs("div",{className:["flex items-center justify-between gap-4 flex-wrap",i].filter(Boolean).join(" "),...l,children:[o==="full"&&s!==void 0&&e.jsxs("p",{className:"text-sm text-on-surface-variant",children:["Mostrando ",e.jsxs("strong",{children:[u,"–",x]})," de ",e.jsx("strong",{children:s})," itens"]}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[e.jsxs("button",{onClick:()=>a(t-1),disabled:t===1,"aria-label":"Página anterior",className:o==="icon"?c+" "+b:w,children:[e.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),o==="text"&&"Anterior"]}),f.map((h,j)=>h==="..."?e.jsx("span",{className:"w-9 text-center text-sm text-on-surface-variant select-none",children:"…"},`ellipsis-${j}`):e.jsx("button",{onClick:()=>a(h),"aria-current":t===h?"page":void 0,className:[c,t===h?p:b].join(" "),children:h},h)),e.jsxs("button",{onClick:()=>a(t+1),disabled:t===r,"aria-label":"Próxima página",className:o==="icon"?c+" "+b:w,children:[o==="text"&&"Próxima",e.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_forward"})]})]})]})}const Le={xs:"h-1",sm:"h-1.5",md:"h-2",lg:"h-3"},Re={primary:"bg-zeo-orange",success:"bg-green-500",warning:"bg-amber-400",danger:"bg-red-500"};function Fe({value:t,max:r=100,size:s="md",variant:n="primary",label:a="none",showPercent:o=!0,title:i,className:l="",...f}){const u=Math.min(100,Math.max(0,t/r*100)),x=`${Math.round(u)}%`;return e.jsxs("div",{className:["flex flex-col gap-1.5",l].filter(Boolean).join(" "),...f,children:[(i||a==="outside"&&o)&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i&&e.jsx("span",{className:"text-sm font-medium text-on-surface",children:i}),a==="outside"&&o&&e.jsx("span",{className:"text-sm font-semibold text-on-surface",children:x})]}),e.jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":r,className:["relative w-full bg-surface-container-high rounded-full overflow-hidden",Le[s]].join(" "),children:e.jsx("div",{className:["h-full rounded-full transition-all duration-500 flex items-center justify-end pr-1",Re[n]].join(" "),style:{width:`${u}%`},children:a==="inside"&&o&&u>=20&&e.jsx("span",{className:"text-[10px] font-bold text-white leading-none",children:x})})})]})}const Ee={xs:"w-3 h-3 border",sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-[3px]",xl:"w-12 h-12 border-4"},Me={primary:"border-orange-200 border-t-zeo-orange",secondary:"border-surface-container-high border-t-on-surface-variant",white:"border-white/30 border-t-white"};function Se({size:t="md",variant:r="primary",label:s="Carregando...",className:n="",...a}){return e.jsx("span",{role:"status","aria-label":s,className:["inline-block rounded-full animate-spin",Ee[t],Me[r],n].filter(Boolean).join(" "),...a})}function Ae({children:t,className:r="",...s}){return e.jsx("div",{className:["overflow-x-auto rounded-xl border border-surface-container-high shadow-sm",r].filter(Boolean).join(" "),...s,children:e.jsx("table",{className:"w-full text-sm",children:t})})}function He({children:t,className:r="",...s}){return e.jsx("thead",{className:["bg-surface-container-low border-b border-surface-container-high",r].filter(Boolean).join(" "),...s,children:t})}function qe({children:t,className:r="",...s}){return e.jsx("tbody",{className:["bg-white divide-y divide-surface-container-high",r].filter(Boolean).join(" "),...s,children:t})}function De({selected:t=!1,children:r,className:s="",...n}){return e.jsx("tr",{className:["hover:bg-surface-container-low transition-colors",t?"bg-orange-50/40":"",s].filter(Boolean).join(" "),...n,children:r})}function Ge({sortable:t=!1,sorted:r=!1,onSort:s,children:n,className:a="",...o}){return e.jsx("th",{className:["px-4 py-3 text-left text-xs font-semibold text-on-surface-variant uppercase tracking-wide whitespace-nowrap",t?"cursor-pointer hover:text-on-surface select-none":"",a].filter(Boolean).join(" "),onClick:t?s:void 0,...o,children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[n,t&&e.jsx("span",{className:`material-symbols-outlined text-[14px] ${r?"text-zeo-orange":"opacity-40"}`,children:r==="asc"?"arrow_upward":r==="desc"?"arrow_downward":"unfold_more"})]})})}function Ue({muted:t=!1,mono:r=!1,children:s,className:n="",...a}){return e.jsx("td",{className:["px-4 py-3",t?"text-on-surface-variant":"text-on-surface",r?"font-mono text-xs":"",n].filter(Boolean).join(" "),...a,children:s})}const W=d.createContext(null);function I(){const t=d.useContext(W);if(!t)throw new Error("Tab must be used inside Tabs");return t}const O=d.createContext({stretch:!1});function Ve({value:t,onChange:r,variant:s="default",children:n}){return e.jsx(W.Provider,{value:{active:t,onChange:r,variant:s},children:e.jsx("div",{className:s==="vertical"?"flex gap-6":"flex flex-col gap-4",children:n})})}function We({children:t,className:r="",stretch:s=!1,...n}){const{variant:a}=I(),o={default:s?"flex gap-1 bg-surface-container-low rounded-lg p-1 w-full":"flex gap-1 bg-surface-container-low rounded-lg p-1 w-fit",underline:"flex gap-0 border-b border-surface-container-high w-full",vertical:"flex flex-col gap-1 bg-surface-container-low rounded-lg p-1 w-48 shrink-0 h-fit"}[a];return e.jsx(O.Provider,{value:{stretch:s},children:e.jsx("div",{role:"tablist",className:[o,r].filter(Boolean).join(" "),...n,children:t})})}function Oe({value:t,label:r,icon:s,badge:n,disabled:a=!1}){const{active:o,onChange:i,variant:l}=I(),{stretch:f}=d.useContext(O),u=o===t,x="inline-flex items-center gap-2 font-medium text-sm transition-all duration-200 select-none focus:outline-none",m="opacity-40 cursor-not-allowed pointer-events-none",c=f&&l!=="vertical"?"flex-1 justify-center":"",p={default:u?"bg-white text-on-surface shadow-sm rounded-md px-4 py-2":"text-on-surface-variant hover:text-on-surface rounded-md px-4 py-2",underline:u?"text-zeo-orange border-b-2 border-zeo-orange px-4 py-2.5 -mb-px":"text-on-surface-variant hover:text-on-surface border-b-2 border-transparent px-4 py-2.5 -mb-px",vertical:u?"bg-white text-on-surface shadow-sm rounded-md px-4 py-2 w-full":"text-on-surface-variant hover:text-on-surface rounded-md px-4 py-2 w-full"}[l];return e.jsxs("button",{role:"tab","aria-selected":u,"aria-disabled":a,disabled:a,onClick:()=>!a&&i(t),className:[x,p,c,a?m:""].filter(Boolean).join(" "),children:[s&&e.jsx("span",{className:"material-symbols-outlined text-[18px]",style:u?{fontVariationSettings:"'FILL' 1"}:void 0,children:s}),r,n!==void 0&&e.jsx("span",{className:`text-[11px] font-semibold px-1.5 py-0.5 rounded-full leading-none ${u?"bg-zeo-orange text-white":"bg-surface-container-high text-on-surface-variant"}`,children:n})]})}function Ke({value:t,children:r,className:s="",stretch:n=!1}){const{active:a}=I();return a!==t?null:e.jsx("div",{role:"tabpanel",className:[n?"flex-1":"",s].filter(Boolean).join(" "),children:r})}const Je={top:{wrapper:"bottom-full left-1/2 -translate-x-1/2 mb-2",arrow:"top-full left-1/2 -translate-x-1/2 border-t-4 border-x-4 border-x-transparent border-b-0"},bottom:{wrapper:"top-full left-1/2 -translate-x-1/2 mt-2",arrow:"bottom-full left-1/2 -translate-x-1/2 border-b-4 border-x-4 border-x-transparent border-t-0"},left:{wrapper:"right-full top-1/2 -translate-y-1/2 mr-2",arrow:"left-full top-1/2 -translate-y-1/2 border-l-4 border-y-4 border-y-transparent border-r-0"},right:{wrapper:"left-full top-1/2 -translate-y-1/2 ml-2",arrow:"right-full top-1/2 -translate-y-1/2 border-r-4 border-y-4 border-y-transparent border-l-0"}},Qe={dark:{tooltip:"bg-slate-800 text-white",arrow:"border-t-slate-800 border-r-slate-800 border-b-slate-800 border-l-slate-800"},light:{tooltip:"bg-white text-on-surface border border-surface-container-high shadow-theme-lg",arrow:"border-t-white border-r-white border-b-white border-l-white"}};function Xe({content:t,position:r="top",variant:s="dark",children:n,className:a="",...o}){const i=Je[r],l=Qe[s];return e.jsxs("div",{className:["relative inline-flex group",a].filter(Boolean).join(" "),...o,children:[n,e.jsxs("div",{role:"tooltip",className:["absolute z-50 pointer-events-none","opacity-0 group-hover:opacity-100 transition-opacity duration-150","whitespace-nowrap text-xs font-medium px-2.5 py-1.5 rounded-lg",i.wrapper,l.tooltip].join(" "),children:[t,e.jsx("span",{className:["absolute w-0 h-0",i.arrow,l.arrow].join(" ")})]})]})}const Ye={sm:"px-3 py-1.5 text-sm h-8",md:"px-3 py-2 text-sm h-10",lg:"px-4 py-2.5 text-base h-11"};function Ze(t,r,s){if(t===""||t===void 0||t===null)return"";const n=Number(t).toFixed(r);return s?`${n} ${s}`:n}const K=d.forwardRef(({label:t,hint:r,error:s,unit:n="",decimals:a=0,value:o,defaultValue:i,onChange:l,disabled:f,placeholder:u,inputSize:x="md",id:m,name:c,min:p,max:b,step:w,required:h,className:j=""},g)=>{const L=d.useId(),C=m??L,y=o!==void 0,[z,T]=d.useState(i!==void 0?i:""),[N,R]=d.useState(!1),[$,F]=d.useState(""),J=d.useRef(null),k=y?o:z,Q=N?$:Ze(k,a,n),X=d.useCallback(()=>{R(!0),F(k===""?"":String(k))},[k]),Y=d.useCallback(()=>{R(!1);const v=parseFloat($.replace(",",".")),E=isNaN(v)?"":v;y||T(E),l==null||l(E)},[$,y,l]),Z=d.useCallback(v=>{F(v.target.value)},[]),P=d.useCallback(v=>{J.current=v,typeof g=="function"?g(v):g&&(g.current=v)},[g]);return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&e.jsx("label",{htmlFor:C,className:"text-sm font-medium text-on-surface",children:t}),e.jsx("input",{ref:P,id:C,name:c,type:N?"number":"text",inputMode:"decimal",value:Q,placeholder:u,disabled:f,required:h,min:p,max:b,step:w??(a>0?Math.pow(10,-a):1),onFocus:X,onBlur:Y,onChange:Z,className:["w-full bg-white border rounded transition-all duration-200","text-on-surface placeholder:text-on-surface-variant","focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",s?"border-error focus:border-error focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]":"border-outline-variant","disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",Ye[x],j].filter(Boolean).join(" ")}),s&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),s]}),!s&&r&&e.jsx("p",{className:"text-xs text-on-surface-variant",children:r})]})});K.displayName="UnitInput";exports.Alert=re;exports.Avatar=ie;exports.Badge=xe;exports.Breadcrumb=fe;exports.Button=A;exports.ButtonGroup=be;exports.Card=we;exports.CardFooter=ve;exports.CardHeader=je;exports.Checkbox=D;exports.Dropdown=ye;exports.Input=V;exports.Modal=Be;exports.ModalBody=Te;exports.ModalFooter=$e;exports.ModalHeader=ze;exports.Pagination=Ie;exports.ProgressBar=Fe;exports.Radio=G;exports.Select=H;exports.Spinner=Se;exports.Switch=U;exports.Tab=Oe;exports.TabList=We;exports.TabPanel=Ke;exports.Table=Ae;exports.TableBody=qe;exports.TableCell=Ue;exports.TableHead=He;exports.TableHeaderCell=Ge;exports.TableRow=De;exports.Tabs=Ve;exports.Textarea=q;exports.Tooltip=Xe;exports.UnitInput=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),he=require("react-dom"),be={info:{container:"bg-blue-50 border-blue-200 text-blue-800",icon:"text-blue-500",defaultIcon:"info"},success:{container:"bg-green-50 border-green-200 text-green-800",icon:"text-green-500",defaultIcon:"check_circle"},warning:{container:"bg-yellow-50 border-yellow-200 text-yellow-800",icon:"text-yellow-500",defaultIcon:"warning"},danger:{container:"bg-red-50 border-red-200 text-red-800",icon:"text-red-500",defaultIcon:"error"}};function ge({variant:t="info",title:s,children:n,onClose:r,icon:a,className:o="",...l}){const i=be[t],c=a??i.defaultIcon;return e.jsxs("div",{role:"alert",className:["flex gap-3 p-4 rounded-lg border",i.container,o].filter(Boolean).join(" "),...l,children:[e.jsx("span",{className:`material-symbols-outlined text-[20px] shrink-0 mt-0.5 ${i.icon}`,children:c}),e.jsxs("div",{className:"flex-1 min-w-0",children:[s&&e.jsx("p",{className:"font-semibold text-sm mb-0.5",children:s}),e.jsx("div",{className:"text-sm leading-relaxed",children:n})]}),r&&e.jsx("button",{onClick:r,className:"shrink-0 opacity-70 hover:opacity-100 transition-opacity","aria-label":"Fechar alerta",children:e.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]})}const je={xs:"w-6 h-6 text-[10px]",sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base",xl:"w-16 h-16 text-lg"},ve={xs:"w-1.5 h-1.5",sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3",xl:"w-3.5 h-3.5"},we={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-yellow-400"};function ye(t){return t.split(" ").slice(0,2).map(s=>s[0]).join("").toUpperCase()}function Ne(t){const s=["bg-orange-100 text-orange-700","bg-blue-100 text-blue-700","bg-green-100 text-green-700","bg-purple-100 text-purple-700","bg-pink-100 text-pink-700","bg-teal-100 text-teal-700"],n=t.charCodeAt(0)%s.length;return s[n]}function E({src:t,alt:s="",name:n,size:r="md",status:a,className:o="",...l}){return e.jsxs("div",{className:["relative inline-flex shrink-0",o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:["rounded-full overflow-hidden flex items-center justify-center font-semibold",je[r],!t&&n?Ne(n):"bg-surface-container"].filter(Boolean).join(" "),children:t?e.jsx("img",{src:t,alt:s||n,className:"w-full h-full object-cover"}):n?ye(n):e.jsx("span",{className:"material-symbols-outlined text-on-surface-variant",style:{fontSize:"60%"},children:"person"})}),a&&e.jsx("span",{className:["absolute bottom-0 right-0 rounded-full border-2 border-white",ve[r],we[a]].filter(Boolean).join(" ")})]})}const ke={default:"bg-surface-container text-on-surface-variant",primary:"bg-orange-100 text-orange-700",success:"bg-green-100 text-green-700",warning:"bg-yellow-100 text-yellow-700",danger:"bg-red-100 text-red-700",info:"bg-blue-100 text-blue-700"},Ce={default:"bg-on-surface-variant",primary:"bg-orange-500",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},Be={sm:"px-2 py-0.5 text-xs gap-1",md:"px-2.5 py-1 text-xs gap-1.5"};function Le({variant:t="default",size:s="md",dot:n=!1,icon:r,children:a,className:o="",...l}){return e.jsxs("span",{className:["inline-flex items-center font-medium rounded-full",ke[t],Be[s],o].filter(Boolean).join(" "),...l,children:[n&&e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${Ce[t]}`}),r&&!n&&e.jsx("span",{className:"material-symbols-outlined text-[12px]",children:r}),a]})}function ze({items:t,className:s="",...n}){return e.jsx("nav",{"aria-label":"Breadcrumb",className:s,...n,children:e.jsx("ol",{className:"inline-flex items-center gap-1.5 text-sm flex-wrap",children:t.map((r,a)=>{const o=a===t.length-1;return e.jsxs("li",{className:"flex items-center gap-1.5",children:[a>0&&e.jsx("span",{className:"material-symbols-outlined text-[16px] text-on-surface-variant select-none",children:"chevron_right"}),o?e.jsxs("span",{"aria-current":"page",className:"font-semibold text-on-surface flex items-center gap-1",children:[r.icon&&e.jsx("span",{className:"material-symbols-outlined text-[18px] leading-none",children:r.icon}),r.label]}):e.jsxs("a",{href:r.href??"#",className:"text-on-surface-variant hover:text-zeo-orange transition-colors flex items-center gap-1",children:[r.icon&&e.jsx("span",{className:"material-symbols-outlined text-[18px] leading-none",children:r.icon}),r.label]})]},a)})})})}const Me={primary:"bg-zeo-orange text-white hover:bg-orange-700 active:bg-orange-800 focus:shadow-zeo-focus border-transparent",secondary:"bg-white text-on-surface border-outline-variant hover:bg-surface-container-low active:bg-surface-container focus:shadow-zeo-focus",ghost:"bg-transparent text-on-surface-variant border-transparent hover:bg-surface-container-low active:bg-surface-container focus:shadow-zeo-focus",danger:"bg-error text-on-error border-transparent hover:bg-red-700 active:bg-red-800 focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]",success:"bg-tertiary text-on-tertiary border-transparent hover:bg-green-800 active:bg-green-900 focus:shadow-[0_0_0_4px_rgba(0,108,73,0.15)]"},_e={sm:"px-3 py-1.5 text-sm gap-1.5 h-8",md:"px-4 py-2 text-sm gap-2 h-10",lg:"px-5 py-2.5 text-base gap-2 h-11"},R={sm:"text-[16px]",md:"text-[18px]",lg:"text-[20px]"},J=u.forwardRef(({variant:t="primary",size:s="md",loading:n=!1,iconLeft:r,iconRight:a,fullWidth:o=!1,disabled:l,children:i,className:c="",...x},f)=>{const m=l||n;return e.jsxs("button",{ref:f,disabled:m,className:["inline-flex items-center justify-center font-medium rounded border transition-all duration-200 select-none","focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed",Me[t],_e[s],o?"w-full":"",c].filter(Boolean).join(" "),...x,children:[n?e.jsx("span",{className:`material-symbols-outlined animate-spin ${R[s]}`,children:"progress_activity"}):r&&e.jsx("span",{className:`material-symbols-outlined ${R[s]}`,children:r}),i,!n&&a&&e.jsx("span",{className:`material-symbols-outlined ${R[s]}`,children:a})]})});J.displayName="Button";function Ie({children:t,attached:s=!1,className:n="",...r}){return e.jsx("div",{role:"group",className:["inline-flex",s?"[&>button]:rounded-none [&>button:first-child]:rounded-l [&>button:last-child]:rounded-r [&>button:not(:first-child)]:-ml-px":"gap-2",n].filter(Boolean).join(" "),...r,children:t})}const Ae={elevated:"bg-white shadow-theme-lg border border-surface-container-high",outlined:"bg-white border border-outline-variant",filled:"bg-surface-container-low border border-transparent"},Se={none:"",sm:"p-4",md:"p-5",lg:"p-6"};function Te({variant:t="elevated",padding:s="md",children:n,className:r="",...a}){return e.jsx("div",{className:["rounded-xl overflow-hidden",Ae[t],r].filter(Boolean).join(" "),...a,children:e.jsx("div",{className:Se[s],children:n})})}function $e({title:t,subtitle:s,action:n,icon:r,className:a="",...o}){return e.jsxs("div",{className:["flex items-start justify-between gap-4 pb-4",a].filter(Boolean).join(" "),...o,children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[r&&e.jsx("span",{className:"material-symbols-outlined text-on-surface-variant text-[24px] shrink-0",children:r}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold text-on-surface truncate",children:t}),s&&e.jsx("p",{className:"text-sm text-on-surface-variant mt-0.5",children:s})]})]}),n&&e.jsx("div",{className:"shrink-0",children:n})]})}function Re({children:t,className:s="",...n}){return e.jsx("div",{className:["flex items-center justify-end gap-3 pt-4 border-t border-surface-container-high",s].filter(Boolean).join(" "),...n,children:t})}const z=8,O=4;function Ee({trigger:t,items:s,align:n="right",className:r="",...a}){const[o,l]=u.useState(!1),[i,c]=u.useState(null),x=u.useRef(null),f=u.useRef(null),m=u.useCallback(()=>{var B;const d=x.current;if(!d)return;const p=d.getBoundingClientRect(),h=(B=f.current)==null?void 0:B.getBoundingClientRect(),j=(h==null?void 0:h.width)??180,b=(h==null?void 0:h.height)??0,v=window.innerHeight-p.bottom,w=p.top,N=v<b+z&&w>v?p.top-b-O:p.bottom+O,_=n==="right"?p.right-j:p.left,I=window.innerWidth-j-z,A=Math.min(Math.max(_,z),Math.max(I,z));c({top:N,left:A})},[n]);return u.useLayoutEffect(()=>{o&&m()},[o,m]),u.useEffect(()=>{if(!o)return;const d=()=>m();return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[o,m]),u.useEffect(()=>{const d=p=>{var v,w;const h=p.target,j=(v=x.current)==null?void 0:v.contains(h),b=(w=f.current)==null?void 0:w.contains(h);!j&&!b&&l(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),u.useEffect(()=>{const d=p=>{p.key==="Escape"&&l(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),e.jsxs("div",{ref:x,className:["relative inline-block",r].filter(Boolean).join(" "),...a,children:[e.jsx("div",{onClick:()=>l(d=>!d),children:t}),o&&he.createPortal(e.jsx("div",{ref:f,className:"fixed z-[100] min-w-[180px] bg-white border border-surface-container-high rounded-xl shadow-theme-lg py-1",style:{top:(i==null?void 0:i.top)??0,left:(i==null?void 0:i.left)??0,visibility:i?"visible":"hidden"},role:"menu",children:s.map((d,p)=>e.jsxs("div",{children:[e.jsxs("button",{role:"menuitem",disabled:d.disabled,onClick:()=>{var h;d.disabled||((h=d.onClick)==null||h.call(d),l(!1))},className:["w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors text-left",d.danger?"text-error hover:bg-red-50":"text-on-surface hover:bg-surface-container-low",d.disabled?"opacity-40 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" "),children:[d.icon&&e.jsx("span",{className:"material-symbols-outlined text-[18px] opacity-70",children:d.icon}),d.label]}),d.dividerAfter&&e.jsx("div",{className:"my-1 border-t border-surface-container-high"})]},p))}),document.body)]})}const P=u.forwardRef(({label:t,hint:s,error:n,options:r,placeholder:a,disabled:o,className:l="",id:i,...c},x)=>{const f=i??(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&e.jsx("label",{htmlFor:f,className:"text-sm font-medium text-on-surface",children:t}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{ref:x,id:f,disabled:o,className:["w-full appearance-none bg-white border rounded px-3 py-2 text-sm pr-9 transition-all duration-200","text-on-surface focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",n?"border-error":"border-outline-variant","disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",l].filter(Boolean).join(" "),...c,children:[a&&e.jsx("option",{value:"",disabled:!0,children:a}),r.map(m=>e.jsx("option",{value:m.value,disabled:m.disabled,children:m.label},m.value))]}),e.jsx("span",{className:"material-symbols-outlined absolute right-3 top-1/2 -translate-y-1/2 text-[18px] text-on-surface-variant pointer-events-none",children:"expand_more"})]}),n&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]}),!n&&s&&e.jsx("p",{className:"text-xs text-on-surface-variant",children:s})]})});P.displayName="Select";const X=u.forwardRef(({label:t,hint:s,error:n,disabled:r,className:a="",id:o,rows:l=4,...i},c)=>{const x=o??(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&e.jsx("label",{htmlFor:x,className:"text-sm font-medium text-on-surface",children:t}),e.jsx("textarea",{ref:c,id:x,rows:l,disabled:r,className:["w-full bg-white border rounded px-3 py-2 text-sm resize-y transition-all duration-200","text-on-surface placeholder:text-on-surface-variant","focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",n?"border-error":"border-outline-variant","disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",a].filter(Boolean).join(" "),...i}),n&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]}),!n&&s&&e.jsx("p",{className:"text-xs text-on-surface-variant",children:s})]})});X.displayName="Textarea";const Fe={square:"rounded-[2px]",rounded:"rounded-[4px]",circle:"rounded-full"},Y=u.forwardRef(({label:t,description:s,error:n,disabled:r,className:a="",id:o,shape:l="square",color:i="#FF6B00",...c},x)=>{const f=o??`checkbox-${t==null?void 0:t.toLowerCase().replace(/\s+/g,"-")}`;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("label",{htmlFor:f,className:["flex items-start gap-3 cursor-pointer",r?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:"relative mt-0.5 shrink-0 w-4 h-4",children:[e.jsx("input",{ref:x,type:"checkbox",id:f,disabled:r,className:["absolute inset-0 w-full h-full opacity-0 cursor-pointer peer disabled:cursor-not-allowed",a].filter(Boolean).join(" "),...c}),e.jsx("div",{className:["w-4 h-4 border-2 border-outline-variant transition-colors pointer-events-none","bg-white peer-checked:bg-[var(--cb-color)] peer-checked:border-[var(--cb-color)]","peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--cb-color)]/30 peer-focus-visible:ring-offset-0",Fe[l]].filter(Boolean).join(" "),style:{"--cb-color":i}}),e.jsx("svg",{viewBox:"0 0 12 10",width:"10",height:"8",fill:"none","aria-hidden":"true",className:"absolute inset-0 m-auto pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity",children:e.jsx("polyline",{points:"1,5 4.5,8.5 11,1.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-on-surface leading-tight",children:t}),s&&e.jsx("span",{className:"text-xs text-on-surface-variant mt-0.5",children:s})]})]}),n&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1 ml-7",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]})]})});Y.displayName="Checkbox";const ee=u.forwardRef(({label:t,description:s,disabled:n,className:r="",id:a,...o},l)=>{const i=a??`radio-${t==null?void 0:t.toLowerCase().replace(/\s+/g,"-")}`;return e.jsxs("label",{htmlFor:i,className:["flex items-start gap-3 cursor-pointer",n?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsx("input",{ref:l,type:"radio",id:i,disabled:n,className:["mt-0.5 w-4 h-4 border-outline-variant text-zeo-orange shrink-0","focus:ring-2 focus:ring-zeo-orange/30 focus:ring-offset-0","disabled:cursor-not-allowed",r].filter(Boolean).join(" "),...o}),t&&e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-on-surface leading-tight",children:t}),s&&e.jsx("span",{className:"text-xs text-on-surface-variant mt-0.5",children:s})]})]})});ee.displayName="Radio";const te=u.forwardRef(({label:t,description:s,disabled:n,className:r="",id:a,...o},l)=>{const i=a??`switch-${t==null?void 0:t.toLowerCase().replace(/\s+/g,"-")}`;return e.jsxs("label",{htmlFor:i,className:["flex items-start gap-3 cursor-pointer select-none",n?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:"relative mt-0.5 shrink-0",children:[e.jsx("input",{ref:l,type:"checkbox",id:i,disabled:n,className:"sr-only peer",...o}),e.jsx("div",{className:"w-10 h-6 bg-surface-container-high rounded-full peer-checked:bg-zeo-orange transition-colors duration-200 peer-focus:ring-2 peer-focus:ring-zeo-orange/30"}),e.jsx("div",{className:"absolute top-1 left-1 w-4 h-4 bg-white rounded-full shadow transition-transform duration-200 peer-checked:translate-x-4"})]}),t&&e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-on-surface leading-tight",children:t}),s&&e.jsx("span",{className:"text-xs text-on-surface-variant mt-0.5",children:s})]})]})});te.displayName="Switch";function y({name:t,size:s=20,fill:n=!1,className:r="",style:a,...o}){return e.jsx("span",{...o,className:`material-symbols-outlined leading-none select-none ${r}`.trim(),style:{fontSize:s,fontVariationSettings:`'FILL' ${n?1:0}, 'wght' 300, 'GRAD' 0, 'opsz' 24`,...a},"aria-hidden":"true",children:t})}const se=({size:t=24,className:s})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:4,className:s,"aria-hidden":"true",children:[e.jsx("path",{d:"M15 65 L40 50 H85 L60 65 Z"}),e.jsx("path",{d:"M15 65 V72 L60 72 V65"}),e.jsx("path",{d:"M60 72 L85 57 V50"}),e.jsx("path",{d:"M25 60 V35 H32 V56"}),e.jsx("path",{d:"M42 45 V20 H49 V41"}),e.jsx("path",{d:"M55 60 V35 H62 V56"}),e.jsx("path",{d:"M72 45 V20 H79 V41"})]}),ne=({size:t=24,className:s})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:4,className:s,"aria-hidden":"true",children:[e.jsx("ellipse",{cx:"50",cy:"20",rx:"12",ry:"6"}),e.jsx("path",{d:"M38 20 V65 M62 20 V65"}),e.jsx("path",{d:"M50 25 V58"}),e.jsx("path",{d:"M38 65 L25 75 V85 L50 90 L75 85 V75 L62 65 Z"}),e.jsx("path",{d:"M50 75 V90"})]}),re=({size:t=24,className:s})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",className:s,"aria-hidden":"true",children:[e.jsx("path",{d:"M48 90 L45 25 L55 25 L52 90 Z",fill:"currentColor",stroke:"none"}),e.jsx("circle",{cx:"50",cy:"20",r:"5",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M38 30 A20 20 0 0 0 38 10",stroke:"currentColor",strokeWidth:3}),e.jsx("path",{d:"M30 35 A28 28 0 0 0 30 5",stroke:"currentColor",strokeWidth:3}),e.jsx("path",{d:"M62 30 A20 20 0 0 1 62 10",stroke:"currentColor",strokeWidth:3}),e.jsx("path",{d:"M70 35 A28 28 0 0 1 70 5",stroke:"currentColor",strokeWidth:3})]}),Ve={sm:"px-3 py-1.5 text-sm h-8",md:"px-3 py-2 text-sm h-10",lg:"px-4 py-2.5 text-base h-11"},Z={sm:"text-[16px]",md:"text-[18px]",lg:"text-[20px]"};function He(t,s,n){if(t===""||t===void 0||t===null)return"";const r=Number(t).toFixed(s);return n?`${r} ${n}`:r}const ae=u.forwardRef(({label:t,hint:s,error:n,inputSize:r="md",iconLeft:a,iconRight:o,onIconRightClick:l,disabled:i,className:c="",id:x,unit:f,decimals:m,onValueChange:d,value:p,defaultValue:h,type:j,step:b,inputMode:v,onChange:w,onFocus:C,onBlur:N,..._},I)=>{const A=u.useId(),B=x??(t?t.toLowerCase().replace(/\s+/g,"-"):A),g=f!==void 0,S=m??0,T=g&&p!==void 0,[de,ue]=u.useState(typeof h=="number"?h:""),[K,U]=u.useState(!1),[$,W]=u.useState(""),L=T?p:de,xe=g?K?$:He(L,S,f??""):p,fe=u.useCallback(k=>{g&&(U(!0),W(L===""?"":String(L))),C==null||C(k)},[g,L,C]),me=u.useCallback(k=>{if(g){U(!1);const q=parseFloat($.replace(",",".")),G=isNaN(q)?"":q;T||ue(G),d==null||d(G)}N==null||N(k)},[g,$,T,d,N]),pe=u.useCallback(k=>{g&&W(k.target.value),w==null||w(k)},[g,w]);return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&e.jsx("label",{htmlFor:B,className:"text-sm font-medium text-on-surface",children:t}),e.jsxs("div",{className:"relative flex items-center",children:[a&&e.jsx("span",{className:`material-symbols-outlined absolute left-3 text-on-surface-variant pointer-events-none ${Z[r]}`,children:a}),e.jsx("input",{ref:I,id:B,disabled:i,type:g?K?"number":"text":j,inputMode:g?"decimal":v,value:g?xe:p,defaultValue:g?void 0:h,step:g?b??(S>0?Math.pow(10,-S):1):b,onFocus:fe,onBlur:me,onChange:pe,className:["w-full bg-white border rounded transition-all duration-200","text-on-surface placeholder:text-on-surface-variant","focus:outline-none focus:border-zeo-orange focus:shadow-zeo-focus",n?"border-error focus:border-error focus:shadow-[0_0_0_4px_rgba(186,26,26,0.15)]":"border-outline-variant","disabled:bg-surface-container-low disabled:cursor-not-allowed disabled:opacity-60",g?"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none":"",Ve[r],a?"pl-9":"",o?"pr-9":"",c].filter(Boolean).join(" "),..._}),o&&e.jsx("span",{className:["material-symbols-outlined absolute right-3 text-on-surface-variant",Z[r],l?"cursor-pointer hover:text-on-surface":"pointer-events-none"].filter(Boolean).join(" "),onClick:l,children:o})]}),n&&e.jsxs("p",{className:"text-xs text-error flex items-center gap-1",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]}),!n&&s&&e.jsx("p",{className:"text-xs text-on-surface-variant",children:s})]})});ae.displayName="Input";const De={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-2xl",full:"max-w-[calc(100vw-2rem)]"};function Ke({open:t,onClose:s,size:n="md",children:r}){return u.useEffect(()=>{if(!t)return;const a=o=>{o.key==="Escape"&&s()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,s]),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","aria-modal":"true",role:"dialog",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:s,"aria-hidden":"true"}),e.jsx("div",{className:["relative w-full bg-white rounded-2xl shadow-theme-lg z-10 flex flex-col max-h-[90vh]",De[n]].filter(Boolean).join(" "),children:r})]}):null}function Ue({title:t,subtitle:s,onClose:n,className:r="",...a}){return e.jsxs("div",{className:["flex items-start justify-between gap-4 p-6 border-b border-surface-container-high",r].filter(Boolean).join(" "),...a,children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-on-surface",children:t}),s&&e.jsx("p",{className:"text-sm text-on-surface-variant mt-0.5",children:s})]}),n&&e.jsx("button",{onClick:n,className:"p-1 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-low rounded-lg transition-all -mt-1 -mr-1","aria-label":"Fechar modal",children:e.jsx("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]})}function We({children:t,className:s="",...n}){return e.jsx("div",{className:["p-6 overflow-y-auto flex-1",s].filter(Boolean).join(" "),...n,children:t})}function qe({children:t,className:s="",...n}){return e.jsx("div",{className:["flex items-center justify-end gap-3 p-6 border-t border-surface-container-high",s].filter(Boolean).join(" "),...n,children:t})}function Ge(t,s){return s<=7?Array.from({length:s},(n,r)=>r+1):t<=4?[1,2,3,4,5,"...",s]:t>=s-3?[1,"...",s-4,s-3,s-2,s-1,s]:[1,"...",t-1,t,t+1,"...",s]}function Oe({currentPage:t,totalPages:s,totalItems:n,itemsPerPage:r=10,onPageChange:a,variant:o="full",className:l="",...i}){const c=Ge(t,s),x=(t-1)*r+1,f=Math.min(t*r,n??t*r),m="inline-flex items-center justify-center text-sm font-medium rounded transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-zeo-orange/30 disabled:opacity-40 disabled:cursor-not-allowed select-none",d=`${m} w-9 h-9`,p="bg-zeo-orange text-white",h="text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface",j=`${m} px-3 h-9 gap-1.5 border border-surface-container-high text-on-surface-variant hover:bg-surface-container-low hover:text-on-surface`;return e.jsxs("div",{className:["flex items-center justify-between gap-4 flex-wrap",l].filter(Boolean).join(" "),...i,children:[o==="full"&&n!==void 0&&e.jsxs("p",{className:"text-sm text-on-surface-variant",children:["Mostrando ",e.jsxs("strong",{children:[x,"–",f]})," de ",e.jsx("strong",{children:n})," itens"]}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[e.jsxs("button",{onClick:()=>a(t-1),disabled:t===1,"aria-label":"Página anterior",className:o==="icon"?d+" "+h:j,children:[e.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),o==="text"&&"Anterior"]}),c.map((b,v)=>b==="..."?e.jsx("span",{className:"w-9 text-center text-sm text-on-surface-variant select-none",children:"…"},`ellipsis-${v}`):e.jsx("button",{onClick:()=>a(b),"aria-current":t===b?"page":void 0,className:[d,t===b?p:h].join(" "),children:b},b)),e.jsxs("button",{onClick:()=>a(t+1),disabled:t===s,"aria-label":"Próxima página",className:o==="icon"?d+" "+h:j,children:[o==="text"&&"Próxima",e.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_forward"})]})]})]})}const Ze={xs:"h-1",sm:"h-1.5",md:"h-2",lg:"h-3"},Qe={primary:"bg-zeo-orange",success:"bg-green-500",warning:"bg-amber-400",danger:"bg-red-500"};function Je({value:t,max:s=100,size:n="md",variant:r="primary",label:a="none",showPercent:o=!0,title:l,className:i="",...c}){const x=Math.min(100,Math.max(0,t/s*100)),f=`${Math.round(x)}%`;return e.jsxs("div",{className:["flex flex-col gap-1.5",i].filter(Boolean).join(" "),...c,children:[(l||a==="outside"&&o)&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l&&e.jsx("span",{className:"text-sm font-medium text-on-surface",children:l}),a==="outside"&&o&&e.jsx("span",{className:"text-sm font-semibold text-on-surface",children:f})]}),e.jsx("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":s,className:["relative w-full bg-surface-container-high rounded-full overflow-hidden",Ze[n]].join(" "),children:e.jsx("div",{className:["h-full rounded-full transition-all duration-500 flex items-center justify-end pr-1",Qe[r]].join(" "),style:{width:`${x}%`},children:a==="inside"&&o&&x>=20&&e.jsx("span",{className:"text-[10px] font-bold text-white leading-none",children:f})})})]})}const Q=(t,s)=>typeof t=="function"?t(s):t;function Pe({sidebar:t,navbar:s,children:n,defaultExpanded:r=!1,isExpanded:a,onToggle:o}){const[l,i]=u.useState(r),c=a??l,x=u.useCallback(()=>{a===void 0&&i(m=>!m),o==null||o()},[a,o]),f={isExpanded:c,toggle:x};return e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[Q(t,f),e.jsxs("div",{className:["flex-1 flex flex-col overflow-hidden transition-[margin-left] duration-shell ease-shell",c?"ml-sidebar-expanded":"ml-sidebar-collapsed"].join(" "),children:[Q(s,f),e.jsx("main",{className:"flex-1 overflow-y-auto bg-surface-container",children:n})]})]})}const Xe=({href:t,className:s,children:n})=>e.jsx("a",{href:t,className:s,children:n}),oe="text-[10px] uppercase tracking-widest text-white/30 font-bold";function F({item:t,isActive:s,isExpanded:n,renderLink:r=Xe}){const a=t.disabled||!t.href,o=!n||a&&t.disabledReason,l=e.jsxs("div",{className:["group relative flex items-center gap-3 px-4 py-3 rounded-lg transition-colors duration-150",s?"bg-primary-container/10 text-primary-container border-r-2 border-primary-container":a?"text-white/30 opacity-50 cursor-default":"text-white/55 hover:bg-sidebar-hover hover:text-white cursor-pointer"].join(" "),children:[t.icon,e.jsx("span",{className:["text-sm font-medium whitespace-nowrap overflow-hidden transition-opacity duration-shell",n?"opacity-100":"opacity-0 w-0"].join(" "),children:t.label}),e.jsxs("div",{role:"tooltip",className:["absolute left-full ml-3 px-3 py-2 bg-white text-gray-700 text-sm font-medium","rounded-lg shadow-theme-lg whitespace-nowrap z-[200] pointer-events-none","invisible opacity-0 transition-all duration-150",o&&"group-hover:visible group-hover:opacity-100"].filter(Boolean).join(" "),children:[a&&t.disabledReason?t.disabledReason:t.label,e.jsx("div",{className:"absolute top-1/2 -left-1 -translate-y-1/2 w-2 h-2 bg-white rotate-45"})]})]});return a?e.jsx("div",{children:l}):r({item:t,href:t.href,className:"block no-underline",children:l})}function le({section:t,index:s=0,activeId:n,isExpanded:r,renderLink:a}){return e.jsxs(e.Fragment,{children:[t.label&&e.jsx("div",{className:["overflow-hidden transition-all duration-shell px-3",r?"h-6 opacity-100 mb-1":"h-0 opacity-0",s>0?"mt-4":""].join(" "),children:e.jsx("span",{className:oe,children:t.label})}),t.items.map(o=>e.jsx(F,{item:o,isActive:o.id===n,isExpanded:r,renderLink:a},o.id))]})}function Ye({sections:t,activeId:s,isExpanded:n,logo:r,renderLink:a}){const o=t.filter(c=>c.placement!=="bottom"),l=t.filter(c=>c.placement==="bottom"),i=e.jsx("img",{src:r.src,alt:r.alt??"",className:["flex-shrink-0",n?"h-8 w-auto object-contain":"w-10 h-10 object-cover object-left"].join(" ")});return e.jsxs("aside",{className:["fixed left-0 top-0 h-screen bg-sidebar flex flex-col z-[100]","transition-[width] duration-shell ease-shell","shadow-[40px_0_40px_0_rgba(0,0,0,0.04)]",n?"w-sidebar-expanded":"w-sidebar-collapsed"].join(" "),children:[e.jsx("div",{className:["h-[88px] flex items-center flex-shrink-0",n?"px-6 justify-start":"justify-center"].join(" "),children:r.href?e.jsx("a",{href:r.href,"aria-label":r.alt,className:"flex-shrink-0",children:i}):i}),e.jsx("nav",{className:"flex-1 flex flex-col py-2 px-3 gap-1",children:o.map((c,x)=>e.jsx(le,{section:c,index:x,activeId:s,isExpanded:n,renderLink:a},c.id))}),l.map(c=>e.jsxs("div",{className:"flex-shrink-0 pb-4",children:[c.label&&e.jsx("div",{className:["px-6 mb-2 overflow-hidden transition-all duration-shell",n?"h-7 opacity-100":"h-0 opacity-0"].join(" "),children:e.jsx("span",{className:oe,children:c.label})}),e.jsx("div",{className:"border-t border-white/[0.06] mb-2"}),e.jsx("div",{className:"px-3",children:c.items.map(x=>e.jsx(F,{item:x,isActive:x.id===s,isExpanded:n,renderLink:a},x.id))})]},c.id))]})}function et({onToggleMenu:t,start:s,search:n,actions:r,userMenu:a,toggleMenuLabel:o="Alternar menu"}){return e.jsxs("header",{className:"h-navbar bg-surface-container-lowest border-b border-surface-container-highest flex items-center justify-between px-6 sticky top-0 z-50 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:[e.jsx("button",{type:"button",onClick:t,"aria-label":o,className:"flex items-center justify-center p-2 rounded-full text-on-secondary-container hover:bg-surface-container-high transition-colors flex-shrink-0",children:e.jsx(y,{name:"menu",size:20})}),s,n]}),(r||a)&&e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-4",children:[r,r&&a&&e.jsx("div",{className:"w-px h-6 bg-outline-variant opacity-30 mx-2 flex-shrink-0"}),a]})]})}function tt({module:t,project:s}){return e.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[e.jsx("span",{className:"text-title-md font-bold text-on-surface whitespace-nowrap",children:t}),s&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-on-surface-variant","aria-hidden":"true",children:"/"}),e.jsx("span",{className:"text-body-md text-on-surface-variant truncate",children:s})]})]})}function st({value:t,onChange:s,placeholder:n,shortcutHint:r,focusShortcut:a=!1}){const o=u.useRef(null);return u.useEffect(()=>{if(!a)return;const l=i=>{var c;(i.metaKey||i.ctrlKey)&&i.key==="k"&&(i.preventDefault(),(c=o.current)==null||c.focus())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a]),e.jsxs("div",{className:"relative w-full max-w-md",children:[e.jsx(y,{name:"search",size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-on-secondary-container pointer-events-none"}),e.jsx("input",{ref:o,value:t,onChange:l=>s(l.target.value),placeholder:n,"aria-label":n,className:["w-full h-9 pl-10 rounded-lg",r?"pr-[90px]":"pr-3","border border-transparent bg-surface-container","text-sm text-on-surface font-sans placeholder:text-on-surface-variant","outline-none transition-all","focus:border-primary-container focus:shadow-zeo-focus focus:bg-surface-container-lowest"].join(" ")}),r&&e.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-on-surface-variant bg-surface-container-lowest border border-surface-container-highest rounded px-1 py-px whitespace-nowrap pointer-events-none",children:r})]})}function V({icon:t,label:s,badge:n=!1,className:r="",type:a="button",...o}){return e.jsxs("button",{...o,type:a,"aria-label":s,className:`relative flex items-center justify-center p-2 rounded-full text-on-secondary-container hover:bg-surface-container-high transition-colors ${r}`.trim(),children:[t,n&&e.jsx("span",{className:"absolute top-2 right-2 w-2 h-2 bg-error rounded-full"})]})}function nt({hasUnread:t=!1,count:s=0,onClick:n,label:r="Notificações"}){return e.jsx(V,{icon:e.jsx(y,{name:"notifications",size:20}),label:r,badge:t||s>0,onClick:n})}function H(t,s,n){u.useEffect(()=>{if(!s)return;const r=o=>{o.key==="Escape"&&n()},a=o=>{var l;(l=t.current)!=null&&l.contains(o.target)||n()};return document.addEventListener("keydown",r),document.addEventListener("mousedown",a),()=>{document.removeEventListener("keydown",r),document.removeEventListener("mousedown",a)}},[t,s,n])}const rt={myAccount:"Minha Conta",logout:"Sair",user:"Usuário"};function at({name:t,email:s,shortName:n,profilePicUrl:r,onMyAccount:a,onLogout:o,labels:l}){const i={...rt,...l},[c,x]=u.useState(!1),f=u.useRef(null),m=u.useCallback(()=>x(!1),[]);return H(f,c,m),e.jsxs("div",{ref:f,className:"relative flex items-center",children:[e.jsxs("button",{type:"button",onClick:()=>x(d=>!d),"aria-haspopup":"true","aria-expanded":c,className:"flex items-center gap-2 px-2 py-1 rounded-full border-none bg-transparent cursor-pointer text-on-surface-variant hover:bg-surface-container-low transition-colors",children:[n&&e.jsx("span",{className:"text-sm font-medium text-on-surface",children:n}),e.jsx(E,{src:r,name:t,size:"sm","aria-label":t||i.user}),e.jsx("span",{className:`flex items-center transition-transform duration-200 ${c?"rotate-180":"rotate-0"}`,children:e.jsx(y,{name:"expand_more",size:13})})]}),c&&e.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+8px)] min-w-[220px] bg-surface-container-lowest border border-surface-container-highest rounded-xl shadow-theme-lg z-[200] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 p-4",children:[e.jsx(E,{src:r,name:t,size:"sm"}),e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-sm font-bold text-on-surface whitespace-nowrap overflow-hidden text-ellipsis",children:t}),e.jsx("span",{className:"text-xs text-on-surface-variant whitespace-nowrap overflow-hidden text-ellipsis",children:s})]})]}),e.jsx("hr",{className:"m-0 border-t border-surface-container-highest"}),e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(),a()},className:"w-full flex items-center gap-3 px-4 py-2.5 border-none bg-transparent cursor-pointer text-left text-on-surface hover:bg-surface-container-low transition-colors",children:[e.jsx(y,{name:"person",size:15}),e.jsx("span",{className:"text-sm font-medium",children:i.myAccount})]}),e.jsx("hr",{className:"m-0 border-t border-surface-container-highest"}),e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(),o()},className:"w-full flex items-center gap-3 px-4 py-2.5 border-none bg-transparent cursor-pointer text-left text-error hover:bg-error/5 transition-colors",children:[e.jsx(y,{name:"logout",size:15}),e.jsx("span",{className:"text-sm font-medium",children:i.logout})]})]})]})}const ot={help:"Ajuda",documentation:"Documentação",faq:"F.A.Q.",changelog:"Changelog",contactUs:"Contate-nos"};function lt({labels:t,hrefs:s}){const n={...ot,...t},r=u.useRef(null),[a,o]=u.useState(!1),l=u.useCallback(()=>o(!1),[]);return H(r,a,l),e.jsxs("div",{ref:r,className:"relative",children:[e.jsx(V,{icon:e.jsx(y,{name:"help",size:20}),label:n.help,onClick:()=>o(i=>!i),"aria-haspopup":"true","aria-expanded":a}),a&&e.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+8px)] w-56 bg-surface-container-lowest border border-surface-container-highest rounded-xl shadow-theme-lg py-1 z-[200] overflow-hidden",children:[e.jsx(M,{icon:"description",label:n.documentation,href:s==null?void 0:s.documentation}),e.jsx(M,{icon:"help_outline",label:n.faq,href:s==null?void 0:s.faq}),e.jsx(M,{icon:"assignment",label:n.changelog,href:s==null?void 0:s.changelog}),e.jsx("div",{className:"my-1 border-t border-surface-container-highest"}),e.jsx(M,{icon:"mail",label:n.contactUs,href:s==null?void 0:s.contactUs})]})]})}function M({icon:t,label:s,href:n="#"}){return e.jsxs("a",{href:n,role:"menuitem",className:"flex items-center gap-3 px-4 py-2.5 text-sm font-medium text-on-surface-variant hover:bg-surface-container hover:text-on-surface transition-colors no-underline",children:[e.jsx(y,{name:t,size:18,className:"opacity-70"}),s]})}const it=[{id:"tower",status:"active",iconName:"cell_tower",labelKey:"modules.tower.title"},{id:"antennas",status:"active",iconName:"settings_input_antenna",labelKey:"modules.antennas.title"},{id:"rooftop",status:"active",iconName:"roofing",labelKey:"modules.rooftop.title"},{id:"radier",status:"active",iconName:"layers",IconComponent:se,labelKey:"modules.radier.title"},{id:"caisson_foundation",status:"coming_soon",iconName:"filter_alt",IconComponent:ne,labelKey:"modules.caisson_foundation.title"},{id:"pole",status:"coming_soon",iconName:"fence",IconComponent:re,labelKey:"modules.pole.title"},{id:"dashboards",status:"coming_soon",iconName:"dashboard",labelKey:"modules.dashboards.title"}];function ct(t,s,n){return t.filter(r=>s.includes(r.id)||n.includes(r.id)).map(r=>({module:r,hasAccess:n.includes(r.id)}))}const dt={xs:"w-3 h-3 border",sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-[3px]",xl:"w-12 h-12 border-4"},ut={primary:"border-orange-200 border-t-zeo-orange",secondary:"border-surface-container-high border-t-on-surface-variant",white:"border-white/30 border-t-white"};function xt({size:t="md",variant:s="primary",label:n="Carregando...",className:r="",...a}){return e.jsx("span",{role:"status","aria-label":n,className:["inline-block rounded-full animate-spin",dt[t],ut[s],r].filter(Boolean).join(" "),...a})}function ft({children:t,className:s="",...n}){return e.jsx("div",{className:["overflow-x-auto rounded-xl border border-surface-container-high shadow-sm",s].filter(Boolean).join(" "),...n,children:e.jsx("table",{className:"w-full text-sm",children:t})})}function mt({children:t,className:s="",...n}){return e.jsx("thead",{className:["bg-surface-container-low border-b border-surface-container-high",s].filter(Boolean).join(" "),...n,children:t})}function pt({children:t,className:s="",...n}){return e.jsx("tbody",{className:["bg-white divide-y divide-surface-container-high",s].filter(Boolean).join(" "),...n,children:t})}function ht({selected:t=!1,children:s,className:n="",...r}){return e.jsx("tr",{className:["hover:bg-surface-container-low transition-colors",t?"bg-orange-50/40":"",n].filter(Boolean).join(" "),...r,children:s})}function bt({sortable:t=!1,sorted:s=!1,onSort:n,children:r,className:a="",...o}){return e.jsx("th",{className:["px-4 py-3 text-left text-xs font-semibold text-on-surface-variant uppercase tracking-wide whitespace-nowrap",t?"cursor-pointer hover:text-on-surface select-none":"",a].filter(Boolean).join(" "),onClick:t?n:void 0,...o,children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r,t&&e.jsx("span",{className:`material-symbols-outlined text-[14px] ${s?"text-zeo-orange":"opacity-40"}`,children:s==="asc"?"arrow_upward":s==="desc"?"arrow_downward":"unfold_more"})]})})}function gt({muted:t=!1,mono:s=!1,children:n,className:r="",...a}){return e.jsx("td",{className:["px-4 py-3",t?"text-on-surface-variant":"text-on-surface",s?"font-mono text-xs":"",r].filter(Boolean).join(" "),...a,children:n})}const ie=u.createContext(null);function D(){const t=u.useContext(ie);if(!t)throw new Error("Tab must be used inside Tabs");return t}const ce=u.createContext({stretch:!1});function jt({value:t,onChange:s,variant:n="default",children:r}){return e.jsx(ie.Provider,{value:{active:t,onChange:s,variant:n},children:e.jsx("div",{className:n==="vertical"?"flex gap-6":"flex flex-col gap-4",children:r})})}function vt({children:t,className:s="",stretch:n=!1,...r}){const{variant:a}=D(),o={default:n?"flex gap-1 bg-surface-container-low rounded-lg p-1 w-full":"flex gap-1 bg-surface-container-low rounded-lg p-1 w-fit",underline:"flex gap-0 border-b border-surface-container-high w-full",vertical:"flex flex-col gap-1 bg-surface-container-low rounded-lg p-1 w-48 shrink-0 h-fit"}[a];return e.jsx(ce.Provider,{value:{stretch:n},children:e.jsx("div",{role:"tablist",className:[o,s].filter(Boolean).join(" "),...r,children:t})})}function wt({value:t,label:s,icon:n,badge:r,disabled:a=!1}){const{active:o,onChange:l,variant:i}=D(),{stretch:c}=u.useContext(ce),x=o===t,f="inline-flex items-center gap-2 font-medium text-sm transition-all duration-200 select-none focus:outline-none",m="opacity-40 cursor-not-allowed pointer-events-none",d=c&&i!=="vertical"?"flex-1 justify-center":"",p={default:x?"bg-white text-on-surface shadow-sm rounded-md px-4 py-2":"text-on-surface-variant hover:text-on-surface rounded-md px-4 py-2",underline:x?"text-zeo-orange border-b-2 border-zeo-orange px-4 py-2.5 -mb-px":"text-on-surface-variant hover:text-on-surface border-b-2 border-transparent px-4 py-2.5 -mb-px",vertical:x?"bg-white text-on-surface shadow-sm rounded-md px-4 py-2 w-full":"text-on-surface-variant hover:text-on-surface rounded-md px-4 py-2 w-full"}[i];return e.jsxs("button",{role:"tab","aria-selected":x,"aria-disabled":a,disabled:a,onClick:()=>!a&&l(t),className:[f,p,d,a?m:""].filter(Boolean).join(" "),children:[n&&e.jsx("span",{className:"material-symbols-outlined text-[18px]",style:x?{fontVariationSettings:"'FILL' 1"}:void 0,children:n}),s,r!==void 0&&e.jsx("span",{className:`text-[11px] font-semibold px-1.5 py-0.5 rounded-full leading-none ${x?"bg-zeo-orange text-white":"bg-surface-container-high text-on-surface-variant"}`,children:r})]})}function yt({value:t,children:s,className:n="",stretch:r=!1}){const{active:a}=D();return a!==t?null:e.jsx("div",{role:"tabpanel",className:[r?"flex-1":"",n].filter(Boolean).join(" "),children:s})}const Nt={top:{wrapper:"bottom-full left-1/2 -translate-x-1/2 mb-2",arrow:"top-full left-1/2 -translate-x-1/2 border-t-4 border-x-4 border-x-transparent border-b-0"},bottom:{wrapper:"top-full left-1/2 -translate-x-1/2 mt-2",arrow:"bottom-full left-1/2 -translate-x-1/2 border-b-4 border-x-4 border-x-transparent border-t-0"},left:{wrapper:"right-full top-1/2 -translate-y-1/2 mr-2",arrow:"left-full top-1/2 -translate-y-1/2 border-l-4 border-y-4 border-y-transparent border-r-0"},right:{wrapper:"left-full top-1/2 -translate-y-1/2 ml-2",arrow:"right-full top-1/2 -translate-y-1/2 border-r-4 border-y-4 border-y-transparent border-l-0"}},kt={dark:{tooltip:"bg-slate-800 text-white",arrow:"border-t-slate-800 border-r-slate-800 border-b-slate-800 border-l-slate-800"},light:{tooltip:"bg-white text-on-surface border border-surface-container-high shadow-theme-lg",arrow:"border-t-white border-r-white border-b-white border-l-white"}};function Ct({content:t,position:s="top",variant:n="dark",children:r,className:a="",...o}){const l=Nt[s],i=kt[n];return e.jsxs("div",{className:["relative inline-flex group",a].filter(Boolean).join(" "),...o,children:[r,e.jsxs("div",{role:"tooltip",className:["absolute z-50 pointer-events-none","opacity-0 group-hover:opacity-100 transition-opacity duration-150","whitespace-nowrap text-xs font-medium px-2.5 py-1.5 rounded-lg",l.wrapper,i.tooltip].join(" "),children:[t,e.jsx("span",{className:["absolute w-0 h-0",l.arrow,i.arrow].join(" ")})]})]})}exports.Alert=ge;exports.AppNavbar=et;exports.AppShellLayout=Pe;exports.AppSidebar=Ye;exports.Avatar=E;exports.Badge=Le;exports.Breadcrumb=ze;exports.Button=J;exports.ButtonGroup=Ie;exports.Card=Te;exports.CardFooter=Re;exports.CardHeader=$e;exports.Checkbox=Y;exports.Dropdown=Ee;exports.HelpMenu=lt;exports.Icon=y;exports.Input=ae;exports.MODULE_CATALOG=it;exports.Modal=Ke;exports.ModalBody=We;exports.ModalFooter=qe;exports.ModalHeader=Ue;exports.NavbarIconButton=V;exports.NavbarSearch=st;exports.NavbarTitle=tt;exports.NotificationsBell=nt;exports.Pagination=Oe;exports.PosteIcon=re;exports.ProgressBar=Je;exports.RadierIcon=se;exports.Radio=ee;exports.Select=P;exports.SidebarItem=F;exports.SidebarSection=le;exports.Spinner=xt;exports.Switch=te;exports.Tab=wt;exports.TabList=vt;exports.TabPanel=yt;exports.Table=ft;exports.TableBody=pt;exports.TableCell=gt;exports.TableHead=mt;exports.TableHeaderCell=bt;exports.TableRow=ht;exports.Tabs=jt;exports.Textarea=X;exports.Tooltip=Ct;exports.TubulaoIcon=ne;exports.UserMenu=at;exports.resolveModuleAccess=ct;exports.useDismiss=H;