@photon-ai/pho-ui 0.3.0 → 0.5.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/IconX-pZ9vrtSr.js +14 -0
- package/dist/chunks/IconX-pZ9vrtSr.js.map +1 -0
- package/dist/chunks/button-CQ4cZvkC.js +365 -0
- package/dist/chunks/button-CQ4cZvkC.js.map +1 -0
- package/dist/chunks/close-button-CNhn8z0w.js +29 -0
- package/dist/chunks/close-button-CNhn8z0w.js.map +1 -0
- package/dist/chunks/createReactComponent-BqCmnqfX.js +50 -0
- package/dist/chunks/createReactComponent-BqCmnqfX.js.map +1 -0
- package/dist/chunks/{dialog-CyyL5VCc.js → dialog-7oOe-eaO.js} +2 -2
- package/dist/chunks/{dialog-CyyL5VCc.js.map → dialog-7oOe-eaO.js.map} +1 -1
- package/dist/chunks/input-DbJpdu6v.js +106 -0
- package/dist/chunks/input-DbJpdu6v.js.map +1 -0
- package/dist/chunks/link-provider-9TFNyDqO.js.map +1 -1
- package/dist/components/button.js +2 -2
- package/dist/components/checkbox.js +27 -27
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/notification.js +64 -34
- package/dist/components/notification.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/src/components/button/button.d.ts +11 -1
- package/dist/src/components/input/input.d.ts +1 -1
- package/dist/src/components/notification/notification.d.ts +1 -1
- package/dist/src/utils/is-react-component.d.ts +1 -1
- package/package.json +3 -3
- package/dist/chunks/button-BMDHIgZh.js +0 -360
- package/dist/chunks/button-BMDHIgZh.js.map +0 -1
- package/dist/chunks/close-button-DKaNIndU.js +0 -30
- package/dist/chunks/close-button-DKaNIndU.js.map +0 -1
- package/dist/chunks/input-DX7d5MlS.js +0 -75
- package/dist/chunks/input-DX7d5MlS.js.map +0 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as r } from "./cn-7uGUzCOM.js";
|
|
3
|
+
import { t as n } from "./createReactComponent-BqCmnqfX.js";
|
|
4
|
+
import { useState as A } from "react";
|
|
5
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { Field as s } from "@base-ui/react/field";
|
|
7
|
+
var S = [
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M10.585 10.587a2 2 0 0 0 2.829 2.828",
|
|
10
|
+
key: "svg-0"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",
|
|
14
|
+
key: "svg-1"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M3 3l18 18",
|
|
18
|
+
key: "svg-2"
|
|
19
|
+
}]
|
|
20
|
+
], k = n("outline", "eye-off", "EyeOff", S), C = [["path", {
|
|
21
|
+
d: "M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",
|
|
22
|
+
key: "svg-0"
|
|
23
|
+
}], ["path", {
|
|
24
|
+
d: "M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",
|
|
25
|
+
key: "svg-1"
|
|
26
|
+
}]], D = n("outline", "eye", "Eye", C), R = [["path", {
|
|
27
|
+
d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z",
|
|
28
|
+
key: "svg-0"
|
|
29
|
+
}]], L = n("filled", "alert-circle-filled", "AlertCircleFilled", R), M = {
|
|
30
|
+
sm: "px-2.5 py-1.5 text-sm",
|
|
31
|
+
md: "px-2.5 py-1.5 text-md",
|
|
32
|
+
lg: "px-3 py-2 text-md"
|
|
33
|
+
}, O = {
|
|
34
|
+
sm: "pl-8.5",
|
|
35
|
+
md: "pl-9.5",
|
|
36
|
+
lg: "pl-10"
|
|
37
|
+
}, z = {
|
|
38
|
+
sm: "left-3 size-4",
|
|
39
|
+
md: "left-3 size-5",
|
|
40
|
+
lg: "left-3.5 size-5"
|
|
41
|
+
}, F = {
|
|
42
|
+
sm: "rounded-lg",
|
|
43
|
+
md: "rounded-lg",
|
|
44
|
+
lg: "squircle rounded-xl"
|
|
45
|
+
}, P = {
|
|
46
|
+
sm: "",
|
|
47
|
+
md: "",
|
|
48
|
+
lg: r("isolate before:pointer-events-none before:absolute before:-z-10 before:content-['']", "before:bg-pho-primary before:inset-px before:rounded-[11px]", "has-[input:focus-visible]:before:inset-0.5 has-[input:focus-visible]:before:rounded-[10px]", "before:transition-[inset,border-radius] before:duration-100 before:ease-linear")
|
|
49
|
+
}, T = {
|
|
50
|
+
sm: "autofill:rounded-md",
|
|
51
|
+
md: "autofill:rounded-md",
|
|
52
|
+
lg: "autofill:rounded-[10px]"
|
|
53
|
+
};
|
|
54
|
+
function Z({ label: d, hint: p, size: t = "md", invalid: a, icon: i, labelTrailing: m, disabled: h, required: c, type: u = "text", className: g, wrapperClassName: v, id: b, ref: x, ...y }) {
|
|
55
|
+
const [f, N] = A(!1), o = u === "password", I = o && f ? "text" : u, _ = !!i, E = o || a;
|
|
56
|
+
return /* @__PURE__ */ l(s.Root, {
|
|
57
|
+
disabled: h,
|
|
58
|
+
className: "group/field flex w-full flex-col gap-1.5",
|
|
59
|
+
children: [
|
|
60
|
+
d && /* @__PURE__ */ l("div", {
|
|
61
|
+
className: "flex items-center justify-between gap-2",
|
|
62
|
+
children: [/* @__PURE__ */ l(s.Label, {
|
|
63
|
+
className: "text-pho-secondary flex cursor-default items-center gap-0.5 text-sm font-medium",
|
|
64
|
+
children: [d, c && /* @__PURE__ */ e("span", {
|
|
65
|
+
className: "text-pho-brand",
|
|
66
|
+
children: "*"
|
|
67
|
+
})]
|
|
68
|
+
}), m]
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ l("div", {
|
|
71
|
+
"data-invalid": a || void 0,
|
|
72
|
+
className: r("bg-pho-primary ring-pho-primary relative flex w-full items-center p-0.5 ring-1 transition-shadow duration-100 ease-linear ring-inset", F[t], P[t], "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", v),
|
|
73
|
+
children: [
|
|
74
|
+
i && /* @__PURE__ */ e(i, { className: r("text-fg-pho-quaternary pointer-events-none absolute", z[t]) }),
|
|
75
|
+
/* @__PURE__ */ e(s.Control, {
|
|
76
|
+
ref: x,
|
|
77
|
+
id: b,
|
|
78
|
+
type: I,
|
|
79
|
+
required: c,
|
|
80
|
+
...y,
|
|
81
|
+
className: r("text-pho-primary placeholder:text-pho-placeholder m-0 w-full bg-transparent outline-none disabled:cursor-not-allowed", M[t], T[t], _ && O[t], E && "pr-8.5", g)
|
|
82
|
+
}),
|
|
83
|
+
a && !o && /* @__PURE__ */ e(L, { className: "text-fg-pho-error pointer-events-none absolute right-3 size-4" }),
|
|
84
|
+
o && /* @__PURE__ */ e("button", {
|
|
85
|
+
type: "button",
|
|
86
|
+
tabIndex: -1,
|
|
87
|
+
"aria-label": "Toggle password visibility",
|
|
88
|
+
onClick: () => N((w) => !w),
|
|
89
|
+
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",
|
|
90
|
+
children: f ? /* @__PURE__ */ e(k, { className: "size-4" }) : /* @__PURE__ */ e(D, { className: "size-4" })
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
}),
|
|
94
|
+
p && /* @__PURE__ */ e(s.Description, {
|
|
95
|
+
className: r("text-pho-tertiary text-sm", a && "text-pho-error"),
|
|
96
|
+
children: p
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
Z.displayName = "Input";
|
|
102
|
+
export {
|
|
103
|
+
Z as t
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=input-DbJpdu6v.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-DbJpdu6v.js","names":["__iconNode","__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconEyeOff.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconEye.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircleFilled.mjs","../../src/components/input/input.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M10.585 10.587a2 2 0 0 0 2.829 2.828\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M3 3l18 18\", \"key\": \"svg-2\" }]];\nconst IconEyeOff = createReactComponent(\"outline\", \"eye-off\", \"EyeOff\", __iconNode);\n\nexport { __iconNode, IconEyeOff as default };\n//# sourceMappingURL=IconEyeOff.mjs.map\n","/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6\", \"key\": \"svg-1\" }]];\nconst IconEye = createReactComponent(\"outline\", \"eye\", \"Eye\", __iconNode);\n\nexport { __iconNode, IconEye as default };\n//# sourceMappingURL=IconEye.mjs.map\n","/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z\", \"key\": \"svg-0\" }]];\nconst IconAlertCircleFilled = createReactComponent(\"filled\", \"alert-circle-filled\", \"AlertCircleFilled\", __iconNode);\n\nexport { __iconNode, IconAlertCircleFilled as default };\n//# sourceMappingURL=IconAlertCircleFilled.mjs.map\n","import {\n useState,\n type ComponentType,\n type InputHTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n IconAlertCircleFilled,\n IconEye,\n IconEyeOff,\n} from \"@tabler/icons-react\";\nimport { Field } from \"@base-ui/react/field\";\nimport { cn } from \"../../utils/cn\";\n\nexport type InputSize = \"sm\" | \"md\" | \"lg\";\n\n// Control padding per size. The wrapper carries a 2px inset (`p-0.5`) so the\n// control's border box — and the browser's autofill fill it paints — sits\n// inside the ring instead of over it; these paddings are the documented\n// effective padding (sm/md 12/8px, lg 14/10px) minus that 2px inset, so the\n// text position and total field height are unchanged.\nconst SIZE_PAD: Record<InputSize, string> = {\n sm: \"px-2.5 py-1.5 text-sm\",\n md: \"px-2.5 py-1.5 text-md\",\n lg: \"px-3 py-2 text-md\",\n};\n// Effective icon clearance minus the wrapper's 2px inset.\nconst LEADING_PAD: Record<InputSize, string> = {\n sm: \"pl-8.5\",\n md: \"pl-9.5\",\n lg: \"pl-10\",\n};\n// Icons are absolutely positioned, so they're placed from the wrapper's\n// padding edge — which, with no border, is the visible field edge; the\n// wrapper's `p-0.5` does not offset them.\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// Wrapper corner radius per size. `lg` steps up to 12px with `squircle`\n// superellipse smoothing (the ring is a box-shadow on this wrapper, so it\n// follows the border-radius automatically); `sm`/`md` keep the 8px default.\nconst SIZE_RADIUS: Record<InputSize, string> = {\n sm: \"rounded-lg\",\n md: \"rounded-lg\",\n lg: \"squircle rounded-xl\",\n};\n// Concentric inner-curve cover, `lg` only. Nested corner radii must follow\n// innerRadius = outerRadius − inset, so the hairline's inner edge at a 12px\n// outer radius is 11px at rest (ring-1) and 10px when focused (ring-2).\n// Browsers derive that automatically for plain round corners, but with\n// `corner-shape: superellipse(...)` shipping engines still scale (rather than\n// offset) the inner shadow curve, which renders the ring visibly thicker at\n// the four corners (see w3c/csswg-drafts#12961). This ::before repaints the\n// field surface over everything inside the correct concentric curve — a round\n// radius is the right parallel-offset approximation of the mild superellipse —\n// so the ring reads as a uniform hairline in every engine. `isolate` +\n// `-z-10` slot the cover above the wrapper's background/ring but below the\n// control's text, icons, and autofill fill. `sm`/`md` have no corner-shape,\n// so the native (already concentric) rendering is kept there.\n// The ::before is absolutely positioned, so its inset is measured from the\n// wrapper's border box (border 0): 1px in at rest, 2px in when focused.\nconst SIZE_RING_COVER: Record<InputSize, string> = {\n sm: \"\",\n md: \"\",\n lg: cn(\n \"isolate before:pointer-events-none before:absolute before:-z-10 before:content-['']\",\n \"before:bg-pho-primary before:inset-px before:rounded-[11px]\",\n \"has-[input:focus-visible]:before:inset-0.5 has-[input:focus-visible]:before:rounded-[10px]\",\n \"before:transition-[inset,border-radius] before:duration-100 before:ease-linear\",\n ),\n};\n// The control's border box sits 2px inside the wrapper (its `p-0.5` inset),\n// clear of both ring widths, so the browser's autofill fill paints inside the\n// hairline instead of over it. Its rounding follows the same concentric\n// formula (innerRadius = outerRadius − 2px inset): 8 − 2 = 6px (`rounded-md`)\n// at sm/md, 12 − 2 = 10px at lg. Round (not squircle) — the parallel offset\n// of the wrapper's mild superellipse is effectively circular.\nconst SIZE_AUTOFILL_RADIUS: Record<InputSize, string> = {\n sm: \"autofill:rounded-md\",\n md: \"autofill:rounded-md\",\n lg: \"autofill:rounded-[10px]\",\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 Tabler 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). `p-0.5`\n // insets the control 2px (the focused ring width) so its background\n // and the browser's autofill fill nest inside the ring; the size\n // maps compensate so effective padding/height are unchanged.\n \"bg-pho-primary ring-pho-primary relative flex w-full items-center p-0.5 ring-1 transition-shadow duration-100 ease-linear ring-inset\",\n SIZE_RADIUS[size],\n SIZE_RING_COVER[size],\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 SIZE_AUTOFILL_RADIUS[size],\n hasLeadingIcon && LEADING_PAD[size],\n // 34px + the wrapper's 2px inset = the previous 36px clearance.\n hasTrailingIcon && \"pr-8.5\",\n className,\n )}\n />\n\n {invalid && !isPassword && (\n <IconAlertCircleFilled className=\"text-fg-pho-error pointer-events-none absolute right-3 size-4\" />\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 <IconEyeOff className=\"size-4\" />\n ) : (\n <IconEye 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 {hint}\n </Field.Description>\n )}\n </Field.Root>\n );\n}\n\nInput.displayName = \"Input\";\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;AASA,IAAMA,IAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAwC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuM,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAC,GAClX,IAAa,EAAqB,WAAW,WAAW,UAAUA,CAAU,GCD5EC,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAuC,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAqF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ts","../../src/utils/link-provider.tsx"],"sourcesContent":["import { isValidElement, type ComponentType } from \"react\";\n\n/**\n * Distinguish an icon passed as a *component* (e.g. a
|
|
1
|
+
{"version":3,"file":"link-provider-9TFNyDqO.js","names":[],"sources":["../../src/utils/is-react-component.ts","../../src/utils/link-provider.tsx"],"sourcesContent":["import { isValidElement, type ComponentType } from \"react\";\n\n/**\n * Distinguish an icon passed as a *component* (e.g. a Tabler icon or any\n * `FC`/forwardRef) from one passed as an already-rendered *element*. Lets icon\n * props accept either form: `prefix={Plus}` or `prefix={<Plus />}`.\n */\nexport function isReactComponent(\n value: unknown,\n): value is ComponentType<{ className?: string }> {\n if (typeof value === \"function\") return true;\n // forwardRef / memo components are objects carrying `$$typeof` but, unlike a\n // rendered element, are not valid React elements.\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n !isValidElement(value)\n );\n}\n","import {\n createContext,\n createElement,\n forwardRef,\n useContext,\n type AnchorHTMLAttributes,\n type ComponentType,\n type ReactNode,\n} from \"react\";\n\n/**\n * The shape a host app's link component must satisfy. Routers (TanStack Router,\n * React Router, Next.js) expose a `Link` that takes `href` + anchor props; this\n * lets Pho components render real client-side links without depending on any\n * specific router.\n */\nexport type LinkComponent = ComponentType<\n AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n>;\n\n// Forwards its ref so wrappers (e.g. Motion) can reach the underlying anchor.\nconst DefaultLink: LinkComponent = forwardRef<\n HTMLAnchorElement,\n AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n>((props, ref) => createElement(\"a\", { ...props, ref }));\nDefaultLink.displayName = \"DefaultLink\";\n\nconst LinkContext = createContext<LinkComponent>(DefaultLink);\n\n/** Inject the host router's link component for all Pho links beneath it. */\nexport function LinkProvider({\n component,\n children,\n}: {\n component: LinkComponent;\n children: ReactNode;\n}) {\n return (\n <LinkContext.Provider value={component}>{children}</LinkContext.Provider>\n );\n}\n\n/** Read the active link component (falls back to a plain `<a>`). */\nexport function useLinkComponent(): LinkComponent {\n return useContext(LinkContext);\n}\n"],"mappings":";;;AAOA,SAAgB,EACd,GACgD;AAChD,SAAI,OAAO,KAAU,aAAmB,KAItC,OAAO,KAAU,YACjB,MAAU,QACV,cAAc,KACd,CAAC,EAAe,CAAK;AAEzB;ACEA,IAAM,IAA6B,EAAA,CAGhC,GAAO,MAAQ,EAAc,KAAK;AAAA,EAAE,GAAG;AAAA,EAAO,KAAA;AAAI,CAAC,CAAC;AACvD,EAAY,cAAc;AAE1B,IAAM,IAAc,EAA6B,CAAW;AAG5D,SAAgB,EAAa,EAC3B,WAAA,GACA,UAAA,EAAA,GAIC;AACD,SACE,gBAAA,EAAC,EAAY,UAAb;AAAA,IAAsB,OAAO;AAAA,IAAY,UAAA;AAAA,EAA+B,CAAA;AAE5E;AAGA,SAAgB,IAAkC;AAChD,SAAO,EAAW,CAAW;AAC/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
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-
|
|
3
|
-
import { t as E } from "../chunks/close-button-
|
|
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-CQ4cZvkC.js";
|
|
3
|
+
import { t as E } from "../chunks/close-button-CNhn8z0w.js";
|
|
4
4
|
export {
|
|
5
5
|
f as BUTTON_SHAPES,
|
|
6
6
|
B as BUTTON_SIZES,
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t } from "../chunks/cn-7uGUzCOM.js";
|
|
2
|
+
import { t as a } from "../chunks/cn-7uGUzCOM.js";
|
|
3
|
+
import { t as d } from "../chunks/createReactComponent-BqCmnqfX.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import { jsx as e, jsxs as
|
|
5
|
-
import { Check as l, Minus as m } from "@phosphor-icons/react";
|
|
5
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
import { Checkbox as s } from "@base-ui/react/checkbox";
|
|
7
|
-
import { CheckboxGroup as
|
|
8
|
-
var
|
|
7
|
+
import { CheckboxGroup as m } from "@base-ui/react/checkbox-group";
|
|
8
|
+
var p = [["path", {
|
|
9
|
+
d: "M5 12l5 5l10 -10",
|
|
10
|
+
key: "svg-0"
|
|
11
|
+
}]], u = d("outline", "check", "Check", p), h = [["path", {
|
|
12
|
+
d: "M5 12l14 0",
|
|
13
|
+
key: "svg-0"
|
|
14
|
+
}]], b = d("outline", "minus", "Minus", h), x = {
|
|
9
15
|
sm: "size-4",
|
|
10
16
|
md: "size-5"
|
|
11
17
|
}, c = {
|
|
12
18
|
sm: "size-3",
|
|
13
19
|
md: "size-3.5"
|
|
14
20
|
};
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
className:
|
|
18
|
-
...
|
|
19
|
-
children: /* @__PURE__ */
|
|
21
|
+
function f({ className: o, label: r, size: t = "md", ...l }) {
|
|
22
|
+
const n = /* @__PURE__ */ e(s.Root, {
|
|
23
|
+
className: a("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", x[t], o),
|
|
24
|
+
...l,
|
|
25
|
+
children: /* @__PURE__ */ i(s.Indicator, {
|
|
20
26
|
className: "flex items-center justify-center",
|
|
21
|
-
children: [/* @__PURE__ */ e(
|
|
22
|
-
weight: "bold",
|
|
23
|
-
className: t(c[a], "group-data-[indeterminate]/cb:hidden")
|
|
24
|
-
}), /* @__PURE__ */ e(m, {
|
|
25
|
-
weight: "bold",
|
|
26
|
-
className: t(c[a], "hidden group-data-[indeterminate]/cb:block")
|
|
27
|
-
})]
|
|
27
|
+
children: [/* @__PURE__ */ e(u, { className: a(c[t], "group-data-[indeterminate]/cb:hidden") }), /* @__PURE__ */ e(b, { className: a(c[t], "hidden group-data-[indeterminate]/cb:block") })]
|
|
28
28
|
})
|
|
29
29
|
});
|
|
30
|
-
return r ? /* @__PURE__ */
|
|
30
|
+
return r ? /* @__PURE__ */ i("label", {
|
|
31
31
|
className: "flex cursor-pointer items-center gap-2 select-none",
|
|
32
|
-
children: [
|
|
32
|
+
children: [n, /* @__PURE__ */ e("span", {
|
|
33
33
|
className: "text-pho-secondary text-sm",
|
|
34
34
|
children: r
|
|
35
35
|
})]
|
|
36
|
-
}) :
|
|
36
|
+
}) : n;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
function
|
|
40
|
-
return /* @__PURE__ */ e(
|
|
41
|
-
className:
|
|
38
|
+
f.displayName = "Checkbox";
|
|
39
|
+
function k({ className: o, ...r }) {
|
|
40
|
+
return /* @__PURE__ */ e(m, {
|
|
41
|
+
className: a("flex flex-col gap-3", o),
|
|
42
42
|
...r
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
k.displayName = "CheckboxGroup";
|
|
46
46
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
f as Checkbox,
|
|
48
|
+
k as CheckboxGroup
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -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 {
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconMinus.mjs","../../src/components/checkbox/checkbox.tsx","../../src/components/checkbox/checkbox-group.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 12l5 5l10 -10\", \"key\": \"svg-0\" }]];\nconst IconCheck = createReactComponent(\"outline\", \"check\", \"Check\", __iconNode);\n\nexport { __iconNode, IconCheck as default };\n//# sourceMappingURL=IconCheck.mjs.map\n","/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 12l14 0\", \"key\": \"svg-0\" }]];\nconst IconMinus = createReactComponent(\"outline\", \"minus\", \"Minus\", __iconNode);\n\nexport { __iconNode, IconMinus as default };\n//# sourceMappingURL=IconMinus.mjs.map\n","import { type ComponentProps, type ReactNode } from \"react\";\nimport { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { IconCheck, IconMinus } from \"@tabler/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 <IconCheck\n className={cn(ICON[size], \"group-data-[indeterminate]/cb:hidden\")}\n />\n <IconMinus\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"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;AASA,IAAMA,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAoB,KAAO;AAAQ,CAAC,CAAC,GACnE,IAAY,EAAqB,WAAW,SAAS,SAASA,CAAU,GCDxE,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAc,KAAO;AAAQ,CAAC,CAAC,GAC7D,IAAY,EAAqB,WAAW,SAAS,SAAS,CAAU,GCHxE,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,EACE,WAAW,EAAG,EAAK,CAAA,GAAO,sCAAsC,EACjE,CAAA,GACD,gBAAA,EAAC,GAAD,EACE,WAAW,EACT,EAAK,CAAA,GACL,4CACF,EACD,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;ACtDvB,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"}
|
package/dist/components/input.js
CHANGED
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t } from "../chunks/cn-7uGUzCOM.js";
|
|
3
|
-
import { t as
|
|
3
|
+
import { t as N } from "../chunks/resolve-variant-CcD8iG5l.js";
|
|
4
|
+
import { t as s } from "../chunks/createReactComponent-BqCmnqfX.js";
|
|
5
|
+
import { t as b } from "../chunks/IconX-pZ9vrtSr.js";
|
|
4
6
|
import "react";
|
|
5
7
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
var k = [
|
|
9
|
+
["path", {
|
|
10
|
+
d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",
|
|
11
|
+
key: "svg-0"
|
|
12
|
+
}],
|
|
13
|
+
["path", {
|
|
14
|
+
d: "M12 8v4",
|
|
15
|
+
key: "svg-1"
|
|
16
|
+
}],
|
|
17
|
+
["path", {
|
|
18
|
+
d: "M12 16h.01",
|
|
19
|
+
key: "svg-2"
|
|
20
|
+
}]
|
|
21
|
+
], c = s("outline", "alert-circle", "AlertCircle", k), C = [["path", {
|
|
22
|
+
d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
23
|
+
key: "svg-0"
|
|
24
|
+
}], ["path", {
|
|
25
|
+
d: "M9 12l2 2l4 -4",
|
|
26
|
+
key: "svg-1"
|
|
27
|
+
}]], I = s("outline", "circle-check", "CircleCheck", C), w = [
|
|
28
|
+
["path", {
|
|
29
|
+
d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",
|
|
30
|
+
key: "svg-0"
|
|
31
|
+
}],
|
|
32
|
+
["path", {
|
|
33
|
+
d: "M12 9h.01",
|
|
34
|
+
key: "svg-1"
|
|
35
|
+
}],
|
|
36
|
+
["path", {
|
|
37
|
+
d: "M11 12h1v4h1",
|
|
38
|
+
key: "svg-2"
|
|
39
|
+
}]
|
|
40
|
+
], l = s("outline", "info-circle", "InfoCircle", w), M = {
|
|
8
41
|
brand: {
|
|
9
42
|
classes: "text-fg-pho-brand",
|
|
10
43
|
description: "Informational / product update (default)"
|
|
@@ -25,23 +58,23 @@ var w = {
|
|
|
25
58
|
classes: "text-fg-pho-error",
|
|
26
59
|
description: "Something went wrong"
|
|
27
60
|
}
|
|
28
|
-
},
|
|
29
|
-
brand:
|
|
30
|
-
gray:
|
|
31
|
-
success:
|
|
32
|
-
warning:
|
|
33
|
-
error:
|
|
34
|
-
},
|
|
35
|
-
function
|
|
36
|
-
const
|
|
61
|
+
}, _ = {
|
|
62
|
+
brand: l,
|
|
63
|
+
gray: l,
|
|
64
|
+
success: I,
|
|
65
|
+
warning: c,
|
|
66
|
+
error: c
|
|
67
|
+
}, d = "cursor-pointer text-sm font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
68
|
+
function A({ color: i = "brand", title: h, description: o, confirmLabel: n, onConfirm: p, dismissLabel: u = "Dismiss", onClose: a, icon: m, className: f, ref: v, ...g }) {
|
|
69
|
+
const x = m ?? _[i], y = !!n;
|
|
37
70
|
return /* @__PURE__ */ r("div", {
|
|
38
|
-
ref:
|
|
39
|
-
...
|
|
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",
|
|
71
|
+
ref: v,
|
|
72
|
+
...g,
|
|
73
|
+
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", f),
|
|
41
74
|
children: [
|
|
42
|
-
/* @__PURE__ */ e(
|
|
75
|
+
/* @__PURE__ */ e(x, {
|
|
43
76
|
"aria-hidden": "true",
|
|
44
|
-
className: t("mt-0.5 size-5 shrink-0",
|
|
77
|
+
className: t("mt-0.5 size-5 shrink-0", N(M, i))
|
|
45
78
|
}),
|
|
46
79
|
/* @__PURE__ */ r("div", {
|
|
47
80
|
className: "flex flex-1 flex-col gap-3 pr-6",
|
|
@@ -49,43 +82,40 @@ function I({ color: i = "brand", title: d, description: s, confirmLabel: n, onCo
|
|
|
49
82
|
className: "flex flex-col gap-1",
|
|
50
83
|
children: [/* @__PURE__ */ e("p", {
|
|
51
84
|
className: "text-pho-primary text-sm font-semibold",
|
|
52
|
-
children:
|
|
53
|
-
}),
|
|
85
|
+
children: h
|
|
86
|
+
}), o != null && o !== !1 && /* @__PURE__ */ e("p", {
|
|
54
87
|
className: "text-pho-tertiary text-sm",
|
|
55
|
-
children:
|
|
88
|
+
children: o
|
|
56
89
|
})]
|
|
57
|
-
}),
|
|
90
|
+
}), y && /* @__PURE__ */ r("div", {
|
|
58
91
|
className: "flex gap-4",
|
|
59
92
|
children: [/* @__PURE__ */ e("button", {
|
|
60
93
|
type: "button",
|
|
61
94
|
onClick: p,
|
|
62
|
-
className: t(
|
|
95
|
+
className: t(d, "text-pho-brand hover:underline"),
|
|
63
96
|
children: n
|
|
64
97
|
}), /* @__PURE__ */ e("button", {
|
|
65
98
|
type: "button",
|
|
66
|
-
onClick:
|
|
67
|
-
className: t(
|
|
68
|
-
children:
|
|
99
|
+
onClick: a,
|
|
100
|
+
className: t(d, "text-pho-secondary hover:text-pho-secondary-hover"),
|
|
101
|
+
children: u
|
|
69
102
|
})]
|
|
70
103
|
})]
|
|
71
104
|
}),
|
|
72
|
-
|
|
105
|
+
a && /* @__PURE__ */ e("button", {
|
|
73
106
|
type: "button",
|
|
74
|
-
onClick:
|
|
107
|
+
onClick: a,
|
|
75
108
|
"aria-label": "Dismiss",
|
|
76
109
|
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
|
-
children: /* @__PURE__ */ e(
|
|
78
|
-
"aria-hidden": "true",
|
|
79
|
-
weight: "bold"
|
|
80
|
-
})
|
|
110
|
+
children: /* @__PURE__ */ e(b, { "aria-hidden": "true" })
|
|
81
111
|
})
|
|
82
112
|
]
|
|
83
113
|
});
|
|
84
114
|
}
|
|
85
|
-
|
|
115
|
+
A.displayName = "Notification";
|
|
86
116
|
export {
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
M as NOTIFICATION_COLORS,
|
|
118
|
+
A as Notification
|
|
89
119
|
};
|
|
90
120
|
|
|
91
121
|
//# sourceMappingURL=notification.js.map
|
|
@@ -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-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,E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K,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
|
+
{"version":3,"file":"notification.js","names":["__iconNode","__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.mjs","../../src/components/notification/notification.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 8v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertCircle = createReactComponent(\"outline\", \"alert-circle\", \"AlertCircle\", __iconNode);\n\nexport { __iconNode, IconAlertCircle as default };\n//# sourceMappingURL=IconAlertCircle.mjs.map\n","/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M9 12l2 2l4 -4\", \"key\": \"svg-1\" }]];\nconst IconCircleCheck = createReactComponent(\"outline\", \"circle-check\", \"CircleCheck\", __iconNode);\n\nexport { __iconNode, IconCircleCheck as default };\n//# sourceMappingURL=IconCircleCheck.mjs.map\n","/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 9h.01\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M11 12h1v4h1\", \"key\": \"svg-2\" }]];\nconst IconInfoCircle = createReactComponent(\"outline\", \"info-circle\", \"InfoCircle\", __iconNode);\n\nexport { __iconNode, IconInfoCircle as default };\n//# sourceMappingURL=IconInfoCircle.mjs.map\n","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\nimport {\n IconCircleCheck,\n IconInfoCircle,\n IconAlertCircle,\n IconX,\n type Icon,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n/**\n * Design notes (Geist-aligned):\n * - ONE closed, semantic axis: `color`. It selects a status glyph *and* its\n * tint together — you never pick an icon and a color separately. This is the\n * `IconNotification` flavor from the app; the unused avatar/image variants of\n * the source family are intentionally dropped.\n * - The action row is a single reduced pair: a brand `confirmLabel` link beside\n * a gray dismiss link. It appears only when there's something to confirm.\n * - `onClose` is the only thing that renders the top-right close button — no\n * separate boolean flag to keep in sync.\n */\n\n/** Status color → icon tint. A bare status-tinted glyph, no badge surface. */\nexport const NOTIFICATION_COLORS = {\n brand: {\n classes: \"text-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: IconInfoCircle,\n gray: IconInfoCircle,\n success: IconCircleCheck,\n warning: IconAlertCircle,\n error: IconAlertCircle,\n} satisfies Record<NotificationColor, Icon>;\n\nexport interface NotificationProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"title\" | \"color\"\n> {\n /** Status color — selects the glyph and its tint. @default \"brand\" */\n color?: NotificationColor;\n /** Bold heading line. */\n title: ReactNode;\n /** Supporting line under the title. */\n description?: ReactNode;\n /** Confirm action label — renders a brand link paired with a dismiss link. */\n confirmLabel?: string;\n /** Called when the confirm link is clicked. */\n onConfirm?: () => void;\n /** Dismiss link label, shown beside the confirm link. @default \"Dismiss\" */\n dismissLabel?: string;\n /** Called on dismiss. Its presence also renders the top-right close button. */\n onClose?: () => void;\n /** Override the status glyph while keeping the color's tint. */\n icon?: Icon;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst LINK_CLASS =\n \"cursor-pointer text-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 [&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AA,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,EAAO,eAAY,OAAQ,CAAA;AAAA,MACrB,CAAA;AAAA,IAEP;AAAA;AAET;AAEA,EAAa,cAAc"}
|
package/dist/index.js
CHANGED
|
@@ -3,22 +3,22 @@ import { t as o } from "./chunks/cn-7uGUzCOM.js";
|
|
|
3
3
|
import { n as s, r, t as n } from "./chunks/link-provider-9TFNyDqO.js";
|
|
4
4
|
import { t as m } from "./chunks/resolve-variant-CcD8iG5l.js";
|
|
5
5
|
import "./utils.js";
|
|
6
|
-
import { a as p, c as u, i as B, l as T, n as c, o as E, r as S, s as l, t as N, u as _ } from "./chunks/button-
|
|
7
|
-
import { t as C } from "./chunks/
|
|
8
|
-
import { t as L } from "./chunks/
|
|
9
|
-
import { t as U } from "./chunks/dialog-
|
|
6
|
+
import { a as p, c as u, i as B, l as T, n as c, o as E, r as S, s as l, t as N, u as _ } from "./chunks/button-CQ4cZvkC.js";
|
|
7
|
+
import { t as C } from "./chunks/input-DbJpdu6v.js";
|
|
8
|
+
import { t as L } from "./chunks/close-button-CNhn8z0w.js";
|
|
9
|
+
import { t as U } from "./chunks/dialog-7oOe-eaO.js";
|
|
10
10
|
export {
|
|
11
11
|
N as BUTTON_SHAPES,
|
|
12
12
|
c as BUTTON_SIZES,
|
|
13
13
|
S as BUTTON_VARIANTS,
|
|
14
14
|
B as Button,
|
|
15
15
|
p as ButtonLink,
|
|
16
|
-
|
|
16
|
+
L as CloseButton,
|
|
17
17
|
U as Dialog,
|
|
18
18
|
E as EFFECT_BUTTON_SIZES,
|
|
19
19
|
l as EffectButton,
|
|
20
20
|
u as EffectButtonLink,
|
|
21
|
-
|
|
21
|
+
C as Input,
|
|
22
22
|
n as LinkProvider,
|
|
23
23
|
T as buttonVariants,
|
|
24
24
|
o as cn,
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, ButtonHTMLAttributes, FC, ReactNode, Ref } from 'react';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Size axis — padding, text size, and icon-only (svgOnly) padding.
|
|
4
|
+
*
|
|
5
|
+
* Icon-side tuck (LiftKit-derived optical correction): a side that carries an
|
|
6
|
+
* icon gets its padding divided by the golden ratio — an icon's rounded form
|
|
7
|
+
* brings its own whitespace, so the full text-edge padding reads as a hole.
|
|
8
|
+
* LiftKit: `--button-padX-sideWithIcon: calc(font-size / 1.618)`. Applied to
|
|
9
|
+
* Pho's paddings: sm 14px/φ ≈ 8px · md 16px/φ ≈ 10px · lg 20px/φ ≈ 12px,
|
|
10
|
+
* selected structurally via `:has()` on the slot markers (`data-icon` is
|
|
11
|
+
* `prefix`, `suffix`, or `loading` — the spinner is an icon too).
|
|
12
|
+
*/
|
|
3
13
|
export declare const BUTTON_SIZES: {
|
|
4
14
|
sm: {
|
|
5
15
|
classes: string;
|
|
@@ -9,7 +9,7 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
9
9
|
size?: InputSize;
|
|
10
10
|
/** Render the invalid state (ring + icon + error-colored hint). */
|
|
11
11
|
invalid?: boolean;
|
|
12
|
-
/** Leading icon component (e.g. a
|
|
12
|
+
/** Leading icon component (e.g. a Tabler icon). */
|
|
13
13
|
icon?: ComponentType<{
|
|
14
14
|
className?: string;
|
|
15
15
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Distinguish an icon passed as a *component* (e.g. a
|
|
3
|
+
* Distinguish an icon passed as a *component* (e.g. a Tabler icon or any
|
|
4
4
|
* `FC`/forwardRef) from one passed as an already-rendered *element*. Lets icon
|
|
5
5
|
* props accept either form: `prefix={Plus}` or `prefix={<Plus />}`.
|
|
6
6
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@photon-ai/pho-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Pho Design System — Photon's React component library, built on Base UI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -362,12 +362,12 @@
|
|
|
362
362
|
}
|
|
363
363
|
},
|
|
364
364
|
"peerDependencies": {
|
|
365
|
-
"@
|
|
365
|
+
"@tabler/icons-react": "^3.44.0",
|
|
366
366
|
"react": "^18.0.0 || ^19.0.0",
|
|
367
367
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
368
368
|
},
|
|
369
369
|
"devDependencies": {
|
|
370
|
-
"@
|
|
370
|
+
"@tabler/icons-react": "^3.44.0",
|
|
371
371
|
"@tailwindcss/vite": "^4.1.0",
|
|
372
372
|
"@testing-library/jest-dom": "^6.9.1",
|
|
373
373
|
"@testing-library/react": "^16.3.2",
|