@photon-ai/pho-ui 4.16.2 → 4.18.0
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/chunks/{basic-page-C0C8NDjG.js → basic-page-Bfcda8w5.js} +418 -400
- package/dist/chunks/basic-page-Bfcda8w5.js.map +1 -0
- package/dist/chunks/{code-block-CbcE994O.js → code-block-DekLMMtV.js} +2 -2
- package/dist/chunks/{code-block-CbcE994O.js.map → code-block-DekLMMtV.js.map} +1 -1
- package/dist/chunks/copy-button-BmGshaq9.js +76 -0
- package/dist/chunks/copy-button-BmGshaq9.js.map +1 -0
- package/dist/chunks/{data-table-hzZb7Otx.js → data-table-T4QKnrxQ.js} +30 -30
- package/dist/chunks/data-table-T4QKnrxQ.js.map +1 -0
- package/dist/chunks/description-list-BRRQ0oF6.js +60 -0
- package/dist/chunks/description-list-BRRQ0oF6.js.map +1 -0
- package/dist/chunks/{filter-bar-yEcG2pBm.js → filter-bar-BCiaO1gO.js} +2 -2
- package/dist/chunks/{filter-bar-yEcG2pBm.js.map → filter-bar-BCiaO1gO.js.map} +1 -1
- package/dist/chunks/menu-CoMrYnd1.js +264 -0
- package/dist/chunks/menu-CoMrYnd1.js.map +1 -0
- package/dist/components/code-block.js +1 -1
- package/dist/components/context-menu.js +38 -37
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/menu.js +5 -4
- package/dist/components/scope.js +88 -84
- package/dist/components/scope.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/sections/basic-page.js +2 -2
- package/dist/src/components/copy-button/copy-button.d.ts +15 -4
- package/dist/src/components/description-list/description-list.d.ts +3 -2
- package/dist/src/components/menu/index.d.ts +1 -1
- package/dist/src/components/menu/menu-pending.d.ts +26 -0
- package/dist/src/sections/basic-page/basic-page.d.ts +13 -3
- package/dist/src/sections/basic-page/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/basic-page-C0C8NDjG.js.map +0 -1
- package/dist/chunks/copy-button-D8XyP0oR.js +0 -56
- package/dist/chunks/copy-button-D8XyP0oR.js.map +0 -1
- package/dist/chunks/data-table-hzZb7Otx.js.map +0 -1
- package/dist/chunks/description-list-8qm83WZB.js +0 -59
- package/dist/chunks/description-list-8qm83WZB.js.map +0 -1
- package/dist/chunks/menu-BQeprfxB.js +0 -208
- package/dist/chunks/menu-BQeprfxB.js.map +0 -1
|
@@ -1,79 +1,80 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t } from "../chunks/cn-ChIgwEl3.js";
|
|
2
|
+
import { t as a } from "../chunks/cn-ChIgwEl3.js";
|
|
3
3
|
import { t as v } from "../chunks/resolve-variant-CcD8iG5l.js";
|
|
4
|
-
import {
|
|
4
|
+
import { l as x, n as M, o as P, r as h, s as N, t as i } from "../chunks/menu-CoMrYnd1.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { Separator as
|
|
6
|
+
import { Fragment as S, jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { Separator as R } from "@base-ui/react/separator";
|
|
8
8
|
import { ContextMenu as e } from "@base-ui/react/context-menu";
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
className:
|
|
9
|
+
var y = x(e.Root), G = e.Trigger, I = e.Portal, T = e.Group, C = e.RadioGroup, E = e.SubmenuRoot;
|
|
10
|
+
function U({ className: r, ...o }) {
|
|
11
|
+
return /* @__PURE__ */ t(e.Positioner, {
|
|
12
|
+
className: a("z-50", r),
|
|
13
13
|
...o
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
className:
|
|
16
|
+
function _({ className: r, ...o }) {
|
|
17
|
+
return /* @__PURE__ */ t(e.Popup, {
|
|
18
|
+
className: a(h, r),
|
|
19
19
|
...o
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const { inert: n, blocked: f, handleClick: g } =
|
|
24
|
-
onClick:
|
|
25
|
-
closeOnClick:
|
|
26
|
-
loading:
|
|
22
|
+
function k({ className: r, color: o = "default", onClick: p, closeOnClick: s = !0, loading: m = !1, disabled: l = !1, children: c, ...d }) {
|
|
23
|
+
const { inert: n, blocked: f, handleClick: g, blinkProps: b } = N({
|
|
24
|
+
onClick: p,
|
|
25
|
+
closeOnClick: s,
|
|
26
|
+
loading: m,
|
|
27
27
|
disabled: l
|
|
28
28
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
className:
|
|
31
|
-
closeOnClick:
|
|
29
|
+
return /* @__PURE__ */ u(e.Item, {
|
|
30
|
+
className: a(i, v(M, o), r),
|
|
31
|
+
closeOnClick: s,
|
|
32
32
|
disabled: f,
|
|
33
33
|
"data-loading": n || void 0,
|
|
34
34
|
"aria-busy": n || void 0,
|
|
35
|
+
...b,
|
|
35
36
|
onClick: g,
|
|
36
37
|
...d,
|
|
37
|
-
children: [n ? /* @__PURE__ */
|
|
38
|
+
children: [n ? /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ t(P, {}), /* @__PURE__ */ t("output", {
|
|
38
39
|
className: "sr-only",
|
|
39
40
|
"aria-live": "polite"
|
|
40
41
|
})] }) : null, c]
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
function L({ className: r, ...o }) {
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
className:
|
|
45
|
+
return /* @__PURE__ */ t(e.GroupLabel, {
|
|
46
|
+
className: a("text-pho-secondary px-2.5 py-1.5 text-xs font-medium", r),
|
|
46
47
|
...o
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
function $({ className: r, ...o }) {
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
className:
|
|
51
|
+
return /* @__PURE__ */ t(R, {
|
|
52
|
+
className: a("-mx-1.5 my-1.5 h-px bg-[var(--border-color-pho-secondary)]", r),
|
|
52
53
|
...o
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
function j({ className: r, ...o }) {
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
className:
|
|
57
|
+
return /* @__PURE__ */ t(e.SubmenuTrigger, {
|
|
58
|
+
className: a(i, "data-[popup-open]:bg-pho-ghost-hover", r),
|
|
58
59
|
...o
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
var
|
|
62
|
-
Root:
|
|
63
|
-
Trigger:
|
|
64
|
-
Portal:
|
|
65
|
-
Positioner:
|
|
66
|
-
Popup:
|
|
67
|
-
Item:
|
|
68
|
-
Group:
|
|
62
|
+
var B = {
|
|
63
|
+
Root: y,
|
|
64
|
+
Trigger: G,
|
|
65
|
+
Portal: I,
|
|
66
|
+
Positioner: U,
|
|
67
|
+
Popup: _,
|
|
68
|
+
Item: k,
|
|
69
|
+
Group: T,
|
|
69
70
|
GroupLabel: L,
|
|
70
71
|
Separator: $,
|
|
71
|
-
SubmenuRoot:
|
|
72
|
+
SubmenuRoot: E,
|
|
72
73
|
SubmenuTrigger: j,
|
|
73
|
-
RadioGroup:
|
|
74
|
+
RadioGroup: C
|
|
74
75
|
};
|
|
75
76
|
export {
|
|
76
|
-
|
|
77
|
+
B as ContextMenu
|
|
77
78
|
};
|
|
78
79
|
|
|
79
80
|
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":[],"sources":["../../src/components/context-menu/context-menu.tsx"],"sourcesContent":["import {\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n} from \"react\";\nimport { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant } from \"../../utils/resolve-variant\";\nimport {\n MENU_POPUP,\n MENU_ITEM,\n MENU_ITEM_COLORS,\n type MenuItemColor,\n} from \"../menu/menu\";\nimport {\n MenuItemSpinner,\n useAsyncMenuItem,\n withMenuPendingRoot,\n type AsyncMenuItemClick,\n} from \"../menu/menu-pending\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\" | \"color\"\n> & {\n className?: string;\n};\n\ntype ContextMenuItemProps = Omit<\n StyledProps<typeof BaseContextMenu.Item>,\n \"onClick\"\n> & {\n /** Semantic ink. @default \"default\" */\n color?: MenuItemColor;\n /**\n * Action handler. Return a promise to keep the menu open while it runs —\n * same behavior as `Menu.Item`.\n */\n onClick?: AsyncMenuItemClick;\n /** Declarative loading state. @default false */\n loading?: boolean;\n};\n\nconst Root = withMenuPendingRoot(BaseContextMenu.Root);\nconst Trigger = BaseContextMenu.Trigger;\nconst Portal = BaseContextMenu.Portal;\nconst Group = BaseContextMenu.Group;\nconst RadioGroup = BaseContextMenu.RadioGroup;\n// Don't wrap SubmenuRoot — nested pending context would shadow the parent\n// Root and fail to lock dismissal for async items inside a submenu.\nconst SubmenuRoot = BaseContextMenu.SubmenuRoot;\n\nfunction Positioner({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.Positioner>) {\n return (\n <BaseContextMenu.Positioner className={cn(\"z-50\", className)} {...props} />\n );\n}\n\nfunction Popup({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.Popup>) {\n return (\n <BaseContextMenu.Popup className={cn(MENU_POPUP, className)} {...props} />\n );\n}\n\nfunction Item({\n className,\n color = \"default\",\n onClick,\n closeOnClick = true,\n loading = false,\n disabled = false,\n children,\n ...props\n}: ContextMenuItemProps) {\n const { inert, blocked, handleClick } = useAsyncMenuItem({\n onClick,\n closeOnClick,\n loading,\n disabled,\n });\n\n return (\n <BaseContextMenu.Item\n className={cn(\n MENU_ITEM,\n resolveVariant(MENU_ITEM_COLORS, color),\n className,\n )}\n closeOnClick={closeOnClick}\n disabled={blocked}\n data-loading={inert || undefined}\n aria-busy={inert || undefined}\n onClick={handleClick as (event: ReactMouseEvent<HTMLElement>) => void}\n {...props}\n >\n {inert ? (\n <>\n <MenuItemSpinner />\n <output className=\"sr-only\" aria-live=\"polite\" />\n </>\n ) : null}\n {children}\n </BaseContextMenu.Item>\n );\n}\n\nfunction GroupLabel({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.GroupLabel>) {\n return (\n <BaseContextMenu.GroupLabel\n className={cn(\n \"text-pho-secondary px-2.5 py-1.5 text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Separator({ className, ...props }: StyledProps<typeof BaseSeparator>) {\n return (\n <BaseSeparator\n className={cn(\n \"-mx-1.5 my-1.5 h-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SubmenuTrigger({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.SubmenuTrigger>) {\n return (\n <BaseContextMenu.SubmenuTrigger\n className={cn(\n MENU_ITEM,\n \"data-[popup-open]:bg-pho-ghost-hover\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Right-click (context) menu built on Base UI `ContextMenu`. `ContextMenu.Trigger`\n * wraps the area that opens the menu on right-click / long-press; the popup\n * shares its look with `Menu`. `ContextMenu.Item` has the same native promise\n * support as `Menu.Item`. Always mirror these actions somewhere visible —\n * a context menu must not be the only way to reach them.\n */\nexport const ContextMenu = {\n Root,\n Trigger,\n Portal,\n Positioner,\n Popup,\n Item,\n Group,\n GroupLabel,\n Separator,\n SubmenuRoot,\n SubmenuTrigger,\n RadioGroup,\n};\n"],"mappings":";;;;;;;;AA6CA,IAAM,IAAO,EAAoB,EAAgB,IAAI,GAC/C,IAAU,EAAgB,SAC1B,IAAS,EAAgB,QACzB,IAAQ,EAAgB,OACxB,IAAa,EAAgB,YAG7B,IAAc,EAAgB;AAEpC,SAAS,EAAW,EAClB,WAAA,GACA,GAAG,EAAA,GAC8C;AACjD,SACE,gBAAA,EAAC,EAAgB,YAAjB;AAAA,IAA4B,WAAW,EAAG,QAAQ,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAgB,OAAjB;AAAA,IAAuB,WAAW,EAAG,GAAY,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE7E;AAEA,SAAS,EAAK,EACZ,WAAA,GACA,OAAA,IAAQ,WACR,SAAA,GACA,cAAA,IAAe,IACf,SAAA,IAAU,IACV,UAAA,IAAW,IACX,UAAA,GACA,GAAG,EAAA,GACoB;AACvB,QAAM,EAAE,OAAA,GAAO,SAAA,GAAS,aAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":[],"sources":["../../src/components/context-menu/context-menu.tsx"],"sourcesContent":["import {\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n} from \"react\";\nimport { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant } from \"../../utils/resolve-variant\";\nimport {\n MENU_POPUP,\n MENU_ITEM,\n MENU_ITEM_COLORS,\n type MenuItemColor,\n} from \"../menu/menu\";\nimport {\n MenuItemSpinner,\n useAsyncMenuItem,\n withMenuPendingRoot,\n type AsyncMenuItemClick,\n} from \"../menu/menu-pending\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\" | \"color\"\n> & {\n className?: string;\n};\n\ntype ContextMenuItemProps = Omit<\n StyledProps<typeof BaseContextMenu.Item>,\n \"onClick\"\n> & {\n /** Semantic ink. @default \"default\" */\n color?: MenuItemColor;\n /**\n * Action handler. Return a promise to keep the menu open while it runs —\n * same behavior as `Menu.Item`.\n */\n onClick?: AsyncMenuItemClick;\n /** Declarative loading state. @default false */\n loading?: boolean;\n};\n\nconst Root = withMenuPendingRoot(BaseContextMenu.Root);\nconst Trigger = BaseContextMenu.Trigger;\nconst Portal = BaseContextMenu.Portal;\nconst Group = BaseContextMenu.Group;\nconst RadioGroup = BaseContextMenu.RadioGroup;\n// Don't wrap SubmenuRoot — nested pending context would shadow the parent\n// Root and fail to lock dismissal for async items inside a submenu.\nconst SubmenuRoot = BaseContextMenu.SubmenuRoot;\n\nfunction Positioner({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.Positioner>) {\n return (\n <BaseContextMenu.Positioner className={cn(\"z-50\", className)} {...props} />\n );\n}\n\nfunction Popup({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.Popup>) {\n return (\n <BaseContextMenu.Popup className={cn(MENU_POPUP, className)} {...props} />\n );\n}\n\nfunction Item({\n className,\n color = \"default\",\n onClick,\n closeOnClick = true,\n loading = false,\n disabled = false,\n children,\n ...props\n}: ContextMenuItemProps) {\n const { inert, blocked, handleClick, blinkProps } = useAsyncMenuItem({\n onClick,\n closeOnClick,\n loading,\n disabled,\n });\n\n return (\n <BaseContextMenu.Item\n className={cn(\n MENU_ITEM,\n resolveVariant(MENU_ITEM_COLORS, color),\n className,\n )}\n closeOnClick={closeOnClick}\n disabled={blocked}\n data-loading={inert || undefined}\n aria-busy={inert || undefined}\n {...blinkProps}\n onClick={handleClick as (event: ReactMouseEvent<HTMLElement>) => void}\n {...props}\n >\n {inert ? (\n <>\n <MenuItemSpinner />\n <output className=\"sr-only\" aria-live=\"polite\" />\n </>\n ) : null}\n {children}\n </BaseContextMenu.Item>\n );\n}\n\nfunction GroupLabel({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.GroupLabel>) {\n return (\n <BaseContextMenu.GroupLabel\n className={cn(\n \"text-pho-secondary px-2.5 py-1.5 text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Separator({ className, ...props }: StyledProps<typeof BaseSeparator>) {\n return (\n <BaseSeparator\n className={cn(\n \"-mx-1.5 my-1.5 h-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SubmenuTrigger({\n className,\n ...props\n}: StyledProps<typeof BaseContextMenu.SubmenuTrigger>) {\n return (\n <BaseContextMenu.SubmenuTrigger\n className={cn(\n MENU_ITEM,\n \"data-[popup-open]:bg-pho-ghost-hover\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Right-click (context) menu built on Base UI `ContextMenu`. `ContextMenu.Trigger`\n * wraps the area that opens the menu on right-click / long-press; the popup\n * shares its look with `Menu`. `ContextMenu.Item` has the same native promise\n * support as `Menu.Item`. Always mirror these actions somewhere visible —\n * a context menu must not be the only way to reach them.\n */\nexport const ContextMenu = {\n Root,\n Trigger,\n Portal,\n Positioner,\n Popup,\n Item,\n Group,\n GroupLabel,\n Separator,\n SubmenuRoot,\n SubmenuTrigger,\n RadioGroup,\n};\n"],"mappings":";;;;;;;;AA6CA,IAAM,IAAO,EAAoB,EAAgB,IAAI,GAC/C,IAAU,EAAgB,SAC1B,IAAS,EAAgB,QACzB,IAAQ,EAAgB,OACxB,IAAa,EAAgB,YAG7B,IAAc,EAAgB;AAEpC,SAAS,EAAW,EAClB,WAAA,GACA,GAAG,EAAA,GAC8C;AACjD,SACE,gBAAA,EAAC,EAAgB,YAAjB;AAAA,IAA4B,WAAW,EAAG,QAAQ,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAgB,OAAjB;AAAA,IAAuB,WAAW,EAAG,GAAY,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE7E;AAEA,SAAS,EAAK,EACZ,WAAA,GACA,OAAA,IAAQ,WACR,SAAA,GACA,cAAA,IAAe,IACf,SAAA,IAAU,IACV,UAAA,IAAW,IACX,UAAA,GACA,GAAG,EAAA,GACoB;AACvB,QAAM,EAAE,OAAA,GAAO,SAAA,GAAS,aAAA,GAAa,YAAA,EAAA,IAAe,EAAiB;AAAA,IACnE,SAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,EACF,CAAC;AAED,SACE,gBAAA,EAAC,EAAgB,MAAjB;AAAA,IACE,WAAW,EACT,GACA,EAAe,GAAkB,CAAK,GACtC,CACF;AAAA,IACc,cAAA;AAAA,IACd,UAAU;AAAA,IACV,gBAAc,KAAS;AAAA,IACvB,aAAW,KAAS;AAAA,IACpB,GAAI;AAAA,IACJ,SAAS;AAAA,IACT,GAAI;AAAA,IAZN,UAAA,CAcG,IACC,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD,CAAkB,CAAA,GAClB,gBAAA,EAAC,UAAD;AAAA,MAAQ,WAAU;AAAA,MAAU,aAAU;AAAA,IAAU,CAAA,CAChD,EAAA,CAAA,IACA,MACH,CACmB;AAAA;AAE1B;AAEA,SAAS,EAAW,EAClB,WAAA,GACA,GAAG,EAAA,GAC8C;AACjD,SACE,gBAAA,EAAC,EAAgB,YAAjB;AAAA,IACE,WAAW,EACT,wDACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAU,EAAE,WAAA,GAAW,GAAG,EAAA,GAA4C;AAC7E,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAW,EACT,8DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAe,EACtB,WAAA,GACA,GAAG,EAAA,GACkD;AACrD,SACE,gBAAA,EAAC,EAAgB,gBAAjB;AAAA,IACE,WAAW,EACT,GACA,wCACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AASA,IAAa,IAAc;AAAA,EACzB,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as e, i as t, n as r, r as o, t as s } from "../chunks/data-table-
|
|
2
|
+
import { a as e, i as t, n as r, r as o, t as s } from "../chunks/data-table-T4QKnrxQ.js";
|
|
3
3
|
import { r as c } from "../chunks/chrome-Ds7WykBJ.js";
|
|
4
4
|
import { t as T } from "../chunks/ghost-search-8PzP73zS.js";
|
|
5
5
|
export {
|
package/dist/components/menu.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { a as s, c as a, i as e, n, r as E, t as _ } from "../chunks/menu-CoMrYnd1.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
n as
|
|
4
|
+
s as MENU_BLINK_MS,
|
|
5
|
+
_ as MENU_ITEM,
|
|
6
|
+
n as MENU_ITEM_COLORS,
|
|
7
|
+
E as MENU_POPUP,
|
|
7
8
|
e as Menu,
|
|
8
9
|
a as useMenuPending
|
|
9
10
|
};
|
package/dist/components/scope.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as d } from "../chunks/cn-ChIgwEl3.js";
|
|
3
3
|
import { revealIn as st } from "../motion.js";
|
|
4
|
-
import { u as
|
|
4
|
+
import { u as lt } from "../chunks/button-C9VqBBIr.js";
|
|
5
5
|
import { t as ye } from "../chunks/IconCheck-D2WuculQ.js";
|
|
6
6
|
import { t as it } from "../chunks/IconChevronDown-CZilB71T.js";
|
|
7
7
|
import { t as ct } from "../chunks/close-button-GvqWbLl0.js";
|
|
@@ -11,11 +11,11 @@ import { t as dt } from "../chunks/ghost-search-8PzP73zS.js";
|
|
|
11
11
|
import { t as A } from "../chunks/tooltip-BTF7GChl.js";
|
|
12
12
|
import { t as p } from "../chunks/select-COFV0NLb.js";
|
|
13
13
|
import { useEffect as Ne, useId as ut, useLayoutEffect as pt, useMemo as G, useRef as S, useState as X } from "react";
|
|
14
|
-
import { jsx as n, jsxs as
|
|
15
|
-
import { AnimatePresence as H, motion as
|
|
16
|
-
import { Field as
|
|
17
|
-
import { Tooltip as
|
|
18
|
-
var vt = "group/scope relative w-full min-w-0 overflow-clip rounded-base border border-pho-secondary bg-pho-primary [--scope-inset:var(--choice-card-inset,0.75rem)]", Se = "px-[var(--scope-inset)]", gt = "flex min-h-11 items-center gap-3 border-b border-pho-secondary px-[var(--scope-inset)]", bt = "text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-secondary-hover data-[popup-open]:bg-pho-ghost-hover outline-pho-brand shrink-0 gap-1.5 rounded-full py-1.5 pr-2 pl-3 font-medium focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid", de = "custom", Ce = "grid grid-cols-1 group-data-[wide]/scope:grid-cols-[fit-content(45%)_minmax(0,1fr)] group-data-[wide]/scope:gap-x-4", Oe = "col-span-full grid grid-cols-subgrid border-t border-pho-secondary first:border-t-0", Ee = "group col-span-full flex min-w-0 cursor-pointer flex-col gap-y-0.5 px-[var(--scope-inset)] py-2 transition-colors select-none hover:bg-pho-primary-hover group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-transparent", wt = "col-span-full flex min-w-0 flex-col gap-y-0.5 px-[var(--scope-inset)] py-2 group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center", ke = "group col-span-full flex h-8 min-w-0 cursor-pointer items-center gap-2 border-b border-pho-secondary bg-pho-page px-[var(--scope-inset)] text-xs font-medium text-pho-secondary select-none data-[disabled]:cursor-not-allowed", Ie = "line-clamp-2 min-w-0 pl-6 text-xs text-pho-description group-data-[wide]/scope:block group-data-[wide]/scope:truncate group-data-[wide]/scope:pl-0", Re = "flex w-full min-w-0 items-center gap-3 px-[var(--scope-inset)] py-2.5 text-left outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-2", xt = 34, yt = 18;
|
|
14
|
+
import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
15
|
+
import { AnimatePresence as H, motion as b, useReducedMotion as ht } from "motion/react";
|
|
16
|
+
import { Field as mt } from "@base-ui/react/field";
|
|
17
|
+
import { Tooltip as ft } from "@base-ui/react/tooltip";
|
|
18
|
+
var vt = "group/scope relative w-full min-w-0 overflow-clip rounded-base border border-pho-secondary bg-pho-primary [--scope-inset:var(--choice-card-inset,0.75rem)]", Se = "px-[var(--scope-inset)]", gt = "flex min-h-11 items-center gap-3 border-b border-pho-secondary px-[var(--scope-inset)]", bt = "text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-secondary-hover data-[popup-open]:bg-pho-ghost-hover outline-pho-brand shrink-0 gap-1.5 rounded-full py-1.5 pr-2 pl-3 font-medium focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid", de = "custom", Ce = "grid auto-rows-max grid-cols-1 group-data-[wide]/scope:grid-cols-[fit-content(45%)_minmax(0,1fr)] group-data-[wide]/scope:gap-x-4", Oe = "col-span-full grid auto-rows-max grid-cols-subgrid border-t border-pho-secondary first:border-t-0", Ee = "group col-span-full flex min-w-0 cursor-pointer flex-col gap-y-0.5 px-[var(--scope-inset)] py-2 transition-colors select-none hover:bg-pho-primary-hover group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-transparent", wt = "col-span-full flex min-w-0 flex-col gap-y-0.5 px-[var(--scope-inset)] py-2 group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center", ke = "group col-span-full flex h-8 min-w-0 cursor-pointer items-center gap-2 border-b border-pho-secondary bg-pho-page px-[var(--scope-inset)] text-xs font-medium text-pho-secondary select-none data-[disabled]:cursor-not-allowed", Ie = "line-clamp-2 min-w-0 pl-6 text-xs text-pho-description group-data-[wide]/scope:block group-data-[wide]/scope:truncate group-data-[wide]/scope:pl-0", Re = "flex w-full min-w-0 items-center gap-3 px-[var(--scope-inset)] py-2.5 text-left outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-2", xt = 34, yt = 18;
|
|
19
19
|
function Nt(r) {
|
|
20
20
|
const [s, m] = X({
|
|
21
21
|
wide: !0,
|
|
@@ -38,7 +38,7 @@ function Nt(r) {
|
|
|
38
38
|
wide: W >= xt * L,
|
|
39
39
|
roomy: W >= yt * L
|
|
40
40
|
};
|
|
41
|
-
m((
|
|
41
|
+
m((w) => w.wide === u.wide && w.roomy === u.roomy ? w : u);
|
|
42
42
|
};
|
|
43
43
|
c();
|
|
44
44
|
const _ = new ResizeObserver(c);
|
|
@@ -78,12 +78,13 @@ function _e(r, s) {
|
|
|
78
78
|
const m = new Set(r);
|
|
79
79
|
return s.every((i) => m.has(i));
|
|
80
80
|
}
|
|
81
|
-
function J(r, s) {
|
|
81
|
+
function J(r, s, m = "fade") {
|
|
82
82
|
return {
|
|
83
83
|
...r,
|
|
84
84
|
initial: {
|
|
85
85
|
...r.initial,
|
|
86
|
-
height: s
|
|
86
|
+
height: s,
|
|
87
|
+
opacity: m === "down" ? 1 : 0
|
|
87
88
|
},
|
|
88
89
|
exit: { opacity: 0 }
|
|
89
90
|
};
|
|
@@ -93,15 +94,15 @@ function Ot(r) {
|
|
|
93
94
|
const s = r.closest("[data-scope-description]");
|
|
94
95
|
return s == null ? !1 : s.scrollWidth > s.clientWidth + 1 || s.scrollHeight > s.clientHeight + 1;
|
|
95
96
|
}
|
|
96
|
-
function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, presets: c, placeholder: _ = "Search", collapsible: C = !1, open: z, defaultOpen: L = !1, onOpenChange: W, loading: u = !1, disabled:
|
|
97
|
-
const [De, Ae] = X(m ?? []), O = s ?? De, [Ge, He] = X(L), E = C ? z ?? Ge : !0, [F, T] = X(""), Le = ht(), ue = S(null), { wide: We, roomy: Be, heights: V } = Nt(ue), v = ut(), pe = `${v}-list`, he = S(null),
|
|
97
|
+
function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, presets: c, placeholder: _ = "Search", collapsible: C = !1, open: z, defaultOpen: L = !1, onOpenChange: W, loading: u = !1, disabled: w = !1, className: Te, ref: B, ...Me }) {
|
|
98
|
+
const [De, Ae] = X(m ?? []), O = s ?? De, [Ge, He] = X(L), E = C ? z ?? Ge : !0, [F, T] = X(""), Le = ht(), ue = S(null), { wide: We, roomy: Be, heights: V } = Nt(ue), v = ut(), pe = `${v}-list`, he = S(null), me = S(null), q = S(null), fe = G(() => ft.createHandle(), []), U = G(() => St(r), [r]), j = G(() => new Set(r.map((e) => e.value)), [r]), Fe = G(() => new Map(r.map((e, t) => [e.value, t])), [r]), Ve = G(() => new Map(U.map((e, t) => [e.label, t])), [U]), Z = S([]);
|
|
98
99
|
for (const e of O) e !== o?.value && !j.has(e) && !Z.current.includes(e) && Z.current.push(e);
|
|
99
100
|
const k = Z.current.filter((e) => !j.has(e)), f = o?.value, M = new Set(O), N = f !== void 0 && M.has(f), K = (e) => N ? j.has(e) : M.has(e), R = r.filter((e) => K(e.value)).length, ee = k.filter((e) => M.has(e)).length, Y = (e) => {
|
|
100
101
|
s === void 0 && Ae(e), i?.(e);
|
|
101
102
|
}, te = (e) => Y([...r.filter((t) => e.has(t.value)).map((t) => t.value), ...k.filter((t) => e.has(t))]), qe = () => N ? new Set(r.map((e) => e.value)) : new Set(O.filter((e) => e !== f)), ne = (e, t) => {
|
|
102
|
-
const
|
|
103
|
-
for (const h of e) t ?
|
|
104
|
-
te(
|
|
103
|
+
const l = qe();
|
|
104
|
+
for (const h of e) t ? l.add(h) : l.delete(h);
|
|
105
|
+
te(l);
|
|
105
106
|
}, Ue = (e) => {
|
|
106
107
|
f === void 0 ? ne(r.map((t) => t.value), e) : e ? Y([f]) : te(new Set(r.map((t) => t.value)));
|
|
107
108
|
}, re = (e) => e.filter((t) => t === f || j.has(t)), P = u || r.length === 0 ? void 0 : c?.find((e) => {
|
|
@@ -109,7 +110,7 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
109
110
|
return t.length > 0 && _e(t, re(O));
|
|
110
111
|
}), je = (e) => {
|
|
111
112
|
const t = re(e.value);
|
|
112
|
-
f !== void 0 && t.includes(f) ? Y([f]) : te(/* @__PURE__ */ new Set([...t, ...k.filter((
|
|
113
|
+
f !== void 0 && t.includes(f) ? Y([f]) : te(/* @__PURE__ */ new Set([...t, ...k.filter((l) => M.has(l))]));
|
|
113
114
|
}, ve = (e) => {
|
|
114
115
|
z === void 0 && He(e), W?.(e);
|
|
115
116
|
}, Ke = () => {
|
|
@@ -130,19 +131,19 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
130
131
|
const e = q.current;
|
|
131
132
|
if (e == null) return;
|
|
132
133
|
q.current = null;
|
|
133
|
-
let t = 0,
|
|
134
|
+
let t = 0, l = 0;
|
|
134
135
|
const h = () => {
|
|
135
|
-
const
|
|
136
|
-
|
|
136
|
+
const x = e === "search" ? he.current : me.current;
|
|
137
|
+
x != null && (x.focus({ preventScroll: !0 }), document.activeElement !== x && l++ < 5 && (t = requestAnimationFrame(h)));
|
|
137
138
|
};
|
|
138
139
|
return t = requestAnimationFrame(h), () => cancelAnimationFrame(t);
|
|
139
140
|
}, [E]);
|
|
140
141
|
const Qe = (e) => {
|
|
141
|
-
e.key === "Enter" && e.preventDefault(), e.key === "Escape" && (F !== "" ? (e.preventDefault(), T("")) : C && !
|
|
142
|
-
},
|
|
142
|
+
e.key === "Enter" && e.preventDefault(), e.key === "Escape" && (F !== "" ? (e.preventDefault(), T("")) : C && !w && (e.preventDefault(), be()));
|
|
143
|
+
}, ae = Ct(F), Q = ae.length > 0, we = U.map((e) => ({
|
|
143
144
|
...e,
|
|
144
|
-
items: Q ? e.items.filter((t) => Pe(
|
|
145
|
-
})).filter((e) => e.items.length > 0), se = Q ? k.filter((e) => Pe(
|
|
145
|
+
items: Q ? e.items.filter((t) => Pe(ae, e.label, t.value, t.label, t.description)) : e.items
|
|
146
|
+
})).filter((e) => e.items.length > 0), se = Q ? k.filter((e) => Pe(ae, e)) : k, D = N || r.length === 0 ? null : `${R} of ${r.length}`, le = (() => {
|
|
146
147
|
if (N && o) return {
|
|
147
148
|
title: o.label,
|
|
148
149
|
detail: o.description ?? ""
|
|
@@ -157,39 +158,39 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
157
158
|
};
|
|
158
159
|
const e = [];
|
|
159
160
|
for (const t of U) {
|
|
160
|
-
const
|
|
161
|
-
t.label !== null && t.items.length > 1 &&
|
|
161
|
+
const l = t.items.filter((h) => K(h.value));
|
|
162
|
+
t.label !== null && t.items.length > 1 && l.length === t.items.length ? e.push(t.label) : e.push(...l.map($e));
|
|
162
163
|
}
|
|
163
164
|
return e.push(...k.filter((t) => M.has(t))), {
|
|
164
165
|
title: e.length > 0 ? e.join(", ") : "None",
|
|
165
166
|
detail: D ?? ""
|
|
166
167
|
};
|
|
167
|
-
})(), $ =
|
|
168
|
-
const
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
...
|
|
168
|
+
})(), $ = w || u, g = st(Le), ie = (e, t = !1) => {
|
|
169
|
+
const l = t ? `${v}-r${k.indexOf(e.value)}` : `${v}-i${Fe.get(e.value)}`, h = `${l}-name`, x = `${l}-description`;
|
|
170
|
+
return /* @__PURE__ */ a(b.label, {
|
|
171
|
+
...g,
|
|
171
172
|
className: d(Ee, "overflow-hidden"),
|
|
172
173
|
"data-scope-row": "",
|
|
173
174
|
"data-disabled": $ || void 0,
|
|
174
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ a("span", {
|
|
175
176
|
className: "flex min-w-0 items-center gap-2",
|
|
176
177
|
children: [/* @__PURE__ */ n(ce, {
|
|
177
178
|
size: "sm",
|
|
178
179
|
checked: K(e.value),
|
|
179
180
|
disabled: $,
|
|
180
181
|
"aria-labelledby": h,
|
|
181
|
-
"aria-describedby": e.description ?
|
|
182
|
-
onCheckedChange: (
|
|
182
|
+
"aria-describedby": e.description ? x : void 0,
|
|
183
|
+
onCheckedChange: (y) => ne([e.value], y)
|
|
183
184
|
}), /* @__PURE__ */ n("span", {
|
|
184
185
|
id: h,
|
|
185
186
|
className: d("truncate text-base", t ? "text-pho-description" : "text-pho-secondary"),
|
|
186
187
|
children: $e(e)
|
|
187
188
|
})]
|
|
188
189
|
}), e.description ? /* @__PURE__ */ n(A.Trigger, {
|
|
189
|
-
handle:
|
|
190
|
+
handle: fe,
|
|
190
191
|
payload: e.description,
|
|
191
192
|
render: /* @__PURE__ */ n("span", {
|
|
192
|
-
id:
|
|
193
|
+
id: x,
|
|
193
194
|
"data-scope-description": "",
|
|
194
195
|
className: Ie
|
|
195
196
|
}),
|
|
@@ -197,24 +198,24 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
197
198
|
}) : null]
|
|
198
199
|
}, e.value);
|
|
199
200
|
}, Je = (e) => {
|
|
200
|
-
if (e.label === null) return e.items.map((
|
|
201
|
-
const t = `${v}-g${Ve.get(e.label)}`,
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
...
|
|
201
|
+
if (e.label === null) return e.items.map((y) => ie(y));
|
|
202
|
+
const t = `${v}-g${Ve.get(e.label)}`, l = e.items.map((y) => y.value), h = l.filter(K).length, x = h === l.length;
|
|
203
|
+
return /* @__PURE__ */ a(b.div, {
|
|
204
|
+
...g,
|
|
204
205
|
role: "group",
|
|
205
206
|
"aria-labelledby": t,
|
|
206
207
|
className: d(Oe, "overflow-hidden"),
|
|
207
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ a("label", {
|
|
208
209
|
className: ke,
|
|
209
210
|
"data-disabled": $ || void 0,
|
|
210
211
|
children: [
|
|
211
212
|
/* @__PURE__ */ n(ce, {
|
|
212
213
|
size: "sm",
|
|
213
|
-
checked:
|
|
214
|
-
indeterminate: h > 0 && !
|
|
214
|
+
checked: x,
|
|
215
|
+
indeterminate: h > 0 && !x,
|
|
215
216
|
disabled: $,
|
|
216
217
|
"aria-labelledby": t,
|
|
217
|
-
onCheckedChange: (
|
|
218
|
+
onCheckedChange: (y) => ne(l, y)
|
|
218
219
|
}),
|
|
219
220
|
/* @__PURE__ */ n("span", {
|
|
220
221
|
id: t,
|
|
@@ -223,20 +224,20 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
223
224
|
}),
|
|
224
225
|
/* @__PURE__ */ n("span", {
|
|
225
226
|
className: "text-pho-description tabular-nums",
|
|
226
|
-
children:
|
|
227
|
+
children: l.length
|
|
227
228
|
})
|
|
228
229
|
]
|
|
229
230
|
}), /* @__PURE__ */ n(H, {
|
|
230
231
|
initial: !1,
|
|
231
|
-
children: e.items.map((
|
|
232
|
+
children: e.items.map((y) => ie(y))
|
|
232
233
|
})]
|
|
233
234
|
}, `group:${e.label}`);
|
|
234
|
-
}, Xe = se.length > 0 ? /* @__PURE__ */
|
|
235
|
-
...
|
|
235
|
+
}, Xe = se.length > 0 ? /* @__PURE__ */ a(b.div, {
|
|
236
|
+
...g,
|
|
236
237
|
role: "group",
|
|
237
238
|
"aria-labelledby": `${v}-retired`,
|
|
238
239
|
className: d(Oe, "overflow-hidden"),
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ a("div", {
|
|
240
241
|
className: d(ke, "cursor-default"),
|
|
241
242
|
children: [/* @__PURE__ */ n("span", {
|
|
242
243
|
"aria-hidden": !0,
|
|
@@ -250,12 +251,12 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
250
251
|
initial: !1,
|
|
251
252
|
children: se.map((e) => ie({ value: e }, !0))
|
|
252
253
|
})]
|
|
253
|
-
}, "retired") : null, Ze = o ? /* @__PURE__ */
|
|
254
|
-
...
|
|
254
|
+
}, "retired") : null, Ze = o ? /* @__PURE__ */ a(b.label, {
|
|
255
|
+
...g,
|
|
255
256
|
className: d(Ee, "overflow-hidden"),
|
|
256
257
|
"data-scope-row": "",
|
|
257
258
|
"data-disabled": $ || N && r.length === 0 || void 0,
|
|
258
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ a("span", {
|
|
259
260
|
className: "flex min-w-0 items-center gap-2",
|
|
260
261
|
children: [/* @__PURE__ */ n(ce, {
|
|
261
262
|
size: "sm",
|
|
@@ -275,10 +276,10 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
275
276
|
className: Ie,
|
|
276
277
|
children: o.description
|
|
277
278
|
}) : null]
|
|
278
|
-
}, "all") : null, et = Q && we.length === 0 && se.length === 0 ? /* @__PURE__ */ n(
|
|
279
|
-
...
|
|
279
|
+
}, "all") : null, et = Q && we.length === 0 && se.length === 0 ? /* @__PURE__ */ n(b.p, {
|
|
280
|
+
...g,
|
|
280
281
|
className: d("text-pho-description col-span-full overflow-hidden text-center text-base", Se),
|
|
281
|
-
children: /* @__PURE__ */
|
|
282
|
+
children: /* @__PURE__ */ a("span", {
|
|
282
283
|
className: "block py-6",
|
|
283
284
|
children: [
|
|
284
285
|
"Nothing matches “",
|
|
@@ -286,12 +287,12 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
286
287
|
"”."
|
|
287
288
|
]
|
|
288
289
|
})
|
|
289
|
-
}, "nothing") : null, tt = /* @__PURE__ */ n(
|
|
290
|
-
...J(
|
|
290
|
+
}, "nothing") : null, tt = /* @__PURE__ */ n(b.div, {
|
|
291
|
+
...J(g, V.current.bones, "down"),
|
|
291
292
|
id: pe,
|
|
292
293
|
"data-scope-list": "",
|
|
293
294
|
className: d(Ce, "overflow-hidden"),
|
|
294
|
-
children: /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ a(H, {
|
|
295
296
|
initial: !1,
|
|
296
297
|
children: [
|
|
297
298
|
Q ? null : Ze,
|
|
@@ -300,8 +301,8 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
300
301
|
et
|
|
301
302
|
]
|
|
302
303
|
})
|
|
303
|
-
}, "list"), nt = /* @__PURE__ */ n(
|
|
304
|
-
...J(
|
|
304
|
+
}, "list"), nt = /* @__PURE__ */ n(b.div, {
|
|
305
|
+
...J(g, V.current.list),
|
|
305
306
|
"data-scope-bones": "",
|
|
306
307
|
"aria-hidden": !0,
|
|
307
308
|
className: d(Ce, "overflow-hidden"),
|
|
@@ -331,12 +332,12 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
331
332
|
name: "w-24",
|
|
332
333
|
text: "w-60"
|
|
333
334
|
}
|
|
334
|
-
].map((e, t) => e.band ? /* @__PURE__ */
|
|
335
|
+
].map((e, t) => e.band ? /* @__PURE__ */ a("div", {
|
|
335
336
|
className: d("border-pho-secondary bg-pho-page col-span-full flex h-8 items-center gap-2 border-y", Se),
|
|
336
337
|
children: [/* @__PURE__ */ n(I, { className: "size-4 rounded-sm" }), /* @__PURE__ */ n(I, { className: d("h-3", e.name) })]
|
|
337
|
-
}, t) : /* @__PURE__ */
|
|
338
|
+
}, t) : /* @__PURE__ */ a("div", {
|
|
338
339
|
className: wt,
|
|
339
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ a("span", {
|
|
340
341
|
className: "flex h-5 min-w-0 items-center gap-2",
|
|
341
342
|
children: [/* @__PURE__ */ n(I, { className: "size-4 shrink-0 rounded-sm" }), /* @__PURE__ */ n(I, { className: d("h-3.5 max-w-full", e.name) })]
|
|
342
343
|
}), /* @__PURE__ */ n("span", {
|
|
@@ -344,9 +345,9 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
344
345
|
children: /* @__PURE__ */ n(I, { className: d("h-3 max-w-full", e.text) })
|
|
345
346
|
})]
|
|
346
347
|
}, t))
|
|
347
|
-
}, "bones"), rt = c != null && c.length > 0 ? /* @__PURE__ */ n(
|
|
348
|
+
}, "bones"), rt = c != null && c.length > 0 ? /* @__PURE__ */ n(mt.Root, {
|
|
348
349
|
className: "contents",
|
|
349
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ a(p.Root, {
|
|
350
351
|
items: [...c.map((e, t) => ({
|
|
351
352
|
value: `preset:${t}`,
|
|
352
353
|
label: e.label
|
|
@@ -359,15 +360,15 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
359
360
|
const t = c[Number(String(e).slice(7))];
|
|
360
361
|
t != null && t !== P && je(t);
|
|
361
362
|
},
|
|
362
|
-
disabled:
|
|
363
|
-
children: [/* @__PURE__ */
|
|
363
|
+
disabled: w || u,
|
|
364
|
+
children: [/* @__PURE__ */ a(p.Trigger, {
|
|
364
365
|
variant: "inline",
|
|
365
366
|
"aria-label": "Preset",
|
|
366
367
|
className: d(bt, C ? "-mr-1" : "-mr-2"),
|
|
367
368
|
children: [/* @__PURE__ */ n(p.Value, {}), /* @__PURE__ */ n(p.Icon, { children: /* @__PURE__ */ n(it, {}) })]
|
|
368
369
|
}), /* @__PURE__ */ n(p.Portal, { children: /* @__PURE__ */ n(p.Positioner, {
|
|
369
370
|
align: "end",
|
|
370
|
-
children: /* @__PURE__ */ n(p.Popup, { children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ n(p.Popup, { children: /* @__PURE__ */ a(p.List, { children: [c.map((e, t) => /* @__PURE__ */ a(p.Item, {
|
|
371
372
|
value: `preset:${t}`,
|
|
372
373
|
children: [
|
|
373
374
|
/* @__PURE__ */ n(p.ItemIndicator, { children: /* @__PURE__ */ n(ye, {}) }),
|
|
@@ -377,17 +378,20 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
377
378
|
children: e.description
|
|
378
379
|
}) : null
|
|
379
380
|
]
|
|
380
|
-
}, t)), /* @__PURE__ */
|
|
381
|
+
}, t)), /* @__PURE__ */ a(p.Item, {
|
|
381
382
|
value: de,
|
|
382
383
|
disabled: !0,
|
|
383
384
|
children: [/* @__PURE__ */ n(p.ItemIndicator, { children: /* @__PURE__ */ n(ye, {}) }), /* @__PURE__ */ n(p.ItemText, { children: "Custom" })]
|
|
384
385
|
})] }) })
|
|
385
386
|
}) })]
|
|
386
387
|
})
|
|
387
|
-
}) : null, ot = /* @__PURE__ */
|
|
388
|
-
...J(
|
|
388
|
+
}) : null, ot = /* @__PURE__ */ a(b.div, {
|
|
389
|
+
...J(g, V.current.face, "down"),
|
|
389
390
|
className: "overflow-hidden",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
391
|
+
children: [/* @__PURE__ */ a(b.div, {
|
|
392
|
+
initial: { opacity: 0 },
|
|
393
|
+
animate: { opacity: 1 },
|
|
394
|
+
transition: g.transition,
|
|
391
395
|
className: gt,
|
|
392
396
|
children: [
|
|
393
397
|
/* @__PURE__ */ n(dt, {
|
|
@@ -411,7 +415,7 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
411
415
|
C ? /* @__PURE__ */ n(ct, {
|
|
412
416
|
size: "sm",
|
|
413
417
|
label: "Cancel",
|
|
414
|
-
disabled:
|
|
418
|
+
disabled: w,
|
|
415
419
|
onClick: be,
|
|
416
420
|
className: "-mr-2 shrink-0 focus-visible:-outline-offset-2"
|
|
417
421
|
}) : null
|
|
@@ -421,7 +425,7 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
421
425
|
mode: "popLayout",
|
|
422
426
|
children: u ? nt : tt
|
|
423
427
|
})]
|
|
424
|
-
}, "picker"), xe = u ? /* @__PURE__ */
|
|
428
|
+
}, "picker"), xe = u ? /* @__PURE__ */ a("span", {
|
|
425
429
|
className: "flex min-w-0 flex-1 flex-col",
|
|
426
430
|
children: [/* @__PURE__ */ n("span", {
|
|
427
431
|
className: "flex h-5 items-center",
|
|
@@ -430,30 +434,30 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
430
434
|
className: "flex h-4.5 items-center",
|
|
431
435
|
children: /* @__PURE__ */ n(I, { className: "h-3 w-16" })
|
|
432
436
|
})]
|
|
433
|
-
}) : /* @__PURE__ */
|
|
437
|
+
}) : /* @__PURE__ */ a("span", {
|
|
434
438
|
className: "flex min-w-0 flex-1 flex-col",
|
|
435
439
|
children: [/* @__PURE__ */ n("span", {
|
|
436
440
|
className: "text-pho-primary truncate text-base",
|
|
437
|
-
children:
|
|
438
|
-
}),
|
|
441
|
+
children: le.title
|
|
442
|
+
}), le.detail ? /* @__PURE__ */ n("span", {
|
|
439
443
|
className: "text-pho-description truncate text-xs tabular-nums",
|
|
440
|
-
children:
|
|
444
|
+
children: le.detail
|
|
441
445
|
}) : null]
|
|
442
|
-
}),
|
|
443
|
-
...J(
|
|
446
|
+
}), at = /* @__PURE__ */ n(b.div, {
|
|
447
|
+
...J(g, V.current.face),
|
|
444
448
|
className: "overflow-hidden",
|
|
445
|
-
children:
|
|
449
|
+
children: w || u ? /* @__PURE__ */ n("div", {
|
|
446
450
|
className: Re,
|
|
447
451
|
children: xe
|
|
448
|
-
}) : /* @__PURE__ */
|
|
449
|
-
ref:
|
|
452
|
+
}) : /* @__PURE__ */ a("button", {
|
|
453
|
+
ref: me,
|
|
450
454
|
type: "button",
|
|
451
455
|
"aria-expanded": !1,
|
|
452
456
|
className: d(Re, "group hover:bg-pho-primary-hover cursor-pointer transition-colors"),
|
|
453
457
|
onClick: Ke,
|
|
454
458
|
children: [xe, /* @__PURE__ */ n("span", {
|
|
455
459
|
"aria-hidden": !0,
|
|
456
|
-
className:
|
|
460
|
+
className: lt({
|
|
457
461
|
variant: "ghost",
|
|
458
462
|
size: "sm",
|
|
459
463
|
className: "group-hover:bg-pho-ghost-hover group-hover:text-pho-secondary-hover pointer-events-none shrink-0"
|
|
@@ -462,7 +466,7 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
462
466
|
})]
|
|
463
467
|
})
|
|
464
468
|
}, "folded");
|
|
465
|
-
return /* @__PURE__ */
|
|
469
|
+
return /* @__PURE__ */ a("div", {
|
|
466
470
|
role: "group",
|
|
467
471
|
"aria-busy": u || void 0,
|
|
468
472
|
"data-scope": "",
|
|
@@ -477,9 +481,9 @@ function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, pre
|
|
|
477
481
|
children: [/* @__PURE__ */ n(H, {
|
|
478
482
|
initial: !1,
|
|
479
483
|
mode: "popLayout",
|
|
480
|
-
children: E ? ot :
|
|
484
|
+
children: E ? ot : at
|
|
481
485
|
}), /* @__PURE__ */ n(A.Root, {
|
|
482
|
-
handle:
|
|
486
|
+
handle: fe,
|
|
483
487
|
onOpenChange: (e, t) => {
|
|
484
488
|
e && !Ot(t.event?.target) && t.cancel();
|
|
485
489
|
},
|