@ebay/ui-core-react 7.1.0-alpha.2 → 7.1.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 (143) hide show
  1. package/common/tooltip-utils/index.d.ts +2 -2
  2. package/common/tooltip-utils/index.d.ts.map +1 -1
  3. package/ebay-button/README.md +4 -0
  4. package/ebay-button/index.d.ts +2 -2
  5. package/ebay-button/index.d.ts.map +1 -1
  6. package/ebay-carousel/index.d.ts +1 -1
  7. package/ebay-carousel/index.d.ts.map +1 -1
  8. package/ebay-date-textbox/index.d.ts +1 -1
  9. package/ebay-date-textbox/index.d.ts.map +1 -1
  10. package/ebay-dialog-base/index.d.ts +1 -1
  11. package/ebay-dialog-base/index.d.ts.map +1 -1
  12. package/ebay-eek/index.d.ts +1 -1
  13. package/ebay-eek/index.d.ts.map +1 -1
  14. package/ebay-fake-menu/index.d.ts +1 -1
  15. package/ebay-fake-menu/index.d.ts.map +1 -1
  16. package/ebay-fake-menu-button/index.d.ts +1 -1
  17. package/ebay-fake-menu-button/index.d.ts.map +1 -1
  18. package/ebay-field/index.d.ts +2 -2
  19. package/ebay-field/index.d.ts.map +1 -1
  20. package/ebay-icon/index.d.ts +2 -2
  21. package/ebay-icon/index.d.ts.map +1 -1
  22. package/ebay-icon/types.d.ts +1 -1
  23. package/ebay-icon/types.d.ts.map +1 -1
  24. package/ebay-icon-button/index.d.ts +1 -1
  25. package/ebay-icon-button/index.d.ts.map +1 -1
  26. package/ebay-infotip/index.d.ts +1 -1
  27. package/ebay-infotip/index.d.ts.map +1 -1
  28. package/ebay-inline-notice/index.d.ts +1 -1
  29. package/ebay-inline-notice/index.d.ts.map +1 -1
  30. package/ebay-menu/index.d.ts +2 -2
  31. package/ebay-menu/index.d.ts.map +1 -1
  32. package/ebay-menu-button/index.d.ts +1 -1
  33. package/ebay-menu-button/index.d.ts.map +1 -1
  34. package/ebay-page-notice/index.d.ts +1 -1
  35. package/ebay-page-notice/index.d.ts.map +1 -1
  36. package/ebay-pagination/index.d.ts +1 -1
  37. package/ebay-pagination/index.d.ts.map +1 -1
  38. package/ebay-progress-bar/index.d.ts +1 -1
  39. package/ebay-progress-bar/index.d.ts.map +1 -1
  40. package/ebay-progress-stepper/index.d.ts +1 -1
  41. package/ebay-progress-stepper/index.d.ts.map +1 -1
  42. package/ebay-section-notice/index.d.ts +1 -1
  43. package/ebay-section-notice/index.d.ts.map +1 -1
  44. package/ebay-section-notice/section-notice.d.ts.map +1 -1
  45. package/ebay-section-notice.js +1 -1
  46. package/ebay-select/index.d.ts +1 -1
  47. package/ebay-select/index.d.ts.map +1 -1
  48. package/ebay-signal/index.d.ts +1 -1
  49. package/ebay-signal/index.d.ts.map +1 -1
  50. package/ebay-snackbar-dialog/index.d.ts +1 -1
  51. package/ebay-snackbar-dialog/index.d.ts.map +1 -1
  52. package/ebay-split-button/index.d.ts +1 -1
  53. package/ebay-split-button/index.d.ts.map +1 -1
  54. package/ebay-star-rating/index.d.ts +1 -2
  55. package/ebay-star-rating/index.d.ts.map +1 -1
  56. package/ebay-star-rating/star-rating.d.ts +1 -1
  57. package/ebay-star-rating/star-rating.d.ts.map +1 -1
  58. package/ebay-star-rating-select/index.d.ts +1 -2
  59. package/ebay-star-rating-select/index.d.ts.map +1 -1
  60. package/ebay-svg/svg.d.ts.map +1 -1
  61. package/ebay-svg.js +1 -1
  62. package/ebay-textbox/index.d.ts +2 -2
  63. package/ebay-textbox/index.d.ts.map +1 -1
  64. package/ebay-tooltip/index.d.ts +1 -1
  65. package/ebay-tooltip/index.d.ts.map +1 -1
  66. package/ebay-tourtip/index.d.ts +1 -1
  67. package/ebay-tourtip/index.d.ts.map +1 -1
  68. package/ebay-video/index.d.ts +2 -2
  69. package/ebay-video/index.d.ts.map +1 -1
  70. package/package.json +2 -3
  71. package/array.polyfill.flat-Bj5UhY_-.mjs +0 -10
  72. package/badge-BX5HuO-3.mjs +0 -9
  73. package/button-B06HeRsZ.mjs +0 -63
  74. package/calendar-Dq0eM9VC.mjs +0 -216
  75. package/debounce-u81vJ6wg.mjs +0 -9
  76. package/dialog-previous-button-gmkm4c8J.mjs +0 -146
  77. package/drawer-Dcg135Bb.mjs +0 -40
  78. package/ebay-alert-dialog.mjs +0 -22
  79. package/ebay-badge.mjs +0 -4
  80. package/ebay-breadcrumbs.mjs +0 -39
  81. package/ebay-button.mjs +0 -5
  82. package/ebay-calendar.mjs +0 -4
  83. package/ebay-carousel.mjs +0 -229
  84. package/ebay-checkbox.mjs +0 -43
  85. package/ebay-confirm-dialog.mjs +0 -24
  86. package/ebay-cta-button.mjs +0 -20
  87. package/ebay-date-textbox.mjs +0 -74
  88. package/ebay-dialog-base.mjs +0 -9
  89. package/ebay-drawer-dialog.mjs +0 -4
  90. package/ebay-eek.mjs +0 -42
  91. package/ebay-fake-menu-button.mjs +0 -7
  92. package/ebay-fake-menu.mjs +0 -9
  93. package/ebay-fake-tabs.mjs +0 -27
  94. package/ebay-field.mjs +0 -19
  95. package/ebay-fullscreen-dialog.mjs +0 -9
  96. package/ebay-icon-button.mjs +0 -4
  97. package/ebay-icon.mjs +0 -4
  98. package/ebay-infotip.mjs +0 -59
  99. package/ebay-inline-notice.mjs +0 -31
  100. package/ebay-lightbox-dialog.mjs +0 -11
  101. package/ebay-listbox-button.mjs +0 -170
  102. package/ebay-menu-button.mjs +0 -82
  103. package/ebay-menu.mjs +0 -9
  104. package/ebay-notice-base.mjs +0 -7
  105. package/ebay-page-notice.mjs +0 -42
  106. package/ebay-pagination.mjs +0 -159
  107. package/ebay-panel-dialog.mjs +0 -11
  108. package/ebay-progress-bar.mjs +0 -6
  109. package/ebay-progress-spinner.mjs +0 -4
  110. package/ebay-progress-stepper.mjs +0 -63
  111. package/ebay-radio.mjs +0 -42
  112. package/ebay-section-notice.mjs +0 -46
  113. package/ebay-section-title.mjs +0 -24
  114. package/ebay-select.mjs +0 -69
  115. package/ebay-signal.mjs +0 -9
  116. package/ebay-snackbar-dialog.mjs +0 -46
  117. package/ebay-split-button.mjs +0 -20
  118. package/ebay-star-rating-select.mjs +0 -36
  119. package/ebay-star-rating.mjs +0 -8
  120. package/ebay-svg.mjs +0 -4753
  121. package/ebay-switch.mjs +0 -25
  122. package/ebay-tabs.mjs +0 -66
  123. package/ebay-textbox.mjs +0 -8
  124. package/ebay-toast-dialog.mjs +0 -9
  125. package/ebay-tooltip.mjs +0 -39
  126. package/ebay-tourtip.mjs +0 -43
  127. package/ebay-video.mjs +0 -173
  128. package/hooks-r29zhPsY.mjs +0 -63
  129. package/icon-B_a65KUD.mjs +0 -42
  130. package/icon-button-Dy8rjzH7.mjs +0 -24
  131. package/index-B5oC9Rl1.mjs +0 -22
  132. package/label-DgOo6Mql.mjs +0 -19
  133. package/menu-CR1Dxl2m.mjs +0 -154
  134. package/menu-button-label-vVnRKJRU.mjs +0 -68
  135. package/menu-item-jlKZ3uT4.mjs +0 -67
  136. package/notice-content-BVZMfcMH.mjs +0 -4
  137. package/notice-content-CdXVjKzD.mjs +0 -9
  138. package/notice-footer-BFa2IeY9.mjs +0 -10
  139. package/progress-spinner-BugUcF5c.mjs +0 -19
  140. package/range-DC7seOVT.mjs +0 -4
  141. package/textbox-BxYjEAZK.mjs +0 -100
  142. package/use-tooltip-Bibsm2rU.mjs +0 -158
  143. package/utils-BipBqkOS.mjs +0 -21
@@ -1,170 +0,0 @@
1
- import o, { useRef as k, useState as x, useEffect as mt, Children as ft, useCallback as dt, cloneElement as xt } from "react";
2
- import N from "classnames";
3
- import { E as j } from "./icon-B_a65KUD.mjs";
4
- import { b as vt } from "./utils-BipBqkOS.mjs";
5
- const Et = ({ value: b, children: h, selected: i, onClick: v, index: m, innerRef: g, className: B, id: w, ...f }) => {
6
- const E = N("listbox-button__option", B, { "listbox-button__option--active": i });
7
- return o.createElement(
8
- "div",
9
- { ...f, className: E, role: "option", id: w || `listbox_btn_${b}_${m}`, "aria-selected": i, ref: g, onClick: (p) => {
10
- v(p, b, m);
11
- } },
12
- o.createElement("span", { className: "listbox-button__value" }, h),
13
- o.createElement(j, { name: "tick16" })
14
- );
15
- }, gt = ({ children: b, name: h, value: i, selected: v, borderless: m, fluid: g, className: B, maxHeight: w, prefixId: f, prefixLabel: E, floatingLabel: p, unselectedText: q = "-", onChange: T = () => {
16
- }, onCollapse: z = () => {
17
- }, onExpand: G = () => {
18
- }, ...J }) => {
19
- const c = k(null), C = k(), O = k(/* @__PURE__ */ new Map()), _ = k(), l = vt(b, Et);
20
- if (!l.length)
21
- throw new Error(`EbayListboxButton: Please use a
22
- EbayListboxButtonOption that defines the options of the listbox`);
23
- const Q = () => {
24
- const t = v !== void 0 ? v : l.findIndex(({ props: s }) => i !== void 0 && s.value === i), e = t > -1 || p ? t : void 0;
25
- return {
26
- option: l[e],
27
- index: e
28
- };
29
- }, { option: D, index: A } = Q(), [a, d] = x(D), [n, S] = x(A), [y, L] = x(), [X, Y] = x(!1), [I, H] = x();
30
- mt(() => {
31
- d(D);
32
- }, [i]);
33
- const r = ft.toArray(b), R = (t) => r[t].props.value, Z = dt((t) => r.findIndex(({ props: e }) => e.value === t), [r]), K = (t) => O.current.get(t), P = (t) => {
34
- const e = c.current;
35
- e == null || e.setAttribute("aria-activedescendant", K(t).id);
36
- }, u = () => {
37
- L(!1), z();
38
- }, tt = () => {
39
- L(!0), G();
40
- }, et = () => {
41
- y ? u() : tt();
42
- }, U = (t, e) => {
43
- d(r[e]), S(e), u(), P(e), _.current.focus(), T(t, { index: e, selected: [R(e)], wasClicked: I }), H(!1);
44
- }, ot = () => {
45
- u(), d(r[A]);
46
- }, nt = (t) => {
47
- const e = c.current.children[t];
48
- e.setAttribute("aria-selected", "true"), e.classList.add("listbox-button__option--active");
49
- }, st = (t) => {
50
- const e = c.current.children[t];
51
- e.setAttribute("aria-selected", "false"), e.classList.remove("listbox-button__option--active");
52
- }, at = (t) => {
53
- const e = C.current, s = K(t);
54
- if (e.scrollHeight > e.clientHeight) {
55
- const bt = e.clientHeight + e.scrollTop, W = s.offsetTop + s.offsetHeight;
56
- W > bt ? e.scrollTop = W - e.clientHeight : s.offsetTop < e.scrollTop && (e.scrollTop = s.offsetTop);
57
- }
58
- }, $ = (t) => {
59
- nt(n === void 0 || t === -1 ? 0 : t), st(n === void 0 || n === -1 ? 0 : n), at(t), P(t), S(t), d(r[t]);
60
- }, M = (t) => setTimeout(() => {
61
- var e;
62
- return (e = c == null ? void 0 : c.current) == null ? void 0 : e.focus(t);
63
- }, 0), ct = () => {
64
- et(), Y(!0), M({ preventScroll: !0 });
65
- }, lt = (t) => {
66
- switch (t.key) {
67
- case "Escape":
68
- u();
69
- break;
70
- case "Enter":
71
- M();
72
- break;
73
- }
74
- }, rt = (t) => {
75
- switch (t.key) {
76
- case " ":
77
- case "PageUp":
78
- case "PageDown":
79
- case "Home":
80
- case "End":
81
- t.preventDefault();
82
- break;
83
- case "Down":
84
- case "ArrowDown":
85
- t.preventDefault(), n !== l.length - 1 && $(n < l.length - 1 ? n + 1 : 0);
86
- break;
87
- case "Up":
88
- case "ArrowUp":
89
- t.preventDefault(), n !== 0 && $(n > 0 ? n - 1 : l.length - 1);
90
- break;
91
- case "Enter":
92
- u(), setTimeout(() => d(r[n])), setTimeout(() => _.current.focus(), 0), T(t, {
93
- index: n,
94
- selected: [R(n)],
95
- wasClicked: I
96
- });
97
- break;
98
- case "Esc":
99
- case "Escape":
100
- ot();
101
- break;
102
- }
103
- }, V = l.map((t, e) => xt(t, {
104
- index: e,
105
- key: e,
106
- selected: a && t.props.value === a.props.value,
107
- onClick: (s) => U(s, e),
108
- innerRef: (s) => s ? O.current.set(e, s) : O.current.delete(e)
109
- })), it = N("listbox-button", B, { "listbox-button--fluid": g }), pt = N("btn", {
110
- "btn--form": !m,
111
- "btn--borderless": m,
112
- "btn--floating-label": p && a
113
- }), F = f && "expand-btn-text", ut = o.createElement(
114
- o.Fragment,
115
- null,
116
- p && o.createElement("span", { className: "btn__floating-label" }, p),
117
- E && o.createElement("span", { className: "btn__label" }, E),
118
- o.createElement("span", { className: "btn__text", id: F }, (a == null ? void 0 : a.props.children) || q)
119
- );
120
- return o.createElement(
121
- "span",
122
- { className: it },
123
- o.createElement(
124
- "button",
125
- {
126
- ...J,
127
- type: "button",
128
- className: pt,
129
- "aria-expanded": !!y,
130
- "aria-haspopup": "listbox",
131
- "aria-labelledby": f && `${f} ${F}`,
132
- onClick: ct,
133
- // https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
134
- onMouseDown: (t) => t.preventDefault(),
135
- onKeyUp: lt,
136
- ref: _
137
- },
138
- o.createElement(
139
- "span",
140
- { className: "btn__cell" },
141
- ut,
142
- o.createElement(j, { name: "chevronDown12" })
143
- )
144
- ),
145
- (y || X) && o.createElement(
146
- "div",
147
- { className: "listbox-button__listbox", ref: C, style: { maxHeight: w } },
148
- o.createElement("div", {
149
- className: "listbox-button__options",
150
- role: "listbox",
151
- tabIndex: y ? 0 : -1,
152
- ref: c,
153
- onKeyDown: (t) => rt(t),
154
- // adding onMouseDown preventDefault b/c on IE the onClick event is not being fired on each
155
- // option https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
156
- onMouseDown: (t) => {
157
- t.preventDefault(), H(!0);
158
- },
159
- onBlur: () => {
160
- u(), setTimeout(() => _.current.focus(), 0);
161
- }
162
- }, V)
163
- ),
164
- o.createElement("select", { hidden: !0, className: "listbox-button__native", name: h, onChange: (t) => U(t, Z(t.target.value)), value: a ? a == null ? void 0 : a.props.value : "" }, V.map((t, e) => o.createElement("option", { value: t.props.value, key: e })))
165
- );
166
- };
167
- export {
168
- gt as EbayListboxButton,
169
- Et as EbayListboxButtonOption
170
- };
@@ -1,82 +0,0 @@
1
- import n, { useState as x, useRef as v, useEffect as w, cloneElement as X } from "react";
2
- import u from "classnames";
3
- import { b as Y, f as M } from "./utils-BipBqkOS.mjs";
4
- import { E as Z, a as $ } from "./menu-CR1Dxl2m.mjs";
5
- import { E as ee } from "./button-B06HeRsZ.mjs";
6
- import { E as ne } from "./icon-button-Dy8rjzH7.mjs";
7
- import { r as te, E as ae } from "./icon-B_a65KUD.mjs";
8
- import { b as oe } from "./index-B5oC9Rl1.mjs";
9
- const Ee = ({ type: t, variant: o = "button", className: c, text: m = "", fixWidth: d, reverse: i, expanded: h, noToggleIcon: f, checked: l, collapseOnSelect: N, a11yText: L, prefixId: y, prefixLabel: R, onClick: K = () => {
10
- }, onExpand: S = () => {
11
- }, onCollapse: A = () => {
12
- }, onChange: F = () => {
13
- }, onSelect: P = () => {
14
- }, children: b, ...T }) => {
15
- const [s, p] = x(h), [k, W] = x(), I = v(null), _ = v(), B = Y(b, [$, ce]), D = B.map((e) => !!e.props.checked), [E, O] = x(D), V = M(b, le), j = M(b, ae), q = se({ text: m, prefixId: y, prefixLabel: R, menuButtonLabel: V, icon: j }), z = u("menu-button", c), G = u("menu-button__menu", {
16
- "menu-button__menu--fix-width": d,
17
- "menu-button__menu--reverse": i
18
- });
19
- w(() => {
20
- const e = (a) => {
21
- const r = _.current, g = r && r.contains(a.target);
22
- (N || !g) && p(!1);
23
- };
24
- return s ? (S(), setTimeout(() => {
25
- document.addEventListener("click", e, !1);
26
- })) : s === !1 && A(), () => document.removeEventListener("click", e, !1);
27
- }, [s]), w(() => {
28
- W(te());
29
- }, []);
30
- const H = (e) => {
31
- oe(e, () => {
32
- var a;
33
- p(!1), (a = I.current) == null || a.focus();
34
- });
35
- }, C = {
36
- ref: I,
37
- className: "menu-button__button",
38
- "aria-expanded": !!s,
39
- "aria-haspopup": !0,
40
- "aria-label": L,
41
- "aria-controls": k,
42
- "aria-labelledby": y,
43
- onClick: (e) => {
44
- p(!s), K(e);
45
- },
46
- ...T
47
- }, J = (e, a) => {
48
- if (t === "radio" || t === "checkbox") {
49
- const r = E.map((g, U) => a.indexes.includes(U));
50
- O(r);
51
- }
52
- F(e, a);
53
- }, Q = () => {
54
- const e = E.findIndex(Boolean);
55
- return e > -1 ? e : l;
56
- };
57
- return n.createElement(
58
- "span",
59
- { className: z },
60
- o === "overflow" ? n.createElement(ne, { icon: "overflowVertical16", ...C }) : n.createElement(ee, { variant: o === "form" ? "form" : void 0, bodyState: f ? void 0 : "expand", ...C }, q),
61
- s && n.createElement(Z, { baseEl: "div", ref: _, type: t, className: G, tabIndex: -1, id: k, autofocus: !0, checked: Q(), onKeyDown: H, onChange: J, onSelect: P }, B.map((e, a) => X(e, {
62
- ...e.props,
63
- className: u(e.props.className, "menu-button__item"),
64
- key: a,
65
- checked: E[a]
66
- })))
67
- );
68
- };
69
- function se({ text: t, prefixId: o, prefixLabel: c, menuButtonLabel: m, icon: d }) {
70
- const i = t.length ? n.createElement("span", null, t) : null, f = [!o && c && [
71
- n.createElement("span", { className: "menu-button-prefix-label" }, c),
72
- n.createElement(n.Fragment, null, " ")
73
- ], m || i], l = [d, f].flat().filter(Boolean);
74
- return l.length ? l : null;
75
- }
76
- const ce = ({ className: t, ...o }) => n.createElement("hr", { ...o, className: u(t, "menu-button__separator"), role: "separator" }), le = ({ children: t }) => n.createElement(n.Fragment, null, t);
77
- export {
78
- Ee as EbayMenuButton,
79
- $ as EbayMenuButtonItem,
80
- le as EbayMenuButtonLabel,
81
- ce as EbayMenuButtonSeparator
82
- };
package/ebay-menu.mjs DELETED
@@ -1,9 +0,0 @@
1
- import { E, a as c } from "./menu-CR1Dxl2m.mjs";
2
- import r from "react";
3
- import t from "classnames";
4
- const s = ({ className: a, ...e }) => r.createElement("hr", { ...e, className: t(a, "menu__separator"), role: "separator" });
5
- export {
6
- E as EbayMenu,
7
- c as EbayMenuItem,
8
- s as EbayMenuSeparator
9
- };
@@ -1,7 +0,0 @@
1
- import t from "react";
2
- import { E as n } from "./notice-content-BVZMfcMH.mjs";
3
- const a = ({ children: e }) => t.createElement("span", { className: "page-notice__title" }, e);
4
- export {
5
- n as EbayNoticeContent,
6
- a as EbayNoticeTitle
7
- };
@@ -1,42 +0,0 @@
1
- import t, { useState as N } from "react";
2
- import { N as g } from "./notice-content-CdXVjKzD.mjs";
3
- import { E as b } from "./notice-content-BVZMfcMH.mjs";
4
- import { E as l } from "./icon-B_a65KUD.mjs";
5
- import d from "classnames";
6
- import { N as f, a as h } from "./notice-footer-BFa2IeY9.mjs";
7
- const w = ({ id: a, status: e = "general", children: o, a11yDismissText: n, "aria-label": i, onDismiss: s = () => {
8
- }, ...m }) => {
9
- const [p, E] = N(!1), c = t.Children.toArray(o).find((r) => r.type === b);
10
- if (!c)
11
- throw new Error("EbayPageNotice: Please use a EbayNoticeContent that defines the content of the notice");
12
- const y = (r) => {
13
- E(!0), s(r);
14
- };
15
- return p ? null : t.createElement(
16
- "section",
17
- { ...m, "aria-labelledby": a || `${e}-status`, className: `page-notice ${e !== "general" ? `page-notice--${e}` : ""}`, role: "region" },
18
- e !== "general" ? t.createElement(
19
- "div",
20
- { className: "page-notice__header", id: a || `${e}-status` },
21
- t.createElement(l, { name: `${e}Filled16`, a11yText: i, a11yVariant: "label" })
22
- ) : null,
23
- t.createElement(g, { ...c.props, type: "page" }),
24
- o,
25
- n && t.createElement(
26
- C,
27
- null,
28
- t.createElement(
29
- "button",
30
- { "aria-label": n, className: "fake-link page-notice__dismiss", onClick: y },
31
- t.createElement(l, { name: "close16" })
32
- )
33
- )
34
- );
35
- }, v = ({ className: a, as: e, children: o, ...n }) => t.createElement(f, { ...n, className: a, as: e, type: "page" }, o), C = ({ className: a, children: e }) => t.createElement(h, { className: a, type: "page" }, e), P = ({ className: a, type: e, children: o, ...n }) => t.createElement("p", { className: d(a, `${e}-notice__cta`), ...n }, o), x = ({ className: a, children: e }) => t.createElement(P, { className: a, type: "page" }, e);
36
- export {
37
- b as EbayNoticeContent,
38
- w as EbayPageNotice,
39
- x as EbayPageNoticeCTA,
40
- C as EbayPageNoticeFooter,
41
- v as EbayPageNoticeTitle
42
- };
@@ -1,159 +0,0 @@
1
- import o, { useRef as G, Children as K, createRef as ne, useState as Q, useEffect as re, cloneElement as oe } from "react";
2
- import { a as ie, E as ae } from "./menu-button-label-vVnRKJRU.mjs";
3
- import V from "classnames";
4
- import { d as se } from "./debounce-u81vJ6wg.mjs";
5
- import { a as ce } from "./utils-BipBqkOS.mjs";
6
- import { E as j, w as le } from "./icon-B_a65KUD.mjs";
7
- import "./array.polyfill.flat-Bj5UhY_-.mjs";
8
- const ue = 1, R = 9, Y = 4, U = 2, me = R - U;
9
- function pe(e, t, a = e, s = null) {
10
- const h = s === "show-last" || s === "overflow" && e > R, u = s === "overflow" && e > R, c = Math.min(a, e), v = Math.max(0, t - Math.ceil((c - 1) / 2)), E = c < Y ? t : Math.max(0, t - Math.floor((c - 1) / 2)), m = (h ? E : v) + c, p = m >= e, A = t <= Y, I = (b, i) => {
11
- const n = k(e, b, i);
12
- return c > 2 ? (n[i - 2] = "dots", n[i - 1] = "hidden", n[e - 1] = "visible") : c > 1 && (n[i - 1] = "dots"), n;
13
- }, g = (b, i) => {
14
- if (A)
15
- return I(0, i);
16
- if (p) {
17
- const w = k(e, e - me, e);
18
- return w[0] = "visible", w[1] = "dots", w;
19
- }
20
- const n = k(e, t - U, t + U + 1);
21
- return n[0] = "visible", n[1] = A ? "visible" : "dots", n[e - 2] = "dots", n[e - 1] = "visible", n;
22
- };
23
- return p && e <= R ? k(e, e - c) : h ? u ? g(E, m) : I(E, m) : k(e, v, m);
24
- }
25
- function de(e, t, a, s = "show-range") {
26
- if (e === -1)
27
- return [];
28
- const h = s === "overflow" ? R : fe(Math.min(a, t), ue, R);
29
- return pe(a, e - 1, h, s);
30
- }
31
- function fe(e, t, a) {
32
- return e <= t ? t : e >= a ? a : e;
33
- }
34
- function k(e, t, a) {
35
- return Array(e).fill("hidden").fill("visible", t, a);
36
- }
37
- function he(e) {
38
- if (!e)
39
- return 0;
40
- e.style.width = "100vw";
41
- const t = e.offsetWidth;
42
- return e.style.width = null, t;
43
- }
44
- const ye = ({ id: e = "ebay-pagination", className: t, a11yCurrentText: a = "Pagination - Current Page", a11yPreviousText: s = "Previous page", a11yNextText: h = "Next page", variant: u = "show-range", fluid: c = !1, onPrevious: v = () => {
45
- }, onNext: E = () => {
46
- }, onSelect: m = () => {
47
- }, children: p, ...A }) => {
48
- const I = G(null), g = G([]);
49
- g.current = K.map(p, ne);
50
- const b = ce(p, ({ props: r }) => r.type === void 0 || r.type === "page").length, i = G(0), n = G(0), w = () => {
51
- var x, _, y, f;
52
- const r = n.current || ((_ = (x = g.current[0]) == null ? void 0 : x.current) == null ? void 0 : _.offsetWidth);
53
- n.current = r;
54
- const d = i.current || ((f = (y = g.current[1]) == null ? void 0 : y.current) == null ? void 0 : f.offsetWidth);
55
- return i.current = d, d ? Math.floor((he(I.current) - r * 2) / d) : 0;
56
- }, [M, z] = Q([]), [N, L] = Q(0), W = (r) => {
57
- const d = r || g.current.findIndex((y) => {
58
- var f;
59
- return ((f = y.current) == null ? void 0 : f.getAttribute("aria-current")) === "page";
60
- }), x = w(), _ = de(d, x, b, u);
61
- L(d), z(["hidden", ..._]);
62
- };
63
- re(() => {
64
- const r = se(W, 16);
65
- return W(), window.addEventListener("resize", () => r()), () => {
66
- window.removeEventListener("resize", () => r());
67
- };
68
- }, [p]);
69
- const C = (r) => {
70
- let d = 0;
71
- const x = [], _ = [], y = [], f = M.indexOf("dots"), F = M.lastIndexOf("dots");
72
- return K.map(p, (X, D) => {
73
- const { type: O = "page", current: Z, disabled: ee, href: H, children: q } = X.props, B = M[D] === "dots", $ = `${e}-item-${D}`, J = M[D] === "hidden", te = {
74
- current: Z,
75
- disabled: ee,
76
- href: H,
77
- type: B && O === "page" ? "separator" : O,
78
- children: B ? o.createElement(j, { name: "overflowHorizontal24", focusable: !1 }) : q,
79
- pageIndex: O === "page" ? d++ : void 0,
80
- key: $,
81
- hide: J,
82
- onPrevious: v,
83
- onNext: E,
84
- onSelect: m,
85
- a11yPreviousText: s,
86
- a11yNextText: h,
87
- ref: g.current[D]
88
- };
89
- if ((J || B) && O === "page") {
90
- const T = o.createElement(ie, { key: $, href: H, onClick: (P) => {
91
- H || P.preventDefault();
92
- const S = P.currentTarget;
93
- m(P, { value: (S == null ? void 0 : S.innerText) || "", index: d }), W(Number(S == null ? void 0 : S.innerText));
94
- } }, q);
95
- f === F && y.push(T), N - 2 > f && D < N && x.push(T), N + 2 < F && D > N && _.push(T);
96
- }
97
- if (r === "page" && B && u === "overflow") {
98
- let T = y;
99
- return f !== F && (T = D === 2 ? x : _), o.createElement(
100
- "li",
101
- { key: $ },
102
- o.createElement(
103
- "span",
104
- { className: "pagination__item", role: "separator" },
105
- o.createElement(ae, { a11yText: "Menu", borderless: !0, variant: "overflow", noToggleIcon: !0 }, T)
106
- )
107
- );
108
- }
109
- return r === O ? oe(X, te) : null;
110
- });
111
- }, l = `${e}-pagination-heading`;
112
- return o.createElement(
113
- "nav",
114
- { ...A, role: "navigation", className: V(t, "pagination", { "pagination--fluid": c }), "aria-labelledby": l, ref: I },
115
- o.createElement(
116
- "span",
117
- { "aria-live": "polite", role: "status" },
118
- o.createElement("h2", { className: "clipped", id: l }, a)
119
- ),
120
- C("previous"),
121
- o.createElement("ol", { className: "pagination__items" }, C("page")),
122
- C("next")
123
- );
124
- }, ge = ({ pageIndex: e = 0, key: t, current: a, disabled: s, type: h = "page", href: u, hide: c, children: v, a11yPreviousText: E = "Previous page", a11yNextText: m = "Next page", onSelect: p, onNext: A, onPrevious: I, className: g, style: b, forwardedRef: i, ...n }) => {
125
- const w = (l) => {
126
- var r;
127
- p(l, { value: ((r = l.currentTarget) == null ? void 0 : r.innerText) || "", index: e });
128
- }, M = (l) => {
129
- l.currentTarget.getAttribute("aria-disabled") || A(l);
130
- }, z = (l) => {
131
- l.currentTarget.getAttribute("aria-disabled") || I(l);
132
- }, N = !!u, L = N ? "a" : "button", W = N ? "icon-link" : "icon-btn", C = { ...b, minWidth: "40px" };
133
- switch (h) {
134
- case "previous":
135
- return o.createElement(
136
- L,
137
- { ...n, ref: i, "aria-disabled": s ? "true" : void 0, "aria-label": E, href: s ? void 0 : u, className: V(W, "pagination__previous"), style: C, onClick: z },
138
- o.createElement(j, { name: "arrowLeft16" })
139
- );
140
- case "next":
141
- return o.createElement(
142
- L,
143
- { ...n, ref: i, "aria-disabled": s ? "true" : void 0, "aria-label": m, href: s ? void 0 : u, className: V(W, "pagination__next"), style: C, onClick: M },
144
- o.createElement(j, { name: "arrowRight16" })
145
- );
146
- case "separator":
147
- return o.createElement("span", { key: t, style: b, className: "pagination__item", ref: i, role: "separator" }, v);
148
- default:
149
- return o.createElement(
150
- "li",
151
- { ...n, hidden: c },
152
- o.createElement(L, { ref: i, "aria-current": a ? "page" : void 0, href: u, className: "pagination__item", style: b, key: t, onClick: w }, v)
153
- );
154
- }
155
- }, De = le(ge);
156
- export {
157
- ye as EbayPagination,
158
- De as EbayPaginationItem
159
- };
@@ -1,11 +0,0 @@
1
- import r from "react";
2
- import i from "classnames";
3
- import { D as c } from "./dialog-previous-button-gmkm4c8J.mjs";
4
- import "./icon-button-Dy8rjzH7.mjs";
5
- const o = "panel-dialog", f = ({ open: s, animated: a, position: e = "start", onClose: t = () => {
6
- }, className: l, ...n }) => r.createElement(c, { ...n, "aria-label": "Infotip", classPrefix: o, buttonPosition: "right", onCloseBtnClick: t, onBackgroundClick: t, animated: a, className: i(l, { [`${o}--mask-fade-slow`]: a }), windowClass: i(`${o}__window--slide`, {
7
- [`${o}__window--end`]: e === "end"
8
- }), open: s });
9
- export {
10
- f as EbayPanelDialog
11
- };
@@ -1,6 +0,0 @@
1
- import m from "react";
2
- import t from "classnames";
3
- const g = ({ value: r = 0, max: s = 100, fluid: e, className: a, ...o }) => m.createElement("progress", { ...o, className: t("progress-bar", a, { "progress-bar--fluid": e }), value: r, max: s });
4
- export {
5
- g as EbayProgressBar
6
- };
@@ -1,4 +0,0 @@
1
- import { E as o } from "./progress-spinner-BugUcF5c.mjs";
2
- export {
3
- o as EbayProgressSpinner
4
- };
@@ -1,63 +0,0 @@
1
- import r, { Children as g, Fragment as y, cloneElement as _, createElement as d } from "react";
2
- import f from "classnames";
3
- import { E as v } from "./icon-B_a65KUD.mjs";
4
- const S = ({ direction: e = "row", defaultState: t = "active", children: s, className: o, ...i }) => {
5
- const a = g.toArray(s), p = N(a, t);
6
- return r.createElement(
7
- "div",
8
- { ...i, className: f(o, "progress-stepper", {
9
- "progress-stepper--vertical": e === "column"
10
- }) },
11
- r.createElement("div", { role: "list", className: "progress-stepper__items" }, a.map((c, n) => r.createElement(
12
- y,
13
- { key: n },
14
- n > 0 && r.createElement("hr", { className: "progress-stepper__separator", role: "presentation" }),
15
- _(c, {
16
- state: b(n, p),
17
- ...c.props,
18
- current: p === n
19
- })
20
- )))
21
- );
22
- };
23
- function N(e, t) {
24
- const s = e.findIndex((o) => o.props.current);
25
- if (s === -1)
26
- switch (t) {
27
- case "complete":
28
- return e.length - 1;
29
- case "upcoming":
30
- return 0;
31
- }
32
- return s;
33
- }
34
- function b(e, t) {
35
- if (e <= t)
36
- return "complete";
37
- if (e > t)
38
- return "upcoming";
39
- }
40
- const h = {
41
- complete: "stepperConfirmation24",
42
- attention: "stepperAttention24",
43
- upcoming: "stepperUpcoming24",
44
- active: "stepperConfirmation24"
45
- }, P = ({ current: e, state: t = "complete", children: s, className: o, ...i }) => {
46
- const a = g.toArray(s), p = a.find((m) => m.type === u), c = a.filter((m) => m.type !== u), n = f(o, "progress-stepper__item", { "progress-stepper__item--attention": t === "attention" }), l = h[t], E = e ? "current" : t;
47
- return r.createElement(
48
- "div",
49
- { ...i, className: n, role: "listitem", "aria-current": e ? "step" : void 0 },
50
- r.createElement("div", { className: "progress-stepper__icon" }, l && r.createElement(v, { name: l, "aria-label": E })),
51
- r.createElement(
52
- "div",
53
- { className: "progress-stepper__text" },
54
- p,
55
- c
56
- )
57
- );
58
- }, u = ({ as: e = "h4", children: t }) => d(e, {}, t);
59
- export {
60
- P as EbayProgressStep,
61
- S as EbayProgressStepper,
62
- u as EbayProgressTitle
63
- };
package/ebay-radio.mjs DELETED
@@ -1,42 +0,0 @@
1
- import n, { Children as f, cloneElement as v } from "react";
2
- import b from "classnames";
3
- import { E as r } from "./icon-B_a65KUD.mjs";
4
- import { L as F } from "./label-DgOo6Mql.mjs";
5
- const I = ({ size: c = "default", checked: s, defaultChecked: d, className: m, style: i, id: o, onChange: h = () => {
6
- }, onFocus: u = () => {
7
- }, onKeyDown: p = () => {
8
- }, children: l, ...E }) => {
9
- const _ = (e) => {
10
- var a;
11
- return h(e, { value: (a = e.target) == null ? void 0 : a.value });
12
- }, g = (e) => {
13
- var a;
14
- return u(e, { value: (a = e.target) == null ? void 0 : a.value });
15
- }, y = (e) => {
16
- const a = e.target;
17
- return p(e, { value: a == null ? void 0 : a.value });
18
- }, k = b("radio", m, { "radio--large": c === "large" }), C = c === "large" ? n.createElement(r, { name: "radioChecked24", className: "radio__checked" }) : n.createElement(r, { name: "radioChecked18", className: "radio__checked" }), N = c === "large" ? n.createElement(r, { name: "radioUnchecked24", className: "radio__unchecked" }) : n.createElement(r, { name: "radioUnchecked18", className: "radio__unchecked" }), t = f.toArray(l).find((e) => e.type === F);
19
- return n.createElement(
20
- n.Fragment,
21
- null,
22
- n.createElement(
23
- "span",
24
- { className: k, style: { ...i, alignItems: "center" } },
25
- n.createElement("input", { ...E, id: o, className: "radio__control", type: "radio", defaultChecked: d, checked: s, onChange: _, onFocus: g, onKeyDown: y }),
26
- n.createElement(
27
- "span",
28
- { className: "radio__icon", hidden: !0 },
29
- C,
30
- N
31
- )
32
- ),
33
- t ? v(t, {
34
- ...t.props,
35
- position: "end",
36
- htmlFor: o
37
- }) : l
38
- );
39
- };
40
- export {
41
- I as EbayRadio
42
- };
@@ -1,46 +0,0 @@
1
- import t, { useState as S } from "react";
2
- import C from "classnames";
3
- import { E as _ } from "./notice-content-BVZMfcMH.mjs";
4
- import { N as $ } from "./notice-content-CdXVjKzD.mjs";
5
- import { E as d } from "./icon-B_a65KUD.mjs";
6
- import { N as k, a as A } from "./notice-footer-BFa2IeY9.mjs";
7
- const R = ({ status: e = "general", children: o, className: a, "aria-label": n, "aria-roledescription": E = "Notice", a11yDismissText: s, educationIcon: N, iconClass: b, prominent: p, onDismiss: y = () => {
8
- }, ...f }) => {
9
- const [h, u] = S(!1), m = t.Children.toArray(o).find(({ type: r }) => r === _), i = e !== "general" && e !== "none", l = e === "education";
10
- let c = null;
11
- if (i && (l ? c = N || "lightbulb24" : c = `${e}Filled16`), !m)
12
- throw new Error("EbaySectionNotice: Please use a EbayNoticeContent that defines the content of the notice");
13
- const g = (r) => {
14
- u(!0), y(r);
15
- };
16
- return h ? null : t.createElement(
17
- "section",
18
- { ...f, className: C(a, "section-notice", {
19
- [`section-notice--${e}`]: i,
20
- "section-notice--education": l && p,
21
- "section-notice--large-icon": l
22
- }), role: "region", "aria-label": i ? null : n, "aria-labelledby": i ? `section-notice-${e}` : null, "aria-roledescription": E },
23
- c && t.createElement(
24
- "div",
25
- { className: "section-notice__header", id: `section-notice-${e}` },
26
- t.createElement(d, { className: b, name: c, a11yText: n, a11yVariant: "label" })
27
- ),
28
- t.createElement($, { ...m.props, type: "section" }),
29
- o,
30
- s && t.createElement(
31
- F,
32
- null,
33
- t.createElement(
34
- "button",
35
- { "aria-label": s, className: "fake-link page-notice__dismiss", onClick: g },
36
- t.createElement(d, { name: "close16" })
37
- )
38
- )
39
- );
40
- }, V = ({ className: e, as: o, children: a, ...n }) => t.createElement(k, { ...n, className: e, as: o, type: "section" }, a), F = ({ className: e, children: o }) => t.createElement(A, { className: e, type: "section" }, o);
41
- export {
42
- _ as EbayNoticeContent,
43
- R as EbaySectionNotice,
44
- F as EbaySectionNoticeFooter,
45
- V as EbaySectionNoticeTitle
46
- };