@photoroom/ui 0.1.450 → 0.1.451
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.
|
@@ -2,16 +2,18 @@ import { VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Merge, PolymorphicComponent } from "../../polymorphic";
|
|
4
4
|
declare const menuItemCva: (props?: ({
|
|
5
|
-
|
|
5
|
+
leadingSlot?: "icon" | "none" | "statusDot" | null | undefined;
|
|
6
6
|
variant?: "default" | "negative" | "positive" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
type MenuItemCvaProps = VariantProps<typeof menuItemCva>;
|
|
8
|
+
type MenuItemCvaProps = Pick<VariantProps<typeof menuItemCva>, "variant">;
|
|
9
9
|
type MenuItemButtonOwnProps = Readonly<{
|
|
10
10
|
avatar?: React.ReactElement;
|
|
11
11
|
objectPreview?: React.ReactElement;
|
|
12
12
|
icon?: React.ComponentType<React.ComponentPropsWithoutRef<"svg">>;
|
|
13
13
|
leading?: React.ReactNode;
|
|
14
14
|
hideIcon?: boolean;
|
|
15
|
+
/** Semantic color token className for an 8px leading status dot, e.g. "bg-content-accent". */
|
|
16
|
+
statusDot?: `bg-content-${string}` | `bg-background-${string}`;
|
|
15
17
|
rightElement?: React.ReactNode;
|
|
16
18
|
trailingLabel?: string;
|
|
17
19
|
description?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemButton.d.ts","sourceRoot":"","sources":["../../../../src/components/collections/CommonMenu/MenuItemButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAgD,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAoB,MAAM,mBAAmB,CAAC;AAGlF,QAAA,MAAM,WAAW;;;
|
|
1
|
+
{"version":3,"file":"MenuItemButton.d.ts","sourceRoot":"","sources":["../../../../src/components/collections/CommonMenu/MenuItemButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAgD,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAoB,MAAM,mBAAmB,CAAC;AAGlF,QAAA,MAAM,WAAW;;;8EAyBhB,CAAC;AAcF,KAAK,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC;AAE1E,KAAK,sBAAsB,GAAG,QAAQ,CAAC;IACrC,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACnC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;IAClE,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,cAAc,MAAM,EAAE,GAAG,iBAAiB,MAAM,EAAE,CAAC;IAC/D,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC,GACA,gBAAgB,CAAC;AAKnB,MAAM,MAAM,mBAAmB,GAAG,KAAK,CACrC,KAAK,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EACrC,sBAAsB,CACvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAoGrB,oBAAoB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -29621,15 +29621,16 @@ XB.displayName = "MenuContent";
|
|
|
29621
29621
|
//#endregion
|
|
29622
29622
|
//#region src/components/collections/CommonMenu/MenuItemButton.tsx
|
|
29623
29623
|
var ZB = G([
|
|
29624
|
-
"component-500 misc-dropdown-inner-rounding flex w-full cursor-pointer
|
|
29624
|
+
"component-500 misc-dropdown-inner-rounding flex w-full cursor-pointer pe-3 outline-hidden",
|
|
29625
29625
|
"hover:bg-background-borderless-subdued-hover focus-visible:bg-background-borderless-subdued-hover active:bg-background-borderless-subdued-down",
|
|
29626
29626
|
"disabled:pointer-events-none disabled:opacity-30 disabled:select-none",
|
|
29627
29627
|
"aria-disabled:pointer-events-none aria-disabled:opacity-30 aria-disabled:select-none"
|
|
29628
29628
|
], {
|
|
29629
29629
|
variants: {
|
|
29630
|
-
|
|
29631
|
-
|
|
29632
|
-
|
|
29630
|
+
leadingSlot: {
|
|
29631
|
+
none: "gap-3 ps-3",
|
|
29632
|
+
icon: "gap-3 ps-2.5",
|
|
29633
|
+
statusDot: "gap-1.5 ps-1.5"
|
|
29633
29634
|
},
|
|
29634
29635
|
variant: {
|
|
29635
29636
|
default: "text-content-primary",
|
|
@@ -29637,7 +29638,10 @@ var ZB = G([
|
|
|
29637
29638
|
negative: "text-content-negative"
|
|
29638
29639
|
}
|
|
29639
29640
|
},
|
|
29640
|
-
defaultVariants: {
|
|
29641
|
+
defaultVariants: {
|
|
29642
|
+
variant: "default",
|
|
29643
|
+
leadingSlot: "none"
|
|
29644
|
+
}
|
|
29641
29645
|
}), QB = G(["icon-size-500 mt-2.5"], { variants: { variant: {
|
|
29642
29646
|
default: "text-content-secondary",
|
|
29643
29647
|
positive: "text-content-positive",
|
|
@@ -29646,52 +29650,57 @@ var ZB = G([
|
|
|
29646
29650
|
hs,
|
|
29647
29651
|
bs,
|
|
29648
29652
|
xs
|
|
29649
|
-
], eV = (({ as: e = "button", avatar: r, objectPreview: i, icon: a, leading: o, hideIcon: s,
|
|
29650
|
-
let
|
|
29653
|
+
], eV = (({ as: e = "button", avatar: r, objectPreview: i, icon: a, leading: o, hideIcon: s, statusDot: c, children: l, description: u, variant: d = "default", noWrap: f = !1, rightElement: p, trailingLabel: m, className: h, ref: g, ..._ }) => {
|
|
29654
|
+
let v = ke(() => r ? he(r, {
|
|
29651
29655
|
className: U("pointer-events-none ms-auto mt-2", r.props.className),
|
|
29652
29656
|
size: 24
|
|
29653
|
-
}) : null, [r]),
|
|
29657
|
+
}) : null, [r]), y = ke(() => i ? he(i, { className: U("bg-background-asset pointer-events-none ms-auto mt-2 h-6 w-6", i.props.className) }) : null, [i]);
|
|
29654
29658
|
return /* @__PURE__ */ n(e, {
|
|
29655
|
-
ref:
|
|
29659
|
+
ref: g,
|
|
29656
29660
|
className: ZB({
|
|
29657
|
-
variant:
|
|
29658
|
-
|
|
29659
|
-
class:
|
|
29661
|
+
variant: d,
|
|
29662
|
+
leadingSlot: c ? "statusDot" : a || o || s ? "icon" : "none",
|
|
29663
|
+
class: h
|
|
29660
29664
|
}),
|
|
29661
|
-
...
|
|
29665
|
+
..._,
|
|
29662
29666
|
children: [
|
|
29663
|
-
_,
|
|
29664
29667
|
v,
|
|
29665
|
-
|
|
29666
|
-
|
|
29668
|
+
y,
|
|
29669
|
+
c && /* @__PURE__ */ t("span", {
|
|
29670
|
+
className: "icon-size-500 mt-2.5 flex items-center justify-center",
|
|
29671
|
+
"aria-hidden": "true",
|
|
29672
|
+
children: /* @__PURE__ */ t("span", { className: U("size-2 rounded-full", c) })
|
|
29673
|
+
}),
|
|
29674
|
+
!c && a && /* @__PURE__ */ t(a, {
|
|
29675
|
+
className: QB({ variant: d }),
|
|
29667
29676
|
"aria-hidden": "true"
|
|
29668
29677
|
}),
|
|
29669
|
-
!a && o && /* @__PURE__ */ t("span", {
|
|
29678
|
+
!c && !a && o && /* @__PURE__ */ t("span", {
|
|
29670
29679
|
className: "icon-size-500 mt-2.5 flex items-center justify-center",
|
|
29671
29680
|
"aria-hidden": "true",
|
|
29672
29681
|
children: o
|
|
29673
29682
|
}),
|
|
29674
|
-
!a && !o && s && /* @__PURE__ */ t("span", {
|
|
29683
|
+
!c && !a && !o && s && /* @__PURE__ */ t("span", {
|
|
29675
29684
|
className: "icon-size-500 mt-2.5",
|
|
29676
29685
|
"aria-hidden": "true"
|
|
29677
29686
|
}),
|
|
29678
29687
|
/* @__PURE__ */ n("div", {
|
|
29679
|
-
className: U("flex flex-1 flex-col gap-0.5 py-[11px] text-start",
|
|
29688
|
+
className: U("flex flex-1 flex-col gap-0.5 py-[11px] text-start", f && "truncate"),
|
|
29680
29689
|
children: [/* @__PURE__ */ t("div", {
|
|
29681
|
-
className: U(
|
|
29682
|
-
children: c
|
|
29683
|
-
}), !r && l && /* @__PURE__ */ t("div", {
|
|
29684
|
-
className: U("component-300 text-content-tertiary", d && "truncate"),
|
|
29690
|
+
className: U(f && "truncate"),
|
|
29685
29691
|
children: l
|
|
29692
|
+
}), !r && u && /* @__PURE__ */ t("div", {
|
|
29693
|
+
className: U("component-300 text-content-tertiary", f && "truncate"),
|
|
29694
|
+
children: u
|
|
29686
29695
|
})]
|
|
29687
29696
|
}),
|
|
29688
|
-
|
|
29689
|
-
className: U("ms-auto", ye(
|
|
29690
|
-
children:
|
|
29697
|
+
p && /* @__PURE__ */ t("div", {
|
|
29698
|
+
className: U("ms-auto", ye(p) && $B.includes(p.type) ? "mt-2.5" : "mt-2"),
|
|
29699
|
+
children: p
|
|
29691
29700
|
}),
|
|
29692
|
-
|
|
29701
|
+
m && /* @__PURE__ */ t("span", {
|
|
29693
29702
|
className: "text-content-secondary shrink-0 self-center whitespace-nowrap",
|
|
29694
|
-
children:
|
|
29703
|
+
children: m
|
|
29695
29704
|
})
|
|
29696
29705
|
]
|
|
29697
29706
|
});
|