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