@newtone-dev/ui-react-web 0.10.0 → 0.13.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.
Files changed (80) hide show
  1. package/README.md +9 -5
  2. package/dist/accordion/accordion.css +4 -4
  3. package/dist/avatar/avatar.css +7 -2
  4. package/dist/avatar/avatar.d.ts +7 -1
  5. package/dist/avatar/avatar.d.ts.map +1 -1
  6. package/dist/avatar/avatar.js +7 -2
  7. package/dist/avatar/avatar.js.map +1 -1
  8. package/dist/bar-list/bar-list.css +29 -4
  9. package/dist/card-box/card-box.css +5 -3
  10. package/dist/card-box/card-box.d.ts +11 -3
  11. package/dist/card-box/card-box.d.ts.map +1 -1
  12. package/dist/card-box/card-box.js +4 -2
  13. package/dist/card-box/card-box.js.map +1 -1
  14. package/dist/card-grid/card-grid.css +28 -1
  15. package/dist/card-grid/card-grid.d.ts +7 -1
  16. package/dist/card-grid/card-grid.d.ts.map +1 -1
  17. package/dist/card-grid/card-grid.js +14 -8
  18. package/dist/card-grid/card-grid.js.map +1 -1
  19. package/dist/chart-key/chart-key.css +4 -4
  20. package/dist/column-chart/column-chart.css +35 -6
  21. package/dist/control/control.css +21 -4
  22. package/dist/control/control.d.ts +15 -5
  23. package/dist/control/control.d.ts.map +1 -1
  24. package/dist/control/control.js +7 -6
  25. package/dist/control/control.js.map +1 -1
  26. package/dist/data-list/data-list.css +7 -5
  27. package/dist/data-list/data-list.d.ts +7 -1
  28. package/dist/data-list/data-list.d.ts.map +1 -1
  29. package/dist/data-list/data-list.js +7 -2
  30. package/dist/data-list/data-list.js.map +1 -1
  31. package/dist/feature-card/feature-card.css +1 -1
  32. package/dist/figure/figure.css +1 -1
  33. package/dist/framed-icon/framed-icon.css +1 -1
  34. package/dist/gallery/gallery.css +27 -2
  35. package/dist/gallery/gallery.d.ts.map +1 -1
  36. package/dist/gallery/gallery.js +5 -2
  37. package/dist/gallery/gallery.js.map +1 -1
  38. package/dist/icon/icon.d.ts.map +1 -1
  39. package/dist/icon/icon.js +30 -3
  40. package/dist/icon/icon.js.map +1 -1
  41. package/dist/icon-link/icon-link.css +2 -2
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +1 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/link/link.css +7 -7
  47. package/dist/logo-marquee/logo-marquee.d.ts.map +1 -1
  48. package/dist/logo-marquee/logo-marquee.js +6 -2
  49. package/dist/logo-marquee/logo-marquee.js.map +1 -1
  50. package/dist/media-window/index.d.ts +4 -0
  51. package/dist/media-window/index.d.ts.map +1 -0
  52. package/dist/media-window/index.js +3 -0
  53. package/dist/media-window/index.js.map +1 -0
  54. package/dist/media-window/media-window.css +5 -2
  55. package/dist/media-window/media-window.d.ts +28 -0
  56. package/dist/media-window/media-window.d.ts.map +1 -0
  57. package/dist/media-window/media-window.js +5 -0
  58. package/dist/media-window/media-window.js.map +1 -0
  59. package/dist/navbar/navbar.d.ts +16 -3
  60. package/dist/navbar/navbar.d.ts.map +1 -1
  61. package/dist/navbar/navbar.js +8 -5
  62. package/dist/navbar/navbar.js.map +1 -1
  63. package/dist/numbered-list/numbered-list.css +1 -1
  64. package/dist/on-media/on-media.css +146 -53
  65. package/dist/page/page.css +9 -9
  66. package/dist/page/page.d.ts +1 -1
  67. package/dist/segmented-control/segmented-control.css +28 -5
  68. package/dist/split-bar/split-bar.css +36 -4
  69. package/dist/stat-card/stat-card.css +3 -3
  70. package/dist/text/text.css +29 -2
  71. package/dist/tooltip/tooltip.css +6 -1
  72. package/dist/tooltip/tooltip.d.ts +9 -1
  73. package/dist/tooltip/tooltip.d.ts.map +1 -1
  74. package/dist/tooltip/tooltip.js +61 -4
  75. package/dist/tooltip/tooltip.js.map +1 -1
  76. package/dist/video-lightbox/video-lightbox.css +13 -7
  77. package/dist/video-lightbox/video-lightbox.d.ts.map +1 -1
  78. package/dist/video-lightbox/video-lightbox.js +5 -2
  79. package/dist/video-lightbox/video-lightbox.js.map +1 -1
  80. package/package.json +5 -1
@@ -9,6 +9,14 @@ import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
9
9
  * it keeps it open. One placement, from 0.9.0 a chat bubble on the trigger's top-right corner with no
10
10
  * gap and a square tail; the one caller is a footer's first column. The bubble is a `strong`
11
11
  * Surface, so it inverts against the page in both modes, and casts shadow.raised in the page's ink.
12
+ *
13
+ * WHEN IT SHOWS, FROM 0.13.0 (2026-09-29): the pointer's time decides, and a click decides nothing.
14
+ * Joshua: "if you hover for like one second, it stays one second and then dissapears ... if I am
15
+ * hovering the tooltip box, it should stay there, until the pointer leaves." Leaving the trigger, it
16
+ * lingers for as long as it was hovered -- none under BRIEF, at most LINGER_MAX. Leaving the bubble,
17
+ * it hides at once. Keyboard shows it through `:has(:focus-visible)` in the sheet, which a mouse click
18
+ * does not match, so a click no longer pins it the way `:focus-within` did. Touch: a tap opens it, a
19
+ * tap elsewhere closes it.
12
20
  */
13
21
  export interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'content'> {
14
22
  /** What the bubble says. */
@@ -18,5 +26,5 @@ export interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'con
18
26
  'aria-describedby'?: string;
19
27
  }>;
20
28
  }
21
- export declare function Tooltip({ content, children, className, onKeyDown, onPointerLeave, onBlur, ...rest }: TooltipProps): import("react").JSX.Element;
29
+ export declare function Tooltip({ content, children, className, onKeyDown, onPointerEnter, onPointerLeave, onPointerOver, onBlur, ...rest }: TooltipProps): import("react").JSX.Element;
22
30
  //# sourceMappingURL=tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAA;AAId;;;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC;IAClF,4BAA4B;IAC5B,OAAO,EAAE,SAAS,CAAA;IAClB,gEAAgE;IAChE,QAAQ,EAAE,YAAY,CAAC;QAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC1D;AAED,wBAAgB,OAAO,CAAC,EACpB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,EACT,cAAc,EACd,MAAM,EACN,GAAG,IAAI,EACV,EAAE,YAAY,+BAoCd"}
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAMH,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAA;AAId;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC;IAClF,4BAA4B;IAC5B,OAAO,EAAE,SAAS,CAAA;IAClB,gEAAgE;IAChE,QAAQ,EAAE,YAAY,CAAC;QAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC1D;AAOD,wBAAgB,OAAO,CAAC,EACpB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,EACT,cAAc,EACd,cAAc,EACd,aAAa,EACb,MAAM,EACN,GAAG,IAAI,EACV,EAAE,YAAY,+BA4Fd"}
@@ -1,17 +1,74 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cloneElement, useId, useState, } from 'react';
3
+ import { cloneElement, useEffect, useId, useRef, useState, } from 'react';
4
4
  import { Surface } from '../surface/index.js';
5
5
  import { Text } from '../text/index.js';
6
- export function Tooltip({ content, children, className, onKeyDown, onPointerLeave, onBlur, ...rest }) {
6
+ /** PLACEHOLDER -- "I am making up the timing". A hover shorter than this leaves nothing behind. */
7
+ const BRIEF = 500;
8
+ /** PLACEHOLDER -- the longest a bubble lingers after the pointer leaves the trigger. */
9
+ const LINGER_MAX = 3000;
10
+ export function Tooltip({ content, children, className, onKeyDown, onPointerEnter, onPointerLeave, onPointerOver, onBlur, ...rest }) {
7
11
  const id = useId();
8
12
  const [dismissed, setDismissed] = useState(false);
9
- return (_jsxs("span", { className: ['newtone-tooltip', className].filter(Boolean).join(' '), "data-dismissed": dismissed ? '' : undefined, onKeyDown: (event) => {
10
- if (event.key === 'Escape')
13
+ const [open, setOpen] = useState(false);
14
+ // Opened by a tap: closed by a tap elsewhere, never by a timer.
15
+ const [touched, setTouched] = useState(false);
16
+ const wrapper = useRef(null);
17
+ const enteredAt = useRef(0);
18
+ // Whether the pointer was last over the bubble, read when it leaves the wrapper. Kept from
19
+ // `pointerover`, which bubbles, because a leave on the bubble runs before the wrapper's.
20
+ const onBubble = useRef(false);
21
+ const timer = useRef(undefined);
22
+ const cancel = () => {
23
+ if (timer.current !== undefined)
24
+ clearTimeout(timer.current);
25
+ timer.current = undefined;
26
+ };
27
+ useEffect(() => cancel, []);
28
+ useEffect(() => {
29
+ if (!touched)
30
+ return;
31
+ const away = (event) => {
32
+ if (!wrapper.current?.contains(event.target)) {
33
+ setOpen(false);
34
+ setTouched(false);
35
+ }
36
+ };
37
+ document.addEventListener('pointerdown', away);
38
+ return () => document.removeEventListener('pointerdown', away);
39
+ }, [touched]);
40
+ return (_jsxs("span", { ref: wrapper, className: ['newtone-tooltip', className].filter(Boolean).join(' '), "data-open": open ? '' : undefined, "data-dismissed": dismissed ? '' : undefined, onKeyDown: (event) => {
41
+ if (event.key === 'Escape') {
42
+ cancel();
43
+ setOpen(false);
11
44
  setDismissed(true);
45
+ }
12
46
  onKeyDown?.(event);
47
+ }, onPointerEnter: (event) => {
48
+ cancel();
49
+ // A linger that is re-entered keeps counting from the first entry.
50
+ if (!open)
51
+ enteredAt.current = event.timeStamp;
52
+ setOpen(true);
53
+ if (event.pointerType === 'touch')
54
+ setTouched(true);
55
+ onPointerEnter?.(event);
56
+ }, onPointerOver: (event) => {
57
+ onBubble.current =
58
+ event.target.closest?.('.newtone-tooltip-bubble') != null;
59
+ onPointerOver?.(event);
13
60
  }, onPointerLeave: (event) => {
14
61
  setDismissed(false);
62
+ if (event.pointerType !== 'touch') {
63
+ cancel();
64
+ const hovered = event.timeStamp - enteredAt.current;
65
+ const linger = onBubble.current || hovered < BRIEF ? 0 : Math.min(hovered, LINGER_MAX);
66
+ onBubble.current = false;
67
+ if (linger === 0)
68
+ setOpen(false);
69
+ else
70
+ timer.current = setTimeout(() => setOpen(false), linger);
71
+ }
15
72
  onPointerLeave?.(event);
16
73
  }, onBlur: (event) => {
17
74
  if (!event.currentTarget.contains(event.relatedTarget))
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACH,YAAY,EACZ,KAAK,EACL,QAAQ,GAIX,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAoBvC,MAAM,UAAU,OAAO,CAAC,EACpB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,EACT,cAAc,EACd,MAAM,EACN,GAAG,IAAI,EACI;IACX,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAClB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACjD,OAAO,CACH,gBACI,SAAS,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,oBACnD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAC1C,SAAS,EAAE,CAAC,KAAK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YAC1B,OAAO,GACL,GACD,IACP,CACV,CAAA;AACL,CAAC"}
@@ -39,8 +39,14 @@
39
39
  * **The disc's hover is painted from the TILE's hover and not its own**, because the pointer is over
40
40
  * the button and only incidentally over the disc. That rule has to live here, and it is the reason
41
41
  * on-media.css publishes channels rather than only classes: this sheet writes
42
- * `var(--newtone-on-media-control-bg-hover)` and no literal. Same specificity as `.newtone-on-media-control:hover`,
43
- * and site.css loads on-media.css first, so this wins by order.
42
+ * `var(--newtone-on-media-control-hover-fill)` and no literal.
43
+ *
44
+ * **It used to win a race and now there is no race**, which is worth recording because the race was
45
+ * invisible. The disc wore `.newtone-on-media-control`, whose `:hover` rule was at the same
46
+ * specificity as the two below, so the only reason these won was that site.css loads on-media.css
47
+ * first. On 2026-09-26 the disc took its own class -- `.newtone-on-media-disc`, which has no states
48
+ * at all, because a decoration has none -- and these two became the only rules that paint it.
49
+ * issues/done/155.
44
50
  *
45
51
  * **The disc does not scale on hover where the reference's does.** Section 8 defers a motion
46
52
  * vocabulary and this band has already spent its two moving things; a transform with a hand-written
@@ -79,7 +85,7 @@
79
85
  }
80
86
 
81
87
  .newtone-video-lightbox:focus-visible {
82
- outline: 2px solid var(--newtone-on-media-ring);
88
+ outline: 2px solid var(--newtone-on-media-focus-ring);
83
89
  outline-offset: -4px;
84
90
  }
85
91
 
@@ -96,7 +102,7 @@
96
102
  .newtone-video-lightbox-shade {
97
103
  position: absolute;
98
104
  inset: 0;
99
- background: var(--newtone-on-media-scrim-soft);
105
+ background: var(--newtone-on-media-scrim-soft-fill);
100
106
  }
101
107
 
102
108
  .newtone-video-lightbox-disc {
@@ -107,11 +113,11 @@
107
113
  }
108
114
 
109
115
  .newtone-video-lightbox:hover .newtone-video-lightbox-disc {
110
- background-color: var(--newtone-on-media-control-bg-hover);
116
+ background-color: var(--newtone-on-media-control-hover-fill);
111
117
  }
112
118
 
113
119
  .newtone-video-lightbox:active .newtone-video-lightbox-disc {
114
- background-color: var(--newtone-on-media-control-bg-press);
120
+ background-color: var(--newtone-on-media-control-pressed-fill);
115
121
  }
116
122
 
117
123
  /* Under the disc: half the disc plus the gap, measured from the tile's middle. Written as a sum so
@@ -137,7 +143,7 @@
137
143
  }
138
144
 
139
145
  .newtone-video-lightbox-panel::backdrop {
140
- background: var(--newtone-on-media-scrim-strong);
146
+ background: var(--newtone-on-media-scrim-strong-fill);
141
147
  }
142
148
 
143
149
  .newtone-video-lightbox-frame {
@@ -1 +1 @@
1
- {"version":3,"file":"video-lightbox.d.ts","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACnE;gBACY;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,+BA6E3F"}
1
+ {"version":3,"file":"video-lightbox.d.ts","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAM7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACnE;gBACY;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,+BAqF3F"}
@@ -6,6 +6,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
6
6
  import { Text } from '../text/index.js';
7
7
  import { useRef, useState } from 'react';
8
8
  import { Icon } from '../icon/index.js';
9
+ // `Icon` stays because the play disc is not a control and keeps its own glyph; the close button
10
+ // stopped being a hand-written `<button>` on 2026-09-26. Subpath, not the barrel.
11
+ import { Control } from '../control/index.js';
9
12
  export function VideoLightbox({ poster, label, src, className, ...rest }) {
10
13
  const panel = useRef(null);
11
14
  const [playing, setPlaying] = useState(false);
@@ -15,7 +18,7 @@ export function VideoLightbox({ poster, label, src, className, ...rest }) {
15
18
  panel.current?.showModal();
16
19
  setPlaying(true);
17
20
  }
18
- return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: ['newtone-video-lightbox', className].filter(Boolean).join(' '), "aria-haspopup": "dialog", onClick: open, ...rest, children: [_jsx("img", { className: "newtone-video-lightbox-poster", src: poster, alt: "", loading: "lazy", draggable: false }), _jsx("span", { className: "newtone-video-lightbox-shade", "aria-hidden": true }), _jsx("span", { className: "newtone-on-media-control newtone-video-lightbox-disc", "aria-hidden": true, children: _jsx(Icon, { name: "play_arrow", size: "lg", fill: true }) }), _jsx("span", { className: "newtone-on-media-text newtone-video-lightbox-label", children: _jsx(Text, { scale: "body", children: label }) })] }), _jsx("dialog", { ref: panel, className: "newtone-video-lightbox-panel", "aria-label": label,
21
+ return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: ['newtone-video-lightbox', className].filter(Boolean).join(' '), "aria-haspopup": "dialog", onClick: open, ...rest, children: [_jsx("img", { className: "newtone-video-lightbox-poster", src: poster, alt: "", loading: "lazy", draggable: false }), _jsx("span", { className: "newtone-video-lightbox-shade", "aria-hidden": true }), _jsx("span", { className: "newtone-on-media-disc newtone-video-lightbox-disc", "aria-hidden": true, children: _jsx(Icon, { name: "play_arrow", size: "lg", fill: true }) }), _jsx("span", { className: "newtone-on-media-text newtone-video-lightbox-label", children: _jsx(Text, { scale: "body", children: label }) })] }), _jsx("dialog", { ref: panel, className: "newtone-video-lightbox-panel", "aria-label": label,
19
22
  // A `<dialog>`'s own box is the panel and its backdrop is a pseudo-element, so a
20
23
  // click that lands ON the dialog element and not on anything inside it is a click
21
24
  // on the backdrop. That is the whole test; there is no overlay to add.
@@ -26,6 +29,6 @@ export function VideoLightbox({ poster, label, src, className, ...rest }) {
26
29
  // `Escape` closes a modal dialog without anything here listening for it, and this
27
30
  // is what makes that path stop the film as well -- one handler for both ways out
28
31
  // rather than a key listener that has to agree with the close button.
29
- onClose: () => setPlaying(false), children: _jsxs("div", { className: "newtone-video-lightbox-frame", children: [_jsx("div", { className: "newtone-video-lightbox-close-row", children: _jsx("button", { type: "button", className: "newtone-on-media-control", "aria-label": "Close video", onClick: () => panel.current?.close(), children: _jsx(Icon, { name: "close" }) }) }), playing && (_jsx("iframe", { className: "newtone-video-lightbox-player", src: src, title: label, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true }))] }) })] }));
32
+ onClose: () => setPlaying(false), children: _jsxs("div", { className: "newtone-video-lightbox-frame", children: [_jsx("div", { className: "newtone-video-lightbox-close-row", children: _jsx(Control, { className: "newtone-on-media-control", icon: "close", size: "xl", ariaLabel: "Close video", onClick: () => panel.current?.close() }) }), playing && (_jsx("iframe", { className: "newtone-video-lightbox-player", src: src, title: label, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true }))] }) })] }));
30
33
  }
31
34
  //# sourceMappingURL=video-lightbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"video-lightbox.js","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;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V,SAAS,EAAC,8BAA8B,gBAC5B,KAAK;gBACjB,iFAAiF;gBACjF,kFAAkF;gBAClF,uEAAuE;gBACvE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;oBACf,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,OAAO;wBAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,CAAA;gBAC9D,CAAC;gBACD,kFAAkF;gBAClF,iFAAiF;gBACjF,sEAAsE;gBACtE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,YAEhC,eAAK,SAAS,EAAC,8BAA8B,aACzC,cAAK,SAAS,EAAC,kCAAkC,YAC7C,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,gBACzB,aAAa,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,YAErC,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GAChB,GACP,EACL,OAAO,IAAI,CACR,iBACI,SAAS,EAAC,+BAA+B,EACzC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,KAAK,EAAC,0CAA0C,EAChD,eAAe,SACjB,CACL,IACC,GACD,IACV,CACN,CAAA;AACL,CAAC"}
1
+ {"version":3,"file":"video-lightbox.js","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,wGAAwG;AACxG,oGAAoG;AACpG,kFAAkF;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,gGAAgG;AAChG,kFAAkF;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AA4F7C,MAAM,UAAU,aAAa,CAAC,EAA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gBACD,kFAAkF;gBAClF,iFAAiF;gBACjF,sEAAsE;gBACtE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,YAEhC,eAAK,SAAS,EAAC,8BAA8B,aACzC,cAAK,SAAS,EAAC,kCAAkC,YAK7C,KAAC,OAAO,IACJ,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,aAAa,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GACvC,GACA,EACL,OAAO,IAAI,CACR,iBACI,SAAS,EAAC,+BAA+B,EACzC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,KAAK,EAAC,0CAA0C,EAChD,eAAe,SACjB,CACL,IACC,GACD,IACV,CACN,CAAA;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtone-dev/ui-react-web",
3
- "version": "0.10.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -81,6 +81,10 @@
81
81
  "types": "./dist/media-plate/index.d.ts",
82
82
  "default": "./dist/media-plate/index.js"
83
83
  },
84
+ "./media-window": {
85
+ "types": "./dist/media-window/index.d.ts",
86
+ "default": "./dist/media-window/index.js"
87
+ },
84
88
  "./navbar": {
85
89
  "types": "./dist/navbar/index.d.ts",
86
90
  "default": "./dist/navbar/index.js"