@neo-ui-kit/react 1.3.15 → 1.3.17

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/README.md CHANGED
@@ -65,7 +65,7 @@ import "@neo-ui-kit/react/styles.css";
65
65
  To test repository changes before publishing, run `npm run package` from the repository root and install the resulting archive in a separate application:
66
66
 
67
67
  ```bash
68
- npm install /path/to/adui/release/neo-ui-kit-react-1.3.15.tgz
68
+ npm install /path/to/adui/release/neo-ui-kit-react-1.3.17.tgz
69
69
  ```
70
70
 
71
71
  Maintainers publish new versions from `Pro100Dimka/adui` using the `release.yml` GitHub Actions workflow, a matching `v<version>` tag, and the `npm-publication` environment. npm trusts its OIDC identity; no `NPM_TOKEN` is required. The workflow checks the project and packed consumer before publishing the tested archive. Published `1.0.0` cannot be overwritten: code and README changes in npm require a new package version. See the [repository release instructions](https://github.com/Pro100Dimka/adui#npm-пакет).
@@ -19,9 +19,18 @@ html:has(.ad-dialog[open]) {
19
19
  }
20
20
  /* Pointer light: a soft glow under the cursor, painted over the window's own surface. */
21
21
  .ad.ad-dialog[data-ad-material] {
22
- background:
23
- radial-gradient(26rem circle at var(--ad-spot-x, -40rem) var(--ad-spot-y, -40rem), rgb(from var(--ad-primary) r g b / 0.11), transparent 60%),
24
- var(--ad-surface-dialog);
22
+ background: var(--ad-surface-dialog);
23
+ }
24
+ .ad-dialog-spotlight {
25
+ position: absolute;
26
+ left: -26rem;
27
+ top: -26rem;
28
+ width: 52rem;
29
+ height: 52rem;
30
+ z-index: -2;
31
+ pointer-events: none;
32
+ background: radial-gradient(26rem circle, rgb(from var(--ad-primary) r g b / 0.11), transparent 60%);
33
+ transform: translate3d(var(--ad-spot-x, -40rem), var(--ad-spot-y, -40rem), 0);
25
34
  }
26
35
  .ad-dialog > .ad-header {
27
36
  flex-wrap: nowrap;
@@ -18,23 +18,33 @@
18
18
  margin-bottom: var(--ad-space-3);
19
19
  }
20
20
  /* Pointer spotlight: a soft ruby light under the cursor, faded in on hover. */
21
- .ad-card::after {
22
- /* The pointer position is not inherited by default: the light reads it from its own card. */
23
- --ad-spot-x: inherit;
24
- --ad-spot-y: inherit;
25
- content: "";
21
+ .ad-card-light {
26
22
  position: absolute;
27
23
  inset: 0;
28
24
  border-radius: inherit;
25
+ overflow: hidden;
26
+ opacity: 0;
27
+ transition: opacity 0.35s;
28
+ pointer-events: none;
29
+ }
30
+ .ad-card-spotlight {
31
+ position: absolute;
32
+ inset: 0;
33
+ transform: translate3d(var(--ad-spot-x, 50%), var(--ad-spot-y, 0%), 0);
34
+ }
35
+ .ad-card-spotlight::before {
36
+ content: "";
37
+ position: absolute;
38
+ width: 44rem;
39
+ height: 44rem;
40
+ left: -22rem;
41
+ top: -22rem;
29
42
  background: radial-gradient(
30
- 22rem circle at var(--ad-spot-x, 50%) var(--ad-spot-y, 0%),
43
+ 22rem circle,
31
44
  rgb(from var(--ad-primary) r g b / 0.08),
32
45
  transparent 60%
33
46
  );
34
- opacity: 0;
35
- transition: opacity 0.35s;
36
- pointer-events: none;
37
47
  }
38
- .ad-card:hover::after {
48
+ .ad-card:hover > .ad-card-light {
39
49
  opacity: 1;
40
50
  }
package/dist/index.js CHANGED
@@ -315,6 +315,7 @@ var Card = ({
315
315
  ...p
316
316
  }) => {
317
317
  const ref = useRef(null);
318
+ const spotlight = useRef(null);
318
319
  useBorder(ref, border, shell);
319
320
  usePauseOffscreen(ref);
320
321
  return createElement3(
@@ -330,12 +331,14 @@ var Card = ({
330
331
  "data-ad-padding": padding,
331
332
  // A soft light follows the pointer across the surface.
332
333
  onPointerMove: (event) => {
334
+ const style = spotlight.current?.style;
335
+ if (!style) return;
333
336
  const box = event.currentTarget.getBoundingClientRect();
334
- event.currentTarget.style.setProperty(
337
+ style.setProperty(
335
338
  "--ad-spot-x",
336
339
  `${event.clientX - box.left}px`
337
340
  );
338
- event.currentTarget.style.setProperty(
341
+ style.setProperty(
339
342
  "--ad-spot-y",
340
343
  `${event.clientY - box.top}px`
341
344
  );
@@ -353,7 +356,12 @@ var Card = ({
353
356
  compact: level > 2
354
357
  }
355
358
  ),
356
- children
359
+ children,
360
+ createElement3(
361
+ "span",
362
+ { className: "ad-card-light", "aria-hidden": true },
363
+ createElement3("span", { ref: spotlight, className: "ad-card-spotlight" })
364
+ )
357
365
  );
358
366
  };
359
367
 
@@ -2865,7 +2873,7 @@ var Dialog = (p) => {
2865
2873
  p.defaultOpen ?? false,
2866
2874
  p.onOpenChange
2867
2875
  ), [pending, setPending] = useState5(false), [error, setError] = useState5();
2868
- const ref = useRef10(null), confirmation = useRef10(0), confirming = useRef10(false), pressedOutside = useRef10(false), titleId = useId(), descId = useId();
2876
+ const ref = useRef10(null), spotlight = useRef10(null), confirmation = useRef10(0), confirming = useRef10(false), pressedOutside = useRef10(false), titleId = useId(), descId = useId();
2869
2877
  useLayoutEffect2(() => {
2870
2878
  confirming.current = false;
2871
2879
  setPending(false);
@@ -2911,13 +2919,15 @@ var Dialog = (p) => {
2911
2919
  pressedOutside.current = false;
2912
2920
  },
2913
2921
  onPointerMove: (e) => {
2922
+ const style = spotlight.current?.style;
2923
+ if (!style) return;
2914
2924
  const box = e.currentTarget.getBoundingClientRect();
2915
- e.currentTarget.style.setProperty("--ad-spot-x", `${e.clientX - box.left}px`);
2916
- e.currentTarget.style.setProperty("--ad-spot-y", `${e.clientY - box.top}px`);
2925
+ style.setProperty("--ad-spot-x", `${e.clientX - box.left}px`);
2926
+ style.setProperty("--ad-spot-y", `${e.clientY - box.top}px`);
2917
2927
  },
2918
- onPointerLeave: (e) => {
2919
- e.currentTarget.style.removeProperty("--ad-spot-x");
2920
- e.currentTarget.style.removeProperty("--ad-spot-y");
2928
+ onPointerLeave: () => {
2929
+ spotlight.current?.style.removeProperty("--ad-spot-x");
2930
+ spotlight.current?.style.removeProperty("--ad-spot-y");
2921
2931
  },
2922
2932
  "aria-describedby": p.description ? descId : void 0,
2923
2933
  onCancel: (e) => {
@@ -2925,6 +2935,7 @@ var Dialog = (p) => {
2925
2935
  if (!pending) setOpen(false);
2926
2936
  },
2927
2937
  children: [
2938
+ /* @__PURE__ */ jsx23("span", { ref: spotlight, className: "ad-dialog-spotlight", "aria-hidden": "true" }),
2928
2939
  p.art && /* @__PURE__ */ jsx23("div", { className: "ad-dialog-art", "aria-hidden": "true", children: p.art }),
2929
2940
  /* @__PURE__ */ jsx23(
2930
2941
  Header,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo-ui-kit/react",
3
- "version": "1.3.15",
3
+ "version": "1.3.17",
4
4
  "description": "NEO UI — React component library",
5
5
  "type": "module",
6
6
  "license": "MIT",