@ai-matrx/design-system 0.18.21 → 0.19.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 +14 -0
- package/dist/content-transfer/alchemy.svg +1 -1
- package/dist/content-transfer/copy-transform.svg +1 -0
- package/dist/content-transfer/icon.cjs +8 -2
- package/dist/content-transfer/icon.cjs.map +1 -1
- package/dist/content-transfer/icon.d.cts +5 -3
- package/dist/content-transfer/icon.d.ts +5 -3
- package/dist/content-transfer/icon.js +8 -2
- package/dist/content-transfer/icon.js.map +1 -1
- package/dist/content-transfer/portal.svg +1 -0
- package/dist/content-transfer.cjs +923 -304
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.css +17 -74
- package/dist/content-transfer.d.cts +14 -3
- package/dist/content-transfer.d.ts +14 -3
- package/dist/content-transfer.js +929 -305
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/data-row-inspector.cjs +990 -397
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +988 -390
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +989 -396
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +987 -389
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/host.cjs.map +1 -1
- package/dist/data-table/host.d.cts +3 -2
- package/dist/data-table/host.d.ts +3 -2
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +2733 -1441
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +2 -2
- package/dist/data-table/index.d.ts +2 -2
- package/dist/data-table/index.js +2742 -1440
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/pagination.cjs +135 -97
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.d.cts +8 -1
- package/dist/data-table/pagination.d.ts +8 -1
- package/dist/data-table/pagination.js +130 -92
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/scroll-pagination.cjs +82 -54
- package/dist/data-table/scroll-pagination.cjs.map +1 -1
- package/dist/data-table/scroll-pagination.js +82 -54
- package/dist/data-table/scroll-pagination.js.map +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.cjs +7 -1
- package/dist/data-table/url-state.cjs.map +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/url-state.js +7 -1
- package/dist/data-table/url-state.js.map +1 -1
- package/dist/data-table/uuid-cell.cjs +1 -1
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +1 -1
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +527 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +531 -0
- package/dist/index.js.map +1 -1
- package/dist/tap-target.cjs +636 -0
- package/dist/tap-target.cjs.map +1 -0
- package/dist/tap-target.css +151 -0
- package/dist/tap-target.d.cts +131 -0
- package/dist/tap-target.d.ts +131 -0
- package/dist/tap-target.js +608 -0
- package/dist/tap-target.js.map +1 -0
- package/dist/{types-BuDKVpeF.d.ts → types-D1m14boM.d.ts} +49 -3
- package/dist/{types-Dqcb7jXO.d.cts → types-Di6QT0P1.d.cts} +49 -3
- package/package.json +14 -1
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/tap-target/tap-target-button.tsx
|
|
4
|
+
import {
|
|
5
|
+
cloneElement,
|
|
6
|
+
forwardRef as forwardRef2,
|
|
7
|
+
isValidElement
|
|
8
|
+
} from "react";
|
|
9
|
+
|
|
10
|
+
// src/tooltip.tsx
|
|
11
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
12
|
+
import * as React2 from "react";
|
|
13
|
+
|
|
14
|
+
// src/cn.ts
|
|
15
|
+
import { clsx } from "clsx";
|
|
16
|
+
import { twMerge } from "tailwind-merge";
|
|
17
|
+
function cn(...inputs) {
|
|
18
|
+
return twMerge(clsx(inputs));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/motion.ts
|
|
22
|
+
var MOTION_OVERLAY = "matrx-motion-overlay";
|
|
23
|
+
var MOTION_DIALOG = "matrx-motion-dialog";
|
|
24
|
+
var MOTION_BOTTOM_SHEET = "matrx-motion-bottom-sheet";
|
|
25
|
+
var MOTION_POPPER = "matrx-motion-popper";
|
|
26
|
+
var MOTION_SHEET = {
|
|
27
|
+
top: "matrx-motion-sheet-top",
|
|
28
|
+
bottom: "matrx-motion-sheet-bottom",
|
|
29
|
+
left: "matrx-motion-sheet-left",
|
|
30
|
+
right: "matrx-motion-sheet-right",
|
|
31
|
+
center: "matrx-motion-sheet-center"
|
|
32
|
+
};
|
|
33
|
+
var MOTION_PULSE = "matrx-pulse";
|
|
34
|
+
var MOTION_SPIN = "matrx-spin";
|
|
35
|
+
var ALL_MOTION_CLASSES = [
|
|
36
|
+
MOTION_OVERLAY,
|
|
37
|
+
MOTION_DIALOG,
|
|
38
|
+
MOTION_BOTTOM_SHEET,
|
|
39
|
+
MOTION_POPPER,
|
|
40
|
+
...Object.values(MOTION_SHEET),
|
|
41
|
+
MOTION_PULSE,
|
|
42
|
+
MOTION_SPIN
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// src/portal-container.tsx
|
|
46
|
+
import * as React from "react";
|
|
47
|
+
import { jsx } from "react/jsx-runtime";
|
|
48
|
+
var CONTEXT_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.portal-container-context");
|
|
49
|
+
var contextRegistry = globalThis;
|
|
50
|
+
var PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext(void 0);
|
|
51
|
+
function usePortalContainer(explicit) {
|
|
52
|
+
const injected = React.useContext(PortalContainerContext);
|
|
53
|
+
if (explicit !== void 0) {
|
|
54
|
+
return explicit ?? void 0;
|
|
55
|
+
}
|
|
56
|
+
return injected ?? void 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/tooltip.tsx
|
|
60
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
61
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
62
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
63
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
64
|
+
var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
65
|
+
const resolved = usePortalContainer(container);
|
|
66
|
+
return /* @__PURE__ */ jsx2(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx2(
|
|
67
|
+
TooltipPrimitive.Content,
|
|
68
|
+
{
|
|
69
|
+
ref,
|
|
70
|
+
"data-slot": "tooltip-content",
|
|
71
|
+
sideOffset,
|
|
72
|
+
className: cn(
|
|
73
|
+
"z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
|
|
74
|
+
animated && MOTION_POPPER,
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
) });
|
|
80
|
+
});
|
|
81
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
82
|
+
|
|
83
|
+
// src/tap-target/cn.ts
|
|
84
|
+
function cn2(...values) {
|
|
85
|
+
return values.filter(Boolean).join(" ").trim();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/tap-target/link.ts
|
|
89
|
+
var LINK_SLOT = /* @__PURE__ */ Symbol.for("@ai-matrx/tap-target:link-component");
|
|
90
|
+
function setTapTargetLinkComponent(component) {
|
|
91
|
+
globalThis[LINK_SLOT] = component;
|
|
92
|
+
}
|
|
93
|
+
function getTapTargetLinkComponent() {
|
|
94
|
+
return globalThis[LINK_SLOT] ?? null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// src/tap-target/tap-target-button.tsx
|
|
98
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
99
|
+
var EXTERNAL_RE = /^(https?:|mailto:|tel:)/i;
|
|
100
|
+
var TAP_OUTER_CLASS = "matrx-tap-target group";
|
|
101
|
+
var TAP_GROUP_OUTER_CLASS = "matrx-tap-target matrx-tap-target-sm group";
|
|
102
|
+
function IconContent({
|
|
103
|
+
icon,
|
|
104
|
+
children,
|
|
105
|
+
strokeWidth = 2,
|
|
106
|
+
className
|
|
107
|
+
}) {
|
|
108
|
+
if (icon) {
|
|
109
|
+
if (isValidElement(icon)) {
|
|
110
|
+
return cloneElement(icon, {
|
|
111
|
+
className: cn2(className, icon.props.className)
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return /* @__PURE__ */ jsx3("span", { className, children: icon });
|
|
115
|
+
}
|
|
116
|
+
return /* @__PURE__ */ jsx3(
|
|
117
|
+
"svg",
|
|
118
|
+
{
|
|
119
|
+
className,
|
|
120
|
+
fill: "none",
|
|
121
|
+
viewBox: "0 0 24 24",
|
|
122
|
+
stroke: "currentColor",
|
|
123
|
+
strokeWidth,
|
|
124
|
+
children
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function resolveTapGeometry(label, size, mobileIconOnly) {
|
|
129
|
+
const inline = Boolean(label);
|
|
130
|
+
if (size === "sm") {
|
|
131
|
+
return {
|
|
132
|
+
outerClassName: inline && mobileIconOnly ? "matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group" : inline ? "matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group" : TAP_GROUP_OUTER_CLASS,
|
|
133
|
+
inlineModifier: mobileIconOnly ? "matrx-tap-pill-mobile-icon-only-sm" : "matrx-tap-pill-inline-sm"
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
outerClassName: inline && mobileIconOnly ? `${TAP_OUTER_CLASS} matrx-tap-target-mobile-icon-only` : inline ? `${TAP_OUTER_CLASS} matrx-tap-target-inline` : TAP_OUTER_CLASS,
|
|
138
|
+
inlineModifier: mobileIconOnly ? "matrx-tap-pill-mobile-icon-only" : "matrx-tap-pill-inline"
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function buildTapInner({
|
|
142
|
+
label,
|
|
143
|
+
pillClassName,
|
|
144
|
+
iconClassName,
|
|
145
|
+
labelClassName,
|
|
146
|
+
inlineModifier,
|
|
147
|
+
icon,
|
|
148
|
+
children,
|
|
149
|
+
strokeWidth = 2
|
|
150
|
+
}) {
|
|
151
|
+
const iconEl = /* @__PURE__ */ jsx3(
|
|
152
|
+
IconContent,
|
|
153
|
+
{
|
|
154
|
+
icon,
|
|
155
|
+
strokeWidth,
|
|
156
|
+
className: iconClassName,
|
|
157
|
+
children
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
const pillClasses = label ? `${pillClassName} ${inlineModifier}`.trim() : pillClassName;
|
|
161
|
+
if (!label) {
|
|
162
|
+
return /* @__PURE__ */ jsx3("div", { className: pillClasses, children: iconEl });
|
|
163
|
+
}
|
|
164
|
+
return /* @__PURE__ */ jsxs("div", { className: pillClasses, children: [
|
|
165
|
+
iconEl,
|
|
166
|
+
/* @__PURE__ */ jsx3("span", { className: labelClassName ?? "matrx-tap-label", children: label })
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
function renderTapTarget({
|
|
170
|
+
size = "default",
|
|
171
|
+
pillClassName,
|
|
172
|
+
iconClassName,
|
|
173
|
+
labelClassName,
|
|
174
|
+
icon,
|
|
175
|
+
children,
|
|
176
|
+
strokeWidth,
|
|
177
|
+
label,
|
|
178
|
+
mobileIconOnly = false,
|
|
179
|
+
onClick,
|
|
180
|
+
as,
|
|
181
|
+
htmlFor,
|
|
182
|
+
ariaLabel,
|
|
183
|
+
disabled,
|
|
184
|
+
href,
|
|
185
|
+
target,
|
|
186
|
+
rel,
|
|
187
|
+
prefetch,
|
|
188
|
+
linkComponent,
|
|
189
|
+
tooltip,
|
|
190
|
+
tooltipSide,
|
|
191
|
+
tooltipAlign,
|
|
192
|
+
rest,
|
|
193
|
+
buttonRef
|
|
194
|
+
}) {
|
|
195
|
+
const { outerClassName, inlineModifier } = resolveTapGeometry(
|
|
196
|
+
label,
|
|
197
|
+
size,
|
|
198
|
+
mobileIconOnly
|
|
199
|
+
);
|
|
200
|
+
const responsiveLabelClassName = mobileIconOnly ? `${labelClassName ?? "matrx-tap-label"} matrx-tap-label-mobile-icon-only` : labelClassName;
|
|
201
|
+
const inner = buildTapInner({
|
|
202
|
+
label,
|
|
203
|
+
pillClassName,
|
|
204
|
+
iconClassName,
|
|
205
|
+
labelClassName: responsiveLabelClassName,
|
|
206
|
+
inlineModifier: label ? inlineModifier : "",
|
|
207
|
+
icon,
|
|
208
|
+
children,
|
|
209
|
+
strokeWidth
|
|
210
|
+
});
|
|
211
|
+
const resolvedTooltip = tooltip !== void 0 ? tooltip : label ? false : void 0;
|
|
212
|
+
const triggerAriaLabel = label && !mobileIconOnly ? void 0 : ariaLabel ?? label;
|
|
213
|
+
const trigger = renderTrigger({
|
|
214
|
+
href,
|
|
215
|
+
target,
|
|
216
|
+
rel,
|
|
217
|
+
prefetch,
|
|
218
|
+
linkComponent,
|
|
219
|
+
as,
|
|
220
|
+
htmlFor,
|
|
221
|
+
onClick,
|
|
222
|
+
ariaLabel: triggerAriaLabel,
|
|
223
|
+
disabled,
|
|
224
|
+
outerClassName,
|
|
225
|
+
children: inner,
|
|
226
|
+
rest,
|
|
227
|
+
buttonRef
|
|
228
|
+
});
|
|
229
|
+
return withTooltip(trigger, {
|
|
230
|
+
tooltip: resolvedTooltip,
|
|
231
|
+
ariaLabel: triggerAriaLabel,
|
|
232
|
+
disabled,
|
|
233
|
+
tooltipSide,
|
|
234
|
+
tooltipAlign
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function renderTrigger({
|
|
238
|
+
href,
|
|
239
|
+
target,
|
|
240
|
+
rel,
|
|
241
|
+
prefetch,
|
|
242
|
+
linkComponent,
|
|
243
|
+
as,
|
|
244
|
+
htmlFor,
|
|
245
|
+
onClick,
|
|
246
|
+
ariaLabel,
|
|
247
|
+
disabled,
|
|
248
|
+
outerClassName,
|
|
249
|
+
children,
|
|
250
|
+
rest,
|
|
251
|
+
buttonRef
|
|
252
|
+
}) {
|
|
253
|
+
if (disabled && href) {
|
|
254
|
+
return /* @__PURE__ */ jsx3(
|
|
255
|
+
"span",
|
|
256
|
+
{
|
|
257
|
+
"aria-disabled": "true",
|
|
258
|
+
"aria-label": ariaLabel,
|
|
259
|
+
className: `${outerClassName} opacity-40 pointer-events-none`,
|
|
260
|
+
children
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
if (href) {
|
|
265
|
+
const isExternal = EXTERNAL_RE.test(href);
|
|
266
|
+
if (isExternal) {
|
|
267
|
+
return /* @__PURE__ */ jsx3(
|
|
268
|
+
"a",
|
|
269
|
+
{
|
|
270
|
+
href,
|
|
271
|
+
target: target ?? "_blank",
|
|
272
|
+
rel: rel ?? "noopener noreferrer",
|
|
273
|
+
"aria-label": ariaLabel,
|
|
274
|
+
className: outerClassName,
|
|
275
|
+
children
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
const Link = linkComponent ?? getTapTargetLinkComponent();
|
|
280
|
+
if (Link) {
|
|
281
|
+
return /* @__PURE__ */ jsx3(
|
|
282
|
+
Link,
|
|
283
|
+
{
|
|
284
|
+
href,
|
|
285
|
+
target,
|
|
286
|
+
rel,
|
|
287
|
+
prefetch,
|
|
288
|
+
"aria-label": ariaLabel,
|
|
289
|
+
className: outerClassName,
|
|
290
|
+
children
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
return /* @__PURE__ */ jsx3(
|
|
295
|
+
"a",
|
|
296
|
+
{
|
|
297
|
+
href,
|
|
298
|
+
target,
|
|
299
|
+
rel,
|
|
300
|
+
"aria-label": ariaLabel,
|
|
301
|
+
className: outerClassName,
|
|
302
|
+
children
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
if (as === "label") {
|
|
307
|
+
return /* @__PURE__ */ jsx3(
|
|
308
|
+
"label",
|
|
309
|
+
{
|
|
310
|
+
htmlFor,
|
|
311
|
+
"aria-label": ariaLabel,
|
|
312
|
+
className: outerClassName,
|
|
313
|
+
children
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
return /* @__PURE__ */ jsx3(
|
|
318
|
+
"button",
|
|
319
|
+
{
|
|
320
|
+
ref: buttonRef,
|
|
321
|
+
type: "button",
|
|
322
|
+
onClick,
|
|
323
|
+
"aria-label": ariaLabel,
|
|
324
|
+
disabled,
|
|
325
|
+
...rest,
|
|
326
|
+
className: outerClassName,
|
|
327
|
+
children
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
function withTooltip(trigger, {
|
|
332
|
+
tooltip,
|
|
333
|
+
ariaLabel,
|
|
334
|
+
disabled,
|
|
335
|
+
tooltipSide = "top",
|
|
336
|
+
tooltipAlign = "center"
|
|
337
|
+
}) {
|
|
338
|
+
if (tooltip === false) return trigger;
|
|
339
|
+
const label = typeof tooltip === "string" && tooltip.length > 0 ? tooltip : ariaLabel;
|
|
340
|
+
if (!label) return trigger;
|
|
341
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
342
|
+
/* @__PURE__ */ jsx3(TooltipTrigger, { asChild: true, children: disabled ? (
|
|
343
|
+
// Radix Tooltip triggers need a hoverable element; a disabled button
|
|
344
|
+
// does not dispatch pointer events, so we wrap in a span for the
|
|
345
|
+
// trigger target while keeping the disabled visual state.
|
|
346
|
+
/* @__PURE__ */ jsx3("span", { className: "inline-flex", children: trigger })
|
|
347
|
+
) : trigger }),
|
|
348
|
+
/* @__PURE__ */ jsx3(TooltipContent, { side: tooltipSide, align: tooltipAlign, children: label })
|
|
349
|
+
] });
|
|
350
|
+
}
|
|
351
|
+
var TapTargetButton = forwardRef2(function TapTargetButton2({
|
|
352
|
+
icon,
|
|
353
|
+
children,
|
|
354
|
+
strokeWidth = 2,
|
|
355
|
+
onClick,
|
|
356
|
+
className,
|
|
357
|
+
as,
|
|
358
|
+
htmlFor,
|
|
359
|
+
ariaLabel,
|
|
360
|
+
disabled,
|
|
361
|
+
href,
|
|
362
|
+
target,
|
|
363
|
+
rel,
|
|
364
|
+
prefetch,
|
|
365
|
+
linkComponent,
|
|
366
|
+
tooltip,
|
|
367
|
+
tooltipSide,
|
|
368
|
+
tooltipAlign,
|
|
369
|
+
label,
|
|
370
|
+
mobileIconOnly,
|
|
371
|
+
...rest
|
|
372
|
+
}, ref) {
|
|
373
|
+
const color = className ?? "text-foreground";
|
|
374
|
+
return renderTapTarget({
|
|
375
|
+
icon,
|
|
376
|
+
children,
|
|
377
|
+
strokeWidth,
|
|
378
|
+
onClick,
|
|
379
|
+
as,
|
|
380
|
+
htmlFor,
|
|
381
|
+
ariaLabel,
|
|
382
|
+
disabled,
|
|
383
|
+
href,
|
|
384
|
+
target,
|
|
385
|
+
rel,
|
|
386
|
+
prefetch,
|
|
387
|
+
linkComponent,
|
|
388
|
+
tooltip,
|
|
389
|
+
tooltipSide,
|
|
390
|
+
tooltipAlign,
|
|
391
|
+
label,
|
|
392
|
+
mobileIconOnly,
|
|
393
|
+
pillClassName: "matrx-tap-pill matrx-glass-thin-border",
|
|
394
|
+
iconClassName: `matrx-tap-icon ${color}`,
|
|
395
|
+
rest,
|
|
396
|
+
buttonRef: ref
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
var TapTargetButtonTransparent = forwardRef2(function TapTargetButtonTransparent2({
|
|
400
|
+
icon,
|
|
401
|
+
children,
|
|
402
|
+
strokeWidth = 2,
|
|
403
|
+
onClick,
|
|
404
|
+
className,
|
|
405
|
+
as,
|
|
406
|
+
htmlFor,
|
|
407
|
+
ariaLabel,
|
|
408
|
+
disabled,
|
|
409
|
+
href,
|
|
410
|
+
target,
|
|
411
|
+
rel,
|
|
412
|
+
prefetch,
|
|
413
|
+
linkComponent,
|
|
414
|
+
tooltip,
|
|
415
|
+
tooltipSide,
|
|
416
|
+
tooltipAlign,
|
|
417
|
+
label,
|
|
418
|
+
mobileIconOnly,
|
|
419
|
+
...rest
|
|
420
|
+
}, ref) {
|
|
421
|
+
const color = className ?? "text-foreground";
|
|
422
|
+
return renderTapTarget({
|
|
423
|
+
icon,
|
|
424
|
+
children,
|
|
425
|
+
strokeWidth,
|
|
426
|
+
onClick,
|
|
427
|
+
as,
|
|
428
|
+
htmlFor,
|
|
429
|
+
ariaLabel,
|
|
430
|
+
disabled,
|
|
431
|
+
href,
|
|
432
|
+
target,
|
|
433
|
+
rel,
|
|
434
|
+
prefetch,
|
|
435
|
+
linkComponent,
|
|
436
|
+
tooltip,
|
|
437
|
+
tooltipSide,
|
|
438
|
+
tooltipAlign,
|
|
439
|
+
label,
|
|
440
|
+
mobileIconOnly,
|
|
441
|
+
pillClassName: "matrx-tap-pill hover:bg-muted active:bg-muted-foreground/15",
|
|
442
|
+
iconClassName: `matrx-tap-icon ${color}`,
|
|
443
|
+
rest,
|
|
444
|
+
buttonRef: ref
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
var TapTargetButtonSolid = forwardRef2(function TapTargetButtonSolid2({
|
|
448
|
+
icon,
|
|
449
|
+
children,
|
|
450
|
+
strokeWidth = 2,
|
|
451
|
+
onClick,
|
|
452
|
+
as,
|
|
453
|
+
htmlFor,
|
|
454
|
+
ariaLabel,
|
|
455
|
+
disabled,
|
|
456
|
+
href,
|
|
457
|
+
target,
|
|
458
|
+
rel,
|
|
459
|
+
prefetch,
|
|
460
|
+
linkComponent,
|
|
461
|
+
bgColor = "bg-primary",
|
|
462
|
+
iconColor = "text-primary-foreground",
|
|
463
|
+
hoverBgColor = "hover:bg-primary/80",
|
|
464
|
+
activeBgColor = "active:brightness-90",
|
|
465
|
+
tooltip,
|
|
466
|
+
tooltipSide,
|
|
467
|
+
tooltipAlign,
|
|
468
|
+
label,
|
|
469
|
+
mobileIconOnly,
|
|
470
|
+
...rest
|
|
471
|
+
}, ref) {
|
|
472
|
+
return renderTapTarget({
|
|
473
|
+
icon,
|
|
474
|
+
children,
|
|
475
|
+
strokeWidth,
|
|
476
|
+
onClick,
|
|
477
|
+
as,
|
|
478
|
+
htmlFor,
|
|
479
|
+
ariaLabel,
|
|
480
|
+
disabled,
|
|
481
|
+
href,
|
|
482
|
+
target,
|
|
483
|
+
rel,
|
|
484
|
+
prefetch,
|
|
485
|
+
linkComponent,
|
|
486
|
+
tooltip,
|
|
487
|
+
tooltipSide,
|
|
488
|
+
tooltipAlign,
|
|
489
|
+
label,
|
|
490
|
+
mobileIconOnly,
|
|
491
|
+
pillClassName: `matrx-tap-pill ${bgColor} ${iconColor} ${hoverBgColor} ${activeBgColor}`,
|
|
492
|
+
iconClassName: `matrx-tap-icon ${iconColor}`,
|
|
493
|
+
labelClassName: `matrx-tap-label ${iconColor}`,
|
|
494
|
+
rest,
|
|
495
|
+
buttonRef: ref
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
var TapTargetButtonDestructive = forwardRef2(function TapTargetButtonDestructive2({
|
|
499
|
+
bgColor = "bg-destructive",
|
|
500
|
+
iconColor = "text-destructive-foreground",
|
|
501
|
+
hoverBgColor = "hover:bg-destructive/90",
|
|
502
|
+
...rest
|
|
503
|
+
}, ref) {
|
|
504
|
+
return /* @__PURE__ */ jsx3(
|
|
505
|
+
TapTargetButtonSolid,
|
|
506
|
+
{
|
|
507
|
+
ref,
|
|
508
|
+
bgColor,
|
|
509
|
+
iconColor,
|
|
510
|
+
hoverBgColor,
|
|
511
|
+
...rest
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
});
|
|
515
|
+
var TapTargetButtonForGroup = forwardRef2(function TapTargetButtonForGroup2({
|
|
516
|
+
icon,
|
|
517
|
+
children,
|
|
518
|
+
strokeWidth = 2,
|
|
519
|
+
onClick,
|
|
520
|
+
className,
|
|
521
|
+
as,
|
|
522
|
+
htmlFor,
|
|
523
|
+
ariaLabel,
|
|
524
|
+
disabled,
|
|
525
|
+
href,
|
|
526
|
+
target,
|
|
527
|
+
rel,
|
|
528
|
+
prefetch,
|
|
529
|
+
linkComponent,
|
|
530
|
+
tooltip,
|
|
531
|
+
tooltipSide,
|
|
532
|
+
tooltipAlign,
|
|
533
|
+
label,
|
|
534
|
+
mobileIconOnly,
|
|
535
|
+
...rest
|
|
536
|
+
}, ref) {
|
|
537
|
+
const color = className ?? "text-foreground";
|
|
538
|
+
return renderTapTarget({
|
|
539
|
+
size: "sm",
|
|
540
|
+
icon,
|
|
541
|
+
children,
|
|
542
|
+
strokeWidth,
|
|
543
|
+
onClick,
|
|
544
|
+
as,
|
|
545
|
+
htmlFor,
|
|
546
|
+
ariaLabel,
|
|
547
|
+
disabled,
|
|
548
|
+
href,
|
|
549
|
+
target,
|
|
550
|
+
rel,
|
|
551
|
+
prefetch,
|
|
552
|
+
linkComponent,
|
|
553
|
+
tooltip,
|
|
554
|
+
tooltipSide,
|
|
555
|
+
tooltipAlign,
|
|
556
|
+
label,
|
|
557
|
+
mobileIconOnly,
|
|
558
|
+
pillClassName: "matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive",
|
|
559
|
+
iconClassName: `matrx-tap-icon ${color}`,
|
|
560
|
+
labelClassName: `matrx-tap-label ${color}`,
|
|
561
|
+
rest,
|
|
562
|
+
buttonRef: ref
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
function TapTargetButtonGroup({
|
|
566
|
+
children,
|
|
567
|
+
className
|
|
568
|
+
}) {
|
|
569
|
+
return /* @__PURE__ */ jsxs(
|
|
570
|
+
"div",
|
|
571
|
+
{
|
|
572
|
+
className: className ? `relative inline-flex h-9 items-center ${className}` : "relative inline-flex h-9 items-center",
|
|
573
|
+
children: [
|
|
574
|
+
/* @__PURE__ */ jsx3("div", { className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 h-7 rounded-full matrx-glass-thin-border" }),
|
|
575
|
+
/* @__PURE__ */ jsx3("div", { className: "relative flex min-w-0 items-center", children })
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// src/tap-target/tap-target-labeled.tsx
|
|
582
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
583
|
+
function TapTargetLabeled({
|
|
584
|
+
label,
|
|
585
|
+
children,
|
|
586
|
+
hideLabel = false,
|
|
587
|
+
toolTipSide = "bottom"
|
|
588
|
+
}) {
|
|
589
|
+
return /* @__PURE__ */ jsx4(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
590
|
+
/* @__PURE__ */ jsx4(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center p-0 gap-0 space-y-0 space-x-0 shrink-0", children: [
|
|
591
|
+
children,
|
|
592
|
+
!hideLabel && /* @__PURE__ */ jsx4("span", { className: "text-[10px] text-muted-foreground/70 leading-tight max-w-[52px] text-center truncate", children: label })
|
|
593
|
+
] }) }),
|
|
594
|
+
/* @__PURE__ */ jsx4(TooltipContent, { side: toolTipSide, children: /* @__PURE__ */ jsx4("span", { className: "font-mono text-xs max-w-[280px] break-all", children: label }) })
|
|
595
|
+
] }) });
|
|
596
|
+
}
|
|
597
|
+
export {
|
|
598
|
+
TapTargetButton,
|
|
599
|
+
TapTargetButtonDestructive,
|
|
600
|
+
TapTargetButtonForGroup,
|
|
601
|
+
TapTargetButtonGroup,
|
|
602
|
+
TapTargetButtonSolid,
|
|
603
|
+
TapTargetButtonTransparent,
|
|
604
|
+
TapTargetLabeled,
|
|
605
|
+
getTapTargetLinkComponent,
|
|
606
|
+
setTapTargetLinkComponent
|
|
607
|
+
};
|
|
608
|
+
//# sourceMappingURL=tap-target.js.map
|