@ai-matrx/design-system 0.49.59 → 0.50.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 +5 -0
- package/dist/index.cjs +170 -171
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -46
- package/dist/index.d.ts +33 -46
- package/dist/index.js +165 -166
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3644,7 +3644,7 @@ var SheetTitle = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3644
3644
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
3645
3645
|
|
|
3646
3646
|
// src/organization-picker.tsx
|
|
3647
|
-
import * as
|
|
3647
|
+
import * as React30 from "react";
|
|
3648
3648
|
|
|
3649
3649
|
// src/skeleton.tsx
|
|
3650
3650
|
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
@@ -3663,47 +3663,8 @@ function Skeleton({ className, animated = true, ...props }) {
|
|
|
3663
3663
|
);
|
|
3664
3664
|
}
|
|
3665
3665
|
|
|
3666
|
-
// src/switch.tsx
|
|
3667
|
-
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3668
|
-
import * as React30 from "react";
|
|
3669
|
-
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3670
|
-
var SWITCH_SIZES = {
|
|
3671
|
-
sm: {
|
|
3672
|
-
root: "h-4 w-9 border-border data-[state=unchecked]:bg-input",
|
|
3673
|
-
thumb: "h-4 w-4 border border-primary data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
3674
|
-
},
|
|
3675
|
-
md: {
|
|
3676
|
-
root: "h-5 w-9 border-transparent data-[state=unchecked]:bg-input",
|
|
3677
|
-
thumb: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
3678
|
-
}
|
|
3679
|
-
};
|
|
3680
|
-
var Switch = React30.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
3681
|
-
SwitchPrimitives.Root,
|
|
3682
|
-
{
|
|
3683
|
-
ref,
|
|
3684
|
-
"data-slot": "switch",
|
|
3685
|
-
className: cn(
|
|
3686
|
-
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary",
|
|
3687
|
-
SWITCH_SIZES[size].root,
|
|
3688
|
-
className
|
|
3689
|
-
),
|
|
3690
|
-
...props,
|
|
3691
|
-
children: /* @__PURE__ */ jsx39(
|
|
3692
|
-
SwitchPrimitives.Thumb,
|
|
3693
|
-
{
|
|
3694
|
-
"data-slot": "switch-thumb",
|
|
3695
|
-
className: cn(
|
|
3696
|
-
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
3697
|
-
SWITCH_SIZES[size].thumb
|
|
3698
|
-
)
|
|
3699
|
-
}
|
|
3700
|
-
)
|
|
3701
|
-
}
|
|
3702
|
-
));
|
|
3703
|
-
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
3704
|
-
|
|
3705
3666
|
// src/organization-picker.tsx
|
|
3706
|
-
import { Fragment as Fragment3, jsx as
|
|
3667
|
+
import { Fragment as Fragment3, jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3707
3668
|
var SEARCH_APPEARS_ABOVE = 8;
|
|
3708
3669
|
function matchesQuery(org, query) {
|
|
3709
3670
|
const q = query.trim().toLowerCase();
|
|
@@ -3712,45 +3673,71 @@ function matchesQuery(org, query) {
|
|
|
3712
3673
|
const abbreviation = org.abbreviation?.trim().toLowerCase();
|
|
3713
3674
|
return !!abbreviation && abbreviation.includes(q);
|
|
3714
3675
|
}
|
|
3715
|
-
|
|
3716
|
-
|
|
3676
|
+
var ORGANIZATION_HUES = [217, 262, 330, 12, 32, 152, 189, 290];
|
|
3677
|
+
function organizationColor(seed) {
|
|
3678
|
+
let hash = 0;
|
|
3679
|
+
for (let index = 0; index < seed.length; index += 1) {
|
|
3680
|
+
hash = hash * 31 + seed.charCodeAt(index) >>> 0;
|
|
3681
|
+
}
|
|
3682
|
+
const hue = ORGANIZATION_HUES[hash % ORGANIZATION_HUES.length];
|
|
3683
|
+
return { background: `hsl(${hue} 62% 46%)`, color: "#fff" };
|
|
3684
|
+
}
|
|
3685
|
+
function OrganizationMark({
|
|
3686
|
+
id,
|
|
3717
3687
|
name,
|
|
3688
|
+
abbreviation,
|
|
3689
|
+
logoUrl,
|
|
3690
|
+
size = 20,
|
|
3718
3691
|
className
|
|
3719
3692
|
}) {
|
|
3720
|
-
const
|
|
3721
|
-
|
|
3693
|
+
const box = { width: size, height: size };
|
|
3694
|
+
if (logoUrl) {
|
|
3695
|
+
return /* @__PURE__ */ jsx39(
|
|
3696
|
+
"span",
|
|
3697
|
+
{
|
|
3698
|
+
style: box,
|
|
3699
|
+
className: cn("relative inline-flex shrink-0 overflow-hidden rounded-md bg-muted", className),
|
|
3700
|
+
"data-slot": "organization-mark",
|
|
3701
|
+
children: /* @__PURE__ */ jsx39("img", { src: logoUrl, alt: name, className: "h-full w-full object-cover" })
|
|
3702
|
+
}
|
|
3703
|
+
);
|
|
3704
|
+
}
|
|
3705
|
+
const letters = (abbreviation && abbreviation.trim() || name.trim().slice(0, 1) || "?").slice(0, 3).toUpperCase();
|
|
3706
|
+
const fontSize = Math.round(size * (letters.length >= 3 ? 0.36 : 0.44));
|
|
3707
|
+
return /* @__PURE__ */ jsx39(
|
|
3722
3708
|
"span",
|
|
3723
3709
|
{
|
|
3710
|
+
style: { ...box, ...organizationColor(id || name), fontSize },
|
|
3724
3711
|
className: cn(
|
|
3725
|
-
"inline-flex shrink-0 items-center justify-center font-bold
|
|
3712
|
+
"inline-flex shrink-0 items-center justify-center rounded-md font-bold leading-none tracking-tight",
|
|
3726
3713
|
className
|
|
3727
3714
|
),
|
|
3728
|
-
"aria-label": `Organization abbreviation ${
|
|
3729
|
-
title:
|
|
3730
|
-
|
|
3715
|
+
"aria-label": `Organization abbreviation ${letters}`,
|
|
3716
|
+
title: letters,
|
|
3717
|
+
"data-slot": "organization-mark",
|
|
3718
|
+
children: letters
|
|
3731
3719
|
}
|
|
3732
3720
|
);
|
|
3733
3721
|
}
|
|
3734
3722
|
function OrganizationPicker({
|
|
3735
3723
|
organizations,
|
|
3736
3724
|
activeOrganizationId,
|
|
3737
|
-
|
|
3725
|
+
favoriteOrganizationIds = [],
|
|
3738
3726
|
loading = false,
|
|
3739
3727
|
loadFailed = false,
|
|
3740
3728
|
onSelect,
|
|
3741
|
-
|
|
3729
|
+
onToggleFavorite,
|
|
3742
3730
|
hideHeading = false,
|
|
3743
3731
|
itemClassName,
|
|
3744
|
-
hideStatus = false,
|
|
3745
3732
|
foldedLabel = "More",
|
|
3746
3733
|
className
|
|
3747
3734
|
}) {
|
|
3748
|
-
const [query, setQuery] =
|
|
3749
|
-
const [showFixtures, setShowFixtures] =
|
|
3750
|
-
const [showFolded, setShowFolded] =
|
|
3751
|
-
const
|
|
3752
|
-
const
|
|
3753
|
-
const rank = (org) => org.id
|
|
3735
|
+
const [query, setQuery] = React30.useState("");
|
|
3736
|
+
const [showFixtures, setShowFixtures] = React30.useState(false);
|
|
3737
|
+
const [showFolded, setShowFolded] = React30.useState(false);
|
|
3738
|
+
const favorites = new Set(favoriteOrganizationIds);
|
|
3739
|
+
const isFavorite = (id) => favorites.has(id);
|
|
3740
|
+
const rank = (org) => isFavorite(org.id) ? 0 : org.isOwn ? 1 : 2;
|
|
3754
3741
|
const ordered = [...organizations].sort((a, b) => rank(a) - rank(b));
|
|
3755
3742
|
const matching = ordered.filter((org) => matchesQuery(org, query));
|
|
3756
3743
|
const listed = matching.filter((org) => !org.isTestFixture && !org.folded);
|
|
@@ -3761,66 +3748,83 @@ function OrganizationPicker({
|
|
|
3761
3748
|
const sharesItsName = (org) => organizations.filter((other) => other.name.trim() === org.name.trim()).length > 1;
|
|
3762
3749
|
const renderRow = (org) => {
|
|
3763
3750
|
const isActive = org.id === activeOrganizationId;
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
/* @__PURE__ */ jsx40(
|
|
3782
|
-
OrganizationAbbreviation,
|
|
3783
|
-
{
|
|
3784
|
-
abbreviation: org.abbreviation,
|
|
3785
|
-
name: org.name,
|
|
3786
|
-
className: cn(
|
|
3787
|
-
"h-5 min-w-8 rounded border border-border bg-muted px-1 text-[9px]",
|
|
3788
|
-
isActive ? "text-primary" : "text-muted-foreground"
|
|
3789
|
-
)
|
|
3790
|
-
}
|
|
3751
|
+
const favorite = isFavorite(org.id);
|
|
3752
|
+
return /* @__PURE__ */ jsxs23("li", { role: "none", className: "group/org relative flex items-center", children: [
|
|
3753
|
+
/* @__PURE__ */ jsxs23(
|
|
3754
|
+
"button",
|
|
3755
|
+
{
|
|
3756
|
+
type: "button",
|
|
3757
|
+
role: "option",
|
|
3758
|
+
"aria-selected": isActive,
|
|
3759
|
+
"aria-pressed": isActive,
|
|
3760
|
+
onClick: (event) => {
|
|
3761
|
+
event.stopPropagation();
|
|
3762
|
+
onSelect(org);
|
|
3763
|
+
},
|
|
3764
|
+
className: cn(
|
|
3765
|
+
"flex w-full min-w-0 items-center gap-2.5 rounded-md py-1.5 pl-2 pr-8 text-left text-sm text-foreground transition-colors hover:bg-accent",
|
|
3766
|
+
isActive && "bg-primary/10 font-semibold text-primary ring-1 ring-inset ring-primary/30 hover:bg-primary/15",
|
|
3767
|
+
itemClassName
|
|
3791
3768
|
),
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
"
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3769
|
+
"data-active": isActive ? "" : void 0,
|
|
3770
|
+
children: [
|
|
3771
|
+
/* @__PURE__ */ jsx39(OrganizationMark, { id: org.id, name: org.name, abbreviation: org.abbreviation, size: 20 }),
|
|
3772
|
+
/* @__PURE__ */ jsxs23("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
3773
|
+
/* @__PURE__ */ jsx39("span", { className: "truncate", children: org.name }),
|
|
3774
|
+
sharesItsName(org) && org.distinguisher ? /* @__PURE__ */ jsx39("span", { className: "truncate text-[10px] font-normal text-muted-foreground", children: org.distinguisher }) : null
|
|
3775
|
+
] }),
|
|
3776
|
+
org.detail ? /* @__PURE__ */ jsx39(
|
|
3777
|
+
"span",
|
|
3778
|
+
{
|
|
3779
|
+
className: "shrink-0 text-xs font-normal text-muted-foreground",
|
|
3780
|
+
"data-slot": "organization-picker-detail",
|
|
3781
|
+
children: org.detail
|
|
3782
|
+
}
|
|
3783
|
+
) : null,
|
|
3784
|
+
isActive && /* @__PURE__ */ jsx39(LucideCheckIcon, { className: "h-[15px] w-[15px] shrink-0 text-primary" })
|
|
3785
|
+
]
|
|
3786
|
+
}
|
|
3787
|
+
),
|
|
3788
|
+
onToggleFavorite ? /* @__PURE__ */ jsx39(
|
|
3789
|
+
"button",
|
|
3790
|
+
{
|
|
3791
|
+
type: "button",
|
|
3792
|
+
"aria-pressed": favorite,
|
|
3793
|
+
"aria-label": favorite ? `Remove ${org.name} from favorites` : `Add ${org.name} to favorites`,
|
|
3794
|
+
title: favorite ? "Remove from favorites" : "Add to favorites",
|
|
3795
|
+
onClick: (event) => {
|
|
3796
|
+
event.stopPropagation();
|
|
3797
|
+
onToggleFavorite(org.id, !favorite);
|
|
3798
|
+
},
|
|
3799
|
+
className: cn(
|
|
3800
|
+
"absolute right-1 flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100",
|
|
3801
|
+
favorite ? "opacity-100" : "opacity-0 group-hover/org:opacity-100"
|
|
3802
|
+
),
|
|
3803
|
+
"data-slot": "organization-picker-favorite",
|
|
3804
|
+
children: /* @__PURE__ */ jsx39(
|
|
3805
3805
|
StarIcon,
|
|
3806
3806
|
{
|
|
3807
|
-
className: "h-[
|
|
3808
|
-
"aria-hidden": false,
|
|
3809
|
-
"aria-label": "Default organization",
|
|
3810
|
-
role: "img"
|
|
3807
|
+
className: cn("h-[14px] w-[14px]", favorite && "fill-warning text-warning")
|
|
3811
3808
|
}
|
|
3812
|
-
)
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3809
|
+
)
|
|
3810
|
+
}
|
|
3811
|
+
) : favorite ? /* @__PURE__ */ jsx39(
|
|
3812
|
+
StarIcon,
|
|
3813
|
+
{
|
|
3814
|
+
className: "absolute right-2 h-[13px] w-[13px] fill-warning text-warning",
|
|
3815
|
+
"aria-hidden": false,
|
|
3816
|
+
"aria-label": "Favorite",
|
|
3817
|
+
role: "img"
|
|
3818
|
+
}
|
|
3819
|
+
) : null
|
|
3820
|
+
] }, org.id);
|
|
3817
3821
|
};
|
|
3818
3822
|
return /* @__PURE__ */ jsxs23("div", { className: cn("flex flex-col", className), "data-slot": "organization-picker", children: [
|
|
3819
|
-
!hideHeading && /* @__PURE__ */
|
|
3823
|
+
!hideHeading && /* @__PURE__ */ jsx39("p", { className: "px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: "Organization" }),
|
|
3820
3824
|
loading ? /* @__PURE__ */ jsxs23("div", { className: "space-y-1 px-1 py-1", "aria-busy": "true", "aria-label": "Loading organizations", children: [
|
|
3821
|
-
/* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
3823
|
-
] }) : loadFailed ? /* @__PURE__ */
|
|
3825
|
+
/* @__PURE__ */ jsx39(Skeleton, { className: "h-7 rounded-md" }),
|
|
3826
|
+
/* @__PURE__ */ jsx39(Skeleton, { className: "h-7 rounded-md" })
|
|
3827
|
+
] }) : loadFailed ? /* @__PURE__ */ jsx39(
|
|
3824
3828
|
ErrorBox,
|
|
3825
3829
|
{
|
|
3826
3830
|
className: "px-2 py-2 text-xs text-destructive",
|
|
@@ -3828,13 +3832,8 @@ function OrganizationPicker({
|
|
|
3828
3832
|
origin: "design-system/OrganizationPicker",
|
|
3829
3833
|
children: "Could not load organizations."
|
|
3830
3834
|
}
|
|
3831
|
-
) : organizations.length === 0 ? /* @__PURE__ */
|
|
3832
|
-
|
|
3833
|
-
"Working in",
|
|
3834
|
-
" ",
|
|
3835
|
-
/* @__PURE__ */ jsx40("span", { className: "font-medium text-foreground", children: active.name })
|
|
3836
|
-
] }) : /* @__PURE__ */ jsx40("p", { className: "px-2 pb-1 text-[11px] text-muted-foreground", "data-slot": "organization-picker-status", children: "No organization selected \u2014 pick one below." }),
|
|
3837
|
-
searchable && /* @__PURE__ */ jsx40("div", { className: "px-2 pb-1.5", children: /* @__PURE__ */ jsx40(
|
|
3835
|
+
) : organizations.length === 0 ? /* @__PURE__ */ jsx39("p", { className: "px-2 py-2 text-xs text-muted-foreground", children: "Your account is not a member of any organization. Ask an administrator to add you to one." }) : /* @__PURE__ */ jsxs23(Fragment3, { children: [
|
|
3836
|
+
searchable && /* @__PURE__ */ jsx39("div", { className: "px-2 pb-1.5", children: /* @__PURE__ */ jsx39(
|
|
3838
3837
|
Input,
|
|
3839
3838
|
{
|
|
3840
3839
|
type: "search",
|
|
@@ -3870,7 +3869,7 @@ function OrganizationPicker({
|
|
|
3870
3869
|
clicking. So: count the matches, say where they are, and carry
|
|
3871
3870
|
the click that reveals them — the same shape as the honest
|
|
3872
3871
|
empty-filter twin one line down. (TAILS-3) */
|
|
3873
|
-
/* @__PURE__ */
|
|
3872
|
+
/* @__PURE__ */ jsx39(
|
|
3874
3873
|
"p",
|
|
3875
3874
|
{
|
|
3876
3875
|
className: "px-2 py-2 text-xs text-muted-foreground",
|
|
@@ -3879,7 +3878,7 @@ function OrganizationPicker({
|
|
|
3879
3878
|
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`,
|
|
3880
3879
|
showFixtures ? ", listed below." : /* @__PURE__ */ jsxs23(Fragment3, { children: [
|
|
3881
3880
|
" \u2014 ",
|
|
3882
|
-
/* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ jsx39(
|
|
3883
3882
|
"button",
|
|
3884
3883
|
{
|
|
3885
3884
|
type: "button",
|
|
@@ -3897,8 +3896,8 @@ function OrganizationPicker({
|
|
|
3897
3896
|
] }) : `Every organization you belong to is a test organization \u2014 all ${fixtures.length} are below.`
|
|
3898
3897
|
}
|
|
3899
3898
|
)
|
|
3900
|
-
) : /* @__PURE__ */
|
|
3901
|
-
/* @__PURE__ */
|
|
3899
|
+
) : /* @__PURE__ */ jsx39("ul", { className: "max-h-72 overflow-y-auto", role: "listbox", "aria-label": "Organizations", children: listed.map(renderRow) }),
|
|
3900
|
+
/* @__PURE__ */ jsx39(
|
|
3902
3901
|
ArchivedDisclosure,
|
|
3903
3902
|
{
|
|
3904
3903
|
count: folded.length,
|
|
@@ -3906,10 +3905,10 @@ function OrganizationPicker({
|
|
|
3906
3905
|
onOpenChange: setShowFolded,
|
|
3907
3906
|
label: foldedLabel,
|
|
3908
3907
|
className: "mt-0.5",
|
|
3909
|
-
children: /* @__PURE__ */
|
|
3908
|
+
children: /* @__PURE__ */ jsx39("ul", { className: "max-h-72 overflow-y-auto", role: "listbox", "aria-label": foldedLabel, children: folded.map(renderRow) })
|
|
3910
3909
|
}
|
|
3911
3910
|
),
|
|
3912
|
-
/* @__PURE__ */
|
|
3911
|
+
/* @__PURE__ */ jsx39(
|
|
3913
3912
|
ArchivedDisclosure,
|
|
3914
3913
|
{
|
|
3915
3914
|
count: fixtures.length,
|
|
@@ -3917,7 +3916,7 @@ function OrganizationPicker({
|
|
|
3917
3916
|
onOpenChange: setShowFixtures,
|
|
3918
3917
|
label: "Test organizations",
|
|
3919
3918
|
className: "mt-0.5",
|
|
3920
|
-
children: /* @__PURE__ */
|
|
3919
|
+
children: /* @__PURE__ */ jsx39(
|
|
3921
3920
|
"ul",
|
|
3922
3921
|
{
|
|
3923
3922
|
className: "max-h-72 overflow-y-auto",
|
|
@@ -3927,50 +3926,49 @@ function OrganizationPicker({
|
|
|
3927
3926
|
}
|
|
3928
3927
|
)
|
|
3929
3928
|
}
|
|
3930
|
-
)
|
|
3931
|
-
onSetDefault && /* @__PURE__ */ jsxs23(Fragment3, { children: [
|
|
3932
|
-
/* @__PURE__ */ jsx40("div", { className: "my-1 border-t border-border" }),
|
|
3933
|
-
/* @__PURE__ */ jsx40(
|
|
3934
|
-
DefaultOrganizationSwitch,
|
|
3935
|
-
{
|
|
3936
|
-
active,
|
|
3937
|
-
checked: !!active && isDefault(active.id),
|
|
3938
|
-
onChange: (on) => onSetDefault(on && active ? active.id : null)
|
|
3939
|
-
}
|
|
3940
|
-
)
|
|
3941
|
-
] })
|
|
3929
|
+
)
|
|
3942
3930
|
] })
|
|
3943
3931
|
] });
|
|
3944
3932
|
}
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
}
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
"
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3933
|
+
|
|
3934
|
+
// src/switch.tsx
|
|
3935
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3936
|
+
import * as React31 from "react";
|
|
3937
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3938
|
+
var SWITCH_SIZES = {
|
|
3939
|
+
sm: {
|
|
3940
|
+
root: "h-4 w-9 border-border data-[state=unchecked]:bg-input",
|
|
3941
|
+
thumb: "h-4 w-4 border border-primary data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
3942
|
+
},
|
|
3943
|
+
md: {
|
|
3944
|
+
root: "h-5 w-9 border-transparent data-[state=unchecked]:bg-input",
|
|
3945
|
+
thumb: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
3946
|
+
}
|
|
3947
|
+
};
|
|
3948
|
+
var Switch = React31.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3949
|
+
SwitchPrimitives.Root,
|
|
3950
|
+
{
|
|
3951
|
+
ref,
|
|
3952
|
+
"data-slot": "switch",
|
|
3953
|
+
className: cn(
|
|
3954
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary",
|
|
3955
|
+
SWITCH_SIZES[size].root,
|
|
3956
|
+
className
|
|
3957
|
+
),
|
|
3958
|
+
...props,
|
|
3959
|
+
children: /* @__PURE__ */ jsx40(
|
|
3960
|
+
SwitchPrimitives.Thumb,
|
|
3961
|
+
{
|
|
3962
|
+
"data-slot": "switch-thumb",
|
|
3963
|
+
className: cn(
|
|
3964
|
+
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
3965
|
+
SWITCH_SIZES[size].thumb
|
|
3969
3966
|
)
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3967
|
+
}
|
|
3968
|
+
)
|
|
3969
|
+
}
|
|
3970
|
+
));
|
|
3971
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
3974
3972
|
|
|
3975
3973
|
// src/tabbed-bottom-sheet.tsx
|
|
3976
3974
|
import { useState as useState8 } from "react";
|
|
@@ -5665,7 +5663,7 @@ export {
|
|
|
5665
5663
|
MOTION_SHEET,
|
|
5666
5664
|
MOTION_SPIN,
|
|
5667
5665
|
NATIVE_TITLE_OPT_OUT_ATTR,
|
|
5668
|
-
|
|
5666
|
+
OrganizationMark,
|
|
5669
5667
|
OrganizationPicker,
|
|
5670
5668
|
OverflowToolbar,
|
|
5671
5669
|
POPPER_OFFSET,
|
|
@@ -5753,6 +5751,7 @@ export {
|
|
|
5753
5751
|
isInsideFloatingLayer,
|
|
5754
5752
|
isModalLayerOpen,
|
|
5755
5753
|
keepFloatingLayersInside,
|
|
5754
|
+
organizationColor,
|
|
5756
5755
|
registerModalLayer,
|
|
5757
5756
|
scoreAccentBgClasses,
|
|
5758
5757
|
scoreRingColorClasses,
|