@ai-matrx/design-system 0.30.0 → 0.32.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 +38 -0
- package/dist/data-table/index.cjs +1 -1
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +1 -1
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/spreadsheet.cjs +1 -1
- package/dist/data-table/spreadsheet.cjs.map +1 -1
- package/dist/data-table/spreadsheet.d.cts +11 -0
- package/dist/data-table/spreadsheet.d.ts +11 -0
- package/dist/data-table/spreadsheet.js +1 -1
- package/dist/data-table/spreadsheet.js.map +1 -1
- package/dist/index.cjs +162 -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 +167 -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,62 @@ 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
|
+
/* @__PURE__ */ jsx38(
|
|
3527
|
+
"p",
|
|
3438
3528
|
{
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
"aria-pressed": isActive,
|
|
3443
|
-
onClick: (event) => {
|
|
3444
|
-
event.stopPropagation();
|
|
3445
|
-
onSelect(org);
|
|
3446
|
-
},
|
|
3447
|
-
className: cn(
|
|
3448
|
-
"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",
|
|
3449
|
-
isActive && "bg-primary/10 font-medium text-primary",
|
|
3450
|
-
itemClassName
|
|
3451
|
-
),
|
|
3452
|
-
children: [
|
|
3453
|
-
/* @__PURE__ */ jsx38(
|
|
3454
|
-
OrganizationAbbreviation,
|
|
3455
|
-
{
|
|
3456
|
-
abbreviation: org.abbreviation,
|
|
3457
|
-
name: org.name,
|
|
3458
|
-
className: cn(
|
|
3459
|
-
"h-5 min-w-8 rounded border border-border bg-muted px-1 text-[9px]",
|
|
3460
|
-
isActive ? "text-primary" : "text-muted-foreground"
|
|
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
|
-
]
|
|
3529
|
+
className: "px-2 py-2 text-xs text-muted-foreground",
|
|
3530
|
+
"data-slot": "organization-picker-only-fixtures",
|
|
3531
|
+
children: query.trim() ? `Nothing matches \u201C${query.trim()}\u201D outside the test organizations below.` : `Every organization you belong to is a test organization \u2014 all ${fixtures.length} are below.`
|
|
3480
3532
|
}
|
|
3481
|
-
)
|
|
3482
|
-
|
|
3533
|
+
)
|
|
3534
|
+
) : /* @__PURE__ */ jsx38("ul", { className: "max-h-72 overflow-y-auto", role: "listbox", "aria-label": "Organizations", children: listed.map(renderRow) }),
|
|
3535
|
+
/* @__PURE__ */ jsx38(
|
|
3536
|
+
ArchivedDisclosure,
|
|
3537
|
+
{
|
|
3538
|
+
count: fixtures.length,
|
|
3539
|
+
open: showFixtures,
|
|
3540
|
+
onOpenChange: setShowFixtures,
|
|
3541
|
+
label: "Test organizations",
|
|
3542
|
+
className: "mt-0.5",
|
|
3543
|
+
children: /* @__PURE__ */ jsx38(
|
|
3544
|
+
"ul",
|
|
3545
|
+
{
|
|
3546
|
+
className: "max-h-72 overflow-y-auto",
|
|
3547
|
+
role: "listbox",
|
|
3548
|
+
"aria-label": "Test organizations",
|
|
3549
|
+
children: fixtures.map(renderRow)
|
|
3550
|
+
}
|
|
3551
|
+
)
|
|
3552
|
+
}
|
|
3553
|
+
),
|
|
3483
3554
|
onSetDefault && /* @__PURE__ */ jsxs21(Fragment2, { children: [
|
|
3484
3555
|
/* @__PURE__ */ jsx38("div", { className: "my-1 border-t border-border" }),
|
|
3485
3556
|
/* @__PURE__ */ jsx38(
|
|
@@ -3525,7 +3596,7 @@ function DefaultOrganizationSwitch({
|
|
|
3525
3596
|
}
|
|
3526
3597
|
|
|
3527
3598
|
// src/tabbed-bottom-sheet.tsx
|
|
3528
|
-
import { useState as
|
|
3599
|
+
import { useState as useState7 } from "react";
|
|
3529
3600
|
import { jsx as jsx39, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3530
3601
|
function TabbedBottomSheet({
|
|
3531
3602
|
open,
|
|
@@ -3534,8 +3605,8 @@ function TabbedBottomSheet({
|
|
|
3534
3605
|
tabs,
|
|
3535
3606
|
initialTabId = null
|
|
3536
3607
|
}) {
|
|
3537
|
-
const [selectedTabId, setSelectedTabId] =
|
|
3538
|
-
const [wasOpen, setWasOpen] =
|
|
3608
|
+
const [selectedTabId, setSelectedTabId] = useState7(initialTabId);
|
|
3609
|
+
const [wasOpen, setWasOpen] = useState7(open);
|
|
3539
3610
|
if (open !== wasOpen) {
|
|
3540
3611
|
setWasOpen(open);
|
|
3541
3612
|
if (open) setSelectedTabId(initialTabId);
|
|
@@ -3580,17 +3651,17 @@ function TabbedBottomSheet({
|
|
|
3580
3651
|
}
|
|
3581
3652
|
|
|
3582
3653
|
// src/table.tsx
|
|
3583
|
-
import * as
|
|
3654
|
+
import * as React30 from "react";
|
|
3584
3655
|
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3585
3656
|
var TABLE_SIZES = {
|
|
3586
3657
|
sm: { head: "px-2", cell: "p-2" },
|
|
3587
3658
|
md: { head: "px-3", cell: "p-3" }
|
|
3588
3659
|
};
|
|
3589
|
-
var TableSizeContext =
|
|
3660
|
+
var TableSizeContext = React30.createContext("md");
|
|
3590
3661
|
function useTableSize() {
|
|
3591
|
-
return
|
|
3662
|
+
return React30.useContext(TableSizeContext);
|
|
3592
3663
|
}
|
|
3593
|
-
var Table =
|
|
3664
|
+
var Table = React30.forwardRef(
|
|
3594
3665
|
({ className, size = "md", wrap = true, wrapperClassName, ...props }, ref) => {
|
|
3595
3666
|
const table = /* @__PURE__ */ jsx40(
|
|
3596
3667
|
"table",
|
|
@@ -3613,7 +3684,7 @@ var Table = React29.forwardRef(
|
|
|
3613
3684
|
}
|
|
3614
3685
|
);
|
|
3615
3686
|
Table.displayName = "Table";
|
|
3616
|
-
var TableHeader =
|
|
3687
|
+
var TableHeader = React30.forwardRef(({ className, sticky = false, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3617
3688
|
"thead",
|
|
3618
3689
|
{
|
|
3619
3690
|
ref,
|
|
@@ -3627,7 +3698,7 @@ var TableHeader = React29.forwardRef(({ className, sticky = false, ...props }, r
|
|
|
3627
3698
|
}
|
|
3628
3699
|
));
|
|
3629
3700
|
TableHeader.displayName = "TableHeader";
|
|
3630
|
-
var TableBody =
|
|
3701
|
+
var TableBody = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3631
3702
|
"tbody",
|
|
3632
3703
|
{
|
|
3633
3704
|
ref,
|
|
@@ -3637,7 +3708,7 @@ var TableBody = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3637
3708
|
}
|
|
3638
3709
|
));
|
|
3639
3710
|
TableBody.displayName = "TableBody";
|
|
3640
|
-
var TableFooter =
|
|
3711
|
+
var TableFooter = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3641
3712
|
"tfoot",
|
|
3642
3713
|
{
|
|
3643
3714
|
ref,
|
|
@@ -3650,7 +3721,7 @@ var TableFooter = React29.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3650
3721
|
}
|
|
3651
3722
|
));
|
|
3652
3723
|
TableFooter.displayName = "TableFooter";
|
|
3653
|
-
var TableRow =
|
|
3724
|
+
var TableRow = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3654
3725
|
"tr",
|
|
3655
3726
|
{
|
|
3656
3727
|
ref,
|
|
@@ -3663,7 +3734,7 @@ var TableRow = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3663
3734
|
}
|
|
3664
3735
|
));
|
|
3665
3736
|
TableRow.displayName = "TableRow";
|
|
3666
|
-
var TableHead =
|
|
3737
|
+
var TableHead = React30.forwardRef(({ className, ...props }, ref) => {
|
|
3667
3738
|
const size = useTableSize();
|
|
3668
3739
|
return /* @__PURE__ */ jsx40(
|
|
3669
3740
|
"th",
|
|
@@ -3680,7 +3751,7 @@ var TableHead = React29.forwardRef(({ className, ...props }, ref) => {
|
|
|
3680
3751
|
);
|
|
3681
3752
|
});
|
|
3682
3753
|
TableHead.displayName = "TableHead";
|
|
3683
|
-
var TableCell =
|
|
3754
|
+
var TableCell = React30.forwardRef(({ className, ...props }, ref) => {
|
|
3684
3755
|
const size = useTableSize();
|
|
3685
3756
|
return /* @__PURE__ */ jsx40(
|
|
3686
3757
|
"td",
|
|
@@ -3697,7 +3768,7 @@ var TableCell = React29.forwardRef(({ className, ...props }, ref) => {
|
|
|
3697
3768
|
);
|
|
3698
3769
|
});
|
|
3699
3770
|
TableCell.displayName = "TableCell";
|
|
3700
|
-
var TableCaption =
|
|
3771
|
+
var TableCaption = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3701
3772
|
"caption",
|
|
3702
3773
|
{
|
|
3703
3774
|
ref,
|
|
@@ -3710,11 +3781,11 @@ TableCaption.displayName = "TableCaption";
|
|
|
3710
3781
|
|
|
3711
3782
|
// src/tabs.tsx
|
|
3712
3783
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3713
|
-
import * as
|
|
3784
|
+
import * as React31 from "react";
|
|
3714
3785
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3715
3786
|
var Tabs = TabsPrimitive.Root;
|
|
3716
3787
|
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 =
|
|
3788
|
+
var TabsList = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3718
3789
|
TabsPrimitive.List,
|
|
3719
3790
|
{
|
|
3720
3791
|
ref,
|
|
@@ -3727,7 +3798,7 @@ var TabsList = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3727
3798
|
}
|
|
3728
3799
|
));
|
|
3729
3800
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
3730
|
-
var TabsTrigger =
|
|
3801
|
+
var TabsTrigger = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3731
3802
|
TabsPrimitive.Trigger,
|
|
3732
3803
|
{
|
|
3733
3804
|
ref,
|
|
@@ -3741,7 +3812,7 @@ var TabsTrigger = React30.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3741
3812
|
}
|
|
3742
3813
|
));
|
|
3743
3814
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
3744
|
-
var TabsTriggerCore =
|
|
3815
|
+
var TabsTriggerCore = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3745
3816
|
TabsPrimitive.Trigger,
|
|
3746
3817
|
{
|
|
3747
3818
|
ref,
|
|
@@ -3751,7 +3822,7 @@ var TabsTriggerCore = React30.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3751
3822
|
}
|
|
3752
3823
|
));
|
|
3753
3824
|
TabsTriggerCore.displayName = TabsPrimitive.Trigger.displayName;
|
|
3754
|
-
var TabsContent =
|
|
3825
|
+
var TabsContent = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx41(
|
|
3755
3826
|
TabsPrimitive.Content,
|
|
3756
3827
|
{
|
|
3757
3828
|
ref,
|
|
@@ -3767,7 +3838,7 @@ var TabsContent = React30.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3767
3838
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
3768
3839
|
|
|
3769
3840
|
// src/textarea.tsx
|
|
3770
|
-
import * as
|
|
3841
|
+
import * as React32 from "react";
|
|
3771
3842
|
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3772
3843
|
var FILL_HEIGHT_REGEX = /(?:^|\s)(h-full|h-dvh|flex-1|grow)(?:\s|$)/;
|
|
3773
3844
|
var FILL_WIDTH_REGEX = /(?:^|\s)(w-full|w-screen)(?:\s|$)/;
|
|
@@ -3781,7 +3852,7 @@ function getStretchClasses(className) {
|
|
|
3781
3852
|
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
3853
|
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
3854
|
function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
3784
|
-
|
|
3855
|
+
React32.useEffect(() => {
|
|
3785
3856
|
if (!autoGrow || !ref.current) return;
|
|
3786
3857
|
const textarea = ref.current;
|
|
3787
3858
|
textarea.style.height = "auto";
|
|
@@ -3797,8 +3868,8 @@ function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
|
3797
3868
|
}, [value, autoGrow, minHeight, maxHeight, ref]);
|
|
3798
3869
|
}
|
|
3799
3870
|
function useMergedTextareaRef(forwarded) {
|
|
3800
|
-
const internal =
|
|
3801
|
-
const callback =
|
|
3871
|
+
const internal = React32.useRef(null);
|
|
3872
|
+
const callback = React32.useCallback(
|
|
3802
3873
|
(node) => {
|
|
3803
3874
|
internal.current = node;
|
|
3804
3875
|
if (typeof forwarded === "function") forwarded(node);
|
|
@@ -3815,7 +3886,7 @@ function boxStyle(minHeight, maxHeight) {
|
|
|
3815
3886
|
maxHeight: maxHeight ? `${maxHeight}px` : void 0
|
|
3816
3887
|
};
|
|
3817
3888
|
}
|
|
3818
|
-
var Textarea =
|
|
3889
|
+
var Textarea = React32.forwardRef(
|
|
3819
3890
|
({ className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props }, forwarded) => {
|
|
3820
3891
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3821
3892
|
const stretchClasses = getStretchClasses(className);
|
|
@@ -3841,7 +3912,7 @@ var Textarea = React31.forwardRef(
|
|
|
3841
3912
|
}
|
|
3842
3913
|
);
|
|
3843
3914
|
Textarea.displayName = "Textarea";
|
|
3844
|
-
var BasicTextarea =
|
|
3915
|
+
var BasicTextarea = React32.forwardRef(
|
|
3845
3916
|
({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {
|
|
3846
3917
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3847
3918
|
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
@@ -3863,7 +3934,7 @@ var BasicTextarea = React31.forwardRef(
|
|
|
3863
3934
|
}
|
|
3864
3935
|
);
|
|
3865
3936
|
BasicTextarea.displayName = "BasicTextarea";
|
|
3866
|
-
var TextareaWithPrefix =
|
|
3937
|
+
var TextareaWithPrefix = React32.forwardRef(
|
|
3867
3938
|
({
|
|
3868
3939
|
prefix,
|
|
3869
3940
|
className,
|
|
@@ -3905,10 +3976,10 @@ var TextareaWithPrefix = React31.forwardRef(
|
|
|
3905
3976
|
TextareaWithPrefix.displayName = "TextareaWithPrefix";
|
|
3906
3977
|
|
|
3907
3978
|
// src/use-scroll-fade.ts
|
|
3908
|
-
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef5, useState as
|
|
3979
|
+
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef5, useState as useState8 } from "react";
|
|
3909
3980
|
var EPSILON = 2;
|
|
3910
3981
|
function useScrollFade() {
|
|
3911
|
-
const [state, setState] =
|
|
3982
|
+
const [state, setState] = useState8({
|
|
3912
3983
|
top: false,
|
|
3913
3984
|
bottom: false
|
|
3914
3985
|
});
|
|
@@ -3960,11 +4031,11 @@ function useScrollFade() {
|
|
|
3960
4031
|
|
|
3961
4032
|
// src/hover-card.tsx
|
|
3962
4033
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3963
|
-
import * as
|
|
4034
|
+
import * as React33 from "react";
|
|
3964
4035
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3965
4036
|
var HoverCard = HoverCardPrimitive.Root;
|
|
3966
4037
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
3967
|
-
var HoverCardContent =
|
|
4038
|
+
var HoverCardContent = React33.forwardRef(
|
|
3968
4039
|
({ className, align = "center", sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
3969
4040
|
const resolved = usePortalContainer(container);
|
|
3970
4041
|
return /* @__PURE__ */ jsx43(HoverCardPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx43(
|
|
@@ -3988,9 +4059,9 @@ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
|
3988
4059
|
|
|
3989
4060
|
// src/radio-group.tsx
|
|
3990
4061
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3991
|
-
import * as
|
|
4062
|
+
import * as React34 from "react";
|
|
3992
4063
|
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3993
|
-
var RadioGroupSizeContext =
|
|
4064
|
+
var RadioGroupSizeContext = React34.createContext("md");
|
|
3994
4065
|
var CONTROL_CLASSES = {
|
|
3995
4066
|
sm: "h-3.5 w-3.5",
|
|
3996
4067
|
md: "h-4 w-4",
|
|
@@ -4001,7 +4072,7 @@ var DOT_CLASSES = {
|
|
|
4001
4072
|
md: "h-1.5 w-1.5",
|
|
4002
4073
|
lg: "h-2 w-2"
|
|
4003
4074
|
};
|
|
4004
|
-
var RadioGroup3 =
|
|
4075
|
+
var RadioGroup3 = React34.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx44(RadioGroupSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx44(
|
|
4005
4076
|
RadioGroupPrimitive.Root,
|
|
4006
4077
|
{
|
|
4007
4078
|
ref,
|
|
@@ -4011,8 +4082,8 @@ var RadioGroup3 = React33.forwardRef(({ className, size = "md", ...props }, ref)
|
|
|
4011
4082
|
}
|
|
4012
4083
|
) }));
|
|
4013
4084
|
RadioGroup3.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4014
|
-
var RadioGroupItem =
|
|
4015
|
-
const groupSize =
|
|
4085
|
+
var RadioGroupItem = React34.forwardRef(({ className, size, ...props }, ref) => {
|
|
4086
|
+
const groupSize = React34.useContext(RadioGroupSizeContext);
|
|
4016
4087
|
const resolved = size ?? groupSize;
|
|
4017
4088
|
return /* @__PURE__ */ jsx44(
|
|
4018
4089
|
RadioGroupPrimitive.Item,
|
|
@@ -4100,7 +4171,7 @@ ResizableHandle.displayName = "ResizableHandle";
|
|
|
4100
4171
|
|
|
4101
4172
|
// src/slider.tsx
|
|
4102
4173
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4103
|
-
import * as
|
|
4174
|
+
import * as React35 from "react";
|
|
4104
4175
|
import { jsx as jsx46, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4105
4176
|
var TRACK_CLASSES = {
|
|
4106
4177
|
sm: "h-1",
|
|
@@ -4112,7 +4183,7 @@ var THUMB_CLASSES = {
|
|
|
4112
4183
|
md: "h-4 w-4",
|
|
4113
4184
|
lg: "h-5 w-5"
|
|
4114
4185
|
};
|
|
4115
|
-
var Slider =
|
|
4186
|
+
var Slider = React35.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
4116
4187
|
const thumbCount = Math.max(
|
|
4117
4188
|
1,
|
|
4118
4189
|
(props.value ?? props.defaultValue ?? [0]).length
|
|
@@ -4174,7 +4245,7 @@ Slider.displayName = SliderPrimitive.Root.displayName;
|
|
|
4174
4245
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4175
4246
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4176
4247
|
import { cva as cva6 } from "class-variance-authority";
|
|
4177
|
-
import * as
|
|
4248
|
+
import * as React36 from "react";
|
|
4178
4249
|
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4179
4250
|
var toggleVariants = cva6(
|
|
4180
4251
|
"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 +4267,7 @@ var toggleVariants = cva6(
|
|
|
4196
4267
|
}
|
|
4197
4268
|
}
|
|
4198
4269
|
);
|
|
4199
|
-
var Toggle =
|
|
4270
|
+
var Toggle = React36.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4200
4271
|
TogglePrimitive.Root,
|
|
4201
4272
|
{
|
|
4202
4273
|
ref,
|
|
@@ -4206,8 +4277,8 @@ var Toggle = React35.forwardRef(({ className, variant, size, ...props }, ref) =>
|
|
|
4206
4277
|
}
|
|
4207
4278
|
));
|
|
4208
4279
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
4209
|
-
var ToggleGroupContext =
|
|
4210
|
-
var ToggleGroup =
|
|
4280
|
+
var ToggleGroupContext = React36.createContext({ size: "default", variant: "default" });
|
|
4281
|
+
var ToggleGroup = React36.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4211
4282
|
ToggleGroupPrimitive.Root,
|
|
4212
4283
|
{
|
|
4213
4284
|
ref,
|
|
@@ -4218,8 +4289,8 @@ var ToggleGroup = React35.forwardRef(({ className, variant, size, children, ...p
|
|
|
4218
4289
|
}
|
|
4219
4290
|
));
|
|
4220
4291
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
4221
|
-
var ToggleGroupItem =
|
|
4222
|
-
const context =
|
|
4292
|
+
var ToggleGroupItem = React36.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
4293
|
+
const context = React36.useContext(ToggleGroupContext);
|
|
4223
4294
|
return /* @__PURE__ */ jsx47(
|
|
4224
4295
|
ToggleGroupPrimitive.Item,
|
|
4225
4296
|
{
|
|
@@ -4241,12 +4312,12 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
|
4241
4312
|
|
|
4242
4313
|
// src/tooltip.tsx
|
|
4243
4314
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4244
|
-
import * as
|
|
4315
|
+
import * as React37 from "react";
|
|
4245
4316
|
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4246
4317
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4247
4318
|
var Tooltip = TooltipPrimitive.Root;
|
|
4248
4319
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
4249
|
-
var TooltipContent =
|
|
4320
|
+
var TooltipContent = React37.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
4250
4321
|
const resolved = usePortalContainer(container);
|
|
4251
4322
|
return /* @__PURE__ */ jsx48(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx48(
|
|
4252
4323
|
TooltipPrimitive.Content,
|