@tedi-design-system/react 18.0.0-rc.3 → 18.0.0-rc.5

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 (96) hide show
  1. package/bundle-stats.html +1 -1
  2. package/external/@floating-ui/core/dist/floating-ui.core.cjs.js +1 -1
  3. package/external/@floating-ui/core/dist/floating-ui.core.es.js +275 -271
  4. package/external/@floating-ui/dom/dist/floating-ui.dom.cjs.js +1 -1
  5. package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +189 -188
  6. package/external/@floating-ui/react/dist/floating-ui.react.cjs.js +1 -1
  7. package/external/@floating-ui/react/dist/floating-ui.react.es.js +1419 -1538
  8. package/external/@floating-ui/react/dist/floating-ui.react.utils.cjs.js +1 -1
  9. package/external/@floating-ui/react/dist/floating-ui.react.utils.es.js +348 -81
  10. package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js +1 -1
  11. package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +113 -93
  12. package/external/@floating-ui/utils/dist/floating-ui.utils.cjs.js +1 -1
  13. package/external/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js +1 -1
  14. package/external/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +97 -97
  15. package/external/@floating-ui/utils/dist/floating-ui.utils.es.js +66 -68
  16. package/external/lodash-es/_baseUnset.cjs.js +1 -1
  17. package/external/lodash-es/_baseUnset.es.js +12 -19
  18. package/external/tabbable/dist/index.esm.cjs.js +1 -1
  19. package/external/tabbable/dist/index.esm.es.js +72 -63
  20. package/index.css +1 -1
  21. package/package.json +4 -4
  22. package/src/community/components/modal/modal-closer.d.ts +6 -0
  23. package/src/community/components/modal/modal-provider.d.ts +6 -0
  24. package/src/community/components/modal/modal-trigger.d.ts +6 -0
  25. package/src/community/components/modal/modal.d.ts +6 -0
  26. package/src/tedi/components/buttons/button-group/button-group.cjs.js +1 -1
  27. package/src/tedi/components/buttons/button-group/button-group.es.js +4 -4
  28. package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
  29. package/src/tedi/components/buttons/collapse/collapse.d.ts +15 -0
  30. package/src/tedi/components/buttons/collapse/collapse.es.js +55 -54
  31. package/src/tedi/components/content/table/index.d.ts +6 -0
  32. package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.cjs.js +1 -0
  33. package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.d.ts +15 -0
  34. package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.es.js +37 -0
  35. package/src/tedi/components/content/table/table-context.cjs.js +1 -0
  36. package/src/tedi/components/content/table/table-context.d.ts +3 -0
  37. package/src/tedi/components/content/table/table-context.es.js +11 -0
  38. package/src/tedi/components/content/table/table-header-button/table-header-button.cjs.js +1 -0
  39. package/src/tedi/components/content/table/table-header-button/table-header-button.d.ts +51 -0
  40. package/src/tedi/components/content/table/table-header-button/table-header-button.es.js +42 -0
  41. package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.cjs.js +1 -0
  42. package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.es.js +7 -0
  43. package/src/tedi/components/content/table/table-toolbar/table-toolbar.cjs.js +1 -0
  44. package/src/tedi/components/content/table/table-toolbar/table-toolbar.d.ts +21 -0
  45. package/src/tedi/components/content/table/table-toolbar/table-toolbar.es.js +9 -0
  46. package/src/tedi/components/content/table/table.cjs.js +1 -0
  47. package/src/tedi/components/content/table/table.d.ts +519 -0
  48. package/src/tedi/components/content/table/table.es.js +856 -0
  49. package/src/tedi/components/content/table/table.module.scss.cjs.js +1 -0
  50. package/src/tedi/components/content/table/table.module.scss.es.js +54 -0
  51. package/src/tedi/components/content/table/use-table-persistence.cjs.js +1 -0
  52. package/src/tedi/components/content/table/use-table-persistence.d.ts +13 -0
  53. package/src/tedi/components/content/table/use-table-persistence.es.js +53 -0
  54. package/src/tedi/components/form/time-field/time-field.es.js +3 -3
  55. package/src/tedi/components/navigation/pagination/pagination.cjs.js +1 -1
  56. package/src/tedi/components/navigation/pagination/pagination.d.ts +7 -0
  57. package/src/tedi/components/navigation/pagination/pagination.es.js +132 -91
  58. package/src/tedi/components/navigation/pagination/pagination.module.scss.cjs.js +1 -1
  59. package/src/tedi/components/navigation/pagination/pagination.module.scss.es.js +7 -1
  60. package/src/tedi/components/navigation/pagination/pagination.types.d.ts +100 -0
  61. package/src/tedi/components/overlays/modal/index.d.ts +8 -0
  62. package/src/tedi/components/overlays/modal/modal-body/modal-body.cjs.js +1 -0
  63. package/src/tedi/components/overlays/modal/modal-body/modal-body.d.ts +22 -0
  64. package/src/tedi/components/overlays/modal/modal-body/modal-body.es.js +21 -0
  65. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.cjs.js +1 -0
  66. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.d.ts +15 -0
  67. package/src/tedi/components/overlays/modal/modal-closer/modal-closer.es.js +16 -0
  68. package/src/tedi/components/overlays/modal/modal-content/modal-content.cjs.js +1 -0
  69. package/src/tedi/components/overlays/modal/modal-content/modal-content.d.ts +108 -0
  70. package/src/tedi/components/overlays/modal/modal-content/modal-content.es.js +81 -0
  71. package/src/tedi/components/overlays/modal/modal-context.cjs.js +1 -0
  72. package/src/tedi/components/overlays/modal/modal-context.d.ts +59 -0
  73. package/src/tedi/components/overlays/modal/modal-context.es.js +15 -0
  74. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.cjs.js +1 -0
  75. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.d.ts +22 -0
  76. package/src/tedi/components/overlays/modal/modal-footer/modal-footer.es.js +25 -0
  77. package/src/tedi/components/overlays/modal/modal-header/modal-header.cjs.js +1 -0
  78. package/src/tedi/components/overlays/modal/modal-header/modal-header.d.ts +58 -0
  79. package/src/tedi/components/overlays/modal/modal-header/modal-header.es.js +25 -0
  80. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.cjs.js +1 -0
  81. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.d.ts +13 -0
  82. package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.es.js +14 -0
  83. package/src/tedi/components/overlays/modal/modal.cjs.js +1 -0
  84. package/src/tedi/components/overlays/modal/modal.d.ts +68 -0
  85. package/src/tedi/components/overlays/modal/modal.es.js +76 -0
  86. package/src/tedi/components/overlays/modal/modal.module.scss.cjs.js +1 -0
  87. package/src/tedi/components/overlays/modal/modal.module.scss.es.js +36 -0
  88. package/src/tedi/components/overlays/tooltip/tooltip.cjs.js +1 -1
  89. package/src/tedi/components/overlays/tooltip/tooltip.es.js +14 -6
  90. package/src/tedi/helpers/hooks/use-sidenav-state.d.ts +1 -1
  91. package/src/tedi/index.d.ts +2 -0
  92. package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
  93. package/src/tedi/providers/label-provider/labels-map.d.ts +132 -6
  94. package/src/tedi/providers/label-provider/labels-map.es.js +146 -11
  95. package/tedi.cjs.js +1 -1
  96. package/tedi.es.js +203 -171
@@ -1,416 +1,420 @@
1
- import { evaluate as H, getSide as B, getSideAxis as $, getOppositePlacement as N, getExpandedPlacements as Q, getOppositeAxisPlacements as U, getAlignmentSides as Z, clamp as _, getAlignment as Y, min as W, max as j, getPaddingObject as q, rectToClientRect as X, getOppositeAxis as tt, getAlignmentAxis as G, getAxisLength as J } from "../../utils/dist/floating-ui.utils.es.js";
2
- function I(a, e, d) {
1
+ import { evaluate as j, getSide as W, getSideAxis as _, getOppositePlacement as G, getExpandedPlacements as J, getOppositeAxisPlacements as K, getAlignmentSides as Q, clamp as z, getAlignment as Y, min as H, max as F, getOppositeAxis as Z, getPaddingObject as I, getAlignmentAxis as N, rectToClientRect as B, getAxisLength as U } from "../../utils/dist/floating-ui.utils.es.js";
2
+ function X(l, t, d) {
3
3
  let {
4
- reference: o,
4
+ reference: i,
5
5
  floating: f
6
- } = a;
7
- const n = $(e), c = G(e), r = J(c), g = B(e), x = n === "y", i = o.x + o.width / 2 - f.width / 2, s = o.y + o.height / 2 - f.height / 2, m = o[r] / 2 - f[r] / 2;
8
- let t;
6
+ } = l;
7
+ const e = _(t), o = N(t), r = U(o), g = W(t), u = e === "y", a = i.x + i.width / 2 - f.width / 2, c = i.y + i.height / 2 - f.height / 2, m = i[r] / 2 - f[r] / 2;
8
+ let n;
9
9
  switch (g) {
10
10
  case "top":
11
- t = {
12
- x: i,
13
- y: o.y - f.height
11
+ n = {
12
+ x: a,
13
+ y: i.y - f.height
14
14
  };
15
15
  break;
16
16
  case "bottom":
17
- t = {
18
- x: i,
19
- y: o.y + o.height
17
+ n = {
18
+ x: a,
19
+ y: i.y + i.height
20
20
  };
21
21
  break;
22
22
  case "right":
23
- t = {
24
- x: o.x + o.width,
25
- y: s
23
+ n = {
24
+ x: i.x + i.width,
25
+ y: c
26
26
  };
27
27
  break;
28
28
  case "left":
29
- t = {
30
- x: o.x - f.width,
31
- y: s
29
+ n = {
30
+ x: i.x - f.width,
31
+ y: c
32
32
  };
33
33
  break;
34
34
  default:
35
- t = {
36
- x: o.x,
37
- y: o.y
35
+ n = {
36
+ x: i.x,
37
+ y: i.y
38
38
  };
39
39
  }
40
- switch (Y(e)) {
40
+ switch (Y(t)) {
41
41
  case "start":
42
- t[c] -= m * (d && x ? -1 : 1);
42
+ n[o] -= m * (d && u ? -1 : 1);
43
43
  break;
44
44
  case "end":
45
- t[c] += m * (d && x ? -1 : 1);
45
+ n[o] += m * (d && u ? -1 : 1);
46
46
  break;
47
47
  }
48
- return t;
48
+ return n;
49
49
  }
50
- const ot = async (a, e, d) => {
50
+ async function tt(l, t) {
51
+ var d;
52
+ t === void 0 && (t = {});
53
+ const {
54
+ x: i,
55
+ y: f,
56
+ platform: e,
57
+ rects: o,
58
+ elements: r,
59
+ strategy: g
60
+ } = l, {
61
+ boundary: u = "clippingAncestors",
62
+ rootBoundary: a = "viewport",
63
+ elementContext: c = "floating",
64
+ altBoundary: m = !1,
65
+ padding: n = 0
66
+ } = j(t, l), s = I(n), p = r[m ? c === "floating" ? "reference" : "floating" : c], w = B(await e.getClippingRect({
67
+ element: (d = await (e.isElement == null ? void 0 : e.isElement(p))) == null || d ? p : p.contextElement || await (e.getDocumentElement == null ? void 0 : e.getDocumentElement(r.floating)),
68
+ boundary: u,
69
+ rootBoundary: a,
70
+ strategy: g
71
+ })), v = c === "floating" ? {
72
+ x: i,
73
+ y: f,
74
+ width: o.floating.width,
75
+ height: o.floating.height
76
+ } : o.reference, h = await (e.getOffsetParent == null ? void 0 : e.getOffsetParent(r.floating)), y = await (e.isElement == null ? void 0 : e.isElement(h)) ? await (e.getScale == null ? void 0 : e.getScale(h)) || {
77
+ x: 1,
78
+ y: 1
79
+ } : {
80
+ x: 1,
81
+ y: 1
82
+ }, O = B(e.convertOffsetParentRelativeRectToViewportRelativeRect ? await e.convertOffsetParentRelativeRectToViewportRelativeRect({
83
+ elements: r,
84
+ rect: v,
85
+ offsetParent: h,
86
+ strategy: g
87
+ }) : v);
88
+ return {
89
+ top: (w.top - O.top + s.top) / y.y,
90
+ bottom: (O.bottom - w.bottom + s.bottom) / y.y,
91
+ left: (w.left - O.left + s.left) / y.x,
92
+ right: (O.right - w.right + s.right) / y.x
93
+ };
94
+ }
95
+ const et = 50, st = async (l, t, d) => {
51
96
  const {
52
- placement: o = "bottom",
97
+ placement: i = "bottom",
53
98
  strategy: f = "absolute",
54
- middleware: n = [],
55
- platform: c
56
- } = d, r = n.filter(Boolean), g = await (c.isRTL == null ? void 0 : c.isRTL(e));
57
- let x = await c.getElementRects({
58
- reference: a,
59
- floating: e,
99
+ middleware: e = [],
100
+ platform: o
101
+ } = d, r = o.detectOverflow ? o : {
102
+ ...o,
103
+ detectOverflow: tt
104
+ }, g = await (o.isRTL == null ? void 0 : o.isRTL(t));
105
+ let u = await o.getElementRects({
106
+ reference: l,
107
+ floating: t,
60
108
  strategy: f
61
109
  }), {
62
- x: i,
63
- y: s
64
- } = I(x, o, g), m = o, t = {}, l = 0;
65
- for (let u = 0; u < r.length; u++) {
110
+ x: a,
111
+ y: c
112
+ } = X(u, i, g), m = i, n = 0;
113
+ const s = {};
114
+ for (let x = 0; x < e.length; x++) {
115
+ const p = e[x];
116
+ if (!p)
117
+ continue;
66
118
  const {
67
119
  name: w,
68
- fn: p
69
- } = r[u], {
120
+ fn: v
121
+ } = p, {
70
122
  x: h,
71
123
  y,
72
- data: b,
73
- reset: v
74
- } = await p({
75
- x: i,
76
- y: s,
77
- initialPlacement: o,
124
+ data: O,
125
+ reset: A
126
+ } = await v({
127
+ x: a,
128
+ y: c,
129
+ initialPlacement: i,
78
130
  placement: m,
79
131
  strategy: f,
80
- middlewareData: t,
81
- rects: x,
82
- platform: c,
132
+ middlewareData: s,
133
+ rects: u,
134
+ platform: r,
83
135
  elements: {
84
- reference: a,
85
- floating: e
136
+ reference: l,
137
+ floating: t
86
138
  }
87
139
  });
88
- i = h ?? i, s = y ?? s, t = {
89
- ...t,
90
- [w]: {
91
- ...t[w],
92
- ...b
93
- }
94
- }, v && l <= 50 && (l++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (x = v.rects === !0 ? await c.getElementRects({
95
- reference: a,
96
- floating: e,
140
+ a = h ?? a, c = y ?? c, s[w] = {
141
+ ...s[w],
142
+ ...O
143
+ }, A && n < et && (n++, typeof A == "object" && (A.placement && (m = A.placement), A.rects && (u = A.rects === !0 ? await o.getElementRects({
144
+ reference: l,
145
+ floating: t,
97
146
  strategy: f
98
- }) : v.rects), {
99
- x: i,
100
- y: s
101
- } = I(x, m, g)), u = -1);
147
+ }) : A.rects), {
148
+ x: a,
149
+ y: c
150
+ } = X(u, m, g)), x = -1);
102
151
  }
103
152
  return {
104
- x: i,
105
- y: s,
153
+ x: a,
154
+ y: c,
106
155
  placement: m,
107
156
  strategy: f,
108
- middlewareData: t
157
+ middlewareData: s
109
158
  };
110
- };
111
- async function z(a, e) {
112
- var d;
113
- e === void 0 && (e = {});
114
- const {
115
- x: o,
116
- y: f,
117
- platform: n,
118
- rects: c,
119
- elements: r,
120
- strategy: g
121
- } = a, {
122
- boundary: x = "clippingAncestors",
123
- rootBoundary: i = "viewport",
124
- elementContext: s = "floating",
125
- altBoundary: m = !1,
126
- padding: t = 0
127
- } = H(e, a), l = q(t), w = r[m ? s === "floating" ? "reference" : "floating" : s], p = X(await n.getClippingRect({
128
- element: (d = await (n.isElement == null ? void 0 : n.isElement(w))) == null || d ? w : w.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(r.floating)),
129
- boundary: x,
130
- rootBoundary: i,
131
- strategy: g
132
- })), h = s === "floating" ? {
133
- x: o,
134
- y: f,
135
- width: c.floating.width,
136
- height: c.floating.height
137
- } : c.reference, y = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(r.floating)), b = await (n.isElement == null ? void 0 : n.isElement(y)) ? await (n.getScale == null ? void 0 : n.getScale(y)) || {
138
- x: 1,
139
- y: 1
140
- } : {
141
- x: 1,
142
- y: 1
143
- }, v = X(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({
144
- elements: r,
145
- rect: h,
146
- offsetParent: y,
147
- strategy: g
148
- }) : h);
149
- return {
150
- top: (p.top - v.top + l.top) / b.y,
151
- bottom: (v.bottom - p.bottom + l.bottom) / b.y,
152
- left: (p.left - v.left + l.left) / b.x,
153
- right: (v.right - p.right + l.right) / b.x
154
- };
155
- }
156
- const st = (a) => ({
159
+ }, at = (l) => ({
157
160
  name: "arrow",
158
- options: a,
159
- async fn(e) {
161
+ options: l,
162
+ async fn(t) {
160
163
  const {
161
164
  x: d,
162
- y: o,
165
+ y: i,
163
166
  placement: f,
164
- rects: n,
165
- platform: c,
167
+ rects: e,
168
+ platform: o,
166
169
  elements: r,
167
170
  middlewareData: g
168
- } = e, {
169
- element: x,
170
- padding: i = 0
171
- } = H(a, e) || {};
172
- if (x == null)
171
+ } = t, {
172
+ element: u,
173
+ padding: a = 0
174
+ } = j(l, t) || {};
175
+ if (u == null)
173
176
  return {};
174
- const s = q(i), m = {
177
+ const c = I(a), m = {
175
178
  x: d,
176
- y: o
177
- }, t = G(f), l = J(t), u = await c.getDimensions(x), w = t === "y", p = w ? "top" : "left", h = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = n.reference[l] + n.reference[t] - m[t] - n.floating[l], v = m[t] - n.reference[t], T = await (c.getOffsetParent == null ? void 0 : c.getOffsetParent(x));
178
- let O = T ? T[y] : 0;
179
- (!O || !await (c.isElement == null ? void 0 : c.isElement(T))) && (O = r.floating[y] || n.floating[l]);
180
- const k = b / 2 - v / 2, S = O / 2 - u[l] / 2 - 1, P = W(s[p], S), L = W(s[h], S), C = P, M = O - u[l] - L, A = O / 2 - u[l] / 2 + k, F = _(C, A, M), E = !g.arrow && Y(f) != null && A !== F && n.reference[l] / 2 - (A < C ? P : L) - u[l] / 2 < 0, R = E ? A < C ? A - C : A - M : 0;
179
+ y: i
180
+ }, n = N(f), s = U(n), x = await o.getDimensions(u), p = n === "y", w = p ? "top" : "left", v = p ? "bottom" : "right", h = p ? "clientHeight" : "clientWidth", y = e.reference[s] + e.reference[n] - m[n] - e.floating[s], O = m[n] - e.reference[n], A = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(u));
181
+ let R = A ? A[h] : 0;
182
+ (!R || !await (o.isElement == null ? void 0 : o.isElement(A))) && (R = r.floating[h] || e.floating[s]);
183
+ const E = y / 2 - O / 2, C = R / 2 - x[s] / 2 - 1, P = H(c[w], C), L = H(c[v], C), k = P, M = R - x[s] - L, b = R / 2 - x[s] / 2 + E, $ = z(k, b, M), T = !g.arrow && Y(f) != null && b !== $ && e.reference[s] / 2 - (b < k ? P : L) - x[s] / 2 < 0, D = T ? b < k ? b - k : b - M : 0;
181
184
  return {
182
- [t]: m[t] + R,
185
+ [n]: m[n] + D,
183
186
  data: {
184
- [t]: F,
185
- centerOffset: A - F - R,
186
- ...E && {
187
- alignmentOffset: R
187
+ [n]: $,
188
+ centerOffset: b - $ - D,
189
+ ...T && {
190
+ alignmentOffset: D
188
191
  }
189
192
  },
190
- reset: E
193
+ reset: T
191
194
  };
192
195
  }
193
- }), at = function(a) {
194
- return a === void 0 && (a = {}), {
196
+ }), lt = function(l) {
197
+ return l === void 0 && (l = {}), {
195
198
  name: "flip",
196
- options: a,
197
- async fn(e) {
198
- var d, o;
199
+ options: l,
200
+ async fn(t) {
201
+ var d, i;
199
202
  const {
200
203
  placement: f,
201
- middlewareData: n,
202
- rects: c,
204
+ middlewareData: e,
205
+ rects: o,
203
206
  initialPlacement: r,
204
207
  platform: g,
205
- elements: x
206
- } = e, {
207
- mainAxis: i = !0,
208
- crossAxis: s = !0,
208
+ elements: u
209
+ } = t, {
210
+ mainAxis: a = !0,
211
+ crossAxis: c = !0,
209
212
  fallbackPlacements: m,
210
- fallbackStrategy: t = "bestFit",
211
- fallbackAxisSideDirection: l = "none",
212
- flipAlignment: u = !0,
213
- ...w
214
- } = H(a, e);
215
- if ((d = n.arrow) != null && d.alignmentOffset)
213
+ fallbackStrategy: n = "bestFit",
214
+ fallbackAxisSideDirection: s = "none",
215
+ flipAlignment: x = !0,
216
+ ...p
217
+ } = j(l, t);
218
+ if ((d = e.arrow) != null && d.alignmentOffset)
216
219
  return {};
217
- const p = B(f), h = $(r), y = B(r) === r, b = await (g.isRTL == null ? void 0 : g.isRTL(x.floating)), v = m || (y || !u ? [N(r)] : Q(r)), T = l !== "none";
218
- !m && T && v.push(...U(r, u, l, b));
219
- const O = [r, ...v], k = await z(e, w), S = [];
220
- let P = ((o = n.flip) == null ? void 0 : o.overflows) || [];
221
- if (i && S.push(k[p]), s) {
222
- const A = Z(f, c, b);
223
- S.push(k[A[0]], k[A[1]]);
220
+ const w = W(f), v = _(r), h = W(r) === r, y = await (g.isRTL == null ? void 0 : g.isRTL(u.floating)), O = m || (h || !x ? [G(r)] : J(r)), A = s !== "none";
221
+ !m && A && O.push(...K(r, x, s, y));
222
+ const R = [r, ...O], E = await g.detectOverflow(t, p), C = [];
223
+ let P = ((i = e.flip) == null ? void 0 : i.overflows) || [];
224
+ if (a && C.push(E[w]), c) {
225
+ const b = Q(f, o, y);
226
+ C.push(E[b[0]], E[b[1]]);
224
227
  }
225
228
  if (P = [...P, {
226
229
  placement: f,
227
- overflows: S
228
- }], !S.every((A) => A <= 0)) {
229
- var L, C;
230
- const A = (((L = n.flip) == null ? void 0 : L.index) || 0) + 1, F = O[A];
231
- if (F && (!(s === "alignment" ? h !== $(F) : !1) || // We leave the current main axis only if every placement on that axis
230
+ overflows: C
231
+ }], !C.every((b) => b <= 0)) {
232
+ var L, k;
233
+ const b = (((L = e.flip) == null ? void 0 : L.index) || 0) + 1, $ = R[b];
234
+ if ($ && (!(c === "alignment" ? v !== _($) : !1) || // We leave the current main axis only if every placement on that axis
232
235
  // overflows the main axis.
233
- P.every((D) => $(D.placement) === h ? D.overflows[0] > 0 : !0)))
236
+ P.every((S) => _(S.placement) === v ? S.overflows[0] > 0 : !0)))
234
237
  return {
235
238
  data: {
236
- index: A,
239
+ index: b,
237
240
  overflows: P
238
241
  },
239
242
  reset: {
240
- placement: F
243
+ placement: $
241
244
  }
242
245
  };
243
- let E = (C = P.filter((R) => R.overflows[0] <= 0).sort((R, D) => R.overflows[1] - D.overflows[1])[0]) == null ? void 0 : C.placement;
244
- if (!E)
245
- switch (t) {
246
+ let T = (k = P.filter((D) => D.overflows[0] <= 0).sort((D, S) => D.overflows[1] - S.overflows[1])[0]) == null ? void 0 : k.placement;
247
+ if (!T)
248
+ switch (n) {
246
249
  case "bestFit": {
247
250
  var M;
248
- const R = (M = P.filter((D) => {
249
- if (T) {
250
- const V = $(D.placement);
251
- return V === h || // Create a bias to the `y` side axis due to horizontal
251
+ const D = (M = P.filter((S) => {
252
+ if (A) {
253
+ const V = _(S.placement);
254
+ return V === v || // Create a bias to the `y` side axis due to horizontal
252
255
  // reading directions favoring greater width.
253
256
  V === "y";
254
257
  }
255
258
  return !0;
256
- }).map((D) => [D.placement, D.overflows.filter((V) => V > 0).reduce((V, K) => V + K, 0)]).sort((D, V) => D[1] - V[1])[0]) == null ? void 0 : M[0];
257
- R && (E = R);
259
+ }).map((S) => [S.placement, S.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((S, V) => S[1] - V[1])[0]) == null ? void 0 : M[0];
260
+ D && (T = D);
258
261
  break;
259
262
  }
260
263
  case "initialPlacement":
261
- E = r;
264
+ T = r;
262
265
  break;
263
266
  }
264
- if (f !== E)
267
+ if (f !== T)
265
268
  return {
266
269
  reset: {
267
- placement: E
270
+ placement: T
268
271
  }
269
272
  };
270
273
  }
271
274
  return {};
272
275
  }
273
276
  };
274
- }, et = /* @__PURE__ */ new Set(["left", "top"]);
275
- async function nt(a, e) {
277
+ }, nt = /* @__PURE__ */ new Set(["left", "top"]);
278
+ async function it(l, t) {
276
279
  const {
277
280
  placement: d,
278
- platform: o,
281
+ platform: i,
279
282
  elements: f
280
- } = a, n = await (o.isRTL == null ? void 0 : o.isRTL(f.floating)), c = B(d), r = Y(d), g = $(d) === "y", x = et.has(c) ? -1 : 1, i = n && g ? -1 : 1, s = H(e, a);
283
+ } = l, e = await (i.isRTL == null ? void 0 : i.isRTL(f.floating)), o = W(d), r = Y(d), g = _(d) === "y", u = nt.has(o) ? -1 : 1, a = e && g ? -1 : 1, c = j(t, l);
281
284
  let {
282
285
  mainAxis: m,
283
- crossAxis: t,
284
- alignmentAxis: l
285
- } = typeof s == "number" ? {
286
- mainAxis: s,
286
+ crossAxis: n,
287
+ alignmentAxis: s
288
+ } = typeof c == "number" ? {
289
+ mainAxis: c,
287
290
  crossAxis: 0,
288
291
  alignmentAxis: null
289
292
  } : {
290
- mainAxis: s.mainAxis || 0,
291
- crossAxis: s.crossAxis || 0,
292
- alignmentAxis: s.alignmentAxis
293
+ mainAxis: c.mainAxis || 0,
294
+ crossAxis: c.crossAxis || 0,
295
+ alignmentAxis: c.alignmentAxis
293
296
  };
294
- return r && typeof l == "number" && (t = r === "end" ? l * -1 : l), g ? {
295
- x: t * i,
296
- y: m * x
297
+ return r && typeof s == "number" && (n = r === "end" ? s * -1 : s), g ? {
298
+ x: n * a,
299
+ y: m * u
297
300
  } : {
298
- x: m * x,
299
- y: t * i
301
+ x: m * u,
302
+ y: n * a
300
303
  };
301
304
  }
302
- const lt = function(a) {
303
- return a === void 0 && (a = 0), {
305
+ const ct = function(l) {
306
+ return l === void 0 && (l = 0), {
304
307
  name: "offset",
305
- options: a,
306
- async fn(e) {
307
- var d, o;
308
+ options: l,
309
+ async fn(t) {
310
+ var d, i;
308
311
  const {
309
312
  x: f,
310
- y: n,
311
- placement: c,
313
+ y: e,
314
+ placement: o,
312
315
  middlewareData: r
313
- } = e, g = await nt(e, a);
314
- return c === ((d = r.offset) == null ? void 0 : d.placement) && (o = r.arrow) != null && o.alignmentOffset ? {} : {
316
+ } = t, g = await it(t, l);
317
+ return o === ((d = r.offset) == null ? void 0 : d.placement) && (i = r.arrow) != null && i.alignmentOffset ? {} : {
315
318
  x: f + g.x,
316
- y: n + g.y,
319
+ y: e + g.y,
317
320
  data: {
318
321
  ...g,
319
- placement: c
322
+ placement: o
320
323
  }
321
324
  };
322
325
  }
323
326
  };
324
- }, ct = function(a) {
325
- return a === void 0 && (a = {}), {
327
+ }, rt = function(l) {
328
+ return l === void 0 && (l = {}), {
326
329
  name: "shift",
327
- options: a,
328
- async fn(e) {
330
+ options: l,
331
+ async fn(t) {
329
332
  const {
330
333
  x: d,
331
- y: o,
332
- placement: f
333
- } = e, {
334
- mainAxis: n = !0,
335
- crossAxis: c = !1,
336
- limiter: r = {
334
+ y: i,
335
+ placement: f,
336
+ platform: e
337
+ } = t, {
338
+ mainAxis: o = !0,
339
+ crossAxis: r = !1,
340
+ limiter: g = {
337
341
  fn: (w) => {
338
342
  let {
339
- x: p,
343
+ x: v,
340
344
  y: h
341
345
  } = w;
342
346
  return {
343
- x: p,
347
+ x: v,
344
348
  y: h
345
349
  };
346
350
  }
347
351
  },
348
- ...g
349
- } = H(a, e), x = {
352
+ ...u
353
+ } = j(l, t), a = {
350
354
  x: d,
351
- y: o
352
- }, i = await z(e, g), s = $(B(f)), m = tt(s);
353
- let t = x[m], l = x[s];
354
- if (n) {
355
- const w = m === "y" ? "top" : "left", p = m === "y" ? "bottom" : "right", h = t + i[w], y = t - i[p];
356
- t = _(h, t, y);
355
+ y: i
356
+ }, c = await e.detectOverflow(t, u), m = _(W(f)), n = Z(m);
357
+ let s = a[n], x = a[m];
358
+ if (o) {
359
+ const w = n === "y" ? "top" : "left", v = n === "y" ? "bottom" : "right", h = s + c[w], y = s - c[v];
360
+ s = z(h, s, y);
357
361
  }
358
- if (c) {
359
- const w = s === "y" ? "top" : "left", p = s === "y" ? "bottom" : "right", h = l + i[w], y = l - i[p];
360
- l = _(h, l, y);
362
+ if (r) {
363
+ const w = m === "y" ? "top" : "left", v = m === "y" ? "bottom" : "right", h = x + c[w], y = x - c[v];
364
+ x = z(h, x, y);
361
365
  }
362
- const u = r.fn({
363
- ...e,
364
- [m]: t,
365
- [s]: l
366
+ const p = g.fn({
367
+ ...t,
368
+ [n]: s,
369
+ [m]: x
366
370
  });
367
371
  return {
368
- ...u,
372
+ ...p,
369
373
  data: {
370
- x: u.x - d,
371
- y: u.y - o,
374
+ x: p.x - d,
375
+ y: p.y - i,
372
376
  enabled: {
373
- [m]: n,
374
- [s]: c
377
+ [n]: o,
378
+ [m]: r
375
379
  }
376
380
  }
377
381
  };
378
382
  }
379
383
  };
380
- }, rt = function(a) {
381
- return a === void 0 && (a = {}), {
384
+ }, ft = function(l) {
385
+ return l === void 0 && (l = {}), {
382
386
  name: "size",
383
- options: a,
384
- async fn(e) {
385
- var d, o;
387
+ options: l,
388
+ async fn(t) {
389
+ var d, i;
386
390
  const {
387
391
  placement: f,
388
- rects: n,
389
- platform: c,
392
+ rects: e,
393
+ platform: o,
390
394
  elements: r
391
- } = e, {
395
+ } = t, {
392
396
  apply: g = () => {
393
397
  },
394
- ...x
395
- } = H(a, e), i = await z(e, x), s = B(f), m = Y(f), t = $(f) === "y", {
396
- width: l,
397
- height: u
398
- } = n.floating;
399
- let w, p;
400
- s === "top" || s === "bottom" ? (w = s, p = m === (await (c.isRTL == null ? void 0 : c.isRTL(r.floating)) ? "start" : "end") ? "left" : "right") : (p = s, w = m === "end" ? "top" : "bottom");
401
- const h = u - i.top - i.bottom, y = l - i.left - i.right, b = W(u - i[w], h), v = W(l - i[p], y), T = !e.middlewareData.shift;
402
- let O = b, k = v;
403
- if ((d = e.middlewareData.shift) != null && d.enabled.x && (k = y), (o = e.middlewareData.shift) != null && o.enabled.y && (O = h), T && !m) {
404
- const P = j(i.left, 0), L = j(i.right, 0), C = j(i.top, 0), M = j(i.bottom, 0);
405
- t ? k = l - 2 * (P !== 0 || L !== 0 ? P + L : j(i.left, i.right)) : O = u - 2 * (C !== 0 || M !== 0 ? C + M : j(i.top, i.bottom));
398
+ ...u
399
+ } = j(l, t), a = await o.detectOverflow(t, u), c = W(f), m = Y(f), n = _(f) === "y", {
400
+ width: s,
401
+ height: x
402
+ } = e.floating;
403
+ let p, w;
404
+ c === "top" || c === "bottom" ? (p = c, w = m === (await (o.isRTL == null ? void 0 : o.isRTL(r.floating)) ? "start" : "end") ? "left" : "right") : (w = c, p = m === "end" ? "top" : "bottom");
405
+ const v = x - a.top - a.bottom, h = s - a.left - a.right, y = H(x - a[p], v), O = H(s - a[w], h), A = !t.middlewareData.shift;
406
+ let R = y, E = O;
407
+ if ((d = t.middlewareData.shift) != null && d.enabled.x && (E = h), (i = t.middlewareData.shift) != null && i.enabled.y && (R = v), A && !m) {
408
+ const P = F(a.left, 0), L = F(a.right, 0), k = F(a.top, 0), M = F(a.bottom, 0);
409
+ n ? E = s - 2 * (P !== 0 || L !== 0 ? P + L : F(a.left, a.right)) : R = x - 2 * (k !== 0 || M !== 0 ? k + M : F(a.top, a.bottom));
406
410
  }
407
411
  await g({
408
- ...e,
409
- availableWidth: k,
410
- availableHeight: O
412
+ ...t,
413
+ availableWidth: E,
414
+ availableHeight: R
411
415
  });
412
- const S = await c.getDimensions(r.floating);
413
- return l !== S.width || u !== S.height ? {
416
+ const C = await o.getDimensions(r.floating);
417
+ return s !== C.width || x !== C.height ? {
414
418
  reset: {
415
419
  rects: !0
416
420
  }
@@ -419,12 +423,12 @@ const lt = function(a) {
419
423
  };
420
424
  };
421
425
  export {
422
- st as arrow,
423
- ot as computePosition,
424
- z as detectOverflow,
425
- at as flip,
426
- lt as offset,
427
- X as rectToClientRect,
428
- ct as shift,
429
- rt as size
426
+ at as arrow,
427
+ st as computePosition,
428
+ tt as detectOverflow,
429
+ lt as flip,
430
+ ct as offset,
431
+ B as rectToClientRect,
432
+ rt as shift,
433
+ ft as size
430
434
  };