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

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
@@ -4088,38 +4088,43 @@ var hn = ({ className: t, clearLabel: n = "Clear", disabled: r = !1, filterKey:
4088
4088
  ]),
4089
4089
  ...o
4090
4090
  }, f && /* @__PURE__ */ e.createElement("div", { className: `${s}__image` }, f[0]), p && /* @__PURE__ */ e.createElement("div", { className: `${s}__main` }, p), m && /* @__PURE__ */ e.createElement("div", { className: `${s}__footer` }, m));
4091
- }, In = ({ className: t, defaultValue: n, id: r, label: i, labelDisplay: a = "left", layout: o = "auto", onChange: s, options: c, size: l = "m", ...u }) => {
4092
- let d = "pds-card-select", f = l === "m" ? null : `${d}--${l}`, p = `${d}__legend`;
4093
- a === "center" && (p = `${d}__legend ${d}__legend--center`), a === "hidden" && (p = `${d}__legend visually-hidden`);
4094
- let [m, g] = h(n), _ = (e) => {
4095
- g(e.currentTarget.value), s && s(e.currentTarget.value);
4096
- }, v = c.length, y = "pds-grid-item pds-grid-item--sm-4 pds-grid-item--md-6", b = "pds-grid-item pds-grid-item--sm-4 pds-grid-item--md-4", x = "";
4097
- return o === "twoAcross" ? x = y : o === "threeAcross" ? x = b : o === "auto" && (x = v === 1 ? "pds-grid-item" : v % 3 == 0 ? b : v % 2 == 0 ? y : b), /* @__PURE__ */ e.createElement("fieldset", {
4091
+ }, In = ({ className: t, defaultValue: n, id: r, imageVariant: i = "bleed", label: a, labelDisplay: o = "left", layout: s = "auto", onChange: c, options: l, showIndicator: u = !0, size: d = "m", ...f }) => {
4092
+ let p = "pds-card-select", m = d === "m" ? null : `${p}--${d}`, g = i === "bleed" ? null : `${p}--image-${i}`, _ = u ? null : `${p}--no-indicator`, v = `${p}__legend`;
4093
+ o === "center" && (v = `${p}__legend ${p}__legend--center`), o === "hidden" && (v = `${p}__legend visually-hidden`);
4094
+ let [y, b] = h(n), x = (e) => {
4095
+ b(e.currentTarget.value), c && c(e.currentTarget.value);
4096
+ }, S = l.length, C = "pds-grid-item pds-grid-item--sm-4 pds-grid-item--md-6", w = "pds-grid-item pds-grid-item--sm-4 pds-grid-item--md-4", T = "";
4097
+ return s === "twoAcross" ? T = C : s === "threeAcross" ? T = w : s === "auto" && (T = S === 1 ? "pds-grid-item" : S % 3 == 0 ? w : S % 2 == 0 ? C : w), /* @__PURE__ */ e.createElement("fieldset", {
4098
4098
  className: Z([
4099
- d,
4100
- f,
4099
+ p,
4100
+ m,
4101
+ g,
4102
+ _,
4101
4103
  t
4102
4104
  ]),
4103
4105
  id: r,
4104
- ...u
4105
- }, /* @__PURE__ */ e.createElement("legend", { className: p }, i), /* @__PURE__ */ e.createElement("div", { className: `${d}__options pds-grid pds-grid--gap-m` }, c.map((t, n) => /* @__PURE__ */ e.createElement("div", {
4106
- key: `${r}-option-${n}`,
4107
- className: Z([`${d}__option`, x])
4108
- }, /* @__PURE__ */ e.createElement("input", {
4109
- defaultChecked: m === t.value,
4110
- id: t.id ? t.id : `${r}-option-${n}`,
4111
- name: r,
4112
- onClick: _,
4113
- type: "radio",
4114
- value: t.value
4115
- }), /* @__PURE__ */ e.createElement("label", {
4116
- className: m === t.value ? `${d}__option-label ${d}__option-label--selected` : `${d}__option-label`,
4117
- htmlFor: t.id ? t.id : `${r}-option-${n}`
4118
- }, /* @__PURE__ */ e.createElement("div", { className: `${d}__option-label-indicator` }, /* @__PURE__ */ e.createElement(Q, {
4119
- className: m === t.value ? `${d}__option-icon ${d}__option-icon--selected` : `${d}__option-icon`,
4120
- iconName: m === t.value ? "circleCheck" : "circle",
4121
- size: "l"
4122
- })), /* @__PURE__ */ e.createElement("span", { className: `${d}__option-label-text` }, t.label), t.children && /* @__PURE__ */ e.createElement("div", { className: `${d}__option-children` }, t.children))))));
4106
+ ...f
4107
+ }, /* @__PURE__ */ e.createElement("legend", { className: v }, a), /* @__PURE__ */ e.createElement("div", { className: `${p}__options pds-grid pds-grid--gap-m` }, l.map((t, n) => {
4108
+ let i = t.id ? t.id : `${r}-option-${n}`, a = y === t.value, s = Le(e.isValidElement(t.children) && t.children.type === e.Fragment ? t.children.props.children : t.children), c = s.image, l = s.__unslotted || s.main;
4109
+ return /* @__PURE__ */ e.createElement("div", {
4110
+ key: `${r}-option-${n}`,
4111
+ className: Z([`${p}__option`, T])
4112
+ }, /* @__PURE__ */ e.createElement("input", {
4113
+ defaultChecked: a,
4114
+ id: i,
4115
+ name: r,
4116
+ onClick: x,
4117
+ type: "radio",
4118
+ value: t.value
4119
+ }), /* @__PURE__ */ e.createElement("label", {
4120
+ className: Z([`${p}__option-label`, a ? `${p}__option-label--selected` : null]),
4121
+ htmlFor: i
4122
+ }, c && /* @__PURE__ */ e.createElement("div", { className: `${p}__option-image` }, c[0]), /* @__PURE__ */ e.createElement("div", { className: `${p}__option-content` }, u && /* @__PURE__ */ e.createElement("div", { className: `${p}__option-label-indicator` }, /* @__PURE__ */ e.createElement(Q, {
4123
+ className: Z([`${p}__option-icon`, a ? `${p}__option-icon--selected` : null]),
4124
+ iconName: a ? "circleCheck" : "circle",
4125
+ size: "l"
4126
+ })), /* @__PURE__ */ e.createElement("div", { className: `${p}__option-body` }, /* @__PURE__ */ e.createElement("span", { className: Z([`${p}__option-label-text`, o === "hidden" ? "visually-hidden" : null]) }, t.label), l && /* @__PURE__ */ e.createElement("div", { className: `${p}__option-main` }, l)))));
4127
+ })));
4123
4128
  }, Ln = ({ className: t, heading: n, headingLevel: r = "span", iconName: i, linkContent: a, message: o, ...s }) => {
4124
4129
  let c = "pds-compact-empty-state";
4125
4130
  return /* @__PURE__ */ e.createElement("div", {
@@ -7784,29 +7789,35 @@ var fr = {
7784
7789
  message: k,
7785
7790
  validationStatus: v
7786
7791
  }));
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 = () => {
7792
+ }, 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) => {
7793
+ 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) => {
7794
+ D || k(e.target.checked), d && d(e);
7795
+ }, M = g ? /* @__PURE__ */ e.createElement("span", {
7796
+ "aria-hidden": "true",
7797
+ className: `${S}__toggle-label`
7798
+ }, A) : null, N = () => {
7791
7799
  i || document.getElementById(a)?.click();
7792
- }, O = /* @__PURE__ */ e.createElement("div", { className: `${v}__control` }, /* @__PURE__ */ e.createElement("input", {
7793
- ref: g,
7800
+ }, P = /* @__PURE__ */ e.createElement("div", {
7801
+ className: `${S}__control`,
7802
+ "data-status-label-placement": _
7803
+ }, /* @__PURE__ */ e.createElement("input", {
7804
+ ref: b,
7794
7805
  "aria-describedby": l ? `${a}__message` : null,
7795
- checked: t === void 0 ? w : t,
7806
+ checked: t === void 0 ? O : t,
7796
7807
  className: "visually-hidden",
7797
7808
  disabled: i,
7798
7809
  id: a,
7799
7810
  name: a,
7800
- onChange: E,
7801
- required: d,
7811
+ onChange: j,
7812
+ required: p,
7802
7813
  role: "switch",
7803
7814
  type: "checkbox",
7804
7815
  ...o
7805
- }), /* @__PURE__ */ e.createElement("div", { className: `${v}__track-wrapper` }, /* @__PURE__ */ e.createElement("span", {
7816
+ }), /* @__PURE__ */ e.createElement("div", { className: `${S}__track-wrapper` }, _ === "left" && M, /* @__PURE__ */ e.createElement("span", {
7806
7817
  "aria-hidden": "true",
7807
- className: `${v}__track`,
7808
- onClick: D
7809
- }, /* @__PURE__ */ e.createElement("span", { className: `${v}__thumb` })))), k = l ? /* @__PURE__ */ e.createElement(jt, {
7818
+ className: `${S}__track`,
7819
+ onClick: N
7820
+ }, /* @__PURE__ */ e.createElement("span", { className: `${S}__thumb` })), _ === "right" && M)), F = l ? /* @__PURE__ */ e.createElement(jt, {
7810
7821
  className: "pds-input-message--switch",
7811
7822
  hasValidationMessage: !1,
7812
7823
  id: a,
@@ -7816,23 +7827,23 @@ var fr = {
7816
7827
  return /* @__PURE__ */ e.createElement("div", {
7817
7828
  className: Z([
7818
7829
  $.base,
7819
- v,
7820
- y,
7821
- b,
7822
- x,
7823
7830
  S,
7831
+ C,
7832
+ w,
7833
+ T,
7834
+ E,
7824
7835
  n
7825
7836
  ]),
7826
- style: s ? _ : null,
7827
- ...m
7837
+ style: s ? x : null,
7838
+ ...y
7828
7839
  }, /* @__PURE__ */ e.createElement(At, {
7829
- className: `${v}__label`,
7840
+ className: `${S}__label`,
7830
7841
  disabled: i,
7831
7842
  id: a,
7832
7843
  label: c,
7833
- required: d,
7834
- showLabel: f
7835
- }), /* @__PURE__ */ e.createElement("div", { className: `${v}__content` }, k, O));
7844
+ required: p,
7845
+ showLabel: m
7846
+ }), /* @__PURE__ */ e.createElement("div", { className: `${S}__content` }, F, P));
7836
7847
  }), 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
7848
  let y = m(null), b = "pds-tags-input__tag";
7838
7849
  l(() => {
@@ -9456,7 +9467,7 @@ var fr = {
9456
9467
  imageSrc: P.imageSrc,
9457
9468
  size: "s",
9458
9469
  uniqueId: P.workspaceId
9459
- }), /* @__PURE__ */ e.createElement("span", { className: `${b}__name` }, P.displayName)) : null;
9470
+ }), /* @__PURE__ */ e.createElement("span", { className: `${b}__name` }, /* @__PURE__ */ e.createElement("span", { className: `${b}__name-text` }, P.displayName))) : null;
9460
9471
  return /* @__PURE__ */ e.createElement("span", {
9461
9472
  className: Z([b, n]),
9462
9473
  ...u
@@ -9982,7 +9993,7 @@ var fr = {
9982
9993
  }, s && /* @__PURE__ */ e.createElement("div", { className: `${v}__close-wrapper` }, /* @__PURE__ */ e.createElement(tn, {
9983
9994
  ariaLabel: i,
9984
9995
  onClick: () => w(!1),
9985
- size: "l"
9996
+ size: "m"
9986
9997
  })), /* @__PURE__ */ e.createElement("div", { className: `${v}__title` }, f), /* @__PURE__ */ e.createElement("div", {
9987
9998
  className: `${v}__content`,
9988
9999
  style: S
@@ -12010,13 +12021,17 @@ var Sa = ({ children: t, className: n, columns: r, depth: i = 0, hasChildren: a
12010
12021
  },
12011
12022
  ...l
12012
12023
  }, /* @__PURE__ */ e.createElement("div", { className: `${u}__main` }, f.__unslotted || f.content), /* @__PURE__ */ e.createElement("div", { className: `${u}__side` }, f.sidebar));
12013
- }, Ja = ({ children: t, className: n, hasPanel: r = !1, ...i }) => {
12014
- let a = Le(t), o = a.stepper, s = a.form, c = "pds-stepper-layout", l = /* @__PURE__ */ e.createElement(ri, {
12015
- className: Z([c, n]),
12024
+ }, Ja = ({ children: t, className: n, formWidth: r = "standard", hasPanel: i = !1, ...a }) => {
12025
+ let o = Le(t), s = o.stepper, c = o.form, l = "pds-stepper-layout", u = r === "full" ? `${l}--full-width` : null, d = /* @__PURE__ */ e.createElement(ri, {
12026
+ className: Z([
12027
+ l,
12028
+ u,
12029
+ n
12030
+ ]),
12016
12031
  width: "wide",
12017
- ...i
12018
- }, o && /* @__PURE__ */ e.createElement("div", { className: `${c}__stepper-container` }, o), s && /* @__PURE__ */ e.createElement("div", { className: `${c}__form-container` }, s));
12019
- return r ? /* @__PURE__ */ e.createElement(Ki, null, l) : l;
12032
+ ...a
12033
+ }, s && /* @__PURE__ */ e.createElement("div", { className: `${l}__stepper-container` }, s), c && /* @__PURE__ */ e.createElement("div", { className: `${l}__form-container` }, c));
12034
+ return i ? /* @__PURE__ */ e.createElement(Ki, null, d) : d;
12020
12035
  }, Ya = ({ children: t, className: n, gridGap: r = "xl", verticalAlign: i = "start", ...a }) => {
12021
12036
  let o = "pds-three-item-layout", s = r === "xl" ? "pds-grid" : `pds-grid pds-grid--gap-${r}`, c = `${o}--${i}`, l = Le(t), u = [
12022
12037
  l["first-item"],