@pactor-app/ui 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-M4PHRT2N.js → chunk-HW6M3BEF.js} +81 -34
- package/dist/{chunk-VT5XP4U4.js → chunk-NVORKHWX.js} +34 -18
- package/dist/components/index.cjs +138 -77
- package/dist/components/index.d.cts +23 -9
- package/dist/components/index.d.ts +23 -9
- package/dist/components/index.js +2 -2
- package/dist/index.cjs +150 -89
- package/dist/index.js +2 -2
- package/dist/ui/index.cjs +49 -33
- package/dist/ui/index.d.cts +7 -1
- package/dist/ui/index.d.ts +7 -1
- package/dist/ui/index.js +1 -1
- package/package.json +5 -5
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
chartColor,
|
|
142
142
|
navigationMenuTriggerStyle,
|
|
143
143
|
toast
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-NVORKHWX.js";
|
|
145
145
|
import {
|
|
146
146
|
Dialog,
|
|
147
147
|
DialogContent,
|
|
@@ -325,13 +325,38 @@ function Badge2({ text, variant = "default", className, style }) {
|
|
|
325
325
|
|
|
326
326
|
// src/components/components/Breadcrumb/index.tsx
|
|
327
327
|
import { Fragment } from "react";
|
|
328
|
+
|
|
329
|
+
// src/components/spa-link.ts
|
|
330
|
+
import { useRenderer as useRenderer3 } from "@pactor-app/runtime";
|
|
331
|
+
function shouldInterceptLinkClick(event, href, target) {
|
|
332
|
+
return typeof href === "string" && href.startsWith("/") && (target === void 0 || target === "_self") && event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;
|
|
333
|
+
}
|
|
334
|
+
function useSpaLinkClick() {
|
|
335
|
+
const { context } = useRenderer3();
|
|
336
|
+
return (event, href, target) => {
|
|
337
|
+
if (shouldInterceptLinkClick(event, href, target)) {
|
|
338
|
+
event.preventDefault();
|
|
339
|
+
context.route.navigate(href);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// src/components/components/Breadcrumb/index.tsx
|
|
328
345
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
329
346
|
function Breadcrumb2({ items = [], className, style }) {
|
|
347
|
+
const handleSpaClick = useSpaLinkClick();
|
|
330
348
|
return /* @__PURE__ */ jsx8(Breadcrumb, { className, style, children: /* @__PURE__ */ jsx8(BreadcrumbList, { children: items.map((item, index) => {
|
|
331
349
|
const isLast = index === items.length - 1;
|
|
332
350
|
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
333
351
|
index > 0 ? /* @__PURE__ */ jsx8(BreadcrumbSeparator, {}) : null,
|
|
334
|
-
/* @__PURE__ */ jsx8(BreadcrumbItem, { children: isLast || !item.href ? /* @__PURE__ */ jsx8(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx8(
|
|
352
|
+
/* @__PURE__ */ jsx8(BreadcrumbItem, { children: isLast || !item.href ? /* @__PURE__ */ jsx8(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx8(
|
|
353
|
+
BreadcrumbLink,
|
|
354
|
+
{
|
|
355
|
+
href: item.href,
|
|
356
|
+
onClick: (event) => handleSpaClick(event, item.href),
|
|
357
|
+
children: item.label
|
|
358
|
+
}
|
|
359
|
+
) })
|
|
335
360
|
] }, `${item.label}-${index}`);
|
|
336
361
|
}) }) });
|
|
337
362
|
}
|
|
@@ -353,6 +378,7 @@ var sizeMap = {
|
|
|
353
378
|
};
|
|
354
379
|
function Button2({
|
|
355
380
|
text,
|
|
381
|
+
icon,
|
|
356
382
|
variant = "default",
|
|
357
383
|
danger,
|
|
358
384
|
size = "middle",
|
|
@@ -381,7 +407,7 @@ function Button2({
|
|
|
381
407
|
className
|
|
382
408
|
),
|
|
383
409
|
children: [
|
|
384
|
-
loading ? /* @__PURE__ */ jsx9(Loader2, { "aria-hidden": true, className: "animate-spin" }) : null,
|
|
410
|
+
loading ? /* @__PURE__ */ jsx9(Loader2, { "aria-hidden": true, className: "animate-spin" }) : icon ? /* @__PURE__ */ jsx9(Icon, { name: icon, size: "sm" }) : null,
|
|
385
411
|
text ?? children
|
|
386
412
|
]
|
|
387
413
|
}
|
|
@@ -499,7 +525,7 @@ function Card2({ title, bordered = true, rounded, className, style, children })
|
|
|
499
525
|
}
|
|
500
526
|
|
|
501
527
|
// src/components/components/Carousel/index.tsx
|
|
502
|
-
import { useRenderer as
|
|
528
|
+
import { useRenderer as useRenderer4 } from "@pactor-app/runtime";
|
|
503
529
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
504
530
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
505
531
|
function isDslNode(item) {
|
|
@@ -512,7 +538,7 @@ function Carousel2({
|
|
|
512
538
|
className,
|
|
513
539
|
style
|
|
514
540
|
}) {
|
|
515
|
-
const { renderChildren } =
|
|
541
|
+
const { renderChildren } = useRenderer4();
|
|
516
542
|
const [api, setApi] = useState2();
|
|
517
543
|
useEffect2(() => {
|
|
518
544
|
if (!api || !autoplay) return;
|
|
@@ -890,7 +916,7 @@ function Chart({
|
|
|
890
916
|
}
|
|
891
917
|
|
|
892
918
|
// src/components/components/ChatInput/index.tsx
|
|
893
|
-
import { useRenderer as
|
|
919
|
+
import { useRenderer as useRenderer5 } from "@pactor-app/runtime";
|
|
894
920
|
import { ArrowUp } from "lucide-react";
|
|
895
921
|
import {
|
|
896
922
|
useRef,
|
|
@@ -912,7 +938,7 @@ function ChatInput({
|
|
|
912
938
|
className,
|
|
913
939
|
style
|
|
914
940
|
}) {
|
|
915
|
-
const { renderChildren } =
|
|
941
|
+
const { renderChildren } = useRenderer5();
|
|
916
942
|
const controlled = value !== void 0;
|
|
917
943
|
const [draft, setDraft] = useState5("");
|
|
918
944
|
const text = controlled ? value : draft;
|
|
@@ -1032,7 +1058,7 @@ function ContextMenu2({
|
|
|
1032
1058
|
}
|
|
1033
1059
|
|
|
1034
1060
|
// src/components/components/DataTable/index.tsx
|
|
1035
|
-
import { useI18n as useI18n3, useRenderer as
|
|
1061
|
+
import { useI18n as useI18n3, useRenderer as useRenderer6 } from "@pactor-app/runtime";
|
|
1036
1062
|
import { ArrowDown, ArrowUp as ArrowUp2, ArrowUpDown } from "lucide-react";
|
|
1037
1063
|
import { useMemo, useState as useState6 } from "react";
|
|
1038
1064
|
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
@@ -1062,7 +1088,7 @@ function DataTable({
|
|
|
1062
1088
|
className,
|
|
1063
1089
|
style
|
|
1064
1090
|
}) {
|
|
1065
|
-
const { renderChildren } =
|
|
1091
|
+
const { renderChildren } = useRenderer6();
|
|
1066
1092
|
const { t } = useI18n3();
|
|
1067
1093
|
const [sortState, setSortState] = useState6(sort);
|
|
1068
1094
|
const [filters, setFilters] = useState6({});
|
|
@@ -1484,7 +1510,7 @@ function DatePicker(props) {
|
|
|
1484
1510
|
}
|
|
1485
1511
|
|
|
1486
1512
|
// src/components/components/Dialog/index.tsx
|
|
1487
|
-
import { useRenderer as
|
|
1513
|
+
import { useRenderer as useRenderer7 } from "@pactor-app/runtime";
|
|
1488
1514
|
import { useState as useState8 } from "react";
|
|
1489
1515
|
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1490
1516
|
function Dialog2({
|
|
@@ -1497,7 +1523,7 @@ function Dialog2({
|
|
|
1497
1523
|
className,
|
|
1498
1524
|
style
|
|
1499
1525
|
}) {
|
|
1500
|
-
const { renderChildren } =
|
|
1526
|
+
const { renderChildren } = useRenderer7();
|
|
1501
1527
|
const [innerOpen, setInnerOpen] = useState8(false);
|
|
1502
1528
|
const controlled = open !== void 0;
|
|
1503
1529
|
const visible = controlled ? open : innerOpen;
|
|
@@ -1611,9 +1637,15 @@ function Empty2({ title, description, children, className, style }) {
|
|
|
1611
1637
|
|
|
1612
1638
|
// src/components/components/Field/index.tsx
|
|
1613
1639
|
import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1614
|
-
function Field2({ label, description, error, children, className, style }) {
|
|
1640
|
+
function Field2({ label, required, description, error, children, className, style }) {
|
|
1615
1641
|
return /* @__PURE__ */ jsxs23(Field, { className, style, children: [
|
|
1616
|
-
label ? /* @__PURE__ */
|
|
1642
|
+
label ? /* @__PURE__ */ jsxs23(FieldLabel, { children: [
|
|
1643
|
+
required ? /* @__PURE__ */ jsxs23("span", { "aria-hidden": true, className: "text-destructive", children: [
|
|
1644
|
+
"*",
|
|
1645
|
+
" "
|
|
1646
|
+
] }) : null,
|
|
1647
|
+
label
|
|
1648
|
+
] }) : null,
|
|
1617
1649
|
children,
|
|
1618
1650
|
description ? /* @__PURE__ */ jsx28(FieldDescription, { children: description }) : null,
|
|
1619
1651
|
error ? /* @__PURE__ */ jsx28(FieldError, { match: true, children: error }) : null
|
|
@@ -1688,7 +1720,7 @@ function Footer({ className, style, children }) {
|
|
|
1688
1720
|
}
|
|
1689
1721
|
|
|
1690
1722
|
// src/components/components/Form/index.tsx
|
|
1691
|
-
import { useRenderer as
|
|
1723
|
+
import { useRenderer as useRenderer8 } from "@pactor-app/runtime";
|
|
1692
1724
|
import {
|
|
1693
1725
|
useCallback,
|
|
1694
1726
|
useEffect as useEffect6,
|
|
@@ -1710,7 +1742,7 @@ function Form({
|
|
|
1710
1742
|
onSubmit,
|
|
1711
1743
|
onValuesChange
|
|
1712
1744
|
}) {
|
|
1713
|
-
const { context } =
|
|
1745
|
+
const { context } = useRenderer8();
|
|
1714
1746
|
const [values, setValues] = useState9(() => ({
|
|
1715
1747
|
...initialValues
|
|
1716
1748
|
}));
|
|
@@ -2020,13 +2052,13 @@ function HeaderLocalesArea({
|
|
|
2020
2052
|
}
|
|
2021
2053
|
|
|
2022
2054
|
// src/components/components/HoverCard/index.tsx
|
|
2023
|
-
import { useRenderer as
|
|
2055
|
+
import { useRenderer as useRenderer9 } from "@pactor-app/runtime";
|
|
2024
2056
|
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2025
2057
|
function isDslNode2(value) {
|
|
2026
2058
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
2027
2059
|
}
|
|
2028
2060
|
function HoverCard2({ content, children, className, style }) {
|
|
2029
|
-
const { renderChildren } =
|
|
2061
|
+
const { renderChildren } = useRenderer9();
|
|
2030
2062
|
return /* @__PURE__ */ jsxs25(HoverCard, { children: [
|
|
2031
2063
|
/* @__PURE__ */ jsx34(HoverCardTrigger, { render: triggerWrapper("hover-card-trigger-wrap"), children }),
|
|
2032
2064
|
/* @__PURE__ */ jsx34(HoverCardContent, { className, style, children: isDslNode2(content) ? renderChildren([content]) : content })
|
|
@@ -2048,6 +2080,7 @@ function Input2({
|
|
|
2048
2080
|
allowClear,
|
|
2049
2081
|
onChange,
|
|
2050
2082
|
className,
|
|
2083
|
+
controlClassName,
|
|
2051
2084
|
style
|
|
2052
2085
|
}) {
|
|
2053
2086
|
const form = useFormContext();
|
|
@@ -2079,7 +2112,10 @@ function Input2({
|
|
|
2079
2112
|
value: currentValue,
|
|
2080
2113
|
placeholder,
|
|
2081
2114
|
disabled,
|
|
2082
|
-
className:
|
|
2115
|
+
className: cn(
|
|
2116
|
+
!inFormRoot && allowClear !== true && className,
|
|
2117
|
+
allowClear !== true && controlClassName
|
|
2118
|
+
),
|
|
2083
2119
|
style: !inFormRoot && allowClear !== true ? style : void 0,
|
|
2084
2120
|
onChange: (event) => {
|
|
2085
2121
|
if (inForm && form && name) {
|
|
@@ -2102,7 +2138,11 @@ function Input2({
|
|
|
2102
2138
|
const control = allowClear === true ? /* @__PURE__ */ jsxs26(
|
|
2103
2139
|
"span",
|
|
2104
2140
|
{
|
|
2105
|
-
className: cn(
|
|
2141
|
+
className: cn(
|
|
2142
|
+
"flex items-center gap-1",
|
|
2143
|
+
!inFormRoot && className,
|
|
2144
|
+
controlClassName
|
|
2145
|
+
),
|
|
2106
2146
|
style: inFormRoot ? void 0 : style,
|
|
2107
2147
|
children: [
|
|
2108
2148
|
input,
|
|
@@ -2212,7 +2252,7 @@ function InputOTP2({
|
|
|
2212
2252
|
}
|
|
2213
2253
|
|
|
2214
2254
|
// src/components/components/Item/index.tsx
|
|
2215
|
-
import { useRenderer as
|
|
2255
|
+
import { useRenderer as useRenderer10 } from "@pactor-app/runtime";
|
|
2216
2256
|
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2217
2257
|
function Item2({
|
|
2218
2258
|
title,
|
|
@@ -2222,7 +2262,7 @@ function Item2({
|
|
|
2222
2262
|
className,
|
|
2223
2263
|
style
|
|
2224
2264
|
}) {
|
|
2225
|
-
const { renderChildren } =
|
|
2265
|
+
const { renderChildren } = useRenderer10();
|
|
2226
2266
|
const mediaNodes = media === void 0 ? [] : Array.isArray(media) ? media : [media];
|
|
2227
2267
|
return /* @__PURE__ */ jsxs28(Item, { className, style, children: [
|
|
2228
2268
|
mediaNodes.length > 0 ? /* @__PURE__ */ jsx38(ItemMedia, { children: renderChildren(mediaNodes) }) : null,
|
|
@@ -2248,10 +2288,10 @@ function Label2({ text, htmlFor, className, style }) {
|
|
|
2248
2288
|
|
|
2249
2289
|
// src/components/components/Layout/index.tsx
|
|
2250
2290
|
import { isDslSourceRef } from "@pactor-app/core";
|
|
2251
|
-
import { useRenderer as
|
|
2291
|
+
import { useRenderer as useRenderer11 } from "@pactor-app/runtime";
|
|
2252
2292
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2253
2293
|
function Layout({ direction, className, style, dslChildren }) {
|
|
2254
|
-
const { renderChildren, context } =
|
|
2294
|
+
const { renderChildren, context } = useRenderer11();
|
|
2255
2295
|
const hasSider = Array.isArray(dslChildren) ? dslChildren.some(
|
|
2256
2296
|
(child) => !isDslSourceRef(child) && resolveRootType(child, context) === "Sider"
|
|
2257
2297
|
) : false;
|
|
@@ -2282,6 +2322,7 @@ function resolveRootType(node, context) {
|
|
|
2282
2322
|
// src/components/components/Link/index.tsx
|
|
2283
2323
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2284
2324
|
function Link({ href, text, target, className, style, children }) {
|
|
2325
|
+
const handleSpaClick = useSpaLinkClick();
|
|
2285
2326
|
return /* @__PURE__ */ jsx42(
|
|
2286
2327
|
"a",
|
|
2287
2328
|
{
|
|
@@ -2291,6 +2332,7 @@ function Link({ href, text, target, className, style, children }) {
|
|
|
2291
2332
|
rel: target === "_blank" ? "noreferrer" : void 0,
|
|
2292
2333
|
className: cn("text-primary underline-offset-4 hover:underline", className),
|
|
2293
2334
|
style,
|
|
2335
|
+
onClick: (event) => handleSpaClick(event, href, target),
|
|
2294
2336
|
children: text ?? children
|
|
2295
2337
|
}
|
|
2296
2338
|
);
|
|
@@ -2443,13 +2485,13 @@ function Pagination2({
|
|
|
2443
2485
|
}
|
|
2444
2486
|
|
|
2445
2487
|
// src/components/components/Popover/index.tsx
|
|
2446
|
-
import { useRenderer as
|
|
2488
|
+
import { useRenderer as useRenderer12 } from "@pactor-app/runtime";
|
|
2447
2489
|
import { jsx as jsx47, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2448
2490
|
function isDslNode3(value) {
|
|
2449
2491
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
2450
2492
|
}
|
|
2451
2493
|
function Popover2({ content, children, className, style }) {
|
|
2452
|
-
const { renderChildren } =
|
|
2494
|
+
const { renderChildren } = useRenderer12();
|
|
2453
2495
|
return /* @__PURE__ */ jsxs33(Popover, { children: [
|
|
2454
2496
|
/* @__PURE__ */ jsx47(
|
|
2455
2497
|
PopoverTrigger,
|
|
@@ -2594,7 +2636,7 @@ function RadioGroup2({
|
|
|
2594
2636
|
}
|
|
2595
2637
|
|
|
2596
2638
|
// src/components/components/Resizable/index.tsx
|
|
2597
|
-
import { useRenderer as
|
|
2639
|
+
import { useRenderer as useRenderer13 } from "@pactor-app/runtime";
|
|
2598
2640
|
import { Fragment as Fragment4 } from "react";
|
|
2599
2641
|
import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2600
2642
|
function Resizable({
|
|
@@ -2603,7 +2645,7 @@ function Resizable({
|
|
|
2603
2645
|
className,
|
|
2604
2646
|
style
|
|
2605
2647
|
}) {
|
|
2606
|
-
const { renderChildren } =
|
|
2648
|
+
const { renderChildren } = useRenderer13();
|
|
2607
2649
|
return /* @__PURE__ */ jsx51(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ jsxs36(Fragment4, { children: [
|
|
2608
2650
|
index > 0 ? /* @__PURE__ */ jsx51(ResizableHandle, { withHandle: true }) : null,
|
|
2609
2651
|
/* @__PURE__ */ jsx51(
|
|
@@ -2652,6 +2694,7 @@ function Select2({
|
|
|
2652
2694
|
allowClear,
|
|
2653
2695
|
onChange,
|
|
2654
2696
|
className,
|
|
2697
|
+
controlClassName,
|
|
2655
2698
|
style
|
|
2656
2699
|
}) {
|
|
2657
2700
|
const form = useFormContext();
|
|
@@ -2677,7 +2720,11 @@ function Select2({
|
|
|
2677
2720
|
const select = /* @__PURE__ */ jsxs37(
|
|
2678
2721
|
"span",
|
|
2679
2722
|
{
|
|
2680
|
-
className: cn(
|
|
2723
|
+
className: cn(
|
|
2724
|
+
"inline-flex items-center gap-1",
|
|
2725
|
+
!inFormRoot && className,
|
|
2726
|
+
controlClassName
|
|
2727
|
+
),
|
|
2681
2728
|
style: inFormRoot ? void 0 : style,
|
|
2682
2729
|
children: [
|
|
2683
2730
|
/* @__PURE__ */ jsxs37(
|
|
@@ -2915,11 +2962,11 @@ function Slider2({
|
|
|
2915
2962
|
}
|
|
2916
2963
|
|
|
2917
2964
|
// src/components/components/Sonner/index.tsx
|
|
2918
|
-
import { useRenderer as
|
|
2965
|
+
import { useRenderer as useRenderer14 } from "@pactor-app/runtime";
|
|
2919
2966
|
import { useEffect as useEffect12 } from "react";
|
|
2920
2967
|
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2921
2968
|
function Sonner({ className, style }) {
|
|
2922
|
-
const { context } =
|
|
2969
|
+
const { context } = useRenderer14();
|
|
2923
2970
|
useEffect12(() => {
|
|
2924
2971
|
const { actions } = context;
|
|
2925
2972
|
if (actions.has("toast")) {
|
|
@@ -3030,7 +3077,7 @@ function Switch2({
|
|
|
3030
3077
|
}
|
|
3031
3078
|
|
|
3032
3079
|
// src/components/components/Table/index.tsx
|
|
3033
|
-
import { useI18n as useI18n8, useRenderer as
|
|
3080
|
+
import { useI18n as useI18n8, useRenderer as useRenderer15 } from "@pactor-app/runtime";
|
|
3034
3081
|
import { useState as useState12 } from "react";
|
|
3035
3082
|
import { jsx as jsx63, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3036
3083
|
function renderCellValue2(value) {
|
|
@@ -3052,7 +3099,7 @@ function Table2({
|
|
|
3052
3099
|
className,
|
|
3053
3100
|
style
|
|
3054
3101
|
}) {
|
|
3055
|
-
const { renderChildren } =
|
|
3102
|
+
const { renderChildren } = useRenderer15();
|
|
3056
3103
|
const { t } = useI18n8();
|
|
3057
3104
|
const [current, setCurrent] = useState12(1);
|
|
3058
3105
|
const pageSize = pagination === false ? void 0 : pagination?.pageSize;
|
|
@@ -3119,10 +3166,10 @@ function Table2({
|
|
|
3119
3166
|
}
|
|
3120
3167
|
|
|
3121
3168
|
// src/components/components/Tabs/index.tsx
|
|
3122
|
-
import { useRenderer as
|
|
3169
|
+
import { useRenderer as useRenderer16 } from "@pactor-app/runtime";
|
|
3123
3170
|
import { jsx as jsx64, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3124
3171
|
function Tabs2({ items = [], activeKey, variant, onChange, className, style }) {
|
|
3125
|
-
const { renderChildren } =
|
|
3172
|
+
const { renderChildren } = useRenderer16();
|
|
3126
3173
|
return /* @__PURE__ */ jsxs44(
|
|
3127
3174
|
Tabs,
|
|
3128
3175
|
{
|
|
@@ -306,6 +306,7 @@ function Badge({
|
|
|
306
306
|
|
|
307
307
|
// src/ui/breadcrumb.tsx
|
|
308
308
|
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
309
|
+
import * as React from "react";
|
|
309
310
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
310
311
|
function Breadcrumb({ ...props }) {
|
|
311
312
|
return /* @__PURE__ */ jsx6("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
@@ -333,12 +334,27 @@ function BreadcrumbItem({ className, ...props }) {
|
|
|
333
334
|
}
|
|
334
335
|
);
|
|
335
336
|
}
|
|
336
|
-
function BreadcrumbLink({
|
|
337
|
+
function BreadcrumbLink({
|
|
338
|
+
className,
|
|
339
|
+
render,
|
|
340
|
+
...props
|
|
341
|
+
}) {
|
|
342
|
+
const linkClassName = cn("transition-colors hover:text-foreground", className);
|
|
343
|
+
if (render) {
|
|
344
|
+
return React.cloneElement(render, {
|
|
345
|
+
"data-slot": "breadcrumb-link",
|
|
346
|
+
...props,
|
|
347
|
+
className: cn(
|
|
348
|
+
linkClassName,
|
|
349
|
+
render.props.className
|
|
350
|
+
)
|
|
351
|
+
});
|
|
352
|
+
}
|
|
337
353
|
return /* @__PURE__ */ jsx6(
|
|
338
354
|
"a",
|
|
339
355
|
{
|
|
340
356
|
"data-slot": "breadcrumb-link",
|
|
341
|
-
className:
|
|
357
|
+
className: linkClassName,
|
|
342
358
|
...props
|
|
343
359
|
}
|
|
344
360
|
);
|
|
@@ -485,11 +501,11 @@ function Calendar({
|
|
|
485
501
|
// src/ui/carousel.tsx
|
|
486
502
|
import useEmblaCarousel from "embla-carousel-react";
|
|
487
503
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon3 } from "lucide-react";
|
|
488
|
-
import * as
|
|
504
|
+
import * as React2 from "react";
|
|
489
505
|
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
490
|
-
var CarouselContext =
|
|
506
|
+
var CarouselContext = React2.createContext(null);
|
|
491
507
|
function useCarousel() {
|
|
492
|
-
const context =
|
|
508
|
+
const context = React2.useContext(CarouselContext);
|
|
493
509
|
if (!context) {
|
|
494
510
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
495
511
|
}
|
|
@@ -508,16 +524,16 @@ function Carousel({
|
|
|
508
524
|
{ ...opts, axis: orientation === "horizontal" ? "x" : "y" },
|
|
509
525
|
plugins
|
|
510
526
|
);
|
|
511
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
512
|
-
const [canScrollNext, setCanScrollNext] =
|
|
513
|
-
const onSelect =
|
|
527
|
+
const [canScrollPrev, setCanScrollPrev] = React2.useState(false);
|
|
528
|
+
const [canScrollNext, setCanScrollNext] = React2.useState(false);
|
|
529
|
+
const onSelect = React2.useCallback((carouselApi) => {
|
|
514
530
|
if (!carouselApi) return;
|
|
515
531
|
setCanScrollPrev(carouselApi.canScrollPrev());
|
|
516
532
|
setCanScrollNext(carouselApi.canScrollNext());
|
|
517
533
|
}, []);
|
|
518
|
-
const scrollPrev =
|
|
519
|
-
const scrollNext =
|
|
520
|
-
const handleKeyDown =
|
|
534
|
+
const scrollPrev = React2.useCallback(() => api?.scrollPrev(), [api]);
|
|
535
|
+
const scrollNext = React2.useCallback(() => api?.scrollNext(), [api]);
|
|
536
|
+
const handleKeyDown = React2.useCallback(
|
|
521
537
|
(event) => {
|
|
522
538
|
if (event.key === "ArrowLeft") {
|
|
523
539
|
event.preventDefault();
|
|
@@ -529,10 +545,10 @@ function Carousel({
|
|
|
529
545
|
},
|
|
530
546
|
[scrollPrev, scrollNext]
|
|
531
547
|
);
|
|
532
|
-
|
|
548
|
+
React2.useEffect(() => {
|
|
533
549
|
if (api && setApi) setApi(api);
|
|
534
550
|
}, [api, setApi]);
|
|
535
|
-
|
|
551
|
+
React2.useEffect(() => {
|
|
536
552
|
if (!api) return;
|
|
537
553
|
onSelect(api);
|
|
538
554
|
api.on("reInit", onSelect);
|
|
@@ -1423,7 +1439,7 @@ function InputGroupInput({
|
|
|
1423
1439
|
// src/ui/input-otp.tsx
|
|
1424
1440
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1425
1441
|
import { MinusIcon } from "lucide-react";
|
|
1426
|
-
import * as
|
|
1442
|
+
import * as React3 from "react";
|
|
1427
1443
|
import { jsx as jsx23, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1428
1444
|
function InputOTP({
|
|
1429
1445
|
className,
|
|
@@ -1458,7 +1474,7 @@ function InputOTPSlot({
|
|
|
1458
1474
|
className,
|
|
1459
1475
|
...props
|
|
1460
1476
|
}) {
|
|
1461
|
-
const inputOTPContext =
|
|
1477
|
+
const inputOTPContext = React3.useContext(OTPInputContext);
|
|
1462
1478
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
1463
1479
|
return /* @__PURE__ */ jsxs8(
|
|
1464
1480
|
"div",
|
|
@@ -2561,9 +2577,9 @@ function Toggle({
|
|
|
2561
2577
|
// src/ui/toggle-group.tsx
|
|
2562
2578
|
import { Toggle as TogglePrimitive2 } from "@base-ui/react/toggle";
|
|
2563
2579
|
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
|
|
2564
|
-
import * as
|
|
2580
|
+
import * as React4 from "react";
|
|
2565
2581
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2566
|
-
var ToggleGroupContext =
|
|
2582
|
+
var ToggleGroupContext = React4.createContext({
|
|
2567
2583
|
size: "default",
|
|
2568
2584
|
variant: "default"
|
|
2569
2585
|
});
|
|
@@ -2596,7 +2612,7 @@ function ToggleGroupItem({
|
|
|
2596
2612
|
size,
|
|
2597
2613
|
...props
|
|
2598
2614
|
}) {
|
|
2599
|
-
const context =
|
|
2615
|
+
const context = React4.useContext(ToggleGroupContext);
|
|
2600
2616
|
return /* @__PURE__ */ jsx41(
|
|
2601
2617
|
TogglePrimitive2,
|
|
2602
2618
|
{
|