@ai-matrx/design-system 0.31.0 → 0.34.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 +59 -0
- package/dist/data-table/index.cjs +56 -12
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +56 -12
- package/dist/data-table/index.js.map +1 -1
- package/dist/index.cjs +189 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +194 -96
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3324,6 +3324,9 @@ var SheetTitle = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3324
3324
|
));
|
|
3325
3325
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
3326
3326
|
|
|
3327
|
+
// src/organization-picker.tsx
|
|
3328
|
+
import * as React29 from "react";
|
|
3329
|
+
|
|
3327
3330
|
// src/skeleton.tsx
|
|
3328
3331
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3329
3332
|
function Skeleton({ className, animated = true, ...props }) {
|
|
@@ -3382,6 +3385,14 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
|
3382
3385
|
|
|
3383
3386
|
// src/organization-picker.tsx
|
|
3384
3387
|
import { Fragment as Fragment2, jsx as jsx38, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3388
|
+
var SEARCH_APPEARS_ABOVE = 8;
|
|
3389
|
+
function matchesQuery(org, query) {
|
|
3390
|
+
const q = query.trim().toLowerCase();
|
|
3391
|
+
if (!q) return true;
|
|
3392
|
+
if (org.name.toLowerCase().includes(q)) return true;
|
|
3393
|
+
const abbreviation = org.abbreviation?.trim().toLowerCase();
|
|
3394
|
+
return !!abbreviation && abbreviation.includes(q);
|
|
3395
|
+
}
|
|
3385
3396
|
function OrganizationAbbreviation({
|
|
3386
3397
|
abbreviation,
|
|
3387
3398
|
name,
|
|
@@ -3413,13 +3424,66 @@ function OrganizationPicker({
|
|
|
3413
3424
|
itemClassName,
|
|
3414
3425
|
className
|
|
3415
3426
|
}) {
|
|
3427
|
+
const [query, setQuery] = React29.useState("");
|
|
3428
|
+
const [showFixtures, setShowFixtures] = React29.useState(false);
|
|
3416
3429
|
const active = organizations.find((o) => o.id === activeOrganizationId) ?? null;
|
|
3417
3430
|
const isDefault = (id) => !!defaultOrganizationId && id === defaultOrganizationId;
|
|
3418
|
-
const
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3431
|
+
const rank = (org) => org.id === defaultOrganizationId ? 0 : org.isOwn ? 1 : 2;
|
|
3432
|
+
const ordered = [...organizations].sort((a, b) => rank(a) - rank(b));
|
|
3433
|
+
const matching = ordered.filter((org) => matchesQuery(org, query));
|
|
3434
|
+
const listed = matching.filter((org) => !org.isTestFixture);
|
|
3435
|
+
const fixtures = matching.filter((org) => org.isTestFixture);
|
|
3436
|
+
const searchable = organizations.length > SEARCH_APPEARS_ABOVE;
|
|
3422
3437
|
const sharesItsName = (org) => organizations.filter((other) => other.name.trim() === org.name.trim()).length > 1;
|
|
3438
|
+
const renderRow = (org) => {
|
|
3439
|
+
const isActive = org.id === activeOrganizationId;
|
|
3440
|
+
return /* @__PURE__ */ jsx38("li", { role: "none", children: /* @__PURE__ */ jsxs21(
|
|
3441
|
+
"button",
|
|
3442
|
+
{
|
|
3443
|
+
type: "button",
|
|
3444
|
+
role: "option",
|
|
3445
|
+
"aria-selected": isActive,
|
|
3446
|
+
"aria-pressed": isActive,
|
|
3447
|
+
onClick: (event) => {
|
|
3448
|
+
event.stopPropagation();
|
|
3449
|
+
onSelect(org);
|
|
3450
|
+
},
|
|
3451
|
+
className: cn(
|
|
3452
|
+
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent",
|
|
3453
|
+
isActive && "bg-primary/10 font-medium text-primary",
|
|
3454
|
+
itemClassName
|
|
3455
|
+
),
|
|
3456
|
+
children: [
|
|
3457
|
+
/* @__PURE__ */ jsx38(
|
|
3458
|
+
OrganizationAbbreviation,
|
|
3459
|
+
{
|
|
3460
|
+
abbreviation: org.abbreviation,
|
|
3461
|
+
name: org.name,
|
|
3462
|
+
className: cn(
|
|
3463
|
+
"h-5 min-w-8 rounded border border-border bg-muted px-1 text-[9px]",
|
|
3464
|
+
isActive ? "text-primary" : "text-muted-foreground"
|
|
3465
|
+
)
|
|
3466
|
+
}
|
|
3467
|
+
),
|
|
3468
|
+
/* @__PURE__ */ jsxs21("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
3469
|
+
/* @__PURE__ */ jsx38("span", { className: "truncate", children: org.name }),
|
|
3470
|
+
sharesItsName(org) && org.distinguisher ? /* @__PURE__ */ jsx38("span", { className: "truncate text-[10px] font-normal text-muted-foreground", children: org.distinguisher }) : null
|
|
3471
|
+
] }),
|
|
3472
|
+
org.isPersonal && /* @__PURE__ */ jsx38("span", { className: "shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "Personal" }),
|
|
3473
|
+
isDefault(org.id) && /* @__PURE__ */ jsx38(
|
|
3474
|
+
StarIcon,
|
|
3475
|
+
{
|
|
3476
|
+
className: "h-[13px] w-[13px] shrink-0 fill-warning text-warning",
|
|
3477
|
+
"aria-hidden": false,
|
|
3478
|
+
"aria-label": "Default organization",
|
|
3479
|
+
role: "img"
|
|
3480
|
+
}
|
|
3481
|
+
),
|
|
3482
|
+
isActive && /* @__PURE__ */ jsx38(LucideCheckIcon, { className: "h-[15px] w-[15px] shrink-0 text-primary" })
|
|
3483
|
+
]
|
|
3484
|
+
}
|
|
3485
|
+
) }, org.id);
|
|
3486
|
+
};
|
|
3423
3487
|
return /* @__PURE__ */ jsxs21("div", { className: cn("flex flex-col", className), "data-slot": "organization-picker", children: [
|
|
3424
3488
|
!hideHeading && /* @__PURE__ */ jsx38("p", { className: "px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: "Organization" }),
|
|
3425
3489
|
loading ? /* @__PURE__ */ jsxs21("div", { className: "space-y-1 px-1 py-1", "aria-busy": "true", "aria-label": "Loading organizations", children: [
|
|
@@ -3431,55 +3495,89 @@ function OrganizationPicker({
|
|
|
3431
3495
|
" ",
|
|
3432
3496
|
/* @__PURE__ */ jsx38("span", { className: "font-medium text-foreground", children: active.name })
|
|
3433
3497
|
] }) : /* @__PURE__ */ jsx38("p", { className: "px-2 pb-1 text-[11px] text-destructive", "data-slot": "organization-picker-status", children: "No organization selected \u2014 pick one below." }),
|
|
3434
|
-
/* @__PURE__ */ jsx38("
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
"
|
|
3498
|
+
searchable && /* @__PURE__ */ jsx38("div", { className: "px-2 pb-1.5", children: /* @__PURE__ */ jsx38(
|
|
3499
|
+
Input,
|
|
3500
|
+
{
|
|
3501
|
+
type: "search",
|
|
3502
|
+
value: query,
|
|
3503
|
+
onChange: (event) => setQuery(event.target.value),
|
|
3504
|
+
onClick: (event) => event.stopPropagation(),
|
|
3505
|
+
onKeyDown: (event) => event.stopPropagation(),
|
|
3506
|
+
placeholder: "Search organizations",
|
|
3507
|
+
"aria-label": "Search organizations by name or abbreviation",
|
|
3508
|
+
className: "h-8 text-sm",
|
|
3509
|
+
"data-slot": "organization-picker-search"
|
|
3510
|
+
}
|
|
3511
|
+
) }),
|
|
3512
|
+
listed.length === 0 && fixtures.length === 0 ? /* @__PURE__ */ jsxs21(
|
|
3513
|
+
"p",
|
|
3514
|
+
{
|
|
3515
|
+
className: "px-2 py-2 text-xs text-muted-foreground",
|
|
3516
|
+
"data-slot": "organization-picker-no-match",
|
|
3517
|
+
children: [
|
|
3518
|
+
"No organization matches \u201C",
|
|
3519
|
+
query.trim(),
|
|
3520
|
+
"\u201D."
|
|
3521
|
+
]
|
|
3522
|
+
}
|
|
3523
|
+
) : listed.length === 0 ? (
|
|
3524
|
+
/* THE ARCHIVED-ITEMS LAW, honesty half: "nothing" may only be said
|
|
3525
|
+
when both halves are empty. Here the other half is one line down.
|
|
3526
|
+
AND IT SAYS WHAT IS TRUE, NOT WHAT IS EMPTY. The earlier sentence
|
|
3527
|
+
read "Nothing matches “X” outside the test organizations below" —
|
|
3528
|
+
which opens by negating the very rows sitting one click away, and
|
|
3529
|
+
`fixtures` IS query-filtered, so those rows ARE matches for X. A
|
|
3530
|
+
person reading "nothing matches" retypes their search instead of
|
|
3531
|
+
clicking. So: count the matches, say where they are, and carry
|
|
3532
|
+
the click that reveals them — the same shape as the honest
|
|
3533
|
+
empty-filter twin one line down. (TAILS-3) */
|
|
3534
|
+
/* @__PURE__ */ jsx38(
|
|
3535
|
+
"p",
|
|
3438
3536
|
{
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
)
|
|
3462
|
-
}
|
|
3463
|
-
),
|
|
3464
|
-
/* @__PURE__ */ jsxs21("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
3465
|
-
/* @__PURE__ */ jsx38("span", { className: "truncate", children: org.name }),
|
|
3466
|
-
sharesItsName(org) && org.distinguisher ? /* @__PURE__ */ jsx38("span", { className: "truncate text-[10px] font-normal text-muted-foreground", children: org.distinguisher }) : null
|
|
3467
|
-
] }),
|
|
3468
|
-
org.isPersonal && /* @__PURE__ */ jsx38("span", { className: "shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "Personal" }),
|
|
3469
|
-
isDefault(org.id) && /* @__PURE__ */ jsx38(
|
|
3470
|
-
StarIcon,
|
|
3471
|
-
{
|
|
3472
|
-
className: "h-[13px] w-[13px] shrink-0 fill-warning text-warning",
|
|
3473
|
-
"aria-hidden": false,
|
|
3474
|
-
"aria-label": "Default organization",
|
|
3475
|
-
role: "img"
|
|
3476
|
-
}
|
|
3477
|
-
),
|
|
3478
|
-
isActive && /* @__PURE__ */ jsx38(LucideCheckIcon, { className: "h-[15px] w-[15px] shrink-0 text-primary" })
|
|
3479
|
-
]
|
|
3537
|
+
className: "px-2 py-2 text-xs text-muted-foreground",
|
|
3538
|
+
"data-slot": "organization-picker-only-fixtures",
|
|
3539
|
+
children: query.trim() ? /* @__PURE__ */ jsxs21(Fragment2, { children: [
|
|
3540
|
+
fixtures.length === 1 ? `1 match for \u201C${query.trim()}\u201D is in your test organizations` : `All ${fixtures.length} matches for \u201C${query.trim()}\u201D are in your test organizations`,
|
|
3541
|
+
showFixtures ? ", listed below." : /* @__PURE__ */ jsxs21(Fragment2, { children: [
|
|
3542
|
+
" \u2014 ",
|
|
3543
|
+
/* @__PURE__ */ jsx38(
|
|
3544
|
+
"button",
|
|
3545
|
+
{
|
|
3546
|
+
type: "button",
|
|
3547
|
+
className: "underline underline-offset-2 hover:text-foreground",
|
|
3548
|
+
"data-slot": "organization-picker-show-fixtures",
|
|
3549
|
+
onClick: (event) => {
|
|
3550
|
+
event.stopPropagation();
|
|
3551
|
+
setShowFixtures(true);
|
|
3552
|
+
},
|
|
3553
|
+
children: "show them"
|
|
3554
|
+
}
|
|
3555
|
+
),
|
|
3556
|
+
"."
|
|
3557
|
+
] })
|
|
3558
|
+
] }) : `Every organization you belong to is a test organization \u2014 all ${fixtures.length} are below.`
|
|
3480
3559
|
}
|
|
3481
|
-
)
|
|
3482
|
-
|
|
3560
|
+
)
|
|
3561
|
+
) : /* @__PURE__ */ jsx38("ul", { className: "max-h-72 overflow-y-auto", role: "listbox", "aria-label": "Organizations", children: listed.map(renderRow) }),
|
|
3562
|
+
/* @__PURE__ */ jsx38(
|
|
3563
|
+
ArchivedDisclosure,
|
|
3564
|
+
{
|
|
3565
|
+
count: fixtures.length,
|
|
3566
|
+
open: showFixtures,
|
|
3567
|
+
onOpenChange: setShowFixtures,
|
|
3568
|
+
label: "Test organizations",
|
|
3569
|
+
className: "mt-0.5",
|
|
3570
|
+
children: /* @__PURE__ */ jsx38(
|
|
3571
|
+
"ul",
|
|
3572
|
+
{
|
|
3573
|
+
className: "max-h-72 overflow-y-auto",
|
|
3574
|
+
role: "listbox",
|
|
3575
|
+
"aria-label": "Test organizations",
|
|
3576
|
+
children: fixtures.map(renderRow)
|
|
3577
|
+
}
|
|
3578
|
+
)
|
|
3579
|
+
}
|
|
3580
|
+
),
|
|
3483
3581
|
onSetDefault && /* @__PURE__ */ jsxs21(Fragment2, { children: [
|
|
3484
3582
|
/* @__PURE__ */ jsx38("div", { className: "my-1 border-t border-border" }),
|
|
3485
3583
|
/* @__PURE__ */ jsx38(
|
|
@@ -3525,7 +3623,7 @@ function DefaultOrganizationSwitch({
|
|
|
3525
3623
|
}
|
|
3526
3624
|
|
|
3527
3625
|
// src/tabbed-bottom-sheet.tsx
|
|
3528
|
-
import { useState as
|
|
3626
|
+
import { useState as useState7 } from "react";
|
|
3529
3627
|
import { jsx as jsx39, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3530
3628
|
function TabbedBottomSheet({
|
|
3531
3629
|
open,
|
|
@@ -3534,8 +3632,8 @@ function TabbedBottomSheet({
|
|
|
3534
3632
|
tabs,
|
|
3535
3633
|
initialTabId = null
|
|
3536
3634
|
}) {
|
|
3537
|
-
const [selectedTabId, setSelectedTabId] =
|
|
3538
|
-
const [wasOpen, setWasOpen] =
|
|
3635
|
+
const [selectedTabId, setSelectedTabId] = useState7(initialTabId);
|
|
3636
|
+
const [wasOpen, setWasOpen] = useState7(open);
|
|
3539
3637
|
if (open !== wasOpen) {
|
|
3540
3638
|
setWasOpen(open);
|
|
3541
3639
|
if (open) setSelectedTabId(initialTabId);
|
|
@@ -3580,17 +3678,17 @@ function TabbedBottomSheet({
|
|
|
3580
3678
|
}
|
|
3581
3679
|
|
|
3582
3680
|
// src/table.tsx
|
|
3583
|
-
import * as
|
|
3681
|
+
import * as React30 from "react";
|
|
3584
3682
|
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3585
3683
|
var TABLE_SIZES = {
|
|
3586
3684
|
sm: { head: "px-2", cell: "p-2" },
|
|
3587
3685
|
md: { head: "px-3", cell: "p-3" }
|
|
3588
3686
|
};
|
|
3589
|
-
var TableSizeContext =
|
|
3687
|
+
var TableSizeContext = React30.createContext("md");
|
|
3590
3688
|
function useTableSize() {
|
|
3591
|
-
return
|
|
3689
|
+
return React30.useContext(TableSizeContext);
|
|
3592
3690
|
}
|
|
3593
|
-
var Table =
|
|
3691
|
+
var Table = React30.forwardRef(
|
|
3594
3692
|
({ className, size = "md", wrap = true, wrapperClassName, ...props }, ref) => {
|
|
3595
3693
|
const table = /* @__PURE__ */ jsx40(
|
|
3596
3694
|
"table",
|
|
@@ -3613,7 +3711,7 @@ var Table = React29.forwardRef(
|
|
|
3613
3711
|
}
|
|
3614
3712
|
);
|
|
3615
3713
|
Table.displayName = "Table";
|
|
3616
|
-
var TableHeader =
|
|
3714
|
+
var TableHeader = React30.forwardRef(({ className, sticky = false, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3617
3715
|
"thead",
|
|
3618
3716
|
{
|
|
3619
3717
|
ref,
|
|
@@ -3627,7 +3725,7 @@ var TableHeader = React29.forwardRef(({ className, sticky = false, ...props }, r
|
|
|
3627
3725
|
}
|
|
3628
3726
|
));
|
|
3629
3727
|
TableHeader.displayName = "TableHeader";
|
|
3630
|
-
var TableBody =
|
|
3728
|
+
var TableBody = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3631
3729
|
"tbody",
|
|
3632
3730
|
{
|
|
3633
3731
|
ref,
|
|
@@ -3637,7 +3735,7 @@ var TableBody = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3637
3735
|
}
|
|
3638
3736
|
));
|
|
3639
3737
|
TableBody.displayName = "TableBody";
|
|
3640
|
-
var TableFooter =
|
|
3738
|
+
var TableFooter = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3641
3739
|
"tfoot",
|
|
3642
3740
|
{
|
|
3643
3741
|
ref,
|
|
@@ -3650,7 +3748,7 @@ var TableFooter = React29.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3650
3748
|
}
|
|
3651
3749
|
));
|
|
3652
3750
|
TableFooter.displayName = "TableFooter";
|
|
3653
|
-
var TableRow =
|
|
3751
|
+
var TableRow = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3654
3752
|
"tr",
|
|
3655
3753
|
{
|
|
3656
3754
|
ref,
|
|
@@ -3663,7 +3761,7 @@ var TableRow = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3663
3761
|
}
|
|
3664
3762
|
));
|
|
3665
3763
|
TableRow.displayName = "TableRow";
|
|
3666
|
-
var TableHead =
|
|
3764
|
+
var TableHead = React30.forwardRef(({ className, ...props }, ref) => {
|
|
3667
3765
|
const size = useTableSize();
|
|
3668
3766
|
return /* @__PURE__ */ jsx40(
|
|
3669
3767
|
"th",
|
|
@@ -3680,7 +3778,7 @@ var TableHead = React29.forwardRef(({ className, ...props }, ref) => {
|
|
|
3680
3778
|
);
|
|
3681
3779
|
});
|
|
3682
3780
|
TableHead.displayName = "TableHead";
|
|
3683
|
-
var TableCell =
|
|
3781
|
+
var TableCell = React30.forwardRef(({ className, ...props }, ref) => {
|
|
3684
3782
|
const size = useTableSize();
|
|
3685
3783
|
return /* @__PURE__ */ jsx40(
|
|
3686
3784
|
"td",
|
|
@@ -3697,7 +3795,7 @@ var TableCell = React29.forwardRef(({ className, ...props }, ref) => {
|
|
|
3697
3795
|
);
|
|
3698
3796
|
});
|
|
3699
3797
|
TableCell.displayName = "TableCell";
|
|
3700
|
-
var TableCaption =
|
|
3798
|
+
var TableCaption = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3701
3799
|
"caption",
|
|
3702
3800
|
{
|
|
3703
3801
|
ref,
|
|
@@ -3710,11 +3808,11 @@ TableCaption.displayName = "TableCaption";
|
|
|
3710
3808
|
|
|
3711
3809
|
// src/tabs.tsx
|
|
3712
3810
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3713
|
-
import * as
|
|
3811
|
+
import * as React31 from "react";
|
|
3714
3812
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3715
3813
|
var Tabs = TabsPrimitive.Root;
|
|
3716
3814
|
var TABS_TRIGGER_BASE = "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm";
|
|
3717
|
-
var TabsList =
|
|
3815
|
+
var TabsList = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3718
3816
|
TabsPrimitive.List,
|
|
3719
3817
|
{
|
|
3720
3818
|
ref,
|
|
@@ -3727,7 +3825,7 @@ var TabsList = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3727
3825
|
}
|
|
3728
3826
|
));
|
|
3729
3827
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
3730
|
-
var TabsTrigger =
|
|
3828
|
+
var TabsTrigger = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3731
3829
|
TabsPrimitive.Trigger,
|
|
3732
3830
|
{
|
|
3733
3831
|
ref,
|
|
@@ -3741,7 +3839,7 @@ var TabsTrigger = React30.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3741
3839
|
}
|
|
3742
3840
|
));
|
|
3743
3841
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
3744
|
-
var TabsTriggerCore =
|
|
3842
|
+
var TabsTriggerCore = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3745
3843
|
TabsPrimitive.Trigger,
|
|
3746
3844
|
{
|
|
3747
3845
|
ref,
|
|
@@ -3751,7 +3849,7 @@ var TabsTriggerCore = React30.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3751
3849
|
}
|
|
3752
3850
|
));
|
|
3753
3851
|
TabsTriggerCore.displayName = TabsPrimitive.Trigger.displayName;
|
|
3754
|
-
var TabsContent =
|
|
3852
|
+
var TabsContent = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3755
3853
|
TabsPrimitive.Content,
|
|
3756
3854
|
{
|
|
3757
3855
|
ref,
|
|
@@ -3767,7 +3865,7 @@ var TabsContent = React30.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3767
3865
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
3768
3866
|
|
|
3769
3867
|
// src/textarea.tsx
|
|
3770
|
-
import * as
|
|
3868
|
+
import * as React32 from "react";
|
|
3771
3869
|
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3772
3870
|
var FILL_HEIGHT_REGEX = /(?:^|\s)(h-full|h-dvh|flex-1|grow)(?:\s|$)/;
|
|
3773
3871
|
var FILL_WIDTH_REGEX = /(?:^|\s)(w-full|w-screen)(?:\s|$)/;
|
|
@@ -3781,7 +3879,7 @@ function getStretchClasses(className) {
|
|
|
3781
3879
|
var TEXTAREA_ELEVATED_CLASS = "flex h-auto w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
|
|
3782
3880
|
var TEXTAREA_CONTROL_CLASS = "flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
|
|
3783
3881
|
function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
3784
|
-
|
|
3882
|
+
React32.useEffect(() => {
|
|
3785
3883
|
if (!autoGrow || !ref.current) return;
|
|
3786
3884
|
const textarea = ref.current;
|
|
3787
3885
|
textarea.style.height = "auto";
|
|
@@ -3797,8 +3895,8 @@ function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
|
3797
3895
|
}, [value, autoGrow, minHeight, maxHeight, ref]);
|
|
3798
3896
|
}
|
|
3799
3897
|
function useMergedTextareaRef(forwarded) {
|
|
3800
|
-
const internal =
|
|
3801
|
-
const callback =
|
|
3898
|
+
const internal = React32.useRef(null);
|
|
3899
|
+
const callback = React32.useCallback(
|
|
3802
3900
|
(node) => {
|
|
3803
3901
|
internal.current = node;
|
|
3804
3902
|
if (typeof forwarded === "function") forwarded(node);
|
|
@@ -3815,7 +3913,7 @@ function boxStyle(minHeight, maxHeight) {
|
|
|
3815
3913
|
maxHeight: maxHeight ? `${maxHeight}px` : void 0
|
|
3816
3914
|
};
|
|
3817
3915
|
}
|
|
3818
|
-
var Textarea =
|
|
3916
|
+
var Textarea = React32.forwardRef(
|
|
3819
3917
|
({ className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props }, forwarded) => {
|
|
3820
3918
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3821
3919
|
const stretchClasses = getStretchClasses(className);
|
|
@@ -3841,7 +3939,7 @@ var Textarea = React31.forwardRef(
|
|
|
3841
3939
|
}
|
|
3842
3940
|
);
|
|
3843
3941
|
Textarea.displayName = "Textarea";
|
|
3844
|
-
var BasicTextarea =
|
|
3942
|
+
var BasicTextarea = React32.forwardRef(
|
|
3845
3943
|
({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {
|
|
3846
3944
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3847
3945
|
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
@@ -3863,7 +3961,7 @@ var BasicTextarea = React31.forwardRef(
|
|
|
3863
3961
|
}
|
|
3864
3962
|
);
|
|
3865
3963
|
BasicTextarea.displayName = "BasicTextarea";
|
|
3866
|
-
var TextareaWithPrefix =
|
|
3964
|
+
var TextareaWithPrefix = React32.forwardRef(
|
|
3867
3965
|
({
|
|
3868
3966
|
prefix,
|
|
3869
3967
|
className,
|
|
@@ -3905,10 +4003,10 @@ var TextareaWithPrefix = React31.forwardRef(
|
|
|
3905
4003
|
TextareaWithPrefix.displayName = "TextareaWithPrefix";
|
|
3906
4004
|
|
|
3907
4005
|
// src/use-scroll-fade.ts
|
|
3908
|
-
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef5, useState as
|
|
4006
|
+
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef5, useState as useState8 } from "react";
|
|
3909
4007
|
var EPSILON = 2;
|
|
3910
4008
|
function useScrollFade() {
|
|
3911
|
-
const [state, setState] =
|
|
4009
|
+
const [state, setState] = useState8({
|
|
3912
4010
|
top: false,
|
|
3913
4011
|
bottom: false
|
|
3914
4012
|
});
|
|
@@ -3960,11 +4058,11 @@ function useScrollFade() {
|
|
|
3960
4058
|
|
|
3961
4059
|
// src/hover-card.tsx
|
|
3962
4060
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3963
|
-
import * as
|
|
4061
|
+
import * as React33 from "react";
|
|
3964
4062
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3965
4063
|
var HoverCard = HoverCardPrimitive.Root;
|
|
3966
4064
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
3967
|
-
var HoverCardContent =
|
|
4065
|
+
var HoverCardContent = React33.forwardRef(
|
|
3968
4066
|
({ className, align = "center", sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
3969
4067
|
const resolved = usePortalContainer(container);
|
|
3970
4068
|
return /* @__PURE__ */ jsx43(HoverCardPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx43(
|
|
@@ -3988,9 +4086,9 @@ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
|
3988
4086
|
|
|
3989
4087
|
// src/radio-group.tsx
|
|
3990
4088
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3991
|
-
import * as
|
|
4089
|
+
import * as React34 from "react";
|
|
3992
4090
|
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3993
|
-
var RadioGroupSizeContext =
|
|
4091
|
+
var RadioGroupSizeContext = React34.createContext("md");
|
|
3994
4092
|
var CONTROL_CLASSES = {
|
|
3995
4093
|
sm: "h-3.5 w-3.5",
|
|
3996
4094
|
md: "h-4 w-4",
|
|
@@ -4001,7 +4099,7 @@ var DOT_CLASSES = {
|
|
|
4001
4099
|
md: "h-1.5 w-1.5",
|
|
4002
4100
|
lg: "h-2 w-2"
|
|
4003
4101
|
};
|
|
4004
|
-
var RadioGroup3 =
|
|
4102
|
+
var RadioGroup3 = React34.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx44(RadioGroupSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx44(
|
|
4005
4103
|
RadioGroupPrimitive.Root,
|
|
4006
4104
|
{
|
|
4007
4105
|
ref,
|
|
@@ -4011,8 +4109,8 @@ var RadioGroup3 = React33.forwardRef(({ className, size = "md", ...props }, ref)
|
|
|
4011
4109
|
}
|
|
4012
4110
|
) }));
|
|
4013
4111
|
RadioGroup3.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4014
|
-
var RadioGroupItem =
|
|
4015
|
-
const groupSize =
|
|
4112
|
+
var RadioGroupItem = React34.forwardRef(({ className, size, ...props }, ref) => {
|
|
4113
|
+
const groupSize = React34.useContext(RadioGroupSizeContext);
|
|
4016
4114
|
const resolved = size ?? groupSize;
|
|
4017
4115
|
return /* @__PURE__ */ jsx44(
|
|
4018
4116
|
RadioGroupPrimitive.Item,
|
|
@@ -4100,7 +4198,7 @@ ResizableHandle.displayName = "ResizableHandle";
|
|
|
4100
4198
|
|
|
4101
4199
|
// src/slider.tsx
|
|
4102
4200
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4103
|
-
import * as
|
|
4201
|
+
import * as React35 from "react";
|
|
4104
4202
|
import { jsx as jsx46, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4105
4203
|
var TRACK_CLASSES = {
|
|
4106
4204
|
sm: "h-1",
|
|
@@ -4112,7 +4210,7 @@ var THUMB_CLASSES = {
|
|
|
4112
4210
|
md: "h-4 w-4",
|
|
4113
4211
|
lg: "h-5 w-5"
|
|
4114
4212
|
};
|
|
4115
|
-
var Slider =
|
|
4213
|
+
var Slider = React35.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
4116
4214
|
const thumbCount = Math.max(
|
|
4117
4215
|
1,
|
|
4118
4216
|
(props.value ?? props.defaultValue ?? [0]).length
|
|
@@ -4174,7 +4272,7 @@ Slider.displayName = SliderPrimitive.Root.displayName;
|
|
|
4174
4272
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4175
4273
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4176
4274
|
import { cva as cva6 } from "class-variance-authority";
|
|
4177
|
-
import * as
|
|
4275
|
+
import * as React36 from "react";
|
|
4178
4276
|
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4179
4277
|
var toggleVariants = cva6(
|
|
4180
4278
|
"inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -4196,7 +4294,7 @@ var toggleVariants = cva6(
|
|
|
4196
4294
|
}
|
|
4197
4295
|
}
|
|
4198
4296
|
);
|
|
4199
|
-
var Toggle =
|
|
4297
|
+
var Toggle = React36.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4200
4298
|
TogglePrimitive.Root,
|
|
4201
4299
|
{
|
|
4202
4300
|
ref,
|
|
@@ -4206,8 +4304,8 @@ var Toggle = React35.forwardRef(({ className, variant, size, ...props }, ref) =>
|
|
|
4206
4304
|
}
|
|
4207
4305
|
));
|
|
4208
4306
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
4209
|
-
var ToggleGroupContext =
|
|
4210
|
-
var ToggleGroup =
|
|
4307
|
+
var ToggleGroupContext = React36.createContext({ size: "default", variant: "default" });
|
|
4308
|
+
var ToggleGroup = React36.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4211
4309
|
ToggleGroupPrimitive.Root,
|
|
4212
4310
|
{
|
|
4213
4311
|
ref,
|
|
@@ -4218,8 +4316,8 @@ var ToggleGroup = React35.forwardRef(({ className, variant, size, children, ...p
|
|
|
4218
4316
|
}
|
|
4219
4317
|
));
|
|
4220
4318
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
4221
|
-
var ToggleGroupItem =
|
|
4222
|
-
const context =
|
|
4319
|
+
var ToggleGroupItem = React36.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
4320
|
+
const context = React36.useContext(ToggleGroupContext);
|
|
4223
4321
|
return /* @__PURE__ */ jsx47(
|
|
4224
4322
|
ToggleGroupPrimitive.Item,
|
|
4225
4323
|
{
|
|
@@ -4241,12 +4339,12 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
|
4241
4339
|
|
|
4242
4340
|
// src/tooltip.tsx
|
|
4243
4341
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4244
|
-
import * as
|
|
4342
|
+
import * as React37 from "react";
|
|
4245
4343
|
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4246
4344
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4247
4345
|
var Tooltip = TooltipPrimitive.Root;
|
|
4248
4346
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
4249
|
-
var TooltipContent =
|
|
4347
|
+
var TooltipContent = React37.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
4250
4348
|
const resolved = usePortalContainer(container);
|
|
4251
4349
|
return /* @__PURE__ */ jsx48(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx48(
|
|
4252
4350
|
TooltipPrimitive.Content,
|