@estiva-app/ui 0.77.0 → 0.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NavItem.d.ts +3 -1
- package/dist/NavItem.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +7 -1
- package/src/NavItem.mdx +8 -0
- package/src/NavItem.stories.tsx +5 -0
- package/src/NavItem.test.tsx +40 -1
- package/src/NavItem.tsx +12 -1
package/dist/NavItem.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export interface NavItemProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'
|
|
|
62
62
|
action?: SectionAction;
|
|
63
63
|
/** Shown only while the row is pointed at or focused, left of the count: a neutral `Chip`, typically. */
|
|
64
64
|
hint?: ReactNode;
|
|
65
|
+
/** A sentence about the item, in the package's tooltip while the label is pointed at; the row stays one line. Absent or blank, no tooltip. */
|
|
66
|
+
tooltip?: string;
|
|
65
67
|
/** Something new here: brighter words, the label in medium, and the `UnreadDot` at the right. Say so in the row's own words for assistive tech too. */
|
|
66
68
|
unread?: boolean;
|
|
67
69
|
/** With `unread`: the warning badge in the dot's place. */
|
|
@@ -75,5 +77,5 @@ export interface NavItemProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'
|
|
|
75
77
|
onOpenChange?: (open: boolean) => void;
|
|
76
78
|
className?: string;
|
|
77
79
|
}
|
|
78
|
-
export declare function NavItem({ label, href, count, countLabel, active, icon, menu, menuLabel, action, hint, unread, urgent, children, defaultOpen, open: openProp, onOpenChange, className, onClick, ...props }: NavItemProps): import("react").JSX.Element;
|
|
80
|
+
export declare function NavItem({ label, href, count, countLabel, active, icon, menu, menuLabel, action, hint, tooltip, unread, urgent, children, defaultOpen, open: openProp, onOpenChange, className, onClick, ...props }: NavItemProps): import("react").JSX.Element;
|
|
79
81
|
//# sourceMappingURL=NavItem.d.ts.map
|
package/dist/NavItem.d.ts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M,CAAC,EAAE,OAAO,CAAA;IAChB,6HAA6H;IAC7H,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAAc,EACd,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,MAAM,EACN,IAAI,EACJ,OAAO,EACP,MAAc,EACd,MAAc,EACd,QAAQ,EACR,WAAkB,EAClB,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,YAAY,+BAgLd"}
|
package/dist/index.js
CHANGED
|
@@ -3339,6 +3339,7 @@ function NavItem({
|
|
|
3339
3339
|
menuLabel,
|
|
3340
3340
|
action,
|
|
3341
3341
|
hint,
|
|
3342
|
+
tooltip,
|
|
3342
3343
|
unread = false,
|
|
3343
3344
|
urgent = false,
|
|
3344
3345
|
children,
|
|
@@ -3395,7 +3396,11 @@ function NavItem({
|
|
|
3395
3396
|
children: icon
|
|
3396
3397
|
}
|
|
3397
3398
|
),
|
|
3398
|
-
|
|
3399
|
+
tooltip?.trim() ? (
|
|
3400
|
+
// On the label alone, not the row: the ⋮ and the action keep their
|
|
3401
|
+
// own tooltips, and the two never stand up at once.
|
|
3402
|
+
/* @__PURE__ */ jsx50(WithTooltip, { label: tooltip, inline: true, wrapperClassName: "flex min-w-0 flex-1", children: /* @__PURE__ */ jsx50("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }) })
|
|
3403
|
+
) : /* @__PURE__ */ jsx50("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }),
|
|
3399
3404
|
hint != null && // Takes room only while it shows, so the label gives way to it.
|
|
3400
3405
|
/* @__PURE__ */ jsx50("span", { className: "hidden shrink-0 items-center group-hover/nav:flex group-has-[:focus-visible]/nav:flex", children: hint }),
|
|
3401
3406
|
buttons > 1 && // Two buttons: the second one's room (24px and the 4px between them, the
|