meticulous-ui 3.9.2 → 3.9.4

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,97 @@
1
+ import { jsxs as r, jsx as a, Fragment as A } from "react/jsx-runtime";
2
+ import "react";
3
+ import { NavListItem as N, NavItemRow as $, NavIconWrapper as k, NavLabel as E, NavControls as j, InlineAction as g, SubList as w, ChildListItem as P, ChildLabel as F } from "./NavItem.styles.js";
4
+ import { ChevronIcon as R, PlusIcon as S } from "./icons.js";
5
+ import b from "./Badge.js";
6
+ const G = ({
7
+ item: e,
8
+ collapsed: t,
9
+ isActive: d,
10
+ isHovered: p,
11
+ isExpanded: l,
12
+ hoveredId: x,
13
+ colors: o,
14
+ isDark: c,
15
+ onNavClick: s,
16
+ onHover: h,
17
+ onClearHover: v,
18
+ onToggleExpand: C
19
+ }) => {
20
+ const u = e.children && e.children.length > 0, i = d(e.id), B = () => s(e.id), T = () => h(e.id), I = (n) => C(e.id, n), f = (n) => {
21
+ n.stopPropagation(), e.onAdd();
22
+ };
23
+ return /* @__PURE__ */ r(N, { children: [
24
+ /* @__PURE__ */ r(
25
+ $,
26
+ {
27
+ $collapsed: t,
28
+ $isChild: !1,
29
+ $isActive: i,
30
+ $isHovered: p,
31
+ $activeText: o.activeText,
32
+ $text: o.text,
33
+ $activeBg: o.activeBg,
34
+ $hoverBg: o.hoverBg,
35
+ onClick: B,
36
+ onMouseEnter: T,
37
+ onMouseLeave: v,
38
+ "aria-current": i ? "page" : void 0,
39
+ children: [
40
+ /* @__PURE__ */ a(k, { $color: i ? o.activeText : o.subText, "aria-hidden": "true", children: e.icon }),
41
+ !t && /* @__PURE__ */ r(A, { children: [
42
+ /* @__PURE__ */ a(E, { children: e.label }),
43
+ /* @__PURE__ */ r(j, { children: [
44
+ e.badge != null && /* @__PURE__ */ a(b, { count: e.badge, isDark: c }),
45
+ u && /* @__PURE__ */ a(
46
+ g,
47
+ {
48
+ $color: o.subText,
49
+ onClick: I,
50
+ "aria-label": l ? `Collapse ${e.label}` : `Expand ${e.label}`,
51
+ "aria-expanded": l,
52
+ children: /* @__PURE__ */ a(R, { direction: l ? "up" : "down" })
53
+ }
54
+ ),
55
+ e.onAdd && /* @__PURE__ */ a(
56
+ g,
57
+ {
58
+ $color: o.subText,
59
+ onClick: f,
60
+ "aria-label": `Add ${e.label}`,
61
+ children: /* @__PURE__ */ a(S, {})
62
+ }
63
+ )
64
+ ] })
65
+ ] })
66
+ ]
67
+ }
68
+ ),
69
+ !t && u && l && /* @__PURE__ */ a(w, { children: e.children.map((n) => {
70
+ const L = () => s(n.id), M = () => h(n.id);
71
+ return /* @__PURE__ */ a(P, { children: /* @__PURE__ */ r(
72
+ $,
73
+ {
74
+ $collapsed: !1,
75
+ $isChild: !0,
76
+ $isActive: d(n.id),
77
+ $isHovered: x === n.id,
78
+ $activeText: o.activeText,
79
+ $text: o.text,
80
+ $activeBg: o.activeBg,
81
+ $hoverBg: o.hoverBg,
82
+ onClick: L,
83
+ onMouseEnter: M,
84
+ onMouseLeave: v,
85
+ "aria-current": d(n.id) ? "page" : void 0,
86
+ children: [
87
+ /* @__PURE__ */ a(F, { children: n.label }),
88
+ n.badge != null && /* @__PURE__ */ a(b, { count: n.badge, isDark: c })
89
+ ]
90
+ }
91
+ ) }, n.id);
92
+ }) })
93
+ ] });
94
+ };
95
+ export {
96
+ G as default
97
+ };
@@ -0,0 +1,69 @@
1
+ import n from "styled-components";
2
+ const s = n.li`
3
+ list-style: none;
4
+ `, l = n.div`
5
+ display: flex;
6
+ align-items: center;
7
+ gap: ${({ $collapsed: e }) => e ? "0" : "0.9375rem"};
8
+ justify-content: ${({ $collapsed: e }) => e ? "center" : "flex-start"};
9
+ padding: ${({ $isChild: e, $collapsed: t }) => e ? "0.75rem 1.5rem 0.75rem 4rem" : t ? "1rem" : "1rem 1.5rem"};
10
+ border-radius: 0.75rem;
11
+ cursor: pointer;
12
+ color: ${({ $isActive: e, $activeText: t, $text: r }) => e ? t : r};
13
+ background: ${({ $isActive: e, $activeBg: t, $isHovered: r, $hoverBg: o }) => e ? t : r ? o : "transparent"};
14
+ transition: background 0.15s;
15
+ font-size: ${({ $isChild: e }) => e ? "1.375rem" : "1.5rem"};
16
+ font-weight: ${({ $isChild: e }) => e ? "400" : "500"};
17
+ user-select: none;
18
+ width: 100%;
19
+ box-sizing: border-box;
20
+ position: relative;
21
+ `, a = n.span`
22
+ flex-shrink: 0;
23
+ width: 1.6875rem;
24
+ height: 1.6875rem;
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ color: ${({ $color: e }) => e};
29
+ `, c = n.span`
30
+ flex: 1;
31
+ white-space: nowrap;
32
+ overflow: hidden;
33
+ text-overflow: ellipsis;
34
+ `, p = n.span`
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 0.375rem;
38
+ flex-shrink: 0;
39
+ `, d = n.button`
40
+ color: ${({ $color: e }) => e};
41
+ display: flex;
42
+ cursor: pointer;
43
+ background: none;
44
+ border: none;
45
+ padding: 0;
46
+ `, m = n.ul`
47
+ margin-top: 0.125rem;
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: 1px;
51
+ list-style: none;
52
+ padding: 0;
53
+ margin-left: 0;
54
+ `, f = n.li`
55
+ list-style: none;
56
+ `, g = n.span`
57
+ flex: 1;
58
+ `;
59
+ export {
60
+ g as ChildLabel,
61
+ f as ChildListItem,
62
+ d as InlineAction,
63
+ p as NavControls,
64
+ a as NavIconWrapper,
65
+ l as NavItemRow,
66
+ c as NavLabel,
67
+ s as NavListItem,
68
+ m as SubList
69
+ };
@@ -0,0 +1,31 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import t from "styled-components";
4
+ const n = t.svg`
5
+ transform: ${({ $direction: r }) => r === "up" ? "rotate(180deg)" : "none"};
6
+ transition: transform 0.2s;
7
+ `, s = ({ direction: r = "down" }) => /* @__PURE__ */ o(n, { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", $direction: r, children: /* @__PURE__ */ o(
8
+ "path",
9
+ {
10
+ d: "M4 6l4 4 4-4",
11
+ stroke: "currentColor",
12
+ strokeWidth: "1.5",
13
+ strokeLinecap: "round",
14
+ strokeLinejoin: "round"
15
+ }
16
+ ) }), d = () => /* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ o("path", { d: "M8 3v10M3 8h10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }), c = ({ size: r = 16 }) => /* @__PURE__ */ o("svg", { width: r, height: r, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ o("path", { d: "M2 4h12M2 8h12M2 12h12", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round" }) }), l = () => /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ o(
17
+ "path",
18
+ {
19
+ d: "M2 6h12M2 10h12M6 2l-4 4 4 4M10 14l4-4-4-4",
20
+ stroke: "currentColor",
21
+ strokeWidth: "1.5",
22
+ strokeLinecap: "round",
23
+ strokeLinejoin: "round"
24
+ }
25
+ ) });
26
+ export {
27
+ s as ChevronIcon,
28
+ c as HamburgerIcon,
29
+ d as PlusIcon,
30
+ l as SwitchIcon
31
+ };
@@ -0,0 +1,4 @@
1
+ import a from "./Sidebar.js";
2
+ export {
3
+ a as default
4
+ };