@photon-ai/pho-ui 4.22.0 → 4.24.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-BYA1lkzf.js → basic-page-DYBjCadG.js} +7 -7
- package/dist/chunks/basic-page-DYBjCadG.js.map +1 -0
- package/dist/chunks/{button-CLfWdqm-.js → button-KM0lAQ4x.js} +2 -2
- package/dist/chunks/button-KM0lAQ4x.js.map +1 -0
- package/dist/chunks/{chat-j7XEdKEo.js → chat-D98GCjbe.js} +5 -5
- package/dist/chunks/chat-D98GCjbe.js.map +1 -0
- package/dist/chunks/{code-block-B7MibV6r.js → code-block-CthLWfxd.js} +3 -3
- package/dist/chunks/{code-block-B7MibV6r.js.map → code-block-CthLWfxd.js.map} +1 -1
- package/dist/chunks/{collapsible-C2tn_b1Q.js → collapsible-CR4QWjFh.js} +8 -8
- package/dist/chunks/collapsible-CR4QWjFh.js.map +1 -0
- package/dist/chunks/{dialog-CDL6qY2a.js → dialog-H72fZGtf.js} +6 -6
- package/dist/chunks/dialog-H72fZGtf.js.map +1 -0
- package/dist/chunks/{error-BZU9vgnj.js → error-BT71wcUd.js} +3 -3
- package/dist/chunks/{error-BZU9vgnj.js.map → error-BT71wcUd.js.map} +1 -1
- package/dist/chunks/{filter-bar-CLLonntH.js → filter-bar-D_sBAT5Y.js} +2 -2
- package/dist/chunks/{filter-bar-CLLonntH.js.map → filter-bar-D_sBAT5Y.js.map} +1 -1
- package/dist/chunks/{log-list-QbSYHZu3.js → log-list-BA6CcfxR.js} +3 -3
- package/dist/chunks/{log-list-QbSYHZu3.js.map → log-list-BA6CcfxR.js.map} +1 -1
- package/dist/chunks/{sidebar-BsBlAVM9.js → sidebar-ttBkgGRh.js} +3 -3
- package/dist/chunks/{sidebar-BsBlAVM9.js.map → sidebar-ttBkgGRh.js.map} +1 -1
- package/dist/chunks/{status-view-I_Y6eEyX.js → status-view-Buhh1UBJ.js} +2 -2
- package/dist/chunks/status-view-Buhh1UBJ.js.map +1 -0
- package/dist/chunks/{toast-K549iZEX.js → toast-Cbnn8lcA.js} +2 -2
- package/dist/chunks/{toast-K549iZEX.js.map → toast-Cbnn8lcA.js.map} +1 -1
- package/dist/chunks/toggle-DeFSPgIj.js +33 -0
- package/dist/chunks/{toggle-Ca4SS3YD.js.map → toggle-DeFSPgIj.js.map} +1 -1
- package/dist/chunks/{trace-5Rh1ade9.js → trace-ClMpG82z.js} +2 -2
- package/dist/chunks/{trace-5Rh1ade9.js.map → trace-ClMpG82z.js.map} +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +5 -5
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/error.js +1 -1
- package/dist/components/field.js +26 -24
- package/dist/components/field.js.map +1 -1
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/log-list.js +1 -1
- package/dist/components/notification.js +2 -2
- package/dist/components/notification.js.map +1 -1
- package/dist/components/scope.js +2 -2
- package/dist/components/scope.js.map +1 -1
- package/dist/components/status-view.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/index.js +11 -11
- package/dist/sections/basic-page.js +1 -1
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/drawer/drawer.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +10 -2
- package/dist/src/components/status-view/status-view.d.ts +4 -3
- package/package.json +1 -1
- package/src/styles/fonts.css +8 -6
- package/src/styles/theme.css +5 -5
- package/dist/chunks/basic-page-BYA1lkzf.js.map +0 -1
- package/dist/chunks/button-CLfWdqm-.js.map +0 -1
- package/dist/chunks/chat-j7XEdKEo.js.map +0 -1
- package/dist/chunks/collapsible-C2tn_b1Q.js.map +0 -1
- package/dist/chunks/dialog-CDL6qY2a.js.map +0 -1
- package/dist/chunks/status-view-I_Y6eEyX.js.map +0 -1
- package/dist/chunks/toggle-Ca4SS3YD.js +0 -33
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a, c as s, d as o, i as n, l as T, n as B, o as u, r as e, s as f, t as i, u as r } from "../chunks/button-
|
|
2
|
+
import { a, c as s, d as o, i as n, l as T, n as B, o as u, r as e, s as f, t as i, u as r } from "../chunks/button-KM0lAQ4x.js";
|
|
3
3
|
import { t as E } from "../chunks/close-button-Ck4rY1Fp.js";
|
|
4
4
|
export {
|
|
5
5
|
i as BUTTON_COLORS,
|
package/dist/components/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as s, c as e, d as i, i as g, l as o, n as h, o as l, r, s as t, t as n, u as A } from "../chunks/code-block-
|
|
2
|
+
import { a as s, c as e, d as i, i as g, l as o, n as h, o as l, r, s as t, t as n, u as A } from "../chunks/code-block-CthLWfxd.js";
|
|
3
3
|
export {
|
|
4
4
|
o as CODE_GRAMMARS,
|
|
5
5
|
e as CODE_TOKEN_CLASS,
|
|
@@ -5,7 +5,7 @@ import { SPRING_SETTLE as P } from "../motion.js";
|
|
|
5
5
|
import { t as j } from "../chunks/IconArrowUpRight-OK8Fp0KQ.js";
|
|
6
6
|
import { t as V } from "../chunks/IconChevronLeft-CptqhdxO.js";
|
|
7
7
|
import { t as Z } from "../chunks/animated-height-zr7BmFY1.js";
|
|
8
|
-
import { t as u } from "../chunks/dialog-
|
|
8
|
+
import { t as u } from "../chunks/dialog-H72fZGtf.js";
|
|
9
9
|
import { useEffect as $, useId as z, useLayoutEffect as A, useRef as F } from "react";
|
|
10
10
|
import { Fragment as E, jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
11
11
|
import { LayoutGroup as H, motion as g, useReducedMotion as B } from "motion/react";
|
|
@@ -22,13 +22,13 @@ function u({ className: t, ...r }) {
|
|
|
22
22
|
...r
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function d({ className: t, ...r }) {
|
|
26
26
|
return /* @__PURE__ */ o(a.Content, {
|
|
27
27
|
className: e("flex h-full flex-col", t),
|
|
28
28
|
...r
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function m({ className: t, ...r }) {
|
|
32
32
|
return /* @__PURE__ */ o(a.Title, {
|
|
33
33
|
className: e("text-pho-primary font-display text-display-sm font-medium text-balance", t),
|
|
34
34
|
...r
|
|
@@ -36,7 +36,7 @@ function d({ className: t, ...r }) {
|
|
|
36
36
|
}
|
|
37
37
|
function f({ className: t, ...r }) {
|
|
38
38
|
return /* @__PURE__ */ o(a.Description, {
|
|
39
|
-
className: e("text-pho-description text-display-xs
|
|
39
|
+
className: e("text-pho-description text-display-xs font-normal", t),
|
|
40
40
|
...r
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -47,8 +47,8 @@ var v = {
|
|
|
47
47
|
Backdrop: p,
|
|
48
48
|
Viewport: c,
|
|
49
49
|
Popup: u,
|
|
50
|
-
Content:
|
|
51
|
-
Title:
|
|
50
|
+
Content: d,
|
|
51
|
+
Title: m,
|
|
52
52
|
Description: f,
|
|
53
53
|
Close: l
|
|
54
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","names":["BaseDrawer","cn","jsx","Drawer$1","Root","Trigger","Portal","Close","Backdrop","className","props","Viewport","Popup","Content","Title","Description","Drawer"],"sources":["../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Root = BaseDrawer.Root;\nconst Trigger = BaseDrawer.Trigger;\nconst Portal = BaseDrawer.Portal;\nconst Close = BaseDrawer.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Backdrop>) {\n return (\n <BaseDrawer.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-300 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Viewport>) {\n return (\n <BaseDrawer.Viewport\n className={cn(\n \"fixed inset-0 z-50 flex items-stretch justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDrawer.Popup>) {\n return (\n <BaseDrawer.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow; hairline edge is the\n // site card stroke (border-pho-secondary), not the interactive edge.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl h-full w-[22rem] max-w-[calc(100vw-3rem)] overflow-y-auto overscroll-contain border-l p-6 outline-none\",\n \"[transform:translateX(var(--drawer-swipe-movement-x,0px))] transition-transform duration-300 ease-out\",\n \"data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Content>) {\n return (\n <BaseDrawer.Content\n className={cn(\"flex h-full flex-col\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDrawer.Title>) {\n return (\n <BaseDrawer.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Description>) {\n return (\n <BaseDrawer.Description\n className={cn(\n \"text-pho-description text-display-xs
|
|
1
|
+
{"version":3,"file":"drawer.js","names":["BaseDrawer","cn","jsx","Drawer$1","Root","Trigger","Portal","Close","Backdrop","className","props","Viewport","Popup","Content","Title","Description","Drawer"],"sources":["../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Root = BaseDrawer.Root;\nconst Trigger = BaseDrawer.Trigger;\nconst Portal = BaseDrawer.Portal;\nconst Close = BaseDrawer.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Backdrop>) {\n return (\n <BaseDrawer.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-300 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Viewport>) {\n return (\n <BaseDrawer.Viewport\n className={cn(\n \"fixed inset-0 z-50 flex items-stretch justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDrawer.Popup>) {\n return (\n <BaseDrawer.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow; hairline edge is the\n // site card stroke (border-pho-secondary), not the interactive edge.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl h-full w-[22rem] max-w-[calc(100vw-3rem)] overflow-y-auto overscroll-contain border-l p-6 outline-none\",\n \"[transform:translateX(var(--drawer-swipe-movement-x,0px))] transition-transform duration-300 ease-out\",\n \"data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Content>) {\n return (\n <BaseDrawer.Content\n className={cn(\"flex h-full flex-col\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDrawer.Title>) {\n return (\n <BaseDrawer.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting copy flush under the title: no gap between the two. */\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Description>) {\n return (\n <BaseDrawer.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Drawer built on Base UI `Drawer` — a panel that slides in from the edge\n * (here, the right) with swipe-to-dismiss. Use it for secondary tasks and\n * navigation that should keep page context; for a decision or a centered modal\n * use `Dialog`. Compose `Drawer.Portal`\n * → `Backdrop` → `Viewport` → `Popup` → `Content`.\n */\nexport const Drawer = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Viewport,\n Popup,\n Content,\n Title,\n Description,\n Close,\n};\n"],"mappings":";;;;;AAYA,IAAMI,IAAOJ,EAAW,MAClBK,IAAUL,EAAW,SACrBM,IAASN,EAAW,QACpBO,IAAQP,EAAW;AAEzB,SAASQ,EAAS,EAChB,WAAAC,GACA,GAAGC,EAAA,GACuC;AAC1C,SACE,gBAAAR,EAACF,EAAW,UAAZ;AAAA,IACE,WAAWC,EACT,8EACA,2FACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASC,EAAS,EAChB,WAAAF,GACA,GAAGC,EAAA,GACuC;AAC1C,SACE,gBAAAR,EAACF,EAAW,UAAZ;AAAA,IACE,WAAWC,EACT,qDACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASE,EAAM,EAAE,WAAAH,GAAW,GAAGC,EAAA,GAA+C;AAC5E,SACE,gBAAAR,EAACF,EAAW,OAAZ;AAAA,IACE,WAAWC,EAGT,4JACA,yGACA,yGACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASG,EAAQ,EACf,WAAAJ,GACA,GAAGC,EAAA,GACsC;AACzC,SACE,gBAAAR,EAACF,EAAW,SAAZ;AAAA,IACE,WAAWC,EAAG,wBAAwBQ,CAAS;AAAA,IAC/C,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASI,EAAM,EAAE,WAAAL,GAAW,GAAGC,EAAA,GAA+C;AAC5E,SACE,gBAAAR,EAACF,EAAW,OAAZ;AAAA,IACE,WAAWC,EACT,0EACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAGA,SAASK,EAAY,EACnB,WAAAN,GACA,GAAGC,EAAA,GAC0C;AAC7C,SACE,gBAAAR,EAACF,EAAW,aAAZ;AAAA,IACE,WAAWC,EACT,oDACAQ,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AASA,IAAaM,IAAS;AAAA,EACpB,MAAAZ;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAE;AAAA,EACA,UAAAG;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAR;AACF"}
|
package/dist/components/error.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as r, c as s, i as t, l as e, n as i, o, r as E, s as n, t as p, u as l } from "../chunks/error-
|
|
2
|
+
import { a as r, c as s, i as t, l as e, n as i, o, r as E, s as n, t as p, u as l } from "../chunks/error-BT71wcUd.js";
|
|
3
3
|
export {
|
|
4
4
|
p as Error,
|
|
5
5
|
i as ErrorView,
|
package/dist/components/field.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t } from "../chunks/cn-CPbhpG1q.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { Field as
|
|
6
|
-
function s({ className:
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
className: t("group/field flex flex-col gap-1.5",
|
|
4
|
+
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { Field as r } from "@base-ui/react/field";
|
|
6
|
+
function s({ className: i, ...e }) {
|
|
7
|
+
return /* @__PURE__ */ a(r.Root, {
|
|
8
|
+
className: t("group/field flex flex-col gap-1.5", "[&>[data-field-label]+[data-field-description]]:-mt-1.5", i),
|
|
9
9
|
...e
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
function d({ className:
|
|
13
|
-
return /* @__PURE__ */ l(
|
|
14
|
-
|
|
12
|
+
function d({ className: i, required: e, children: o, ...n }) {
|
|
13
|
+
return /* @__PURE__ */ l(r.Label, {
|
|
14
|
+
"data-field-label": "",
|
|
15
|
+
className: t("text-pho-secondary font-heading cursor-default text-base font-medium", e && "flex items-center gap-0.5", i),
|
|
15
16
|
...n,
|
|
16
|
-
children: [
|
|
17
|
+
children: [o, e ? /* @__PURE__ */ a("span", {
|
|
17
18
|
className: "text-pho-brand",
|
|
18
19
|
"aria-hidden": "true",
|
|
19
20
|
children: "*"
|
|
20
21
|
}) : null]
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
function c({ className:
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
className: t("bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder text-md rounded-base w-full px-3 py-2 ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset", "focus-visible:ring-pho-brand focus-visible:ring-2", "data-[invalid]:ring-pho-error-subtle data-[invalid]:focus-visible:ring-pho-error data-[invalid]:ring-[1.5px] data-[invalid]:focus-visible:ring-2", "disabled:cursor-not-allowed disabled:opacity-50",
|
|
24
|
+
function c({ className: i, ...e }) {
|
|
25
|
+
return /* @__PURE__ */ a(r.Control, {
|
|
26
|
+
className: t("bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder text-md rounded-base w-full px-3 py-2 ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset", "focus-visible:ring-pho-brand focus-visible:ring-2", "data-[invalid]:ring-pho-error-subtle data-[invalid]:focus-visible:ring-pho-error data-[invalid]:ring-[1.5px] data-[invalid]:focus-visible:ring-2", "disabled:cursor-not-allowed disabled:opacity-50", i),
|
|
26
27
|
...e
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
function p({ className:
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
className: t("flex min-w-0 flex-col gap-3",
|
|
30
|
+
function p({ className: i, ...e }) {
|
|
31
|
+
return /* @__PURE__ */ a("div", {
|
|
32
|
+
className: t("flex min-w-0 flex-col gap-3", i),
|
|
32
33
|
...e
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function u({ className:
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
36
|
+
function u({ className: i, ...e }) {
|
|
37
|
+
return /* @__PURE__ */ a(r.Description, {
|
|
38
|
+
"data-field-description": "",
|
|
39
|
+
className: t("text-pho-description text-base", i),
|
|
38
40
|
...e
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
className: t("text-pho-error text-base",
|
|
43
|
+
function f({ className: i, ...e }) {
|
|
44
|
+
return /* @__PURE__ */ a(r.Error, {
|
|
45
|
+
className: t("text-pho-error text-base", i),
|
|
44
46
|
...e
|
|
45
47
|
});
|
|
46
48
|
}
|
|
@@ -50,9 +52,9 @@ var g = {
|
|
|
50
52
|
Control: c,
|
|
51
53
|
Controls: p,
|
|
52
54
|
Description: u,
|
|
53
|
-
Error:
|
|
54
|
-
Item:
|
|
55
|
-
Validity:
|
|
55
|
+
Error: f,
|
|
56
|
+
Item: r.Item,
|
|
57
|
+
Validity: r.Validity
|
|
56
58
|
};
|
|
57
59
|
export {
|
|
58
60
|
g as Field
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","names":["BaseField","jsx","jsxs","Field$1","Root","className","props","cn","Label","required","children","Control","Controls","Description","Error","Field"],"sources":["../../src/components/field/field.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nfunction Root({ className, ...props }: StyledProps<typeof BaseField.Root>) {\n return (\n <BaseField.Root\n className={cn(\"group/field flex flex-col gap-1.5\"
|
|
1
|
+
{"version":3,"file":"field.js","names":["BaseField","jsx","jsxs","Field$1","Root","className","props","cn","Label","required","children","Control","Controls","Description","Error","Field"],"sources":["../../src/components/field/field.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/**\n * The field's column: label, control and description 6px apart. A\n * description right under the label (above the control) is the label's\n * own and sits flush under it: `-mt-1.5` takes back the column's gap for\n * that pair. A title of the host's own standing in for `Label` (a `div`\n * over a group of controls) joins the pair with `data-field-label`.\n */\nfunction Root({ className, ...props }: StyledProps<typeof BaseField.Root>) {\n return (\n <BaseField.Root\n className={cn(\n \"group/field flex flex-col gap-1.5\",\n \"[&>[data-field-label]+[data-field-description]]:-mt-1.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * The field's label. `required` marks it the way `Input required` marks\n * its own: a brand-coloured star after the words. A form marks every\n * required field or none, so a field built from parts (a `Select`, a\n * `PhoneInput`, a pair of inputs under one label) takes `required` here to\n * match the `Input`s beside it.\n */\nfunction Label({\n className,\n required,\n children,\n ...props\n}: StyledProps<typeof BaseField.Label> & {\n /** Mark the field required: a star after the label's words. */\n required?: boolean;\n}) {\n return (\n <BaseField.Label\n data-field-label=\"\"\n className={cn(\n \"text-pho-secondary font-heading cursor-default text-base font-medium\",\n required && \"flex items-center gap-0.5\",\n className,\n )}\n {...props}\n >\n {children}\n {/* The star is for the eye; the control carries the required state. */}\n {required ? (\n <span className=\"text-pho-brand\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </BaseField.Label>\n );\n}\n\nfunction Control({\n className,\n ...props\n}: StyledProps<typeof BaseField.Control>) {\n return (\n <BaseField.Control\n className={cn(\n // Flat field surface — hairline ring carries the edge (site has no\n // resting shadows outside floating layers).\n \"bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder text-md rounded-base w-full px-3 py-2 ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset\",\n \"focus-visible:ring-pho-brand focus-visible:ring-2\",\n // Invalid is mid-weight: thicker than the 1px rest hairline, thinner\n // than the 2px focus ring. Rest uses the subtle error ink; focus\n // steps up to the solid error.\n \"data-[invalid]:ring-pho-error-subtle data-[invalid]:focus-visible:ring-pho-error data-[invalid]:ring-[1.5px] data-[invalid]:focus-visible:ring-2\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Several controls under one label: the lines of an address, first and\n * last name, the parts of a date. Stacks them at the gap the system uses\n * between the parts of one thing (12px), so the field's own 6px stays\n * between the label, the controls and the description. Put an `Inline`\n * inside for a side-by-side row.\n */\nfunction Controls({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex min-w-0 flex-col gap-3\", className)} {...props} />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseField.Description>) {\n return (\n <BaseField.Description\n data-field-description=\"\"\n className={cn(\"text-pho-description text-base\", className)}\n {...props}\n />\n );\n}\n\nfunction Error({ className, ...props }: StyledProps<typeof BaseField.Error>) {\n return (\n <BaseField.Error\n className={cn(\"text-pho-error text-base\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Form field built on Base UI `Field`. Wires a label, description, and\n * validation error to a control for you — compose it around `Field.Control`\n * (or any control via `render`). `Field.Error` shows when the control is\n * invalid; `Field.Validity` exposes raw validity for custom messages.\n * `Field.Controls` stacks several controls under one label.\n */\nexport const Field = {\n Root,\n Label,\n Control,\n Controls,\n Description,\n Error,\n Item: BaseField.Item,\n Validity: BaseField.Validity,\n};\n"],"mappings":";;;;;AAmBA,SAASI,EAAK,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAA6C;AACzE,SACE,gBAAAL,EAACD,EAAU,MAAX;AAAA,IACE,WAAWO,EACT,qCACA,2DACAF,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AASA,SAASE,EAAM,EACb,WAAAH,GACA,UAAAI,GACA,UAAAC,GACA,GAAGJ,EAAA,GAIF;AACD,SACE,gBAAAJ,EAACF,EAAU,OAAX;AAAA,IACE,oBAAiB;AAAA,IACjB,WAAWO,EACT,wEACAE,KAAY,6BACZJ,CACF;AAAA,IACA,GAAIC;AAAA,IAPN,UAAA,CASGI,GAEAD,IACC,gBAAAR,EAAC,QAAD;AAAA,MAAM,WAAU;AAAA,MAAiB,eAAY;AAAA,MAAO,UAAA;AAAA,IAE9C,CAAA,IACJ,IACW;AAAA,E;AAErB;AAEA,SAASU,EAAQ,EACf,WAAAN,GACA,GAAGC,EAAA,GACqC;AACxC,SACE,gBAAAL,EAACD,EAAU,SAAX;AAAA,IACE,WAAWO,EAGT,qMACA,qDAIA,oJACA,mDACAF,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AASA,SAASM,EAAS,EAAE,WAAAP,GAAW,GAAGC,EAAA,GAAgC;AAChE,SACE,gBAAAL,EAAC,OAAD;AAAA,IAAK,WAAWM,EAAG,+BAA+BF,CAAS;AAAA,IAAG,GAAIC;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAASO,EAAY,EACnB,WAAAR,GACA,GAAGC,EAAA,GACyC;AAC5C,SACE,gBAAAL,EAACD,EAAU,aAAX;AAAA,IACE,0BAAuB;AAAA,IACvB,WAAWO,EAAG,kCAAkCF,CAAS;AAAA,IACzD,GAAIC;AAAA,EACL,CAAA;AAEL;AAEA,SAASQ,EAAM,EAAE,WAAAT,GAAW,GAAGC,EAAA,GAA8C;AAC3E,SACE,gBAAAL,EAACD,EAAU,OAAX;AAAA,IACE,WAAWO,EAAG,4BAA4BF,CAAS;AAAA,IACnD,GAAIC;AAAA,EACL,CAAA;AAEL;AASA,IAAaS,IAAQ;AAAA,EACnB,MAAAX;AAAA,EACA,OAAAI;AAAA,EACA,SAAAG;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAMd,EAAU;AAAA,EAChB,UAAUA,EAAU;AACtB"}
|
|
@@ -52,7 +52,7 @@ var k = [
|
|
|
52
52
|
success: I,
|
|
53
53
|
warning: c,
|
|
54
54
|
error: c
|
|
55
|
-
}, l = "cursor-pointer text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
55
|
+
}, l = "cursor-pointer font-heading text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
56
56
|
function _({ color: a = "brand", title: p, description: r, confirmLabel: i, onConfirm: h, dismissLabel: m = "Dismiss", onClose: s, icon: u, className: f, ref: v, ...x }) {
|
|
57
57
|
const g = u ?? A[a], b = !!i;
|
|
58
58
|
return /* @__PURE__ */ o("div", {
|
|
@@ -67,7 +67,7 @@ function _({ color: a = "brand", title: p, description: r, confirmLabel: i, onCo
|
|
|
67
67
|
/* @__PURE__ */ o("div", {
|
|
68
68
|
className: "flex flex-1 flex-col gap-3 pr-6",
|
|
69
69
|
children: [/* @__PURE__ */ o("div", {
|
|
70
|
-
className: "flex flex-col
|
|
70
|
+
className: "flex flex-col",
|
|
71
71
|
children: [/* @__PURE__ */ e("p", {
|
|
72
72
|
className: "text-pho-primary font-heading text-base font-medium",
|
|
73
73
|
children: p
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","names":["__iconNode","resolveVariant","createReactComponent","IconInfoCircle","IconX","jsx","jsxs","__iconNode$1","IconAlertCircle","__iconNode","IconCircleCheck","NOTIFICATION_COLORS","ICON_MAP","LINK_CLASS","Notification","color","title","description","confirmLabel","onConfirm","dismissLabel","onClose","icon","className","ref","props","Glyph","showActions","cn"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs","../../src/components/notification/notification.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 8v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertCircle = createReactComponent(\"outline\", \"alert-circle\", \"AlertCircle\", __iconNode);\n\nexport { __iconNode, IconAlertCircle as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M9 12l2 2l4 -4\", \"key\": \"svg-1\" }]];\nconst IconCircleCheck = createReactComponent(\"outline\", \"circle-check\", \"CircleCheck\", __iconNode);\n\nexport { __iconNode, IconCircleCheck as default };\n","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport {\n IconCircleCheck,\n IconInfoCircle,\n IconAlertCircle,\n IconX,\n type Icon,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE closed, semantic axis: `color`. It selects a status glyph *and* its\n * tint together — you never pick an icon and a color separately. This is the\n * `IconNotification` flavor from the app; the unused avatar/image variants of\n * the source family are intentionally dropped.\n * - The action row is a single reduced pair: a brand `confirmLabel` link beside\n * a gray dismiss link. It appears only when there's something to confirm.\n * - `onClose` is the only thing that renders the top-right close button — no\n * separate boolean flag to keep in sync.\n */\n\n/** Status color → icon tint. A bare status-tinted glyph, no badge surface. */\nexport const NOTIFICATION_COLORS = {\n brand: {\n classes: \"text-pho-brand\",\n description: \"Informational / product update (default)\",\n },\n gray: {\n classes: \"text-pho-secondary\",\n description: \"Neutral, low-stakes note\",\n },\n success: {\n classes: \"text-pho-success\",\n description: \"An action completed\",\n },\n warning: {\n classes: \"text-pho-warning\",\n description: \"Needs attention, not yet failed\",\n },\n error: {\n classes: \"text-pho-error\",\n description: \"Something went wrong\",\n },\n} satisfies VariantMap;\n\nexport type NotificationColor = keyof typeof NOTIFICATION_COLORS;\n\n/** Status color → glyph. Mirrors the source's `iconMap` semantics. */\nconst ICON_MAP = {\n brand: IconInfoCircle,\n gray: IconInfoCircle,\n success: IconCircleCheck,\n warning: IconAlertCircle,\n error: IconAlertCircle,\n} satisfies Record<NotificationColor, Icon>;\n\nexport interface NotificationProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"title\" | \"color\"\n> {\n /** Status color — selects the glyph and its tint. @default \"brand\" */\n color?: NotificationColor;\n /** Bold heading line. */\n title: ReactNode;\n /** Supporting line under the title. */\n description?: ReactNode;\n /** Confirm action label — renders a brand link paired with a dismiss link. */\n confirmLabel?: string;\n /** Called when the confirm link is clicked. */\n onConfirm?: () => void;\n /** Dismiss link label, shown beside the confirm link. @default \"Dismiss\" */\n dismissLabel?: string;\n /** Called on dismiss. Its presence also renders the top-right close button. */\n onClose?: () => void;\n /** Override the status glyph while keeping the color's tint. */\n icon?: Icon;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst LINK_CLASS =\n \"cursor-pointer text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\";\n\n/**\n * Notification — the standalone status card ported from the app's\n * `IconNotification`: a status glyph, a title/description, an optional\n * confirm+dismiss link pair, and an optional close button. It is a *card*, not a\n * lifecycle: it owns its surface but nothing about timing or stacking.\n *\n * For a transient, auto-stacking toast, drop it inside pho-ui's Base UI\n * {@link Toast} — render it as the child of a `Toast.Root` whose own surface you\n * neutralize (`className=\"bg-transparent p-0 shadow-none ring-0\"`) so the\n * manager owns motion and swipe while this card owns the look. For a choice the\n * user must make, use `Dialog` instead.\n */\nexport function Notification({\n color = \"brand\",\n title,\n description,\n confirmLabel,\n onConfirm,\n dismissLabel = \"Dismiss\",\n onClose,\n icon,\n className,\n ref,\n ...props\n}: NotificationProps) {\n const Glyph = icon ?? ICON_MAP[color];\n const showActions = Boolean(confirmLabel);\n\n return (\n <div\n ref={ref}\n {...props}\n className={cn(\n // Floating layer: keeps its shadow elevation, hairline card edge.\n \"ring-pho-secondary bg-pho-primary shadow-pho-lg rounded-base relative flex w-full max-w-sm gap-4 p-4 ring-1 ring-inset\",\n className,\n )}\n >\n <Glyph\n aria-hidden=\"true\"\n className={cn(\n \"mt-0.5 size-5 shrink-0\",\n resolveVariant(NOTIFICATION_COLORS, color),\n )}\n />\n\n <div className=\"flex flex-1 flex-col gap-3 pr-6\">\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-pho-primary font-heading text-base font-medium\">\n {title}\n </p>\n {description != null && description !== false && (\n <p className=\"text-pho-description text-base\">{description}</p>\n )}\n </div>\n\n {showActions && (\n <div className=\"flex gap-4\">\n <button\n type=\"button\"\n onClick={onConfirm}\n className={cn(\n LINK_CLASS,\n // brand text is monochrome now — underline carries the hover.\n \"text-pho-brand hover:underline\",\n )}\n >\n {confirmLabel}\n </button>\n <button\n type=\"button\"\n onClick={onClose}\n className={cn(\n LINK_CLASS,\n \"text-pho-secondary hover:text-pho-secondary-hover\",\n )}\n >\n {dismissLabel}\n </button>\n </div>\n )}\n </div>\n\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Dismiss\"\n className=\"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\"\n >\n <IconX aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n}\n\nNotification.displayName = \"Notification\";\n"],"ignoreList":[0,1],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"notification.js","names":["__iconNode","resolveVariant","createReactComponent","IconInfoCircle","IconX","jsx","jsxs","__iconNode$1","IconAlertCircle","__iconNode","IconCircleCheck","NOTIFICATION_COLORS","ICON_MAP","LINK_CLASS","Notification","color","title","description","confirmLabel","onConfirm","dismissLabel","onClose","icon","className","ref","props","Glyph","showActions","cn"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs","../../src/components/notification/notification.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 8v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertCircle = createReactComponent(\"outline\", \"alert-circle\", \"AlertCircle\", __iconNode);\n\nexport { __iconNode, IconAlertCircle as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M9 12l2 2l4 -4\", \"key\": \"svg-1\" }]];\nconst IconCircleCheck = createReactComponent(\"outline\", \"circle-check\", \"CircleCheck\", __iconNode);\n\nexport { __iconNode, IconCircleCheck as default };\n","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport {\n IconCircleCheck,\n IconInfoCircle,\n IconAlertCircle,\n IconX,\n type Icon,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE closed, semantic axis: `color`. It selects a status glyph *and* its\n * tint together — you never pick an icon and a color separately. This is the\n * `IconNotification` flavor from the app; the unused avatar/image variants of\n * the source family are intentionally dropped.\n * - The action row is a single reduced pair: a brand `confirmLabel` link beside\n * a gray dismiss link. It appears only when there's something to confirm.\n * - `onClose` is the only thing that renders the top-right close button — no\n * separate boolean flag to keep in sync.\n */\n\n/** Status color → icon tint. A bare status-tinted glyph, no badge surface. */\nexport const NOTIFICATION_COLORS = {\n brand: {\n classes: \"text-pho-brand\",\n description: \"Informational / product update (default)\",\n },\n gray: {\n classes: \"text-pho-secondary\",\n description: \"Neutral, low-stakes note\",\n },\n success: {\n classes: \"text-pho-success\",\n description: \"An action completed\",\n },\n warning: {\n classes: \"text-pho-warning\",\n description: \"Needs attention, not yet failed\",\n },\n error: {\n classes: \"text-pho-error\",\n description: \"Something went wrong\",\n },\n} satisfies VariantMap;\n\nexport type NotificationColor = keyof typeof NOTIFICATION_COLORS;\n\n/** Status color → glyph. Mirrors the source's `iconMap` semantics. */\nconst ICON_MAP = {\n brand: IconInfoCircle,\n gray: IconInfoCircle,\n success: IconCircleCheck,\n warning: IconAlertCircle,\n error: IconAlertCircle,\n} satisfies Record<NotificationColor, Icon>;\n\nexport interface NotificationProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"title\" | \"color\"\n> {\n /** Status color — selects the glyph and its tint. @default \"brand\" */\n color?: NotificationColor;\n /** Bold heading line. */\n title: ReactNode;\n /** Supporting line under the title. */\n description?: ReactNode;\n /** Confirm action label — renders a brand link paired with a dismiss link. */\n confirmLabel?: string;\n /** Called when the confirm link is clicked. */\n onConfirm?: () => void;\n /** Dismiss link label, shown beside the confirm link. @default \"Dismiss\" */\n dismissLabel?: string;\n /** Called on dismiss. Its presence also renders the top-right close button. */\n onClose?: () => void;\n /** Override the status glyph while keeping the color's tint. */\n icon?: Icon;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst LINK_CLASS =\n \"cursor-pointer font-heading text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\";\n\n/**\n * Notification — the standalone status card ported from the app's\n * `IconNotification`: a status glyph, a title/description, an optional\n * confirm+dismiss link pair, and an optional close button. It is a *card*, not a\n * lifecycle: it owns its surface but nothing about timing or stacking.\n *\n * For a transient, auto-stacking toast, drop it inside pho-ui's Base UI\n * {@link Toast} — render it as the child of a `Toast.Root` whose own surface you\n * neutralize (`className=\"bg-transparent p-0 shadow-none ring-0\"`) so the\n * manager owns motion and swipe while this card owns the look. For a choice the\n * user must make, use `Dialog` instead.\n */\nexport function Notification({\n color = \"brand\",\n title,\n description,\n confirmLabel,\n onConfirm,\n dismissLabel = \"Dismiss\",\n onClose,\n icon,\n className,\n ref,\n ...props\n}: NotificationProps) {\n const Glyph = icon ?? ICON_MAP[color];\n const showActions = Boolean(confirmLabel);\n\n return (\n <div\n ref={ref}\n {...props}\n className={cn(\n // Floating layer: keeps its shadow elevation, hairline card edge.\n \"ring-pho-secondary bg-pho-primary shadow-pho-lg rounded-base relative flex w-full max-w-sm gap-4 p-4 ring-1 ring-inset\",\n className,\n )}\n >\n <Glyph\n aria-hidden=\"true\"\n className={cn(\n \"mt-0.5 size-5 shrink-0\",\n resolveVariant(NOTIFICATION_COLORS, color),\n )}\n />\n\n <div className=\"flex flex-1 flex-col gap-3 pr-6\">\n {/* The description flush under the title. */}\n <div className=\"flex flex-col\">\n <p className=\"text-pho-primary font-heading text-base font-medium\">\n {title}\n </p>\n {description != null && description !== false && (\n <p className=\"text-pho-description text-base\">{description}</p>\n )}\n </div>\n\n {showActions && (\n <div className=\"flex gap-4\">\n <button\n type=\"button\"\n onClick={onConfirm}\n className={cn(\n LINK_CLASS,\n // brand text is monochrome now — underline carries the hover.\n \"text-pho-brand hover:underline\",\n )}\n >\n {confirmLabel}\n </button>\n <button\n type=\"button\"\n onClick={onClose}\n className={cn(\n LINK_CLASS,\n \"text-pho-secondary hover:text-pho-secondary-hover\",\n )}\n >\n {dismissLabel}\n </button>\n </div>\n )}\n </div>\n\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Dismiss\"\n className=\"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\"\n >\n <IconX aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n}\n\nNotification.displayName = \"Notification\";\n"],"ignoreList":[0,1],"mappings":"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"}
|
package/dist/components/scope.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as d } from "../chunks/cn-CPbhpG1q.js";
|
|
3
3
|
import { revealIn as st } from "../motion.js";
|
|
4
|
-
import { u as lt } from "../chunks/button-
|
|
4
|
+
import { u as lt } from "../chunks/button-KM0lAQ4x.js";
|
|
5
5
|
import { t as ye } from "../chunks/IconCheck-DwSMn1wK.js";
|
|
6
6
|
import { t as it } from "../chunks/IconChevronDown-Cd68NnX2.js";
|
|
7
7
|
import { t as ct } from "../chunks/close-button-Ck4rY1Fp.js";
|
|
@@ -15,7 +15,7 @@ import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
|
15
15
|
import { AnimatePresence as H, motion as b, useReducedMotion as ht } from "motion/react";
|
|
16
16
|
import { Field as mt } from "@base-ui/react/field";
|
|
17
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
|
|
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 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 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,
|