@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/components/StatusChecker/StatusChecker.d.ts +8 -1
- package/dist/components/buttons/Button/Button.d.ts +11 -1
- package/dist/components/buttons/ClipboardButton/ClipboardButton.d.ts +6 -1
- package/dist/components/buttons/IconButton/IconButton.d.ts +1 -1
- package/dist/components/buttons/SSOButton/SSOButton.d.ts +7 -1
- package/dist/components/buttons/UtilityButton/UtilityButton.d.ts +10 -2
- package/dist/components/icons/Icon/generated-icon-data.d.ts +1 -1
- package/dist/css/component-css/pds-button.css +1 -1
- package/dist/css/component-css/pds-index.css +4 -4
- package/dist/css/component-css/pds-status-checker.css +1 -1
- package/dist/css/component-css/pds-table.css +3 -3
- package/dist/css/pds-components.css +4 -4
- package/dist/index.css +1 -1
- package/dist/index.js +132 -126
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
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,
|
|
2844
|
-
let
|
|
2845
|
-
switch (
|
|
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
|
-
|
|
2847
|
+
O = "xs", k = "s", A = "xs";
|
|
2848
2848
|
break;
|
|
2849
2849
|
case "s":
|
|
2850
|
-
|
|
2850
|
+
O = "m", k = "m", A = "xs";
|
|
2851
2851
|
break;
|
|
2852
2852
|
case "m":
|
|
2853
|
-
|
|
2853
|
+
O = "m", k = "m", A = "s";
|
|
2854
2854
|
break;
|
|
2855
2855
|
case "l":
|
|
2856
|
-
|
|
2856
|
+
O = "xl", k = "l", A = "m";
|
|
2857
2857
|
break;
|
|
2858
2858
|
}
|
|
2859
|
-
let
|
|
2859
|
+
let j = [
|
|
2860
2860
|
"primary",
|
|
2861
2861
|
"secondary",
|
|
2862
2862
|
"subtle",
|
|
2863
2863
|
"highlight"
|
|
2864
|
-
],
|
|
2865
|
-
|
|
2866
|
-
let
|
|
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
|
-
],
|
|
2871
|
-
|
|
2872
|
-
let
|
|
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: `${
|
|
2875
|
-
iconName:
|
|
2876
|
-
size:
|
|
2877
|
-
}),
|
|
2878
|
-
|
|
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: `${
|
|
2881
|
-
status:
|
|
2882
|
-
})) :
|
|
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: `${
|
|
2885
|
-
label:
|
|
2886
|
-
size:
|
|
2887
|
-
type:
|
|
2888
|
-
})) :
|
|
2889
|
-
let
|
|
2890
|
-
ref:
|
|
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:
|
|
2902
|
-
onClick:
|
|
2901
|
+
disabled: D,
|
|
2902
|
+
onClick: p,
|
|
2903
2903
|
type: n,
|
|
2904
|
-
...
|
|
2905
|
-
},
|
|
2906
|
-
className: `${
|
|
2904
|
+
...y
|
|
2905
|
+
}, d && !l && /* @__PURE__ */ e.createElement(Cn, {
|
|
2906
|
+
className: `${x}__working-indicator`,
|
|
2907
2907
|
color: "currentColor",
|
|
2908
|
-
size:
|
|
2909
|
-
}),
|
|
2910
|
-
return
|
|
2908
|
+
size: k
|
|
2909
|
+
}), I);
|
|
2910
|
+
return D && _ ? /* @__PURE__ */ e.createElement(on, {
|
|
2911
2911
|
disableTapTrigger: !0,
|
|
2912
|
-
content:
|
|
2913
|
-
customTrigger:
|
|
2914
|
-
}) : /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
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,
|
|
3048
|
-
let [
|
|
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:
|
|
3058
|
-
size:
|
|
3059
|
-
variant:
|
|
3060
|
-
...
|
|
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,
|
|
4122
|
-
let
|
|
4123
|
-
className: `${
|
|
4124
|
-
platformType:
|
|
4125
|
-
size:
|
|
4126
|
-
}),
|
|
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:
|
|
4133
|
-
onClick:
|
|
4132
|
+
disabled: g,
|
|
4133
|
+
onClick: s,
|
|
4134
4134
|
type: t,
|
|
4135
|
-
...
|
|
4136
|
-
},
|
|
4137
|
-
className: `${
|
|
4135
|
+
...d
|
|
4136
|
+
}, _, o, a && /* @__PURE__ */ e.createElement(Cn, {
|
|
4137
|
+
className: `${f}__working-indicator`,
|
|
4138
4138
|
color: "currentColor",
|
|
4139
|
-
size:
|
|
4139
|
+
size: h
|
|
4140
4140
|
}));
|
|
4141
|
-
return
|
|
4141
|
+
return g && u ? /* @__PURE__ */ e.createElement(on, {
|
|
4142
4142
|
disableTapTrigger: !0,
|
|
4143
|
-
content:
|
|
4144
|
-
customTrigger:
|
|
4145
|
-
}) : /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
4146
|
-
}, _r = ({ buttonProps: t, className: n, disabled: i = !1,
|
|
4147
|
-
let
|
|
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: `${
|
|
4150
|
-
iconName:
|
|
4151
|
-
}) : null,
|
|
4149
|
+
className: `${y}__icon`,
|
|
4150
|
+
iconName: c
|
|
4151
|
+
}) : null, C = () => p ? /* @__PURE__ */ e.createElement(Cn, {
|
|
4152
4152
|
key: "spinner",
|
|
4153
|
-
className: `${
|
|
4153
|
+
className: `${y}__spinner`,
|
|
4154
|
+
color: "currentColor",
|
|
4154
4155
|
size: "m"
|
|
4155
|
-
}) : null,
|
|
4156
|
+
}) : null, w = (t) => {
|
|
4156
4157
|
let n = [];
|
|
4157
|
-
return
|
|
4158
|
+
return l === "before" && n.push(S("icon-before")), n.push(C()), n.push(/* @__PURE__ */ e.createElement("span", {
|
|
4158
4159
|
key: "label",
|
|
4159
|
-
className: `${
|
|
4160
|
-
}, t)),
|
|
4161
|
-
},
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
i ? `${
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
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
|
-
]),
|
|
4171
|
+
]), D = (t) => _ ? /* @__PURE__ */ e.createElement(on, {
|
|
4171
4172
|
disableTapTrigger: !0,
|
|
4172
|
-
content:
|
|
4173
|
+
content: _,
|
|
4173
4174
|
customTrigger: t
|
|
4174
4175
|
}) : t;
|
|
4175
|
-
if (
|
|
4176
|
-
let t = s(
|
|
4176
|
+
if (h && !i) {
|
|
4177
|
+
let t = s(h) ? r(h, Object.assign({}, h.props, {
|
|
4177
4178
|
className: Z([
|
|
4178
|
-
`${
|
|
4179
|
-
|
|
4180
|
-
|
|
4179
|
+
`${y}__button`,
|
|
4180
|
+
b,
|
|
4181
|
+
h.props.className ?? ""
|
|
4181
4182
|
]),
|
|
4182
|
-
children:
|
|
4183
|
+
children: w(T)
|
|
4183
4184
|
})) : null;
|
|
4184
4185
|
return /* @__PURE__ */ e.createElement("div", {
|
|
4185
|
-
className:
|
|
4186
|
-
...
|
|
4187
|
-
},
|
|
4186
|
+
className: E,
|
|
4187
|
+
...v
|
|
4188
|
+
}, D(t));
|
|
4188
4189
|
}
|
|
4189
|
-
let
|
|
4190
|
-
className: Z([`${
|
|
4191
|
-
disabled:
|
|
4192
|
-
onClick:
|
|
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
|
-
},
|
|
4196
|
+
}, w(T));
|
|
4196
4197
|
return /* @__PURE__ */ e.createElement("div", {
|
|
4197
|
-
className:
|
|
4198
|
-
...
|
|
4199
|
-
},
|
|
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,
|
|
12390
|
-
let
|
|
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
|
-
...
|
|
12396
|
-
},
|
|
12397
|
-
switch (
|
|
12398
|
-
case "default": return
|
|
12399
|
-
case "working": return
|
|
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 (
|
|
12402
|
-
let e =
|
|
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 =
|
|
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
|
|
12410
|
+
return d.checked;
|
|
12410
12411
|
}
|
|
12411
|
-
},
|
|
12412
|
-
|
|
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
|
-
})),
|
|
12420
|
+
})), y = /* @__PURE__ */ e.createElement("span", { className: `${p}__label` }, f());
|
|
12416
12421
|
return /* @__PURE__ */ e.createElement("div", {
|
|
12417
12422
|
className: Z([
|
|
12418
|
-
|
|
12419
|
-
|
|
12423
|
+
p,
|
|
12424
|
+
m,
|
|
12425
|
+
h,
|
|
12420
12426
|
n ?? ""
|
|
12421
12427
|
]),
|
|
12422
|
-
style: { width:
|
|
12423
|
-
...
|
|
12428
|
+
style: _ ? { width: _ } : void 0,
|
|
12429
|
+
...l
|
|
12424
12430
|
}, /* @__PURE__ */ e.createElement("button", {
|
|
12425
|
-
"aria-label":
|
|
12431
|
+
"aria-label": d.ariaLabel,
|
|
12426
12432
|
"aria-live": "polite",
|
|
12427
|
-
className:
|
|
12428
|
-
onClick:
|
|
12433
|
+
className: g,
|
|
12434
|
+
onClick: s,
|
|
12429
12435
|
type: "button"
|
|
12430
|
-
}, t === "right" &&
|
|
12436
|
+
}, t === "right" && y, /* @__PURE__ */ e.createElement(on, {
|
|
12431
12437
|
disableTapTrigger: !0,
|
|
12432
|
-
content:
|
|
12433
|
-
customTrigger:
|
|
12438
|
+
content: d.tooltipContent || d.ariaLabel,
|
|
12439
|
+
customTrigger: v,
|
|
12434
12440
|
triggerIconColor: "default",
|
|
12435
12441
|
triggerIconSize: "xs"
|
|
12436
|
-
}), t === "left" &&
|
|
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`,
|