@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,44 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
2
|
+
import { t as n } from "./cn-7uGUzCOM.js";
|
|
3
|
+
import { t as f } from "./close-button-DKaNIndU.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
import { Dialog as r } from "@base-ui/react/dialog";
|
|
7
|
-
var
|
|
7
|
+
var g = r.Root, h = r.Trigger, s = r.Portal, l = r.Close;
|
|
8
8
|
function c({ className: t, ...e }) {
|
|
9
9
|
return /* @__PURE__ */ a(r.Backdrop, {
|
|
10
|
-
className:
|
|
10
|
+
className: n("bg-pho-overlay fixed inset-0 z-50 backdrop-blur-[2px] transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", t),
|
|
11
11
|
...e
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function d({ className: t, ...e }) {
|
|
15
15
|
return /* @__PURE__ */ a(r.Popup, {
|
|
16
|
-
className:
|
|
16
|
+
className: n("squircle border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border outline-none", "transition-all duration-200 ease-out", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", t),
|
|
17
17
|
...e
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function p({ className: t, ...e }) {
|
|
21
21
|
return /* @__PURE__ */ a(r.Title, {
|
|
22
|
-
className:
|
|
22
|
+
className: n("text-pho-primary text-lg font-semibold", t),
|
|
23
23
|
...e
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
function u({ className: t, ...e }) {
|
|
27
27
|
return /* @__PURE__ */ a(r.Description, {
|
|
28
|
-
className:
|
|
28
|
+
className: n("text-pho-tertiary text-sm", t),
|
|
29
29
|
...e
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function v({ title: t, description: e, showClose:
|
|
32
|
+
function v({ title: t, description: e, showClose: i = !0, children: m, className: x, ...y }) {
|
|
33
33
|
return /* @__PURE__ */ o(s, { children: [/* @__PURE__ */ a(c, {}), /* @__PURE__ */ o(d, {
|
|
34
34
|
className: x,
|
|
35
|
-
...
|
|
36
|
-
children: [!!(t || e ||
|
|
35
|
+
...y,
|
|
36
|
+
children: [!!(t || e || i) && /* @__PURE__ */ o("div", {
|
|
37
37
|
className: "flex items-start justify-between gap-4 px-6 pt-5",
|
|
38
38
|
children: [/* @__PURE__ */ o("div", {
|
|
39
39
|
className: "flex flex-col gap-1",
|
|
40
40
|
children: [t && /* @__PURE__ */ a(p, { children: t }), e && /* @__PURE__ */ a(u, { children: e })]
|
|
41
|
-
}),
|
|
41
|
+
}), i && /* @__PURE__ */ a(l, { render: /* @__PURE__ */ a(f, {}) })]
|
|
42
42
|
}), /* @__PURE__ */ a("div", {
|
|
43
43
|
className: "px-6 py-5",
|
|
44
44
|
children: m
|
|
@@ -46,7 +46,7 @@ function v({ title: t, description: e, showClose: n = !0, children: m, className
|
|
|
46
46
|
})] });
|
|
47
47
|
}
|
|
48
48
|
var T = {
|
|
49
|
-
Root:
|
|
49
|
+
Root: g,
|
|
50
50
|
Trigger: h,
|
|
51
51
|
Portal: s,
|
|
52
52
|
Backdrop: c,
|
|
@@ -60,4 +60,4 @@ export {
|
|
|
60
60
|
T as t
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
//# sourceMappingURL=dialog-
|
|
63
|
+
//# sourceMappingURL=dialog-CyyL5VCc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-CyyL5VCc.js","names":[],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType, type ReactNode } from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { cn } from \"../../utils/cn\";\nimport { CloseButton } from \"../button/close-button\";\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 = BaseDialog.Root;\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 backdrop-blur-[2px] transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"squircle border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border outline-none\",\n \"transition-all duration-200 ease-out\",\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 BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\"text-pho-primary text-lg font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\"text-pho-tertiary text-sm\", className)}\n {...props}\n />\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /** Show the top-right close button. @default true */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close). For full control, compose the\n * parts directly (`Dialog.Portal` / `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n title,\n description,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n const hasHeader = Boolean(title || description || showClose);\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex items-start justify-between gap-4 px-6 pt-5\">\n <div className=\"flex flex-col gap-1\">\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n {showClose && <Close render={<CloseButton />} />}\n </div>\n )}\n <div className=\"px-6 py-5\">{children}</div>\n </Popup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`).\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n Title,\n Description,\n Close,\n Content,\n};\n"],"mappings":";;;;;;AAaA,IAAM,IAAO,EAAW,MAClB,IAAU,EAAW,SACrB,IAAS,EAAW,QACpB,IAAQ,EAAW;AAEzB,SAAS,EAAS,EAChB,WAAA,GACA,GAAG,EAAA,GACuC;AAC1C,SACE,gBAAA,EAAC,EAAW,UAAZ;AAAA,IACE,WAAW,EACT,kGACA,iEACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA+C;AAC5E,SACE,gBAAA,EAAC,EAAW,OAAZ;AAAA,IACE,WAAW,EAET,yMACA,wCACA,kEACA,8DACA,CACF;AAAA,IACA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AA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as r } from "./cn-
|
|
2
|
+
import { t as r } from "./cn-7uGUzCOM.js";
|
|
3
3
|
import { useState as E } from "react";
|
|
4
4
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
import { Eye as z, EyeSlash as A, WarningCircle as C } from "@phosphor-icons/react";
|
|
@@ -35,7 +35,7 @@ function _({ label: n, hint: p, size: i = "md", invalid: t, icon: l, labelTraili
|
|
|
35
35
|
}),
|
|
36
36
|
/* @__PURE__ */ s("div", {
|
|
37
37
|
"data-invalid": t || void 0,
|
|
38
|
-
className: r("bg-pho-primary
|
|
38
|
+
className: r("bg-pho-primary ring-pho-primary relative flex w-full items-center 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", "data-[invalid]:ring-pho-error-subtle data-[invalid]:has-[input:focus-visible]:ring-pho-error", "group-data-[disabled]/field:cursor-not-allowed group-data-[disabled]/field:opacity-50", g),
|
|
39
39
|
children: [
|
|
40
40
|
l && /* @__PURE__ */ e(l, { className: r("text-fg-pho-quaternary pointer-events-none absolute", S[i]) }),
|
|
41
41
|
/* @__PURE__ */ e(o.Control, {
|
|
@@ -72,4 +72,4 @@ export {
|
|
|
72
72
|
_ as t
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
//# sourceMappingURL=input-
|
|
75
|
+
//# sourceMappingURL=input-DX7d5MlS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-DX7d5MlS.js","names":[],"sources":["../../src/components/input/input.tsx"],"sourcesContent":["import {\n useState,\n type ComponentType,\n type InputHTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { Eye, EyeSlash, WarningCircle } from \"@phosphor-icons/react\";\nimport { Field } from \"@base-ui/react/field\";\nimport { cn } from \"../../utils/cn\";\n\nexport type InputSize = \"sm\" | \"md\" | \"lg\";\n\nconst SIZE_PAD: Record<InputSize, string> = {\n sm: \"px-3 py-2 text-sm\",\n md: \"px-3 py-2 text-md\",\n lg: \"px-3.5 py-2.5 text-md\",\n};\nconst LEADING_PAD: Record<InputSize, string> = {\n sm: \"pl-9\",\n md: \"pl-10\",\n lg: \"pl-10.5\",\n};\nconst LEADING_ICON_POS: Record<InputSize, string> = {\n sm: \"left-3 size-4\",\n md: \"left-3 size-5\",\n lg: \"left-3.5 size-5\",\n};\n\nexport interface InputProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"size\"\n> {\n /** Field label (associated for accessibility). */\n label?: ReactNode;\n /** Helper text below the field; rendered in the error color when `invalid`. */\n hint?: ReactNode;\n /** Size variant. @default \"md\" */\n size?: InputSize;\n /** Render the invalid state (ring + icon + error-colored hint). */\n invalid?: boolean;\n /** Leading icon component (e.g. a Phosphor icon). */\n icon?: ComponentType<{ className?: string }>;\n /** Node rendered at the right edge of the label row (e.g. \"Forgot?\"). */\n labelTrailing?: ReactNode;\n /** Class applied to the input wrapper. */\n wrapperClassName?: string;\n ref?: Ref<HTMLInputElement>;\n}\n\n/**\n * Text input built on Base UI `Field` (label/description a11y wiring) with\n * Pho's bordered surface, leading icon, invalid state, and a built-in password\n * reveal toggle.\n */\nexport function Input({\n label,\n hint,\n size = \"md\",\n invalid,\n icon: Icon,\n labelTrailing,\n disabled,\n required,\n type = \"text\",\n className,\n wrapperClassName,\n id,\n ref,\n ...props\n}: InputProps) {\n const [reveal, setReveal] = useState(false);\n const isPassword = type === \"password\";\n const resolvedType = isPassword && reveal ? \"text\" : type;\n const hasLeadingIcon = Boolean(Icon);\n const hasTrailingIcon = isPassword || invalid;\n\n return (\n <Field.Root\n disabled={disabled}\n className=\"group/field flex w-full flex-col gap-1.5\"\n >\n {label && (\n <div className=\"flex items-center justify-between gap-2\">\n <Field.Label className=\"text-pho-secondary flex cursor-default items-center gap-0.5 text-sm font-medium\">\n {label}\n {required && <span className=\"text-pho-brand\">*</span>}\n </Field.Label>\n {labelTrailing}\n </div>\n )}\n\n <div\n data-invalid={invalid || undefined}\n className={cn(\n // Flat field surface — hairline ring only; elevation shadows are\n // reserved for floating layers (menus/popovers/dialogs).\n \"bg-pho-primary ring-pho-primary relative flex w-full items-center 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 \"data-[invalid]:ring-pho-error-subtle data-[invalid]:has-[input:focus-visible]:ring-pho-error\",\n \"group-data-[disabled]/field:cursor-not-allowed group-data-[disabled]/field:opacity-50\",\n wrapperClassName,\n )}\n >\n {Icon && (\n <Icon\n className={cn(\n \"text-fg-pho-quaternary pointer-events-none absolute\",\n LEADING_ICON_POS[size],\n )}\n />\n )}\n\n <Field.Control\n ref={ref}\n id={id}\n type={resolvedType}\n required={required}\n {...props}\n className={cn(\n \"text-pho-primary placeholder:text-pho-placeholder m-0 w-full bg-transparent outline-none disabled:cursor-not-allowed\",\n SIZE_PAD[size],\n hasLeadingIcon && LEADING_PAD[size],\n hasTrailingIcon && \"pr-9\",\n className,\n )}\n />\n\n {invalid && !isPassword && (\n <WarningCircle\n weight=\"fill\"\n className=\"text-fg-pho-error pointer-events-none absolute right-3 size-4\"\n />\n )}\n\n {isPassword && (\n <button\n type=\"button\"\n // Reachable by click but skipped in tab order so Tab moves field→field.\n tabIndex={-1}\n aria-label=\"Toggle password visibility\"\n onClick={() => setReveal((v) => !v)}\n className=\"text-fg-pho-quaternary hover:text-fg-pho-quaternary-hover absolute right-3 flex cursor-pointer items-center transition duration-100 ease-linear focus:outline-none\"\n >\n {reveal ? (\n <EyeSlash className=\"size-4\" />\n ) : (\n <Eye className=\"size-4\" />\n )}\n </button>\n )}\n </div>\n\n {hint && (\n <Field.Description\n className={cn(\n \"text-pho-tertiary text-sm\",\n invalid && \"text-pho-error\",\n )}\n >\n {h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AA;AAAA,YACJ,MAAM;AAAA,YACI,UAAA;AAAA,YACV,GAAI;AAAA,YACJ,WAAW,EACT,wHACA,EAAS,CAAA,GACT,KAAkB,EAAY,CAAA,GAC9B,KAAmB,QACnB,CACF;AAAA,UACD,CAAA;AAAA,UAEA,KAAW,CAAC,KACX,gBAAA,EAAC,GAAD;AAAA,YACE,QAAO;AAAA,YACP,WAAU;AAAA,UACX,CAAA;AAAA,UAGF,KACC,gBAAA,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YAEL,UAAU;AAAA,YACV,cAAW;AAAA,YACX,SAAA,MAAe,EAAA,CAAW,MAAM,CAAC,CAAC;AAAA,YAClC,WAAU;AAAA,sBAET,IACC,gBAAA,EAAC,GAAD,EAAU,WAAU,SAAU,CAAA,IAE9B,gBAAA,EAAC,GAAD,EAAK,WAAU,SAAU,CAAA;AAAA,UAErB,CAAA;AAAA,QAEP;AAAA;MAEJ,KACC,gBAAA,EAAC,EAAM,aAAP;AAAA,QACE,WAAW,EACT,6BACA,KAAW,gBACb;AAAA,kBAEC;AAAA,MACgB,CAAA;AAAA,IAEX;AAAA;AAEhB;AAEA,EAAM,cAAc"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as o } from "./cn-7uGUzCOM.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
+
import { Menu as r } from "@base-ui/react/menu";
|
|
6
|
+
import { Separator as p } from "@base-ui/react/separator";
|
|
7
|
+
var u = "squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary origin-[var(--transform-origin)] min-w-44 rounded-xl p-1 ring-1 ring-inset outline-none transition-[transform,opacity] duration-150 ease-out data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0", n = "relative flex cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-2.5 pl-2.5 text-sm text-pho-secondary outline-none select-none data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:text-fg-pho-quaternary", m = r.Root, c = r.Trigger, l = r.Portal, d = r.Group, g = r.RadioGroup, h = r.SubmenuRoot;
|
|
8
|
+
function f({ className: t, sideOffset: e = 6, ...s }) {
|
|
9
|
+
return /* @__PURE__ */ a(r.Positioner, {
|
|
10
|
+
sideOffset: e,
|
|
11
|
+
className: o("z-50", t),
|
|
12
|
+
...s
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function x({ className: t, ...e }) {
|
|
16
|
+
return /* @__PURE__ */ a(r.Popup, {
|
|
17
|
+
className: o(u, t),
|
|
18
|
+
...e
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function b({ className: t, ...e }) {
|
|
22
|
+
return /* @__PURE__ */ a(r.Item, {
|
|
23
|
+
className: o(n, t),
|
|
24
|
+
...e
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function v({ className: t, ...e }) {
|
|
28
|
+
return /* @__PURE__ */ a(r.LinkItem, {
|
|
29
|
+
className: o(n, t),
|
|
30
|
+
...e
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function y({ className: t, ...e }) {
|
|
34
|
+
return /* @__PURE__ */ a(r.GroupLabel, {
|
|
35
|
+
className: o("text-pho-quaternary px-2.5 py-1.5 text-xs font-medium", t),
|
|
36
|
+
...e
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function I({ className: t, ...e }) {
|
|
40
|
+
return /* @__PURE__ */ a(p, {
|
|
41
|
+
className: o("-mx-1 my-1 h-px bg-[var(--border-color-pho-secondary)]", t),
|
|
42
|
+
...e
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function N({ className: t, ...e }) {
|
|
46
|
+
return /* @__PURE__ */ a(r.SubmenuTrigger, {
|
|
47
|
+
className: o(n, "data-[popup-open]:bg-pho-ghost-hover", t),
|
|
48
|
+
...e
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function R({ className: t, ...e }) {
|
|
52
|
+
return /* @__PURE__ */ a(r.CheckboxItem, {
|
|
53
|
+
className: o(n, "pl-8", t),
|
|
54
|
+
...e
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function P({ className: t, ...e }) {
|
|
58
|
+
return /* @__PURE__ */ a(r.RadioItem, {
|
|
59
|
+
className: o(n, "pl-8", t),
|
|
60
|
+
...e
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
var i = "text-pho-brand absolute left-2.5 flex items-center [&>svg]:size-4";
|
|
64
|
+
function C({ className: t, ...e }) {
|
|
65
|
+
return /* @__PURE__ */ a(r.CheckboxItemIndicator, {
|
|
66
|
+
className: o(i, t),
|
|
67
|
+
...e
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function S({ className: t, ...e }) {
|
|
71
|
+
return /* @__PURE__ */ a(r.RadioItemIndicator, {
|
|
72
|
+
className: o(i, t),
|
|
73
|
+
...e
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
var L = {
|
|
77
|
+
Root: m,
|
|
78
|
+
Trigger: c,
|
|
79
|
+
Portal: l,
|
|
80
|
+
Positioner: f,
|
|
81
|
+
Popup: x,
|
|
82
|
+
Item: b,
|
|
83
|
+
LinkItem: v,
|
|
84
|
+
Group: d,
|
|
85
|
+
GroupLabel: y,
|
|
86
|
+
Separator: I,
|
|
87
|
+
SubmenuRoot: h,
|
|
88
|
+
SubmenuTrigger: N,
|
|
89
|
+
CheckboxItem: R,
|
|
90
|
+
CheckboxItemIndicator: C,
|
|
91
|
+
RadioGroup: g,
|
|
92
|
+
RadioItem: P,
|
|
93
|
+
RadioItemIndicator: S
|
|
94
|
+
};
|
|
95
|
+
export {
|
|
96
|
+
u as n,
|
|
97
|
+
L as r,
|
|
98
|
+
n as t
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=menu-BfaNHnOp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-BfaNHnOp.js","names":[],"sources":["../../src/components/menu/menu.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\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/** Shared popup + item styles, reused by `ContextMenu` and `Menubar` menus. */\n// Floating layer: keeps its elevation shadow, sits on the primary surface\n// with the site's hairline (ring-pho-secondary, #eee/#202020) as its edge.\nexport const MENU_POPUP =\n \"squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary origin-[var(--transform-origin)] min-w-44 rounded-xl p-1 ring-1 ring-inset outline-none transition-[transform,opacity] duration-150 ease-out data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0\";\n// Highlighted item uses the ghost-hover wash (Font/5%) so it reads as a\n// lighten/darken over the popup in BOTH modes (bg-pho-secondary is darker\n// than the popup surface in dark mode).\nexport const MENU_ITEM =\n \"relative flex cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-2.5 pl-2.5 text-sm text-pho-secondary outline-none select-none data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:text-fg-pho-quaternary\";\n\nconst Root = BaseMenu.Root;\nconst Trigger = BaseMenu.Trigger;\nconst Portal = BaseMenu.Portal;\nconst Group = BaseMenu.Group;\nconst RadioGroup = BaseMenu.RadioGroup;\nconst SubmenuRoot = BaseMenu.SubmenuRoot;\n\nfunction Positioner({\n className,\n sideOffset = 6,\n ...props\n}: StyledProps<typeof BaseMenu.Positioner>) {\n return (\n <BaseMenu.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseMenu.Popup>) {\n return <BaseMenu.Popup className={cn(MENU_POPUP, className)} {...props} />;\n}\n\nfunction Item({ className, ...props }: StyledProps<typeof BaseMenu.Item>) {\n return <BaseMenu.Item className={cn(MENU_ITEM, className)} {...props} />;\n}\n\nfunction LinkItem({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.LinkItem>) {\n return <BaseMenu.LinkItem className={cn(MENU_ITEM, className)} {...props} />;\n}\n\nfunction GroupLabel({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.GroupLabel>) {\n return (\n <BaseMenu.GroupLabel\n className={cn(\n \"text-pho-quaternary px-2.5 py-1.5 text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Separator({ className, ...props }: StyledProps<typeof BaseSeparator>) {\n return (\n <BaseSeparator\n className={cn(\n \"-mx-1 my-1 h-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SubmenuTrigger({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.SubmenuTrigger>) {\n return (\n <BaseMenu.SubmenuTrigger\n className={cn(\n MENU_ITEM,\n \"data-[popup-open]:bg-pho-ghost-hover\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CheckboxItem({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.CheckboxItem>) {\n return (\n <BaseMenu.CheckboxItem\n className={cn(MENU_ITEM, \"pl-8\", className)}\n {...props}\n />\n );\n}\n\nfunction RadioItem({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.RadioItem>) {\n return (\n <BaseMenu.RadioItem\n className={cn(MENU_ITEM, \"pl-8\", className)}\n {...props}\n />\n );\n}\n\nconst CHECK_INDICATOR =\n \"text-pho-brand absolute left-2.5 flex items-center [&>svg]:size-4\";\n\nfunction CheckboxItemIndicator({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.CheckboxItemIndicator>) {\n return (\n <BaseMenu.CheckboxItemIndicator\n className={cn(CHECK_INDICATOR, className)}\n {...props}\n />\n );\n}\n\nfunction RadioItemIndicator({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.RadioItemIndicator>) {\n return (\n <BaseMenu.RadioItemIndicator\n className={cn(CHECK_INDICATOR, className)}\n {...props}\n />\n );\n}\n\n/**\n * Dropdown menu built on Base UI `Menu` — a list of actions opened from a\n * trigger. Supports grouped items, separators, submenus\n * (`SubmenuRoot` + `SubmenuTrigger`), and stateful `CheckboxItem` /\n * `RadioItem`s. For a right-click menu use `ContextMenu`.\n */\nexport const Menu = {\n Root,\n Trigger,\n Portal,\n Positioner,\n Popup,\n Item,\n LinkItem,\n Group,\n GroupLabel,\n Separator,\n SubmenuRoot,\n SubmenuTrigger,\n CheckboxItem,\n CheckboxItemIndicator,\n RadioGroup,\n RadioItem,\n RadioItemIndicator,\n};\n"],"mappings":";;;;;;AAgBA,IAAa,IACX,oVAIW,IACX,8TAEI,IAAO,EAAS,MAChB,IAAU,EAAS,SACnB,IAAS,EAAS,QAClB,IAAQ,EAAS,OACjB,IAAa,EAAS,YACtB,IAAc,EAAS;AAE7B,SAAS,EAAW,EAClB,WAAA,GACA,YAAA,IAAa,GACb,GAAG,EAAA,GACuC;AAC1C,SACE,gBAAA,EAAC,EAAS,YAAV;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,GAA6C;AAC1E,SAAO,gBAAA,EAAC,EAAS,OAAV;AAAA,IAAgB,WAAW,EAAG,GAAY,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAC3E;AAEA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA4C;AACxE,SAAO,gBAAA,EAAC,EAAS,MAA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,CAAS;AAAA,IACxC,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAmB,EAC1B,WAAA,GACA,GAAG,EAAA,GAC+C;AAClD,SACE,gBAAA,EAAC,EAAS,oBAAV;AAAA,IACE,WAAW,EAAG,GAAiB,CAAS;AAAA,IACxC,GAAI;AAAA,EACL,CAAA;AAEL;AAQA,IAAa,IAAO;AAAA,EAClB,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA,EACA,uBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,oBAAA;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as o } from "../chunks/cn-
|
|
2
|
+
import { t as o } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { AlertDialog as r } from "@base-ui/react/alert-dialog";
|
|
6
|
-
var x = r.Root,
|
|
6
|
+
var x = r.Root, y = r.Trigger, n = r.Portal, g = r.Close;
|
|
7
7
|
function l({ className: t, ...a }) {
|
|
8
8
|
return /* @__PURE__ */ e(r.Backdrop, {
|
|
9
9
|
className: o("bg-pho-overlay fixed inset-0 z-50 backdrop-blur-[2px] transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", t),
|
|
@@ -12,7 +12,7 @@ function l({ className: t, ...a }) {
|
|
|
12
12
|
}
|
|
13
13
|
function s({ className: t, ...a }) {
|
|
14
14
|
return /* @__PURE__ */ e(r.Popup, {
|
|
15
|
-
className: o("squircle border-pho-
|
|
15
|
+
className: o("squircle border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border outline-none", "transition-all duration-200 ease-out", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", t),
|
|
16
16
|
...a
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -43,13 +43,13 @@ function f({ title: t, description: a, children: d, className: m, ...u }) {
|
|
|
43
43
|
}
|
|
44
44
|
var D = {
|
|
45
45
|
Root: x,
|
|
46
|
-
Trigger:
|
|
46
|
+
Trigger: y,
|
|
47
47
|
Portal: n,
|
|
48
48
|
Backdrop: l,
|
|
49
49
|
Popup: s,
|
|
50
50
|
Title: c,
|
|
51
51
|
Description: p,
|
|
52
|
-
Close:
|
|
52
|
+
Close: g,
|
|
53
53
|
Content: f
|
|
54
54
|
};
|
|
55
55
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","names":[],"sources":["../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType, type ReactNode } from \"react\";\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\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 = BaseAlertDialog.Root;\nconst Trigger = BaseAlertDialog.Trigger;\nconst Portal = BaseAlertDialog.Portal;\nconst Close = BaseAlertDialog.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseAlertDialog.Backdrop>) {\n return (\n <BaseAlertDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 backdrop-blur-[2px] transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({\n className,\n ...props\n}: StyledProps<typeof BaseAlertDialog.Popup>) {\n return (\n <BaseAlertDialog.Popup\n className={cn(\n \"squircle border-pho-
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","names":[],"sources":["../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType, type ReactNode } from \"react\";\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\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 = BaseAlertDialog.Root;\nconst Trigger = BaseAlertDialog.Trigger;\nconst Portal = BaseAlertDialog.Portal;\nconst Close = BaseAlertDialog.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseAlertDialog.Backdrop>) {\n return (\n <BaseAlertDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 backdrop-blur-[2px] transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({\n className,\n ...props\n}: StyledProps<typeof BaseAlertDialog.Popup>) {\n return (\n <BaseAlertDialog.Popup\n className={cn(\n \"squircle border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border outline-none\",\n \"transition-all duration-200 ease-out\",\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({\n className,\n ...props\n}: StyledProps<typeof BaseAlertDialog.Title>) {\n return (\n <BaseAlertDialog.Title\n className={cn(\"text-pho-primary text-lg font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseAlertDialog.Description>) {\n return (\n <BaseAlertDialog.Description\n className={cn(\"text-pho-tertiary mt-1 text-sm\", className)}\n {...props}\n />\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseAlertDialog.Popup>,\n \"title\"\n> {\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * Convenience panel: portal + backdrop + styled popup with a title/description\n * header. The action buttons are your responsibility — an alert dialog requires\n * an explicit choice and must not be dismissed by clicking away.\n */\nfunction Content({\n title,\n description,\n children,\n className,\n ...props\n}: ContentProps) {\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {(title || description) && (\n <div className=\"flex flex-col gap-1 px-6 pt-5\">\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <div className=\"px-6 py-5\">{children}</div>\n </Popup>\n </Portal>\n );\n}\n\n/**\n * Alert dialog built on Base UI `AlertDialog` — a modal that interrupts to\n * confirm a consequential or destructive action. Unlike `Dialog`, it does not\n * close on outside press or Escape: the user must pick an action. Reach for\n * `Dialog` for anything that isn't a forced decision.\n */\nexport const AlertDialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n Title,\n Description,\n Close,\n Content,\n};\n"],"mappings":";;;;;AAYA,IAAM,IAAO,EAAgB,MACvB,IAAU,EAAgB,SAC1B,IAAS,EAAgB,QACzB,IAAQ,EAAgB;AAE9B,SAAS,EAAS,EAChB,WAAA,GACA,GAAG,EAAA,GAC4C;AAC/C,SACE,gBAAA,EAAC,EAAgB,UAAjB;AAAA,IACE,WAAW,EACT,kGACA,iEACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAgB,OAAjB;AAAA,IACE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import { t as o } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as a } from "react/jsx-runtime";
|
|
5
5
|
import { Autocomplete as r } from "@base-ui/react/autocomplete";
|
|
6
|
-
var i = r.Root,
|
|
6
|
+
var i = r.Root, l = r.Value, s = r.Portal, p = r.Group, u = r.Collection;
|
|
7
7
|
function c({ className: t, ...e }) {
|
|
8
8
|
return /* @__PURE__ */ a(r.InputGroup, {
|
|
9
9
|
className: o("relative flex items-center", t),
|
|
@@ -12,7 +12,7 @@ function c({ className: t, ...e }) {
|
|
|
12
12
|
}
|
|
13
13
|
function m({ className: t, ...e }) {
|
|
14
14
|
return /* @__PURE__ */ a(r.Input, {
|
|
15
|
-
className: o("squircle bg-pho-primary
|
|
15
|
+
className: o("squircle bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder focus-visible:ring-pho-brand w-full rounded-lg px-3 py-2 text-sm ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50", t),
|
|
16
16
|
...e
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -31,7 +31,7 @@ function d({ className: t, sideOffset: e = 6, ...n }) {
|
|
|
31
31
|
}
|
|
32
32
|
function g({ className: t, ...e }) {
|
|
33
33
|
return /* @__PURE__ */ a(r.Popup, {
|
|
34
|
-
className: o("squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-
|
|
34
|
+
className: o("squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary w-[var(--anchor-width)] max-w-[var(--available-width)] origin-[var(--transform-origin)] rounded-xl p-1 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),
|
|
35
35
|
...e
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -49,7 +49,7 @@ function x({ className: t, ...e }) {
|
|
|
49
49
|
}
|
|
50
50
|
function f({ className: t, ...e }) {
|
|
51
51
|
return /* @__PURE__ */ a(r.Item, {
|
|
52
|
-
className: o("text-pho-secondary flex cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-2.5 pl-2 text-sm outline-none select-none", "data-[highlighted]:bg-pho-
|
|
52
|
+
className: o("text-pho-secondary flex cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-2.5 pl-2 text-sm outline-none select-none", "data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary", t),
|
|
53
53
|
...e
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -61,11 +61,11 @@ function v({ className: t, ...e }) {
|
|
|
61
61
|
}
|
|
62
62
|
var I = {
|
|
63
63
|
Root: i,
|
|
64
|
-
Value:
|
|
64
|
+
Value: l,
|
|
65
65
|
InputGroup: c,
|
|
66
66
|
Input: m,
|
|
67
67
|
Clear: h,
|
|
68
|
-
Portal:
|
|
68
|
+
Portal: s,
|
|
69
69
|
Positioner: d,
|
|
70
70
|
Popup: g,
|
|
71
71
|
List: y,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","names":[],"sources":["../../src/components/autocomplete/autocomplete.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Autocomplete as BaseAutocomplete } from \"@base-ui/react/autocomplete\";\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 = BaseAutocomplete.Root;\nconst Value = BaseAutocomplete.Value;\nconst Portal = BaseAutocomplete.Portal;\nconst Group = BaseAutocomplete.Group;\nconst Collection = BaseAutocomplete.Collection;\n\nfunction InputGroup({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.InputGroup>) {\n return (\n <BaseAutocomplete.InputGroup\n className={cn(\"relative flex items-center\", className)}\n {...props}\n />\n );\n}\n\nfunction Input({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.Input>) {\n return (\n <BaseAutocomplete.Input\n className={cn(\n \"squircle bg-pho-primary
|
|
1
|
+
{"version":3,"file":"autocomplete.js","names":[],"sources":["../../src/components/autocomplete/autocomplete.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Autocomplete as BaseAutocomplete } from \"@base-ui/react/autocomplete\";\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 = BaseAutocomplete.Root;\nconst Value = BaseAutocomplete.Value;\nconst Portal = BaseAutocomplete.Portal;\nconst Group = BaseAutocomplete.Group;\nconst Collection = BaseAutocomplete.Collection;\n\nfunction InputGroup({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.InputGroup>) {\n return (\n <BaseAutocomplete.InputGroup\n className={cn(\"relative flex items-center\", className)}\n {...props}\n />\n );\n}\n\nfunction Input({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.Input>) {\n return (\n <BaseAutocomplete.Input\n className={cn(\n // Flat field surface — the 15% hairline ring carries the edge; shadows\n // are reserved for floating layers.\n \"squircle bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder focus-visible:ring-pho-brand w-full rounded-lg px-3 py-2 text-sm ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Clear({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.Clear>) {\n return (\n <BaseAutocomplete.Clear\n className={cn(\n \"text-fg-pho-quaternary hover:text-fg-pho-quaternary-hover absolute right-2.5 flex cursor-pointer items-center [&>svg]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Positioner({\n className,\n sideOffset = 6,\n ...props\n}: StyledProps<typeof BaseAutocomplete.Positioner>) {\n return (\n <BaseAutocomplete.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50 outline-none\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.Popup>) {\n return (\n <BaseAutocomplete.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow, edged with the site\n // hairline (ring-pho-secondary).\n \"squircle bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary w-[var(--anchor-width)] max-w-[var(--available-width)] origin-[var(--transform-origin)] rounded-xl p-1 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 List({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.List>) {\n return (\n <BaseAutocomplete.List\n className={cn(\n \"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Empty({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.Empty>) {\n return (\n <BaseAutocomplete.Empty\n className={cn(\n \"text-pho-tertiary px-2.5 py-6 text-center text-sm empty:m-0 empty:p-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Item({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.Item>) {\n return (\n <BaseAutocomplete.Item\n className={cn(\n \"text-pho-secondary flex cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-2.5 pl-2 text-sm outline-none select-none\",\n // Ghost-hover wash (Font/5%) stays visible on the popup surface in both\n // modes — bg-pho-secondary (#0b0b0b dark) vanishes against the #101010\n // popup.\n \"data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction GroupLabel({\n className,\n ...props\n}: StyledProps<typeof BaseAutocomplete.GroupLabel>) {\n return (\n <BaseAutocomplete.GroupLabel\n className={cn(\n \"text-pho-quaternary px-2.5 py-1.5 text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Autocomplete built on Base UI `Autocomplete` — a free-text input that offers\n * matching suggestions as you type. Unlike `Combobox`, the value isn't\n * constrained to the list: the user can submit text that matches no suggestion.\n * Pass `items` to `Autocomplete.Root` and render an `Item` per suggestion.\n */\nexport const Autocomplete = {\n Root,\n Value,\n InputGroup,\n Input,\n Clear,\n Portal,\n Positioner,\n Popup,\n List,\n Collection,\n Empty,\n Item,\n Group,\n GroupLabel,\n};\n"],"mappings":";;;;;AAYA,IAAM,IAAO,EAAiB,MACxB,IAAQ,EAAiB,OACzB,IAAS,EAAiB,QAC1B,IAAQ,EAAiB,OACzB,IAAa,EAAiB;AAEpC,SAAS,EAAW,EAClB,WAAA,GACA,GAAG,EAAA,GAC+C;AAClD,SACE,gBAAA,EAAC,EAAiB,YAAlB;AAAA,IACE,WAAW,EAAG,8BAA8B,CAAS;AAAA,IACrD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAiB,OAAlB;AAAA,IACE,WAAW,EAGT,8SACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAiB,OAAlB;AAAA,IACE,WAAW,EACT,gIACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAW,EAClB,WAAA,GACA,YAAA,IAAa,GACb,GAAG,EAAA,GAC+C;AAClD,SACE,gBAAA,EAAC,EAAiB,YAAlB;AAAA,IACc,YAAA;AAAA,IACZ,WAAW,EAAG,qBAAqB,CAAS;AAAA,IAC5C,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAiB,OAAlB;AAAA,IACE,WAAW,EAGT,wQACA,kEACA,8DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAK,EACZ,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAiB,MAAlB;AAAA,IACE,WAAW,EACT,iFACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EACb,WAAA,GACA,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAiB,OAAlB;AAAA,IACE,WAAW,EACT,yEACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAK,EACZ,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAiB,MAAlB;AAAA,IACE,WAAW,EACT,4HAIA,6EACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAW,EAClB,WAAA,GACA,GAAG,EAAA,GAC+C;AAClD,SACE,gBAAA,EAAC,EAAiB,YAAlB;AAAA,IACE,WAAW,EACT,yDACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAQA,IAAa,IAAe;AAAA,EAC1B,MAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AACF"}
|
package/dist/components/badge.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as a } from "../chunks/cn-
|
|
2
|
+
import { t as a } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import { t as i } from "../chunks/resolve-variant-CcD8iG5l.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx as o } from "react/jsx-runtime";
|
|
6
6
|
var l = a("inline-flex shrink-0 items-center whitespace-nowrap rounded-full font-medium", "bg-current/10 ring-1 ring-current/20 ring-inset"), c = {
|
|
7
7
|
sm: {
|
|
8
|
-
classes: "gap-0.5 px-1.5 py-px text-
|
|
8
|
+
classes: "gap-0.5 px-1.5 py-px text-xs",
|
|
9
9
|
description: "Small — dense rows, table cells, inline with tight text"
|
|
10
10
|
},
|
|
11
11
|
md: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":[],"sources":["../../src/components/badge/badge.tsx"],"sourcesContent":["import { type ComponentProps } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE color axis, a tight semantic set (`gray` / `brand` / `success` /\n * `warning` / `error`). Untitled UI's `type` triplication (modern / pill /\n * badge-color) is dropped: a Badge is always the soft \"accent\" material.\n * - The color axis only sets the *text* token; the fill and hairline ring\n * derive from `currentColor` at low opacity, so every color shares one recipe\n * and no per-color background/ring token has to exist.\n * - TWO sizes (`sm` / `md`, default `md`). A badge is inherently small.\n * - The richer Untitled features (dot, icon, avatar, count, dismiss button) are\n * deliberately left out — a dismissible or selectable chip is a Tag, not a\n * Badge, and a badge that triggers an action is a Button.\n */\n\n/** Shared material: pill shape + the currentColor-derived accent fill and ring. */\nconst BADGE_BASE = cn(\n \"inline-flex shrink-0 items-center whitespace-nowrap rounded-full font-medium\",\n \"bg-current/10 ring-1 ring-current/20 ring-inset\",\n);\n\n/** Size axis — padding, gap, and label size. */\nexport const BADGE_SIZES = {\n sm: {\n classes: \"gap-0.5 px-1.5 py-px text-
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../../src/components/badge/badge.tsx"],"sourcesContent":["import { type ComponentProps } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE color axis, a tight semantic set (`gray` / `brand` / `success` /\n * `warning` / `error`). Untitled UI's `type` triplication (modern / pill /\n * badge-color) is dropped: a Badge is always the soft \"accent\" material.\n * - The color axis only sets the *text* token; the fill and hairline ring\n * derive from `currentColor` at low opacity, so every color shares one recipe\n * and no per-color background/ring token has to exist.\n * - TWO sizes (`sm` / `md`, default `md`). A badge is inherently small.\n * - The richer Untitled features (dot, icon, avatar, count, dismiss button) are\n * deliberately left out — a dismissible or selectable chip is a Tag, not a\n * Badge, and a badge that triggers an action is a Button.\n */\n\n/** Shared material: pill shape + the currentColor-derived accent fill and ring. */\nconst BADGE_BASE = cn(\n \"inline-flex shrink-0 items-center whitespace-nowrap rounded-full font-medium\",\n \"bg-current/10 ring-1 ring-current/20 ring-inset\",\n);\n\n/** Size axis — padding, gap, and label size. */\nexport const BADGE_SIZES = {\n sm: {\n classes: \"gap-0.5 px-1.5 py-px text-xs\",\n description: \"Small — dense rows, table cells, inline with tight text\",\n },\n md: {\n classes: \"gap-1 px-2 py-0.5 text-xs\",\n description: \"Medium — the default\",\n },\n} satisfies VariantMap;\n\n/** Color axis — a closed semantic set; each key tints text, fill, and ring. */\nexport const BADGE_COLORS = {\n gray: {\n classes: \"text-pho-secondary\",\n description: \"Neutral — the low-signal default\",\n },\n brand: {\n classes: \"text-pho-brand\",\n description: \"Brand — plan tiers, feature flags, highlights\",\n },\n success: {\n classes: \"text-pho-success\",\n description: \"Success — healthy, live, complete\",\n },\n warning: {\n classes: \"text-pho-warning\",\n description: \"Warning — needs attention, degraded\",\n },\n error: {\n classes: \"text-pho-error\",\n description: \"Error — failed, blocked, over limit\",\n },\n} satisfies VariantMap;\n\nexport type BadgeSize = keyof typeof BADGE_SIZES;\nexport type BadgeColor = keyof typeof BADGE_COLORS;\n\n/** Compose the full class string for a badge — exported for reuse/testing. */\nexport function badgeVariants(opts?: {\n color?: BadgeColor;\n size?: BadgeSize;\n className?: string;\n}): string {\n const { color = \"gray\", size = \"md\", className } = opts ?? {};\n return cn(\n BADGE_BASE,\n resolveVariant(BADGE_SIZES, size),\n resolveVariant(BADGE_COLORS, color),\n className,\n );\n}\n\ninterface BadgeBaseProps {\n /** Semantic color. @default \"gray\" */\n color?: BadgeColor;\n /** Size variant. @default \"md\" */\n size?: BadgeSize;\n}\n\nexport interface BadgeProps\n extends BadgeBaseProps, Omit<ComponentProps<\"span\">, keyof BadgeBaseProps> {}\n\n/**\n * Badge — a small, non-interactive status label: a plan tier (`Pro`), a state\n * (`Live`, `Failed`), a count. It's a plain `<span>`, so it never takes focus or\n * handles clicks — for a dismissible or selectable chip reach for a `Tag`, and\n * for a standalone action use a `Button`. Let `color` carry the meaning and keep\n * the label to a word or two.\n */\nexport function Badge({\n color,\n size,\n className,\n children,\n ...props\n}: BadgeProps) {\n return (\n <span className={cn(badgeVariants({ color, size }), className)} {...props}>\n {children}\n </span>\n );\n}\n\nBadge.displayName = \"Badge\";\n"],"mappings":";;;;;AAmBA,IAAM,IAAa,EACjB,gFACA,iDACF,GAGa,IAAc;AAAA,EACzB,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AACF,GAGa,IAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,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;AAMA,SAAgB,EAAc,GAInB;AACT,QAAM,EAAE,OAAA,IAAQ,QAAQ,MAAA,IAAO,MAAM,WAAA,EAAA,IAAc,KAAQ,CAAC;AAC5D,SAAO,EACL,GACA,EAAe,GAAa,CAAI,GAChC,EAAe,GAAc,CAAK,GAClC,CACF;AACF;AAmBA,SAAgB,EAAM,EACpB,OAAA,GACA,MAAA,GACA,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACU;AACb,SACE,gBAAA,EAAC,QAAD;AAAA,IAAM,WAAW,EAAG,EAAc;AAAA,MAAE,OAAA;AAAA,MAAO,MAAA;AAAA,IAAK,CAAC,GAAG,CAAS;AAAA,IAAG,GAAI;AAAA,IACjE,UAAA;AAAA,EACG,CAAA;AAEV;AAEA,EAAM,cAAc"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a, c as s,
|
|
3
|
-
import { t as
|
|
2
|
+
import { a, c as s, i as o, l as n, n as B, o as T, r as u, s as e, t as f, u as i } from "../chunks/button-BMDHIgZh.js";
|
|
3
|
+
import { t as E } from "../chunks/close-button-DKaNIndU.js";
|
|
4
4
|
export {
|
|
5
5
|
f as BUTTON_SHAPES,
|
|
6
6
|
B as BUTTON_SIZES,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
u as BUTTON_VARIANTS,
|
|
8
|
+
o as Button,
|
|
9
9
|
a as ButtonLink,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
e as
|
|
13
|
-
s as
|
|
14
|
-
n as
|
|
15
|
-
i as
|
|
16
|
-
o as effectButtonVariants
|
|
10
|
+
E as CloseButton,
|
|
11
|
+
T as EFFECT_BUTTON_SIZES,
|
|
12
|
+
e as EffectButton,
|
|
13
|
+
s as EffectButtonLink,
|
|
14
|
+
n as buttonVariants,
|
|
15
|
+
i as effectButtonVariants
|
|
17
16
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t } from "../chunks/cn-
|
|
2
|
+
import { t } from "../chunks/cn-7uGUzCOM.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
5
5
|
import { Check as l, Minus as m } from "@phosphor-icons/react";
|
|
@@ -14,7 +14,7 @@ var h = {
|
|
|
14
14
|
};
|
|
15
15
|
function u({ className: o, label: r, size: a = "md", ...d }) {
|
|
16
16
|
const i = /* @__PURE__ */ e(s.Root, {
|
|
17
|
-
className: t("group/cb squircle outline-pho-brand bg-pho-primary
|
|
17
|
+
className: t("group/cb squircle outline-pho-brand bg-pho-primary ring-pho-primary text-pho-on-brand flex shrink-0 cursor-pointer items-center justify-center rounded-md 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-[indeterminate]:bg-pho-brand-solid data-[indeterminate]:ring-transparent", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", h[a], o),
|
|
18
18
|
...d,
|
|
19
19
|
children: /* @__PURE__ */ n(s.Indicator, {
|
|
20
20
|
className: "flex items-center justify-center",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":[],"sources":["../../src/components/checkbox/checkbox.tsx","../../src/components/checkbox/checkbox-group.tsx"],"sourcesContent":["import { type ComponentProps, type ReactNode } from \"react\";\nimport { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { Check, Minus } from \"@phosphor-icons/react\";\nimport { cn } from \"../../utils/cn\";\n\nexport type CheckboxSize = \"sm\" | \"md\";\n\nconst BOX: Record<CheckboxSize, string> = { sm: \"size-4\", md: \"size-5\" };\nconst ICON: Record<CheckboxSize, string> = { sm: \"size-3\", md: \"size-3.5\" };\n\nexport interface CheckboxProps extends Omit<\n ComponentProps<typeof BaseCheckbox.Root>,\n \"className\"\n> {\n className?: string;\n /** Text rendered beside the box; the whole row toggles the checkbox. */\n label?: ReactNode;\n /** Size variant. @default \"md\" */\n size?: CheckboxSize;\n}\n\n/**\n * Checkbox built on Base UI `Checkbox`. Supports checked, unchecked, and\n * `indeterminate` states; pass `label` for a clickable text row, or omit it\n * and provide an `aria-label`. For a set of related options that submit\n * together, wrap them in `CheckboxGroup`.\n */\nexport function Checkbox({\n className,\n label,\n size = \"md\",\n ...props\n}: CheckboxProps) {\n const box = (\n <BaseCheckbox.Root\n className={cn(\n \"group/cb squircle outline-pho-brand bg-pho-primary
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../src/components/checkbox/checkbox.tsx","../../src/components/checkbox/checkbox-group.tsx"],"sourcesContent":["import { type ComponentProps, type ReactNode } from \"react\";\nimport { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { Check, Minus } from \"@phosphor-icons/react\";\nimport { cn } from \"../../utils/cn\";\n\nexport type CheckboxSize = \"sm\" | \"md\";\n\nconst BOX: Record<CheckboxSize, string> = { sm: \"size-4\", md: \"size-5\" };\nconst ICON: Record<CheckboxSize, string> = { sm: \"size-3\", md: \"size-3.5\" };\n\nexport interface CheckboxProps extends Omit<\n ComponentProps<typeof BaseCheckbox.Root>,\n \"className\"\n> {\n className?: string;\n /** Text rendered beside the box; the whole row toggles the checkbox. */\n label?: ReactNode;\n /** Size variant. @default \"md\" */\n size?: CheckboxSize;\n}\n\n/**\n * Checkbox built on Base UI `Checkbox`. Supports checked, unchecked, and\n * `indeterminate` states; pass `label` for a clickable text row, or omit it\n * and provide an `aria-label`. For a set of related options that submit\n * together, wrap them in `CheckboxGroup`.\n */\nexport function Checkbox({\n className,\n label,\n size = \"md\",\n ...props\n}: CheckboxProps) {\n const box = (\n <BaseCheckbox.Root\n className={cn(\n // Flat field surface with the input-strength ring; the glyph only shows\n // on the brand-solid checked fill, so it must be on-brand (not white —\n // brand-solid is white in dark mode).\n \"group/cb squircle outline-pho-brand bg-pho-primary ring-pho-primary text-pho-on-brand flex shrink-0 cursor-pointer items-center justify-center rounded-md 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-[indeterminate]:bg-pho-brand-solid data-[indeterminate]:ring-transparent\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n BOX[size],\n className,\n )}\n {...props}\n >\n <BaseCheckbox.Indicator className=\"flex items-center justify-center\">\n <Check\n weight=\"bold\"\n className={cn(ICON[size], \"group-data-[indeterminate]/cb:hidden\")}\n />\n <Minus\n weight=\"bold\"\n className={cn(\n ICON[size],\n \"hidden group-data-[indeterminate]/cb:block\",\n )}\n />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n\n if (!label) return box;\n return (\n <label className=\"flex cursor-pointer items-center gap-2 select-none\">\n {box}\n <span className=\"text-pho-secondary text-sm\">{label}</span>\n </label>\n );\n}\n\nCheckbox.displayName = \"Checkbox\";\n","import { type ComponentProps } from \"react\";\nimport { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface CheckboxGroupProps extends Omit<\n ComponentProps<typeof BaseCheckboxGroup>,\n \"className\"\n> {\n className?: string;\n}\n\n/**\n * Groups related `Checkbox`es and tracks their values as one. Built on Base UI\n * `CheckboxGroup` — supports a parent \"select all\" checkbox via `allValues`.\n * Control with `value` / `onValueChange` or leave uncontrolled with\n * `defaultValue`.\n */\nexport function CheckboxGroup({ className, ...props }: CheckboxGroupProps) {\n return (\n <BaseCheckboxGroup\n className={cn(\"flex flex-col gap-3\", className)}\n {...props}\n />\n );\n}\n\nCheckboxGroup.displayName = \"CheckboxGroup\";\n"],"mappings":";;;;;;;AAOA,IAAM,IAAoC;AAAA,EAAE,IAAI;AAAA,EAAU,IAAI;AAAS,GACjE,IAAqC;AAAA,EAAE,IAAI;AAAA,EAAU,IAAI;AAAW;AAmB1E,SAAgB,EAAS,EACvB,WAAA,GACA,OAAA,GACA,MAAA,IAAO,MACP,GAAG,EAAA,GACa;AAChB,QAAM,IACJ,gBAAA,EAAC,EAAa,MAAd;AAAA,IACE,WAAW,EAIT,0QACA,qEACA,iFACA,iEACA,EAAI,CAAA,GACJ,CACF;AAAA,IACA,GAAI;AAAA,cAEJ,gBAAA,EAAC,EAAa,WAAd;AAAA,MAAwB,WAAU;AAAA,gBAAlC,CACE,gBAAA,EAAC,GAAD;AAAA,QACE,QAAO;AAAA,QACP,WAAW,EAAG,EAAK,CAAA,GAAO,sCAAsC;AAAA,MACjE,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,QACE,QAAO;AAAA,QACP,WAAW,EACT,EAAK,CAAA,GACL,4CACF;AAAA,MACD,CAAA,CACqB;AAAA;EACP,CAAA;AAGrB,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,EAAS,cAAc;ACxDvB,SAAgB,EAAc,EAAE,WAAA,GAAW,GAAG,EAAA,GAA6B;AACzE,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAW,EAAG,uBAAuB,CAAS;AAAA,IAC9C,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,EAAc,cAAc"}
|