@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/ui",
3
- "version": "0.37.0",
3
+ "version": "0.37.1",
4
4
  "description": "Estiva's design tokens (the contract) and a small set of primitives (a convenience) for every Estiva app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/registry.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "kind": "package",
5
5
  "repo": "estiva-ui",
6
6
  "package": "@estiva-app/ui",
7
- "packageVersion": "0.37.0",
7
+ "packageVersion": "0.37.1",
8
8
  "exports": 88,
9
9
  "typeExports": 97,
10
10
  "files": null
@@ -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 its column gives it (`flex-1 min-h-0`), never its content's
21
- * height, so the body is what scrolls, not the page. Two panels in one column
22
- * share it; a `max-h-*` in `className` caps one of them.
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.