@tmlmobilidade/ui 20250305.1841.5 → 20250306.1453.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +8 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/common/Menu/index.d.ts +4 -2
- package/dist/cjs/types/src/components/layout/AppWrapper/Header/index.d.ts +2 -1
- package/dist/cjs/types/src/components/layout/AppWrapper/index.d.ts +6 -3
- package/dist/cjs/types/src/components/layout/Sidebar/index.d.ts +1 -1
- package/dist/cjs/types/src/components/layout/index.d.ts +1 -0
- package/dist/esm/index.js +9 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/common/Menu/index.d.ts +4 -2
- package/dist/esm/types/src/components/layout/AppWrapper/Header/index.d.ts +2 -1
- package/dist/esm/types/src/components/layout/AppWrapper/index.d.ts +6 -3
- package/dist/esm/types/src/components/layout/Sidebar/index.d.ts +1 -1
- package/dist/esm/types/src/components/layout/index.d.ts +1 -0
- package/dist/index.d.ts +11 -5
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -1275,8 +1275,8 @@ Menu.Target = function MenuTarget(props) {
|
|
1275
1275
|
Menu.Dropdown = function MenuDropdown(props) {
|
1276
1276
|
return jsxRuntimeExports.jsx(core.Menu.Dropdown, { ...props, className: styles$i.dropdown });
|
1277
1277
|
};
|
1278
|
-
Menu.Item = function MenuItem(props) {
|
1279
|
-
return jsxRuntimeExports.jsx(core.Menu.Item, {
|
1278
|
+
Menu.Item = function MenuItem({ href, ...props }) {
|
1279
|
+
return (jsxRuntimeExports.jsx(core.Menu.Item, { className: styles$i.item, component: href ? 'a' : undefined, href: href, ...props }));
|
1280
1280
|
};
|
1281
1281
|
Menu.Divider = function MenuDivider(props) {
|
1282
1282
|
return jsxRuntimeExports.jsx(core.Menu.Divider, { ...props, className: styles$i.divider });
|
@@ -1596,7 +1596,8 @@ function generateIcon(name) {
|
|
1596
1596
|
var styles$7 = {"container":"styles-module_container__tduxg","navWrapper":"styles-module_navWrapper__Xb59N","navButton":"styles-module_navButton__kTv0k","selected":"styles-module_selected__w-GVG","disabled":"styles-module_disabled__lxQjN"};
|
1597
1597
|
|
1598
1598
|
function Sidebar({ items, }) {
|
1599
|
-
|
1599
|
+
if (!items || items.length === 0)
|
1600
|
+
return null;
|
1600
1601
|
//
|
1601
1602
|
// A. Render components
|
1602
1603
|
return (jsxRuntimeExports.jsx("div", { className: cn(styles$7.container), children: jsxRuntimeExports.jsx("div", { className: cn(styles$7.navWrapper), children: items.map((item) => {
|
@@ -1612,45 +1613,32 @@ function SidebarItem({ classNames, disabled, href, icon, label, }) {
|
|
1612
1613
|
}), children: typeof icon === 'string' ? generateIcon(icon) : icon }) }) }));
|
1613
1614
|
}
|
1614
1615
|
|
1615
|
-
/* * */
|
1616
|
-
function AppOptions() {
|
1617
|
-
//
|
1618
|
-
//
|
1619
|
-
// A. Setup variables
|
1620
|
-
//
|
1621
|
-
// B. Handle actions
|
1622
|
-
//
|
1623
|
-
// C. Render components
|
1624
|
-
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(Icon.IconSettings, { size: 20 }) }) }), jsxRuntimeExports.jsxs(Menu.Dropdown, { children: [jsxRuntimeExports.jsx(Menu.Divider, {}), jsxRuntimeExports.jsxs(Menu.Item, { color: "red", children: [jsxRuntimeExports.jsx(Icon.IconLogin, { size: 20 }), "Logout"] }), jsxRuntimeExports.jsx(Menu.Divider, {})] })] }));
|
1625
|
-
//
|
1626
|
-
}
|
1627
|
-
|
1628
1616
|
var styles$6 = {"container":"styles-module_container__G0H4W","greeting":"styles-module_greeting__Zw9r-","options":"styles-module_options__RyJJ1"};
|
1629
1617
|
|
1630
1618
|
/* * */
|
1631
1619
|
const greetings = ['Olá', 'Hi', 'Hey', 'Oi', 'Hallo', 'Ciao', 'Hej'];
|
1632
1620
|
/* * */
|
1633
|
-
function Header() {
|
1621
|
+
function Header({ user_name }) {
|
1634
1622
|
//
|
1635
1623
|
//
|
1636
1624
|
// A. Setup variables
|
1637
1625
|
const [drawnGreeting] = React.useState(greetings[(greetings.length * Math.random()) | 0]);
|
1638
1626
|
//
|
1639
1627
|
// B. Render components
|
1640
|
-
return (jsxRuntimeExports.jsxs("div", { className: styles$6.container, children: [jsxRuntimeExports.
|
1628
|
+
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 })] }));
|
1641
1629
|
//
|
1642
1630
|
}
|
1643
1631
|
|
1644
1632
|
var styles$5 = {"container":"styles-module_container__V2XNO","appIcon":"styles-module_appIcon__QFZYG","content":"styles-module_content__N1Zgw"};
|
1645
1633
|
|
1646
|
-
function AppWrapper({ children, icon, sidebarItems, }) {
|
1634
|
+
function AppWrapper({ children, headerProps, icon, sidebarItems, }) {
|
1647
1635
|
const appIcon = () => {
|
1648
1636
|
if (icon && typeof icon === 'object' && 'href' in icon) {
|
1649
1637
|
return jsxRuntimeExports.jsx("a", { href: icon.href, children: icon.icon });
|
1650
1638
|
}
|
1651
1639
|
return icon;
|
1652
1640
|
};
|
1653
|
-
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 })] }));
|
1641
|
+
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 })] }));
|
1654
1642
|
}
|
1655
1643
|
|
1656
1644
|
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"};
|