@lax-wp/design-system 0.8.26 → 0.8.27
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/button/Button.d.ts +1 -0
- package/dist/index.es.js +30 -27
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ export interface IButtonProps {
|
|
|
16
16
|
type?: 'button' | 'submit' | 'reset';
|
|
17
17
|
options?: ItemType[];
|
|
18
18
|
tooltip?: string;
|
|
19
|
+
autoFocus?: boolean;
|
|
19
20
|
tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
|
|
20
21
|
/** Array of keyboard shortcut keys to display inline in the button (e.g., ['Meta', 'S'] or ['Ctrl', 'Enter']) */
|
|
21
22
|
shortcuts?: string[];
|
package/dist/index.es.js
CHANGED
|
@@ -6245,27 +6245,28 @@ const Dt = ({
|
|
|
6245
6245
|
tooltipPlacement: p = "top",
|
|
6246
6246
|
shortcuts: m,
|
|
6247
6247
|
tooltipShortcuts: b,
|
|
6248
|
-
theme: g = "light"
|
|
6248
|
+
theme: g = "light",
|
|
6249
|
+
autoFocus: x
|
|
6249
6250
|
}) => {
|
|
6250
|
-
const
|
|
6251
|
+
const v = ve(() => {
|
|
6251
6252
|
switch (e) {
|
|
6252
6253
|
case "outline":
|
|
6253
|
-
return w();
|
|
6254
|
-
case "ghost":
|
|
6255
6254
|
return P();
|
|
6256
|
-
case "
|
|
6255
|
+
case "ghost":
|
|
6257
6256
|
return S();
|
|
6257
|
+
case "dashed":
|
|
6258
|
+
return C();
|
|
6258
6259
|
default:
|
|
6259
|
-
return
|
|
6260
|
+
return w();
|
|
6260
6261
|
}
|
|
6261
|
-
}, [e, A, r, g]),
|
|
6262
|
+
}, [e, A, r, g]), y = ve(() => {
|
|
6262
6263
|
switch (e) {
|
|
6263
6264
|
case "dashed":
|
|
6264
|
-
return
|
|
6265
|
+
return O();
|
|
6265
6266
|
default:
|
|
6266
6267
|
return {};
|
|
6267
6268
|
}
|
|
6268
|
-
}, [e, A, r, g]),
|
|
6269
|
+
}, [e, A, r, g]), w = ve(() => {
|
|
6269
6270
|
switch (A) {
|
|
6270
6271
|
case "primary":
|
|
6271
6272
|
return "bg-primary-600 text-white focus:border-primary-200 hover:bg-primary-700 disabled:opacity-60";
|
|
@@ -6288,7 +6289,7 @@ const Dt = ({
|
|
|
6288
6289
|
default:
|
|
6289
6290
|
return "bg-white dark:bg-black-800 text-neutral-900 dark:text-white border-white border hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60";
|
|
6290
6291
|
}
|
|
6291
|
-
}, [A, r, g]),
|
|
6292
|
+
}, [A, r, g]), P = ve(() => {
|
|
6292
6293
|
switch (A) {
|
|
6293
6294
|
case "primary":
|
|
6294
6295
|
return "text-primary-700 dark:text-primary-600 border-primary-700 border dark:border-primary-600 hover:bg-primary-100 disabled:opacity-60";
|
|
@@ -6305,7 +6306,7 @@ const Dt = ({
|
|
|
6305
6306
|
default:
|
|
6306
6307
|
return "bg-white dark:bg-black-800 text-neutral-900 dark:text-white border-neutral-300 dark:border-neutral-700 border hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60";
|
|
6307
6308
|
}
|
|
6308
|
-
}, [A, g]),
|
|
6309
|
+
}, [A, g]), S = ve(() => {
|
|
6309
6310
|
switch (A) {
|
|
6310
6311
|
case "primary":
|
|
6311
6312
|
return "text-primary-700 dark:text-primary-600 border border-transparent dark:border-transparent hover:text-primary-700 disabled:opacity-60";
|
|
@@ -6320,14 +6321,14 @@ const Dt = ({
|
|
|
6320
6321
|
default:
|
|
6321
6322
|
return "text-neutral-900 dark:text-white border border-transparent dark:border-transparent hover:text-[#667085] disabled:opacity-60";
|
|
6322
6323
|
}
|
|
6323
|
-
}, [A, g]),
|
|
6324
|
+
}, [A, g]), C = ve(() => {
|
|
6324
6325
|
switch (A) {
|
|
6325
6326
|
case "primary":
|
|
6326
6327
|
return "bg-primary-50 dark:bg-black-700 text-primary-600 dark:text-primary-600 disabled:text-primary-100 hover:bg-primary-100 dark:hover:bg-black-600";
|
|
6327
6328
|
default:
|
|
6328
6329
|
return "bg-primary-50 dark:bg-black-700 text-primary-600 dark:text-primary-600 disabled:text-primary-100 hover:bg-primary-100 dark:hover:bg-black-600";
|
|
6329
6330
|
}
|
|
6330
|
-
}, [A, g]),
|
|
6331
|
+
}, [A, g]), O = ve(() => {
|
|
6331
6332
|
switch (A) {
|
|
6332
6333
|
case "primary":
|
|
6333
6334
|
return {
|
|
@@ -6339,7 +6340,7 @@ const Dt = ({
|
|
|
6339
6340
|
default:
|
|
6340
6341
|
return {};
|
|
6341
6342
|
}
|
|
6342
|
-
}, [A, g]),
|
|
6343
|
+
}, [A, g]), D = ve(() => {
|
|
6343
6344
|
if (!e || e === "filled")
|
|
6344
6345
|
switch (A) {
|
|
6345
6346
|
case "primary":
|
|
@@ -6377,10 +6378,10 @@ const Dt = ({
|
|
|
6377
6378
|
default:
|
|
6378
6379
|
return "bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-neutral-400";
|
|
6379
6380
|
}
|
|
6380
|
-
}, [A, e]),
|
|
6381
|
-
const
|
|
6382
|
-
return
|
|
6383
|
-
}) : [], [m,
|
|
6381
|
+
}, [A, e]), H = ua(), Q = Oe(() => m?.length ? m.map((M) => {
|
|
6382
|
+
const z = wd[M];
|
|
6383
|
+
return z ? H === "macos" ? z.macos : z.other : M;
|
|
6384
|
+
}) : [], [m, H]), L = () => /* @__PURE__ */ l(Ee, { children: /* @__PURE__ */ l(md, { size: 24, className: "inline mr-2 spinner" }) }), N = u || (A === "primary" ? "submit" : u);
|
|
6384
6385
|
return /* @__PURE__ */ l(Se, { title: f, placement: p, shortcuts: b, delayShow: !0, children: /* @__PURE__ */ k(
|
|
6385
6386
|
"button",
|
|
6386
6387
|
{
|
|
@@ -6401,27 +6402,28 @@ const Dt = ({
|
|
|
6401
6402
|
gap-1.5
|
|
6402
6403
|
relative
|
|
6403
6404
|
max-h-[32px]
|
|
6404
|
-
${
|
|
6405
|
+
${v()}
|
|
6405
6406
|
`,
|
|
6406
|
-
style: { ...
|
|
6407
|
+
style: { ...y() },
|
|
6407
6408
|
disabled: r || i,
|
|
6408
6409
|
id: o,
|
|
6409
6410
|
onClick: a,
|
|
6410
6411
|
onKeyDown: c,
|
|
6411
6412
|
title: s,
|
|
6412
|
-
type:
|
|
6413
|
+
type: N,
|
|
6414
|
+
autoFocus: x,
|
|
6413
6415
|
children: [
|
|
6414
|
-
i &&
|
|
6416
|
+
i && L(),
|
|
6415
6417
|
n,
|
|
6416
|
-
|
|
6418
|
+
Q.length > 0 ? /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-0.5 ml-1 flex-shrink-0", children: Q.map((M, z) => /* @__PURE__ */ l(
|
|
6417
6419
|
"kbd",
|
|
6418
6420
|
{
|
|
6419
|
-
className: `inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none ${
|
|
6420
|
-
children:
|
|
6421
|
+
className: `inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none ${D()}`,
|
|
6422
|
+
children: M
|
|
6421
6423
|
},
|
|
6422
|
-
|
|
6424
|
+
z
|
|
6423
6425
|
)) }) : null,
|
|
6424
|
-
h?.length ? /* @__PURE__ */ l("div", { onClick: (
|
|
6426
|
+
h?.length ? /* @__PURE__ */ l("div", { onClick: (M) => M.stopPropagation(), children: /* @__PURE__ */ l(
|
|
6425
6427
|
mr,
|
|
6426
6428
|
{
|
|
6427
6429
|
menu: {
|
|
@@ -7436,6 +7438,7 @@ const C0 = _i(null), C6 = C0.Provider, ts = () => {
|
|
|
7436
7438
|
onClick: n,
|
|
7437
7439
|
isLoading: i,
|
|
7438
7440
|
status: s === "destructive" ? "error" : "primary",
|
|
7441
|
+
autoFocus: !0,
|
|
7439
7442
|
children: a || (s === "destructive" ? "Delete" : "Confirm")
|
|
7440
7443
|
}
|
|
7441
7444
|
)
|