@estiva-app/ui 0.37.0 → 0.37.1
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/Panel.d.ts +6 -3
- package/dist/Panel.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/registry.json +1 -1
- package/src/Panel.stories.tsx +13 -0
- package/src/Panel.tsx +7 -4
package/package.json
CHANGED
package/registry.json
CHANGED
package/src/Panel.stories.tsx
CHANGED
|
@@ -84,6 +84,19 @@ export const TwoInAColumn: Story = {
|
|
|
84
84
|
),
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/** In a plain box with a height, not a flex column: it still fills it, and the body still scrolls. */
|
|
88
|
+
export const InAPlainBox: Story = {
|
|
89
|
+
decorators: [
|
|
90
|
+
(Story) => (
|
|
91
|
+
<div className="h-[560px] w-[380px] border-l border-border-subtle bg-bg-surface">
|
|
92
|
+
{Story()}
|
|
93
|
+
</div>
|
|
94
|
+
),
|
|
95
|
+
],
|
|
96
|
+
parameters: { layout: 'fullscreen' },
|
|
97
|
+
render: (args) => <Panel {...args}>{paragraphs(14)}</Panel>,
|
|
98
|
+
}
|
|
99
|
+
|
|
87
100
|
function Broken(): never {
|
|
88
101
|
throw new Error('The body could not draw itself')
|
|
89
102
|
}
|
package/src/Panel.tsx
CHANGED
|
@@ -17,9 +17,12 @@ import { ScrollArea } from './ScrollArea'
|
|
|
17
17
|
* nothing to scroll. Here the body is always a `ScrollArea`, so the bar shows
|
|
18
18
|
* as soon as there is more, and an empty panel or a short one has none.
|
|
19
19
|
*
|
|
20
|
-
* It takes the room
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* It takes the room it is given, never its content's height, so the body is
|
|
21
|
+
* what scrolls, not the page: the rest of a flex column (`flex-1 min-h-0`), or
|
|
22
|
+
* the whole of a plain box with a height (`h-full`). The second was missing in
|
|
23
|
+
* 0.37.0, and a panel in a plain box grew past it: Peek's thread story pushed
|
|
24
|
+
* its reply box out of its frame. Two panels in one column share it; a
|
|
25
|
+
* `max-h-*` in `className` caps one of them.
|
|
23
26
|
*
|
|
24
27
|
* It keeps a crash inside itself, as ListColumn does: if its body, its actions
|
|
25
28
|
* or its footer break, the panel keeps its title and shows `ErrorBoundary`'s
|
|
@@ -48,7 +51,7 @@ export interface PanelProps {
|
|
|
48
51
|
|
|
49
52
|
function Frame({ title, chevron = false, actions, children, footer, bodyClassName, bodyRef, onBodyScroll, className, broken = false }: PanelProps & { broken?: boolean }) {
|
|
50
53
|
return (
|
|
51
|
-
<div className={cn('flex min-h-0 flex-1 flex-col', className)}>
|
|
54
|
+
<div className={cn('flex h-full min-h-0 flex-1 flex-col', className)}>
|
|
52
55
|
<ContainerHeader title={title} chevron={chevron} actions={actions} />
|
|
53
56
|
{broken ? (
|
|
54
57
|
// The message takes the room the body had and centres itself in it.
|