@ebay/ui-core-react 7.1.0-alpha.2 → 7.1.0-alpha.3

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 (75) hide show
  1. package/ebay-button/README.md +4 -0
  2. package/package.json +2 -2
  3. package/array.polyfill.flat-Bj5UhY_-.mjs +0 -10
  4. package/badge-BX5HuO-3.mjs +0 -9
  5. package/button-B06HeRsZ.mjs +0 -63
  6. package/calendar-Dq0eM9VC.mjs +0 -216
  7. package/debounce-u81vJ6wg.mjs +0 -9
  8. package/dialog-previous-button-gmkm4c8J.mjs +0 -146
  9. package/drawer-Dcg135Bb.mjs +0 -40
  10. package/ebay-alert-dialog.mjs +0 -22
  11. package/ebay-badge.mjs +0 -4
  12. package/ebay-breadcrumbs.mjs +0 -39
  13. package/ebay-button.mjs +0 -5
  14. package/ebay-calendar.mjs +0 -4
  15. package/ebay-carousel.mjs +0 -229
  16. package/ebay-checkbox.mjs +0 -43
  17. package/ebay-confirm-dialog.mjs +0 -24
  18. package/ebay-cta-button.mjs +0 -20
  19. package/ebay-date-textbox.mjs +0 -74
  20. package/ebay-dialog-base.mjs +0 -9
  21. package/ebay-drawer-dialog.mjs +0 -4
  22. package/ebay-eek.mjs +0 -42
  23. package/ebay-fake-menu-button.mjs +0 -7
  24. package/ebay-fake-menu.mjs +0 -9
  25. package/ebay-fake-tabs.mjs +0 -27
  26. package/ebay-field.mjs +0 -19
  27. package/ebay-fullscreen-dialog.mjs +0 -9
  28. package/ebay-icon-button.mjs +0 -4
  29. package/ebay-icon.mjs +0 -4
  30. package/ebay-infotip.mjs +0 -59
  31. package/ebay-inline-notice.mjs +0 -31
  32. package/ebay-lightbox-dialog.mjs +0 -11
  33. package/ebay-listbox-button.mjs +0 -170
  34. package/ebay-menu-button.mjs +0 -82
  35. package/ebay-menu.mjs +0 -9
  36. package/ebay-notice-base.mjs +0 -7
  37. package/ebay-page-notice.mjs +0 -42
  38. package/ebay-pagination.mjs +0 -159
  39. package/ebay-panel-dialog.mjs +0 -11
  40. package/ebay-progress-bar.mjs +0 -6
  41. package/ebay-progress-spinner.mjs +0 -4
  42. package/ebay-progress-stepper.mjs +0 -63
  43. package/ebay-radio.mjs +0 -42
  44. package/ebay-section-notice.mjs +0 -46
  45. package/ebay-section-title.mjs +0 -24
  46. package/ebay-select.mjs +0 -69
  47. package/ebay-signal.mjs +0 -9
  48. package/ebay-snackbar-dialog.mjs +0 -46
  49. package/ebay-split-button.mjs +0 -20
  50. package/ebay-star-rating-select.mjs +0 -36
  51. package/ebay-star-rating.mjs +0 -8
  52. package/ebay-svg.mjs +0 -4753
  53. package/ebay-switch.mjs +0 -25
  54. package/ebay-tabs.mjs +0 -66
  55. package/ebay-textbox.mjs +0 -8
  56. package/ebay-toast-dialog.mjs +0 -9
  57. package/ebay-tooltip.mjs +0 -39
  58. package/ebay-tourtip.mjs +0 -43
  59. package/ebay-video.mjs +0 -173
  60. package/hooks-r29zhPsY.mjs +0 -63
  61. package/icon-B_a65KUD.mjs +0 -42
  62. package/icon-button-Dy8rjzH7.mjs +0 -24
  63. package/index-B5oC9Rl1.mjs +0 -22
  64. package/label-DgOo6Mql.mjs +0 -19
  65. package/menu-CR1Dxl2m.mjs +0 -154
  66. package/menu-button-label-vVnRKJRU.mjs +0 -68
  67. package/menu-item-jlKZ3uT4.mjs +0 -67
  68. package/notice-content-BVZMfcMH.mjs +0 -4
  69. package/notice-content-CdXVjKzD.mjs +0 -9
  70. package/notice-footer-BFa2IeY9.mjs +0 -10
  71. package/progress-spinner-BugUcF5c.mjs +0 -19
  72. package/range-DC7seOVT.mjs +0 -4
  73. package/textbox-BxYjEAZK.mjs +0 -100
  74. package/use-tooltip-Bibsm2rU.mjs +0 -158
  75. package/utils-BipBqkOS.mjs +0 -21
@@ -13,6 +13,10 @@ import { EbayButton } from '@ebay/ui-core-react/ebay-button'
13
13
  ```jsx harmony
14
14
  import "@ebay/skin/button"
15
15
  ```
16
+ ### If tokens haven't been added to the project at a higher level, make sure to import
17
+ ```jsx harmony
18
+ import '@ebay/skin/tokens';
19
+ ```
16
20
  ### Or import styles using SCSS/CSS
17
21
  ```jsx harmony
18
22
  import '@ebay/skin/button.css'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebay/ui-core-react",
3
- "version": "7.1.0-alpha.2",
3
+ "version": "7.1.0-alpha.3",
4
4
  "description": "Skin components build off React",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -9,7 +9,6 @@
9
9
  "./package.json": "./package.json",
10
10
  "./*": {
11
11
  "types": "./*/index.d.ts",
12
- "import": "./*.mjs",
13
12
  "default": "./*.js"
14
13
  }
15
14
  },
@@ -26,6 +25,7 @@
26
25
  "build-storybook": "storybook build",
27
26
  "storybook:publish": "NODE_OPTIONS=--openssl-legacy-provider yarn build-storybook --output-dir storybook-static/$(git branch --show-current) && gh-pages --add --message=\"Deploying to gh-pages from @ eBay/ebayui-core-react@$(git rev-parse --short HEAD) 🚀\" -d storybook-static",
28
27
  "test": "yarn jest",
28
+ "build:tsc": "yarn tsc",
29
29
  "build": "yarn type:check && vite build",
30
30
  "type:check": "tsc --noEmit",
31
31
  "update-icons": "node ./scripts/update-icons",
@@ -1,10 +0,0 @@
1
- Array.prototype.flat || Object.defineProperty(Array.prototype, "flat", {
2
- configurable: !0,
3
- writable: !0,
4
- value: function(t) {
5
- const a = typeof t > "u" ? 1 : Number(t) || 0, r = [], n = r.forEach, o = (c, f) => n.call(c, (e) => {
6
- f > 0 && Array.isArray(e) ? o(e, f - 1) : r.push(e);
7
- });
8
- return o(this, a), r;
9
- }
10
- });
@@ -1,9 +0,0 @@
1
- import t from "react";
2
- import i from "classnames";
3
- const d = ({ number: r, type: e = "img", className: m, ...s }) => {
4
- const a = Math.round(parseInt(String(r), 10));
5
- return a <= 0 ? null : t.createElement("span", { ...s, className: i("badge", m), role: e === "img" ? "img" : void 0, "aria-hidden": e !== "img" }, a > 99 ? "99+" : a);
6
- };
7
- export {
8
- d as E
9
- };
@@ -1,63 +0,0 @@
1
- import t, { Children as O } from "react";
2
- import B from "classnames";
3
- import { E as m, w as R } from "./icon-B_a65KUD.mjs";
4
- import "./array.polyfill.flat-Bj5UhY_-.mjs";
5
- import { E as T } from "./progress-spinner-BugUcF5c.mjs";
6
- const j = {
7
- cta: "cta-",
8
- fake: "fake-",
9
- expand: "expand-",
10
- default: ""
11
- }, k = ({ type: n = "default", children: a, ...r }) => t.createElement(
12
- "span",
13
- { className: `${j[n]}btn__cell`, ...r },
14
- t.createElement(t.Fragment, null, a)
15
- ), q = () => t.createElement(
16
- k,
17
- null,
18
- t.createElement(T, null)
19
- ), G = ({ className: n, children: a }) => t.createElement("span", { className: B(n, "btn__text") }, a), H = ({ children: n }) => n ? t.createElement(
20
- k,
21
- null,
22
- t.createElement(G, null, n),
23
- t.createElement(m, { name: "chevronDown12" })
24
- ) : t.createElement(m, { name: "chevronDown12" }), J = ({ priority: n = "secondary", variant: a = "standard", size: r = "regular", bodyState: u, split: D, transparent: N = !1, fluid: C = !1, disabled: y, partiallyDisabled: S, children: o, onKeyDown: _ = () => {
25
- }, onEscape: h = () => {
26
- }, truncate: F = !1, href: l, className: L, forwardedRef: E, borderless: p, fixedHeight: d, ...f }) => {
27
- const e = l ? "fake-btn" : "btn", A = {
28
- primary: `${e}--primary`,
29
- secondary: `${e}--secondary`,
30
- tertiary: `${e}--tertiary`,
31
- none: ""
32
- }, c = {
33
- large: `${e}--large`,
34
- small: `${e}--small`,
35
- regular: "",
36
- default: ""
37
- }, I = {
38
- start: `${e}--split-start`,
39
- end: `${e}--split-end`
40
- }, K = a === "destructive", i = a === "form", $ = u === "loading", b = u === "expand", P = i && (Q(o) || b && !o), g = B(e, L, A[i || p ? "none" : n], c[r], I[D], K && `${e}--destructive`, i && `${e}--form`, P && `${e}--slim`, N && `${e}--transparent`, C && `${e}--fluid`, F && `${e}--truncated`, p && `${e}--borderless`, d && (c[r] ? `${c[r]}-${d}` : `${e}--fixed-height`)), x = (s) => {
41
- _(s), (s.key === "Escape" || s.key === "Esc") && h(s);
42
- }, v = M(o, { isLoading: $, isExpand: b }), w = $ ? "polite" : null;
43
- return l ? t.createElement("a", { className: g, href: y ? void 0 : l, ref: E, onKeyDown: x, "aria-live": w, ...f }, v) : t.createElement("button", { disabled: y, "aria-disabled": S, "aria-live": w, className: g, ref: E, onKeyDown: x, ...f }, v);
44
- };
45
- function M(n, { isLoading: a, isExpand: r }) {
46
- switch (!0) {
47
- case a:
48
- return t.createElement(q, null);
49
- case r:
50
- return t.createElement(H, null, n);
51
- default:
52
- return n;
53
- }
54
- }
55
- function Q(n) {
56
- const a = O.toArray(n);
57
- return a.length === 1 && a[0].type === m;
58
- }
59
- const Z = R(J);
60
- export {
61
- Z as E,
62
- k as a
63
- };
@@ -1,216 +0,0 @@
1
- import r, { useRef as fe, useState as H, useEffect as Ae } from "react";
2
- import { E as de } from "./icon-button-Dy8rjzH7.mjs";
3
- import me from "classnames";
4
- function Fe(n) {
5
- const c = new Intl.Locale(n);
6
- return c.weekInfo ? c.weekInfo.firstDay : 0;
7
- }
8
- function Re(n) {
9
- const c = Fe(n), i = new Intl.DateTimeFormat(n, {
10
- weekday: "short"
11
- }), u = new Date(2022, 9, 2 + c), A = [...Array(7)].map(() => {
12
- const k = i.format(u);
13
- return u.setDate(u.getDate() + 1), k;
14
- });
15
- return {
16
- firstDayOfWeek: c,
17
- weekdayLabels: A
18
- };
19
- }
20
- function Me(n) {
21
- if (n)
22
- return /^\d\d\d\d-\d\d-\d\d$/g.test(n) ? n : d(new Date(n));
23
- }
24
- function d(n) {
25
- if (!isNaN(n.getTime()))
26
- return n.toISOString().slice(0, 10);
27
- }
28
- function v(n) {
29
- return new Date(n);
30
- }
31
- function G(n, c) {
32
- const i = v(n);
33
- return i.setUTCDate(i.getUTCDate() + c), d(i);
34
- }
35
- function ye(n) {
36
- return n || navigator.language;
37
- }
38
- const Ne = {
39
- ArrowRight: 1,
40
- ArrowLeft: -1,
41
- ArrowDown: 7,
42
- ArrowUp: -7
43
- }, Ye = ({ selected: n, numMonths: c = 1, navigable: i, interactive: u, range: A, locale: k, disableBefore: g, disableAfter: D, disableWeekdays: J, disableList: Q, a11ySelectedText: ge = "selected", a11yRangeStartText: De = "start of range", a11yInRangeText: Ie = "in range", a11yRangeEndText: we = "end of range", a11ySeparator: X = "-", a11yTodayText: Ee = "today", a11yDisabledText: Se = "inactive", getA11yShowMonthText: Z = (T) => `Show ${T}`, linkBuilder: B, onMonthChange: ee = () => {
44
- }, onFocus: Oe = () => {
45
- }, onSelect: Te = () => {
46
- } }) => {
47
- const T = d(/* @__PURE__ */ new Date()), { firstDayOfWeek: pe, weekdayLabels: ke } = Re(ye(k)), te = fe(null), [m, F] = H(0), [ne, ae] = H(null), [I, b] = H(T), R = fe(T), w = (e) => {
48
- const t = v(R.current);
49
- return new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth() + e));
50
- }, E = () => d(w(m)), S = () => {
51
- const e = v(R.current);
52
- return d(new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth() + m + (c || 1), 0)));
53
- };
54
- Ae(() => {
55
- if (n) {
56
- const e = Array.isArray(n) ? n : [n], t = E(), a = S();
57
- e.find((f) => f >= t && f <= a) === void 0 && (R.current = e[0], F(0));
58
- }
59
- }, [n]);
60
- const be = () => {
61
- if (n && A) {
62
- let e, t;
63
- if (Array.isArray(n) ? [e, t] = n : ne && (e = n, t = ne), e && t) {
64
- const [a, s] = [e, t].sort();
65
- return {
66
- rangeStart: a,
67
- rangeEnd: s
68
- };
69
- }
70
- }
71
- return {
72
- rangeStart: null,
73
- rangeEnd: null
74
- };
75
- }, h = (e) => new Intl.DateTimeFormat(ye(k), {
76
- month: "long",
77
- year: "numeric"
78
- }).format(new Date(e.getUTCFullYear(), e.getUTCMonth())), _ = (e) => g && e < g || D && e > D || J && J.includes(v(e).getUTCDay()) || Q && Q.includes(e), re = () => {
79
- let e = E();
80
- const t = S();
81
- for (; e <= t && _(e); )
82
- e = G(e, 1);
83
- return e > t ? null : e;
84
- }, se = () => {
85
- let e = S();
86
- const t = E();
87
- for (; e >= t && _(e); )
88
- e = G(e, -1);
89
- return e < t ? null : e;
90
- }, p = (e) => {
91
- b(e), setTimeout(() => {
92
- var a;
93
- const t = (a = te.current) == null ? void 0 : a.querySelector(`[data-iso="${e}"]`);
94
- t == null || t.focus();
95
- });
96
- }, N = (e) => {
97
- if (g && E() <= g)
98
- return !1;
99
- F((s) => s - 1);
100
- let t = I;
101
- const a = se();
102
- return a && a < I && (t = a, b(a)), e && p(t), ee({
103
- iso: d(w(m))
104
- }), !0;
105
- }, L = (e) => {
106
- if (D && S() >= D)
107
- return !1;
108
- F((s) => s + 1);
109
- let t = I;
110
- const a = re();
111
- a && a > I && (t = a, b(a)), e && p(t), ee({
112
- iso: d(w(m + (c || 1)))
113
- });
114
- }, he = (e) => {
115
- const t = Ne[e.key];
116
- if (t) {
117
- e.preventDefault();
118
- let a = 7, s = I;
119
- do
120
- s = G(s, t);
121
- while (a-- > 0 && _(s));
122
- if (a > 0) {
123
- const f = E(), O = S();
124
- s < f ? i ? N() : s = f : s > O && (i ? L() : s = O), p(s);
125
- }
126
- } else
127
- switch (e.key) {
128
- case "PageUp":
129
- N(!0);
130
- break;
131
- case "PageDown":
132
- L(!0);
133
- break;
134
- case "Home":
135
- p(re());
136
- break;
137
- case "End":
138
- p(se());
139
- break;
140
- }
141
- }, _e = (e, t) => {
142
- Te(e, { iso: t });
143
- }, oe = (e, t) => {
144
- ae(t), b(t), Oe(e, { iso: t });
145
- }, ce = () => {
146
- ae(null);
147
- }, { rangeStart: x, rangeEnd: V } = be(), Ce = (e) => !(!x || !V || e < x || e > V), le = [...Array(c)].map((e, t) => w(m + t));
148
- return r.createElement(
149
- "div",
150
- { className: "calendar", ref: te },
151
- i && r.createElement(
152
- "div",
153
- { className: "calendar__header" },
154
- r.createElement(
155
- "div",
156
- { className: "calendar__header--inner" },
157
- r.createElement(de, { transparent: !0, size: "small", icon: "chevronLeft24", disabled: g && E() <= g, "aria-label": Z(h(w(m - 1))), onClick: () => N() }),
158
- le.map((e, t) => r.createElement("h3", { key: t }, h(e))),
159
- r.createElement(de, { transparent: !0, size: "small", icon: "chevronRight24", disabled: D && S() >= D, "aria-label": Z(h(w(m + c))), onClick: () => L() })
160
- )
161
- ),
162
- r.createElement("div", { className: "calendar__body" }, le.map((e, t) => {
163
- const a = (e.getUTCDay() - pe + 7) % 7, s = e.getUTCFullYear(), f = e.getUTCMonth(), O = new Date(s, f + 1, 0).getDate(), Ue = [...Array(Math.ceil((a + O) / 7))];
164
- return r.createElement(
165
- "div",
166
- { key: t, className: "calendar__month" },
167
- r.createElement(
168
- "table",
169
- { onKeyDown: he },
170
- r.createElement("caption", null, h(e)),
171
- r.createElement(
172
- "thead",
173
- null,
174
- r.createElement("tr", null, ke.map((M) => r.createElement("th", { key: M, scope: "col" }, M)))
175
- ),
176
- r.createElement("tbody", null, Ue.map((M, Y) => {
177
- let $ = Y * 7 - a + 1, P = $ + 6;
178
- const W = [];
179
- Y === 0 && a !== 0 ? ($ = 1, W.push(r.createElement("td", { key: "pre-column", colSpan: a }))) : P > O && (P = O);
180
- for (let y = $; y <= P; y++) {
181
- const o = d(new Date(Date.UTC(s, f, y))), j = o === T, z = Array.isArray(n) ? n.some((l) => l === o) : n === o, K = o === x, ie = Ce(o), q = o === V, C = _(o), U = [
182
- "",
183
- z && ge,
184
- K && De,
185
- !K && !q && ie && Ie,
186
- q && we,
187
- !u && j && Ee,
188
- !u && C && Se
189
- ].filter((l) => typeof l != "boolean" || l !== !1), ue = !u && !C && B && B(o), ve = ue ? "a" : "span";
190
- W.push(r.createElement("td", { key: y, className: me({
191
- "calendar__cell--selected": z,
192
- "calendar__range--start": K,
193
- calendar__range: ie,
194
- "calendar__range--end": q
195
- }) }, u ? r.createElement("button", { disabled: C, "aria-label": U.length > 1 ? `${y}${U.join(X)}` : void 0, tabIndex: I !== o ? -1 : void 0, "aria-current": j ? "date" : void 0, "aria-pressed": z ? "true" : void 0, onClick: (l) => _e(l, o), onFocus: (l) => oe(l, o), onMouseOver: (l) => oe(l, o), onMouseOut: (l) => ce(), onBlur: () => ce(), "data-iso": o }, y) : r.createElement(
196
- ve,
197
- { className: me({
198
- "calendar__cell--disabled": C,
199
- "calendar__cell--current": j
200
- }), href: ue },
201
- y,
202
- U.length > 1 && r.createElement("span", { className: "clipped" }, U.join(X))
203
- )));
204
- }
205
- return r.createElement("tr", { key: Y }, W);
206
- }))
207
- )
208
- );
209
- }))
210
- );
211
- };
212
- export {
213
- Ye as E,
214
- Me as d,
215
- d as t
216
- };
@@ -1,9 +0,0 @@
1
- function u(t, o) {
2
- let e;
3
- return (...r) => {
4
- clearTimeout(e), e = setTimeout(() => t(...r), o);
5
- };
6
- }
7
- export {
8
- u as d
9
- };
@@ -1,146 +0,0 @@
1
- import o, { useRef as b, useLayoutEffect as ne, useState as re, useEffect as _, cloneElement as ae, Children as oe } from "react";
2
- import { RemoveScroll as ie } from "react-remove-scroll";
3
- import L from "classnames";
4
- import * as F from "makeup-screenreader-trap";
5
- import * as D from "makeup-keyboard-trap";
6
- import { r as ce, E as se } from "./icon-B_a65KUD.mjs";
7
- import { E as le } from "./icon-button-Dy8rjzH7.mjs";
8
- const W = ({ children: t, ...e }) => o.createElement("h2", { ...e }, t), j = ({ children: t }) => o.createElement(o.Fragment, null, t), z = ({ children: t }) => o.createElement(o.Fragment, null, t);
9
- function de({ open: t, classPrefix: e, transitionElement: r, dialogRef: i, dialogWindowRef: u, enabled: d, onTransitionEnd: a }) {
10
- const c = b(!0);
11
- ne(() => {
12
- if (!d)
13
- return;
14
- let s = [u, i];
15
- r === "window" ? s = [u] : r === "root" && (s = [i]);
16
- let l;
17
- return t ? l = ue({
18
- dialog: i,
19
- waitFor: s,
20
- classPrefix: e,
21
- onTransitionEnd: a
22
- }) : c.current || (l = me({
23
- dialog: i,
24
- waitFor: s,
25
- classPrefix: e,
26
- onTransitionEnd: a
27
- })), c.current = !1, () => {
28
- l && l();
29
- };
30
- }, [t, d]);
31
- }
32
- function ue({ dialog: t, waitFor: e, classPrefix: r, onTransitionEnd: i }) {
33
- return Q(t, e, `${r}--show`, i);
34
- }
35
- function me({ dialog: t, waitFor: e, classPrefix: r, onTransitionEnd: i }) {
36
- return Q(t, e, `${r}--hide`, i);
37
- }
38
- function Q(t, e, r, i) {
39
- if (!t.current || !r)
40
- return;
41
- let u = 0;
42
- const d = e ? e.length : 0, a = `${r}-init`;
43
- return t.current.classList.add(a), fe(() => {
44
- t.current && (t.current.classList.add(r), t.current.classList.remove(a), e.forEach((c) => {
45
- const s = () => {
46
- var l, f;
47
- ++u === d && ((l = t.current) == null || l.classList.remove(r), i(), (f = c.current) == null || f.removeEventListener("transitionend", s));
48
- };
49
- c.current.addEventListener("transitionend", s, { once: !0 });
50
- }));
51
- });
52
- }
53
- function fe(t) {
54
- let e, r;
55
- return window.requestAnimationFrame ? (e = window.requestAnimationFrame(() => {
56
- e = window.requestAnimationFrame(t);
57
- }), r = window.cancelAnimationFrame) : (e = window.setTimeout(t, 26), r = window.clearTimeout), () => {
58
- e && (r(e), e = void 0);
59
- };
60
- }
61
- const Ee = ({ baseEl: t = "div", classPrefix: e = "drawer-dialog", windowClass: r, windowType: i, mainId: u, top: d, header: a, buttonPosition: c = "right", children: s, ariaLabelledby: l, a11yCloseText: f, onCloseBtnClick: y = () => {
62
- }, footer: p, actions: g, onScroll: N, open: n = !1, onOpen: $ = () => {
63
- }, onBackgroundClick: I = () => {
64
- }, ignoreEscape: U, closeButton: V, previousButton: X, isModal: h, role: Y = "dialog", focus: T, transitionElement: Z, animated: k, closeButtonClass: M, ...C }) => {
65
- var K;
66
- const R = b(null), E = b(null), q = b(null), [x, P] = re("");
67
- _(() => {
68
- P(ce());
69
- }, []), _(() => {
70
- let m;
71
- const w = (v) => {
72
- E.current && !E.current.contains(v.target) && I(v);
73
- };
74
- return n && c !== "hidden" && (m = window.setTimeout(() => {
75
- document.addEventListener("click", w, !1);
76
- })), () => {
77
- clearTimeout(m), document.removeEventListener("click", w, !1);
78
- };
79
- }, [I, n]), _(() => (n && h ? (F.trap(E.current), D.trap(E.current)) : (F.untrap(), D.untrap()), () => {
80
- F.untrap(), D.untrap();
81
- }), [n, h]), de({
82
- open: n,
83
- classPrefix: e,
84
- transitionElement: Z,
85
- dialogRef: R,
86
- dialogWindowRef: E,
87
- enabled: k,
88
- onTransitionEnd: () => S(n)
89
- });
90
- const A = (m) => {
91
- !U && m.key === "Escape" && (m.stopPropagation(), y(m));
92
- };
93
- _(() => {
94
- k || S(n), n && $();
95
- }, [n]);
96
- function S(m) {
97
- var w, v;
98
- if (m)
99
- return T ? (w = T.current) == null || w.focus() : h && ((v = q.current) == null || v.focus()), document.addEventListener("keydown", A, !1), () => document.removeEventListener("keydown", A, !1);
100
- }
101
- const H = c !== "hidden" && o.createElement("button", { ref: q, className: L("icon-btn", M, `${e}__close`, {
102
- "icon-btn--transparent": e === "toast-dialog"
103
- }), type: "button", "aria-label": f, onClick: y }, V || o.createElement(se, { name: "close16" })), ee = i ? `${e}__${i}-window` : `${e}__window`, O = ((K = a == null ? void 0 : a.props) == null ? void 0 : K.id) || `dialog-title-${x}`, te = l || O, B = a ? ae(a, { ...a.props, id: O }) : null;
104
- return o.createElement(
105
- t,
106
- { ...C, "aria-labelledby": te, "aria-modal": "true", role: Y, hidden: !n, className: L(e, C.className), "aria-live": h ? void 0 : "polite", ref: R, onKeyDown: A },
107
- o.createElement(
108
- "div",
109
- { className: L(ee, r), ref: E },
110
- d,
111
- B && o.createElement(
112
- "div",
113
- { className: `${e}__header` },
114
- X,
115
- c === "right" && B,
116
- c !== "bottom" && H,
117
- (c === "left" || c === "hidden") && B
118
- ),
119
- o.createElement("div", { id: u, className: `${e}__main`, onScroll: N }, s),
120
- g ? o.createElement("div", { className: `${e}__actions` }, g) : null,
121
- p || c === "bottom" ? o.createElement(
122
- "div",
123
- { className: `${e}__footer` },
124
- p,
125
- c === "bottom" && H
126
- ) : null
127
- )
128
- );
129
- }, he = ({ isModal: t, open: e, children: r, animated: i = !0, ...u }) => {
130
- const d = t !== !1, a = oe.toArray(r), c = a.find((n) => n.type === W), s = a.find((n) => n.type === j), l = a.find((n) => n.type === G), f = a.find((n) => n.type === z), y = a.find((n) => n.type === J), p = a.filter((n) => ![
131
- W,
132
- j,
133
- z,
134
- G,
135
- J
136
- ].some(($) => $ === n.type)), g = o.createElement(Ee, { ...u, open: e, isModal: d, header: c, footer: s, actions: l, closeButton: f, previousButton: y, animated: i }, p);
137
- return i || e ? d ? o.createElement(ie, { enabled: e }, g) : g : null;
138
- }, G = ({ children: t }) => o.createElement(o.Fragment, null, t), J = ({ className: t, icon: e, ...r }) => o.createElement(le, { ...r, icon: e || "chevronLeft16", className: L(t, "lightbox-dialog__prev") });
139
- export {
140
- he as D,
141
- W as E,
142
- j as a,
143
- z as b,
144
- G as c,
145
- J as d
146
- };
@@ -1,40 +0,0 @@
1
- import h, { useState as N, useEffect as B, Children as v } from "react";
2
- import E from "classnames";
3
- import { E as u, D as I } from "./dialog-previous-button-gmkm4c8J.mjs";
4
- import "./icon-button-Dy8rjzH7.mjs";
5
- const T = 30, t = "drawer-dialog", P = ({ expanded: r = !1, noHandle: g, onClose: i = () => {
6
- }, onCollapsed: _ = () => {
7
- }, onExpanded: y = () => {
8
- }, a11yMaximizeText: x, a11yMinimizeText: S, children: C, ...l }) => {
9
- let a = [];
10
- const [s, m] = N(r);
11
- B(() => {
12
- m(r);
13
- }, [r]);
14
- const c = (e) => {
15
- m(e), e ? y() : _();
16
- }, D = (e) => {
17
- a = Array.from(e.changedTouches).map(({ identifier: n, pageY: o }) => ({ identifier: n, pageY: o }));
18
- }, d = (e) => {
19
- Array.from(e.changedTouches).forEach(({ identifier: n }) => {
20
- const o = a.findIndex((f) => f.identifier === n);
21
- o > -1 && a.splice(o, 1);
22
- });
23
- }, b = (e) => {
24
- a.length && Array.from(e.changedTouches).forEach(({ identifier: n, pageY: o }) => {
25
- const f = a.findIndex(($) => $.identifier === n), p = o - a[f].pageY;
26
- p > T ? (s ? c(!1) : i(), d(e)) : p < -T && (c(!0), d(e));
27
- });
28
- }, k = g ? null : h.createElement("button", { "aria-label": s ? S : x, className: `${t}__handle`, onClick: () => c(!s), onScroll: () => c(!0), onTouchStart: D, onTouchMove: b, onTouchEnd: d, type: "button" }), w = v.toArray(C), A = w.find(({ type: e }) => e === u), H = w.filter(({ type: e }) => e !== u);
29
- return h.createElement(
30
- I,
31
- { ...l, classPrefix: t, onCloseBtnClick: i, className: E(l.className, `${t}--mask-fade-slow`), windowClass: E(l.windowClass, `${t}__window`, `${t}__window--slide`, {
32
- [`${t}__window--expanded`]: s
33
- }), onBackgroundClick: i, top: k },
34
- A || h.createElement(u, null),
35
- H
36
- );
37
- };
38
- export {
39
- P as E
40
- };
@@ -1,22 +0,0 @@
1
- import o, { useRef as c } from "react";
2
- import m from "classnames";
3
- import { D as d, a as f } from "./dialog-previous-button-gmkm4c8J.mjs";
4
- import "./icon-button-Dy8rjzH7.mjs";
5
- import { E as g } from "./button-B06HeRsZ.mjs";
6
- const a = "alert-dialog", y = ({ a11yCloseText: t = "Close Dialog", confirmText: l, onConfirm: n = () => {
7
- }, ...e }) => {
8
- const i = c(null), s = "alert-dialog-confirm", r = "alert-dialog-main";
9
- return o.createElement(
10
- d,
11
- { focus: i, ...e, a11yCloseText: t, role: "alertdialog", classPrefix: a, ignoreEscape: !0, mainId: r, buttonPosition: "hidden", className: m(e.className, `${a}--mask-fade`), windowClass: `${a}__window ${a}__window--fade` },
12
- e.children,
13
- o.createElement(
14
- f,
15
- null,
16
- o.createElement(g, { priority: "primary", "aria-describedby": r, onClick: n, ref: i, id: s, className: "alert-dialog__acknowledge" }, l)
17
- )
18
- );
19
- };
20
- export {
21
- y as EbayAlertDialog
22
- };
package/ebay-badge.mjs DELETED
@@ -1,4 +0,0 @@
1
- import { E as o } from "./badge-BX5HuO-3.mjs";
2
- export {
3
- o as EbayBadge
4
- };
@@ -1,39 +0,0 @@
1
- import e, { Children as m, cloneElement as f } from "react";
2
- import v from "classnames";
3
- import { E as k } from "./icon-B_a65KUD.mjs";
4
- const N = ({ a11yHeadingText: n = "Page navigation", a11yHeadingTag: t = "h2", id: s = "ebay-breadcrumb", children: a = [], className: i, onSelect: l = () => {
5
- }, ...r }) => {
6
- const o = `${s}-breadcrumbs-heading`, d = m.count(a) - 1, u = t, b = m.toArray(a).some((c) => c.props.href) ? "a" : "button";
7
- return e.createElement(
8
- "nav",
9
- { ...r, "aria-labelledby": o, className: v("breadcrumbs", i), role: "navigation" },
10
- e.createElement(u, { id: o, className: "clipped" }, n),
11
- e.createElement("ul", null, m.map(a, (c, p) => {
12
- const h = p === d, { href: E, children: g } = c.props;
13
- return f(c, {
14
- tag: b,
15
- isLastItem: h,
16
- href: E,
17
- children: g,
18
- onClick: (y) => l(y)
19
- });
20
- }))
21
- );
22
- }, P = ({ tag: n = "button", isLastItem: t = !1, href: s, children: a, onClick: i, ...l }) => {
23
- const r = n === "a", o = {
24
- ...l,
25
- ...t ? { "aria-current": "location" } : {},
26
- href: r ? s : void 0,
27
- onClick: r ? void 0 : i
28
- };
29
- return e.createElement(
30
- "li",
31
- null,
32
- e.createElement(n, { ...o }, a),
33
- !t && e.createElement(k, { name: "chevronRight12" })
34
- );
35
- };
36
- export {
37
- P as EbayBreadcrumbItem,
38
- N as EbayBreadcrumbs
39
- };
package/ebay-button.mjs DELETED
@@ -1,5 +0,0 @@
1
- import { E as o, a as E } from "./button-B06HeRsZ.mjs";
2
- export {
3
- o as EbayButton,
4
- E as EbayButtonCell
5
- };
package/ebay-calendar.mjs DELETED
@@ -1,4 +0,0 @@
1
- import { E as e } from "./calendar-Dq0eM9VC.mjs";
2
- export {
3
- e as EbayCalendar
4
- };