@tmlmobilidade/ui 20250305.1841.5 → 20250306.1249.35

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.
@@ -2,14 +2,16 @@ import { MenuDividerProps as MantineMenuDividerProps, MenuDropdownProps as Manti
2
2
  export type MenuProps = MantineMenuProps;
3
3
  export type MenuTargetProps = MantineMenuTargetProps;
4
4
  export type MenuDropdownProps = MantineMenuDropdownProps;
5
- export type MenuItemProps = MantineMenuItemProps;
5
+ export type MenuItemProps = MantineMenuItemProps & {
6
+ href: string;
7
+ };
6
8
  export type MenuDividerProps = MantineMenuDividerProps;
7
9
  export type MenuLabelProps = MantineMenuLabelProps;
8
10
  declare function Menu(props: MenuProps): import("react/jsx-runtime").JSX.Element;
9
11
  declare namespace Menu {
10
12
  var Target: (props: MenuTargetProps) => import("react/jsx-runtime").JSX.Element;
11
13
  var Dropdown: (props: MenuDropdownProps) => import("react/jsx-runtime").JSX.Element;
12
- var Item: (props: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
14
+ var Item: ({ href, ...props }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
13
15
  var Divider: (props: MenuDividerProps) => import("react/jsx-runtime").JSX.Element;
14
16
  var Label: (props: MenuLabelProps) => import("react/jsx-runtime").JSX.Element;
15
17
  }
@@ -1 +1,2 @@
1
- export default function Header(): import("react/jsx-runtime").JSX.Element;
1
+ import { HeaderProps } from '..';
2
+ export default function Header({ user_name }: HeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,14 @@
1
1
  import { SidebarItemProps } from '../Sidebar';
2
- interface AppWrapperProps {
2
+ export interface HeaderProps {
3
+ user_name?: string;
4
+ }
5
+ export interface AppWrapperProps {
3
6
  children: React.ReactNode;
7
+ headerProps?: HeaderProps;
4
8
  icon: React.ReactNode | {
5
9
  href: string;
6
10
  icon: React.ReactNode;
7
11
  };
8
12
  sidebarItems: SidebarItemProps[];
9
13
  }
10
- export default function AppWrapper({ children, icon, sidebarItems, }: AppWrapperProps): import("react/jsx-runtime").JSX.Element;
11
- export {};
14
+ export default function AppWrapper({ children, headerProps, icon, sidebarItems, }: AppWrapperProps): import("react/jsx-runtime").JSX.Element;
package/dist/esm/index.js CHANGED
@@ -10,7 +10,7 @@ import { ModalsProvider, modals as modals$1 } from '@mantine/modals';
10
10
  export * from '@mantine/modals';
11
11
  import { Notifications, notifications } from '@mantine/notifications';
12
12
  import * as Icon from '@tabler/icons-react';
13
- import { IconX, IconCaretDownFilled, IconCalendar, IconTrash, IconUpload, IconEye, IconEyeClosed, IconInfoCircle, IconArrowUpRhombus, IconArrowDownRhombus, IconArrowsUpDown, IconSettings, IconLogin, IconCaretLeftFilled } from '@tabler/icons-react';
13
+ import { IconX, IconCaretDownFilled, IconCalendar, IconTrash, IconUpload, IconEye, IconEyeClosed, IconInfoCircle, IconArrowUpRhombus, IconArrowDownRhombus, IconArrowsUpDown, IconCaretLeftFilled } from '@tabler/icons-react';
14
14
  import { ViewportList } from 'react-viewport-list';
15
15
  import { useDebouncedValue } from '@mantine/hooks';
16
16
  export * from '@mantine/hooks';
@@ -1258,8 +1258,8 @@ Menu.Target = function MenuTarget(props) {
1258
1258
  Menu.Dropdown = function MenuDropdown(props) {
1259
1259
  return jsxRuntimeExports.jsx(Menu$1.Dropdown, { ...props, className: styles$i.dropdown });
1260
1260
  };
1261
- Menu.Item = function MenuItem(props) {
1262
- return jsxRuntimeExports.jsx(Menu$1.Item, { ...props, className: styles$i.item });
1261
+ Menu.Item = function MenuItem({ href, ...props }) {
1262
+ return (jsxRuntimeExports.jsx(Menu$1.Item, { className: styles$i.item, component: href ? 'a' : undefined, href: href, ...props }));
1263
1263
  };
1264
1264
  Menu.Divider = function MenuDivider(props) {
1265
1265
  return jsxRuntimeExports.jsx(Menu$1.Divider, { ...props, className: styles$i.divider });
@@ -1595,45 +1595,32 @@ function SidebarItem({ classNames, disabled, href, icon, label, }) {
1595
1595
  }), children: typeof icon === 'string' ? generateIcon(icon) : icon }) }) }));
1596
1596
  }
1597
1597
 
1598
- /* * */
1599
- function AppOptions() {
1600
- //
1601
- //
1602
- // A. Setup variables
1603
- //
1604
- // B. Handle actions
1605
- //
1606
- // C. Render components
1607
- return (jsxRuntimeExports.jsxs(Menu, { offset: 15, position: "bottom-end", shadow: "lg", children: [jsxRuntimeExports.jsx(Menu.Target, { children: jsxRuntimeExports.jsx(ActionIcon, { color: "gray", variant: "muted", children: jsxRuntimeExports.jsx(IconSettings, { size: 20 }) }) }), jsxRuntimeExports.jsxs(Menu.Dropdown, { children: [jsxRuntimeExports.jsx(Menu.Divider, {}), jsxRuntimeExports.jsxs(Menu.Item, { color: "red", children: [jsxRuntimeExports.jsx(IconLogin, { size: 20 }), "Logout"] }), jsxRuntimeExports.jsx(Menu.Divider, {})] })] }));
1608
- //
1609
- }
1610
-
1611
1598
  var styles$6 = {"container":"styles-module_container__G0H4W","greeting":"styles-module_greeting__Zw9r-","options":"styles-module_options__RyJJ1"};
1612
1599
 
1613
1600
  /* * */
1614
1601
  const greetings = ['Olá', 'Hi', 'Hey', 'Oi', 'Hallo', 'Ciao', 'Hej'];
1615
1602
  /* * */
1616
- function Header() {
1603
+ function Header({ user_name }) {
1617
1604
  //
1618
1605
  //
1619
1606
  // A. Setup variables
1620
1607
  const [drawnGreeting] = useState(greetings[(greetings.length * Math.random()) | 0]);
1621
1608
  //
1622
1609
  // B. Render components
1623
- return (jsxRuntimeExports.jsxs("div", { className: styles$6.container, children: [jsxRuntimeExports.jsx("p", { className: styles$6.greeting, children: drawnGreeting }), jsxRuntimeExports.jsx("div", { className: styles$6.options, children: jsxRuntimeExports.jsx(AppOptions, {}) })] }));
1610
+ return (jsxRuntimeExports.jsxs("div", { className: styles$6.container, children: [jsxRuntimeExports.jsxs("p", { className: styles$6.greeting, children: [drawnGreeting, " ", user_name] }), jsxRuntimeExports.jsx("div", { className: styles$6.options })] }));
1624
1611
  //
1625
1612
  }
1626
1613
 
1627
1614
  var styles$5 = {"container":"styles-module_container__V2XNO","appIcon":"styles-module_appIcon__QFZYG","content":"styles-module_content__N1Zgw"};
1628
1615
 
1629
- function AppWrapper({ children, icon, sidebarItems, }) {
1616
+ function AppWrapper({ children, headerProps, icon, sidebarItems, }) {
1630
1617
  const appIcon = () => {
1631
1618
  if (icon && typeof icon === 'object' && 'href' in icon) {
1632
1619
  return jsxRuntimeExports.jsx("a", { href: icon.href, children: icon.icon });
1633
1620
  }
1634
1621
  return icon;
1635
1622
  };
1636
- return (jsxRuntimeExports.jsxs("div", { className: styles$5.container, children: [jsxRuntimeExports.jsx("div", { className: styles$5.appIcon, children: appIcon() }), jsxRuntimeExports.jsx(Header, {}), jsxRuntimeExports.jsx(Sidebar, { items: sidebarItems }), jsxRuntimeExports.jsx("div", { className: styles$5.content, children: children })] }));
1623
+ return (jsxRuntimeExports.jsxs("div", { className: styles$5.container, children: [jsxRuntimeExports.jsx("div", { className: styles$5.appIcon, children: appIcon() }), jsxRuntimeExports.jsx(Header, { ...headerProps }), jsxRuntimeExports.jsx(Sidebar, { items: sidebarItems }), jsxRuntimeExports.jsx("div", { className: styles$5.content, children: children })] }));
1637
1624
  }
1638
1625
 
1639
1626
  var styles$4 = {"container":"styles-module_container__u-Ao-","hAlignstart":"styles-module_hAlignstart__Poz-6","hAligncenter":"styles-module_hAligncenter__-8-PQ","hAlignend":"styles-module_hAlignend__9-hiG","vAlignstart":"styles-module_vAlignstart__UHr2W","vAligncenter":"styles-module_vAligncenter__AI3ka","vAlignend":"styles-module_vAlignend__Ufwik","gapnone":"styles-module_gapnone__yv7lm","gapxs":"styles-module_gapxs__qCDUv","gapsm":"styles-module_gapsm__9Pnop","gapmd":"styles-module_gapmd__9lCqV","gaplg":"styles-module_gaplg__kvQt9","gapxl":"styles-module_gapxl__5-mrY","a":"styles-module_a__NDsdd","aab":"styles-module_aab__xvehZ","ab":"styles-module_ab__JtDDA","abb":"styles-module_abb__jlnJf","abc":"styles-module_abc__XRK-M","abcd":"styles-module_abcd__3jl83"};