@danxbot/ui 6.3.8 → 6.4.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.
@@ -120,7 +120,37 @@ export interface AppShellProps {
120
120
  * box itself.
121
121
  */
122
122
  scrollResetKey?: string | number;
123
+ /**
124
+ * Remembers whether the sidebar is collapsed, under `danxbot-<persistId>`.
125
+ * `false` stops it being remembered at all.
126
+ *
127
+ * COLLAPSING IS THE ONE GESTURE ON THIS SHELL THAT ONLY MAKES SENSE KEPT.
128
+ * Its entire purpose is to give the content the sidebar's width back, and it
129
+ * was plain `useState` — so every refresh handed the width straight back to
130
+ * the navigation. Somebody who wants a narrow sidebar wants it on every load;
131
+ * re-collapsing it on each one is the app forgetting a decision that was
132
+ * never provisional.
133
+ *
134
+ * NOTE THE DIFFERENCE FROM `PanelGroup`'s `persistId`, which is undefined by
135
+ * default and persists nothing until a caller names it. That is right there
136
+ * and wrong here: a page can hold any number of panel groups, so none of them
137
+ * can claim a default key without colliding with the next one, whereas an
138
+ * application has exactly ONE shell and can safely name itself. Two shells on
139
+ * one origin — a shell previewed inside a shell — give the inner one its own
140
+ * id, which is what the test for that case pins.
141
+ *
142
+ * It is the ONLY thing this component stores, and it is the only KIND of
143
+ * thing it should: a per-viewer arrangement that can come back empty with no
144
+ * consequence. Every read and write goes through `lib/persist`, which
145
+ * swallows the throw `localStorage` raises in a private window or wherever
146
+ * storage is blocked by policy — the read happens in a `useState`
147
+ * initializer, where an unhandled throw unmounts the whole tree. A blocked
148
+ * browser gets an expanded sidebar and a working app, never a blank page.
149
+ *
150
+ * @default "app-shell-sidebar"
151
+ */
152
+ persistId?: string | false;
123
153
  children: ReactNode;
124
154
  className?: string;
125
155
  }
126
- export declare function AppShell({ brand, sections, activeId, sidebarFooter, header, contentLandmark, navLabel, scroll, scrollResetKey, children, className, }: AppShellProps): import("react").JSX.Element;
156
+ export declare function AppShell({ brand, sections, activeId, sidebarFooter, header, contentLandmark, navLabel, scroll, scrollResetKey, persistId, children, className, }: AppShellProps): import("react").JSX.Element;
@@ -14,6 +14,12 @@ declare const tabs: import("tailwind-variants").TVReturnType<{
14
14
  indicator: string;
15
15
  };
16
16
  };
17
+ fill: {
18
+ true: {
19
+ root: string;
20
+ panel: string;
21
+ };
22
+ };
17
23
  }, {
18
24
  root: string;
19
25
  list: string;
@@ -33,6 +39,12 @@ declare const tabs: import("tailwind-variants").TVReturnType<{
33
39
  indicator: string;
34
40
  };
35
41
  };
42
+ fill: {
43
+ true: {
44
+ root: string;
45
+ panel: string;
46
+ };
47
+ };
36
48
  }, {
37
49
  root: string;
38
50
  list: string;
@@ -52,6 +64,12 @@ declare const tabs: import("tailwind-variants").TVReturnType<{
52
64
  indicator: string;
53
65
  };
54
66
  };
67
+ fill: {
68
+ true: {
69
+ root: string;
70
+ panel: string;
71
+ };
72
+ };
55
73
  }, {
56
74
  root: string;
57
75
  list: string;
@@ -60,10 +78,37 @@ declare const tabs: import("tailwind-variants").TVReturnType<{
60
78
  panel: string;
61
79
  }>>;
62
80
  export interface TabsProps extends Omit<BaseTabs.Root.Props, "className">, VariantProps<typeof tabs> {
81
+ /**
82
+ * Fill the height this group was given, instead of sizing to the content of
83
+ * whichever panel is open.
84
+ *
85
+ * THIS IS THE SHAPE `AppShell` ASKS FOR AND A TABBED SCREEN COULD NOT GIVE.
86
+ * The shell bounds the viewport and hands its content column a real height;
87
+ * its own instruction to a screen that wants to use it is "write `flex-1
88
+ * min-h-0`, and never name a viewport unit". A tabbed screen was the one
89
+ * arrangement where that could not be honoured — the root here passes a
90
+ * height DOWN (it is already a flex column) but claims none of its own, and
91
+ * the panel below it is a plain block, so the two together are an
92
+ * auto-height gap in the middle of an otherwise sound chain. The only way
93
+ * through was for the content inside to name a fraction of the viewport,
94
+ * which is precisely the arithmetic the shell exists to have ended.
95
+ *
96
+ * OPT-IN, AND THAT IS THE DESIGN RATHER THAN CAUTION. A tab group inside a
97
+ * card is the ordinary case and must keep sizing to its content. It also
98
+ * cannot be a default safely: a consumer rendering SEVERAL panels at once
99
+ * (Base UI also keeps an OUTGOING panel mounted for the length of its exit
100
+ * transition, so even a one-panel group briefly has two) would have them
101
+ * split the same free space between them. Filling is a claim about the box
102
+ * this group was handed, so the caller who knows that box is the one who
103
+ * makes it.
104
+ *
105
+ * @default false
106
+ */
107
+ fill?: boolean;
63
108
  className?: string;
64
109
  ref?: Ref<HTMLDivElement>;
65
110
  }
66
- export declare function Tabs({ variant, className, children, ref, ...props }: TabsProps): import("react").JSX.Element;
111
+ export declare function Tabs({ variant, fill, className, children, ref, ...props }: TabsProps): import("react").JSX.Element;
67
112
  export interface TabListProps {
68
113
  className?: string;
69
114
  children: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "6.3.8",
3
+ "version": "6.4.0",
4
4
  "type": "module",
5
5
  "description": "Danxbot — a domain-agnostic React design system with motion as a first-class primitive.",
6
6
  "license": "MIT",