@photon-ai/pho-ui 0.1.1 → 0.3.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/button-BMDHIgZh.js +360 -0
- package/dist/chunks/button-BMDHIgZh.js.map +1 -0
- package/dist/chunks/{close-button-CbQNfpxU.js → close-button-DKaNIndU.js} +6 -6
- package/dist/chunks/{close-button-CbQNfpxU.js.map → close-button-DKaNIndU.js.map} +1 -1
- package/dist/chunks/{cn-D6jQqeRj.js → cn-7uGUzCOM.js} +2 -3
- package/dist/chunks/{cn-D6jQqeRj.js.map → cn-7uGUzCOM.js.map} +1 -1
- package/dist/chunks/{dialog-BSBF1Wyq.js → dialog-CyyL5VCc.js} +13 -13
- package/dist/chunks/dialog-CyyL5VCc.js.map +1 -0
- package/dist/chunks/{input-aZqjjV_m.js → input-DX7d5MlS.js} +3 -3
- package/dist/chunks/input-DX7d5MlS.js.map +1 -0
- package/dist/chunks/menu-BfaNHnOp.js +101 -0
- package/dist/chunks/menu-BfaNHnOp.js.map +1 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.js +5 -5
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/autocomplete.js +7 -7
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.js +2 -2
- package/dist/components/badge.js.map +1 -1
- package/dist/components/button.js +10 -11
- package/dist/components/checkbox.js +2 -2
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.js +53 -53
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/context-menu.js +11 -11
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/field.js +26 -26
- package/dist/components/field.js.map +1 -1
- package/dist/components/fieldset.js +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/kbd.js +8 -8
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/menubar.js +5 -5
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/navigation-menu.js +34 -34
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/notification.js +16 -16
- package/dist/components/notification.js.map +1 -1
- package/dist/components/number-field.js +18 -18
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/otp-field.js +6 -6
- package/dist/components/otp-field.js.map +1 -1
- package/dist/components/popover.js +9 -9
- package/dist/components/popover.js.map +1 -1
- package/dist/components/preview-card.js +12 -12
- package/dist/components/preview-card.js.map +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.js +9 -9
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.js +10 -10
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/slider.js +16 -16
- package/dist/components/slider.js.map +1 -1
- package/dist/components/switch.js +11 -11
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tabs.js +15 -15
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/toast.js +6 -6
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.js +6 -6
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/toolbar.js +7 -7
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.js +14 -14
- package/dist/components/tooltip.js.map +1 -1
- package/dist/index.js +17 -18
- package/dist/src/components/button/button.d.ts +40 -41
- package/dist/src/components/button/index.d.ts +1 -1
- package/dist/src/components/menu/menu.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/src/styles/fonts.css +22 -0
- package/src/styles/theme.css +166 -169
- package/dist/chunks/button-DjjSiLYz.js +0 -334
- package/dist/chunks/button-DjjSiLYz.js.map +0 -1
- package/dist/chunks/dialog-BSBF1Wyq.js.map +0 -1
- package/dist/chunks/input-aZqjjV_m.js.map +0 -1
- package/dist/chunks/menu-BkzDbNuX.js +0 -101
- package/dist/chunks/menu-BkzDbNuX.js.map +0 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as n } from "../chunks/cn-
|
|
2
|
+
import { t as n } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
-
import { NavigationMenu as
|
|
6
|
-
function a({ className: t, ...
|
|
7
|
-
return /* @__PURE__ */ i(
|
|
5
|
+
import { NavigationMenu as e } from "@base-ui/react/navigation-menu";
|
|
6
|
+
function a({ className: t, ...o }) {
|
|
7
|
+
return /* @__PURE__ */ i(e.Root, {
|
|
8
8
|
className: n("relative min-w-max", t),
|
|
9
|
-
...
|
|
9
|
+
...o
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
function s({ className: t, ...
|
|
13
|
-
return /* @__PURE__ */ i(
|
|
12
|
+
function s({ className: t, ...o }) {
|
|
13
|
+
return /* @__PURE__ */ i(e.List, {
|
|
14
14
|
className: n("relative flex items-center gap-1", t),
|
|
15
|
-
...
|
|
15
|
+
...o
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
var p =
|
|
19
|
-
function l({ className: t, ...
|
|
20
|
-
return /* @__PURE__ */ i(
|
|
21
|
-
className: n("outline-pho-brand text-pho-secondary hover:bg-pho-
|
|
22
|
-
...
|
|
18
|
+
var p = e.Item, u = e.Icon;
|
|
19
|
+
function l({ className: t, ...o }) {
|
|
20
|
+
return /* @__PURE__ */ i(e.Trigger, {
|
|
21
|
+
className: n("outline-pho-brand text-pho-secondary hover:bg-pho-ghost-hover data-[popup-open]:bg-pho-ghost-hover inline-flex cursor-pointer items-center gap-1 rounded-md px-3 py-2 text-sm font-medium transition focus-visible:outline-2 focus-visible:-outline-offset-1", "[&>svg]:size-4 [&>svg]:transition-transform [&>svg]:duration-150 data-[popup-open]:[&>svg]:rotate-180", t),
|
|
22
|
+
...o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function c({ className: t, ...
|
|
26
|
-
return /* @__PURE__ */ i(
|
|
25
|
+
function c({ className: t, ...o }) {
|
|
26
|
+
return /* @__PURE__ */ i(e.Content, {
|
|
27
27
|
className: n("w-full p-2", t),
|
|
28
|
-
...
|
|
28
|
+
...o
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */ i(
|
|
33
|
-
className: n("outline-pho-brand text-pho-secondary hover:bg-pho-
|
|
34
|
-
...
|
|
31
|
+
function g({ className: t, ...o }) {
|
|
32
|
+
return /* @__PURE__ */ i(e.Link, {
|
|
33
|
+
className: n("outline-pho-brand text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-primary block rounded-lg px-3 py-2 text-sm transition focus-visible:outline-2 focus-visible:-outline-offset-1", t),
|
|
34
|
+
...o
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
return /* @__PURE__ */ i(
|
|
40
|
-
sideOffset:
|
|
37
|
+
var m = e.Portal;
|
|
38
|
+
function h({ className: t, sideOffset: o = 8, ...r }) {
|
|
39
|
+
return /* @__PURE__ */ i(e.Positioner, {
|
|
40
|
+
sideOffset: o,
|
|
41
41
|
className: n("z-50", t),
|
|
42
42
|
...r
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function f({ className: t, ...
|
|
46
|
-
return /* @__PURE__ */ i(
|
|
47
|
-
className: n("squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-
|
|
48
|
-
...
|
|
45
|
+
function f({ className: t, ...o }) {
|
|
46
|
+
return /* @__PURE__ */ i(e.Popup, {
|
|
47
|
+
className: n("squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary relative h-[var(--popup-height)] w-[var(--popup-width)] origin-[var(--transform-origin)] rounded-xl ring-1 transition-[opacity,transform,width,height] duration-150 ease-out outline-none ring-inset", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", t),
|
|
48
|
+
...o
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
function v({ className: t, ...
|
|
52
|
-
return /* @__PURE__ */ i(
|
|
51
|
+
function v({ className: t, ...o }) {
|
|
52
|
+
return /* @__PURE__ */ i(e.Viewport, {
|
|
53
53
|
className: n("relative h-full w-full overflow-hidden", t),
|
|
54
|
-
...
|
|
54
|
+
...o
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
var N = {
|
|
@@ -60,10 +60,10 @@ var N = {
|
|
|
60
60
|
Item: p,
|
|
61
61
|
Trigger: l,
|
|
62
62
|
Content: c,
|
|
63
|
-
Link:
|
|
63
|
+
Link: g,
|
|
64
64
|
Icon: u,
|
|
65
|
-
Portal:
|
|
66
|
-
Positioner:
|
|
65
|
+
Portal: m,
|
|
66
|
+
Positioner: h,
|
|
67
67
|
Popup: f,
|
|
68
68
|
Viewport: v
|
|
69
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.js","names":[],"sources":["../../src/components/navigation-menu/navigation-menu.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { NavigationMenu as BaseNav } from \"@base-ui/react/navigation-menu\";\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 BaseNav.Root>) {\n return (\n <BaseNav.Root className={cn(\"relative min-w-max\", className)} {...props} />\n );\n}\n\nfunction List({ className, ...props }: StyledProps<typeof BaseNav.List>) {\n return (\n <BaseNav.List\n className={cn(\"relative flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nconst Item = BaseNav.Item;\nconst Icon = BaseNav.Icon;\n\nfunction Trigger({ className, ...props }: StyledProps<typeof BaseNav.Trigger>) {\n return (\n <BaseNav.Trigger\n className={cn(\n \"outline-pho-brand text-pho-secondary hover:bg-pho-
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":[],"sources":["../../src/components/navigation-menu/navigation-menu.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { NavigationMenu as BaseNav } from \"@base-ui/react/navigation-menu\";\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 BaseNav.Root>) {\n return (\n <BaseNav.Root className={cn(\"relative min-w-max\", className)} {...props} />\n );\n}\n\nfunction List({ className, ...props }: StyledProps<typeof BaseNav.List>) {\n return (\n <BaseNav.List\n className={cn(\"relative flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nconst Item = BaseNav.Item;\nconst Icon = BaseNav.Icon;\n\nfunction Trigger({ className, ...props }: StyledProps<typeof BaseNav.Trigger>) {\n return (\n <BaseNav.Trigger\n className={cn(\n \"outline-pho-brand text-pho-secondary hover:bg-pho-ghost-hover data-[popup-open]:bg-pho-ghost-hover inline-flex cursor-pointer items-center gap-1 rounded-md px-3 py-2 text-sm font-medium transition focus-visible:outline-2 focus-visible:-outline-offset-1\",\n \"[&>svg]:size-4 [&>svg]:transition-transform [&>svg]:duration-150 data-[popup-open]:[&>svg]:rotate-180\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({ className, ...props }: StyledProps<typeof BaseNav.Content>) {\n return <BaseNav.Content className={cn(\"w-full p-2\", className)} {...props} />;\n}\n\nfunction Link({ className, ...props }: StyledProps<typeof BaseNav.Link>) {\n return (\n <BaseNav.Link\n className={cn(\n \"outline-pho-brand text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-primary block rounded-lg px-3 py-2 text-sm transition focus-visible:outline-2 focus-visible:-outline-offset-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst Portal = BaseNav.Portal;\n\nfunction Positioner({\n className,\n sideOffset = 8,\n ...props\n}: StyledProps<typeof BaseNav.Positioner>) {\n return (\n <BaseNav.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseNav.Popup>) {\n return (\n <BaseNav.Popup\n className={cn(\n \"squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary relative h-[var(--popup-height)] w-[var(--popup-width)] origin-[var(--transform-origin)] rounded-xl ring-1 transition-[opacity,transform,width,height] duration-150 ease-out outline-none ring-inset\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseNav.Viewport>) {\n return (\n <BaseNav.Viewport\n className={cn(\"relative h-full w-full overflow-hidden\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Site navigation menu built on Base UI `NavigationMenu` — a horizontal bar\n * whose items open animated dropdown panels that resize to their content. Each\n * `Item` pairs a `Trigger` with `Content` (rendered into the shared\n * `Viewport`). Use it for primary site nav with grouped links; for app action\n * menus use `Menu`.\n */\nexport const NavigationMenu = {\n Root,\n List,\n Item,\n Trigger,\n Content,\n Link,\n Icon,\n Portal,\n Positioner,\n Popup,\n Viewport,\n};\n"],"mappings":";;;;;AAYA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA2C;AACvE,SACE,gBAAA,EAAC,EAAQ,MAAT;AAAA,IAAc,WAAW,EAAG,sBAAsB,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA2C;AACvE,SACE,gBAAA,EAAC,EAAQ,MAAT;AAAA,IACE,WAAW,EAAG,oCAAoC,CAAS;AAAA,IAC3D,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,IAAM,IAAO,EAAQ,MACf,IAAO,EAAQ;AAErB,SAAS,EAAQ,EAAE,WAAA,GAAW,GAAG,EAAA,GAA8C;AAC7E,SACE,gBAAA,EAAC,EAAQ,SAAT;AAAA,IACE,WAAW,EACT,gQACA,yGACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAQ,EAAE,WAAA,GAAW,GAAG,EAAA,GAA8C;AAC7E,SAAO,gBAAA,EAAC,EAAQ,SAAT;AAAA,IAAiB,WAAW,EAAG,cAAc,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAC9E;AAEA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA2C;AACvE,SACE,gBAAA,EAAC,EAAQ,MAAT;AAAA,IACE,WAAW,EACT,8LACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,IAAM,IAAS,EAAQ;AAEvB,SAAS,EAAW,EAClB,WAAA,GACA,YAAA,IAAa,GACb,GAAG,EAAA,GACsC;AACzC,SACE,gBAAA,EAAC,EAAQ,YAAT;AAAA,IACc,YAAA;AAAA,IACZ,WAAW,EAAG,QAAQ,CAAS;AAAA,IAC/B,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA4C;AACzE,SACE,gBAAA,EAAC,EAAQ,OAAT;AAAA,IACE,WAAW,EACT,kRACA,kEACA,8DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAS,EAChB,WAAA,GACA,GAAG,EAAA,GACoC;AACvC,SACE,gBAAA,EAAC,EAAQ,UAAT;AAAA,IACE,WAAW,EAAG,0CAA0C,CAAS;AAAA,IACjE,GAAI;AAAA,EACL,CAAA;AAEL;AASA,IAAa,IAAiB;AAAA,EAC5B,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t } from "../chunks/cn-
|
|
2
|
+
import { t } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import { t as v } from "../chunks/resolve-variant-CcD8iG5l.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
6
|
-
import { CheckCircle as N, Info as
|
|
6
|
+
import { CheckCircle as N, Info as a, WarningCircle as l, X as y } from "@phosphor-icons/react";
|
|
7
7
|
var w = {
|
|
8
8
|
brand: {
|
|
9
9
|
classes: "text-fg-pho-brand",
|
|
@@ -26,18 +26,18 @@ var w = {
|
|
|
26
26
|
description: "Something went wrong"
|
|
27
27
|
}
|
|
28
28
|
}, C = {
|
|
29
|
-
brand:
|
|
30
|
-
gray:
|
|
29
|
+
brand: a,
|
|
30
|
+
gray: a,
|
|
31
31
|
success: N,
|
|
32
32
|
warning: l,
|
|
33
33
|
error: l
|
|
34
|
-
}, c = "cursor-pointer text-sm font-
|
|
35
|
-
function I({ color: i = "brand", title: d, description:
|
|
36
|
-
const g = u ?? C[i], b = !!
|
|
34
|
+
}, c = "cursor-pointer text-sm font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
35
|
+
function I({ color: i = "brand", title: d, description: s, confirmLabel: n, onConfirm: p, dismissLabel: h = "Dismiss", onClose: o, icon: u, className: m, ref: f, ...x }) {
|
|
36
|
+
const g = u ?? C[i], b = !!n;
|
|
37
37
|
return /* @__PURE__ */ r("div", {
|
|
38
38
|
ref: f,
|
|
39
39
|
...x,
|
|
40
|
-
className: t("squircle ring-pho-
|
|
40
|
+
className: t("squircle ring-pho-secondary bg-pho-primary shadow-pho-lg relative flex w-full max-w-sm gap-4 rounded-xl p-4 ring-1 ring-inset", m),
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ e(g, {
|
|
43
43
|
"aria-hidden": "true",
|
|
@@ -50,30 +50,30 @@ function I({ color: i = "brand", title: d, description: o, confirmLabel: a, onCo
|
|
|
50
50
|
children: [/* @__PURE__ */ e("p", {
|
|
51
51
|
className: "text-pho-primary text-sm font-semibold",
|
|
52
52
|
children: d
|
|
53
|
-
}),
|
|
53
|
+
}), s != null && s !== !1 && /* @__PURE__ */ e("p", {
|
|
54
54
|
className: "text-pho-tertiary text-sm",
|
|
55
|
-
children:
|
|
55
|
+
children: s
|
|
56
56
|
})]
|
|
57
57
|
}), b && /* @__PURE__ */ r("div", {
|
|
58
58
|
className: "flex gap-4",
|
|
59
59
|
children: [/* @__PURE__ */ e("button", {
|
|
60
60
|
type: "button",
|
|
61
61
|
onClick: p,
|
|
62
|
-
className: t(c, "text-pho-brand hover:
|
|
63
|
-
children:
|
|
62
|
+
className: t(c, "text-pho-brand hover:underline"),
|
|
63
|
+
children: n
|
|
64
64
|
}), /* @__PURE__ */ e("button", {
|
|
65
65
|
type: "button",
|
|
66
|
-
onClick:
|
|
66
|
+
onClick: o,
|
|
67
67
|
className: t(c, "text-pho-secondary hover:text-pho-secondary-hover"),
|
|
68
68
|
children: h
|
|
69
69
|
})]
|
|
70
70
|
})]
|
|
71
71
|
}),
|
|
72
|
-
|
|
72
|
+
o && /* @__PURE__ */ e("button", {
|
|
73
73
|
type: "button",
|
|
74
|
-
onClick:
|
|
74
|
+
onClick: o,
|
|
75
75
|
"aria-label": "Dismiss",
|
|
76
|
-
className: "text-fg-pho-quaternary hover:text-fg-pho-quaternary-hover hover:bg-pho-
|
|
76
|
+
className: "text-fg-pho-quaternary hover:text-fg-pho-quaternary-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-md transition focus-visible:outline-2 [&>svg]:size-4",
|
|
77
77
|
children: /* @__PURE__ */ e(y, {
|
|
78
78
|
"aria-hidden": "true",
|
|
79
79
|
weight: "bold"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","names":[],"sources":["../../src/components/notification/notification.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport {\n CheckCircle,\n Info,\n WarningCircle,\n X,\n type Icon,\n} from \"@phosphor-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-fg-pho-brand\",\n description: \"Informational / product update (default)\",\n },\n gray: {\n classes: \"text-fg-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-fg-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: Info,\n gray: Info,\n success: CheckCircle,\n warning: WarningCircle,\n error: WarningCircle,\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-sm font-
|
|
1
|
+
{"version":3,"file":"notification.js","names":[],"sources":["../../src/components/notification/notification.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport {\n CheckCircle,\n Info,\n WarningCircle,\n X,\n type Icon,\n} from \"@phosphor-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-fg-pho-brand\",\n description: \"Informational / product update (default)\",\n },\n gray: {\n classes: \"text-fg-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-fg-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: Info,\n gray: Info,\n success: CheckCircle,\n warning: WarningCircle,\n error: WarningCircle,\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-sm 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 `AlertDialog` 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 \"squircle ring-pho-secondary bg-pho-primary shadow-pho-lg relative flex w-full max-w-sm gap-4 rounded-xl 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 text-sm font-semibold\">{title}</p>\n {description != null && description !== false && (\n <p className=\"text-pho-tertiary text-sm\">{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-fg-pho-quaternary hover:text-fg-pho-quaternary-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-md transition focus-visible:outline-2 [&>svg]:size-4\"\n >\n <X aria-hidden=\"true\" weight=\"bold\" />\n </button>\n )}\n </div>\n );\n}\n\nNotification.displayName = \"Notification\";\n"],"mappings":";;;;;;AAwBA,IAAa,IAAsB;AAAA,EACjC,OAAO;AAAA,IACL,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AACF,GAKM,IAAW;AAAA,EACf,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GA0BM,IACJ;AAcF,SAAgB,EAAa,EAC3B,OAAA,IAAQ,SACR,OAAA,GACA,aAAA,GACA,cAAA,GACA,WAAA,GACA,cAAA,IAAe,WACf,SAAA,GACA,MAAA,GACA,WAAA,GACA,KAAA,GACA,GAAG,EAAA,GACiB;AACpB,QAAM,IAAQ,KAAQ,EAAS,CAAA,GACzB,IAAc,EAAQ;AAE5B,SACE,gBAAA,EAAC,OAAD;AAAA,IACO,KAAA;AAAA,IACL,GAAI;AAAA,IACJ,WAAW,EAET,iIACA,CACF;AAAA,cAPF;AAAA,MASE,gBAAA,EAAC,GAAD;AAAA,QACE,eAAY;AAAA,QACZ,WAAW,EACT,0BACA,EAAe,GAAqB,CAAK,CAC3C;AAAA,MACD,CAAA;AAAA,MAED,gBAAA,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,kBAAf,CACE,gBAAA,EAAC,OAAD;AAAA,UAAK,WAAU;AAAA,oBAAf,CACE,gBAAA,EAAC,KAAD;AAAA,YAAG,WAAU;AAAA,sBAA0C;AAAA,UAAS,CAAA,GAC/D,KAAe,QAAQ,MAAgB,MACtC,gBAAA,EAAC,KAAD;AAAA,YAAG,WAAU;AAAA,sBAA6B;AAAA,UAAe,CAAA,CAExD;AAAA,YAEJ,KACC,gBAAA,EAAC,OAAD;AAAA,UAAK,WAAU;AAAA,oBAAf,CACE,gBAAA,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAW,EACT,GAEA,gCACF;AAAA,sBAEC;AAAA,UACK,CAAA,GACR,gBAAA,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAW,EACT,GACA,mDACF;AAAA,sBAEC;AAAA,UACK,CAAA,CACL;AAAA,UAEJ;AAAA;MAEJ,KACC,gBAAA,EAAC,UAAD;AAAA,QACE,MAAK;AAAA,QACL,SAAS;AAAA,QACT,cAAW;AAAA,QACX,WAAU;AAAA,kBAEV,gBAAA,EAAC,GAAD;AAAA,UAAG,eAAY;AAAA,UAAO,QAAO;AAAA,QAAQ,CAAA;AAAA,MAC/B,CAAA;AAAA,IAEP;AAAA;AAET;AAEA,EAAa,cAAc"}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t
|
|
2
|
+
import { t } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
-
import { NumberField as
|
|
5
|
+
import { NumberField as n } from "@base-ui/react/number-field";
|
|
6
6
|
function i({ className: r, ...e }) {
|
|
7
|
-
return /* @__PURE__ */ o(
|
|
8
|
-
className:
|
|
7
|
+
return /* @__PURE__ */ o(n.Root, {
|
|
8
|
+
className: t("flex flex-col gap-1.5", r),
|
|
9
9
|
...e
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
function s({ className: r, ...e }) {
|
|
13
|
-
return /* @__PURE__ */ o(
|
|
14
|
-
className:
|
|
13
|
+
return /* @__PURE__ */ o(n.Group, {
|
|
14
|
+
className: t("bg-pho-primary ring-pho-primary inline-flex items-stretch rounded-lg ring-1 transition-shadow duration-100 ease-linear ring-inset", "has-[input:focus-visible]:ring-pho-brand has-[input:focus-visible]:ring-2", r),
|
|
15
15
|
...e
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
var a =
|
|
18
|
+
var a = t("text-fg-pho-quaternary hover:text-fg-pho-quaternary-hover hover:bg-pho-primary-hover flex w-9 cursor-pointer items-center justify-center transition duration-100 ease-linear select-none first:rounded-l-lg last:rounded-r-lg", "disabled:cursor-not-allowed disabled:opacity-50 [&>svg]:size-4");
|
|
19
19
|
function u({ className: r, ...e }) {
|
|
20
|
-
return /* @__PURE__ */ o(
|
|
21
|
-
className:
|
|
20
|
+
return /* @__PURE__ */ o(n.Decrement, {
|
|
21
|
+
className: t(a, r),
|
|
22
22
|
...e
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function c({ className: r, ...e }) {
|
|
26
|
-
return /* @__PURE__ */ o(
|
|
27
|
-
className:
|
|
26
|
+
return /* @__PURE__ */ o(n.Increment, {
|
|
27
|
+
className: t(a, r),
|
|
28
28
|
...e
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
function l({ className: r, ...e }) {
|
|
32
|
-
return /* @__PURE__ */ o(
|
|
33
|
-
className:
|
|
32
|
+
return /* @__PURE__ */ o(n.Input, {
|
|
33
|
+
className: t("text-pho-primary placeholder:text-pho-placeholder text-md border-pho-secondary w-16 border-x bg-transparent px-2 py-2 text-center tabular-nums outline-none", r),
|
|
34
34
|
...e
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
function p({ className: r, ...e }) {
|
|
38
|
-
return /* @__PURE__ */ o(
|
|
39
|
-
className:
|
|
38
|
+
return /* @__PURE__ */ o(n.ScrubArea, {
|
|
39
|
+
className: t("cursor-ew-resize select-none", r),
|
|
40
40
|
...e
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var b = {
|
|
44
44
|
Root: i,
|
|
45
45
|
Group: s,
|
|
46
46
|
Decrement: u,
|
|
47
47
|
Increment: c,
|
|
48
48
|
Input: l,
|
|
49
49
|
ScrubArea: p,
|
|
50
|
-
ScrubAreaCursor:
|
|
50
|
+
ScrubAreaCursor: n.ScrubAreaCursor
|
|
51
51
|
};
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
b as NumberField
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
//# sourceMappingURL=number-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-field.js","names":[],"sources":["../../src/components/number-field/number-field.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { NumberField as BaseNumberField } from \"@base-ui/react/number-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({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.Root>) {\n return (\n <BaseNumberField.Root\n className={cn(\"flex flex-col gap-1.5\", className)}\n {...props}\n />\n );\n}\n\nfunction Group({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.Group>) {\n return (\n <BaseNumberField.Group\n className={cn(\n \"bg-pho-primary
|
|
1
|
+
{"version":3,"file":"number-field.js","names":[],"sources":["../../src/components/number-field/number-field.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { NumberField as BaseNumberField } from \"@base-ui/react/number-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({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.Root>) {\n return (\n <BaseNumberField.Root\n className={cn(\"flex flex-col gap-1.5\", className)}\n {...props}\n />\n );\n}\n\nfunction Group({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.Group>) {\n return (\n <BaseNumberField.Group\n className={cn(\n // Flat field surface — the ring hairline carries the edge (no shadow;\n // shadows are reserved for floating layers). `transition-shadow` still\n // animates the focus ring, which Tailwind renders as a box-shadow.\n \"bg-pho-primary ring-pho-primary inline-flex items-stretch rounded-lg ring-1 transition-shadow duration-100 ease-linear ring-inset\",\n \"has-[input:focus-visible]:ring-pho-brand has-[input:focus-visible]:ring-2\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst STEPPER = cn(\n \"text-fg-pho-quaternary hover:text-fg-pho-quaternary-hover hover:bg-pho-primary-hover flex w-9 cursor-pointer items-center justify-center transition duration-100 ease-linear select-none first:rounded-l-lg last:rounded-r-lg\",\n \"disabled:cursor-not-allowed disabled:opacity-50 [&>svg]:size-4\",\n);\n\nfunction Decrement({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.Decrement>) {\n return (\n <BaseNumberField.Decrement className={cn(STEPPER, className)} {...props} />\n );\n}\n\nfunction Increment({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.Increment>) {\n return (\n <BaseNumberField.Increment className={cn(STEPPER, className)} {...props} />\n );\n}\n\nfunction Input({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.Input>) {\n return (\n <BaseNumberField.Input\n className={cn(\n \"text-pho-primary placeholder:text-pho-placeholder text-md border-pho-secondary w-16 border-x bg-transparent px-2 py-2 text-center tabular-nums outline-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ScrubArea({\n className,\n ...props\n}: StyledProps<typeof BaseNumberField.ScrubArea>) {\n return (\n <BaseNumberField.ScrubArea\n className={cn(\"cursor-ew-resize select-none\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Numeric input with stepper buttons, built on Base UI `NumberField`. Compose\n * `NumberField.Group` with a `Decrement`, `Input`, and `Increment`; it handles\n * clamping, keyboard step, and pointer scrubbing. Use it over a plain text\n * input whenever the value is a number with a sensible range.\n */\nexport const NumberField = {\n Root,\n Group,\n Decrement,\n Increment,\n Input,\n ScrubArea,\n ScrubAreaCursor: BaseNumberField.ScrubAreaCursor,\n};\n"],"mappings":";;;;;AAYA,SAAS,EAAK,EACZ,WAAA,GACA,GAAG,EAAA,GACwC;AAC3C,SACE,gBAAA,EAAC,EAAgB,MAAjB;AAAA,IACE,WAAW,EAAG,yBAAyB,CAAS;AAAA,IAChD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAgB,OAAjB;AAAA,IACE,WAAW,EAIT,qIACA,6EACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,IAAM,IAAU,EACd,iOACA,gEACF;AAEA,SAAS,EAAU,EACjB,WAAA,GACA,GAAG,EAAA,GAC6C;AAChD,SACE,gBAAA,EAAC,EAAgB,WAAjB;AAAA,IAA2B,WAAW,EAAG,GAAS,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAU,EACjB,WAAA,GACA,GAAG,EAAA,GAC6C;AAChD,SACE,gBAAA,EAAC,EAAgB,WAAjB;AAAA,IAA2B,WAAW,EAAG,GAAS,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAgB,OAAjB;AAAA,IACE,WAAW,EACT,+JACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAU,EACjB,WAAA,GACA,GAAG,EAAA,GAC6C;AAChD,SACE,gBAAA,EAAC,EAAgB,WAAjB;AAAA,IACE,WAAW,EAAG,gCAAgC,CAAS;AAAA,IACvD,GAAI;AAAA,EACL,CAAA;AAEL;AAQA,IAAa,IAAc;AAAA,EACzB,MAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,iBAAiB,EAAgB;AACnC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as r } from "../chunks/cn-
|
|
2
|
+
import { t as r } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as e } from "react/jsx-runtime";
|
|
5
|
-
import { OTPField as
|
|
6
|
-
function s({ className:
|
|
7
|
-
return /* @__PURE__ */ e(
|
|
5
|
+
import { OTPField as t } from "@base-ui/react/otp-field";
|
|
6
|
+
function s({ className: o, length: i, ...a }) {
|
|
7
|
+
return /* @__PURE__ */ e(t.Root, {
|
|
8
8
|
length: i,
|
|
9
|
-
className: r("flex items-center gap-2",
|
|
9
|
+
className: r("flex items-center gap-2", o),
|
|
10
10
|
...a,
|
|
11
|
-
children: Array.from({ length: i }, (
|
|
11
|
+
children: Array.from({ length: i }, (l, n) => /* @__PURE__ */ e(t.Input, { className: r("squircle bg-pho-primary ring-pho-primary text-pho-primary size-11 rounded-lg text-center text-lg font-medium ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset", "focus-visible:ring-pho-brand focus-visible:ring-2", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50") }, n))
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
s.displayName = "OtpField";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-field.js","names":[],"sources":["../../src/components/otp-field/otp-field.tsx"],"sourcesContent":["import { type ComponentProps } from \"react\";\nimport { OTPField as BaseOTPField } from \"@base-ui/react/otp-field\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface OtpFieldProps extends Omit<\n ComponentProps<typeof BaseOTPField.Root>,\n \"className\"\n> {\n /** Class applied to the cell row. */\n className?: string;\n /** Number of single-character cells. */\n length: number;\n}\n\n/**\n * One-time-code input built on Base UI `OTPField` — a row of single-character\n * cells with paste, arrow-key, and auto-advance handling. Control with `value`\n * / `onValueChange`, or read the completed code via `onValueChange`.\n */\nexport function OtpField({ className, length, ...props }: OtpFieldProps) {\n return (\n <BaseOTPField.Root\n length={length}\n className={cn(\"flex items-center gap-2\", className)}\n {...props}\n >\n {Array.from({ length }, (_, i) => (\n <BaseOTPField.Input\n key={i}\n className={cn(\n \"squircle bg-pho-primary
|
|
1
|
+
{"version":3,"file":"otp-field.js","names":[],"sources":["../../src/components/otp-field/otp-field.tsx"],"sourcesContent":["import { type ComponentProps } from \"react\";\nimport { OTPField as BaseOTPField } from \"@base-ui/react/otp-field\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface OtpFieldProps extends Omit<\n ComponentProps<typeof BaseOTPField.Root>,\n \"className\"\n> {\n /** Class applied to the cell row. */\n className?: string;\n /** Number of single-character cells. */\n length: number;\n}\n\n/**\n * One-time-code input built on Base UI `OTPField` — a row of single-character\n * cells with paste, arrow-key, and auto-advance handling. Control with `value`\n * / `onValueChange`, or read the completed code via `onValueChange`.\n */\nexport function OtpField({ className, length, ...props }: OtpFieldProps) {\n return (\n <BaseOTPField.Root\n length={length}\n className={cn(\"flex items-center gap-2\", className)}\n {...props}\n >\n {Array.from({ length }, (_, i) => (\n <BaseOTPField.Input\n key={i}\n className={cn(\n // Flat field surface — shadows are reserved for floating layers;\n // the 15% ring-pho-primary hairline carries the input edge.\n \"squircle bg-pho-primary ring-pho-primary text-pho-primary size-11 rounded-lg text-center text-lg font-medium ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset\",\n \"focus-visible:ring-pho-brand focus-visible:ring-2\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n )}\n />\n ))}\n </BaseOTPField.Root>\n );\n}\n\nOtpField.displayName = \"OtpField\";\n"],"mappings":";;;;;AAmBA,SAAgB,EAAS,EAAE,WAAA,GAAW,QAAA,GAAQ,GAAG,EAAA,GAAwB;AACvE,SACE,gBAAA,EAAC,EAAa,MAAd;AAAA,IACU,QAAA;AAAA,IACR,WAAW,EAAG,2BAA2B,CAAS;AAAA,IAClD,GAAI;AAAA,cAEH,MAAM,KAAK,EAAE,QAAA,EAAO,GAAA,CAAI,GAAG,MAC1B,gBAAA,EAAC,EAAa,OAAd,EAEE,WAAW,EAGT,0LACA,qDACA,+DACF,EACD,GARM,CAQN,CACF;AAAA,EACgB,CAAA;AAEvB;AAEA,EAAS,cAAc"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../chunks/cn-
|
|
2
|
+
import { t as e } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
5
|
import { Popover as t } from "@base-ui/react/popover";
|
|
6
6
|
var n = t.Root, s = t.Trigger, p = t.Portal, l = t.Close;
|
|
7
|
-
function m({ className: r, sideOffset: o = 8, ...
|
|
8
|
-
return /* @__PURE__ */
|
|
7
|
+
function m({ className: r, sideOffset: o = 8, ...i }) {
|
|
8
|
+
return /* @__PURE__ */ a(t.Positioner, {
|
|
9
9
|
sideOffset: o,
|
|
10
10
|
className: e("z-50", r),
|
|
11
|
-
...
|
|
11
|
+
...i
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function c({ className: r, ...o }) {
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
className: e("squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-
|
|
15
|
+
return /* @__PURE__ */ a(t.Popup, {
|
|
16
|
+
className: e("squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary max-w-[calc(100vw-2rem)] origin-[var(--transform-origin)] rounded-xl p-4 ring-1 transition-[transform,opacity] duration-150 ease-out outline-none ring-inset", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", r),
|
|
17
17
|
...o
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function u({ className: r, ...o }) {
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ a(t.Title, {
|
|
22
22
|
className: e("text-pho-primary text-sm font-semibold", r),
|
|
23
23
|
...o
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
function g({ className: r, ...o }) {
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ a(t.Description, {
|
|
28
28
|
className: e("text-pho-tertiary mt-1 text-sm", r),
|
|
29
29
|
...o
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":[],"sources":["../../src/components/popover/popover.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\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 = BasePopover.Root;\nconst Trigger = BasePopover.Trigger;\nconst Portal = BasePopover.Portal;\nconst Close = BasePopover.Close;\n\nfunction Positioner({\n className,\n sideOffset = 8,\n ...props\n}: StyledProps<typeof BasePopover.Positioner>) {\n return (\n <BasePopover.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BasePopover.Popup>) {\n return (\n <BasePopover.Popup\n className={cn(\n \"squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-
|
|
1
|
+
{"version":3,"file":"popover.js","names":[],"sources":["../../src/components/popover/popover.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\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 = BasePopover.Root;\nconst Trigger = BasePopover.Trigger;\nconst Portal = BasePopover.Portal;\nconst Close = BasePopover.Close;\n\nfunction Positioner({\n className,\n sideOffset = 8,\n ...props\n}: StyledProps<typeof BasePopover.Positioner>) {\n return (\n <BasePopover.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BasePopover.Popup>) {\n return (\n <BasePopover.Popup\n className={cn(\n // Floating layer: keeps shadow elevation; ring-pho-secondary is the\n // site card-hairline edge (#eee / #202020).\n \"squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary max-w-[calc(100vw-2rem)] origin-[var(--transform-origin)] rounded-xl p-4 ring-1 transition-[transform,opacity] duration-150 ease-out outline-none ring-inset\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BasePopover.Title>) {\n return (\n <BasePopover.Title\n className={cn(\"text-pho-primary text-sm font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BasePopover.Description>) {\n return (\n <BasePopover.Description\n className={cn(\"text-pho-tertiary mt-1 text-sm\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Popover built on Base UI `Popover` — a click-triggered floating panel\n * anchored to its trigger, for rich, interactive content (forms, menus of\n * actions, details). Unlike a `Tooltip`, it can hold focusable controls and is\n * dismissed by clicking away or pressing Escape.\n */\nexport const Popover = {\n Root,\n Trigger,\n Portal,\n Positioner,\n Popup,\n Title,\n Description,\n Close,\n};\n"],"mappings":";;;;;AAYA,IAAM,IAAO,EAAY,MACnB,IAAU,EAAY,SACtB,IAAS,EAAY,QACrB,IAAQ,EAAY;AAE1B,SAAS,EAAW,EAClB,WAAA,GACA,YAAA,IAAa,GACb,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAY,YAAb;AAAA,IACc,YAAA;AAAA,IACZ,WAAW,EAAG,QAAQ,CAAS;AAAA,IAC/B,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EAGT,0OACA,kEACA,8DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAAgD;AAC7E,SACE,gBAAA,EAAC,EAAY,OAAb;AAAA,IACE,WAAW,EAAG,0CAA0C,CAAS;AAAA,IACjE,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAY,EACnB,WAAA,GACA,GAAG,EAAA,GAC2C;AAC9C,SACE,gBAAA,EAAC,EAAY,aAAb;AAAA,IACE,WAAW,EAAG,kCAAkC,CAAS;AAAA,IACzD,GAAI;AAAA,EACL,CAAA;AAEL;AAQA,IAAa,IAAU;AAAA,EACrB,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AACF"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
2
|
+
import { t as a } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
5
|
import { PreviewCard as r } from "@base-ui/react/preview-card";
|
|
6
6
|
var n = r.Root, s = r.Trigger, p = r.Portal;
|
|
7
|
-
function g({ className: t, sideOffset:
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
sideOffset:
|
|
10
|
-
className:
|
|
7
|
+
function g({ className: t, sideOffset: o = 8, ...e }) {
|
|
8
|
+
return /* @__PURE__ */ i(r.Positioner, {
|
|
9
|
+
sideOffset: o,
|
|
10
|
+
className: a("z-50", t),
|
|
11
11
|
...e
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
function l({ className: t, ...
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
className:
|
|
17
|
-
...
|
|
14
|
+
function l({ className: t, ...o }) {
|
|
15
|
+
return /* @__PURE__ */ i(r.Popup, {
|
|
16
|
+
className: a("squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary w-72 origin-[var(--transform-origin)] rounded-xl p-4 ring-1 transition-[transform,opacity] duration-150 ease-out outline-none ring-inset", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", t),
|
|
17
|
+
...o
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
var
|
|
20
|
+
var y = {
|
|
21
21
|
Root: n,
|
|
22
22
|
Trigger: s,
|
|
23
23
|
Portal: p,
|
|
@@ -25,7 +25,7 @@ var v = {
|
|
|
25
25
|
Popup: l
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
y as PreviewCard
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
//# sourceMappingURL=preview-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-card.js","names":[],"sources":["../../src/components/preview-card/preview-card.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { PreviewCard as BasePreviewCard } from \"@base-ui/react/preview-card\";\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 = BasePreviewCard.Root;\nconst Trigger = BasePreviewCard.Trigger;\nconst Portal = BasePreviewCard.Portal;\n\nfunction Positioner({\n className,\n sideOffset = 8,\n ...props\n}: StyledProps<typeof BasePreviewCard.Positioner>) {\n return (\n <BasePreviewCard.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({\n className,\n ...props\n}: StyledProps<typeof BasePreviewCard.Popup>) {\n return (\n <BasePreviewCard.Popup\n className={cn(\n \"squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-
|
|
1
|
+
{"version":3,"file":"preview-card.js","names":[],"sources":["../../src/components/preview-card/preview-card.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { PreviewCard as BasePreviewCard } from \"@base-ui/react/preview-card\";\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 = BasePreviewCard.Root;\nconst Trigger = BasePreviewCard.Trigger;\nconst Portal = BasePreviewCard.Portal;\n\nfunction Positioner({\n className,\n sideOffset = 8,\n ...props\n}: StyledProps<typeof BasePreviewCard.Positioner>) {\n return (\n <BasePreviewCard.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({\n className,\n ...props\n}: StyledProps<typeof BasePreviewCard.Popup>) {\n return (\n <BasePreviewCard.Popup\n className={cn(\n \"squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary w-72 origin-[var(--transform-origin)] rounded-xl p-4 ring-1 transition-[transform,opacity] duration-150 ease-out outline-none ring-inset\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Preview card built on Base UI `PreviewCard` — a hover-triggered card that\n * previews what's behind a link (a profile, a repo, an article). Like a\n * `Tooltip` it opens on hover/focus, but it holds richer, non-essential\n * content. Keep the underlying link fully usable without opening the card.\n */\nexport const PreviewCard = { Root, Trigger, Portal, Positioner, Popup };\n"],"mappings":";;;;;AAYA,IAAM,IAAO,EAAgB,MACvB,IAAU,EAAgB,SAC1B,IAAS,EAAgB;AAE/B,SAAS,EAAW,EAClB,WAAA,GACA,YAAA,IAAa,GACb,GAAG,EAAA,GAC8C;AACjD,SACE,gBAAA,EAAC,EAAgB,YAAjB;AAAA,IACc,YAAA;AAAA,IACZ,WAAW,EAAG,QAAQ,CAAS;AAAA,IAC/B,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAgB,OAAjB;AAAA,IACE,WAAW,EACT,sNACA,kEACA,8DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAQA,IAAa,IAAc;AAAA,EAAE,MAAA;AAAA,EAAM,SAAA;AAAA,EAAS,QAAA;AAAA,EAAQ,YAAA;AAAA,EAAY,OAAA;AAAM"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as s } from "../chunks/cn-
|
|
2
|
+
import { t as s } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
5
5
|
import { Radio as a } from "@base-ui/react/radio";
|
|
6
6
|
import { RadioGroup as d } from "@base-ui/react/radio-group";
|
|
7
|
-
function l({ className:
|
|
7
|
+
function l({ className: r, ...e }) {
|
|
8
8
|
return /* @__PURE__ */ o(d, {
|
|
9
|
-
className: s("flex flex-col gap-3",
|
|
9
|
+
className: s("flex flex-col gap-3", r),
|
|
10
10
|
...e
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
l.displayName = "RadioGroup";
|
|
14
|
-
function c({ className:
|
|
15
|
-
const
|
|
16
|
-
className: s("squircle outline-pho-brand bg-pho-primary
|
|
14
|
+
function c({ className: r, label: e, ...t }) {
|
|
15
|
+
const i = /* @__PURE__ */ o(a.Root, {
|
|
16
|
+
className: s("squircle outline-pho-brand bg-pho-primary ring-pho-primary flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full ring-1 transition duration-100 ease-linear ring-inset focus-visible:outline-2 focus-visible:outline-offset-2", "data-[checked]:bg-pho-brand-solid data-[checked]:ring-transparent", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", r),
|
|
17
17
|
...t,
|
|
18
|
-
children: /* @__PURE__ */ o(a.Indicator, { className: "size-2 rounded-full
|
|
18
|
+
children: /* @__PURE__ */ o(a.Indicator, { className: "bg-pho-on-brand size-2 rounded-full" })
|
|
19
19
|
});
|
|
20
20
|
return e ? /* @__PURE__ */ n("label", {
|
|
21
21
|
className: "flex cursor-pointer items-center gap-2 select-none",
|
|
22
|
-
children: [
|
|
22
|
+
children: [i, /* @__PURE__ */ o("span", {
|
|
23
23
|
className: "text-pho-secondary text-sm",
|
|
24
24
|
children: e
|
|
25
25
|
})]
|
|
26
|
-
}) :
|
|
26
|
+
}) : i;
|
|
27
27
|
}
|
|
28
28
|
c.displayName = "Radio";
|
|
29
29
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","names":[],"sources":["../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["import { type ComponentProps, type ReactNode } from \"react\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface RadioGroupProps extends Omit<\n ComponentProps<typeof BaseRadioGroup>,\n \"className\"\n> {\n className?: string;\n}\n\n/**\n * Single-choice group built on Base UI `RadioGroup`. Holds `Radio` items;\n * exactly one may be selected. Control with `value` / `onValueChange` or leave\n * uncontrolled with `defaultValue`.\n */\nexport function RadioGroup({ className, ...props }: RadioGroupProps) {\n return (\n <BaseRadioGroup\n className={cn(\"flex flex-col gap-3\", className)}\n {...props}\n />\n );\n}\n\nRadioGroup.displayName = \"RadioGroup\";\n\nexport interface RadioProps extends Omit<\n ComponentProps<typeof BaseRadio.Root>,\n \"className\"\n> {\n className?: string;\n /** Text rendered beside the dot; the whole row selects this option. */\n label?: ReactNode;\n}\n\n/**\n * A single option within a `RadioGroup`. Requires a `value`; pass `label` for a\n * clickable text row or provide an `aria-label`.\n */\nexport function Radio({ className, label, ...props }: RadioProps) {\n const dot = (\n <BaseRadio.Root\n className={cn(\n \"squircle outline-pho-brand bg-pho-primary
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":[],"sources":["../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["import { type ComponentProps, type ReactNode } from \"react\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface RadioGroupProps extends Omit<\n ComponentProps<typeof BaseRadioGroup>,\n \"className\"\n> {\n className?: string;\n}\n\n/**\n * Single-choice group built on Base UI `RadioGroup`. Holds `Radio` items;\n * exactly one may be selected. Control with `value` / `onValueChange` or leave\n * uncontrolled with `defaultValue`.\n */\nexport function RadioGroup({ className, ...props }: RadioGroupProps) {\n return (\n <BaseRadioGroup\n className={cn(\"flex flex-col gap-3\", className)}\n {...props}\n />\n );\n}\n\nRadioGroup.displayName = \"RadioGroup\";\n\nexport interface RadioProps extends Omit<\n ComponentProps<typeof BaseRadio.Root>,\n \"className\"\n> {\n className?: string;\n /** Text rendered beside the dot; the whole row selects this option. */\n label?: ReactNode;\n}\n\n/**\n * A single option within a `RadioGroup`. Requires a `value`; pass `label` for a\n * clickable text row or provide an `aria-label`.\n */\nexport function Radio({ className, label, ...props }: RadioProps) {\n const dot = (\n <BaseRadio.Root\n className={cn(\n \"squircle outline-pho-brand bg-pho-primary ring-pho-primary flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full ring-1 transition duration-100 ease-linear ring-inset focus-visible:outline-2 focus-visible:outline-offset-2\",\n \"data-[checked]:bg-pho-brand-solid data-[checked]:ring-transparent\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n >\n {/* The indicator only renders when checked, i.e. always on brand-solid —\n on-brand (light-dark(#fff,#000)) keeps the dot visible in dark mode,\n where brand-solid is white. */}\n <BaseRadio.Indicator className=\"bg-pho-on-brand size-2 rounded-full\" />\n </BaseRadio.Root>\n );\n\n if (!label) return dot;\n return (\n <label className=\"flex cursor-pointer items-center gap-2 select-none\">\n {dot}\n <span className=\"text-pho-secondary text-sm\">{label}</span>\n </label>\n );\n}\n\nRadio.displayName = \"Radio\";\n"],"mappings":";;;;;;AAiBA,SAAgB,EAAW,EAAE,WAAA,GAAW,GAAG,EAAA,GAA0B;AACnE,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAW,EAAG,uBAAuB,CAAS;AAAA,IAC9C,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,EAAW,cAAc;AAezB,SAAgB,EAAM,EAAE,WAAA,GAAW,OAAA,GAAO,GAAG,EAAA,GAAqB;AAChE,QAAM,IACJ,gBAAA,EAAC,EAAU,MAAX;AAAA,IACE,WAAW,EACT,wPACA,qEACA,iEACA,CACF;AAAA,IACA,GAAI;AAAA,cAKJ,gBAAA,EAAC,EAAU,WAAX,EAAqB,WAAU,sCAAuC,CAAA;AAAA,EACxD,CAAA;AAGlB,SAAK,IAEH,gBAAA,EAAC,SAAD;AAAA,IAAO,WAAU;AAAA,cAAjB,CACG,GACD,gBAAA,EAAC,QAAD;AAAA,MAAM,WAAU;AAAA,gBAA8B;AAAA,IAAY,CAAA,CACrD;AAAA,OALU;AAOrB;AAEA,EAAM,cAAc"}
|