@ai-matrx/tap-target 0.1.1 → 0.2.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/CHANGELOG.md +35 -0
- package/dist/buttons.cjs +253 -288
- package/dist/buttons.cjs.map +1 -1
- package/dist/buttons.js +213 -234
- package/dist/buttons.js.map +1 -1
- package/dist/index.cjs +28 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -19
- package/dist/index.d.ts +1 -19
- package/dist/index.js +41 -62
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all)
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
|
|
31
21
|
// src/index.ts
|
|
@@ -38,10 +28,6 @@ __export(src_exports, {
|
|
|
38
28
|
TapTargetButtonSolid: () => TapTargetButtonSolid,
|
|
39
29
|
TapTargetButtonTransparent: () => TapTargetButtonTransparent,
|
|
40
30
|
TapTargetLabeled: () => TapTargetLabeled,
|
|
41
|
-
Tooltip: () => Tooltip,
|
|
42
|
-
TooltipContent: () => TooltipContent,
|
|
43
|
-
TooltipProvider: () => TooltipProvider,
|
|
44
|
-
TooltipTrigger: () => TooltipTrigger,
|
|
45
31
|
getTapTargetLinkComponent: () => getTapTargetLinkComponent,
|
|
46
32
|
setTapTargetLinkComponent: () => setTapTargetLinkComponent
|
|
47
33
|
});
|
|
@@ -49,40 +35,13 @@ module.exports = __toCommonJS(src_exports);
|
|
|
49
35
|
|
|
50
36
|
// src/tap-target-button.tsx
|
|
51
37
|
var import_react = require("react");
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
// src/tooltip.tsx
|
|
55
|
-
var React = __toESM(require("react"), 1);
|
|
56
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
38
|
+
var import_design_system = require("@ai-matrx/design-system");
|
|
57
39
|
|
|
58
40
|
// src/cn.ts
|
|
59
41
|
function cn(...values) {
|
|
60
42
|
return values.filter(Boolean).join(" ").trim();
|
|
61
43
|
}
|
|
62
44
|
|
|
63
|
-
// src/tooltip.tsx
|
|
64
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
65
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
66
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
67
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
68
|
-
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
-
TooltipPrimitive.Content,
|
|
70
|
-
{
|
|
71
|
-
ref,
|
|
72
|
-
sideOffset,
|
|
73
|
-
className: cn(
|
|
74
|
-
// Neutral, theme-aware surface (popover tokens) so tooltip text is
|
|
75
|
-
// ALWAYS legible in both light and dark mode — including rich content
|
|
76
|
-
// that uses `text-muted-foreground`. A brand-colored `bg-primary`
|
|
77
|
-
// background broke legibility for any non-default content.
|
|
78
|
-
"z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
79
|
-
className
|
|
80
|
-
),
|
|
81
|
-
...props
|
|
82
|
-
}
|
|
83
|
-
) }));
|
|
84
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
85
|
-
|
|
86
45
|
// src/link.ts
|
|
87
46
|
var LINK_SLOT = /* @__PURE__ */ Symbol.for("@ai-matrx/tap-target:link-component");
|
|
88
47
|
function setTapTargetLinkComponent(component) {
|
|
@@ -93,7 +52,7 @@ function getTapTargetLinkComponent() {
|
|
|
93
52
|
}
|
|
94
53
|
|
|
95
54
|
// src/tap-target-button.tsx
|
|
96
|
-
var
|
|
55
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
97
56
|
var EXTERNAL_RE = /^(https?:|mailto:|tel:)/i;
|
|
98
57
|
var TAP_OUTER_CLASS = "matrx-tap-target group";
|
|
99
58
|
var TAP_GROUP_OUTER_CLASS = "matrx-tap-target matrx-tap-target-sm group";
|
|
@@ -109,9 +68,9 @@ function IconContent({
|
|
|
109
68
|
className: cn(className, icon.props.className)
|
|
110
69
|
});
|
|
111
70
|
}
|
|
112
|
-
return /* @__PURE__ */ (0,
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className, children: icon });
|
|
113
72
|
}
|
|
114
|
-
return /* @__PURE__ */ (0,
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
74
|
"svg",
|
|
116
75
|
{
|
|
117
76
|
className,
|
|
@@ -146,7 +105,7 @@ function buildTapInner({
|
|
|
146
105
|
children,
|
|
147
106
|
strokeWidth = 2
|
|
148
107
|
}) {
|
|
149
|
-
const iconEl = /* @__PURE__ */ (0,
|
|
108
|
+
const iconEl = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
150
109
|
IconContent,
|
|
151
110
|
{
|
|
152
111
|
icon,
|
|
@@ -157,11 +116,11 @@ function buildTapInner({
|
|
|
157
116
|
);
|
|
158
117
|
const pillClasses = label ? `${pillClassName} ${inlineModifier}`.trim() : pillClassName;
|
|
159
118
|
if (!label) {
|
|
160
|
-
return /* @__PURE__ */ (0,
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: pillClasses, children: iconEl });
|
|
161
120
|
}
|
|
162
|
-
return /* @__PURE__ */ (0,
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: pillClasses, children: [
|
|
163
122
|
iconEl,
|
|
164
|
-
/* @__PURE__ */ (0,
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClassName ?? "matrx-tap-label", children: label })
|
|
165
124
|
] });
|
|
166
125
|
}
|
|
167
126
|
function renderTapTarget({
|
|
@@ -249,7 +208,7 @@ function renderTrigger({
|
|
|
249
208
|
buttonRef
|
|
250
209
|
}) {
|
|
251
210
|
if (disabled && href) {
|
|
252
|
-
return /* @__PURE__ */ (0,
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
253
212
|
"span",
|
|
254
213
|
{
|
|
255
214
|
"aria-disabled": "true",
|
|
@@ -262,7 +221,7 @@ function renderTrigger({
|
|
|
262
221
|
if (href) {
|
|
263
222
|
const isExternal = EXTERNAL_RE.test(href);
|
|
264
223
|
if (isExternal) {
|
|
265
|
-
return /* @__PURE__ */ (0,
|
|
224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
266
225
|
"a",
|
|
267
226
|
{
|
|
268
227
|
href,
|
|
@@ -276,7 +235,7 @@ function renderTrigger({
|
|
|
276
235
|
}
|
|
277
236
|
const Link = linkComponent ?? getTapTargetLinkComponent();
|
|
278
237
|
if (Link) {
|
|
279
|
-
return /* @__PURE__ */ (0,
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
280
239
|
Link,
|
|
281
240
|
{
|
|
282
241
|
href,
|
|
@@ -289,7 +248,7 @@ function renderTrigger({
|
|
|
289
248
|
}
|
|
290
249
|
);
|
|
291
250
|
}
|
|
292
|
-
return /* @__PURE__ */ (0,
|
|
251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
293
252
|
"a",
|
|
294
253
|
{
|
|
295
254
|
href,
|
|
@@ -302,7 +261,7 @@ function renderTrigger({
|
|
|
302
261
|
);
|
|
303
262
|
}
|
|
304
263
|
if (as === "label") {
|
|
305
|
-
return /* @__PURE__ */ (0,
|
|
264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
306
265
|
"label",
|
|
307
266
|
{
|
|
308
267
|
htmlFor,
|
|
@@ -312,7 +271,7 @@ function renderTrigger({
|
|
|
312
271
|
}
|
|
313
272
|
);
|
|
314
273
|
}
|
|
315
|
-
return /* @__PURE__ */ (0,
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
316
275
|
"button",
|
|
317
276
|
{
|
|
318
277
|
ref: buttonRef,
|
|
@@ -336,14 +295,14 @@ function withTooltip(trigger, {
|
|
|
336
295
|
if (tooltip === false) return trigger;
|
|
337
296
|
const label = typeof tooltip === "string" && tooltip.length > 0 ? tooltip : ariaLabel;
|
|
338
297
|
if (!label) return trigger;
|
|
339
|
-
return /* @__PURE__ */ (0,
|
|
340
|
-
/* @__PURE__ */ (0,
|
|
298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design_system.Tooltip, { children: [
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.TooltipTrigger, { asChild: true, children: disabled ? (
|
|
341
300
|
// Radix Tooltip triggers need a hoverable element; a disabled button
|
|
342
301
|
// does not dispatch pointer events, so we wrap in a span for the
|
|
343
302
|
// trigger target while keeping the disabled visual state.
|
|
344
|
-
/* @__PURE__ */ (0,
|
|
303
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "inline-flex", children: trigger })
|
|
345
304
|
) : trigger }),
|
|
346
|
-
/* @__PURE__ */ (0,
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.TooltipContent, { side: tooltipSide, align: tooltipAlign, children: label })
|
|
347
306
|
] });
|
|
348
307
|
}
|
|
349
308
|
var TapTargetButton = (0, import_react.forwardRef)(function TapTargetButton2({
|
|
@@ -499,7 +458,7 @@ var TapTargetButtonDestructive = (0, import_react.forwardRef)(function TapTarget
|
|
|
499
458
|
hoverBgColor = "hover:bg-destructive/90",
|
|
500
459
|
...rest
|
|
501
460
|
}, ref) {
|
|
502
|
-
return /* @__PURE__ */ (0,
|
|
461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
503
462
|
TapTargetButtonSolid,
|
|
504
463
|
{
|
|
505
464
|
ref,
|
|
@@ -564,32 +523,33 @@ function TapTargetButtonGroup({
|
|
|
564
523
|
children,
|
|
565
524
|
className
|
|
566
525
|
}) {
|
|
567
|
-
return /* @__PURE__ */ (0,
|
|
526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
568
527
|
"div",
|
|
569
528
|
{
|
|
570
529
|
className: className ? `relative inline-flex h-9 items-center ${className}` : "relative inline-flex h-9 items-center",
|
|
571
530
|
children: [
|
|
572
|
-
/* @__PURE__ */ (0,
|
|
573
|
-
/* @__PURE__ */ (0,
|
|
531
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 h-7 rounded-full matrx-glass-thin-border" }),
|
|
532
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative flex min-w-0 items-center", children })
|
|
574
533
|
]
|
|
575
534
|
}
|
|
576
535
|
);
|
|
577
536
|
}
|
|
578
537
|
|
|
579
538
|
// src/tap-target-labeled.tsx
|
|
580
|
-
var
|
|
539
|
+
var import_design_system2 = require("@ai-matrx/design-system");
|
|
540
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
581
541
|
function TapTargetLabeled({
|
|
582
542
|
label,
|
|
583
543
|
children,
|
|
584
544
|
hideLabel = false,
|
|
585
545
|
toolTipSide = "bottom"
|
|
586
546
|
}) {
|
|
587
|
-
return /* @__PURE__ */ (0,
|
|
588
|
-
/* @__PURE__ */ (0,
|
|
547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_design_system2.TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_design_system2.Tooltip, { children: [
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_design_system2.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-col items-center p-0 gap-0 space-y-0 space-x-0 shrink-0", children: [
|
|
589
549
|
children,
|
|
590
|
-
!hideLabel && /* @__PURE__ */ (0,
|
|
550
|
+
!hideLabel && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-[10px] text-muted-foreground/70 leading-tight max-w-[52px] text-center truncate", children: label })
|
|
591
551
|
] }) }),
|
|
592
|
-
/* @__PURE__ */ (0,
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_design_system2.TooltipContent, { side: toolTipSide, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-mono text-xs max-w-[280px] break-all", children: label }) })
|
|
593
553
|
] }) });
|
|
594
554
|
}
|
|
595
555
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/tap-target-button.tsx","../src/tooltip.tsx","../src/cn.ts","../src/link.ts","../src/tap-target-labeled.tsx"],"sourcesContent":["// @ai-matrx/tap-target — primitives entry.\n// The ~60 pre-composed buttons live behind the opt-in \"./buttons\" subpath.\n// The geometry stylesheet ships as \"./styles.css\" — import it once at app root.\n\nexport {\n TapTargetButton,\n TapTargetButtonTransparent,\n TapTargetButtonSolid,\n TapTargetButtonDestructive,\n TapTargetButtonForGroup,\n TapTargetButtonGroup,\n type TapTargetButtonProps,\n type TapTargetButtonSolidProps,\n} from \"./tap-target-button\";\nexport { TapTargetLabeled } from \"./tap-target-labeled\";\nexport {\n setTapTargetLinkComponent,\n getTapTargetLinkComponent,\n type TapTargetLinkComponent,\n type TapTargetLinkProps,\n} from \"./link\";\n// Hosts mount TooltipProvider once near the app root (tooltips on every tap\n// button flow through it); the full tooltip quartet is exported for hosts\n// that do not already have their own Radix tooltip wrapper.\nexport {\n TooltipProvider,\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n} from \"./tooltip\";\n","\"use client\";\n\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { TooltipContent, TooltipTrigger } from \"./tooltip\";\nimport { cn } from \"./cn\";\nimport {\n getTapTargetLinkComponent,\n type TapTargetLinkComponent,\n} from \"./link\";\n\nexport interface TapTargetButtonProps {\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n onClick?: (() => void) | undefined;\n className?: string | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n /**\n * When set, the tap button renders as a link instead of a button.\n * - Internal hrefs (e.g. \"/tasks\") render via the injected link component\n * (`setTapTargetLinkComponent` / the `linkComponent` prop), falling back\n * to a plain `<a>` when none is registered.\n * - External hrefs (http://, https://, mailto:, tel:) render as `<a>`\n * with `target=\"_blank\"` and `rel=\"noopener noreferrer\"` by default.\n * - When combined with `disabled`, the trigger renders as a non-navigable\n * `<span aria-disabled=\"true\">` with the same visual styling.\n */\n href?: string | undefined;\n /** Override target. Works on both internal links and external anchors. */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n /** Override rel. Works on both internal links and external anchors. */\n rel?: string | undefined;\n /** Forwarded to the injected link component. Pass `false` to disable prefetching. */\n prefetch?: boolean | null | undefined;\n /**\n * Per-instance link component for internal hrefs — overrides the\n * module-level `setTapTargetLinkComponent` registration.\n */\n linkComponent?: TapTargetLinkComponent | undefined;\n /**\n * Tooltip text. Defaults to `ariaLabel` when omitted.\n * Pass `false` to explicitly disable the tooltip.\n */\n tooltip?: string | false | undefined;\n /** Tooltip placement. Defaults to \"top\". */\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n /** Tooltip alignment along its side. Defaults to \"center\". */\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n /**\n * Visible caption rendered inline after the icon (`[icon Label]`).\n * Widens the pill automatically. Tooltip defaults to off when set — the\n * label is self-describing. Visible text becomes the accessible name.\n */\n label?: string | undefined;\n /**\n * Collapse an icon + caption pill to its icon-only 44px tap target below\n * the `sm` breakpoint. The caption and inline geometry return at `sm+`;\n * `ariaLabel` (falling back to `label`) remains the accessible name.\n */\n mobileIconOnly?: boolean | undefined;\n}\n\nexport interface TapTargetButtonSolidProps extends TapTargetButtonProps {\n bgColor?: string | undefined;\n iconColor?: string | undefined;\n hoverBgColor?: string | undefined;\n /**\n * Press-state background. Defaults to `active:brightness-90` which works on\n * any color. Override when using a custom `bgColor` that should darken to a\n * specific shade on press (e.g. `active:bg-primary/60`).\n */\n activeBgColor?: string | undefined;\n}\n\nconst EXTERNAL_RE = /^(https?:|mailto:|tel:)/i;\n\n// Geometry + press feedback + tap hygiene are the SINGLE SOURCE OF TRUTH in\n// the shipped stylesheet (the `.matrx-tap-*` family in styles.css — import\n// \"@ai-matrx/tap-target/styles.css\" once at app root). This component only\n// picks the right class and layers each variant's decoration on top.\nconst TAP_OUTER_CLASS = \"matrx-tap-target group\";\nconst TAP_GROUP_OUTER_CLASS = \"matrx-tap-target matrx-tap-target-sm group\";\n\nfunction IconContent({\n icon,\n children,\n strokeWidth = 2,\n className,\n}: Pick<\n TapTargetButtonProps,\n \"icon\" | \"children\" | \"strokeWidth\" | \"className\"\n>) {\n if (icon) {\n if (isValidElement<{ className?: string }>(icon)) {\n return cloneElement(icon, {\n className: cn(className, icon.props.className),\n });\n }\n return <span className={className}>{icon}</span>;\n }\n return (\n <svg\n className={className}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n >\n {children}\n </svg>\n );\n}\n\ntype TapTargetSize = \"default\" | \"sm\";\n\nfunction resolveTapGeometry(\n label: string | undefined,\n size: TapTargetSize,\n mobileIconOnly: boolean,\n) {\n const inline = Boolean(label);\n if (size === \"sm\") {\n return {\n outerClassName:\n inline && mobileIconOnly\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group\"\n : inline\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group\"\n : TAP_GROUP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only-sm\"\n : \"matrx-tap-pill-inline-sm\",\n };\n }\n return {\n outerClassName:\n inline && mobileIconOnly\n ? `${TAP_OUTER_CLASS} matrx-tap-target-mobile-icon-only`\n : inline\n ? `${TAP_OUTER_CLASS} matrx-tap-target-inline`\n : TAP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only\"\n : \"matrx-tap-pill-inline\",\n };\n}\n\nfunction buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName,\n inlineModifier,\n icon,\n children,\n strokeWidth = 2,\n}: {\n label?: string | undefined;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n inlineModifier: string;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n}) {\n const iconEl = (\n <IconContent\n icon={icon}\n strokeWidth={strokeWidth}\n className={iconClassName}\n >\n {children}\n </IconContent>\n );\n const pillClasses = label\n ? `${pillClassName} ${inlineModifier}`.trim()\n : pillClassName;\n\n if (!label) {\n return <div className={pillClasses}>{iconEl}</div>;\n }\n\n return (\n <div className={pillClasses}>\n {iconEl}\n <span className={labelClassName ?? \"matrx-tap-label\"}>{label}</span>\n </div>\n );\n}\n\ninterface RenderTapTargetArgs extends Pick<\n TapTargetButtonProps,\n | \"icon\"\n | \"children\"\n | \"strokeWidth\"\n | \"label\"\n | \"mobileIconOnly\"\n | \"onClick\"\n | \"as\"\n | \"htmlFor\"\n | \"ariaLabel\"\n | \"disabled\"\n | \"href\"\n | \"target\"\n | \"rel\"\n | \"prefetch\"\n | \"linkComponent\"\n | \"tooltip\"\n | \"tooltipSide\"\n | \"tooltipAlign\"\n> {\n size?: TapTargetSize;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n rest?: ButtonHTMLAttributes<HTMLButtonElement> | undefined;\n buttonRef?: Ref<HTMLButtonElement> | undefined;\n}\n\nfunction renderTapTarget({\n size = \"default\",\n pillClassName,\n iconClassName,\n labelClassName,\n icon,\n children,\n strokeWidth,\n label,\n mobileIconOnly = false,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n rest,\n buttonRef,\n}: RenderTapTargetArgs): ReactElement {\n const { outerClassName, inlineModifier } = resolveTapGeometry(\n label,\n size,\n mobileIconOnly,\n );\n const responsiveLabelClassName = mobileIconOnly\n ? `${labelClassName ?? \"matrx-tap-label\"} matrx-tap-label-mobile-icon-only`\n : labelClassName;\n const inner = buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName: responsiveLabelClassName,\n inlineModifier: label ? inlineModifier : \"\",\n icon,\n children,\n strokeWidth,\n });\n const resolvedTooltip =\n tooltip !== undefined ? tooltip : label ? false : undefined;\n const triggerAriaLabel =\n label && !mobileIconOnly ? undefined : (ariaLabel ?? label);\n const trigger = renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick,\n ariaLabel: triggerAriaLabel,\n disabled,\n outerClassName,\n children: inner,\n rest,\n buttonRef,\n });\n return withTooltip(trigger, {\n tooltip: resolvedTooltip,\n ariaLabel: triggerAriaLabel,\n disabled,\n tooltipSide,\n tooltipAlign,\n });\n}\n\ninterface RenderTriggerArgs {\n href?: string | undefined;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n prefetch?: boolean | null | undefined;\n linkComponent?: TapTargetLinkComponent | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n onClick?: (() => void) | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n outerClassName: string;\n children: ReactNode;\n rest?: ButtonHTMLAttributes<HTMLButtonElement> | undefined;\n buttonRef?: Ref<HTMLButtonElement> | undefined;\n}\n\n/**\n * Resolves the correct trigger element based on the props passed.\n *\n * - `href` + `disabled` → unclickable `<span aria-disabled>`\n * - `href` matching `http(s):|mailto:|tel:` → `<a target=\"_blank\" rel=\"noopener noreferrer\">`\n * - `href` (internal) → the injected link component (per-instance\n * `linkComponent` prop, else `setTapTargetLinkComponent` registration),\n * falling back to a plain `<a>` when none is registered\n * - `as=\"label\"` → `<label htmlFor=...>`\n * - default → `<button>`\n */\nfunction renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick,\n ariaLabel,\n disabled,\n outerClassName,\n children,\n rest,\n buttonRef,\n}: RenderTriggerArgs): ReactElement {\n if (disabled && href) {\n return (\n <span\n aria-disabled=\"true\"\n aria-label={ariaLabel}\n className={`${outerClassName} opacity-40 pointer-events-none`}\n >\n {children}\n </span>\n );\n }\n if (href) {\n const isExternal = EXTERNAL_RE.test(href);\n if (isExternal) {\n return (\n <a\n href={href}\n target={target ?? \"_blank\"}\n rel={rel ?? \"noopener noreferrer\"}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n const Link = linkComponent ?? getTapTargetLinkComponent();\n if (Link) {\n return (\n <Link\n href={href}\n target={target}\n rel={rel}\n prefetch={prefetch}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </Link>\n );\n }\n // No link component registered — plain <a>. `prefetch` is a router hint,\n // not a DOM attribute, so it is deliberately dropped here.\n return (\n <a\n href={href}\n target={target}\n rel={rel}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n if (as === \"label\") {\n return (\n <label\n htmlFor={htmlFor}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </label>\n );\n }\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n onClick={onClick}\n aria-label={ariaLabel}\n disabled={disabled}\n {...rest}\n className={outerClassName}\n >\n {children}\n </button>\n );\n}\n\n/**\n * Wraps a trigger element in a Tooltip when a tooltip label is available.\n * Falls back to `ariaLabel` when `tooltip` is not explicitly set. If both\n * are absent (or `tooltip === false`), the trigger is returned unwrapped.\n */\nfunction withTooltip(\n trigger: ReactElement,\n {\n tooltip,\n ariaLabel,\n disabled,\n tooltipSide = \"top\",\n tooltipAlign = \"center\",\n }: {\n tooltip?: string | false | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n },\n): ReactElement {\n if (tooltip === false) return trigger;\n const label =\n typeof tooltip === \"string\" && tooltip.length > 0 ? tooltip : ariaLabel;\n if (!label) return trigger;\n return (\n <TooltipPrimitive.Root>\n <TooltipTrigger asChild>\n {disabled ? (\n // Radix Tooltip triggers need a hoverable element; a disabled button\n // does not dispatch pointer events, so we wrap in a span for the\n // trigger target while keeping the disabled visual state.\n <span className=\"inline-flex\">{trigger}</span>\n ) : (\n trigger\n )}\n </TooltipTrigger>\n <TooltipContent side={tooltipSide} align={tooltipAlign}>\n {label}\n </TooltipContent>\n </TooltipPrimitive.Root>\n );\n}\n\n// To resize/retune every tap button, edit styles.css — not here.\n\nexport const TapTargetButton = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButton(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return renderTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-glass-thin-border\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonTransparent = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonTransparent(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return renderTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName:\n \"matrx-tap-pill hover:bg-muted active:bg-muted-foreground/15\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonSolid = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonSolid(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n bgColor = \"bg-primary\",\n iconColor = \"text-primary-foreground\",\n hoverBgColor = \"hover:bg-primary/80\",\n activeBgColor = \"active:brightness-90\",\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n return renderTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: `matrx-tap-pill ${bgColor} ${iconColor} ${hoverBgColor} ${activeBgColor}`,\n iconClassName: `matrx-tap-icon ${iconColor}`,\n labelClassName: `matrx-tap-label ${iconColor}`,\n rest,\n buttonRef: ref,\n });\n});\n\n/** Solid destructive pill — delete/remove actions. White-on-red like the\n * primary solid is white-on-blue. Use THIS, never hand-pass bg-destructive\n * with the default (dark) icon color. */\nexport const TapTargetButtonDestructive = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonDestructive(\n {\n bgColor = \"bg-destructive\",\n iconColor = \"text-destructive-foreground\",\n hoverBgColor = \"hover:bg-destructive/90\",\n ...rest\n },\n ref,\n) {\n return (\n <TapTargetButtonSolid\n ref={ref}\n bgColor={bgColor}\n iconColor={iconColor}\n hoverBgColor={hoverBgColor}\n {...rest}\n />\n );\n});\n\nexport const TapTargetButtonForGroup = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonForGroup(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return renderTapTarget({\n size: \"sm\",\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive\",\n iconClassName: `matrx-tap-icon ${color}`,\n labelClassName: `matrx-tap-label ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport function TapTargetButtonGroup({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string | undefined;\n}) {\n return (\n <div\n className={\n className\n ? `relative inline-flex h-9 items-center ${className}`\n : \"relative inline-flex h-9 items-center\"\n }\n >\n <div className=\"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 h-7 rounded-full matrx-glass-thin-border\" />\n {/* min-w-0 lets flexible children (e.g. a truncating filename) shrink\n under container pressure; fixed-size tap buttons are unaffected. */}\n <div className=\"relative flex min-w-0 items-center\">{children}</div>\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"./cn\";\n\n/**\n * Inlined port of matrx-frontend `components/ui/tooltip.tsx` — the one `@/`\n * import the tap-target components consumed beyond `cn` and `next/link`.\n * Behavior deltas vs. the original, both documented in FEATURE.md:\n * - `useNestedPortalContainer` (a host-specific nested-overlay portal context)\n * is dropped: content portals to the Radix default (document.body).\n * - Everything else — unconditional Root render, popover-token styling — is\n * verbatim.\n *\n * Hosts must mount `TooltipProvider` once near the app root (matrx-frontend\n * already does); `TapTargetLabeled` brings its own provider like the original.\n */\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n // Neutral, theme-aware surface (popover tokens) so tooltip text is\n // ALWAYS legible in both light and dark mode — including rich content\n // that uses `text-muted-foreground`. A brand-colored `bg-primary`\n // background broke legibility for any non-default content.\n \"z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","/**\n * Minimal className join — the only piece of `cn` this package needs.\n * No tailwind-merge / clsx dependency by design: callers pass literal strings.\n */\nexport function cn(\n ...values: Array<string | null | undefined | false>\n): string {\n return values.filter(Boolean).join(\" \").trim();\n}\n","import type { ComponentType, ReactNode } from \"react\";\n\n/**\n * The injectable link seam — the package's replacement for the original\n * hard `next/link` import.\n *\n * Internal hrefs (anything NOT matching `http(s):`, `mailto:`, `tel:`) render\n * through the link component resolved here; external hrefs always render a\n * plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`, exactly like the\n * original. When nothing is registered and no per-instance `linkComponent`\n * prop is given, internal hrefs fall back to a plain `<a>` (no prefetch, no\n * client-side routing — still a working link).\n */\nexport interface TapTargetLinkProps {\n href: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n /** Router prefetch hint (next/link semantics). Plain `<a>` fallback ignores it. */\n prefetch?: boolean | null | undefined;\n \"aria-label\"?: string | undefined;\n className?: string | undefined;\n children?: ReactNode;\n}\n\nexport type TapTargetLinkComponent = ComponentType<TapTargetLinkProps>;\n\n/**\n * The registered component lives in a `Symbol.for` slot on `globalThis` — NOT\n * in module state — so it survives the module graph being instantiated more\n * than once: the `.` and `./buttons` dist bundles each inline the primitives\n * (tsup `splitting: false`), and a consumer may even mix `import` and\n * `require`. One registration must reach every copy.\n */\nconst LINK_SLOT = Symbol.for(\"@ai-matrx/tap-target:link-component\");\n\ntype GlobalWithLinkSlot = typeof globalThis & {\n [LINK_SLOT]?: TapTargetLinkComponent | null;\n};\n\n/**\n * Register the app's link component once at startup (e.g. `next/link`):\n *\n * ```tsx\n * import Link from \"next/link\";\n * import { setTapTargetLinkComponent } from \"@ai-matrx/tap-target\";\n * setTapTargetLinkComponent(Link);\n * ```\n *\n * Pass `null` to unregister (plain `<a>` fallback resumes).\n */\nexport function setTapTargetLinkComponent(\n component: TapTargetLinkComponent | null,\n): void {\n (globalThis as GlobalWithLinkSlot)[LINK_SLOT] = component;\n}\n\n/** The currently registered link component, or `null` when none is set. */\nexport function getTapTargetLinkComponent(): TapTargetLinkComponent | null {\n return (globalThis as GlobalWithLinkSlot)[LINK_SLOT] ?? null;\n}\n","\"use client\";\n\nimport {\n TooltipProvider,\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n} from \"./tooltip\";\n\n/**\n * Wraps a TapTargetButton (or any tap control) like the button-demo page:\n * no extra padding on the control — only `gap-0.5` before the caption.\n * Tooltip shows the full `label`; the caption truncates at max-w-[52px].\n */\nexport function TapTargetLabeled({\n label,\n children,\n hideLabel = false,\n toolTipSide = \"bottom\",\n}: {\n label: string;\n children: React.ReactNode;\n hideLabel?: boolean | undefined;\n toolTipSide?: \"top\" | \"bottom\" | \"left\" | \"right\" | undefined;\n}) {\n return (\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <div className=\"flex flex-col items-center p-0 gap-0 space-y-0 space-x-0 shrink-0\">\n {children}\n {!hideLabel && (\n <span className=\"text-[10px] text-muted-foreground/70 leading-tight max-w-[52px] text-center truncate\">\n {label}\n </span>\n )}\n </div>\n </TooltipTrigger>\n <TooltipContent side={toolTipSide}>\n <span className=\"font-mono text-xs max-w-[280px] break-all\">\n {label}\n </span>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAQO;AACP,IAAAA,oBAAkC;;;ACTlC,YAAuB;AACvB,uBAAkC;;;ACC3B,SAAS,MACX,QACK;AACR,SAAO,OAAO,OAAO,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK;AAC/C;;;ADqBI;AAXJ,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C,4CAAkB,yBAA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G;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WACE,YACI,yCAAyC,SAAS,KAClD;AAAA,MAGN;AAAA,qDAAC,SAAI,WAAU,4GAA2G;AAAA,QAG1H,6CAAC,SAAI,WAAU,sCAAsC,UAAS;AAAA;AAAA;AAAA,EAChE;AAEJ;;;AIhtBU,IAAAC,sBAAA;AAfH,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAChB,GAKG;AACD,SACE,6CAAC,mBAAgB,eAAe,KAC9B,wDAAC,WACC;AAAA,iDAAC,kBAAe,SAAO,MACrB,wDAAC,SAAI,WAAU,qEACZ;AAAA;AAAA,MACA,CAAC,aACA,6CAAC,UAAK,WAAU,wFACb,iBACH;AAAA,OAEJ,GACF;AAAA,IACA,6CAAC,kBAAe,MAAM,aACpB,uDAAC,UAAK,WAAU,6CACb,iBACH,GACF;AAAA,KACF,GACF;AAEJ;","names":["TooltipPrimitive","import_jsx_runtime","TapTargetButton","TapTargetButtonTransparent","TapTargetButtonSolid","TapTargetButtonDestructive","TapTargetButtonForGroup","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/tap-target-button.tsx","../src/cn.ts","../src/link.ts","../src/tap-target-labeled.tsx"],"sourcesContent":["// @ai-matrx/tap-target — primitives entry.\n// The ~60 pre-composed buttons live behind the opt-in \"./buttons\" subpath.\n// The geometry stylesheet ships as \"./styles.css\" — import it once at app root.\n\nexport {\n TapTargetButton,\n TapTargetButtonTransparent,\n TapTargetButtonSolid,\n TapTargetButtonDestructive,\n TapTargetButtonForGroup,\n TapTargetButtonGroup,\n type TapTargetButtonProps,\n type TapTargetButtonSolidProps,\n} from \"./tap-target-button\";\nexport { TapTargetLabeled } from \"./tap-target-labeled\";\nexport {\n setTapTargetLinkComponent,\n getTapTargetLinkComponent,\n type TapTargetLinkComponent,\n type TapTargetLinkProps,\n} from \"./link\";\n// THE TOOLTIP MOVED (0.2.0). A tooltip is a design-system surface, and this\n// package only ever shipped one because no shared package owned it — the file\n// was an explicit inlined PORT of matrx-frontend's, which meant the fleet ran\n// two copies. `@ai-matrx/design-system` now owns it; this package consumes it\n// like any other consumer and re-exports NOTHING, so there is exactly one\n// import path. Hosts import the quartet from `@ai-matrx/design-system`.\n","\"use client\";\n\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@ai-matrx/design-system\";\nimport { cn } from \"./cn\";\nimport {\n getTapTargetLinkComponent,\n type TapTargetLinkComponent,\n} from \"./link\";\n\nexport interface TapTargetButtonProps {\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n onClick?: (() => void) | undefined;\n className?: string | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n /**\n * When set, the tap button renders as a link instead of a button.\n * - Internal hrefs (e.g. \"/tasks\") render via the injected link component\n * (`setTapTargetLinkComponent` / the `linkComponent` prop), falling back\n * to a plain `<a>` when none is registered.\n * - External hrefs (http://, https://, mailto:, tel:) render as `<a>`\n * with `target=\"_blank\"` and `rel=\"noopener noreferrer\"` by default.\n * - When combined with `disabled`, the trigger renders as a non-navigable\n * `<span aria-disabled=\"true\">` with the same visual styling.\n */\n href?: string | undefined;\n /** Override target. Works on both internal links and external anchors. */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n /** Override rel. Works on both internal links and external anchors. */\n rel?: string | undefined;\n /** Forwarded to the injected link component. Pass `false` to disable prefetching. */\n prefetch?: boolean | null | undefined;\n /**\n * Per-instance link component for internal hrefs — overrides the\n * module-level `setTapTargetLinkComponent` registration.\n */\n linkComponent?: TapTargetLinkComponent | undefined;\n /**\n * Tooltip text. Defaults to `ariaLabel` when omitted.\n * Pass `false` to explicitly disable the tooltip.\n */\n tooltip?: string | false | undefined;\n /** Tooltip placement. Defaults to \"top\". */\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n /** Tooltip alignment along its side. Defaults to \"center\". */\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n /**\n * Visible caption rendered inline after the icon (`[icon Label]`).\n * Widens the pill automatically. Tooltip defaults to off when set — the\n * label is self-describing. Visible text becomes the accessible name.\n */\n label?: string | undefined;\n /**\n * Collapse an icon + caption pill to its icon-only 44px tap target below\n * the `sm` breakpoint. The caption and inline geometry return at `sm+`;\n * `ariaLabel` (falling back to `label`) remains the accessible name.\n */\n mobileIconOnly?: boolean | undefined;\n}\n\nexport interface TapTargetButtonSolidProps extends TapTargetButtonProps {\n bgColor?: string | undefined;\n iconColor?: string | undefined;\n hoverBgColor?: string | undefined;\n /**\n * Press-state background. Defaults to `active:brightness-90` which works on\n * any color. Override when using a custom `bgColor` that should darken to a\n * specific shade on press (e.g. `active:bg-primary/60`).\n */\n activeBgColor?: string | undefined;\n}\n\nconst EXTERNAL_RE = /^(https?:|mailto:|tel:)/i;\n\n// Geometry + press feedback + tap hygiene are the SINGLE SOURCE OF TRUTH in\n// the shipped stylesheet (the `.matrx-tap-*` family in styles.css — import\n// \"@ai-matrx/tap-target/styles.css\" once at app root). This component only\n// picks the right class and layers each variant's decoration on top.\nconst TAP_OUTER_CLASS = \"matrx-tap-target group\";\nconst TAP_GROUP_OUTER_CLASS = \"matrx-tap-target matrx-tap-target-sm group\";\n\nfunction IconContent({\n icon,\n children,\n strokeWidth = 2,\n className,\n}: Pick<\n TapTargetButtonProps,\n \"icon\" | \"children\" | \"strokeWidth\" | \"className\"\n>) {\n if (icon) {\n if (isValidElement<{ className?: string }>(icon)) {\n return cloneElement(icon, {\n className: cn(className, icon.props.className),\n });\n }\n return <span className={className}>{icon}</span>;\n }\n return (\n <svg\n className={className}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n >\n {children}\n </svg>\n );\n}\n\ntype TapTargetSize = \"default\" | \"sm\";\n\nfunction resolveTapGeometry(\n label: string | undefined,\n size: TapTargetSize,\n mobileIconOnly: boolean,\n) {\n const inline = Boolean(label);\n if (size === \"sm\") {\n return {\n outerClassName:\n inline && mobileIconOnly\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group\"\n : inline\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group\"\n : TAP_GROUP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only-sm\"\n : \"matrx-tap-pill-inline-sm\",\n };\n }\n return {\n outerClassName:\n inline && mobileIconOnly\n ? `${TAP_OUTER_CLASS} matrx-tap-target-mobile-icon-only`\n : inline\n ? `${TAP_OUTER_CLASS} matrx-tap-target-inline`\n : TAP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only\"\n : \"matrx-tap-pill-inline\",\n };\n}\n\nfunction buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName,\n inlineModifier,\n icon,\n children,\n strokeWidth = 2,\n}: {\n label?: string | undefined;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n inlineModifier: string;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n}) {\n const iconEl = (\n <IconContent\n icon={icon}\n strokeWidth={strokeWidth}\n className={iconClassName}\n >\n {children}\n </IconContent>\n );\n const pillClasses = label\n ? `${pillClassName} ${inlineModifier}`.trim()\n : pillClassName;\n\n if (!label) {\n return <div className={pillClasses}>{iconEl}</div>;\n }\n\n return (\n <div className={pillClasses}>\n {iconEl}\n <span className={labelClassName ?? \"matrx-tap-label\"}>{label}</span>\n </div>\n );\n}\n\ninterface RenderTapTargetArgs extends Pick<\n TapTargetButtonProps,\n | \"icon\"\n | \"children\"\n | \"strokeWidth\"\n | \"label\"\n | \"mobileIconOnly\"\n | \"onClick\"\n | \"as\"\n | \"htmlFor\"\n | \"ariaLabel\"\n | \"disabled\"\n | \"href\"\n | \"target\"\n | \"rel\"\n | \"prefetch\"\n | \"linkComponent\"\n | \"tooltip\"\n | \"tooltipSide\"\n | \"tooltipAlign\"\n> {\n size?: TapTargetSize;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n rest?: ButtonHTMLAttributes<HTMLButtonElement> | undefined;\n buttonRef?: Ref<HTMLButtonElement> | undefined;\n}\n\nfunction renderTapTarget({\n size = \"default\",\n pillClassName,\n iconClassName,\n labelClassName,\n icon,\n children,\n strokeWidth,\n label,\n mobileIconOnly = false,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n rest,\n buttonRef,\n}: RenderTapTargetArgs): ReactElement {\n const { outerClassName, inlineModifier } = resolveTapGeometry(\n label,\n size,\n mobileIconOnly,\n );\n const responsiveLabelClassName = mobileIconOnly\n ? `${labelClassName ?? \"matrx-tap-label\"} matrx-tap-label-mobile-icon-only`\n : labelClassName;\n const inner = buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName: responsiveLabelClassName,\n inlineModifier: label ? inlineModifier : \"\",\n icon,\n children,\n strokeWidth,\n });\n const resolvedTooltip =\n tooltip !== undefined ? tooltip : label ? false : undefined;\n const triggerAriaLabel =\n label && !mobileIconOnly ? undefined : (ariaLabel ?? label);\n const trigger = renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick,\n ariaLabel: triggerAriaLabel,\n disabled,\n outerClassName,\n children: inner,\n rest,\n buttonRef,\n });\n return withTooltip(trigger, {\n tooltip: resolvedTooltip,\n ariaLabel: triggerAriaLabel,\n disabled,\n tooltipSide,\n tooltipAlign,\n });\n}\n\ninterface RenderTriggerArgs {\n href?: string | undefined;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n prefetch?: boolean | null | undefined;\n linkComponent?: TapTargetLinkComponent | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n onClick?: (() => void) | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n outerClassName: string;\n children: ReactNode;\n rest?: ButtonHTMLAttributes<HTMLButtonElement> | undefined;\n buttonRef?: Ref<HTMLButtonElement> | undefined;\n}\n\n/**\n * Resolves the correct trigger element based on the props passed.\n *\n * - `href` + `disabled` → unclickable `<span aria-disabled>`\n * - `href` matching `http(s):|mailto:|tel:` → `<a target=\"_blank\" rel=\"noopener noreferrer\">`\n * - `href` (internal) → the injected link component (per-instance\n * `linkComponent` prop, else `setTapTargetLinkComponent` registration),\n * falling back to a plain `<a>` when none is registered\n * - `as=\"label\"` → `<label htmlFor=...>`\n * - default → `<button>`\n */\nfunction renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick,\n ariaLabel,\n disabled,\n outerClassName,\n children,\n rest,\n buttonRef,\n}: RenderTriggerArgs): ReactElement {\n if (disabled && href) {\n return (\n <span\n aria-disabled=\"true\"\n aria-label={ariaLabel}\n className={`${outerClassName} opacity-40 pointer-events-none`}\n >\n {children}\n </span>\n );\n }\n if (href) {\n const isExternal = EXTERNAL_RE.test(href);\n if (isExternal) {\n return (\n <a\n href={href}\n target={target ?? \"_blank\"}\n rel={rel ?? \"noopener noreferrer\"}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n const Link = linkComponent ?? getTapTargetLinkComponent();\n if (Link) {\n return (\n <Link\n href={href}\n target={target}\n rel={rel}\n prefetch={prefetch}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </Link>\n );\n }\n // No link component registered — plain <a>. `prefetch` is a router hint,\n // not a DOM attribute, so it is deliberately dropped here.\n return (\n <a\n href={href}\n target={target}\n rel={rel}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n if (as === \"label\") {\n return (\n <label\n htmlFor={htmlFor}\n aria-label={ariaLabel}\n className={outerClassName}\n >\n {children}\n </label>\n );\n }\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n onClick={onClick}\n aria-label={ariaLabel}\n disabled={disabled}\n {...rest}\n className={outerClassName}\n >\n {children}\n </button>\n );\n}\n\n/**\n * Wraps a trigger element in a Tooltip when a tooltip label is available.\n * Falls back to `ariaLabel` when `tooltip` is not explicitly set. If both\n * are absent (or `tooltip === false`), the trigger is returned unwrapped.\n */\nfunction withTooltip(\n trigger: ReactElement,\n {\n tooltip,\n ariaLabel,\n disabled,\n tooltipSide = \"top\",\n tooltipAlign = \"center\",\n }: {\n tooltip?: string | false | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n },\n): ReactElement {\n if (tooltip === false) return trigger;\n const label =\n typeof tooltip === \"string\" && tooltip.length > 0 ? tooltip : ariaLabel;\n if (!label) return trigger;\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n {disabled ? (\n // Radix Tooltip triggers need a hoverable element; a disabled button\n // does not dispatch pointer events, so we wrap in a span for the\n // trigger target while keeping the disabled visual state.\n <span className=\"inline-flex\">{trigger}</span>\n ) : (\n trigger\n )}\n </TooltipTrigger>\n <TooltipContent side={tooltipSide} align={tooltipAlign}>\n {label}\n </TooltipContent>\n </Tooltip>\n );\n}\n\n// To resize/retune every tap button, edit styles.css — not here.\n\nexport const TapTargetButton = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButton(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return renderTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-glass-thin-border\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonTransparent = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonTransparent(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return renderTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName:\n \"matrx-tap-pill hover:bg-muted active:bg-muted-foreground/15\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonSolid = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonSolid(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n bgColor = \"bg-primary\",\n iconColor = \"text-primary-foreground\",\n hoverBgColor = \"hover:bg-primary/80\",\n activeBgColor = \"active:brightness-90\",\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n return renderTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: `matrx-tap-pill ${bgColor} ${iconColor} ${hoverBgColor} ${activeBgColor}`,\n iconClassName: `matrx-tap-icon ${iconColor}`,\n labelClassName: `matrx-tap-label ${iconColor}`,\n rest,\n buttonRef: ref,\n });\n});\n\n/** Solid destructive pill — delete/remove actions. White-on-red like the\n * primary solid is white-on-blue. Use THIS, never hand-pass bg-destructive\n * with the default (dark) icon color. */\nexport const TapTargetButtonDestructive = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonDestructive(\n {\n bgColor = \"bg-destructive\",\n iconColor = \"text-destructive-foreground\",\n hoverBgColor = \"hover:bg-destructive/90\",\n ...rest\n },\n ref,\n) {\n return (\n <TapTargetButtonSolid\n ref={ref}\n bgColor={bgColor}\n iconColor={iconColor}\n hoverBgColor={hoverBgColor}\n {...rest}\n />\n );\n});\n\nexport const TapTargetButtonForGroup = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & ButtonHTMLAttributes<HTMLButtonElement>\n>(function TapTargetButtonForGroup(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return renderTapTarget({\n size: \"sm\",\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive\",\n iconClassName: `matrx-tap-icon ${color}`,\n labelClassName: `matrx-tap-label ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport function TapTargetButtonGroup({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string | undefined;\n}) {\n return (\n <div\n className={\n className\n ? `relative inline-flex h-9 items-center ${className}`\n : \"relative inline-flex h-9 items-center\"\n }\n >\n <div className=\"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 h-7 rounded-full matrx-glass-thin-border\" />\n {/* min-w-0 lets flexible children (e.g. a truncating filename) shrink\n under container pressure; fixed-size tap buttons are unaffected. */}\n <div className=\"relative flex min-w-0 items-center\">{children}</div>\n </div>\n );\n}\n","/**\n * Minimal className join — the only piece of `cn` this package needs.\n * No tailwind-merge / clsx dependency by design: callers pass literal strings.\n */\nexport function cn(\n ...values: Array<string | null | undefined | false>\n): string {\n return values.filter(Boolean).join(\" \").trim();\n}\n","import type { ComponentType, ReactNode } from \"react\";\n\n/**\n * The injectable link seam — the package's replacement for the original\n * hard `next/link` import.\n *\n * Internal hrefs (anything NOT matching `http(s):`, `mailto:`, `tel:`) render\n * through the link component resolved here; external hrefs always render a\n * plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`, exactly like the\n * original. When nothing is registered and no per-instance `linkComponent`\n * prop is given, internal hrefs fall back to a plain `<a>` (no prefetch, no\n * client-side routing — still a working link).\n */\nexport interface TapTargetLinkProps {\n href: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n /** Router prefetch hint (next/link semantics). Plain `<a>` fallback ignores it. */\n prefetch?: boolean | null | undefined;\n \"aria-label\"?: string | undefined;\n className?: string | undefined;\n children?: ReactNode;\n}\n\nexport type TapTargetLinkComponent = ComponentType<TapTargetLinkProps>;\n\n/**\n * The registered component lives in a `Symbol.for` slot on `globalThis` — NOT\n * in module state — so it survives the module graph being instantiated more\n * than once: the `.` and `./buttons` dist bundles each inline the primitives\n * (tsup `splitting: false`), and a consumer may even mix `import` and\n * `require`. One registration must reach every copy.\n */\nconst LINK_SLOT = Symbol.for(\"@ai-matrx/tap-target:link-component\");\n\ntype GlobalWithLinkSlot = typeof globalThis & {\n [LINK_SLOT]?: TapTargetLinkComponent | null;\n};\n\n/**\n * Register the app's link component once at startup (e.g. `next/link`):\n *\n * ```tsx\n * import Link from \"next/link\";\n * import { setTapTargetLinkComponent } from \"@ai-matrx/tap-target\";\n * setTapTargetLinkComponent(Link);\n * ```\n *\n * Pass `null` to unregister (plain `<a>` fallback resumes).\n */\nexport function setTapTargetLinkComponent(\n component: TapTargetLinkComponent | null,\n): void {\n (globalThis as GlobalWithLinkSlot)[LINK_SLOT] = component;\n}\n\n/** The currently registered link component, or `null` when none is set. */\nexport function getTapTargetLinkComponent(): TapTargetLinkComponent | null {\n return (globalThis as GlobalWithLinkSlot)[LINK_SLOT] ?? null;\n}\n","\"use client\";\n\nimport {\n TooltipProvider,\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n} from \"@ai-matrx/design-system\";\n\n/**\n * Wraps a TapTargetButton (or any tap control) like the button-demo page:\n * no extra padding on the control — only `gap-0.5` before the caption.\n * Tooltip shows the full `label`; the caption truncates at max-w-[52px].\n */\nexport function TapTargetLabeled({\n label,\n children,\n hideLabel = false,\n toolTipSide = \"bottom\",\n}: {\n label: string;\n children: React.ReactNode;\n hideLabel?: boolean | undefined;\n toolTipSide?: \"top\" | \"bottom\" | \"left\" | \"right\" | undefined;\n}) {\n return (\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <div className=\"flex flex-col items-center p-0 gap-0 space-y-0 space-x-0 shrink-0\">\n {children}\n {!hideLabel && (\n <span className=\"text-[10px] text-muted-foreground/70 leading-tight max-w-[52px] text-center truncate\">\n {label}\n </span>\n )}\n </div>\n </TooltipTrigger>\n <TooltipContent side={toolTipSide}>\n <span className=\"font-mono text-xs max-w-[280px] break-all\">\n {label}\n </span>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAQO;AAEP,2BAIO;;;ACZA,SAAS,MACX,QACK;AACR,SAAO,OAAO,OAAO,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK;AAC/C;;;ACyBA,IAAM,YAAY,uBAAO,IAAI,qCAAqC;AAiB3D,SAAS,0BACd,WACM;AACN,EAAC,WAAkC,SAAS,IAAI;AAClD;AAGO,SAAS,4BAA2D;AACzE,SAAQ,WAAkC,SAAS,KAAK;AAC1D;;;AFuDW;AAxBX,IAAM,cAAc;AAMpB,IAAM,kBAAkB;AACxB,IAAM,wBAAwB;AAE9B,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AACF,GAGG;AACD,MAAI,MAAM;AACR,YAAI,6BAAuC,IAAI,GAAG;AAChD,iBAAO,2BAAa,MAAM;AAAA,QACxB,WAAW,GAAG,WAAW,KAAK,MAAM,SAAS;AAAA,MAC/C,CAAC;AAAA,IACH;AACA,WAAO,4CAAC,UAAK,WAAuB,gBAAK;AAAA,EAC3C;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,QAAO;AAAA,MACP;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAIA,SAAS,mBACP,OACA,MACA,gBACA;AACA,QAAM,SAAS,QAAQ,KAAK;AAC5B,MAAI,SAAS,MAAM;AACjB,WAAO;AAAA,MACL,gBACE,UAAU,iBACN,oFACA,SACE,0EACA;AAAA,MACR,gBAAgB,iBACZ,uCACA;AAAA,IACN;AAAA,EACF;AACA,SAAO;AAAA,IACL,gBAC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BAAgB,mBAAmB,KAAK;AAAA,IACxC;AAAA,IACA,WAAW;AAAA,EACb,CAAC;AACH,CAAC;AAEM,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AACF,GAGG;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WACE,YACI,yCAAyC,SAAS,KAClD;AAAA,MAGN;AAAA,oDAAC,SAAI,WAAU,4GAA2G;AAAA,QAG1H,4CAAC,SAAI,WAAU,sCAAsC,UAAS;AAAA;AAAA;AAAA,EAChE;AAEJ;;;AG/uBA,IAAAC,wBAKO;AAsBG,IAAAC,sBAAA;AAfH,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAChB,GAKG;AACD,SACE,6CAAC,yCAAgB,eAAe,KAC9B,wDAAC,iCACC;AAAA,iDAAC,wCAAe,SAAO,MACrB,wDAAC,SAAI,WAAU,qEACZ;AAAA;AAAA,MACA,CAAC,aACA,6CAAC,UAAK,WAAU,wFACb,iBACH;AAAA,OAEJ,GACF;AAAA,IACA,6CAAC,wCAAe,MAAM,aACpB,uDAAC,UAAK,WAAU,6CACb,iBACH,GACF;AAAA,KACF,GACF;AAEJ;","names":["TapTargetButton","TapTargetButtonTransparent","TapTargetButtonSolid","TapTargetButtonDestructive","TapTargetButtonForGroup","import_design_system","import_jsx_runtime"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,6 @@ import * as react from 'react';
|
|
|
2
2
|
import { ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import { T as TapTargetLinkComponent } from './link-CkRpHgou.cjs';
|
|
4
4
|
export { a as TapTargetLinkProps, g as getTapTargetLinkComponent, s as setTapTargetLinkComponent } from './link-CkRpHgou.cjs';
|
|
5
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
6
5
|
|
|
7
6
|
interface TapTargetButtonProps {
|
|
8
7
|
icon?: React.ReactNode;
|
|
@@ -94,21 +93,4 @@ declare function TapTargetLabeled({ label, children, hideLabel, toolTipSide, }:
|
|
|
94
93
|
toolTipSide?: "top" | "bottom" | "left" | "right" | undefined;
|
|
95
94
|
}): react.JSX.Element;
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
* Inlined port of matrx-frontend `components/ui/tooltip.tsx` — the one `@/`
|
|
99
|
-
* import the tap-target components consumed beyond `cn` and `next/link`.
|
|
100
|
-
* Behavior deltas vs. the original, both documented in FEATURE.md:
|
|
101
|
-
* - `useNestedPortalContainer` (a host-specific nested-overlay portal context)
|
|
102
|
-
* is dropped: content portals to the Radix default (document.body).
|
|
103
|
-
* - Everything else — unconditional Root render, popover-token styling — is
|
|
104
|
-
* verbatim.
|
|
105
|
-
*
|
|
106
|
-
* Hosts must mount `TooltipProvider` once near the app root (matrx-frontend
|
|
107
|
-
* already does); `TapTargetLabeled` brings its own provider like the original.
|
|
108
|
-
*/
|
|
109
|
-
declare const TooltipProvider: react.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
110
|
-
declare const Tooltip: react.FC<TooltipPrimitive.TooltipProps>;
|
|
111
|
-
declare const TooltipTrigger: react.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
112
|
-
declare const TooltipContent: react.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
113
|
-
|
|
114
|
-
export { TapTargetButton, TapTargetButtonDestructive, TapTargetButtonForGroup, TapTargetButtonGroup, type TapTargetButtonProps, TapTargetButtonSolid, type TapTargetButtonSolidProps, TapTargetButtonTransparent, TapTargetLabeled, TapTargetLinkComponent, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
96
|
+
export { TapTargetButton, TapTargetButtonDestructive, TapTargetButtonForGroup, TapTargetButtonGroup, type TapTargetButtonProps, TapTargetButtonSolid, type TapTargetButtonSolidProps, TapTargetButtonTransparent, TapTargetLabeled, TapTargetLinkComponent };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as react from 'react';
|
|
|
2
2
|
import { ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import { T as TapTargetLinkComponent } from './link-CkRpHgou.js';
|
|
4
4
|
export { a as TapTargetLinkProps, g as getTapTargetLinkComponent, s as setTapTargetLinkComponent } from './link-CkRpHgou.js';
|
|
5
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
6
5
|
|
|
7
6
|
interface TapTargetButtonProps {
|
|
8
7
|
icon?: React.ReactNode;
|
|
@@ -94,21 +93,4 @@ declare function TapTargetLabeled({ label, children, hideLabel, toolTipSide, }:
|
|
|
94
93
|
toolTipSide?: "top" | "bottom" | "left" | "right" | undefined;
|
|
95
94
|
}): react.JSX.Element;
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
* Inlined port of matrx-frontend `components/ui/tooltip.tsx` — the one `@/`
|
|
99
|
-
* import the tap-target components consumed beyond `cn` and `next/link`.
|
|
100
|
-
* Behavior deltas vs. the original, both documented in FEATURE.md:
|
|
101
|
-
* - `useNestedPortalContainer` (a host-specific nested-overlay portal context)
|
|
102
|
-
* is dropped: content portals to the Radix default (document.body).
|
|
103
|
-
* - Everything else — unconditional Root render, popover-token styling — is
|
|
104
|
-
* verbatim.
|
|
105
|
-
*
|
|
106
|
-
* Hosts must mount `TooltipProvider` once near the app root (matrx-frontend
|
|
107
|
-
* already does); `TapTargetLabeled` brings its own provider like the original.
|
|
108
|
-
*/
|
|
109
|
-
declare const TooltipProvider: react.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
110
|
-
declare const Tooltip: react.FC<TooltipPrimitive.TooltipProps>;
|
|
111
|
-
declare const TooltipTrigger: react.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
112
|
-
declare const TooltipContent: react.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
113
|
-
|
|
114
|
-
export { TapTargetButton, TapTargetButtonDestructive, TapTargetButtonForGroup, TapTargetButtonGroup, type TapTargetButtonProps, TapTargetButtonSolid, type TapTargetButtonSolidProps, TapTargetButtonTransparent, TapTargetLabeled, TapTargetLinkComponent, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
96
|
+
export { TapTargetButton, TapTargetButtonDestructive, TapTargetButtonForGroup, TapTargetButtonGroup, type TapTargetButtonProps, TapTargetButtonSolid, type TapTargetButtonSolidProps, TapTargetButtonTransparent, TapTargetLabeled, TapTargetLinkComponent };
|