@estiva-app/ui 0.90.0 → 0.90.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.90.0",
3
+ "version": "0.90.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.90.0",
7
+ "packageVersion": "0.90.1",
8
8
  "exports": 210,
9
9
  "typeExports": 211,
10
10
  "files": null
@@ -1,6 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite'
2
2
  import { useState } from 'react'
3
3
  import { IconMenu2, IconSquareRounded } from '@tabler/icons-react'
4
+ import { expect, userEvent, within } from 'storybook/test'
4
5
  import { AppShell } from './AppShell'
5
6
  import { Banner } from './Banner'
6
7
  import { EmptyState } from './EmptyState'
@@ -117,6 +118,16 @@ export const InsetFolds: Story = {
117
118
  </AppShell>
118
119
  )
119
120
  },
121
+ // Measured as drawn: in a Tailwind 3 app the `hidden` attribute alone loses to a display class (LED-3, 0.90.0).
122
+ play: async ({ canvasElement }) => {
123
+ const canvas = within(canvasElement)
124
+ const drawn = () => canvasElement.querySelector('nav')?.getBoundingClientRect().width ?? 0
125
+ await expect(drawn()).toBeGreaterThan(0)
126
+ await userEvent.click(canvas.getByRole('button', { name: 'Hide the sidebar' }))
127
+ await expect(drawn()).toBe(0)
128
+ await userEvent.click(canvas.getByRole('button', { name: 'Show the sidebar' }))
129
+ await expect(drawn()).toBeGreaterThan(0)
130
+ },
120
131
  }
121
132
 
122
133
  export const InsetWithBanner: Story = {
package/src/AppShell.tsx CHANGED
@@ -136,8 +136,9 @@ export function AppShell({ variant = 'solid', menu, logo, search, onSearch, sear
136
136
  {bar}
137
137
  <div className="flex min-h-0 flex-1">
138
138
  {/* Folded, the navigation stays mounted and hidden, so it comes back as it was left (its scroll, its open
139
- rows); open, `contents` keeps it a direct flex child of the row. */}
140
- <div className="contents" hidden={!navOpen}>
139
+ rows); open, `contents` keeps it a direct flex child of the row. Hidden by the class as well as the
140
+ attribute: in a Tailwind 3 app `[hidden]` loses to `.contents`, and the sidebar stayed drawn (0.90.0). */}
141
+ <div className={navOpen ? 'contents' : 'hidden'} hidden={!navOpen}>
141
142
  <SidebarOnGround.Provider value={inset}>{nav}</SidebarOnGround.Provider>
142
143
  </div>
143
144
  {/* Folded: the inset card keeps a left margin as wide as its right one. */}