@cupra/ui-kit 1.0.0-canary.13 → 1.0.0-canary.15

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 (45) hide show
  1. package/dist/components/ds-rating/ds-rating.d.ts +14 -0
  2. package/dist/components/ds-rating/ds-rating.js +73 -0
  3. package/dist/components/ds-rating/ds-rating.test.d.ts +8 -0
  4. package/dist/components/ds-rating/ds-rating.types.d.ts +6 -0
  5. package/dist/components/ds-rating/styles/common.styles.d.ts +1 -0
  6. package/dist/components/ds-rating/styles/common.styles.js +14 -0
  7. package/dist/components/ds-theme-provider/ds-theme-provider.js +1 -1
  8. package/dist/components/ds-tooltip/ds-tooltip.d.ts +37 -23
  9. package/dist/components/ds-tooltip/ds-tooltip.js +179 -157
  10. package/dist/components/ds-tooltip/ds-tooltip.test.d.ts +8 -0
  11. package/dist/components/ds-tooltip/ds-tooltip.types.d.ts +5 -10
  12. package/dist/components/ds-tooltip/styles/common.styles.d.ts +0 -2
  13. package/dist/components/ds-tooltip/styles/common.styles.js +69 -102
  14. package/dist/components/index.d.ts +2 -1
  15. package/dist/index.js +4 -3
  16. package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +430 -0
  17. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +313 -0
  18. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +132 -0
  19. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
  20. package/dist/utils/StylesRegistry/StylesRegistry.js +1 -1
  21. package/dist/utils/cssWithTokens.js +1 -1
  22. package/dist/utils/htmlWithTokens.js +1 -1
  23. package/dist-react/components/ds-rating/ds-rating.d.ts +14 -0
  24. package/dist-react/components/ds-rating/ds-rating.js +73 -0
  25. package/dist-react/components/ds-rating/ds-rating.test.d.ts +8 -0
  26. package/dist-react/components/ds-rating/ds-rating.types.d.ts +6 -0
  27. package/dist-react/components/ds-rating/styles/common.styles.d.ts +1 -0
  28. package/dist-react/components/ds-rating/styles/common.styles.js +14 -0
  29. package/dist-react/components/ds-theme-provider/ds-theme-provider.js +1 -1
  30. package/dist-react/components/ds-tooltip/ds-tooltip.d.ts +37 -23
  31. package/dist-react/components/ds-tooltip/ds-tooltip.js +179 -157
  32. package/dist-react/components/ds-tooltip/ds-tooltip.test.d.ts +8 -0
  33. package/dist-react/components/ds-tooltip/ds-tooltip.types.d.ts +5 -10
  34. package/dist-react/components/ds-tooltip/styles/common.styles.d.ts +0 -2
  35. package/dist-react/components/ds-tooltip/styles/common.styles.js +69 -102
  36. package/dist-react/components/index.d.ts +2 -1
  37. package/dist-react/index.js +4 -3
  38. package/dist-react/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +430 -0
  39. package/dist-react/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +313 -0
  40. package/dist-react/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +132 -0
  41. package/dist-react/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
  42. package/dist-react/utils/StylesRegistry/StylesRegistry.js +1 -1
  43. package/dist-react/utils/cssWithTokens.js +1 -1
  44. package/dist-react/utils/htmlWithTokens.js +1 -1
  45. package/package.json +2 -1
@@ -2,10 +2,11 @@ import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@li
2
2
  import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
3
3
  import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
4
4
  import { css as t } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
5
- const e = t`
5
+ const i = t`
6
6
  :host {
7
7
  position: relative;
8
8
  display: inline-block;
9
+ width: fit-content;
9
10
  }
10
11
 
11
12
  .title {
@@ -21,143 +22,109 @@ const e = t`
21
22
  grid-template-columns: 1fr 1fr;
22
23
  justify-content: flex-end;
23
24
  }
24
- `, p = t`
25
- .tooltip {
26
- width: max-content;
27
- white-space: normal;
28
- box-sizing: border-box;
29
- position: absolute;
30
- }
31
25
 
32
- .tooltip.complex {
33
- padding: 12px;
26
+ ::slotted([slot='content']) {
27
+ text-align: left;
34
28
  }
35
29
 
36
- .tooltip.top {
37
- bottom: 100%;
38
- margin-bottom: 13px;
39
- }
30
+ .container {
31
+ white-space: normal;
32
+ box-sizing: border-box;
33
+ display: flex;
34
+ flex-direction: column;
35
+ justify-content: center;
36
+ align-items: flex-start;
37
+ gap: var(--ds-spacing-s-5, 8px);
38
+ align-self: stretch;
40
39
 
41
- .tooltip.bottom {
42
- top: 100%;
43
- margin-top: 13px;
44
- }
40
+ z-index: var(--ds-z-index-tooltip, 1300);
45
41
 
46
- .tooltip.left {
47
- right: 100%;
48
- margin-right: 13px;
42
+ position: absolute;
43
+ width: max-content;
49
44
  }
50
45
 
51
- .tooltip.right {
52
- left: 100%;
53
- margin-left: 13px;
46
+ ::slotted([slot='image']) {
47
+ width: 100%;
48
+ height: auto;
49
+ object-fit: contain;
54
50
  }
55
51
 
56
- .tooltip.top.center,
57
- .tooltip.bottom.center {
58
- left: 50%;
59
- transform: translateX(-50%);
52
+ .header-container {
53
+ display: flex;
54
+ width: 100%;
55
+ align-items: center;
56
+ justify-content: space-between;
60
57
  }
61
58
 
62
- .tooltip.left.center,
63
- .tooltip.right.center {
64
- top: 50%;
65
- transform: translateY(-50%);
59
+ .header-container.hidden,
60
+ .content-container.hidden {
61
+ display: none;
66
62
  }
67
63
 
68
- .tooltip.top.start,
69
- .tooltip.bottom.start {
70
- left: 0;
71
- transform: none;
64
+ .content-container {
65
+ overflow: auto;
72
66
  }
73
67
 
74
- .tooltip.left.start,
75
- .tooltip.right.start {
76
- top: 0;
77
- transform: none;
68
+ ::slotted([slot='header']) {
69
+ flex: 1 1 auto;
78
70
  }
79
71
 
80
- .tooltip.top.end,
81
- .tooltip.bottom.end {
82
- left: auto;
83
- right: 0;
84
- transform: none;
72
+ ::slotted([slot='close-button']) {
73
+ flex: 0 0 auto;
74
+ margin-left: auto;
85
75
  }
86
76
 
87
- .tooltip.left.end,
88
- .tooltip.right.end {
89
- top: auto;
90
- bottom: 0;
91
- transform: none;
92
- }
93
- `, a = t`
94
77
  .arrow {
95
- width: 0;
96
- height: 0;
97
- border-style: solid;
98
78
  position: absolute;
79
+ z-index: var(--ds-z-index-tooltip, 1300);
99
80
  }
100
81
 
101
- .arrow.top {
102
- border-width: 5px 6px 0 6px;
103
- bottom: calc(100% + 9px);
104
- }
105
-
106
- .arrow.bottom {
107
- border-width: 0 6px 5px 6px;
108
- top: calc(100% + 9px);
109
- }
110
-
111
- .arrow.left {
112
- border-width: 6px 0 6px 5px;
113
- right: calc(100% + 9px);
82
+ .ds-tooltip-arrow-background {
83
+ fill: var(--ds-tooltip-arrow-background-color);
114
84
  }
115
85
 
116
- .arrow.right {
117
- border-width: 6px 5px 6px 0;
118
- left: calc(100% + 9px);
86
+ .ds-tooltip-arrow-border {
87
+ stroke: var(--ds-tooltip-arrow-border-color);
119
88
  }
120
89
 
121
- .arrow.top,
122
- .arrow.bottom {
123
- left: 50%;
124
- transform: translateX(-50%);
90
+ .anchor {
91
+ line-height: 0;
92
+ outline: none;
93
+ width: fit-content;
125
94
  }
126
95
 
127
- .arrow.left,
128
- .arrow.right {
129
- top: 50%;
130
- transform: translateY(-50%);
131
- }
132
-
133
- .arrow.top.start.not-positionable,
134
- .arrow.bottom.start.not-positionable {
135
- left: 6px;
136
- transform: none;
96
+ .top .arrow,
97
+ .top-start .arrow,
98
+ .top-end .arrow {
99
+ bottom: 0;
100
+ margin-bottom: -9px;
101
+ transform: rotate(180deg);
137
102
  }
138
103
 
139
- .arrow.top.end.not-positionable,
140
- .arrow.bottom.end.not-positionable {
141
- left: auto;
142
- right: 6px;
143
- transform: none;
104
+ .bottom .arrow,
105
+ .bottom-start .arrow,
106
+ .bottom-end .arrow {
107
+ top: 0;
108
+ margin-top: -9px;
109
+ transform: rotate(0deg);
144
110
  }
145
111
 
146
- .arrow.left.start.not-positionable,
147
- .arrow.right.start.not-positionable {
148
- top: 6px;
149
- transform: none;
112
+ .left .arrow,
113
+ .left-start .arrow,
114
+ .left-end .arrow {
115
+ right: 0;
116
+ margin-right: -9px;
117
+ transform: rotate(90deg);
150
118
  }
151
119
 
152
- .arrow.left.end.not-positionable,
153
- .arrow.right.end.not-positionable {
154
- top: auto;
155
- bottom: 6px;
156
- transform: none;
120
+ .right .arrow,
121
+ .right-start .arrow,
122
+ .right-end .arrow {
123
+ left: 0;
124
+ margin-left: -9px;
125
+ transform: rotate(270deg);
157
126
  }
158
127
  `;
159
128
  export {
160
- a as arrowStyles,
161
- e as commonStyles,
162
- p as tooltipStyles
129
+ i as commonStyles
163
130
  };
@@ -27,9 +27,10 @@ import './ds-password-input/ds-password-input.ts';
27
27
  import './ds-picker-item/ds-picker-item.ts';
28
28
  import './ds-portal/ds-portal.ts';
29
29
  import './ds-progress-bar/ds-progress-bar.ts';
30
+ import './ds-radio/ds-radio.ts';
30
31
  import './ds-radio-button/ds-radio-button.ts';
31
32
  import './ds-radio-group/ds-radio-group.ts';
32
- import './ds-radio/ds-radio.ts';
33
+ import './ds-rating/ds-rating.ts';
33
34
  import './ds-search-input/ds-search-input.ts';
34
35
  import './ds-search/ds-search.ts';
35
36
  import './ds-secondary-navigation/ds-secondary-navigation.ts';
package/dist/index.js CHANGED
@@ -27,9 +27,10 @@ import "./components/ds-password-input/ds-password-input.js";
27
27
  import "./components/ds-picker-item/ds-picker-item.js";
28
28
  import "./components/ds-portal/ds-portal.js";
29
29
  import "./components/ds-progress-bar/ds-progress-bar.js";
30
+ import "./components/ds-radio/ds-radio.js";
30
31
  import "./components/ds-radio-button/ds-radio-button.js";
31
32
  import "./components/ds-radio-group/ds-radio-group.js";
32
- import "./components/ds-radio/ds-radio.js";
33
+ import "./components/ds-rating/ds-rating.js";
33
34
  import "./components/ds-search-input/ds-search-input.js";
34
35
  import "./components/ds-search/ds-search.js";
35
36
  import "./components/ds-secondary-navigation/ds-secondary-navigation.js";
@@ -54,7 +55,7 @@ import "./components/ds-static-box/ds-static-box.js";
54
55
  import "./components/ds-interactive-card/ds-interactive-card.js";
55
56
  import "./components/ds-radio-button-group/ds-radio-button-group.js";
56
57
  import "./components/ds-sidebar-navigation/ds-sidebar-navigation.js";
57
- import { iconNames as po } from "./components/ds-icon/iconNames.js";
58
+ import { iconNames as to } from "./components/ds-icon/iconNames.js";
58
59
  export {
59
- po as iconNames
60
+ to as iconNames
60
61
  };
@@ -0,0 +1,430 @@
1
+ import { evaluate as H, getSide as B, getSideAxis as $, getOppositePlacement as N, getExpandedPlacements as Q, getOppositeAxisPlacements as U, getAlignmentSides as Z, clamp as _, getPaddingObject as q, getAlignmentAxis as G, getAlignment as Y, min as W, max as j, rectToClientRect as X, getOppositeAxis as tt, getAxisLength as J } from "../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js";
2
+ function I(a, e, d) {
3
+ let {
4
+ reference: o,
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;
9
+ switch (g) {
10
+ case "top":
11
+ t = {
12
+ x: i,
13
+ y: o.y - f.height
14
+ };
15
+ break;
16
+ case "bottom":
17
+ t = {
18
+ x: i,
19
+ y: o.y + o.height
20
+ };
21
+ break;
22
+ case "right":
23
+ t = {
24
+ x: o.x + o.width,
25
+ y: s
26
+ };
27
+ break;
28
+ case "left":
29
+ t = {
30
+ x: o.x - f.width,
31
+ y: s
32
+ };
33
+ break;
34
+ default:
35
+ t = {
36
+ x: o.x,
37
+ y: o.y
38
+ };
39
+ }
40
+ switch (Y(e)) {
41
+ case "start":
42
+ t[c] -= m * (d && x ? -1 : 1);
43
+ break;
44
+ case "end":
45
+ t[c] += m * (d && x ? -1 : 1);
46
+ break;
47
+ }
48
+ return t;
49
+ }
50
+ const ot = async (a, e, d) => {
51
+ const {
52
+ placement: o = "bottom",
53
+ 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,
60
+ strategy: f
61
+ }), {
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++) {
66
+ const {
67
+ name: w,
68
+ fn: p
69
+ } = r[u], {
70
+ x: h,
71
+ y,
72
+ data: b,
73
+ reset: v
74
+ } = await p({
75
+ x: i,
76
+ y: s,
77
+ initialPlacement: o,
78
+ placement: m,
79
+ strategy: f,
80
+ middlewareData: t,
81
+ rects: x,
82
+ platform: c,
83
+ elements: {
84
+ reference: a,
85
+ floating: e
86
+ }
87
+ });
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,
97
+ strategy: f
98
+ }) : v.rects), {
99
+ x: i,
100
+ y: s
101
+ } = I(x, m, g)), u = -1);
102
+ }
103
+ return {
104
+ x: i,
105
+ y: s,
106
+ placement: m,
107
+ strategy: f,
108
+ middlewareData: t
109
+ };
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) => ({
157
+ name: "arrow",
158
+ options: a,
159
+ async fn(e) {
160
+ const {
161
+ x: d,
162
+ y: o,
163
+ placement: f,
164
+ rects: n,
165
+ platform: c,
166
+ elements: r,
167
+ middlewareData: g
168
+ } = e, {
169
+ element: x,
170
+ padding: i = 0
171
+ } = H(a, e) || {};
172
+ if (x == null)
173
+ return {};
174
+ const s = q(i), m = {
175
+ 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;
181
+ return {
182
+ [t]: m[t] + R,
183
+ data: {
184
+ [t]: F,
185
+ centerOffset: A - F - R,
186
+ ...E && {
187
+ alignmentOffset: R
188
+ }
189
+ },
190
+ reset: E
191
+ };
192
+ }
193
+ }), at = function(a) {
194
+ return a === void 0 && (a = {}), {
195
+ name: "flip",
196
+ options: a,
197
+ async fn(e) {
198
+ var d, o;
199
+ const {
200
+ placement: f,
201
+ middlewareData: n,
202
+ rects: c,
203
+ initialPlacement: r,
204
+ platform: g,
205
+ elements: x
206
+ } = e, {
207
+ mainAxis: i = !0,
208
+ crossAxis: s = !0,
209
+ 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)
216
+ 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]]);
224
+ }
225
+ if (P = [...P, {
226
+ 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
232
+ // overflows the main axis.
233
+ P.every((D) => $(D.placement) === h ? D.overflows[0] > 0 : !0)))
234
+ return {
235
+ data: {
236
+ index: A,
237
+ overflows: P
238
+ },
239
+ reset: {
240
+ placement: F
241
+ }
242
+ };
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
+ case "bestFit": {
247
+ 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
252
+ // reading directions favoring greater width.
253
+ V === "y";
254
+ }
255
+ 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);
258
+ break;
259
+ }
260
+ case "initialPlacement":
261
+ E = r;
262
+ break;
263
+ }
264
+ if (f !== E)
265
+ return {
266
+ reset: {
267
+ placement: E
268
+ }
269
+ };
270
+ }
271
+ return {};
272
+ }
273
+ };
274
+ }, et = /* @__PURE__ */ new Set(["left", "top"]);
275
+ async function nt(a, e) {
276
+ const {
277
+ placement: d,
278
+ platform: o,
279
+ 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);
281
+ let {
282
+ mainAxis: m,
283
+ crossAxis: t,
284
+ alignmentAxis: l
285
+ } = typeof s == "number" ? {
286
+ mainAxis: s,
287
+ crossAxis: 0,
288
+ alignmentAxis: null
289
+ } : {
290
+ mainAxis: s.mainAxis || 0,
291
+ crossAxis: s.crossAxis || 0,
292
+ alignmentAxis: s.alignmentAxis
293
+ };
294
+ return r && typeof l == "number" && (t = r === "end" ? l * -1 : l), g ? {
295
+ x: t * i,
296
+ y: m * x
297
+ } : {
298
+ x: m * x,
299
+ y: t * i
300
+ };
301
+ }
302
+ const lt = function(a) {
303
+ return a === void 0 && (a = 0), {
304
+ name: "offset",
305
+ options: a,
306
+ async fn(e) {
307
+ var d, o;
308
+ const {
309
+ x: f,
310
+ y: n,
311
+ placement: c,
312
+ 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 ? {} : {
315
+ x: f + g.x,
316
+ y: n + g.y,
317
+ data: {
318
+ ...g,
319
+ placement: c
320
+ }
321
+ };
322
+ }
323
+ };
324
+ }, ct = function(a) {
325
+ return a === void 0 && (a = {}), {
326
+ name: "shift",
327
+ options: a,
328
+ async fn(e) {
329
+ const {
330
+ x: d,
331
+ y: o,
332
+ placement: f
333
+ } = e, {
334
+ mainAxis: n = !0,
335
+ crossAxis: c = !1,
336
+ limiter: r = {
337
+ fn: (w) => {
338
+ let {
339
+ x: p,
340
+ y: h
341
+ } = w;
342
+ return {
343
+ x: p,
344
+ y: h
345
+ };
346
+ }
347
+ },
348
+ ...g
349
+ } = H(a, e), x = {
350
+ 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);
357
+ }
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);
361
+ }
362
+ const u = r.fn({
363
+ ...e,
364
+ [m]: t,
365
+ [s]: l
366
+ });
367
+ return {
368
+ ...u,
369
+ data: {
370
+ x: u.x - d,
371
+ y: u.y - o,
372
+ enabled: {
373
+ [m]: n,
374
+ [s]: c
375
+ }
376
+ }
377
+ };
378
+ }
379
+ };
380
+ }, rt = function(a) {
381
+ return a === void 0 && (a = {}), {
382
+ name: "size",
383
+ options: a,
384
+ async fn(e) {
385
+ var d, o;
386
+ const {
387
+ placement: f,
388
+ rects: n,
389
+ platform: c,
390
+ elements: r
391
+ } = e, {
392
+ apply: g = () => {
393
+ },
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));
406
+ }
407
+ await g({
408
+ ...e,
409
+ availableWidth: k,
410
+ availableHeight: O
411
+ });
412
+ const S = await c.getDimensions(r.floating);
413
+ return l !== S.width || u !== S.height ? {
414
+ reset: {
415
+ rects: !0
416
+ }
417
+ } : {};
418
+ }
419
+ };
420
+ };
421
+ 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
430
+ };