@alexandregme/zljs 2.0.0 → 2.0.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/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@ A change that needs action in an app has a **Migration** note. When updating, re
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [2.0.1] - 2026-11-03
12
+
13
+ ### Changed
14
+
15
+ - The colored toasts of `Toaster` follow the `--color-zl-*` theme values: the text is the `-strong` value, the background is the color at 15% over white and the border is the color at 30%. `error` uses `danger`
16
+
17
+ ### Fixed
18
+
19
+ - `Toaster` holds 4.5:1 on the text of each toast type. The rich colors of Sonner stayed under it on their light backgrounds
20
+ - A toast from `useToastStore` no longer replaces a toast from `toast()` that is showing. Both numbered their toasts from 1
21
+ - A toast and its close button draw a real focus outline in the text color. Their `box-shadow` ring was about 1.6:1 and disappeared in forced colors mode
22
+
11
23
  ## [2.0.0] - 2026-11-03
12
24
 
13
25
  ### Added
@@ -323,7 +335,8 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
323
335
 
324
336
  The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
325
337
 
326
- [Unreleased]: https://github.com/alexandregme/zljs/compare/v2.0.0...HEAD
338
+ [Unreleased]: https://github.com/alexandregme/zljs/compare/v2.0.1...HEAD
339
+ [2.0.1]: https://github.com/alexandregme/zljs/compare/v2.0.0...v2.0.1
327
340
  [2.0.0]: https://github.com/alexandregme/zljs/compare/v1.19.1...v2.0.0
328
341
  [1.19.1]: https://github.com/alexandregme/zljs/compare/v1.19.0...v1.19.1
329
342
  [1.19.0]: https://github.com/alexandregme/zljs/compare/v1.18.1...v1.19.0
@@ -166,16 +166,40 @@ var useToastStore = create()(
166
166
  // core/toaster/toaster.tsx
167
167
  import { useEffect } from "react";
168
168
  import { Toaster as SonnerToaster, toast } from "sonner";
169
+
170
+ // core/toaster/toaster.styles.ts
171
+ import { tv as tv4 } from "tailwind-variants";
172
+ var focusOutline = "focus-visible:outline-2! focus-visible:outline-offset-2! focus-visible:outline-current!";
173
+ var toaster = tv4({
174
+ slots: {
175
+ toast: focusOutline,
176
+ closeButton: focusOutline
177
+ }
178
+ });
179
+ var toasterColors = {
180
+ "--success-text": "var(--color-zl-success-strong)",
181
+ "--success-bg": "color-mix(in oklab, var(--color-zl-success) 15%, white)",
182
+ "--success-border": "color-mix(in oklab, var(--color-zl-success) 30%, white)",
183
+ "--info-text": "var(--color-zl-info-strong)",
184
+ "--info-bg": "color-mix(in oklab, var(--color-zl-info) 15%, white)",
185
+ "--info-border": "color-mix(in oklab, var(--color-zl-info) 30%, white)",
186
+ "--warning-text": "var(--color-zl-warning-strong)",
187
+ "--warning-bg": "color-mix(in oklab, var(--color-zl-warning) 15%, white)",
188
+ "--warning-border": "color-mix(in oklab, var(--color-zl-warning) 30%, white)",
189
+ "--error-text": "var(--color-zl-danger-strong)",
190
+ "--error-bg": "color-mix(in oklab, var(--color-zl-danger) 15%, white)",
191
+ "--error-border": "color-mix(in oklab, var(--color-zl-danger) 30%, white)"
192
+ };
193
+
194
+ // core/toaster/toaster.tsx
169
195
  import { jsx as jsx4 } from "react/jsx-runtime";
170
196
  var Toaster = () => {
171
197
  const toasts = useToastStore((s) => s.toasts);
172
198
  const removeToast = useToastStore((s) => s.removeToast);
199
+ const { toast: toastStyles, closeButton } = toaster();
173
200
  useEffect(() => {
174
201
  toasts.forEach((t) => {
175
- toast[t.type](t.message, {
176
- id: t.id,
177
- onDismiss: () => removeToast(t.id)
178
- });
202
+ toast[t.type](t.message, { id: `store-${t.id}` });
179
203
  removeToast(t.id);
180
204
  });
181
205
  }, [toasts, removeToast]);
@@ -187,7 +211,11 @@ var Toaster = () => {
187
211
  closeButton: true,
188
212
  duration: 4e3,
189
213
  expand: true,
190
- visibleToasts: 5
214
+ visibleToasts: 5,
215
+ style: toasterColors,
216
+ toastOptions: {
217
+ classNames: { toast: toastStyles(), closeButton: closeButton() }
218
+ }
191
219
  }
192
220
  );
193
221
  };
@@ -350,8 +378,8 @@ var spinnerIcons = {
350
378
  };
351
379
 
352
380
  // core/spinner/spinner.styles.ts
353
- import { tv as tv4 } from "tailwind-variants";
354
- var spinner = tv4({
381
+ import { tv as tv5 } from "tailwind-variants";
382
+ var spinner = tv5({
355
383
  base: "inline-flex animate-spin"
356
384
  });
357
385
 
@@ -373,8 +401,8 @@ var Spinner = ({
373
401
  );
374
402
 
375
403
  // core/loader/loader.styles.ts
376
- import { tv as tv5 } from "tailwind-variants";
377
- var loader = tv5({
404
+ import { tv as tv6 } from "tailwind-variants";
405
+ var loader = tv6({
378
406
  base: "flex fixed inset-0 justify-center items-center bg-black/20 text-zl-primary z-50"
379
407
  });
380
408
 
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  usePageStore,
13
13
  useRouterStore,
14
14
  useToastStore
15
- } from "./chunk-O6UAZGBC.js";
15
+ } from "./chunk-5VIR5UAF.js";
16
16
  import {
17
17
  Error,
18
18
  FormInput,
@@ -7,7 +7,7 @@ import {
7
7
  Toaster,
8
8
  usePageStore,
9
9
  useRouterStore
10
- } from "../chunk-O6UAZGBC.js";
10
+ } from "../chunk-5VIR5UAF.js";
11
11
 
12
12
  // core/next/root-layout/root-layout.styles.ts
13
13
  import { tv } from "tailwind-variants";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandregme/zljs",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
5
5
  "keywords": [
6
6
  "react",