@alexandregme/zljs 1.18.1 → 1.19.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
@@ -8,6 +8,25 @@ A change that needs action in an app has a **Migration** note. When updating, re
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [1.19.0] - 2026-11-02
12
+
13
+ ### Added
14
+
15
+ - `label` on `Spinner`: the name screen readers announce, `Loading` by default
16
+
17
+ ### Changed
18
+
19
+ - `Spinner` is a status with a name (`role="status"`) and has no color of its own. It was always white, and now inherits the color from around it
20
+ - `Loader` draws its spinner in the `primary` color, which holds 3:1 over the overlay on a white page. It was white, at 1.6:1. The `status` role moved from the overlay to the spinner, which takes the `label`
21
+
22
+ #### Migration
23
+
24
+ Search the app for `<Spinner`. On a dark surface, set a light text color around it, such as `text-white`. Remove a `role="status"` the app put around a `Spinner`, so there aren't two. `Loader` needs no change.
25
+
26
+ ### Fixed
27
+
28
+ - `Loader` covers the whole page. It had no position of its own, so it started where it was rendered, below anything before it
29
+
11
30
  ## [1.18.1] - 2026-11-02
12
31
 
13
32
  ### Removed
@@ -263,7 +282,8 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
263
282
 
264
283
  The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
265
284
 
266
- [Unreleased]: https://github.com/alexandregme/zljs/compare/v1.18.1...HEAD
285
+ [Unreleased]: https://github.com/alexandregme/zljs/compare/v1.19.0...HEAD
286
+ [1.19.0]: https://github.com/alexandregme/zljs/compare/v1.18.1...v1.19.0
267
287
  [1.18.1]: https://github.com/alexandregme/zljs/compare/v1.18.0...v1.18.1
268
288
  [1.18.0]: https://github.com/alexandregme/zljs/compare/v1.17.0...v1.18.0
269
289
  [1.17.0]: https://github.com/alexandregme/zljs/compare/v1.16.0...v1.17.0
@@ -352,17 +352,30 @@ var spinnerIcons = {
352
352
  // core/spinner/spinner.styles.ts
353
353
  import { tv as tv4 } from "tailwind-variants";
354
354
  var spinner = tv4({
355
- base: "inline-flex animate-spin text-white"
355
+ base: "inline-flex animate-spin"
356
356
  });
357
357
 
358
358
  // core/spinner/spinner.tsx
359
359
  import { jsx as jsx6 } from "react/jsx-runtime";
360
- var Spinner = ({ variant = "circle", size = "md" }) => /* @__PURE__ */ jsx6("span", { "data-testid": "spinner", className: spinner(), children: /* @__PURE__ */ jsx6(Icon, { name: spinnerIcons[variant], size }) });
360
+ var Spinner = ({
361
+ variant = "circle",
362
+ size = "md",
363
+ label = "Loading"
364
+ }) => /* @__PURE__ */ jsx6(
365
+ "span",
366
+ {
367
+ "data-testid": "spinner",
368
+ role: "status",
369
+ "aria-label": label,
370
+ className: spinner(),
371
+ children: /* @__PURE__ */ jsx6(Icon, { name: spinnerIcons[variant], size })
372
+ }
373
+ );
361
374
 
362
375
  // core/loader/loader.styles.ts
363
376
  import { tv as tv5 } from "tailwind-variants";
364
- var overlay = tv5({
365
- base: "flex fixed justify-center items-center w-full h-full bg-black/20 z-50"
377
+ var loader = tv5({
378
+ base: "flex fixed inset-0 justify-center items-center bg-black/20 text-zl-primary z-50"
366
379
  });
367
380
 
368
381
  // core/loader/loader.tsx
@@ -370,7 +383,7 @@ import { jsx as jsx7 } from "react/jsx-runtime";
370
383
  var Loader = ({ label = "Loading" }) => {
371
384
  const fetching = useAppStore((s) => s.fetching);
372
385
  if (!fetching) return null;
373
- return /* @__PURE__ */ jsx7("div", { role: "status", "aria-label": label, className: overlay(), children: /* @__PURE__ */ jsx7(Spinner, { size: "lg" }) });
386
+ return /* @__PURE__ */ jsx7("div", { className: loader(), children: /* @__PURE__ */ jsx7(Spinner, { size: "lg", label }) });
374
387
  };
375
388
 
376
389
  export {
package/dist/index.d.ts CHANGED
@@ -431,9 +431,10 @@ type SpinnerVariant = "circle" | "dots" | "refresh";
431
431
  interface SpinnerProps {
432
432
  variant?: SpinnerVariant;
433
433
  size?: Size;
434
+ label?: string;
434
435
  }
435
436
 
436
- declare const Spinner: ({ variant, size }: SpinnerProps) => react.JSX.Element;
437
+ declare const Spinner: ({ variant, size, label, }: SpinnerProps) => react.JSX.Element;
437
438
 
438
439
  interface LoaderProps {
439
440
  label?: string;
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  usePageStore,
13
13
  useRouterStore,
14
14
  useToastStore
15
- } from "./chunk-KPSFYQYV.js";
15
+ } from "./chunk-O6UAZGBC.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-KPSFYQYV.js";
10
+ } from "../chunk-O6UAZGBC.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": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
5
5
  "keywords": [
6
6
  "react",