laif-ds 1.0.0 → 1.0.2

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/index.d.ts CHANGED
@@ -146,25 +146,44 @@ declare const alertVariants: (props?: ({
146
146
 
147
147
  declare type Animation_2 = VariantProps<typeof chatBubbleVariants>["animation"];
148
148
 
149
- export declare function AppBottomNav({ items, showMenu, menuLabel, ariaLabel, menuIconName, linkComponent: LinkComponent, linkProps, className, ...props }: AppBottomNavProps): JSX.Element | null;
149
+ export declare function AppBottomNav({ items, showMenu, menuLabel, ariaLabel, menuIcon, menuBadge, linkComponent: LinkComponent, linkProps, className, ...props }: AppBottomNavProps): JSX.Element | null;
150
150
 
151
151
  export declare interface AppBottomNavProps extends Omit<React_2.ComponentProps<"div">, "children"> {
152
152
  /** Already filtered, sorted and route-matched by the consuming app. */
153
153
  items: BottomNavItem[];
154
154
  /**
155
155
  * `false` drops the Menu cell and spends the slot it frees on a sixth
156
- * destination — the bar is six cells wide either way.
157
- *
158
- * Only for an app that opens the mobile panel somewhere else, typically a
159
- * `SidebarTrigger` in its own header: with no Menu cell and no item carrying
160
- * `subItems`, nothing in the bar reaches `AppSidebar`'s mobile panel any
161
- * more. Turning it off is a claim that the app provides that way itself, so
162
- * it is not warned about — the component cannot see the header.
156
+ * destination — the bar is six cells wide either way. Only for an app that
157
+ * opens the mobile panel somewhere else, typically a `SidebarTrigger` in its
158
+ * own header; taking that over is not warned about, because the component
159
+ * cannot see the header.
163
160
  */
164
161
  showMenu?: boolean;
165
162
  menuLabel?: string;
166
163
  ariaLabel?: string;
167
- menuIconName?: IconName;
164
+ /**
165
+ * The Menu cell's glyph: a **lucide name**, or a **function returning the node
166
+ * to draw** for what lucide does not have.
167
+ *
168
+ * A function and not a `ReactNode`, which is what makes the union work: a
169
+ * string is itself a valid `ReactNode`, so `IconName | ReactNode` collapses
170
+ * and there is no way left to tell a lucide name from literal text.
171
+ *
172
+ * It is **called, not rendered as a component**: hooks inside it are not
173
+ * supported, and in exchange an inline arrow is safe. Whatever it returns goes
174
+ * inside a 20px `shrink-0` box, and a direct `<svg>` child is stretched to
175
+ * fill it; anything else has to size itself. Returning nullish falls back to
176
+ * the default glyph. `BottomNavItem.iconName` stays name-only — the escape
177
+ * hatch is this cell's alone.
178
+ */
179
+ menuIcon?: IconName | (() => React_2.ReactNode);
180
+ /**
181
+ * A dot on the Menu cell. **Never a count**, hence a boolean and not a
182
+ * `badge`: the Menu opens a superset of `items`, so any number would be a lie.
183
+ * OR-ed with the badged items dropped past the cell budget. It carries no
184
+ * announcement — what it stands for is announced on the panel's rows.
185
+ */
186
+ menuBadge?: boolean;
168
187
  linkComponent?: React_2.ComponentType<React_2.AnchorHTMLAttributes<HTMLAnchorElement> & {
169
188
  href: string;
170
189
  }>;
@@ -589,7 +608,7 @@ export declare interface AppSelectOption {
589
608
 
590
609
  export declare type AppSelectProps = SingleSelectProps | MultiSelectProps;
591
610
 
592
- export declare function AppSidebar({ navigation, navigationFooter, navigationDisplay, headerContent, footerContent, showRail, collapsible, linkComponent: LinkComponent, linkProps, ...props }: AppSidebarProps): JSX.Element;
611
+ export declare function AppSidebar({ navigation, navigationFooter, navigationDisplay, headerContent, footerContent, showRail, collapsible, side, expandOnHover, pinned, defaultPinned, onPinnedChange, linkComponent: LinkComponent, linkProps, ...props }: AppSidebarProps): JSX.Element;
593
612
 
594
613
  /**
595
614
  * How the `navigation` groups are laid out. `"list"` stacks every group under
@@ -607,6 +626,27 @@ declare interface AppSidebarProps extends React_2.ComponentProps<typeof Sidebar>
607
626
  headerContent?: React_2.ReactNode;
608
627
  footerContent?: React_2.ReactNode;
609
628
  showRail?: boolean;
629
+ /**
630
+ * Expands the sidebar while the pointer or focus is inside it, as an
631
+ * **overlay**: the content does not move. The Pin control in the header
632
+ * promotes the expansion to permanent, and only then does the layout shift.
633
+ *
634
+ * Active only with `collapsible="icon"`, above 768px and on a fine pointer;
635
+ * anywhere else it is inert, and a different `collapsible` warns.
636
+ */
637
+ expandOnHover?: boolean;
638
+ /**
639
+ * Controlled: the sidebar is permanently expanded and pushes the content.
640
+ * This is the semantic alias of the primitive's `open`, not a state beside it
641
+ * — `Cmd/Ctrl+B`, `SidebarTrigger` and the rail move it exactly as the Pin
642
+ * button does. Do not combine it with a `SidebarProvider` whose `open` is
643
+ * itself controlled: they are two handles on one value.
644
+ */
645
+ pinned?: boolean;
646
+ /** Initial pin value, applied once at mount; it wins over `defaultOpen`. */
647
+ defaultPinned?: boolean;
648
+ /** Called on every pin change, from any affordance. A peek never emits it. */
649
+ onPinnedChange?: (pinned: boolean) => void;
610
650
  linkComponent?: React_2.ComponentType<React_2.AnchorHTMLAttributes<HTMLAnchorElement> & {
611
651
  href: string;
612
652
  }>;
@@ -869,20 +909,15 @@ declare type BaseProps = {
869
909
  export declare interface BottomNavItem {
870
910
  /**
871
911
  * Must equal the sidebar `NavItem.title` of the same destination: it is what
872
- * resolves the drill target when the cell opens the mobile menu. Both lists
873
- * come from the same app-side source, so this is a naming discipline, not a
874
- * lookup the app has to maintain.
912
+ * resolves the drill target when the cell opens the mobile menu.
875
913
  */
876
914
  title: string;
877
915
  /** Ignored when the item has `subItems`: the cell opens the menu instead. */
878
916
  url: string;
879
917
  /**
880
- * Required, with no fallback — but not because the glyph carries recognition
881
- * on its own any more: at 16px it reads level with its label, not above it
882
- * (the trade is argued on `renderCellInner`). What keeps it mandatory is the
883
- * row: a cell missing its icon breaks the rhythm of the other five and reads
884
- * as a failed image, and there is no room here for the initial-letter
885
- * fallback the desktop sidebar uses in icon mode.
918
+ * Required, with no fallback: there is no room here for the initial-letter
919
+ * fallback the desktop sidebar uses in icon mode, and a cell without a glyph
920
+ * breaks the rhythm of the other five.
886
921
  */
887
922
  iconName: IconName;
888
923
  /** Leaf-level only — the subtree state is derived from `subItems`. */
@@ -891,6 +926,14 @@ export declare interface BottomNavItem {
891
926
  subItems?: NavSubItem[];
892
927
  /** Only when the spoken name must differ; it must still contain the label. */
893
928
  ariaLabel?: string;
929
+ /**
930
+ * Same field as `AppSidebar`'s `NavItem.badge`. This surface is `compact`: a
931
+ * **number** renders as a superscript on the glyph (`99+` included), a
932
+ * **short text** degrades to a dot, and `true` is a dot here too.
933
+ */
934
+ badge?: number | string | true;
935
+ /** See `AppSidebar`'s `NavItem.badgeLabel`. */
936
+ badgeLabel?: string;
894
937
  }
895
938
 
896
939
  export declare function Breadcrumb({ ...props }: React_2.ComponentProps<"nav">): JSX.Element;
@@ -2701,22 +2744,20 @@ export declare interface NavGroup {
2701
2744
  title: string;
2702
2745
  url?: string;
2703
2746
  items: NavItem[];
2747
+ /** See `NavItem.badge`. The group's own badge is never a sum of its items'. */
2748
+ badge?: number | string | true;
2749
+ /** See `NavItem.badgeLabel`. */
2750
+ badgeLabel?: string;
2704
2751
  /** Only read in `navigationDisplay="tab"`, where it is the tab's icon. */
2705
2752
  iconName?: IconName;
2706
- /**
2707
- * Only read in `navigationDisplay="tab"`. Escape hatch from lucide, taking
2708
- * precedence over `iconName`.
2709
- */
2753
+ /** Only read in `"tab"`. Escape hatch from lucide; wins over `iconName`. */
2710
2754
  icon?: NavIcon;
2711
2755
  }
2712
2756
 
2713
2757
  /**
2714
- * A third-party or custom icon: any component accepting `className`. The
2715
- * sidebar renders the same icon at more than one size (20px in a row, 16px in a
2716
- * collapsed dropdown, and whatever the tab bar imposes), so it passes a size
2717
- * *class* instead of a `size` prop — `className` is the one contract every icon
2718
- * library honours, and a CSS width/height overrides the `width`/`height`
2719
- * attributes libraries like react-icons put on their `<svg>`.
2758
+ * Any component accepting `className`. A size *class* and not a `size` prop,
2759
+ * because a CSS width/height overrides the `width`/`height` attributes
2760
+ * libraries like react-icons put on their `<svg>`.
2720
2761
  */
2721
2762
  export declare type NavIcon = React_2.ComponentType<{
2722
2763
  className?: string;
@@ -2749,6 +2790,26 @@ export declare interface NavItem {
2749
2790
  /** Escape hatch from lucide. Takes precedence over `iconName`. */
2750
2791
  icon?: NavIcon;
2751
2792
  subItems?: NavSubItem[];
2793
+ /**
2794
+ * A quantitative mark beside the row, in one of three forms:
2795
+ *
2796
+ * - **`number`** — a count. Integer >= 1; over 99 renders `99+`. `0` renders
2797
+ * nothing (pass `"0"` to really mean the character). Negative or
2798
+ * non-integer warns and is ignored.
2799
+ * - **`string`** — short text (`NEW`, `BETA`). Over 8 characters warns.
2800
+ * - **`true`** — a dot, for state with no number to it.
2801
+ *
2802
+ * The value degrades by what each surface can draw and is never dropped.
2803
+ * Counts are never aggregated — a parent shows its own badge, or a dot for
2804
+ * badged children while it is collapsed.
2805
+ */
2806
+ badge?: number | string | true;
2807
+ /**
2808
+ * The spoken form of `badge` ("3 unread documents"), announced by an
2809
+ * `sr-only` span while the visual badge is `aria-hidden`. Effectively required
2810
+ * for `badge: true`: without it the dot stays silent and the component warns.
2811
+ */
2812
+ badgeLabel?: string;
2752
2813
  }
2753
2814
 
2754
2815
  export declare interface NavSubItem {
@@ -2758,6 +2819,10 @@ export declare interface NavSubItem {
2758
2819
  iconName?: IconName;
2759
2820
  /** Escape hatch from lucide. Takes precedence over `iconName`. */
2760
2821
  icon?: NavIcon;
2822
+ /** See `NavItem.badge`. */
2823
+ badge?: number | string | true;
2824
+ /** See `NavItem.badgeLabel`. */
2825
+ badgeLabel?: string;
2761
2826
  }
2762
2827
 
2763
2828
  declare type NoRepeatDataType = {
@@ -3047,6 +3112,22 @@ declare type SidebarContextProps = {
3047
3112
  state: "expanded" | "collapsed";
3048
3113
  open: boolean;
3049
3114
  setOpen: (open: boolean) => void;
3115
+ /**
3116
+ * Temporary expansion driven by hover or focus — `AppSidebar`'s
3117
+ * `expandOnHover` owns the logic and this is the only thing it writes.
3118
+ *
3119
+ * Deliberately *not* folded into `open`: `setOpen` persists to the
3120
+ * `sidebar_state` cookie, so routing the peek through it would let every pass
3121
+ * of the mouse overwrite the consumer's saved preference with noise. It does
3122
+ * fold into `state`, because the children read the context and the
3123
+ * `group-data-[collapsible=icon]:*` rules, not the panel's width — nothing
3124
+ * short of a peek-aware `state` makes labels, inline submenus and tooltips
3125
+ * behave as expanded. The wrapper's `data-peek` is the other half: it holds
3126
+ * the gap div and `SidebarInset` at icon width, which is what makes the peek
3127
+ * an overlay instead of a push.
3128
+ */
3129
+ peek: boolean;
3130
+ setPeek: (peek: boolean) => void;
3050
3131
  openMobile: boolean;
3051
3132
  setOpenMobile: (open: boolean) => void;
3052
3133
  /**
@@ -3087,6 +3168,18 @@ export declare const SidebarMenuAction: React_2.ForwardRefExoticComponent<Omit<R
3087
3168
  showOnHover?: boolean;
3088
3169
  }, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
3089
3170
 
3171
+ /**
3172
+ * @deprecated Use `AppSidebar` with `NavItem.badge` / `NavItem.badgeLabel`
3173
+ * instead. This primitive is `group-data-[collapsible=icon]:hidden`, so the
3174
+ * value it carries simply disappears in the 3rem rail, it has no spoken form,
3175
+ * and it is positioned absolutely over the row rather than laid out in it.
3176
+ * `NavItem.badge` degrades to a dot on every narrower surface, announces itself
3177
+ * through an `sr-only` label, and renders on all four surfaces a `NavItem`
3178
+ * feeds.
3179
+ *
3180
+ * Still exported and unchanged in behaviour, for a consumer hand-building a
3181
+ * `Sidebar` out of the primitives.
3182
+ */
3090
3183
  export declare const SidebarMenuBadge: React_2.ForwardRefExoticComponent<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
3091
3184
 
3092
3185
  export declare const SidebarMenuButton: React_2.ForwardRefExoticComponent<Omit<React_2.ClassAttributes<HTMLButtonElement> & React_2.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import e from "../../_virtual/index5.js";
2
+ import e from "../../_virtual/index3.js";
3
3
  export {
4
4
  e as EventEmitter,
5
5
  e as default
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
3
3
  import { ok as u } from "../../devlop/lib/default.js";
4
4
  import { svg as m, html as C } from "../../property-information/index.js";
5
5
  import { stringify as N } from "../../space-separated-tokens/index.js";
6
- import S from "../../../_virtual/index3.js";
6
+ import S from "../../../_virtual/index4.js";
7
7
  import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
8
8
  import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
9
9
  import { VFileMessage as h } from "../../vfile-message/lib/index.js";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import e from "../../../../_virtual/index5.js";
2
+ import e from "../../../../_virtual/index3.js";
3
3
  var r = new e(), n = "recharts.syncEvent.tooltip";
4
4
  export {
5
5
  n as TOOLTIP_SYNC_EVENT,
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { bail as P } from "../../bail/index.js";
3
- import y from "../../../_virtual/index4.js";
3
+ import y from "../../../_virtual/index5.js";
4
4
  import z from "../../is-plain-obj/index.js";
5
5
  import { CallableInstance as C } from "./callable-instance.js";
6
6
  import { trough as A } from "../../trough/lib/index.js";