hazo_ui 4.10.0 → 5.1.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/CHANGE_LOG.md CHANGED
@@ -5,7 +5,58 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## v4.10.0 (2026-07-09)
8
+ ## v5.1.0 (2026-07-10)
9
+
10
+ ### New
11
+ - **`HazoUiKanban` card editor: `richtext` field type** — `editorFields` now
12
+ accepts `type: 'richtext'`, which renders the package's existing
13
+ `HazoUiRte` (`hazo_ui_rte`) in place of a plain text input. No new
14
+ dependency — TipTap was already required by this package. Binds to a
15
+ string HTML key on the item; `on_change` writes `RteOutput.html` back
16
+ into the draft. As with `select`/`checkbox`, `required` gating is not
17
+ honored for `richtext` (an "empty" RTE still emits `<p></p>`, not `""`).
18
+ Auto-detected fields are unaffected — `richtext` is opt-in via
19
+ `editorFields` only.
20
+ - **`HazoUiKanban`: double-click to open the card editor** — double-clicking
21
+ a card now opens the same editor as the pencil icon, gated by the same
22
+ `showEdit`/`onEditRequest` props (no new prop). PointerSensor's 5px drag
23
+ activation distance means this doesn't interfere with drag-and-drop.
24
+
25
+ ## v5.0.0 (2026-07-09)
26
+
27
+ ### BREAKING — theming rehomed onto hazo_theme
28
+ hazo_ui no longer owns theme tokens, a Tailwind preset, or its own theme
29
+ provider — `hazo_theme` is now the single source, and is a **required** peer
30
+ dependency (was optional).
31
+
32
+ - **Removed exports:** `./styles.css` and `./tailwind-preset` package exports
33
+ are gone (`dist/styles.css`, `tailwind.preset.js` no longer ship). Import
34
+ `hazo_theme/theme.css` (+ optionally a `hazo_theme/themes/<name>.css` brand
35
+ palette) in your app's globals instead of `hazo_ui/styles.css`.
36
+ - **`useTheme()` return shape changed:** `{ theme, setTheme, resolvedTheme,
37
+ toggleTheme }` → `{ mode, setMode, resolvedMode, toggleMode, themeSet,
38
+ setThemeSet }`. `HazoThemeProvider`'s `defaultTheme` prop is now
39
+ `defaultMode`; add `defaultThemeSet` to opt into a shipped brand palette.
40
+ `Theme`/`ThemeProviderProps`/`ThemeContextValue` types are removed — use
41
+ `ThemeMode`/`HazoThemeProviderProps`/`HazoThemeContextValue` from
42
+ `hazo_theme/client` (re-exported from the `hazo_ui` root).
43
+ - **New export:** `ThemeSetPicker`, re-exported from `hazo_theme/client`,
44
+ lets consumers switch between shipped theme-sets (`indigo-sunset`,
45
+ `ops-dark`, `soft-studio`, ...) at runtime.
46
+ - **Persisted-preference reset (one-time):** the localStorage key changed
47
+ from `"theme"` to `"hazo-theme"` (with `-mode`/`-set` suffixes), so a
48
+ user's saved theme choice resets to `"system"` once after upgrading.
49
+ - **hazo_ui's own kanban tokens deleted** (`--hazo-kanban-*` in
50
+ `src/styles/globals.css`) — now sourced from `hazo_theme`'s Tier-1 tokens
51
+ (`hazo_theme@^0.2.0`), same values, zero visual change, but consumers
52
+ MUST import `hazo_theme/theme.css` for kanban components to render with
53
+ the intended colors (previously baked into `hazo_ui`'s own CSS).
54
+ - **Migration:** bump to `hazo_theme@^0.2.0` (now required, not optional),
55
+ swap `hazo_ui/styles.css` → `hazo_theme/theme.css` in your globals, and
56
+ update any `useTheme()`/`HazoThemeProvider` call sites for the
57
+ `theme`→`mode` rename.
58
+
59
+ ## Unreleased
9
60
 
10
61
  ### New
11
62
  - **`Logo`, `AppHeader`, `AppFooter` chrome components** (framework-neutral,
package/README.md CHANGED
@@ -216,8 +216,6 @@ The following components support both global config and prop-level color overrid
216
216
 
217
217
  - **[Theme Kit](#theme-kit-v490)** (v4.9.0) - SSR-safe dark/light theme using the shadcn `.dark`-class convention: `HazoThemeProvider`, `useTheme`, `ThemeToggle`, and a no-flash `ThemeScript`. Persists the chosen mode to `localStorage` and resolves `"system"` against the OS preference.
218
218
 
219
- - **[Chrome Components](#chrome-components-v4100)** (v4.10.0) - `Logo`, `AppHeader`, and `AppFooter` — framework-neutral header/footer/logo pieces that consume hazo_theme's `BrandIdentity` contract and its `footer-public-*`/`footer-app-*` chrome tokens. Every admin-configurable `<a href>` inside them runs through the new `safeHref()` scheme allowlist.
220
-
221
219
  ### State Primitives (v2.10.0)
222
220
 
223
221
  Lightweight, opinionated components for the four ubiquitous async states: **loading**, **empty**, **error**, and **success**.
@@ -252,46 +250,6 @@ SSR-safe dark/light theme using the shadcn `.dark`-class convention (toggles a `
252
250
 
253
251
  **Exports:** `HazoThemeProvider`, `useTheme`, `ThemeToggle`, `ThemeScript` and types `Theme`, `ThemeProviderProps`, `ThemeContextValue`, `ThemeScriptProps`, `ThemeToggleProps`.
254
252
 
255
- ### Chrome Components (v4.10.0)
256
-
257
- `Logo`, `AppHeader`, and `AppFooter` — framework-neutral chrome pieces that consume hazo_theme's
258
- `BrandIdentity` (type-only import; `hazo_theme` stays an optional peer) plus its
259
- `footer-public-*`/`footer-app-*` chrome tokens (import `hazo_theme/theme.css` for the tokens to
260
- resolve).
261
-
262
- ```tsx
263
- import { AppHeader, AppFooter } from 'hazo_ui';
264
- import type { BrandIdentity } from 'hazo_theme';
265
-
266
- const identity: BrandIdentity = {
267
- logoUrl: '/brand/logo.svg',
268
- appTitle: 'Acme',
269
- footer: { app: { copyright: '© 2026 Acme Inc.' } },
270
- };
271
-
272
- function Shell({ children }: { children: React.ReactNode }) {
273
- return (
274
- <>
275
- <AppHeader identity={identity} homeHref="/" actions={<UserMenu />} />
276
- {children}
277
- <AppFooter variant="app" identity={identity} />
278
- </>
279
- );
280
- }
281
- ```
282
-
283
- - `Logo({ logoUrl?, logoUrlDark?, appTitle?, href?, height?, className?, imgClassName? })` — logo
284
- image (swaps light/dark variants via `dark:hidden`/`dark:block`) or text fallback.
285
- - `AppHeader({ identity?, homeHref?, navItems?, actions?, className? })` — `bg-navbar` header bar.
286
- - `AppFooter({ variant: 'public' | 'app', footer?, identity?, className? })` — `'app'` renders a
287
- thin copyright/link strip (`bg-footer-app`); `'public'` renders a taller multi-column footer with
288
- a brand row and social links (`bg-footer-public`).
289
- - **`safeHref(url?: string): string | undefined`** — also exported standalone from the package
290
- root. Allows `http://`, `https://`, `mailto:`, and same-origin `/path` hrefs; returns `undefined`
291
- for anything else (`javascript:`, `data:`, protocol-relative `//host`, …). Used internally by
292
- every chrome-component `<a href>` sink; reach for it directly when rendering admin-configurable
293
- links elsewhere.
294
-
295
253
  ```tsx
296
254
  // app/layout.tsx
297
255
  import { HazoThemeProvider, ThemeScript } from 'hazo_ui';
@@ -3749,12 +3707,19 @@ on hover/focus). Clicking it opens a `HazoUiDialog` editor:
3749
3707
 
3750
3708
  Field types: `text`, `textarea`, `select`, `number`, `checkbox`,
3751
3709
  `priority` (a select pre-populated with `editorPriorities` —
3752
- defaults to `["P0","P1","P2","P3"]`).
3710
+ defaults to `["P0","P1","P2","P3"]`), `status` (a select pre-populated
3711
+ from `columns`, bound to `columnKey`), and `richtext` (renders the
3712
+ package's `HazoUiRte` rich text editor — binds to a string HTML key;
3713
+ `required` gating is not honored for this type, same as `select`/
3714
+ `checkbox`).
3753
3715
 
3754
3716
  If you don't pass `editorFields`, the library auto-detects all
3755
3717
  string-valued fields on the item (except `id`, `columnKey`, `priority`)
3756
3718
  and renders each as a text input with a humanized label.
3757
3719
 
3720
+ Besides the pencil icon, **double-clicking a card** also opens the
3721
+ editor — same `onCardSave`/`editorFields` config, no extra prop needed.
3722
+
3758
3723
  #### Custom form via renderCardEditor
3759
3724
 
3760
3725
  When the declarative config isn't enough, replace the dialog body