@pantheon-systems/pds-toolkit-react 2.0.0-beta.4 → 2.0.0-beta.5

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
@@ -2840,78 +2840,78 @@ var En = ({ className: t, componentWidth: n, isLoading: r, loadingText: i = "Loa
2840
2840
  return t.toArray(n.children).map(kn).join("");
2841
2841
  }
2842
2842
  return "";
2843
- }, An = o(({ ariaLabel: t, buttonType: n = "button", className: r = "", disabled: i = !1, displayType: a = "label-only", iconName: o, isFullWidth: s = !1, isLoading: c = !1, isSplitButton: l = !1, isWorking: u = !1, label: d, onClick: f, size: p = "s", statusDot: m, tally: h, tooltipText: g, variant: _ = "primary", ...v }, y) => {
2844
- let b = "pds-button", x = `${b}--${p}`, S = `${b}--${_}`, C = s ? `${b}--full-width` : null, w = c ? `${b}--loading` : null, T = c ? "pds-pulse" : null, E, D, O;
2845
- switch (p) {
2843
+ }, An = o(({ ariaLabel: t, buttonType: n = "button", className: r = "", disabled: i = !1, disableWhenWorking: a = !0, displayType: o = "label-only", iconName: s, isFullWidth: c = !1, isLoading: l = !1, isSplitButton: u = !1, isWorking: d = !1, label: f, onClick: p, size: m = "s", statusDot: h, tally: g, tooltipText: _, variant: v = "primary", ...y }, b) => {
2844
+ let x = "pds-button", S = `${x}--${m}`, C = `${x}--${v}`, w = c ? `${x}--full-width` : null, T = l ? `${x}--loading` : null, E = l ? "pds-pulse" : null, D = i || l || d && a, O, k, A;
2845
+ switch (m) {
2846
2846
  case "xs":
2847
- E = "xs", D = "s", O = "xs";
2847
+ O = "xs", k = "s", A = "xs";
2848
2848
  break;
2849
2849
  case "s":
2850
- E = "m", D = "m", O = "xs";
2850
+ O = "m", k = "m", A = "xs";
2851
2851
  break;
2852
2852
  case "m":
2853
- E = "m", D = "m", O = "s";
2853
+ O = "m", k = "m", A = "s";
2854
2854
  break;
2855
2855
  case "l":
2856
- E = "xl", D = "l", O = "m";
2856
+ O = "xl", k = "l", A = "m";
2857
2857
  break;
2858
2858
  }
2859
- let k = [
2859
+ let j = [
2860
2860
  "primary",
2861
2861
  "secondary",
2862
2862
  "subtle",
2863
2863
  "highlight"
2864
- ], A = k.includes(_);
2865
- h && !A && process.env.NODE_ENV !== "production" && console.warn(`[Button] The \`tally\` prop is not supported on the "${_}" variant. Use one of: ${k.join(", ")}.`);
2866
- let j = [
2864
+ ], M = j.includes(v);
2865
+ g && !M && process.env.NODE_ENV !== "production" && console.warn(`[Button] The \`tally\` prop is not supported on the "${v}" variant. Use one of: ${j.join(", ")}.`);
2866
+ let N = [
2867
2867
  "primary",
2868
2868
  "secondary",
2869
2869
  "subtle"
2870
- ], M = j.includes(_);
2871
- m && !M && process.env.NODE_ENV !== "production" && console.warn(`[Button] The \`statusDot\` prop is not supported on the "${_}" variant. Use one of: ${j.join(", ")}.`);
2872
- let N = /* @__PURE__ */ e.createElement(Q, {
2870
+ ], P = N.includes(v);
2871
+ h && !P && process.env.NODE_ENV !== "production" && console.warn(`[Button] The \`statusDot\` prop is not supported on the "${v}" variant. Use one of: ${N.join(", ")}.`);
2872
+ let F = /* @__PURE__ */ e.createElement(Q, {
2873
2873
  key: "icon",
2874
- className: `${b}__icon`,
2875
- iconName: o,
2876
- size: E
2877
- }), P = [];
2878
- m && M ? P.push(/* @__PURE__ */ e.createElement(Dn, {
2874
+ className: `${x}__icon`,
2875
+ iconName: s,
2876
+ size: O
2877
+ }), I = [];
2878
+ h && P ? I.push(/* @__PURE__ */ e.createElement(Dn, {
2879
2879
  key: "status-dot",
2880
- className: `${b}__icon`,
2881
- status: m
2882
- })) : a === "icon-start" && o && P.push(N), P.push(/* @__PURE__ */ e.createElement(e.Fragment, { key: "label" }, d)), h && A ? P.push(/* @__PURE__ */ e.createElement(Tn, {
2880
+ className: `${x}__icon`,
2881
+ status: h
2882
+ })) : o === "icon-start" && s && I.push(F), I.push(/* @__PURE__ */ e.createElement(e.Fragment, { key: "label" }, f)), g && M ? I.push(/* @__PURE__ */ e.createElement(Tn, {
2883
2883
  key: "tally",
2884
- className: `${b}__tally`,
2885
- label: h.label,
2886
- size: O,
2887
- type: h.type
2888
- })) : a === "icon-end" && o && P.push(N), l && (P = [N], t = kn(d));
2889
- let F = /* @__PURE__ */ e.createElement("button", {
2890
- ref: y,
2884
+ className: `${x}__tally`,
2885
+ label: g.label,
2886
+ size: A,
2887
+ type: g.type
2888
+ })) : o === "icon-end" && s && I.push(F), u && (I = [F], t = kn(f));
2889
+ let L = /* @__PURE__ */ e.createElement("button", {
2890
+ ref: b,
2891
2891
  "aria-label": t,
2892
2892
  className: Z([
2893
- b,
2894
2893
  x,
2895
2894
  S,
2896
2895
  C,
2897
2896
  w,
2898
2897
  T,
2898
+ E,
2899
2899
  r
2900
2900
  ]),
2901
- disabled: i || c || u,
2902
- onClick: f,
2901
+ disabled: D,
2902
+ onClick: p,
2903
2903
  type: n,
2904
- ...v
2905
- }, u && !c && /* @__PURE__ */ e.createElement(Cn, {
2906
- className: `${b}__working-indicator`,
2904
+ ...y
2905
+ }, d && !l && /* @__PURE__ */ e.createElement(Cn, {
2906
+ className: `${x}__working-indicator`,
2907
2907
  color: "currentColor",
2908
- size: D
2909
- }), P);
2910
- return (i || c || u) && g ? /* @__PURE__ */ e.createElement(on, {
2908
+ size: k
2909
+ }), I);
2910
+ return D && _ ? /* @__PURE__ */ e.createElement(on, {
2911
2911
  disableTapTrigger: !0,
2912
- content: g,
2913
- customTrigger: F
2914
- }) : /* @__PURE__ */ e.createElement(e.Fragment, null, F);
2912
+ content: _,
2913
+ customTrigger: L
2914
+ }) : /* @__PURE__ */ e.createElement(e.Fragment, null, L);
2915
2915
  }), jn = ({ className: t, disabled: n = !1, displayType: i = "label-only", iconName: a, linkContent: o, size: c = "s", tooltipText: l, variant: u = "primary", ...d }) => {
2916
2916
  let f = "pds-button-link", p = "pds-button", m = Z([
2917
2917
  p,
@@ -3044,8 +3044,8 @@ var En = ({ className: t, componentWidth: n, isLoading: r, loadingText: i = "Loa
3044
3044
  customTrigger: N,
3045
3045
  offsetValue: w
3046
3046
  }) : N);
3047
- }), Pn = ({ ariaLabel: t = "Copy to clipboard", className: n, clipboardText: r = "", disabled: i, hasBorder: a = !1, variant: o = "standard", ...s }) => {
3048
- let [c, l] = Mn(r);
3047
+ }), Pn = ({ ariaLabel: t = "Copy to clipboard", className: n, clipboardText: r = "", disabled: i, hasBorder: a = !1, size: o = "s", variant: s = "standard", ...c }) => {
3048
+ let [l, u] = Mn(r);
3049
3049
  return /* @__PURE__ */ e.createElement(Nn, {
3050
3050
  ariaLabel: t,
3051
3051
  buttonType: "button",
@@ -3054,10 +3054,10 @@ var En = ({ className: t, componentWidth: n, isLoading: r, loadingText: i = "Loa
3054
3054
  hasBorder: a,
3055
3055
  icon2Name: "check",
3056
3056
  iconName: "copy",
3057
- onClick: l,
3058
- size: "m",
3059
- variant: o,
3060
- ...s
3057
+ onClick: u,
3058
+ size: o,
3059
+ variant: s,
3060
+ ...c
3061
3061
  });
3062
3062
  }, Fn = ({ ariaLabel: t = "Close", className: n, onClick: r, size: i = "m", ...a }) => {
3063
3063
  let o = "pds-close-button", s = `${o}--${i}`, c = /* @__PURE__ */ e.createElement("button", {
@@ -4118,85 +4118,86 @@ var lr = ({ className: t = "pds-dropdown__selected-icon" }) => /* @__PURE__ */ e
4118
4118
  d: "M17 10.5V15H21.5C22.0312 15 22.5 15.4688 22.5 16C22.5 16.5625 22.0312 17 21.5 17H17V21.5C17 22.0625 16.5312 22.5 16 22.5C15.4375 22.5 15 22.0625 15 21.5V17H10.5C9.9375 17 9.5 16.5625 9.5 16C9.5 15.4688 9.9375 15 10.5 15H15V10.5C15 9.96875 15.4375 9.5 16 9.5C16.5312 9.5 17 9.96875 17 10.5Z",
4119
4119
  fill: "var(--pds-color-foreground-reverse)"
4120
4120
  }))
4121
- }, gr = ({ buttonType: t = "button", className: n = "", disabled: r = !1, isWorking: i = !1, label: a, onClick: o, platform: s, size: c = "m", tooltipText: l, ...u }) => {
4122
- let d = "pds-sso-button", f = `${d}--${c}`, p = c === "m" ? "l" : "2xl", m = c === "m" ? "l" : "xl", h = /* @__PURE__ */ e.createElement(mr, {
4123
- className: `${d}__icon`,
4124
- platformType: s,
4125
- size: p
4126
- }), g = /* @__PURE__ */ e.createElement("button", {
4121
+ }, gr = ({ buttonType: t = "button", className: n = "", disabled: r = !1, disableWhenWorking: i = !0, isWorking: a = !1, label: o, onClick: s, platform: c, size: l = "m", tooltipText: u, ...d }) => {
4122
+ let f = "pds-sso-button", p = `${f}--${l}`, m = l === "m" ? "l" : "2xl", h = l === "m" ? "l" : "xl", g = r || a && i, _ = /* @__PURE__ */ e.createElement(mr, {
4123
+ className: `${f}__icon`,
4124
+ platformType: c,
4125
+ size: m
4126
+ }), v = /* @__PURE__ */ e.createElement("button", {
4127
4127
  className: Z([
4128
- d,
4129
4128
  f,
4129
+ p,
4130
4130
  n
4131
4131
  ]),
4132
- disabled: r || i,
4133
- onClick: o,
4132
+ disabled: g,
4133
+ onClick: s,
4134
4134
  type: t,
4135
- ...u
4136
- }, h, a, i && /* @__PURE__ */ e.createElement(Cn, {
4137
- className: `${d}__working-indicator`,
4135
+ ...d
4136
+ }, _, o, a && /* @__PURE__ */ e.createElement(Cn, {
4137
+ className: `${f}__working-indicator`,
4138
4138
  color: "currentColor",
4139
- size: m
4139
+ size: h
4140
4140
  }));
4141
- return (r || i) && l ? /* @__PURE__ */ e.createElement(on, {
4141
+ return g && u ? /* @__PURE__ */ e.createElement(on, {
4142
4142
  disableTapTrigger: !0,
4143
- content: l,
4144
- customTrigger: g
4145
- }) : /* @__PURE__ */ e.createElement(e.Fragment, null, g);
4146
- }, _r = ({ buttonProps: t, className: n, disabled: i = !1, hasBorder: a = !1, iconName: o, iconPosition: c = "before", isCritical: l = !1, isLoading: u, isMonospace: d = !1, isWorking: f, label: p, linkContent: m, onClick: h, tooltipText: g, ..._ }) => {
4147
- let v = "pds-utility-button", y = u ? "pds-pulse" : null, b = (t) => o && !f ? /* @__PURE__ */ e.createElement(Q, {
4143
+ content: u,
4144
+ customTrigger: v
4145
+ }) : /* @__PURE__ */ e.createElement(e.Fragment, null, v);
4146
+ }, _r = ({ buttonProps: t, className: n, disabled: i = !1, disableWhenWorking: a = !0, hasBorder: o = !1, iconName: c, iconPosition: l = "before", isCritical: u = !1, isLoading: d, isMonospace: f = !1, isWorking: p, label: m, linkContent: h, onClick: g, tooltipText: _, ...v }) => {
4147
+ let y = "pds-utility-button", b = d ? "pds-pulse" : null, x = i || d || p && a, S = (t) => c && !p ? /* @__PURE__ */ e.createElement(Q, {
4148
4148
  key: t,
4149
- className: `${v}__icon`,
4150
- iconName: o
4151
- }) : null, x = () => f ? /* @__PURE__ */ e.createElement(Cn, {
4149
+ className: `${y}__icon`,
4150
+ iconName: c
4151
+ }) : null, C = () => p ? /* @__PURE__ */ e.createElement(Cn, {
4152
4152
  key: "spinner",
4153
- className: `${v}__spinner`,
4153
+ className: `${y}__spinner`,
4154
+ color: "currentColor",
4154
4155
  size: "m"
4155
- }) : null, S = (t) => {
4156
+ }) : null, w = (t) => {
4156
4157
  let n = [];
4157
- return c === "before" && n.push(b("icon-before")), n.push(x()), n.push(/* @__PURE__ */ e.createElement("span", {
4158
+ return l === "before" && n.push(S("icon-before")), n.push(C()), n.push(/* @__PURE__ */ e.createElement("span", {
4158
4159
  key: "label",
4159
- className: `${v}__label`
4160
- }, t)), c === "after" && n.push(b("icon-after")), n.filter(Boolean);
4161
- }, C = m && s(m) ? m.props.children : p, w = Z([
4162
- v,
4163
- a ? `${v}--border` : null,
4164
- l ? `${v}--critical` : null,
4165
- i ? `${v}--disabled` : null,
4166
- u ? `${v}--loading` : null,
4167
- f ? `${v}--working` : null,
4168
- d ? `${v}--monospace` : null,
4160
+ className: `${y}__label`
4161
+ }, t)), l === "after" && n.push(S("icon-after")), n.filter(Boolean);
4162
+ }, T = h && s(h) ? h.props.children : m, E = Z([
4163
+ y,
4164
+ o ? `${y}--border` : null,
4165
+ u ? `${y}--critical` : null,
4166
+ i ? `${y}--disabled` : null,
4167
+ d ? `${y}--loading` : null,
4168
+ p ? `${y}--working` : null,
4169
+ f ? `${y}--monospace` : null,
4169
4170
  n ?? ""
4170
- ]), T = (t) => g ? /* @__PURE__ */ e.createElement(on, {
4171
+ ]), D = (t) => _ ? /* @__PURE__ */ e.createElement(on, {
4171
4172
  disableTapTrigger: !0,
4172
- content: g,
4173
+ content: _,
4173
4174
  customTrigger: t
4174
4175
  }) : t;
4175
- if (m && !i) {
4176
- let t = s(m) ? r(m, Object.assign({}, m.props, {
4176
+ if (h && !i) {
4177
+ let t = s(h) ? r(h, Object.assign({}, h.props, {
4177
4178
  className: Z([
4178
- `${v}__button`,
4179
- y,
4180
- m.props.className ?? ""
4179
+ `${y}__button`,
4180
+ b,
4181
+ h.props.className ?? ""
4181
4182
  ]),
4182
- children: S(C)
4183
+ children: w(T)
4183
4184
  })) : null;
4184
4185
  return /* @__PURE__ */ e.createElement("div", {
4185
- className: w,
4186
- ..._
4187
- }, T(t));
4186
+ className: E,
4187
+ ...v
4188
+ }, D(t));
4188
4189
  }
4189
- let E = /* @__PURE__ */ e.createElement("button", {
4190
- className: Z([`${v}__button`, y]),
4191
- disabled: i || u || f,
4192
- onClick: h,
4190
+ let O = /* @__PURE__ */ e.createElement("button", {
4191
+ className: Z([`${y}__button`, b]),
4192
+ disabled: x,
4193
+ onClick: g,
4193
4194
  type: "button",
4194
4195
  ...t
4195
- }, S(C));
4196
+ }, w(T));
4196
4197
  return /* @__PURE__ */ e.createElement("div", {
4197
- className: w,
4198
- ..._
4199
- }, T(E));
4198
+ className: E,
4199
+ ...v
4200
+ }, D(O));
4200
4201
  }, vr = {
4201
4202
  info: "circleInfo",
4202
4203
  warning: "triangleExclamation",
@@ -12386,54 +12387,59 @@ var ns = ({ children: t, className: n, columns: r, depth: i = 0, hasChildren: a
12386
12387
  "default",
12387
12388
  "working",
12388
12389
  "checked"
12389
- ], as = ({ alignment: t = "left", className: n, componentWidth: r, labelStrings: i = {}, lastChecked: a, onCheck: o, state: s = "default", ...c }) => {
12390
- let l = {
12390
+ ], as = ({ alignment: t = "left", className: n, componentWidth: r, displayType: i = "label", labelStrings: a = {}, lastChecked: o, onCheck: s, state: c = "default", ...l }) => {
12391
+ let u = i === "icon-button", d = {
12391
12392
  checkForUpdates: "Check for updates",
12392
12393
  checking: "Checking...",
12393
12394
  checked: "Last checked",
12394
12395
  ariaLabel: "Check for updates",
12395
- ...i
12396
- }, u = () => {
12397
- switch (s) {
12398
- case "default": return l.checkForUpdates;
12399
- case "working": return l.checking;
12396
+ ...a
12397
+ }, f = () => {
12398
+ switch (c) {
12399
+ case "default": return d.checkForUpdates;
12400
+ case "working": return d.checking;
12400
12401
  case "checked":
12401
- if (a) {
12402
- let e = a instanceof Date ? a : new Date(a), t = Date.now() - e.getTime(), n = Math.floor(t / 1e3), r = Math.floor(n / 60), i = Math.floor(r / 60), o = Math.floor(i / 24), s = {
12402
+ if (o) {
12403
+ let e = o instanceof Date ? o : new Date(o), t = Date.now() - e.getTime(), n = Math.floor(t / 1e3), r = Math.floor(n / 60), i = Math.floor(r / 60), a = Math.floor(i / 24), s = {
12403
12404
  year: "numeric",
12404
12405
  month: "short",
12405
12406
  day: "numeric"
12406
12407
  }, c = "";
12407
- return c = o > 7 ? e.toLocaleDateString(void 0, s) : o > 0 && o <= 7 ? `${o} day${o === 1 ? "" : "s"} ago` : i > 0 ? `${i} hour${i === 1 ? "" : "s"} ago` : r > 0 ? `${r} minute${r === 1 ? "" : "s"} ago` : `${n} second${n === 1 ? "" : "s"} ago`, `${l.checked} ${c}`;
12408
+ return c = a > 7 ? e.toLocaleDateString(void 0, s) : a > 0 && a <= 7 ? `${a} day${a === 1 ? "" : "s"} ago` : i > 0 ? `${i} hour${i === 1 ? "" : "s"} ago` : r > 0 ? `${r} minute${r === 1 ? "" : "s"} ago` : `${n} second${n === 1 ? "" : "s"} ago`, `${d.checked} ${c}`;
12408
12409
  }
12409
- return l.checked;
12410
+ return d.checked;
12410
12411
  }
12411
- }, d = "pds-status-checker", f = `${d}--${t}`, p = Z([`${d}__button`, s === "working" ? `${d}__button--spinning` : ""]), m = r !== null && r > 0 ? `${r}rem` : "100%", h = /* @__PURE__ */ e.createElement("span", { className: `${d}__tooltip-icon` }, /* @__PURE__ */ e.createElement(Q, {
12412
- className: `${d}__icon ${s === "working" ? `${d}__icon--spinning` : ""}`,
12412
+ }, p = "pds-status-checker", m = `${p}--${t}`, h = u ? `${p}--icon-button` : "", g = Z([
12413
+ `${p}__button`,
12414
+ c === "working" ? `${p}__button--spinning` : "",
12415
+ u ? `${p}__button--icon-only` : ""
12416
+ ]), _ = u ? void 0 : r !== null && r > 0 ? `${r}rem` : "100%", v = /* @__PURE__ */ e.createElement("span", { className: `${p}__tooltip-icon` }, /* @__PURE__ */ e.createElement(Q, {
12417
+ className: `${p}__icon ${c === "working" ? `${p}__icon--spinning` : ""}`,
12413
12418
  iconName: "rotate",
12414
12419
  size: "m"
12415
- })), g = /* @__PURE__ */ e.createElement("span", { className: `${d}__label` }, u());
12420
+ })), y = /* @__PURE__ */ e.createElement("span", { className: `${p}__label` }, f());
12416
12421
  return /* @__PURE__ */ e.createElement("div", {
12417
12422
  className: Z([
12418
- d,
12419
- f,
12423
+ p,
12424
+ m,
12425
+ h,
12420
12426
  n ?? ""
12421
12427
  ]),
12422
- style: { width: m },
12423
- ...c
12428
+ style: _ ? { width: _ } : void 0,
12429
+ ...l
12424
12430
  }, /* @__PURE__ */ e.createElement("button", {
12425
- "aria-label": l.ariaLabel,
12431
+ "aria-label": d.ariaLabel,
12426
12432
  "aria-live": "polite",
12427
- className: p,
12428
- onClick: o,
12433
+ className: g,
12434
+ onClick: s,
12429
12435
  type: "button"
12430
- }, t === "right" && g, /* @__PURE__ */ e.createElement(on, {
12436
+ }, t === "right" && y, /* @__PURE__ */ e.createElement(on, {
12431
12437
  disableTapTrigger: !0,
12432
- content: l.tooltipContent || l.ariaLabel,
12433
- customTrigger: h,
12438
+ content: d.tooltipContent || d.ariaLabel,
12439
+ customTrigger: v,
12434
12440
  triggerIconColor: "default",
12435
12441
  triggerIconSize: "xs"
12436
- }), t === "left" && g));
12442
+ }), t === "left" && y));
12437
12443
  }, os = ({ className: t, label: n = null, linkContent: r, type: i = "neutral", ...a }) => {
12438
12444
  let o = "pds-status-indicator", c = `${o}--${i}`, l = /* @__PURE__ */ e.createElement(e.Fragment, null, i === "working" ? /* @__PURE__ */ e.createElement(Cn, {
12439
12445
  className: `${o}__spinner`,