@still-void/ui 3.2.0 → 3.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,70 @@
1
1
  # @still-void/ui
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`7e3ec95`](https://github.com/KalleoPinheiro/still-void/commit/7e3ec95bca55850496e663c855811efbfbb97bda) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add action slot to Alert component.
8
+
9
+ The Alert component now accepts an `action` prop (a ReactNode) that renders inside a `.sv-alert__action` element. The action slot is not rendered if the prop is omitted, keeping the DOM clean. Works seamlessly with variant classes and icons from T1.
10
+
11
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`31e8ea2`](https://github.com/KalleoPinheiro/still-void/commit/31e8ea27c290cb0f7c44b61ee465bd79b9d96685) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add semantic variant to Alert component with derived role and default icon.
12
+
13
+ The Alert component now accepts a `variant` prop ('info', 'success', 'warning', 'danger') that automatically derives the appropriate `role` ('alert' for danger/warning, 'status' for info/success) and renders a semantic icon. The icon can be customized via the `icon` prop or hidden with `icon={null}`. Alerts without a variant maintain their current behavior unchanged.
14
+
15
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`ca4b68e`](https://github.com/KalleoPinheiro/still-void/commit/ca4b68efa588c88ba9cfad0f56d479c938ebb5a9) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add createMediaQuery behavior for responsive breakpoint detection.
16
+
17
+ Introduces `createMediaQuery(query: string)` as a framework-agnostic controllable media query source with `getSnapshot()`, `subscribe()`, and `destroy()` methods. Complements `useMediaQuery` hook for safe hydration in Server Components. Gracefully degrades when `matchMedia` is unavailable (e.g., jsdom without stub).
18
+
19
+ Also adds a global `matchMedia` stub to `tests/setup.ts` with default `matches: false` (mobile, below-breakpoint, for the `(min-width: …px)` query used by `SidebarProvider`) for consistent test behavior across the suite.
20
+
21
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`18274db`](https://github.com/KalleoPinheiro/still-void/commit/18274db39916bcd16b052a20a9db1b982f76cdda) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add SidebarInset component for responsive content area.
22
+
23
+ Introduces `SidebarInset` as the main content container that adjusts responsively to sidebar state via CSS selectors reading `data-state` and `data-collapsible` attributes from the wrapper. Renders as `<main class="sv-app-sidebar-inset">` and supports custom className merging. Allows layout to adapt without JavaScript calculations, following Flat-By-Default Rule.
24
+
25
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`e1101a0`](https://github.com/KalleoPinheiro/still-void/commit/e1101a0da6989c2ec35929c1c84edd049fb56205) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add @radix-ui/react-toast as a direct runtime dependency for Toast components.
26
+
27
+ The `@radix-ui/react-toast` primitive is now available as a direct dependency, enabling the `ToastProvider` and `useToast` implementation. The package is client-only and does not affect the server-safe entry point. This represents a new capability for the design system.
28
+
29
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`b85481f`](https://github.com/KalleoPinheiro/still-void/commit/b85481f15d2af981dbd5b7b5b958210e78ac9c41) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add icon and none collapsible modes to the app sidebar.
30
+
31
+ Extends `SidebarProvider` with `collapsible` prop supporting `'icon'` (displays rail of icons when closed on desktop, drawer on mobile), `'offcanvas'` (default, drawer on mobile), and `'none'` (always expanded, no trigger rendered). `SidebarTrigger` returns `null` when `collapsible="none"`. All modes render `data-collapsible` attribute for CSS-driven styling.
32
+
33
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`3b61541`](https://github.com/KalleoPinheiro/still-void/commit/3b6154102772c8e92761d8722703bf6abff9661e) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add SidebarProvider and useSidebar for responsive app shell.
34
+
35
+ Introduces `SidebarProvider` component providing state management for application sidebar with breakpoint detection via `useMediaQuery`. Includes `useSidebar()` hook exposing `{ open, setOpen, toggle, isMobile, collapsible, panelId }`. Supports both controlled and uncontrolled modes. Default `collapsible` mode is `'offcanvas'`. Invalid breakpoint values fall back to 1024px. Wrapper element (`.sv-app-shell`) emits `data-state`, `data-collapsible`, and `data-mobile` attributes for CSS-driven responsive layout. Exported from `@still-void/ui/react/client`.
36
+
37
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`62a60e7`](https://github.com/KalleoPinheiro/still-void/commit/62a60e731e776fd5fc50745c94fc819a1002c92f) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add SidebarPanel, SidebarTrigger and SidebarInset components for app shell.
38
+
39
+ Introduces responsive sidebar components: `SidebarPanel` renders statically in-flow above breakpoint or as off-canvas drawer below, `SidebarTrigger` provides menu button with toggle functionality, and `SidebarInset` is the content container that adjusts via CSS. Exports from `@still-void/ui/react/client`. Depends on `useMediaQuery` for breakpoint detection and `@radix-ui/react-dialog` for drawer modal behavior (already installed). Focus management and scroll-lock handled by Radix Dialog.
40
+
41
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`15ea2b0`](https://github.com/KalleoPinheiro/still-void/commit/15ea2b0fb6d42161f33bcd51ae5ebe42639aec66) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add action support to toasts.
42
+
43
+ Extends `ToastOptions` with optional `action` parameter containing label, required altText, and onClick callback. Renders as a button within the toast with accompanying close button. Action click dismisses the toast after executing callback. AltText requirement enforced by types.
44
+
45
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`2150d78`](https://github.com/KalleoPinheiro/still-void/commit/2150d78c42b0e40a2cbac8e419bb387b006bb8a4) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add dismiss, dismissAll and update handles to useToast.
46
+
47
+ `toast()` returns `{ id, dismiss, update }` handle. `dismiss(id)` removes specific toast; `dismissAll()` empties queue. `update(patch)` modifies toast content in-place without remounting. Non-existent dismisses are no-op; double-dismiss on same handle is no-op.
48
+
49
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`3a16b4a`](https://github.com/KalleoPinheiro/still-void/commit/3a16b4a628ac908d5e631c4c69264758cc8f0c9c) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add ToastProvider and useToast for transient notifications.
50
+
51
+ Introduces `ToastProvider` + `useToast()` hook for dismissible, auto-dismissing toast notifications with four semantic variants (info, success, warning, danger), automatic stacking (default max 3), pause-on-hover, and optional action buttons. Replaces manual toast implementations across multiple screens. Wraps `@radix-ui/react-toast` (new dependency, already verified for marginal install cost and `'use client'` boundary isolation) with a queue management layer. Exported from `@still-void/ui/react/client`.
52
+
53
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`6020c3e`](https://github.com/KalleoPinheiro/still-void/commit/6020c3ef3e3c66342dae1d2bedfa84f002c3e8a3) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add useMediaQuery hook for responsive breakpoint detection.
54
+
55
+ Introduces `useMediaQuery(query: string)` hook built on `createMediaQuery` and `useSyncExternalStore` for safe SSR hydration. Provides a server snapshot (`false`) that matches on initial render, then reflects the true client-side media query state after hydration without triggering mismatch warnings. Exported from `@still-void/ui/react/client` along with `createMediaQuery` and `MediaQueryController` type.
56
+
57
+ ### Patch Changes
58
+
59
+ - [#22](https://github.com/KalleoPinheiro/still-void/pull/22) [`03d0e82`](https://github.com/KalleoPinheiro/still-void/commit/03d0e823bfbeccfe8811f8f2334a70d40bc8d831) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Fix correctness bugs found by review in the round-5 App Shell / Toast / Alert work (all unreleased in this cycle):
60
+
61
+ - `SidebarPanel`: `collapsible="none"` no longer renders an undismissable mobile drawer; the drawer ref now forwards to `Dialog.Content` so consumer refs work below the breakpoint.
62
+ - `SidebarTrigger`: a consumer `onClick` is now called alongside the internal toggle instead of being silently replaced.
63
+ - `ToastProvider`: the mount flag now resets on remount, so a toast fired during a React Strict Mode dev remount no longer silently no-ops; the action and close buttons are explicit `type="button"` so they don't submit a surrounding form; toast content is no longer wrapped in an unclassed `<div>`, restoring the intended flex layout.
64
+ - `Alert`: variant lookup checks own keys only (rejects `"constructor"`/`"toString"`); a custom `icon` node that isn't a `React.isValidElement` (a string, number, or array) is now rendered instead of silently dropped.
65
+ - `createMediaQuery`: a transition notifies a snapshot of listeners, so one listener unsubscribing mid-transition no longer causes the next listener to be skipped.
66
+ - CSS: `.sv-toast__action:hover` referenced an undefined `--sv-surface-3` token; now uses the same surface-2/surface pair as `.sv-btn--secondary`, which shares its base color.
67
+
3
68
  ## 3.2.0
4
69
 
5
70
  ### Minor Changes
package/README.md CHANGED
@@ -21,7 +21,7 @@ changes (Tailwind v4 is now required, and the v3 preset is gone).
21
21
  | **Component CSS** | `@still-void/ui/style.css` | browser | All component classes (`sv-*`) — every component this package ships needs only this, never Tailwind |
22
22
  | **Tailwind theme (optional)** | `@still-void/ui/tailwind.css` | browser (Tailwind v4 build) | `@theme inline` mapping `--color-sv-*`/`--font-sv-*`/`--spacing`/`--radius-sv-*` to `var(--sv-*)`, for `bg-sv-surface`-style utilities in **your own** markup |
23
23
  | **React (server-safe)** | `@still-void/ui/react` | server or client | Tokens, recipes, and components without hooks — render inside Server Components |
24
- | **React (client)** | `@still-void/ui/react/client` | client | `'use client'` bundle: DOM behaviors (`createThemeManager`, `createScrollSpy`, `createReadingProgress`, `copyToClipboard`), `ThemeProvider`, `ThemeToggle`, `CopyButton`, `TableOfContents`, `ReadingProgress`, hooks |
24
+ | **React (client)** | `@still-void/ui/react/client` | client | `'use client'` bundle: DOM behaviors (`createThemeManager`, `createScrollSpy`, `createReadingProgress`, `createMediaQuery`, `copyToClipboard`), `ThemeProvider`, `ThemeToggle`, `CopyButton`, `TableOfContents`, `ReadingProgress`, app shell (`SidebarProvider`, `SidebarPanel`, `SidebarTrigger`, `SidebarInset`), toast (`ToastProvider`), hooks |
25
25
 
26
26
  ## Install
27
27
 
@@ -158,7 +158,7 @@ A selection of **shadcn/ui** components has been ported to Still Void with the d
158
158
  - `Card` — with header, title, description, content, footer; renders as `<div>` by default, or any of `section`/`article`/`li`/`aside` via `as`, or merges onto a single child via `asChild`
159
159
  - `Icon` — a curated set of icons (`@heroicons/react` under the hood) with `size` (`sm`/`md`/`lg`) and an accessible `label`
160
160
  - `Input` — text input with placeholder, disabled, and focus states
161
- - `Alert` — with optional title and description
161
+ - `Alert` — with optional semantic `variant` (info/success/warning/danger), automatic icon and role derivation, and an optional `action` slot; zero-regression default when variant is omitted
162
162
  - `Badge` — with variants (default, secondary, destructive, outline)
163
163
  - `Textarea` — multi-line text field sharing `Input`'s frame, plus `rows`
164
164
  - `NativeSelect` — a real `<select>`, serializable via `FormData`; coexists with the client-only `Select` combobox (see [docs/design-system.md](docs/design-system.md))
@@ -166,11 +166,14 @@ A selection of **shadcn/ui** components has been ported to Still Void with the d
166
166
  - `Checkbox` — `<input type="checkbox">`, no wrapper
167
167
  - `RadioGroup` / `RadioGroupItem` — `<fieldset>`/`<legend>` group of native radios
168
168
  - `Table` family — `Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableRow`, `TableHead`, `TableCell`, `TableCaption`, a presentational data table with a scrolling container
169
+ - `Sidebar` / `SidebarSection` — content sidebar (blog table of contents, article navigation); static rail at all viewport widths. **Coexists with the client-only `SidebarPanel`** for responsive app shells — see [docs/design-system.md](docs/design-system.md)
169
170
 
170
171
  All of the above style themselves through real `sv-*` CSS classes — **no Tailwind required**,
171
172
  for any component this package ships, in any version.
172
173
 
173
174
  **Client-only components** (import from `@still-void/ui/react/client`):
175
+ - `SidebarProvider` / `SidebarPanel` / `SidebarTrigger` / `SidebarInset` / `useSidebar` — responsive app shell with toggleable sidebar (drawer below breakpoint, static panel above); read/control state via context
176
+ - `ToastProvider` / `useToast` — notification queue (up to 3 by default, configurable), auto-dismiss (5s default), pause on hover/focus; four severities with semantic `aria-live` announcements
174
177
  - `Dialog` — modal with trigger, content, header, footer, title, description; renders a close button by default (`showCloseButton={false}` to opt out)
175
178
  - `AlertDialog` — the same modal mechanics as `Dialog`, without a close button, for destructive confirmations that must be resolved through explicit `Action`/`Cancel`
176
179
  - `Select` — dropdown with groups, labels, and scroll