@pantheon-systems/pds-toolkit-react 2.0.0-alpha.47 → 2.0.0-alpha.48

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
@@ -7784,29 +7784,35 @@ var fr = {
7784
7784
  message: k,
7785
7785
  validationStatus: v
7786
7786
  }));
7787
- }, Ir = a(({ checked: t, className: n, defaultChecked: r, disabled: i = !1, id: a, inputProps: o, inputWidth: s, label: c, message: l, onChange: u, required: d = !1, showLabel: f = !0, switchPlacement: p = "right", ...m }, g) => {
7788
- let _ = Dt(s), v = "pds-switch", y = `${v}--${p}`, b = l ? `${v}--message` : null, x = i ? $.disabled : null, S = d && !i ? $.required : null, C = t !== void 0, [w, T] = h(!C && r ? r : !1), E = (e) => {
7789
- C || T(e.target.checked), u && u(e);
7790
- }, D = () => {
7787
+ }, Ir = a(({ checked: t, className: n, defaultChecked: r, disabled: i = !1, id: a, inputProps: o, inputWidth: s, label: c, message: l, offLabel: u = "Off", onChange: d, onLabel: f = "On", required: p = !1, showLabel: m = !0, showStatusLabel: g = !0, statusLabelPlacement: _ = "right", switchPlacement: v = "right", ...y }, b) => {
7788
+ let x = Dt(s), S = "pds-switch", C = `${S}--${v}`, w = l ? `${S}--message` : null, T = i ? $.disabled : null, E = p && !i ? $.required : null, D = t !== void 0, [O, k] = h(!D && r ? r : !1), A = t || O ? f : u, j = (e) => {
7789
+ D || k(e.target.checked), d && d(e);
7790
+ }, M = g ? /* @__PURE__ */ e.createElement("span", {
7791
+ "aria-hidden": "true",
7792
+ className: `${S}__toggle-label`
7793
+ }, A) : null, N = () => {
7791
7794
  i || document.getElementById(a)?.click();
7792
- }, O = /* @__PURE__ */ e.createElement("div", { className: `${v}__control` }, /* @__PURE__ */ e.createElement("input", {
7793
- ref: g,
7795
+ }, P = /* @__PURE__ */ e.createElement("div", {
7796
+ className: `${S}__control`,
7797
+ "data-status-label-placement": _
7798
+ }, /* @__PURE__ */ e.createElement("input", {
7799
+ ref: b,
7794
7800
  "aria-describedby": l ? `${a}__message` : null,
7795
- checked: t === void 0 ? w : t,
7801
+ checked: t === void 0 ? O : t,
7796
7802
  className: "visually-hidden",
7797
7803
  disabled: i,
7798
7804
  id: a,
7799
7805
  name: a,
7800
- onChange: E,
7801
- required: d,
7806
+ onChange: j,
7807
+ required: p,
7802
7808
  role: "switch",
7803
7809
  type: "checkbox",
7804
7810
  ...o
7805
- }), /* @__PURE__ */ e.createElement("div", { className: `${v}__track-wrapper` }, /* @__PURE__ */ e.createElement("span", {
7811
+ }), /* @__PURE__ */ e.createElement("div", { className: `${S}__track-wrapper` }, _ === "left" && M, /* @__PURE__ */ e.createElement("span", {
7806
7812
  "aria-hidden": "true",
7807
- className: `${v}__track`,
7808
- onClick: D
7809
- }, /* @__PURE__ */ e.createElement("span", { className: `${v}__thumb` })))), k = l ? /* @__PURE__ */ e.createElement(jt, {
7813
+ className: `${S}__track`,
7814
+ onClick: N
7815
+ }, /* @__PURE__ */ e.createElement("span", { className: `${S}__thumb` })), _ === "right" && M)), F = l ? /* @__PURE__ */ e.createElement(jt, {
7810
7816
  className: "pds-input-message--switch",
7811
7817
  hasValidationMessage: !1,
7812
7818
  id: a,
@@ -7816,23 +7822,23 @@ var fr = {
7816
7822
  return /* @__PURE__ */ e.createElement("div", {
7817
7823
  className: Z([
7818
7824
  $.base,
7819
- v,
7820
- y,
7821
- b,
7822
- x,
7823
7825
  S,
7826
+ C,
7827
+ w,
7828
+ T,
7829
+ E,
7824
7830
  n
7825
7831
  ]),
7826
- style: s ? _ : null,
7827
- ...m
7832
+ style: s ? x : null,
7833
+ ...y
7828
7834
  }, /* @__PURE__ */ e.createElement(At, {
7829
- className: `${v}__label`,
7835
+ className: `${S}__label`,
7830
7836
  disabled: i,
7831
7837
  id: a,
7832
7838
  label: c,
7833
- required: d,
7834
- showLabel: f
7835
- }), /* @__PURE__ */ e.createElement("div", { className: `${v}__content` }, k, O));
7839
+ required: p,
7840
+ showLabel: m
7841
+ }), /* @__PURE__ */ e.createElement("div", { className: `${S}__content` }, F, P));
7836
7842
  }), Lr = ({ disabled: t, dropTargetDirection: n, focusedIndex: r, index: i, isDragging: a, isSortable: o, onDragEnd: s, onDragOver: c, onDragStart: u, onFocusInput: d, onKeyboardMove: f, onRemove: p, setFocusedIndex: h, tag: g, totalTags: _, translationStrings: v }) => {
7837
7843
  let y = m(null), b = "pds-tags-input__tag";
7838
7844
  l(() => {