@rankingcoach/vanguard 1.12.0 → 1.12.2-testare.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 (37) hide show
  1. package/dist/index-BenchmarkGauge.js +1 -1
  2. package/dist/index-BenchmarkGaugeMarker.js +1 -1
  3. package/dist/index-CreditCard.js +1 -1
  4. package/dist/index-DateInput.js +4 -4
  5. package/dist/index-DateRange.js +1 -1
  6. package/dist/index-DropdownMenu.js +65 -55
  7. package/dist/index-InputRangeField.js +1 -1
  8. package/dist/index-ModalContext.js +28 -27
  9. package/dist/index-ModalService.js +178 -125
  10. package/dist/index-Month.js +2 -2
  11. package/dist/index-StyledSVG2.js +2 -2
  12. package/dist/index-_virtual10.js +2 -3
  13. package/dist/index-_virtual69.js +2 -2
  14. package/dist/index-_virtual70.js +4 -2
  15. package/dist/index-_virtual71.js +2 -4
  16. package/dist/index-_virtual72.js +4 -2
  17. package/dist/index-_virtual73.js +1 -1
  18. package/dist/index-_virtual74.js +1 -1
  19. package/dist/index-_virtual75.js +2 -4
  20. package/dist/index-_virtual76.js +2 -2
  21. package/dist/index-_virtual9.js +3 -2
  22. package/dist/index-accessibility.js +1 -1
  23. package/dist/index-dist3.js +1 -1
  24. package/dist/index-esm4.js +128 -293
  25. package/dist/index-esm5.js +293 -128
  26. package/dist/index-helpers2.js +393 -43
  27. package/dist/index-helpers3.js +43 -393
  28. package/dist/index-use-benchmark-gauge-render-state.js +1 -1
  29. package/dist/index-utils2.js +67 -47
  30. package/dist/index-utils3.js +47 -67
  31. package/dist/types/core/Modal/ModalService.d.ts +30 -0
  32. package/dist/types/core/Modal/stories/ModalStackingPopover.story.d.ts +6 -0
  33. package/dist/types/core/Modal/stories/TopmostModalZIndex.story.d.ts +5 -0
  34. package/dist/vanguard-asset-analysis.json +1 -1
  35. package/dist-wordpress/index.js +8498 -8446
  36. package/dist-wordpress/vanguard.css +1 -1
  37. package/package.json +4 -4
@@ -4,7 +4,7 @@ import { useState as z } from "react";
4
4
  import e from "./index-BenchmarkGauge.module.scss.js";
5
5
  import { BenchmarkGaugeMarker as F } from "./index-BenchmarkGaugeMarker.js";
6
6
  import { useBenchmarkGaugeRenderState as U } from "./index-use-benchmark-gauge-render-state.js";
7
- import { resolveMarkerColor as W } from "./index-utils2.js";
7
+ import { resolveMarkerColor as W } from "./index-utils3.js";
8
8
  import { Render as c } from "./index-Render.js";
9
9
  import { Text as x, TextTypes as y } from "./index-Text.js";
10
10
  const _ = (m) => {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
2
  import { classNames as m } from "./index-classNames.js";
3
3
  import "react";
4
- import { valueToPercent as y, markerPosition as d } from "./index-utils2.js";
4
+ import { valueToPercent as y, markerPosition as d } from "./index-utils3.js";
5
5
  import t from "./index-BenchmarkGaugeMarker.module.scss.js";
6
6
  import { BenchmarkGaugePin as A } from "./index-BenchmarkGaugePin.js";
7
7
  import { Render as M } from "./index-Render.js";
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import { useDynamicImport as d } from "./index-use-dynamic-import.js";
3
3
  import { ComponentContainer as h } from "./index-ComponentContainer.js";
4
4
  import "react";
5
- import p from "./index-esm4.js";
5
+ import p from "./index-esm5.js";
6
6
  var r;
7
7
  (function(e) {
8
8
  e.Visa = "visa", e.MasterCard = "masterCard", e.AmericanExpress = "americanExpress", e.Discover = "discover", e.CarteBleue = "carteBleue", e.Placeholder = "placeholder";
@@ -1,10 +1,10 @@
1
- import { __exports as p } from "./index-_virtual72.js";
1
+ import { __exports as p } from "./index-_virtual71.js";
2
2
  import k from "react";
3
3
  import { __require as K } from "./index-prop-types.js";
4
4
  import { __require as L } from "./index-classnames2.js";
5
- import U from "./index-_virtual73.js";
6
- import z from "./index-_virtual74.js";
7
- import A from "./index-_virtual75.js";
5
+ import U from "./index-_virtual72.js";
6
+ import z from "./index-_virtual73.js";
7
+ import A from "./index-_virtual74.js";
8
8
  import V from "./index-_virtual55.js";
9
9
  var q;
10
10
  function te() {
@@ -6,7 +6,7 @@ import { classNames as f } from "./index-classNames.js";
6
6
  import { datesAreDifferent as r } from "./index-date-helpers.js";
7
7
  import c from "./index-moment.js";
8
8
  import { useState as g, useEffect as d } from "react";
9
- import { d as p } from "./index-_virtual10.js";
9
+ import { d as p } from "./index-_virtual9.js";
10
10
  import { ComponentContainer as u } from "./index-ComponentContainer.js";
11
11
  const w = (a) => {
12
12
  const {
@@ -1,46 +1,56 @@
1
- import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
- import { classNames as k } from "./index-classNames.js";
3
- import { ComponentContainer as C } from "./index-ComponentContainer.js";
4
- import { Icon as I } from "./index-Icon.js";
5
- import { Text as N } from "./index-Text.js";
6
- import { useState as x } from "react";
7
- import i from "./index-DropdownMenu.module.scss.js";
8
- import D from "./index-Popper.js";
9
- import A from "./index-Fade.js";
1
+ import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
+ import { classNames as x } from "./index-classNames.js";
3
+ import { uuidv4 as A } from "./index-generate-uid.js";
4
+ import { ComponentContainer as E } from "./index-ComponentContainer.js";
5
+ import { Icon as g } from "./index-Icon.js";
6
+ import { MODAL_BASE_Z_INDEX as l, ModalService as a } from "./index-ModalService.js";
7
+ import { Text as M } from "./index-Text.js";
8
+ import { useState as p, useRef as L, useEffect as O } from "react";
9
+ import s from "./index-DropdownMenu.module.scss.js";
10
+ import P from "./index-Popper.js";
11
+ import R from "./index-Fade.js";
10
12
  import { ClickAwayListener as b } from "./index-ClickAwayListener.js";
11
- import g from "./index-MenuList.js";
12
- import E from "./index-MenuItem2.js";
13
- const B = (s) => {
13
+ import S from "./index-MenuList.js";
14
+ import _ from "./index-MenuItem2.js";
15
+ const V = (f) => {
14
16
  const {
15
- anchorEl: n,
16
- isOpen: m,
17
- toggleIsOpen: t,
18
- items: l,
19
- hideOnItemClick: a = !0,
20
- placement: p = "bottom"
21
- } = s, [f, d] = x(null);
22
- function u(e) {
23
- e.key === "Tab" ? (e.preventDefault(), t()) : e.key === "Escape" && t();
17
+ anchorEl: t,
18
+ isOpen: n,
19
+ toggleIsOpen: i,
20
+ items: u,
21
+ hideOnItemClick: d = !0,
22
+ placement: h = "bottom"
23
+ } = f, [w, I] = p(null), y = L(`dropdown-${A()}`), [k, c] = p(l);
24
+ O(() => {
25
+ if (!n) {
26
+ c(l);
27
+ return;
28
+ }
29
+ const e = y.current;
30
+ return c(a.registerPopover(e)), () => a.unregisterPopover(e);
31
+ }, [n]);
32
+ function C(e) {
33
+ e.key === "Tab" ? (e.preventDefault(), i()) : e.key === "Escape" && i();
24
34
  }
25
- const h = (e) => {
26
- e && e(), a && t();
27
- }, w = (e) => {
28
- n && n.current && n.current.contains(e.target) || (e.preventDefault(), t());
35
+ const D = (e) => {
36
+ e && e(), d && i();
37
+ }, N = (e) => {
38
+ t && t.current && t.current.contains(e.target) || (e.preventDefault(), i());
29
39
  };
30
- return o(C, {
31
- children: o(D, {
40
+ return r(E, {
41
+ children: r(P, {
32
42
  style: {
33
- zIndex: 1100
43
+ zIndex: k
34
44
  },
35
45
  role: void 0,
36
- open: m,
37
- anchorEl: n && n.current,
38
- placement: p,
46
+ open: n,
47
+ anchorEl: t && t.current,
48
+ placement: h,
39
49
  modifiers: [{
40
50
  name: "arrow",
41
51
  enabled: !0,
42
52
  options: {
43
- element: f
53
+ element: w
44
54
  }
45
55
  }, {
46
56
  name: "offset",
@@ -51,31 +61,31 @@ const B = (s) => {
51
61
  transition: !0,
52
62
  children: ({
53
63
  TransitionProps: e,
54
- placement: L
55
- }) => o(A, {
64
+ placement: j
65
+ }) => r(R, {
56
66
  ...e,
57
67
  timeout: 250,
58
- children: c("div", {
59
- children: [o("div", {
60
- className: k(i.arrow),
61
- ref: d
62
- }), o(b, {
63
- onClickAway: w,
64
- children: o(g, {
65
- autoFocusItem: m,
66
- className: i.menu,
67
- onKeyDown: u,
68
- children: l.map((r, y) => c(E, {
69
- className: i.item,
70
- onClick: () => h(r.onClick),
71
- selected: r.selected,
72
- children: [r.iconName && o(I, {
73
- ...r.iconProps,
74
- children: r.iconName
75
- }), o(N, {
76
- children: r.title
68
+ children: m("div", {
69
+ children: [r("div", {
70
+ className: x(s.arrow),
71
+ ref: I
72
+ }), r(b, {
73
+ onClickAway: N,
74
+ children: r(S, {
75
+ autoFocusItem: n,
76
+ className: s.menu,
77
+ onKeyDown: C,
78
+ children: u.map((o, v) => m(_, {
79
+ className: s.item,
80
+ onClick: () => D(o.onClick),
81
+ selected: o.selected,
82
+ children: [o.iconName && r(g, {
83
+ ...o.iconProps,
84
+ children: o.iconName
85
+ }), r(M, {
86
+ children: o.title
77
87
  })]
78
- }, y))
88
+ }, v))
79
89
  })
80
90
  })]
81
91
  })
@@ -84,5 +94,5 @@ const B = (s) => {
84
94
  });
85
95
  };
86
96
  export {
87
- B as DropdownMenu
97
+ V as DropdownMenu
88
98
  };
@@ -1,4 +1,4 @@
1
- import { __exports as p } from "./index-_virtual69.js";
1
+ import { __exports as p } from "./index-_virtual76.js";
2
2
  import E from "react";
3
3
  import { __require as W } from "./index-prop-types.js";
4
4
  var R;
@@ -1,25 +1,26 @@
1
- import { jsx as k } from "react/jsx-runtime";
2
- import { useRef as l, useState as v, useCallback as d, useContext as S, createContext as P } from "react";
3
- const p = P(void 0), j = () => {
4
- const s = S(p);
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import { useRef as C, useState as k, useCallback as n, useContext as m, createContext as v } from "react";
3
+ import { ModalService as S } from "./index-ModalService.js";
4
+ const c = v(void 0), $ = () => {
5
+ const s = m(c);
5
6
  if (!s)
6
7
  throw new Error("useModalContext must be used within a ModalProvider");
7
8
  return s;
8
- }, A = ({
9
+ }, j = ({
9
10
  children: s
10
11
  }) => {
11
- const c = l(/* @__PURE__ */ new Map()), n = l(/* @__PURE__ */ new Map()), i = l(0), [f, u] = v({
12
+ const d = C(/* @__PURE__ */ new Map()), [u, l] = k({
12
13
  growModals: [],
13
14
  slideModals: [],
14
15
  popModals: []
15
- }), g = d((e) => c.current.get(e), []), h = d((e) => n.current.get(e) ?? 0, []), x = d((e, o, t) => {
16
- c.current.set(e, t), n.current.has(e) || (i.current += 1, n.current.set(e, i.current)), u((R) => {
16
+ }), p = n((e) => d.current.get(e), []), w = n((e) => S.getModalOrder(e), []), f = n((e, t, o) => {
17
+ d.current.set(e, o), l((x) => {
17
18
  const r = {
18
- ...R
19
- }, a = (M, w) => {
20
- M.indexOf(w) >= 0 || M.push(w);
19
+ ...x
20
+ }, a = (i, M) => {
21
+ i.indexOf(M) >= 0 || i.push(M);
21
22
  };
22
- switch (o) {
23
+ switch (t) {
23
24
  case "grow":
24
25
  a(r.growModals, e);
25
26
  break;
@@ -34,25 +35,25 @@ const p = P(void 0), j = () => {
34
35
  }
35
36
  return r;
36
37
  });
37
- }, []), C = d((e) => {
38
- c.current.delete(e), n.current.delete(e), u((o) => ({
39
- growModals: o.growModals.filter((t) => t !== e),
40
- slideModals: o.slideModals.filter((t) => t !== e),
41
- popModals: o.popModals.filter((t) => t !== e)
38
+ }, []), g = n((e) => {
39
+ d.current.delete(e), l((t) => ({
40
+ growModals: t.growModals.filter((o) => o !== e),
41
+ slideModals: t.slideModals.filter((o) => o !== e),
42
+ popModals: t.popModals.filter((o) => o !== e)
42
43
  }));
43
- }, []), b = {
44
- getModal: g,
45
- modalRootState: f,
46
- addModal: x,
47
- removeModal: C,
48
- getModalOrder: h
44
+ }, []), h = {
45
+ getModal: p,
46
+ modalRootState: u,
47
+ addModal: f,
48
+ removeModal: g,
49
+ getModalOrder: w
49
50
  };
50
- return k(p.Provider, {
51
- value: b,
51
+ return b(c.Provider, {
52
+ value: h,
52
53
  children: s
53
54
  });
54
55
  };
55
56
  export {
56
- A as ModalProvider,
57
- j as useModalContext
57
+ j as ModalProvider,
58
+ $ as useModalContext
58
59
  };