@pantheon-systems/pds-toolkit-react 2.0.0-alpha.55 → 2.0.0-alpha.56

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.
package/dist/index.js CHANGED
@@ -3475,7 +3475,8 @@ var On = ({ className: t = "pds-dropdown__selected-icon" }) => /* @__PURE__ */ e
3475
3475
  onClick: () => {
3476
3476
  Pn(t) || I(t);
3477
3477
  },
3478
- role: "menuitem"
3478
+ role: "menuitem",
3479
+ tabIndex: t.disabled ? -1 : 0
3479
3480
  }, c);
3480
3481
  }
3481
3482
  }, B = (t) => {
@@ -4027,9 +4028,9 @@ var On = ({ className: t = "pds-dropdown__selected-icon" }) => /* @__PURE__ */ e
4027
4028
  }, T(t));
4028
4029
  }
4029
4030
  let E = /* @__PURE__ */ e.createElement("button", {
4030
- "aria-disabled": i || u || f,
4031
4031
  className: Z([`${v}__button`, y]),
4032
- onClick: i ? void 0 : h,
4032
+ disabled: i || u || f,
4033
+ onClick: h,
4033
4034
  type: "button",
4034
4035
  ...t
4035
4036
  }, S(C));
@@ -7357,7 +7358,7 @@ var Tr = {
7357
7358
  onClick: Se,
7358
7359
  onKeyDown: we,
7359
7360
  onMouseDown: Ce,
7360
- tabIndex: 0
7361
+ tabIndex: r ? -1 : 0
7361
7362
  }, R.length > 1 && !y && /* @__PURE__ */ e.createElement("div", { className: `${D}__counter` }, /* @__PURE__ */ e.createElement("span", { className: `${D}__counter-wrapper` }, Ee)), R.length > 0 && /* @__PURE__ */ e.createElement("div", { className: `${D}__items-wrapper` }, R.map((t, n) => /* @__PURE__ */ e.createElement("span", {
7362
7363
  key: `selected-item-${n}`,
7363
7364
  className: `
@@ -7928,6 +7929,7 @@ var Tr = {
7928
7929
  }, w = String(i + 1), T = String(_), E = o ? v.tagAriaLabel : v.tagAriaLabelSimple, D = `${g.value}, ${E.replace("{index}", w).replace("{total}", T)}`, O = a ? `${b}--dragging` : null, k = t ? $.disabled : null, A = n ? `${b}--drop-target-${n}` : null;
7929
7930
  return /* @__PURE__ */ e.createElement("div", {
7930
7931
  ref: y,
7932
+ "aria-disabled": t || void 0,
7931
7933
  "aria-label": D,
7932
7934
  className: Z([
7933
7935
  b,
@@ -9489,6 +9491,7 @@ var Tr = {
9489
9491
  ref: (e) => {
9490
9492
  H.current[n] = e;
9491
9493
  },
9494
+ "aria-disabled": t.disabled || void 0,
9492
9495
  className: Z([i, a]),
9493
9496
  id: r,
9494
9497
  onKeyDown: q,
@@ -9504,6 +9507,7 @@ var Tr = {
9504
9507
  let r = y.current[n], i = `${E}__item`, a = t.disabled ? `${i}--disabled` : null;
9505
9508
  return /* @__PURE__ */ e.createElement("li", {
9506
9509
  key: r,
9510
+ "aria-disabled": t.disabled || void 0,
9507
9511
  className: Z([i, a]),
9508
9512
  id: `${r}-accordion`,
9509
9513
  onClick: () => {
@@ -10121,7 +10125,7 @@ var Tr = {
10121
10125
  transform: "translateY(1rem)"
10122
10126
  }
10123
10127
  });
10124
- return /* @__PURE__ */ e.createElement(e.Fragment, null, P && /* @__PURE__ */ e.createElement(b, {
10128
+ return P ? Ee(/* @__PURE__ */ e.createElement(b, {
10125
10129
  lockScroll: !0,
10126
10130
  style: {
10127
10131
  ...O,
@@ -10153,7 +10157,7 @@ var Tr = {
10153
10157
  })), /* @__PURE__ */ e.createElement("div", { className: `${v}__title` }, f), /* @__PURE__ */ e.createElement("div", {
10154
10158
  className: `${v}__content`,
10155
10159
  style: S
10156
- }, g), _ && /* @__PURE__ */ e.createElement("div", { className: `${v}__footer` }, _)))));
10160
+ }, g), _ && /* @__PURE__ */ e.createElement("div", { className: `${v}__footer` }, _)))), document.body) : null;
10157
10161
  }, ra = (e, t) => {
10158
10162
  let n = t - e + 1;
10159
10163
  return Array.from({ length: n }, (t, n) => n + e);
@@ -10272,10 +10276,10 @@ var Tr = {
10272
10276
  }), /* @__PURE__ */ e.createElement("span", { className: `${_}__count` }, o.of, " ", f), /* @__PURE__ */ e.createElement("div", { className: `${_}__nav` }, /* @__PURE__ */ e.createElement(zt, {
10273
10277
  content: o.previous,
10274
10278
  customTrigger: /* @__PURE__ */ e.createElement("button", {
10275
- "aria-disabled": h ? !0 : void 0,
10276
10279
  "aria-label": o.previous,
10277
10280
  className: Z([`${_}__btn`, h ? `${_}__btn--disabled` : null]),
10278
- onClick: h ? void 0 : () => s(n - 1),
10281
+ disabled: h,
10282
+ onClick: () => s(n - 1),
10279
10283
  type: "button"
10280
10284
  }, /* @__PURE__ */ e.createElement(Q, {
10281
10285
  iconName: "angleLeft",
@@ -10284,10 +10288,10 @@ var Tr = {
10284
10288
  }), /* @__PURE__ */ e.createElement(zt, {
10285
10289
  content: o.next,
10286
10290
  customTrigger: /* @__PURE__ */ e.createElement("button", {
10287
- "aria-disabled": g ? !0 : void 0,
10288
10291
  "aria-label": o.next,
10289
10292
  className: Z([`${_}__btn`, g ? `${_}__btn--disabled` : null]),
10290
- onClick: g ? void 0 : () => s(n + 1),
10293
+ disabled: g,
10294
+ onClick: () => s(n + 1),
10291
10295
  type: "button"
10292
10296
  }, /* @__PURE__ */ e.createElement(Q, {
10293
10297
  iconName: "angleRight",
@@ -11851,7 +11855,7 @@ var Ba = ({ children: t, className: n, columns: r, depth: i = 0, hasChildren: a
11851
11855
  let f = (e) => {
11852
11856
  let t = e.currentTarget.getAttribute("data-tabnumber");
11853
11857
  t && d(parseInt(t, 10));
11854
- }, p = m([]);
11858
+ }, p = m([]), g = m([]);
11855
11859
  l(() => {
11856
11860
  i(u);
11857
11861
  }, [u, i]), l(() => {
@@ -11864,30 +11868,30 @@ var Ba = ({ children: t, className: n, columns: r, depth: i = 0, hasChildren: a
11864
11868
  return;
11865
11869
  }
11866
11870
  }, [u]);
11867
- let g = (e, t) => {
11868
- let n = u, r = p.current[t === "next" ? n + 1 < p.current.length ? n + 1 : 0 : n - 1 >= 0 ? n - 1 : p.current.length - 1];
11869
- r || (r = t == "next" ? p.current[e + 1] == null ? p.current[0] : p.current[e + 1] : p.current[e - 1]), r.focus();
11870
- }, _ = (e) => {
11871
- let t = p.current.length, n = () => {
11872
- g((u + 1) % t, "next"), d(u + 1);
11873
- }, r = () => {
11874
- g((u - 1 + t) % t, "prev"), d(u - 1);
11871
+ let _ = (e, t, n) => {
11872
+ let r = u, i = e.current[n === "next" ? r + 1 < e.current.length ? r + 1 : 0 : r - 1 >= 0 ? r - 1 : e.current.length - 1];
11873
+ i || (i = n == "next" ? e.current[t + 1] == null ? e.current[0] : e.current[t + 1] : e.current[t - 1]), i.focus();
11874
+ }, v = (e) => (t) => {
11875
+ let n = e.current.length, r = () => {
11876
+ _(e, (u + 1) % n, "next"), d(u + 1);
11875
11877
  }, i = () => {
11876
- g(0), d(0);
11878
+ _(e, (u - 1 + n) % n, "prev"), d(u - 1);
11877
11879
  }, a = () => {
11878
- g(t - 1), d(t - 1);
11880
+ _(e, 0), d(0);
11879
11881
  }, o = () => {
11880
- p.current[u].focus();
11881
- }, s = {
11882
- ArrowRight: n,
11883
- ArrowLeft: r,
11884
- Home: i,
11885
- End: a,
11886
- Space: o,
11887
- Enter: o
11888
- }[e.code];
11889
- s && (e.preventDefault(), s());
11890
- };
11882
+ _(e, n - 1), d(n - 1);
11883
+ }, s = () => {
11884
+ e.current[u].focus();
11885
+ }, c = {
11886
+ ArrowRight: r,
11887
+ ArrowLeft: i,
11888
+ Home: a,
11889
+ End: o,
11890
+ Space: s,
11891
+ Enter: s
11892
+ }[t.code];
11893
+ c && (t.preventDefault(), c());
11894
+ }, y = v(p), b = v(g);
11891
11895
  return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", {
11892
11896
  className: Z([c, n]),
11893
11897
  ...s
@@ -11902,14 +11906,14 @@ var Ba = ({ children: t, className: n, columns: r, depth: i = 0, hasChildren: a
11902
11906
  t || (p.current[o] = e);
11903
11907
  },
11904
11908
  "aria-controls": `${c}__tab--${o}`,
11905
- "aria-disabled": !!t,
11906
11909
  "aria-selected": o == u,
11907
11910
  className: `${c}__tab`,
11908
11911
  "data-tabnumber": o,
11912
+ disabled: t,
11909
11913
  id: r,
11910
- onClick: t ? null : f,
11914
+ onClick: f,
11911
11915
  onKeyDown: (e) => {
11912
- e.preventDefault(), _(e);
11916
+ e.preventDefault(), y(e);
11913
11917
  },
11914
11918
  role: "tab",
11915
11919
  tabIndex: u === o ? 0 : -1,
@@ -11929,15 +11933,18 @@ var Ba = ({ children: t, className: n, columns: r, depth: i = 0, hasChildren: a
11929
11933
  role: "tabpanel"
11930
11934
  }, /* @__PURE__ */ e.createElement("button", {
11931
11935
  key: o,
11936
+ ref: (e) => {
11937
+ t || (g.current[o] = e);
11938
+ },
11932
11939
  "aria-controls": `tabpanel_${o}`,
11933
- "aria-disabled": !!t,
11934
11940
  "aria-selected": o == u,
11935
11941
  className: `${c}__trigger`,
11936
11942
  "data-tabnumber": o,
11937
- onClick: t ? null : f,
11938
- onKeyDown: _,
11943
+ disabled: t,
11944
+ onClick: f,
11945
+ onKeyDown: b,
11939
11946
  role: "tab",
11940
- tabIndex: u === o ? 1 : -1,
11947
+ tabIndex: u === o ? 0 : -1,
11941
11948
  type: "button"
11942
11949
  }, /* @__PURE__ */ e.createElement("div", { className: `${c}__tab-label` }, n && /* @__PURE__ */ e.createElement(Q, {
11943
11950
  iconName: n,