@photon-ai/pho-ui 0.2.0 → 0.4.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-BMDHIgZh.js +360 -0
- package/dist/chunks/button-BMDHIgZh.js.map +1 -0
- package/dist/chunks/{close-button-DKaNIndU.js → close-button-CRiiwy6K.js} +5 -6
- package/dist/chunks/close-button-CRiiwy6K.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-sTOaOEB2.js} +2 -2
- package/dist/chunks/{dialog-CyyL5VCc.js.map → dialog-sTOaOEB2.js.map} +1 -1
- package/dist/chunks/input-e1k2gbET.js +102 -0
- package/dist/chunks/input-e1k2gbET.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 +36 -14
- 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-GQALfaly.js +0 -325
- package/dist/chunks/button-GQALfaly.js.map +0 -1
- 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,102 @@
|
|
|
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 E } from "react";
|
|
5
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Field as s } from "@base-ui/react/field";
|
|
7
|
+
var k = [
|
|
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
|
+
], D = n("outline", "eye-off", "EyeOff", k), S = [["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
|
+
}]], C = n("outline", "eye", "Eye", S), L = [["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
|
+
}]], M = n("filled", "alert-circle-filled", "AlertCircleFilled", L), z = {
|
|
30
|
+
sm: "px-3 py-2 text-sm",
|
|
31
|
+
md: "px-3 py-2 text-md",
|
|
32
|
+
lg: "px-3.5 py-2.5 text-md"
|
|
33
|
+
}, O = {
|
|
34
|
+
sm: "pl-9",
|
|
35
|
+
md: "pl-10",
|
|
36
|
+
lg: "pl-10.5"
|
|
37
|
+
}, R = {
|
|
38
|
+
sm: "left-3 size-4",
|
|
39
|
+
md: "left-3 size-5",
|
|
40
|
+
lg: "left-3.5 size-5"
|
|
41
|
+
}, q = {
|
|
42
|
+
sm: "rounded-lg",
|
|
43
|
+
md: "rounded-lg",
|
|
44
|
+
lg: "squircle rounded-xl"
|
|
45
|
+
}, F = {
|
|
46
|
+
sm: "autofill:rounded-lg",
|
|
47
|
+
md: "autofill:rounded-lg",
|
|
48
|
+
lg: "squircle autofill:rounded-xl"
|
|
49
|
+
};
|
|
50
|
+
function P({ label: d, hint: c, size: t = "md", invalid: a, icon: i, labelTrailing: f, disabled: g, required: p, type: m = "text", className: h, wrapperClassName: v, id: x, ref: y, ...b }) {
|
|
51
|
+
const [u, N] = E(!1), l = m === "password", I = l && u ? "text" : m, _ = !!i, w = l || a;
|
|
52
|
+
return /* @__PURE__ */ o(s.Root, {
|
|
53
|
+
disabled: g,
|
|
54
|
+
className: "group/field flex w-full flex-col gap-1.5",
|
|
55
|
+
children: [
|
|
56
|
+
d && /* @__PURE__ */ o("div", {
|
|
57
|
+
className: "flex items-center justify-between gap-2",
|
|
58
|
+
children: [/* @__PURE__ */ o(s.Label, {
|
|
59
|
+
className: "text-pho-secondary flex cursor-default items-center gap-0.5 text-sm font-medium",
|
|
60
|
+
children: [d, p && /* @__PURE__ */ e("span", {
|
|
61
|
+
className: "text-pho-brand",
|
|
62
|
+
children: "*"
|
|
63
|
+
})]
|
|
64
|
+
}), f]
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ o("div", {
|
|
67
|
+
"data-invalid": a || void 0,
|
|
68
|
+
className: r("bg-pho-primary ring-pho-primary relative flex w-full items-center ring-1 transition-shadow duration-100 ease-linear ring-inset", q[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),
|
|
69
|
+
children: [
|
|
70
|
+
i && /* @__PURE__ */ e(i, { className: r("text-fg-pho-quaternary pointer-events-none absolute", R[t]) }),
|
|
71
|
+
/* @__PURE__ */ e(s.Control, {
|
|
72
|
+
ref: y,
|
|
73
|
+
id: x,
|
|
74
|
+
type: I,
|
|
75
|
+
required: p,
|
|
76
|
+
...b,
|
|
77
|
+
className: r("text-pho-primary placeholder:text-pho-placeholder m-0 w-full bg-transparent outline-none disabled:cursor-not-allowed", z[t], F[t], _ && O[t], w && "pr-9", h)
|
|
78
|
+
}),
|
|
79
|
+
a && !l && /* @__PURE__ */ e(M, { className: "text-fg-pho-error pointer-events-none absolute right-3 size-4" }),
|
|
80
|
+
l && /* @__PURE__ */ e("button", {
|
|
81
|
+
type: "button",
|
|
82
|
+
tabIndex: -1,
|
|
83
|
+
"aria-label": "Toggle password visibility",
|
|
84
|
+
onClick: () => N((A) => !A),
|
|
85
|
+
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",
|
|
86
|
+
children: u ? /* @__PURE__ */ e(D, { className: "size-4" }) : /* @__PURE__ */ e(C, { className: "size-4" })
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
}),
|
|
90
|
+
c && /* @__PURE__ */ e(s.Description, {
|
|
91
|
+
className: r("text-pho-tertiary text-sm", a && "text-pho-error"),
|
|
92
|
+
children: c
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
P.displayName = "Input";
|
|
98
|
+
export {
|
|
99
|
+
P as t
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=input-e1k2gbET.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-e1k2gbET.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\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// 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// Match the wrapper radius on the inner input's autofill background so the\n// browser's autofill fill doesn't square off the wrapper's rounded corners.\nconst SIZE_AUTOFILL_RADIUS: Record<InputSize, string> = {\n sm: \"autofill:rounded-lg\",\n md: \"autofill:rounded-lg\",\n lg: \"squircle autofill:rounded-xl\",\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).\n \"bg-pho-primary ring-pho-primary relative flex w-full items-center ring-1 transition-shadow duration-100 ease-linear ring-inset\",\n SIZE_RADIUS[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 hasTrailingIcon && \"pr-9\",\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":"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"}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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-BMDHIgZh.js";
|
|
3
|
+
import { t as E } from "../chunks/close-button-CRiiwy6K.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,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AACF,GAKM,IAAW;AAAA,EACf,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GA0BM,IACJ;AAcF,SAAgB,EAAa,EAC3B,OAAA,IAAQ,SACR,OAAA,GACA,aAAA,GACA,cAAA,GACA,WAAA,GACA,cAAA,IAAe,WACf,SAAA,GACA,MAAA,GACA,WAAA,GACA,KAAA,GACA,GAAG,EAAA,GACiB;AACpB,QAAM,IAAQ,KAAQ,EAAS,CAAA,GACzB,IAAc,EAAQ;AAE5B,SACE,gBAAA,EAAC,OAAD;AAAA,IACO,KAAA;AAAA,IACL,GAAI;AAAA,IACJ,WAAW,EAET,iIACA,CACF;AAAA,cAPF;AAAA,MASE,gBAAA,EAAC,GAAD;AAAA,QACE,eAAY;AAAA,QACZ,WAAW,EACT,0BACA,EAAe,GAAqB,CAAK,CAC3C;AAAA,MACD,CAAA;AAAA,MAED,gBAAA,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,kBAAf,CACE,gBAAA,EAAC,OAAD;AAAA,UAAK,WAAU;AAAA,oBAAf,CACE,gBAAA,EAAC,KAAD;AAAA,YAAG,WAAU;AAAA,sBAA0C;AAAA,UAAS,CAAA,GAC/D,KAAe,QAAQ,MAAgB,MACtC,gBAAA,EAAC,KAAD;AAAA,YAAG,WAAU;AAAA,sBAA6B;AAAA,UAAe,CAAA,CAExD;AAAA,YAEJ,KACC,gBAAA,EAAC,OAAD;AAAA,UAAK,WAAU;AAAA,oBAAf,CACE,gBAAA,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAW,EACT,GAEA,gCACF;AAAA,sBAEC;AAAA,UACK,CAAA,GACR,gBAAA,EAAC,UAAD;AAAA,YACE,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAW,EACT,GACA,mDACF;AAAA,sBAEC;AAAA,UACK,CAAA,CACL;AAAA,UAEJ;AAAA;MAEJ,KACC,gBAAA,EAAC,UAAD;AAAA,QACE,MAAK;AAAA,QACL,SAAS;AAAA,QACT,cAAW;AAAA,QACX,WAAU;AAAA,kBAEV,gBAAA,EAAC,GAAD;AAAA,UAAG,eAAY;AAAA,UAAO,QAAO;AAAA,QAAQ,CAAA;AAAA,MAC/B,CAAA;AAAA,IAEP;AAAA;AAET;AAEA,EAAa,cAAc"}
|
|
1
|
+
{"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 [&>svg]:size-4\"\n >\n <IconX aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n}\n\nNotification.displayName = \"Notification\";\n"],"x_google_ignoreList":[0,1,2],"mappings":"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"}
|
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-BMDHIgZh.js";
|
|
7
|
+
import { t as C } from "./chunks/input-e1k2gbET.js";
|
|
8
|
+
import { t as L } from "./chunks/close-button-CRiiwy6K.js";
|
|
9
|
+
import { t as U } from "./chunks/dialog-sTOaOEB2.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,
|
|
@@ -106,7 +106,11 @@ export declare function ButtonLink({ variant, size, shape, prefix, suffix, svgOn
|
|
|
106
106
|
export declare namespace ButtonLink {
|
|
107
107
|
var displayName: string;
|
|
108
108
|
}
|
|
109
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* EffectButton shares Button's size axis verbatim — same padding, text size,
|
|
111
|
+
* and svgOnly geometry, so effect pills line up with plain Buttons.
|
|
112
|
+
* Kept as a named export for API compatibility.
|
|
113
|
+
*/
|
|
110
114
|
export declare const EFFECT_BUTTON_SIZES: {
|
|
111
115
|
sm: {
|
|
112
116
|
classes: string;
|
|
@@ -116,9 +120,13 @@ export declare const EFFECT_BUTTON_SIZES: {
|
|
|
116
120
|
classes: string;
|
|
117
121
|
description: string;
|
|
118
122
|
};
|
|
123
|
+
lg: {
|
|
124
|
+
classes: string;
|
|
125
|
+
description: string;
|
|
126
|
+
};
|
|
119
127
|
};
|
|
120
|
-
export type EffectButtonSize =
|
|
121
|
-
/** Compose the
|
|
128
|
+
export type EffectButtonSize = ButtonSize;
|
|
129
|
+
/** Compose the full class string for an effect button — exported for reuse. */
|
|
122
130
|
export declare function effectButtonVariants(opts?: {
|
|
123
131
|
size?: EffectButtonSize;
|
|
124
132
|
fullWidth?: boolean;
|
|
@@ -126,10 +134,19 @@ export declare function effectButtonVariants(opts?: {
|
|
|
126
134
|
}): string;
|
|
127
135
|
type MotionConflicts = "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragExit" | "onDragLeave" | "onDragOver" | "onDrop" | "style";
|
|
128
136
|
interface EffectButtonBaseProps {
|
|
129
|
-
/** Size variant. @default "md" */
|
|
137
|
+
/** Size variant — Button's scale (32 / 36 / 44px). @default "md" */
|
|
130
138
|
size?: EffectButtonSize;
|
|
131
139
|
/** Stretch to the container's full width (stacked login / OAuth pills). */
|
|
132
140
|
fullWidth?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Play the Motion treatment. When `true` (the default), hovering springs the
|
|
143
|
+
* sheen, gap, and icon reveal — at rest the pill reads as a normal button
|
|
144
|
+
* with the icon hidden. When `false` there is no animation at all: the pill
|
|
145
|
+
* is a plain static `Button` with the effect styling, and a passed icon is
|
|
146
|
+
* simply displayed from the start.
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
animated?: boolean;
|
|
133
150
|
/** Slot before the label — a component (`Plus`) or element (`<Plus />`). */
|
|
134
151
|
prefix?: Slottable;
|
|
135
152
|
/** Slot after the label. */
|
|
@@ -151,22 +168,27 @@ export interface EffectButtonLinkProps extends EffectButtonBaseProps, Omit<Ancho
|
|
|
151
168
|
disabled?: boolean;
|
|
152
169
|
}
|
|
153
170
|
/**
|
|
154
|
-
* EffectButton — the glossy, springy
|
|
155
|
-
* Framer "Button - Effect"
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
171
|
+
* EffectButton — {@link Button} wearing the glossy, springy effect treatment
|
|
172
|
+
* ported frame-for-frame from Photon's Framer "Button - Effect". Shares
|
|
173
|
+
* Button's size scale (`sm`/`md`/`lg` at 32/36/44px) so it pairs with plain
|
|
174
|
+
* Buttons at equal heights. `animated` (default `true`) gates the Motion
|
|
175
|
+
* treatment: off, it's a static effect-styled Button whose icon is always
|
|
176
|
+
* visible. `fullWidth` stretches the pill across its container. There is no
|
|
177
|
+
* variant axis — for a supporting/OAuth pill without the sheen, use
|
|
178
|
+
* `<Button variant="secondary">`. Triggers an action; for navigation use
|
|
179
|
+
* {@link EffectButtonLink}.
|
|
159
180
|
*/
|
|
160
|
-
export declare function EffectButton({ size, fullWidth, prefix, suffix, svgOnly, loading, children, className, ref, ...props }: EffectButtonProps): import("react").JSX.Element;
|
|
181
|
+
export declare function EffectButton({ size, fullWidth, animated, prefix, suffix, svgOnly, loading, children, className, ref, ...props }: EffectButtonProps): import("react").JSX.Element;
|
|
161
182
|
export declare namespace EffectButton {
|
|
162
183
|
var displayName: string;
|
|
163
184
|
}
|
|
164
185
|
/**
|
|
165
|
-
* EffectButtonLink — {@link EffectButton} as a link, for navigation that
|
|
166
|
-
* the URL.
|
|
167
|
-
*
|
|
186
|
+
* EffectButtonLink — {@link EffectButton} as a link, for navigation that
|
|
187
|
+
* changes the URL. Composes {@link ButtonLink} (Motion-wrapped when animated),
|
|
188
|
+
* which renders the host router's link via `LinkProvider`, so the pill
|
|
189
|
+
* animates identically to the button.
|
|
168
190
|
*/
|
|
169
|
-
export declare function EffectButtonLink({ size, fullWidth, prefix, suffix, svgOnly, loading, disabled, href, children, className, ...props }: EffectButtonLinkProps): import("react").JSX.Element;
|
|
191
|
+
export declare function EffectButtonLink({ size, fullWidth, animated, prefix, suffix, svgOnly, loading, disabled, href, children, className, ...props }: EffectButtonLinkProps): import("react").JSX.Element;
|
|
170
192
|
export declare namespace EffectButtonLink {
|
|
171
193
|
var displayName: string;
|
|
172
194
|
}
|
|
@@ -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
|
*/
|