@rock.star/ui 1.1.2 → 1.1.4
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/index.d.ts +1 -1
- package/dist/index.js +314 -282
- package/dist/index.js.map +1 -1
- package/dist/loader.css +93 -0
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +344 -298
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/index.js
CHANGED
|
@@ -3472,6 +3472,51 @@ function EmptyContent({ className, ...props }) {
|
|
|
3472
3472
|
);
|
|
3473
3473
|
}
|
|
3474
3474
|
|
|
3475
|
+
// src/hooks/useMediaQuery.ts
|
|
3476
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
3477
|
+
function useMediaQuery(query) {
|
|
3478
|
+
const [matches, setMatches] = useState4(false);
|
|
3479
|
+
useEffect4(() => {
|
|
3480
|
+
const mediaQuery = window.matchMedia(query);
|
|
3481
|
+
const handleChange = () => setMatches(mediaQuery.matches);
|
|
3482
|
+
handleChange();
|
|
3483
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
3484
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
3485
|
+
}, [query]);
|
|
3486
|
+
return matches;
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3489
|
+
// src/ui/farmer/div.tsx
|
|
3490
|
+
import { motion as motion5 } from "motion/react";
|
|
3491
|
+
import React9 from "react";
|
|
3492
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3493
|
+
var AnimatedDiv = React9.forwardRef(
|
|
3494
|
+
({ variants, mobileVariants, className, children, infinity, ...motionProps }, ref) => {
|
|
3495
|
+
const isDesktop = useMediaQuery("(min-width: 768px)");
|
|
3496
|
+
const selectedVariants = !isDesktop && mobileVariants ? mobileVariants : variants;
|
|
3497
|
+
return /* @__PURE__ */ jsx29(
|
|
3498
|
+
motion5.div,
|
|
3499
|
+
{
|
|
3500
|
+
ref,
|
|
3501
|
+
layout: true,
|
|
3502
|
+
className,
|
|
3503
|
+
initial: "hidden",
|
|
3504
|
+
transition: {
|
|
3505
|
+
staggerChildren: 0.1,
|
|
3506
|
+
delayChildren: 0.2
|
|
3507
|
+
},
|
|
3508
|
+
variants: selectedVariants,
|
|
3509
|
+
viewport: { once: !infinity },
|
|
3510
|
+
whileInView: "visible",
|
|
3511
|
+
...motionProps,
|
|
3512
|
+
children
|
|
3513
|
+
}
|
|
3514
|
+
);
|
|
3515
|
+
}
|
|
3516
|
+
);
|
|
3517
|
+
AnimatedDiv.displayName = "AnimatedDiv";
|
|
3518
|
+
var div_default = AnimatedDiv;
|
|
3519
|
+
|
|
3475
3520
|
// src/ui/farmer/FramerMotionVariants.ts
|
|
3476
3521
|
var activityItemAnimation = {
|
|
3477
3522
|
hidden: {
|
|
@@ -3769,9 +3814,9 @@ import { cva as cva7 } from "class-variance-authority";
|
|
|
3769
3814
|
import { useMemo as useMemo3 } from "react";
|
|
3770
3815
|
|
|
3771
3816
|
// src/ui/label.tsx
|
|
3772
|
-
import { jsx as
|
|
3817
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3773
3818
|
function Label({ className, ...props }) {
|
|
3774
|
-
return /* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ jsx30(
|
|
3775
3820
|
"label",
|
|
3776
3821
|
{
|
|
3777
3822
|
"data-slot": "label",
|
|
@@ -3785,9 +3830,9 @@ function Label({ className, ...props }) {
|
|
|
3785
3830
|
}
|
|
3786
3831
|
|
|
3787
3832
|
// src/ui/field.tsx
|
|
3788
|
-
import { jsx as
|
|
3833
|
+
import { jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3789
3834
|
function FieldSet({ className, ...props }) {
|
|
3790
|
-
return /* @__PURE__ */
|
|
3835
|
+
return /* @__PURE__ */ jsx31(
|
|
3791
3836
|
"fieldset",
|
|
3792
3837
|
{
|
|
3793
3838
|
"data-slot": "field-set",
|
|
@@ -3804,7 +3849,7 @@ function FieldLegend({
|
|
|
3804
3849
|
variant = "legend",
|
|
3805
3850
|
...props
|
|
3806
3851
|
}) {
|
|
3807
|
-
return /* @__PURE__ */
|
|
3852
|
+
return /* @__PURE__ */ jsx31(
|
|
3808
3853
|
"legend",
|
|
3809
3854
|
{
|
|
3810
3855
|
"data-slot": "field-legend",
|
|
@@ -3818,7 +3863,7 @@ function FieldLegend({
|
|
|
3818
3863
|
);
|
|
3819
3864
|
}
|
|
3820
3865
|
function FieldGroup({ className, ...props }) {
|
|
3821
|
-
return /* @__PURE__ */
|
|
3866
|
+
return /* @__PURE__ */ jsx31(
|
|
3822
3867
|
"div",
|
|
3823
3868
|
{
|
|
3824
3869
|
"data-slot": "field-group",
|
|
@@ -3850,7 +3895,7 @@ function Field({
|
|
|
3850
3895
|
orientation = "vertical",
|
|
3851
3896
|
...props
|
|
3852
3897
|
}) {
|
|
3853
|
-
return /* @__PURE__ */
|
|
3898
|
+
return /* @__PURE__ */ jsx31(
|
|
3854
3899
|
"div",
|
|
3855
3900
|
{
|
|
3856
3901
|
role: "group",
|
|
@@ -3862,7 +3907,7 @@ function Field({
|
|
|
3862
3907
|
);
|
|
3863
3908
|
}
|
|
3864
3909
|
function FieldContent({ className, ...props }) {
|
|
3865
|
-
return /* @__PURE__ */
|
|
3910
|
+
return /* @__PURE__ */ jsx31(
|
|
3866
3911
|
"div",
|
|
3867
3912
|
{
|
|
3868
3913
|
"data-slot": "field-content",
|
|
@@ -3878,7 +3923,7 @@ function FieldLabel({
|
|
|
3878
3923
|
className,
|
|
3879
3924
|
...props
|
|
3880
3925
|
}) {
|
|
3881
|
-
return /* @__PURE__ */
|
|
3926
|
+
return /* @__PURE__ */ jsx31(
|
|
3882
3927
|
Label,
|
|
3883
3928
|
{
|
|
3884
3929
|
"data-slot": "field-label",
|
|
@@ -3892,7 +3937,7 @@ function FieldLabel({
|
|
|
3892
3937
|
);
|
|
3893
3938
|
}
|
|
3894
3939
|
function FieldTitle({ className, ...props }) {
|
|
3895
|
-
return /* @__PURE__ */
|
|
3940
|
+
return /* @__PURE__ */ jsx31(
|
|
3896
3941
|
"div",
|
|
3897
3942
|
{
|
|
3898
3943
|
"data-slot": "field-label",
|
|
@@ -3905,7 +3950,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
3905
3950
|
);
|
|
3906
3951
|
}
|
|
3907
3952
|
function FieldDescription({ className, ...props }) {
|
|
3908
|
-
return /* @__PURE__ */
|
|
3953
|
+
return /* @__PURE__ */ jsx31(
|
|
3909
3954
|
"p",
|
|
3910
3955
|
{
|
|
3911
3956
|
"data-slot": "field-description",
|
|
@@ -3935,8 +3980,8 @@ function FieldSeparator({
|
|
|
3935
3980
|
),
|
|
3936
3981
|
...props,
|
|
3937
3982
|
children: [
|
|
3938
|
-
/* @__PURE__ */
|
|
3939
|
-
children && /* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ jsx31(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
3984
|
+
children && /* @__PURE__ */ jsx31(
|
|
3940
3985
|
"span",
|
|
3941
3986
|
{
|
|
3942
3987
|
className: "relative mx-auto block w-fit px-2 text-muted-foreground",
|
|
@@ -3967,14 +4012,14 @@ function FieldError({
|
|
|
3967
4012
|
if (uniqueErrors?.length == 1) {
|
|
3968
4013
|
return uniqueErrors[0]?.message;
|
|
3969
4014
|
}
|
|
3970
|
-
return /* @__PURE__ */
|
|
3971
|
-
(error, index) => error?.message && /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ jsx31("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
4016
|
+
(error, index) => error?.message && /* @__PURE__ */ jsx31("li", { children: error.message }, index)
|
|
3972
4017
|
) });
|
|
3973
4018
|
}, [children, errors]);
|
|
3974
4019
|
if (!content) {
|
|
3975
4020
|
return null;
|
|
3976
4021
|
}
|
|
3977
|
-
return /* @__PURE__ */
|
|
4022
|
+
return /* @__PURE__ */ jsx31(
|
|
3978
4023
|
"div",
|
|
3979
4024
|
{
|
|
3980
4025
|
role: "alert",
|
|
@@ -3988,8 +4033,8 @@ function FieldError({
|
|
|
3988
4033
|
|
|
3989
4034
|
// src/ui/image.tsx
|
|
3990
4035
|
import NextImage from "next/image";
|
|
3991
|
-
import { useCallback as useCallback2, useState as
|
|
3992
|
-
import { jsx as
|
|
4036
|
+
import { useCallback as useCallback2, useState as useState5 } from "react";
|
|
4037
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3993
4038
|
function srcValue(src) {
|
|
3994
4039
|
if (!src) return null;
|
|
3995
4040
|
if (typeof src === "string") return src;
|
|
@@ -4009,12 +4054,12 @@ function Image({
|
|
|
4009
4054
|
onLoad,
|
|
4010
4055
|
onError,
|
|
4011
4056
|
children,
|
|
4012
|
-
fallback = /* @__PURE__ */
|
|
4057
|
+
fallback = /* @__PURE__ */ jsx32(JellyMini, { mood: "curious", className: "size-full p-4" }),
|
|
4013
4058
|
...props
|
|
4014
4059
|
}) {
|
|
4015
4060
|
const currentSrc = srcValue(src);
|
|
4016
|
-
const [loadedSrc, setLoadedSrc] =
|
|
4017
|
-
const [failedSrc, setFailedSrc] =
|
|
4061
|
+
const [loadedSrc, setLoadedSrc] = useState5(null);
|
|
4062
|
+
const [failedSrc, setFailedSrc] = useState5(null);
|
|
4018
4063
|
const hasSource = Boolean(currentSrc);
|
|
4019
4064
|
const failed = hasSource && failedSrc === currentSrc;
|
|
4020
4065
|
const loaded = hasSource && loadedSrc === currentSrc && !failed;
|
|
@@ -4030,8 +4075,8 @@ function Image({
|
|
|
4030
4075
|
setFailedSrc(currentSrc);
|
|
4031
4076
|
}, [currentSrc]);
|
|
4032
4077
|
return /* @__PURE__ */ jsxs17("section", { className: cn("relative block overflow-hidden", wrapper), children: [
|
|
4033
|
-
showSkeleton && !loaded && !failed && hasSource && /* @__PURE__ */
|
|
4034
|
-
hasSource && !failed ? /* @__PURE__ */
|
|
4078
|
+
showSkeleton && !loaded && !failed && hasSource && /* @__PURE__ */ jsx32(Skeleton, { className: "absolute inset-0 size-full" }),
|
|
4079
|
+
hasSource && !failed ? /* @__PURE__ */ jsx32(
|
|
4035
4080
|
NextImage,
|
|
4036
4081
|
{
|
|
4037
4082
|
...props,
|
|
@@ -4061,16 +4106,16 @@ function Image({
|
|
|
4061
4106
|
}
|
|
4062
4107
|
|
|
4063
4108
|
// src/ui/input-otp.tsx
|
|
4064
|
-
import * as
|
|
4109
|
+
import * as React10 from "react";
|
|
4065
4110
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
4066
4111
|
import { MinusIcon } from "lucide-react";
|
|
4067
|
-
import { jsx as
|
|
4112
|
+
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4068
4113
|
function InputOTP({
|
|
4069
4114
|
className,
|
|
4070
4115
|
containerClassName,
|
|
4071
4116
|
...props
|
|
4072
4117
|
}) {
|
|
4073
|
-
return /* @__PURE__ */
|
|
4118
|
+
return /* @__PURE__ */ jsx33(
|
|
4074
4119
|
OTPInput,
|
|
4075
4120
|
{
|
|
4076
4121
|
"data-slot": "input-otp",
|
|
@@ -4085,7 +4130,7 @@ function InputOTP({
|
|
|
4085
4130
|
);
|
|
4086
4131
|
}
|
|
4087
4132
|
function InputOTPGroup({ className, ...props }) {
|
|
4088
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ jsx33(
|
|
4089
4134
|
"div",
|
|
4090
4135
|
{
|
|
4091
4136
|
"data-slot": "input-otp-group",
|
|
@@ -4102,7 +4147,7 @@ function InputOTPSlot({
|
|
|
4102
4147
|
className,
|
|
4103
4148
|
...props
|
|
4104
4149
|
}) {
|
|
4105
|
-
const inputOTPContext =
|
|
4150
|
+
const inputOTPContext = React10.useContext(OTPInputContext);
|
|
4106
4151
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
4107
4152
|
return /* @__PURE__ */ jsxs18(
|
|
4108
4153
|
"div",
|
|
@@ -4116,20 +4161,20 @@ function InputOTPSlot({
|
|
|
4116
4161
|
...props,
|
|
4117
4162
|
children: [
|
|
4118
4163
|
char,
|
|
4119
|
-
hasFakeCaret && /* @__PURE__ */
|
|
4164
|
+
hasFakeCaret && /* @__PURE__ */ jsx33("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx33("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
4120
4165
|
]
|
|
4121
4166
|
}
|
|
4122
4167
|
);
|
|
4123
4168
|
}
|
|
4124
4169
|
function InputOTPSeparator({ ...props }) {
|
|
4125
|
-
return /* @__PURE__ */
|
|
4170
|
+
return /* @__PURE__ */ jsx33(
|
|
4126
4171
|
"div",
|
|
4127
4172
|
{
|
|
4128
4173
|
"data-slot": "input-otp-separator",
|
|
4129
4174
|
className: "flex items-center [&_svg:not([class*='size-'])]:size-4",
|
|
4130
4175
|
role: "separator",
|
|
4131
4176
|
...props,
|
|
4132
|
-
children: /* @__PURE__ */
|
|
4177
|
+
children: /* @__PURE__ */ jsx33(MinusIcon, {})
|
|
4133
4178
|
}
|
|
4134
4179
|
);
|
|
4135
4180
|
}
|
|
@@ -4138,9 +4183,9 @@ function InputOTPSeparator({ ...props }) {
|
|
|
4138
4183
|
import { mergeProps as mergeProps4 } from "@base-ui/react/merge-props";
|
|
4139
4184
|
import { useRender as useRender4 } from "@base-ui/react/use-render";
|
|
4140
4185
|
import { cva as cva8 } from "class-variance-authority";
|
|
4141
|
-
import { jsx as
|
|
4186
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4142
4187
|
function ItemGroup({ className, ...props }) {
|
|
4143
|
-
return /* @__PURE__ */
|
|
4188
|
+
return /* @__PURE__ */ jsx34(
|
|
4144
4189
|
"div",
|
|
4145
4190
|
{
|
|
4146
4191
|
role: "list",
|
|
@@ -4157,7 +4202,7 @@ function ItemSeparator({
|
|
|
4157
4202
|
className,
|
|
4158
4203
|
...props
|
|
4159
4204
|
}) {
|
|
4160
|
-
return /* @__PURE__ */
|
|
4205
|
+
return /* @__PURE__ */ jsx34(
|
|
4161
4206
|
Separator,
|
|
4162
4207
|
{
|
|
4163
4208
|
"data-slot": "item-separator",
|
|
@@ -4231,7 +4276,7 @@ function ItemMedia({
|
|
|
4231
4276
|
variant = "default",
|
|
4232
4277
|
...props
|
|
4233
4278
|
}) {
|
|
4234
|
-
return /* @__PURE__ */
|
|
4279
|
+
return /* @__PURE__ */ jsx34(
|
|
4235
4280
|
"div",
|
|
4236
4281
|
{
|
|
4237
4282
|
"data-slot": "item-media",
|
|
@@ -4242,7 +4287,7 @@ function ItemMedia({
|
|
|
4242
4287
|
);
|
|
4243
4288
|
}
|
|
4244
4289
|
function ItemContent({ className, ...props }) {
|
|
4245
|
-
return /* @__PURE__ */
|
|
4290
|
+
return /* @__PURE__ */ jsx34(
|
|
4246
4291
|
"div",
|
|
4247
4292
|
{
|
|
4248
4293
|
"data-slot": "item-content",
|
|
@@ -4255,7 +4300,7 @@ function ItemContent({ className, ...props }) {
|
|
|
4255
4300
|
);
|
|
4256
4301
|
}
|
|
4257
4302
|
function ItemTitle({ className, ...props }) {
|
|
4258
|
-
return /* @__PURE__ */
|
|
4303
|
+
return /* @__PURE__ */ jsx34(
|
|
4259
4304
|
"div",
|
|
4260
4305
|
{
|
|
4261
4306
|
"data-slot": "item-title",
|
|
@@ -4268,7 +4313,7 @@ function ItemTitle({ className, ...props }) {
|
|
|
4268
4313
|
);
|
|
4269
4314
|
}
|
|
4270
4315
|
function ItemDescription({ className, ...props }) {
|
|
4271
|
-
return /* @__PURE__ */
|
|
4316
|
+
return /* @__PURE__ */ jsx34(
|
|
4272
4317
|
"p",
|
|
4273
4318
|
{
|
|
4274
4319
|
"data-slot": "item-description",
|
|
@@ -4281,7 +4326,7 @@ function ItemDescription({ className, ...props }) {
|
|
|
4281
4326
|
);
|
|
4282
4327
|
}
|
|
4283
4328
|
function ItemActions({ className, ...props }) {
|
|
4284
|
-
return /* @__PURE__ */
|
|
4329
|
+
return /* @__PURE__ */ jsx34(
|
|
4285
4330
|
"div",
|
|
4286
4331
|
{
|
|
4287
4332
|
"data-slot": "item-actions",
|
|
@@ -4291,7 +4336,7 @@ function ItemActions({ className, ...props }) {
|
|
|
4291
4336
|
);
|
|
4292
4337
|
}
|
|
4293
4338
|
function ItemHeader({ className, ...props }) {
|
|
4294
|
-
return /* @__PURE__ */
|
|
4339
|
+
return /* @__PURE__ */ jsx34(
|
|
4295
4340
|
"div",
|
|
4296
4341
|
{
|
|
4297
4342
|
"data-slot": "item-header",
|
|
@@ -4304,7 +4349,7 @@ function ItemHeader({ className, ...props }) {
|
|
|
4304
4349
|
);
|
|
4305
4350
|
}
|
|
4306
4351
|
function ItemFooter({ className, ...props }) {
|
|
4307
|
-
return /* @__PURE__ */
|
|
4352
|
+
return /* @__PURE__ */ jsx34(
|
|
4308
4353
|
"div",
|
|
4309
4354
|
{
|
|
4310
4355
|
"data-slot": "item-footer",
|
|
@@ -4318,10 +4363,10 @@ function ItemFooter({ className, ...props }) {
|
|
|
4318
4363
|
}
|
|
4319
4364
|
|
|
4320
4365
|
// src/hooks/useMounted.ts
|
|
4321
|
-
import { useEffect as
|
|
4366
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
4322
4367
|
function useMounted() {
|
|
4323
|
-
const [mounted, setMounted] =
|
|
4324
|
-
|
|
4368
|
+
const [mounted, setMounted] = useState6(false);
|
|
4369
|
+
useEffect5(() => {
|
|
4325
4370
|
setMounted(true);
|
|
4326
4371
|
}, []);
|
|
4327
4372
|
return { mounted };
|
|
@@ -4332,15 +4377,15 @@ import {
|
|
|
4332
4377
|
BlobSpeech,
|
|
4333
4378
|
JellyBlobMascot
|
|
4334
4379
|
} from "feral-blob";
|
|
4335
|
-
import * as
|
|
4380
|
+
import * as React11 from "react";
|
|
4336
4381
|
import {
|
|
4337
4382
|
BlobSpeech as BlobSpeech2,
|
|
4338
4383
|
JellyBlobMascot as JellyBlobMascot2,
|
|
4339
4384
|
JellyBlobMascotDemo
|
|
4340
4385
|
} from "feral-blob";
|
|
4341
|
-
import { jsx as
|
|
4386
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4342
4387
|
function JellyBlob({ ...props }) {
|
|
4343
|
-
return /* @__PURE__ */
|
|
4388
|
+
return /* @__PURE__ */ jsx35("span", { className: "inline-block", children: /* @__PURE__ */ jsx35(
|
|
4344
4389
|
JellyBlobMascot,
|
|
4345
4390
|
{
|
|
4346
4391
|
...props,
|
|
@@ -4370,7 +4415,7 @@ function JellyMini({
|
|
|
4370
4415
|
...props
|
|
4371
4416
|
}) {
|
|
4372
4417
|
const { mounted } = useMounted();
|
|
4373
|
-
return /* @__PURE__ */
|
|
4418
|
+
return /* @__PURE__ */ jsx35(
|
|
4374
4419
|
"span",
|
|
4375
4420
|
{
|
|
4376
4421
|
"aria-hidden": "true",
|
|
@@ -4378,7 +4423,7 @@ function JellyMini({
|
|
|
4378
4423
|
"inline-flex size-5 shrink-0 items-center justify-center select-none",
|
|
4379
4424
|
className
|
|
4380
4425
|
),
|
|
4381
|
-
children: mounted ? /* @__PURE__ */
|
|
4426
|
+
children: mounted ? /* @__PURE__ */ jsx35(
|
|
4382
4427
|
JellyBlobMascot,
|
|
4383
4428
|
{
|
|
4384
4429
|
...props,
|
|
@@ -4390,10 +4435,10 @@ function JellyMini({
|
|
|
4390
4435
|
}
|
|
4391
4436
|
);
|
|
4392
4437
|
}
|
|
4393
|
-
var JellyMascotContext =
|
|
4438
|
+
var JellyMascotContext = React11.createContext(null);
|
|
4394
4439
|
function useJellyMood() {
|
|
4395
|
-
const state =
|
|
4396
|
-
return
|
|
4440
|
+
const state = React11.useContext(JellyMascotContext);
|
|
4441
|
+
return React11.useCallback(
|
|
4397
4442
|
(mood) => {
|
|
4398
4443
|
if (!mood || !state) return {};
|
|
4399
4444
|
return {
|
|
@@ -4420,14 +4465,14 @@ function JellyAction({
|
|
|
4420
4465
|
...props
|
|
4421
4466
|
}) {
|
|
4422
4467
|
const preview = useJellyMood();
|
|
4423
|
-
return /* @__PURE__ */
|
|
4468
|
+
return /* @__PURE__ */ jsx35(Button, { ...props, ...withPreviewHandlers(preview, { ...props, mood }) });
|
|
4424
4469
|
}
|
|
4425
4470
|
function JellyLink({
|
|
4426
4471
|
mood,
|
|
4427
4472
|
...props
|
|
4428
4473
|
}) {
|
|
4429
4474
|
const preview = useJellyMood();
|
|
4430
|
-
return /* @__PURE__ */
|
|
4475
|
+
return /* @__PURE__ */ jsx35("a", { ...props, ...withPreviewHandlers(preview, { ...props, mood }) });
|
|
4431
4476
|
}
|
|
4432
4477
|
function JellyMascotProvider({
|
|
4433
4478
|
mood = "neutral",
|
|
@@ -4436,7 +4481,7 @@ function JellyMascotProvider({
|
|
|
4436
4481
|
...blobProps
|
|
4437
4482
|
}) {
|
|
4438
4483
|
const { mounted } = useMounted();
|
|
4439
|
-
const [previewMood, setPreviewMood] =
|
|
4484
|
+
const [previewMood, setPreviewMood] = React11.useState(
|
|
4440
4485
|
null
|
|
4441
4486
|
);
|
|
4442
4487
|
const activeMood = previewMood ?? mood;
|
|
@@ -4449,7 +4494,7 @@ function JellyMascotProvider({
|
|
|
4449
4494
|
blobProps,
|
|
4450
4495
|
setPreview: setPreviewMood
|
|
4451
4496
|
};
|
|
4452
|
-
return /* @__PURE__ */
|
|
4497
|
+
return /* @__PURE__ */ jsx35(JellyMascotContext.Provider, { value, children });
|
|
4453
4498
|
}
|
|
4454
4499
|
var SIZE_WRAPPER = {
|
|
4455
4500
|
sm: "w-20",
|
|
@@ -4461,7 +4506,7 @@ function JellyMascotFace({
|
|
|
4461
4506
|
size = "md",
|
|
4462
4507
|
className
|
|
4463
4508
|
}) {
|
|
4464
|
-
const mascot =
|
|
4509
|
+
const mascot = React11.useContext(JellyMascotContext);
|
|
4465
4510
|
if (!mascot) return null;
|
|
4466
4511
|
return /* @__PURE__ */ jsxs19(
|
|
4467
4512
|
"div",
|
|
@@ -4473,14 +4518,14 @@ function JellyMascotFace({
|
|
|
4473
4518
|
className
|
|
4474
4519
|
),
|
|
4475
4520
|
children: [
|
|
4476
|
-
mascot.speech ? /* @__PURE__ */
|
|
4521
|
+
mascot.speech ? /* @__PURE__ */ jsx35(
|
|
4477
4522
|
BlobSpeech,
|
|
4478
4523
|
{
|
|
4479
4524
|
mood: mascot.mood,
|
|
4480
4525
|
messages: { [mascot.mood]: mascot.speech }
|
|
4481
4526
|
}
|
|
4482
4527
|
) : null,
|
|
4483
|
-
mascot.mounted ? /* @__PURE__ */
|
|
4528
|
+
mascot.mounted ? /* @__PURE__ */ jsx35(
|
|
4484
4529
|
JellyBlobMascot,
|
|
4485
4530
|
{
|
|
4486
4531
|
...mascot.blobProps,
|
|
@@ -4499,15 +4544,15 @@ function JellyMascot({
|
|
|
4499
4544
|
className,
|
|
4500
4545
|
...config
|
|
4501
4546
|
}) {
|
|
4502
|
-
const existing =
|
|
4503
|
-
if (existing) return /* @__PURE__ */
|
|
4504
|
-
return /* @__PURE__ */
|
|
4547
|
+
const existing = React11.useContext(JellyMascotContext);
|
|
4548
|
+
if (existing) return /* @__PURE__ */ jsx35(JellyMascotFace, { size, className });
|
|
4549
|
+
return /* @__PURE__ */ jsx35(JellyMascotProvider, { ...config, children: /* @__PURE__ */ jsx35(JellyMascotFace, { size, className }) });
|
|
4505
4550
|
}
|
|
4506
4551
|
function JellyGroup({
|
|
4507
4552
|
children,
|
|
4508
4553
|
...config
|
|
4509
4554
|
}) {
|
|
4510
|
-
return /* @__PURE__ */
|
|
4555
|
+
return /* @__PURE__ */ jsx35(JellyMascotProvider, { ...config, children });
|
|
4511
4556
|
}
|
|
4512
4557
|
function JellyEmpty({
|
|
4513
4558
|
title,
|
|
@@ -4517,20 +4562,20 @@ function JellyEmpty({
|
|
|
4517
4562
|
className,
|
|
4518
4563
|
...config
|
|
4519
4564
|
}) {
|
|
4520
|
-
return /* @__PURE__ */
|
|
4565
|
+
return /* @__PURE__ */ jsx35(JellyMascotProvider, { ...config, children: /* @__PURE__ */ jsxs19(Empty, { className: cn("gap-4", className), children: [
|
|
4521
4566
|
/* @__PURE__ */ jsxs19(EmptyHeader, { className: "gap-2", children: [
|
|
4522
|
-
/* @__PURE__ */
|
|
4523
|
-
title ? /* @__PURE__ */
|
|
4524
|
-
description ? /* @__PURE__ */
|
|
4567
|
+
/* @__PURE__ */ jsx35(JellyMascotFace, { size }),
|
|
4568
|
+
title ? /* @__PURE__ */ jsx35(EmptyTitle, { className: "text-base font-semibold sm:text-lg", children: title }) : null,
|
|
4569
|
+
description ? /* @__PURE__ */ jsx35(EmptyDescription, { className: "max-w-sm", children: description }) : null
|
|
4525
4570
|
] }),
|
|
4526
|
-
actions ? /* @__PURE__ */
|
|
4571
|
+
actions ? /* @__PURE__ */ jsx35(EmptyContent, { children: actions }) : null
|
|
4527
4572
|
] }) });
|
|
4528
4573
|
}
|
|
4529
4574
|
|
|
4530
4575
|
// src/ui/kbd.tsx
|
|
4531
|
-
import { jsx as
|
|
4576
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4532
4577
|
function Kbd({ className, ...props }) {
|
|
4533
|
-
return /* @__PURE__ */
|
|
4578
|
+
return /* @__PURE__ */ jsx36(
|
|
4534
4579
|
"kbd",
|
|
4535
4580
|
{
|
|
4536
4581
|
"data-slot": "kbd",
|
|
@@ -4543,7 +4588,7 @@ function Kbd({ className, ...props }) {
|
|
|
4543
4588
|
);
|
|
4544
4589
|
}
|
|
4545
4590
|
function KbdGroup({ className, ...props }) {
|
|
4546
|
-
return /* @__PURE__ */
|
|
4591
|
+
return /* @__PURE__ */ jsx36(
|
|
4547
4592
|
"kbd",
|
|
4548
4593
|
{
|
|
4549
4594
|
"data-slot": "kbd-group",
|
|
@@ -4554,9 +4599,9 @@ function KbdGroup({ className, ...props }) {
|
|
|
4554
4599
|
}
|
|
4555
4600
|
|
|
4556
4601
|
// src/ui/message.tsx
|
|
4557
|
-
import { jsx as
|
|
4602
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4558
4603
|
function MessageGroup({ className, ...props }) {
|
|
4559
|
-
return /* @__PURE__ */
|
|
4604
|
+
return /* @__PURE__ */ jsx37(
|
|
4560
4605
|
"div",
|
|
4561
4606
|
{
|
|
4562
4607
|
"data-slot": "message-group",
|
|
@@ -4570,7 +4615,7 @@ function Message({
|
|
|
4570
4615
|
align = "start",
|
|
4571
4616
|
...props
|
|
4572
4617
|
}) {
|
|
4573
|
-
return /* @__PURE__ */
|
|
4618
|
+
return /* @__PURE__ */ jsx37(
|
|
4574
4619
|
"div",
|
|
4575
4620
|
{
|
|
4576
4621
|
"data-slot": "message",
|
|
@@ -4584,7 +4629,7 @@ function Message({
|
|
|
4584
4629
|
);
|
|
4585
4630
|
}
|
|
4586
4631
|
function MessageAvatar({ className, ...props }) {
|
|
4587
|
-
return /* @__PURE__ */
|
|
4632
|
+
return /* @__PURE__ */ jsx37(
|
|
4588
4633
|
"div",
|
|
4589
4634
|
{
|
|
4590
4635
|
"data-slot": "message-avatar",
|
|
@@ -4597,7 +4642,7 @@ function MessageAvatar({ className, ...props }) {
|
|
|
4597
4642
|
);
|
|
4598
4643
|
}
|
|
4599
4644
|
function MessageContent({ className, ...props }) {
|
|
4600
|
-
return /* @__PURE__ */
|
|
4645
|
+
return /* @__PURE__ */ jsx37(
|
|
4601
4646
|
"div",
|
|
4602
4647
|
{
|
|
4603
4648
|
"data-slot": "message-content",
|
|
@@ -4610,7 +4655,7 @@ function MessageContent({ className, ...props }) {
|
|
|
4610
4655
|
);
|
|
4611
4656
|
}
|
|
4612
4657
|
function MessageHeader({ className, ...props }) {
|
|
4613
|
-
return /* @__PURE__ */
|
|
4658
|
+
return /* @__PURE__ */ jsx37(
|
|
4614
4659
|
"div",
|
|
4615
4660
|
{
|
|
4616
4661
|
"data-slot": "message-header",
|
|
@@ -4623,7 +4668,7 @@ function MessageHeader({ className, ...props }) {
|
|
|
4623
4668
|
);
|
|
4624
4669
|
}
|
|
4625
4670
|
function MessageFooter({ className, ...props }) {
|
|
4626
|
-
return /* @__PURE__ */
|
|
4671
|
+
return /* @__PURE__ */ jsx37(
|
|
4627
4672
|
"div",
|
|
4628
4673
|
{
|
|
4629
4674
|
"data-slot": "message-footer",
|
|
@@ -4644,15 +4689,15 @@ import {
|
|
|
4644
4689
|
useMessageScrollerVisibility
|
|
4645
4690
|
} from "@shadcn/react/message-scroller";
|
|
4646
4691
|
import { ArrowDownIcon } from "lucide-react";
|
|
4647
|
-
import { Fragment as Fragment2, jsx as
|
|
4692
|
+
import { Fragment as Fragment2, jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4648
4693
|
function MessageScrollerProvider(props) {
|
|
4649
|
-
return /* @__PURE__ */
|
|
4694
|
+
return /* @__PURE__ */ jsx38(MessageScrollerPrimitive.Provider, { ...props });
|
|
4650
4695
|
}
|
|
4651
4696
|
function MessageScroller({
|
|
4652
4697
|
className,
|
|
4653
4698
|
...props
|
|
4654
4699
|
}) {
|
|
4655
|
-
return /* @__PURE__ */
|
|
4700
|
+
return /* @__PURE__ */ jsx38(
|
|
4656
4701
|
MessageScrollerPrimitive.Root,
|
|
4657
4702
|
{
|
|
4658
4703
|
"data-slot": "message-scroller",
|
|
@@ -4668,7 +4713,7 @@ function MessageScrollerViewport({
|
|
|
4668
4713
|
className,
|
|
4669
4714
|
...props
|
|
4670
4715
|
}) {
|
|
4671
|
-
return /* @__PURE__ */
|
|
4716
|
+
return /* @__PURE__ */ jsx38(
|
|
4672
4717
|
MessageScrollerPrimitive.Viewport,
|
|
4673
4718
|
{
|
|
4674
4719
|
"data-slot": "message-scroller-viewport",
|
|
@@ -4684,7 +4729,7 @@ function MessageScrollerContent({
|
|
|
4684
4729
|
className,
|
|
4685
4730
|
...props
|
|
4686
4731
|
}) {
|
|
4687
|
-
return /* @__PURE__ */
|
|
4732
|
+
return /* @__PURE__ */ jsx38(
|
|
4688
4733
|
MessageScrollerPrimitive.Content,
|
|
4689
4734
|
{
|
|
4690
4735
|
"data-slot": "message-scroller-content",
|
|
@@ -4698,7 +4743,7 @@ function MessageScrollerItem({
|
|
|
4698
4743
|
scrollAnchor = false,
|
|
4699
4744
|
...props
|
|
4700
4745
|
}) {
|
|
4701
|
-
return /* @__PURE__ */
|
|
4746
|
+
return /* @__PURE__ */ jsx38(
|
|
4702
4747
|
MessageScrollerPrimitive.Item,
|
|
4703
4748
|
{
|
|
4704
4749
|
"data-slot": "message-scroller-item",
|
|
@@ -4720,7 +4765,7 @@ function MessageScrollerButton({
|
|
|
4720
4765
|
size = "icon-sm",
|
|
4721
4766
|
...props
|
|
4722
4767
|
}) {
|
|
4723
|
-
return /* @__PURE__ */
|
|
4768
|
+
return /* @__PURE__ */ jsx38(
|
|
4724
4769
|
MessageScrollerPrimitive.Button,
|
|
4725
4770
|
{
|
|
4726
4771
|
"data-slot": "message-scroller-button",
|
|
@@ -4732,11 +4777,11 @@ function MessageScrollerButton({
|
|
|
4732
4777
|
"data-[active=true]:ease-out-quint absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",
|
|
4733
4778
|
className
|
|
4734
4779
|
),
|
|
4735
|
-
render: render ?? /* @__PURE__ */
|
|
4780
|
+
render: render ?? /* @__PURE__ */ jsx38(Button, { variant, size }),
|
|
4736
4781
|
...props,
|
|
4737
4782
|
children: children ?? /* @__PURE__ */ jsxs20(Fragment2, { children: [
|
|
4738
|
-
/* @__PURE__ */
|
|
4739
|
-
/* @__PURE__ */
|
|
4783
|
+
/* @__PURE__ */ jsx38(ArrowDownIcon, {}),
|
|
4784
|
+
/* @__PURE__ */ jsx38("span", { className: "sr-only", children: direction === "end" ? "Scroll to end" : "Scroll to start" })
|
|
4740
4785
|
] })
|
|
4741
4786
|
}
|
|
4742
4787
|
);
|
|
@@ -4747,12 +4792,12 @@ import { clsx as clsx2 } from "clsx";
|
|
|
4747
4792
|
import {
|
|
4748
4793
|
AnimatePresence as AnimatePresence2,
|
|
4749
4794
|
animate,
|
|
4750
|
-
motion as
|
|
4795
|
+
motion as motion6,
|
|
4751
4796
|
useReducedMotion
|
|
4752
4797
|
} from "motion/react";
|
|
4753
|
-
import { Fragment as Fragment3, useEffect as
|
|
4798
|
+
import { Fragment as Fragment3, useEffect as useEffect6, useId as useId2, useRef as useRef3, useState as useState8 } from "react";
|
|
4754
4799
|
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
4755
|
-
import { jsx as
|
|
4800
|
+
import { jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4756
4801
|
var EASE_OUT = [0.16, 1, 0.3, 1];
|
|
4757
4802
|
var EASE_IN_OUT = [0.77, 0, 0.175, 1];
|
|
4758
4803
|
var EASE_DRAWER = [0.32, 0.72, 0, 1];
|
|
@@ -4812,15 +4857,15 @@ function OTPInput2({
|
|
|
4812
4857
|
const inputRef = useRef3(null);
|
|
4813
4858
|
const slotsRef = useRef3(null);
|
|
4814
4859
|
const controlled = controlledValue !== void 0;
|
|
4815
|
-
const [slots, setSlots] =
|
|
4860
|
+
const [slots, setSlots] = useState8(
|
|
4816
4861
|
() => toSlots(controlled ? controlledValue : defaultValue, length)
|
|
4817
4862
|
);
|
|
4818
|
-
const [focused, setFocused] =
|
|
4819
|
-
const [active, setActive] =
|
|
4863
|
+
const [focused, setFocused] = useState8(false);
|
|
4864
|
+
const [active, setActive] = useState8(0);
|
|
4820
4865
|
const joined = slots.join("");
|
|
4821
4866
|
const joinedRef = useRef3(joined);
|
|
4822
4867
|
joinedRef.current = joined;
|
|
4823
|
-
|
|
4868
|
+
useEffect6(() => {
|
|
4824
4869
|
if (!controlled) return;
|
|
4825
4870
|
const incoming = sanitize(controlledValue, length);
|
|
4826
4871
|
if (incoming !== joinedRef.current) {
|
|
@@ -4904,7 +4949,7 @@ function OTPInput2({
|
|
|
4904
4949
|
commit(toSlots(digits, length));
|
|
4905
4950
|
setActive(Math.min(digits.length, length - 1));
|
|
4906
4951
|
};
|
|
4907
|
-
|
|
4952
|
+
useEffect6(() => {
|
|
4908
4953
|
if (status !== "error" || reduce || !slotsRef.current) return;
|
|
4909
4954
|
animate(
|
|
4910
4955
|
slotsRef.current,
|
|
@@ -4921,7 +4966,7 @@ function OTPInput2({
|
|
|
4921
4966
|
const activeIndex = focused ? active : -1;
|
|
4922
4967
|
const message = showSuccess ? successMessage : status === "error" ? errorMessage : hint;
|
|
4923
4968
|
return /* @__PURE__ */ jsxs21("div", { className: otpCn("inline-flex flex-col gap-2", className), children: [
|
|
4924
|
-
label ? /* @__PURE__ */
|
|
4969
|
+
label ? /* @__PURE__ */ jsx39(
|
|
4925
4970
|
"label",
|
|
4926
4971
|
{
|
|
4927
4972
|
htmlFor: `${uid}-input`,
|
|
@@ -4942,7 +4987,7 @@ function OTPInput2({
|
|
|
4942
4987
|
inputRef.current?.focus();
|
|
4943
4988
|
},
|
|
4944
4989
|
children: [
|
|
4945
|
-
/* @__PURE__ */
|
|
4990
|
+
/* @__PURE__ */ jsx39(
|
|
4946
4991
|
"input",
|
|
4947
4992
|
{
|
|
4948
4993
|
ref: inputRef,
|
|
@@ -4969,7 +5014,7 @@ function OTPInput2({
|
|
|
4969
5014
|
className: "absolute inset-0 z-20 h-full w-full cursor-text bg-transparent text-transparent caret-transparent opacity-0 outline-none disabled:cursor-not-allowed"
|
|
4970
5015
|
}
|
|
4971
5016
|
),
|
|
4972
|
-
/* @__PURE__ */
|
|
5017
|
+
/* @__PURE__ */ jsx39("div", { ref: slotsRef, className: "flex items-center gap-3", children: Array.from({ length }, (_, i) => {
|
|
4973
5018
|
const char = slots[i] ?? "";
|
|
4974
5019
|
const isActive = i === activeIndex;
|
|
4975
5020
|
return /* @__PURE__ */ jsxs21(Fragment3, { children: [
|
|
@@ -4986,8 +5031,8 @@ function OTPInput2({
|
|
|
4986
5031
|
disabled && "opacity-50"
|
|
4987
5032
|
),
|
|
4988
5033
|
children: [
|
|
4989
|
-
isActive && !showSuccess ? /* @__PURE__ */
|
|
4990
|
-
|
|
5034
|
+
isActive && !showSuccess ? /* @__PURE__ */ jsx39(
|
|
5035
|
+
motion6.span,
|
|
4991
5036
|
{
|
|
4992
5037
|
"aria-hidden": true,
|
|
4993
5038
|
animate: reduce ? void 0 : { opacity: [1, 1, 0, 0] },
|
|
@@ -5002,8 +5047,8 @@ function OTPInput2({
|
|
|
5002
5047
|
)
|
|
5003
5048
|
}
|
|
5004
5049
|
) : null,
|
|
5005
|
-
/* @__PURE__ */
|
|
5006
|
-
|
|
5050
|
+
/* @__PURE__ */ jsx39(AnimatePresence2, { initial: false, children: char ? /* @__PURE__ */ jsx39(
|
|
5051
|
+
motion6.span,
|
|
5007
5052
|
{
|
|
5008
5053
|
initial: reduce ? {
|
|
5009
5054
|
opacity: 0
|
|
@@ -5040,11 +5085,11 @@ function OTPInput2({
|
|
|
5040
5085
|
]
|
|
5041
5086
|
}
|
|
5042
5087
|
),
|
|
5043
|
-
i === 2 ? /* @__PURE__ */
|
|
5088
|
+
i === 2 ? /* @__PURE__ */ jsx39("span", { "aria-hidden": "true", className: "h-0.5 w-4 bg-primary" }) : null
|
|
5044
5089
|
] }, `${uid}-${i}`);
|
|
5045
5090
|
}) }),
|
|
5046
|
-
/* @__PURE__ */
|
|
5047
|
-
|
|
5091
|
+
/* @__PURE__ */ jsx39(AnimatePresence2, { children: showSuccess ? /* @__PURE__ */ jsx39(
|
|
5092
|
+
motion6.span,
|
|
5048
5093
|
{
|
|
5049
5094
|
initial: reduce ? {
|
|
5050
5095
|
opacity: 0
|
|
@@ -5085,9 +5130,9 @@ function OTPInput2({
|
|
|
5085
5130
|
strokeLinecap: "round",
|
|
5086
5131
|
strokeLinejoin: "round",
|
|
5087
5132
|
children: [
|
|
5088
|
-
/* @__PURE__ */
|
|
5089
|
-
/* @__PURE__ */
|
|
5090
|
-
|
|
5133
|
+
/* @__PURE__ */ jsx39("title", { children: "Verified" }),
|
|
5134
|
+
/* @__PURE__ */ jsx39(
|
|
5135
|
+
motion6.path,
|
|
5091
5136
|
{
|
|
5092
5137
|
d: "M5 13l4 4L19 7",
|
|
5093
5138
|
initial: reduce ? {
|
|
@@ -5115,7 +5160,7 @@ function OTPInput2({
|
|
|
5115
5160
|
]
|
|
5116
5161
|
}
|
|
5117
5162
|
),
|
|
5118
|
-
message ? /* @__PURE__ */
|
|
5163
|
+
message ? /* @__PURE__ */ jsx39(
|
|
5119
5164
|
"p",
|
|
5120
5165
|
{
|
|
5121
5166
|
"aria-live": "polite",
|
|
@@ -5138,12 +5183,12 @@ function toSlots(raw, length) {
|
|
|
5138
5183
|
|
|
5139
5184
|
// src/ui/popover.tsx
|
|
5140
5185
|
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
5141
|
-
import { jsx as
|
|
5186
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
5142
5187
|
function Popover({ ...props }) {
|
|
5143
|
-
return /* @__PURE__ */
|
|
5188
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
5144
5189
|
}
|
|
5145
5190
|
function PopoverTrigger({ ...props }) {
|
|
5146
|
-
return /* @__PURE__ */
|
|
5191
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
5147
5192
|
}
|
|
5148
5193
|
function PopoverContent({
|
|
5149
5194
|
className,
|
|
@@ -5153,7 +5198,7 @@ function PopoverContent({
|
|
|
5153
5198
|
sideOffset = 4,
|
|
5154
5199
|
...props
|
|
5155
5200
|
}) {
|
|
5156
|
-
return /* @__PURE__ */
|
|
5201
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx40(
|
|
5157
5202
|
PopoverPrimitive.Positioner,
|
|
5158
5203
|
{
|
|
5159
5204
|
align,
|
|
@@ -5161,7 +5206,7 @@ function PopoverContent({
|
|
|
5161
5206
|
side,
|
|
5162
5207
|
sideOffset,
|
|
5163
5208
|
className: "isolate z-50",
|
|
5164
|
-
children: /* @__PURE__ */
|
|
5209
|
+
children: /* @__PURE__ */ jsx40(
|
|
5165
5210
|
PopoverPrimitive.Popup,
|
|
5166
5211
|
{
|
|
5167
5212
|
"data-slot": "popover-content",
|
|
@@ -5176,7 +5221,7 @@ function PopoverContent({
|
|
|
5176
5221
|
) });
|
|
5177
5222
|
}
|
|
5178
5223
|
function PopoverHeader({ className, ...props }) {
|
|
5179
|
-
return /* @__PURE__ */
|
|
5224
|
+
return /* @__PURE__ */ jsx40(
|
|
5180
5225
|
"div",
|
|
5181
5226
|
{
|
|
5182
5227
|
"data-slot": "popover-header",
|
|
@@ -5186,7 +5231,7 @@ function PopoverHeader({ className, ...props }) {
|
|
|
5186
5231
|
);
|
|
5187
5232
|
}
|
|
5188
5233
|
function PopoverTitle({ className, ...props }) {
|
|
5189
|
-
return /* @__PURE__ */
|
|
5234
|
+
return /* @__PURE__ */ jsx40(
|
|
5190
5235
|
PopoverPrimitive.Title,
|
|
5191
5236
|
{
|
|
5192
5237
|
"data-slot": "popover-title",
|
|
@@ -5199,7 +5244,7 @@ function PopoverDescription({
|
|
|
5199
5244
|
className,
|
|
5200
5245
|
...props
|
|
5201
5246
|
}) {
|
|
5202
|
-
return /* @__PURE__ */
|
|
5247
|
+
return /* @__PURE__ */ jsx40(
|
|
5203
5248
|
PopoverPrimitive.Description,
|
|
5204
5249
|
{
|
|
5205
5250
|
"data-slot": "popover-description",
|
|
@@ -5212,12 +5257,12 @@ function PopoverDescription({
|
|
|
5212
5257
|
// src/ui/quantity.tsx
|
|
5213
5258
|
import { NumberField } from "@base-ui/react/number-field";
|
|
5214
5259
|
import { Minus, Plus } from "@gravity-ui/icons";
|
|
5215
|
-
import * as
|
|
5216
|
-
import { jsx as
|
|
5217
|
-
var QuantityInput =
|
|
5218
|
-
const id =
|
|
5219
|
-
return /* @__PURE__ */
|
|
5220
|
-
/* @__PURE__ */
|
|
5260
|
+
import * as React12 from "react";
|
|
5261
|
+
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5262
|
+
var QuantityInput = React12.forwardRef(function QuantityInput2({ ...props }, ref) {
|
|
5263
|
+
const id = React12.useId();
|
|
5264
|
+
return /* @__PURE__ */ jsx41(NumberField.Root, { id, ...props, className: "flex flex-col items-start", children: /* @__PURE__ */ jsxs22(NumberField.Group, { className: "flex h-8 gap-1", children: [
|
|
5265
|
+
/* @__PURE__ */ jsx41(
|
|
5221
5266
|
NumberField.Decrement,
|
|
5222
5267
|
{
|
|
5223
5268
|
className: buttonVariants({
|
|
@@ -5225,10 +5270,10 @@ var QuantityInput = React11.forwardRef(function QuantityInput2({ ...props }, ref
|
|
|
5225
5270
|
size: "icon-sm",
|
|
5226
5271
|
className: "rounded-full! border-border!"
|
|
5227
5272
|
}),
|
|
5228
|
-
children: /* @__PURE__ */
|
|
5273
|
+
children: /* @__PURE__ */ jsx41(Minus, {})
|
|
5229
5274
|
}
|
|
5230
5275
|
),
|
|
5231
|
-
/* @__PURE__ */
|
|
5276
|
+
/* @__PURE__ */ jsx41(
|
|
5232
5277
|
NumberField.Input,
|
|
5233
5278
|
{
|
|
5234
5279
|
ref,
|
|
@@ -5236,7 +5281,7 @@ var QuantityInput = React11.forwardRef(function QuantityInput2({ ...props }, ref
|
|
|
5236
5281
|
"data-no-ring": true
|
|
5237
5282
|
}
|
|
5238
5283
|
),
|
|
5239
|
-
/* @__PURE__ */
|
|
5284
|
+
/* @__PURE__ */ jsx41(
|
|
5240
5285
|
NumberField.Increment,
|
|
5241
5286
|
{
|
|
5242
5287
|
className: buttonVariants({
|
|
@@ -5244,7 +5289,7 @@ var QuantityInput = React11.forwardRef(function QuantityInput2({ ...props }, ref
|
|
|
5244
5289
|
size: "icon-sm",
|
|
5245
5290
|
className: "rounded-full! border-border!"
|
|
5246
5291
|
}),
|
|
5247
|
-
children: /* @__PURE__ */
|
|
5292
|
+
children: /* @__PURE__ */ jsx41(Plus, {})
|
|
5248
5293
|
}
|
|
5249
5294
|
)
|
|
5250
5295
|
] }) });
|
|
@@ -5253,9 +5298,9 @@ var QuantityInput = React11.forwardRef(function QuantityInput2({ ...props }, ref
|
|
|
5253
5298
|
// src/ui/radio-group.tsx
|
|
5254
5299
|
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
5255
5300
|
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
5256
|
-
import { jsx as
|
|
5301
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
5257
5302
|
function RadioGroup({ className, ...props }) {
|
|
5258
|
-
return /* @__PURE__ */
|
|
5303
|
+
return /* @__PURE__ */ jsx42(
|
|
5259
5304
|
RadioGroupPrimitive,
|
|
5260
5305
|
{
|
|
5261
5306
|
"data-slot": "radio-group",
|
|
@@ -5265,7 +5310,7 @@ function RadioGroup({ className, ...props }) {
|
|
|
5265
5310
|
);
|
|
5266
5311
|
}
|
|
5267
5312
|
function RadioGroupItem({ className, ...props }) {
|
|
5268
|
-
return /* @__PURE__ */
|
|
5313
|
+
return /* @__PURE__ */ jsx42(
|
|
5269
5314
|
RadioPrimitive.Root,
|
|
5270
5315
|
{
|
|
5271
5316
|
"data-slot": "radio-group-item",
|
|
@@ -5274,12 +5319,12 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
5274
5319
|
className
|
|
5275
5320
|
),
|
|
5276
5321
|
...props,
|
|
5277
|
-
children: /* @__PURE__ */
|
|
5322
|
+
children: /* @__PURE__ */ jsx42(
|
|
5278
5323
|
RadioPrimitive.Indicator,
|
|
5279
5324
|
{
|
|
5280
5325
|
"data-slot": "radio-group-indicator",
|
|
5281
5326
|
className: "flex size-4 items-center justify-center",
|
|
5282
|
-
children: /* @__PURE__ */
|
|
5327
|
+
children: /* @__PURE__ */ jsx42("span", { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" })
|
|
5283
5328
|
}
|
|
5284
5329
|
)
|
|
5285
5330
|
}
|
|
@@ -5293,21 +5338,21 @@ import {
|
|
|
5293
5338
|
createContext as createContext5,
|
|
5294
5339
|
useCallback as useCallback4,
|
|
5295
5340
|
useContext as useContext6,
|
|
5296
|
-
useEffect as
|
|
5341
|
+
useEffect as useEffect7,
|
|
5297
5342
|
useId as useId4,
|
|
5298
5343
|
useMemo as useMemo4,
|
|
5299
5344
|
useRef as useRef4,
|
|
5300
|
-
useState as
|
|
5345
|
+
useState as useState9
|
|
5301
5346
|
} from "react";
|
|
5302
5347
|
|
|
5303
5348
|
// src/ui/tooltip.tsx
|
|
5304
5349
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
5305
|
-
import { jsx as
|
|
5350
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5306
5351
|
function TooltipProvider({
|
|
5307
5352
|
delay = 0,
|
|
5308
5353
|
...props
|
|
5309
5354
|
}) {
|
|
5310
|
-
return /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ jsx43(
|
|
5311
5356
|
TooltipPrimitive.Provider,
|
|
5312
5357
|
{
|
|
5313
5358
|
"data-slot": "tooltip-provider",
|
|
@@ -5317,10 +5362,10 @@ function TooltipProvider({
|
|
|
5317
5362
|
);
|
|
5318
5363
|
}
|
|
5319
5364
|
function Tooltip2({ ...props }) {
|
|
5320
|
-
return /* @__PURE__ */
|
|
5365
|
+
return /* @__PURE__ */ jsx43(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
5321
5366
|
}
|
|
5322
5367
|
function TooltipTrigger({ ...props }) {
|
|
5323
|
-
return /* @__PURE__ */
|
|
5368
|
+
return /* @__PURE__ */ jsx43(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
5324
5369
|
}
|
|
5325
5370
|
function TooltipContent({
|
|
5326
5371
|
className,
|
|
@@ -5331,7 +5376,7 @@ function TooltipContent({
|
|
|
5331
5376
|
children,
|
|
5332
5377
|
...props
|
|
5333
5378
|
}) {
|
|
5334
|
-
return /* @__PURE__ */
|
|
5379
|
+
return /* @__PURE__ */ jsx43(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx43(
|
|
5335
5380
|
TooltipPrimitive.Positioner,
|
|
5336
5381
|
{
|
|
5337
5382
|
align,
|
|
@@ -5350,7 +5395,7 @@ function TooltipContent({
|
|
|
5350
5395
|
...props,
|
|
5351
5396
|
children: [
|
|
5352
5397
|
children,
|
|
5353
|
-
/* @__PURE__ */
|
|
5398
|
+
/* @__PURE__ */ jsx43(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })
|
|
5354
5399
|
]
|
|
5355
5400
|
}
|
|
5356
5401
|
)
|
|
@@ -5360,7 +5405,7 @@ function TooltipContent({
|
|
|
5360
5405
|
|
|
5361
5406
|
// src/ui/reui/filters.tsx
|
|
5362
5407
|
import { AlertCircleIcon, CheckIcon as CheckIcon2, PlusIcon, XIcon } from "lucide-react";
|
|
5363
|
-
import { Fragment as Fragment4, jsx as
|
|
5408
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5364
5409
|
var DEFAULT_I18N = {
|
|
5365
5410
|
// UI Labels
|
|
5366
5411
|
addFilter: "Filter",
|
|
@@ -5467,10 +5512,10 @@ function FilterInput({
|
|
|
5467
5512
|
...props
|
|
5468
5513
|
}) {
|
|
5469
5514
|
const context = useFilterContext();
|
|
5470
|
-
const [isValid, setIsValid] =
|
|
5471
|
-
const [validationMessage, setValidationMessage] =
|
|
5515
|
+
const [isValid, setIsValid] = useState9(true);
|
|
5516
|
+
const [validationMessage, setValidationMessage] = useState9("");
|
|
5472
5517
|
const inputRef = useRef4(null);
|
|
5473
|
-
|
|
5518
|
+
useEffect7(() => {
|
|
5474
5519
|
if (props.autoFocus) {
|
|
5475
5520
|
const timer = setTimeout(() => {
|
|
5476
5521
|
inputRef.current?.focus();
|
|
@@ -5544,8 +5589,8 @@ function FilterInput({
|
|
|
5544
5589
|
className
|
|
5545
5590
|
),
|
|
5546
5591
|
children: [
|
|
5547
|
-
field?.prefix && /* @__PURE__ */
|
|
5548
|
-
/* @__PURE__ */
|
|
5592
|
+
field?.prefix && /* @__PURE__ */ jsx44(InputGroupAddon, { children: /* @__PURE__ */ jsx44(InputGroupText, { children: field.prefix }) }),
|
|
5593
|
+
/* @__PURE__ */ jsx44(
|
|
5549
5594
|
InputGroupInput,
|
|
5550
5595
|
{
|
|
5551
5596
|
ref: inputRef,
|
|
@@ -5560,22 +5605,22 @@ function FilterInput({
|
|
|
5560
5605
|
...props
|
|
5561
5606
|
}
|
|
5562
5607
|
),
|
|
5563
|
-
!isValid && validationMessage && /* @__PURE__ */
|
|
5564
|
-
/* @__PURE__ */
|
|
5565
|
-
/* @__PURE__ */
|
|
5608
|
+
!isValid && validationMessage && /* @__PURE__ */ jsx44(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsxs24(Tooltip2, { children: [
|
|
5609
|
+
/* @__PURE__ */ jsx44(TooltipTrigger, { render: /* @__PURE__ */ jsx44(InputGroupButton, { size: "icon-xs" }), children: /* @__PURE__ */ jsx44(AlertCircleIcon, { className: "size-3.5 text-destructive" }) }),
|
|
5610
|
+
/* @__PURE__ */ jsx44(TooltipContent, { children: /* @__PURE__ */ jsx44("p", { className: "text-sm", children: validationMessage }) })
|
|
5566
5611
|
] }) }),
|
|
5567
|
-
field?.suffix && /* @__PURE__ */
|
|
5612
|
+
field?.suffix && /* @__PURE__ */ jsx44(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx44(InputGroupText, { children: field.suffix }) })
|
|
5568
5613
|
]
|
|
5569
5614
|
}
|
|
5570
5615
|
);
|
|
5571
5616
|
}
|
|
5572
5617
|
function FilterRemoveButton({
|
|
5573
5618
|
className,
|
|
5574
|
-
icon = /* @__PURE__ */
|
|
5619
|
+
icon = /* @__PURE__ */ jsx44(XIcon, {}),
|
|
5575
5620
|
...props
|
|
5576
5621
|
}) {
|
|
5577
5622
|
const context = useFilterContext();
|
|
5578
|
-
return /* @__PURE__ */
|
|
5623
|
+
return /* @__PURE__ */ jsx44(
|
|
5579
5624
|
Button,
|
|
5580
5625
|
{
|
|
5581
5626
|
variant: "outline",
|
|
@@ -5633,9 +5678,9 @@ function useFieldOptions(field, searchInput, enabled) {
|
|
|
5633
5678
|
cache.set(opt.value, opt);
|
|
5634
5679
|
}
|
|
5635
5680
|
}
|
|
5636
|
-
const [state, setState] =
|
|
5637
|
-
const [debouncedQuery, setDebouncedQuery] =
|
|
5638
|
-
|
|
5681
|
+
const [state, setState] = useState9(() => ({ options: field.options ?? [], loading: false, error: false }));
|
|
5682
|
+
const [debouncedQuery, setDebouncedQuery] = useState9(searchInput);
|
|
5683
|
+
useEffect7(() => {
|
|
5639
5684
|
if (!isAsync) return;
|
|
5640
5685
|
const timer = setTimeout(() => setDebouncedQuery(searchInput), 250);
|
|
5641
5686
|
return () => clearTimeout(timer);
|
|
@@ -5643,7 +5688,7 @@ function useFieldOptions(field, searchInput, enabled) {
|
|
|
5643
5688
|
const requestIdRef = useRef4(0);
|
|
5644
5689
|
const loaderRef = useRef4(field.loadOptions);
|
|
5645
5690
|
loaderRef.current = field.loadOptions;
|
|
5646
|
-
|
|
5691
|
+
useEffect7(() => {
|
|
5647
5692
|
if (!isAsync || !enabled) return;
|
|
5648
5693
|
const loader = loaderRef.current;
|
|
5649
5694
|
if (!loader) return;
|
|
@@ -5747,10 +5792,10 @@ function FilterOperatorDropdown({
|
|
|
5747
5792
|
);
|
|
5748
5793
|
const operatorLabel = operators.find((op) => op.value === operator)?.label || context.i18n.helpers.formatOperator(operator);
|
|
5749
5794
|
return /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
5750
|
-
/* @__PURE__ */
|
|
5795
|
+
/* @__PURE__ */ jsx44(
|
|
5751
5796
|
DropdownMenuTrigger,
|
|
5752
5797
|
{
|
|
5753
|
-
render: /* @__PURE__ */
|
|
5798
|
+
render: /* @__PURE__ */ jsx44(
|
|
5754
5799
|
Button,
|
|
5755
5800
|
{
|
|
5756
5801
|
variant: "outline",
|
|
@@ -5761,7 +5806,7 @@ function FilterOperatorDropdown({
|
|
|
5761
5806
|
)
|
|
5762
5807
|
}
|
|
5763
5808
|
),
|
|
5764
|
-
/* @__PURE__ */
|
|
5809
|
+
/* @__PURE__ */ jsx44(DropdownMenuContent, { align: "start", className: "w-fit min-w-fit", children: operators.map((op) => /* @__PURE__ */ jsxs24(
|
|
5765
5810
|
DropdownMenuItem,
|
|
5766
5811
|
{
|
|
5767
5812
|
onClick: () => onChange(op.value),
|
|
@@ -5769,8 +5814,8 @@ function FilterOperatorDropdown({
|
|
|
5769
5814
|
"flex items-center justify-between data-highlighted:bg-accent data-highlighted:text-accent-foreground"
|
|
5770
5815
|
),
|
|
5771
5816
|
children: [
|
|
5772
|
-
/* @__PURE__ */
|
|
5773
|
-
/* @__PURE__ */
|
|
5817
|
+
/* @__PURE__ */ jsx44("span", { children: op.label }),
|
|
5818
|
+
/* @__PURE__ */ jsx44(
|
|
5774
5819
|
CheckIcon2,
|
|
5775
5820
|
{
|
|
5776
5821
|
className: cn(
|
|
@@ -5792,21 +5837,21 @@ function SelectOptionsPopover({
|
|
|
5792
5837
|
onClose,
|
|
5793
5838
|
inline = false
|
|
5794
5839
|
}) {
|
|
5795
|
-
const [open, setOpen] =
|
|
5796
|
-
const [searchInput, setSearchInput] =
|
|
5797
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
5840
|
+
const [open, setOpen] = useState9(false);
|
|
5841
|
+
const [searchInput, setSearchInput] = useState9("");
|
|
5842
|
+
const [highlightedIndex, setHighlightedIndex] = useState9(-1);
|
|
5798
5843
|
const inputRef = useRef4(null);
|
|
5799
5844
|
const context = useFilterContext();
|
|
5800
5845
|
const baseId = useId4();
|
|
5801
|
-
|
|
5846
|
+
useEffect7(() => {
|
|
5802
5847
|
if (open) {
|
|
5803
5848
|
inputRef.current?.focus();
|
|
5804
5849
|
}
|
|
5805
5850
|
}, [open]);
|
|
5806
|
-
|
|
5851
|
+
useEffect7(() => {
|
|
5807
5852
|
setHighlightedIndex(-1);
|
|
5808
5853
|
}, [searchInput, open]);
|
|
5809
|
-
|
|
5854
|
+
useEffect7(() => {
|
|
5810
5855
|
if (highlightedIndex >= 0 && open) {
|
|
5811
5856
|
const element = document.getElementById(
|
|
5812
5857
|
`${baseId}-item-${highlightedIndex}`
|
|
@@ -5873,7 +5918,7 @@ function SelectOptionsPopover({
|
|
|
5873
5918
|
onCheckedChange: () => toggleOption(option),
|
|
5874
5919
|
children: [
|
|
5875
5920
|
option.icon && option.icon,
|
|
5876
|
-
/* @__PURE__ */
|
|
5921
|
+
/* @__PURE__ */ jsx44("span", { className: "truncate", children: option.label })
|
|
5877
5922
|
]
|
|
5878
5923
|
},
|
|
5879
5924
|
String(option.value)
|
|
@@ -5881,7 +5926,7 @@ function SelectOptionsPopover({
|
|
|
5881
5926
|
};
|
|
5882
5927
|
const renderMenuContent = () => /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
5883
5928
|
field.searchable !== false && /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
5884
|
-
/* @__PURE__ */
|
|
5929
|
+
/* @__PURE__ */ jsx44(
|
|
5885
5930
|
Input,
|
|
5886
5931
|
{
|
|
5887
5932
|
ref: inputRef,
|
|
@@ -5942,24 +5987,24 @@ function SelectOptionsPopover({
|
|
|
5942
5987
|
}
|
|
5943
5988
|
}
|
|
5944
5989
|
),
|
|
5945
|
-
/* @__PURE__ */
|
|
5990
|
+
/* @__PURE__ */ jsx44(DropdownMenuSeparator, {})
|
|
5946
5991
|
] }),
|
|
5947
|
-
/* @__PURE__ */
|
|
5992
|
+
/* @__PURE__ */ jsx44("div", { className: "relative flex max-h-full", children: /* @__PURE__ */ jsx44(
|
|
5948
5993
|
"div",
|
|
5949
5994
|
{
|
|
5950
5995
|
className: "flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain",
|
|
5951
5996
|
role: "listbox",
|
|
5952
5997
|
id: `${baseId}-listbox`,
|
|
5953
|
-
children: isAsync && loading && allFilteredOptions.length === 0 ? /* @__PURE__ */
|
|
5998
|
+
children: isAsync && loading && allFilteredOptions.length === 0 ? /* @__PURE__ */ jsx44("div", { className: "py-2 text-center text-sm text-muted-foreground", children: context.i18n.loadingOptions ?? DEFAULT_I18N.loadingOptions }) : isAsync && error ? /* @__PURE__ */ jsx44("div", { className: "py-2 text-center text-sm text-muted-foreground", children: context.i18n.errorLoadingOptions ?? DEFAULT_I18N.errorLoadingOptions }) : allFilteredOptions.length === 0 ? /* @__PURE__ */ jsx44("div", { className: "py-2 text-center text-sm text-muted-foreground", children: context.i18n.noResultsFound }) : field.renderOptionList ? field.renderOptionList({
|
|
5954
5999
|
options: allFilteredOptions,
|
|
5955
6000
|
highlightedIndex,
|
|
5956
6001
|
renderOption: renderOptionItem
|
|
5957
6002
|
}) : /* @__PURE__ */ jsxs24(ScrollArea, { className: "size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain", children: [
|
|
5958
|
-
filteredSelectedOptions.length > 0 && /* @__PURE__ */
|
|
6003
|
+
filteredSelectedOptions.length > 0 && /* @__PURE__ */ jsx44(DropdownMenuGroup, { className: "px-1", children: filteredSelectedOptions.map(
|
|
5959
6004
|
(option, index) => renderOptionItem(option, index)
|
|
5960
6005
|
) }),
|
|
5961
|
-
filteredSelectedOptions.length > 0 && filteredUnselectedOptions.length > 0 && /* @__PURE__ */
|
|
5962
|
-
filteredUnselectedOptions.length > 0 && /* @__PURE__ */
|
|
6006
|
+
filteredSelectedOptions.length > 0 && filteredUnselectedOptions.length > 0 && /* @__PURE__ */ jsx44(DropdownMenuSeparator, { className: "mx-0" }),
|
|
6007
|
+
filteredUnselectedOptions.length > 0 && /* @__PURE__ */ jsx44(DropdownMenuGroup, { className: "px-1", children: filteredUnselectedOptions.map(
|
|
5963
6008
|
(option, index) => renderOptionItem(
|
|
5964
6009
|
option,
|
|
5965
6010
|
index + filteredSelectedOptions.length
|
|
@@ -5970,7 +6015,7 @@ function SelectOptionsPopover({
|
|
|
5970
6015
|
) })
|
|
5971
6016
|
] });
|
|
5972
6017
|
if (inline) {
|
|
5973
|
-
return /* @__PURE__ */
|
|
6018
|
+
return /* @__PURE__ */ jsx44("div", { className: "w-full", children: renderMenuContent() });
|
|
5974
6019
|
}
|
|
5975
6020
|
return /* @__PURE__ */ jsxs24(
|
|
5976
6021
|
DropdownMenu,
|
|
@@ -5983,19 +6028,19 @@ function SelectOptionsPopover({
|
|
|
5983
6028
|
}
|
|
5984
6029
|
},
|
|
5985
6030
|
children: [
|
|
5986
|
-
/* @__PURE__ */
|
|
6031
|
+
/* @__PURE__ */ jsx44(
|
|
5987
6032
|
DropdownMenuTrigger,
|
|
5988
6033
|
{
|
|
5989
|
-
render: /* @__PURE__ */
|
|
6034
|
+
render: /* @__PURE__ */ jsx44(Button, { variant: "outline", size: context.size, children: /* @__PURE__ */ jsx44("div", { className: "flex items-center gap-1.5", children: field.customValueRenderer ? field.customValueRenderer(
|
|
5990
6035
|
values,
|
|
5991
6036
|
isAsync ? resolveSelected(values) : field.options || []
|
|
5992
6037
|
) : /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
5993
|
-
selectedOptions.length > 0 && /* @__PURE__ */
|
|
6038
|
+
selectedOptions.length > 0 && /* @__PURE__ */ jsx44("div", { className: "flex items-center -space-x-1.5", children: selectedOptions.slice(0, 3).map((option) => /* @__PURE__ */ jsx44("div", { children: option.icon }, String(option.value))) }),
|
|
5994
6039
|
selectedOptions.length === 1 ? selectedOptions[0].label : selectedOptions.length > 1 ? `${selectedOptions.length} ${context.i18n.selectedCount}` : context.i18n.select
|
|
5995
6040
|
] }) }) })
|
|
5996
6041
|
}
|
|
5997
6042
|
),
|
|
5998
|
-
/* @__PURE__ */
|
|
6043
|
+
/* @__PURE__ */ jsx44(
|
|
5999
6044
|
DropdownMenuContent,
|
|
6000
6045
|
{
|
|
6001
6046
|
align: "start",
|
|
@@ -6018,10 +6063,10 @@ function FilterValueSelector({
|
|
|
6018
6063
|
return null;
|
|
6019
6064
|
}
|
|
6020
6065
|
if (field.customRenderer) {
|
|
6021
|
-
return /* @__PURE__ */
|
|
6066
|
+
return /* @__PURE__ */ jsx44(ButtonGroupText, { className: "bg-background text-start whitespace-nowrap outline-hidden hover:bg-accent aria-expanded:bg-accent dark:bg-input/30", children: field.customRenderer({ field, values, onChange, operator }) });
|
|
6022
6067
|
}
|
|
6023
6068
|
if (field.type === "text") {
|
|
6024
|
-
return /* @__PURE__ */
|
|
6069
|
+
return /* @__PURE__ */ jsx44(
|
|
6025
6070
|
FilterInput,
|
|
6026
6071
|
{
|
|
6027
6072
|
type: "text",
|
|
@@ -6036,9 +6081,9 @@ function FilterValueSelector({
|
|
|
6036
6081
|
);
|
|
6037
6082
|
}
|
|
6038
6083
|
if (field.type === "select" || field.type === "multiselect") {
|
|
6039
|
-
return /* @__PURE__ */
|
|
6084
|
+
return /* @__PURE__ */ jsx44(SelectOptionsPopover, { field, values, onChange });
|
|
6040
6085
|
}
|
|
6041
|
-
return /* @__PURE__ */
|
|
6086
|
+
return /* @__PURE__ */ jsx44(SelectOptionsPopover, { field, values, onChange });
|
|
6042
6087
|
}
|
|
6043
6088
|
var FiltersContent = ({
|
|
6044
6089
|
filters,
|
|
@@ -6070,7 +6115,7 @@ var FiltersContent = ({
|
|
|
6070
6115
|
},
|
|
6071
6116
|
[filters, onChange]
|
|
6072
6117
|
);
|
|
6073
|
-
return /* @__PURE__ */
|
|
6118
|
+
return /* @__PURE__ */ jsx44(
|
|
6074
6119
|
"div",
|
|
6075
6120
|
{
|
|
6076
6121
|
className: cn(
|
|
@@ -6092,7 +6137,7 @@ var FiltersContent = ({
|
|
|
6092
6137
|
field.icon && field.icon,
|
|
6093
6138
|
field.label
|
|
6094
6139
|
] }),
|
|
6095
|
-
/* @__PURE__ */
|
|
6140
|
+
/* @__PURE__ */ jsx44(
|
|
6096
6141
|
FilterOperatorDropdown,
|
|
6097
6142
|
{
|
|
6098
6143
|
field,
|
|
@@ -6101,7 +6146,7 @@ var FiltersContent = ({
|
|
|
6101
6146
|
onChange: (operator) => updateFilter(filter.id, { operator })
|
|
6102
6147
|
}
|
|
6103
6148
|
),
|
|
6104
|
-
/* @__PURE__ */
|
|
6149
|
+
/* @__PURE__ */ jsx44(
|
|
6105
6150
|
FilterValueSelector,
|
|
6106
6151
|
{
|
|
6107
6152
|
field,
|
|
@@ -6111,7 +6156,7 @@ var FiltersContent = ({
|
|
|
6111
6156
|
autoFocus: false
|
|
6112
6157
|
}
|
|
6113
6158
|
),
|
|
6114
|
-
/* @__PURE__ */
|
|
6159
|
+
/* @__PURE__ */ jsx44(FilterRemoveButton, { onClick: () => removeFilter(filter.id) })
|
|
6115
6160
|
]
|
|
6116
6161
|
},
|
|
6117
6162
|
filter.id
|
|
@@ -6131,8 +6176,8 @@ function FilterSubmenuContent({
|
|
|
6131
6176
|
onBack,
|
|
6132
6177
|
onClose
|
|
6133
6178
|
}) {
|
|
6134
|
-
const [searchInput, setSearchInput] =
|
|
6135
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
6179
|
+
const [searchInput, setSearchInput] = useState9("");
|
|
6180
|
+
const [highlightedIndex, setHighlightedIndex] = useState9(-1);
|
|
6136
6181
|
const inputRef = useRef4(null);
|
|
6137
6182
|
const baseId = useId4();
|
|
6138
6183
|
const {
|
|
@@ -6142,7 +6187,7 @@ function FilterSubmenuContent({
|
|
|
6142
6187
|
error,
|
|
6143
6188
|
resolveSelected
|
|
6144
6189
|
} = useFieldOptions(field, searchInput, true);
|
|
6145
|
-
|
|
6190
|
+
useEffect7(() => {
|
|
6146
6191
|
if (isActive) {
|
|
6147
6192
|
if (field.searchable !== false) {
|
|
6148
6193
|
inputRef.current?.focus();
|
|
@@ -6152,10 +6197,10 @@ function FilterSubmenuContent({
|
|
|
6152
6197
|
}
|
|
6153
6198
|
}
|
|
6154
6199
|
}, [isActive, field.searchable, baseId]);
|
|
6155
|
-
|
|
6200
|
+
useEffect7(() => {
|
|
6156
6201
|
setHighlightedIndex(-1);
|
|
6157
6202
|
}, [searchInput]);
|
|
6158
|
-
|
|
6203
|
+
useEffect7(() => {
|
|
6159
6204
|
if (highlightedIndex >= 0 && isActive) {
|
|
6160
6205
|
const element = document.getElementById(
|
|
6161
6206
|
`${baseId}-item-${highlightedIndex}`
|
|
@@ -6208,20 +6253,20 @@ function FilterSubmenuContent({
|
|
|
6208
6253
|
onCheckedChange: () => onToggle(option.value, isSelected),
|
|
6209
6254
|
children: [
|
|
6210
6255
|
option.icon && option.icon,
|
|
6211
|
-
/* @__PURE__ */
|
|
6256
|
+
/* @__PURE__ */ jsx44("span", { className: "truncate", children: option.label })
|
|
6212
6257
|
]
|
|
6213
6258
|
},
|
|
6214
6259
|
String(option.value)
|
|
6215
6260
|
);
|
|
6216
6261
|
};
|
|
6217
|
-
|
|
6262
|
+
useEffect7(() => {
|
|
6218
6263
|
if (isActive && filteredOptions.length > 0) {
|
|
6219
6264
|
setHighlightedIndex(0);
|
|
6220
6265
|
}
|
|
6221
6266
|
}, [isActive, filteredOptions.length]);
|
|
6222
6267
|
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col", onMouseEnter: onActive, children: [
|
|
6223
6268
|
field.searchable !== false && /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
6224
|
-
/* @__PURE__ */
|
|
6269
|
+
/* @__PURE__ */ jsx44(
|
|
6225
6270
|
Input,
|
|
6226
6271
|
{
|
|
6227
6272
|
ref: inputRef,
|
|
@@ -6284,9 +6329,9 @@ function FilterSubmenuContent({
|
|
|
6284
6329
|
}
|
|
6285
6330
|
}
|
|
6286
6331
|
),
|
|
6287
|
-
/* @__PURE__ */
|
|
6332
|
+
/* @__PURE__ */ jsx44(DropdownMenuSeparator, {})
|
|
6288
6333
|
] }),
|
|
6289
|
-
/* @__PURE__ */
|
|
6334
|
+
/* @__PURE__ */ jsx44("div", { className: "relative flex max-h-full", children: /* @__PURE__ */ jsx44(
|
|
6290
6335
|
"div",
|
|
6291
6336
|
{
|
|
6292
6337
|
className: "flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain outline-hidden",
|
|
@@ -6331,11 +6376,11 @@ function FilterSubmenuContent({
|
|
|
6331
6376
|
e.stopPropagation();
|
|
6332
6377
|
}
|
|
6333
6378
|
},
|
|
6334
|
-
children: isAsync && loading && filteredOptions.length === 0 ? /* @__PURE__ */
|
|
6379
|
+
children: isAsync && loading && filteredOptions.length === 0 ? /* @__PURE__ */ jsx44("div", { className: "py-2 text-center text-sm text-muted-foreground", children: i18n.loadingOptions ?? DEFAULT_I18N.loadingOptions }) : isAsync && error ? /* @__PURE__ */ jsx44("div", { className: "py-2 text-center text-sm text-muted-foreground", children: i18n.errorLoadingOptions ?? DEFAULT_I18N.errorLoadingOptions }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx44("div", { className: "py-2 text-center text-sm text-muted-foreground", children: i18n.noResultsFound }) : field.renderOptionList ? field.renderOptionList({
|
|
6335
6380
|
options: filteredOptions,
|
|
6336
6381
|
highlightedIndex,
|
|
6337
6382
|
renderOption: renderOptionItem
|
|
6338
|
-
}) : /* @__PURE__ */
|
|
6383
|
+
}) : /* @__PURE__ */ jsx44(ScrollArea, { className: "size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain", children: /* @__PURE__ */ jsx44(DropdownMenuGroup, { children: filteredOptions.map(
|
|
6339
6384
|
(option, index) => renderOptionItem(option, index)
|
|
6340
6385
|
) }) })
|
|
6341
6386
|
}
|
|
@@ -6359,17 +6404,17 @@ function Filters({
|
|
|
6359
6404
|
shortcutKey = "f",
|
|
6360
6405
|
shortcutLabel = "F"
|
|
6361
6406
|
}) {
|
|
6362
|
-
const [addFilterOpen, setAddFilterOpen] =
|
|
6363
|
-
const [menuSearchInput, setMenuSearchInput] =
|
|
6364
|
-
const [activeMenu, setActiveMenu] =
|
|
6365
|
-
const [openSubMenu, setOpenSubMenu] =
|
|
6366
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
6367
|
-
const [lastAddedFilterId, setLastAddedFilterId] =
|
|
6407
|
+
const [addFilterOpen, setAddFilterOpen] = useState9(false);
|
|
6408
|
+
const [menuSearchInput, setMenuSearchInput] = useState9("");
|
|
6409
|
+
const [activeMenu, setActiveMenu] = useState9("root");
|
|
6410
|
+
const [openSubMenu, setOpenSubMenu] = useState9(null);
|
|
6411
|
+
const [highlightedIndex, setHighlightedIndex] = useState9(-1);
|
|
6412
|
+
const [lastAddedFilterId, setLastAddedFilterId] = useState9(
|
|
6368
6413
|
null
|
|
6369
6414
|
);
|
|
6370
6415
|
const rootInputRef = useRef4(null);
|
|
6371
6416
|
const rootId = useId4();
|
|
6372
|
-
|
|
6417
|
+
useEffect7(() => {
|
|
6373
6418
|
if (!enableShortcut) return;
|
|
6374
6419
|
const handleKeyDown = (e) => {
|
|
6375
6420
|
if (e.key.toLowerCase() === shortcutKey.toLowerCase() && !addFilterOpen && !(document.activeElement instanceof HTMLInputElement || document.activeElement instanceof HTMLTextAreaElement)) {
|
|
@@ -6380,15 +6425,15 @@ function Filters({
|
|
|
6380
6425
|
window.addEventListener("keydown", handleKeyDown);
|
|
6381
6426
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
6382
6427
|
}, [enableShortcut, shortcutKey, addFilterOpen]);
|
|
6383
|
-
|
|
6428
|
+
useEffect7(() => {
|
|
6384
6429
|
if (addFilterOpen && activeMenu === "root") {
|
|
6385
6430
|
rootInputRef.current?.focus();
|
|
6386
6431
|
}
|
|
6387
6432
|
}, [addFilterOpen, activeMenu]);
|
|
6388
|
-
|
|
6433
|
+
useEffect7(() => {
|
|
6389
6434
|
setHighlightedIndex(-1);
|
|
6390
6435
|
}, [menuSearchInput]);
|
|
6391
|
-
|
|
6436
|
+
useEffect7(() => {
|
|
6392
6437
|
if (highlightedIndex >= 0 && addFilterOpen) {
|
|
6393
6438
|
const element = document.getElementById(
|
|
6394
6439
|
`${rootId}-item-${highlightedIndex}`
|
|
@@ -6396,13 +6441,13 @@ function Filters({
|
|
|
6396
6441
|
element?.scrollIntoView({ block: "nearest" });
|
|
6397
6442
|
}
|
|
6398
6443
|
}, [highlightedIndex, addFilterOpen, rootId]);
|
|
6399
|
-
|
|
6444
|
+
useEffect7(() => {
|
|
6400
6445
|
if (!addFilterOpen) {
|
|
6401
6446
|
setOpenSubMenu(null);
|
|
6402
6447
|
}
|
|
6403
6448
|
}, [addFilterOpen]);
|
|
6404
|
-
const [sessionFilterIds, setSessionFilterIds] =
|
|
6405
|
-
|
|
6449
|
+
const [sessionFilterIds, setSessionFilterIds] = useState9({});
|
|
6450
|
+
useEffect7(() => {
|
|
6406
6451
|
if (lastAddedFilterId) {
|
|
6407
6452
|
const timer = setTimeout(() => {
|
|
6408
6453
|
setLastAddedFilterId(null);
|
|
@@ -6476,14 +6521,14 @@ function Filters({
|
|
|
6476
6521
|
(f) => !menuSearchInput || f.label?.toLowerCase().includes(menuSearchInput.toLowerCase())
|
|
6477
6522
|
);
|
|
6478
6523
|
}, [selectableFields, menuSearchInput]);
|
|
6479
|
-
|
|
6524
|
+
useEffect7(() => {
|
|
6480
6525
|
if (addFilterOpen && filteredFields.length > 0) {
|
|
6481
6526
|
setHighlightedIndex(0);
|
|
6482
6527
|
}
|
|
6483
6528
|
}, [addFilterOpen, filteredFields.length]);
|
|
6484
6529
|
const triggerButton = useRender5({
|
|
6485
6530
|
render: trigger ?? /* @__PURE__ */ jsxs24(Button, { variant: "outline", children: [
|
|
6486
|
-
/* @__PURE__ */
|
|
6531
|
+
/* @__PURE__ */ jsx44(PlusIcon, {}),
|
|
6487
6532
|
mergedI18n.addFilter
|
|
6488
6533
|
] }),
|
|
6489
6534
|
defaultTagName: "button"
|
|
@@ -6500,7 +6545,7 @@ function Filters({
|
|
|
6500
6545
|
}),
|
|
6501
6546
|
[variant, size, radius, mergedI18n, className, trigger, allowMultiple]
|
|
6502
6547
|
);
|
|
6503
|
-
return /* @__PURE__ */
|
|
6548
|
+
return /* @__PURE__ */ jsx44(FilterContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs24(
|
|
6504
6549
|
"div",
|
|
6505
6550
|
{
|
|
6506
6551
|
className: cn(filtersContainerVariants({ variant, size }), className),
|
|
@@ -6519,7 +6564,7 @@ function Filters({
|
|
|
6519
6564
|
}
|
|
6520
6565
|
},
|
|
6521
6566
|
children: [
|
|
6522
|
-
/* @__PURE__ */
|
|
6567
|
+
/* @__PURE__ */ jsx44(DropdownMenuTrigger, { render: triggerButton }),
|
|
6523
6568
|
/* @__PURE__ */ jsxs24(
|
|
6524
6569
|
DropdownMenuContent,
|
|
6525
6570
|
{
|
|
@@ -6528,7 +6573,7 @@ function Filters({
|
|
|
6528
6573
|
children: [
|
|
6529
6574
|
showSearchInput && /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
6530
6575
|
/* @__PURE__ */ jsxs24("div", { className: "relative", children: [
|
|
6531
|
-
/* @__PURE__ */
|
|
6576
|
+
/* @__PURE__ */ jsx44(
|
|
6532
6577
|
Input,
|
|
6533
6578
|
{
|
|
6534
6579
|
ref: rootInputRef,
|
|
@@ -6600,20 +6645,20 @@ function Filters({
|
|
|
6600
6645
|
}
|
|
6601
6646
|
}
|
|
6602
6647
|
),
|
|
6603
|
-
enableShortcut && shortcutLabel && /* @__PURE__ */
|
|
6648
|
+
enableShortcut && shortcutLabel && /* @__PURE__ */ jsx44(Kbd, { className: "absolute top-1/2 right-2 -translate-y-1/2 border bg-background", children: shortcutLabel })
|
|
6604
6649
|
] }),
|
|
6605
|
-
/* @__PURE__ */
|
|
6650
|
+
/* @__PURE__ */ jsx44(DropdownMenuSeparator, {})
|
|
6606
6651
|
] }),
|
|
6607
|
-
/* @__PURE__ */
|
|
6652
|
+
/* @__PURE__ */ jsx44("div", { className: "relative flex max-h-full", children: /* @__PURE__ */ jsx44(
|
|
6608
6653
|
"div",
|
|
6609
6654
|
{
|
|
6610
6655
|
className: "flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain",
|
|
6611
6656
|
role: "listbox",
|
|
6612
6657
|
id: `${rootId}-listbox`,
|
|
6613
6658
|
onMouseEnter: () => setActiveMenu("root"),
|
|
6614
|
-
children: /* @__PURE__ */
|
|
6659
|
+
children: /* @__PURE__ */ jsx44(ScrollArea, { className: "**:data-[slot=scroll-area-scrollbar]:m-0", children: (() => {
|
|
6615
6660
|
if (filteredFields.length === 0) {
|
|
6616
|
-
return /* @__PURE__ */
|
|
6661
|
+
return /* @__PURE__ */ jsx44("div", { className: "py-2 text-center text-sm text-muted-foreground", children: mergedI18n.noFieldsFound });
|
|
6617
6662
|
}
|
|
6618
6663
|
return filteredFields.map((field, index) => {
|
|
6619
6664
|
const isHighlighted = highlightedIndex === index;
|
|
@@ -6654,16 +6699,16 @@ function Filters({
|
|
|
6654
6699
|
className: "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground",
|
|
6655
6700
|
children: [
|
|
6656
6701
|
field.icon,
|
|
6657
|
-
/* @__PURE__ */
|
|
6702
|
+
/* @__PURE__ */ jsx44("span", { children: field.label })
|
|
6658
6703
|
]
|
|
6659
6704
|
}
|
|
6660
6705
|
),
|
|
6661
|
-
/* @__PURE__ */
|
|
6706
|
+
/* @__PURE__ */ jsx44(
|
|
6662
6707
|
DropdownMenuSubContent,
|
|
6663
6708
|
{
|
|
6664
6709
|
className: "w-50",
|
|
6665
6710
|
side: "right",
|
|
6666
|
-
children: /* @__PURE__ */
|
|
6711
|
+
children: /* @__PURE__ */ jsx44(
|
|
6667
6712
|
FilterSubmenuContent,
|
|
6668
6713
|
{
|
|
6669
6714
|
field,
|
|
@@ -6748,7 +6793,7 @@ function Filters({
|
|
|
6748
6793
|
className: "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
|
|
6749
6794
|
children: [
|
|
6750
6795
|
field.icon,
|
|
6751
|
-
/* @__PURE__ */
|
|
6796
|
+
/* @__PURE__ */ jsx44("span", { children: field.label })
|
|
6752
6797
|
]
|
|
6753
6798
|
},
|
|
6754
6799
|
field.key
|
|
@@ -6775,7 +6820,7 @@ function Filters({
|
|
|
6775
6820
|
field.icon && field.icon,
|
|
6776
6821
|
field.label
|
|
6777
6822
|
] }),
|
|
6778
|
-
/* @__PURE__ */
|
|
6823
|
+
/* @__PURE__ */ jsx44(
|
|
6779
6824
|
FilterOperatorDropdown,
|
|
6780
6825
|
{
|
|
6781
6826
|
field,
|
|
@@ -6784,7 +6829,7 @@ function Filters({
|
|
|
6784
6829
|
onChange: (operator) => updateFilter(filter.id, { operator })
|
|
6785
6830
|
}
|
|
6786
6831
|
),
|
|
6787
|
-
/* @__PURE__ */
|
|
6832
|
+
/* @__PURE__ */ jsx44(
|
|
6788
6833
|
FilterValueSelector,
|
|
6789
6834
|
{
|
|
6790
6835
|
field,
|
|
@@ -6794,7 +6839,7 @@ function Filters({
|
|
|
6794
6839
|
autoFocus: filter.id === lastAddedFilterId
|
|
6795
6840
|
}
|
|
6796
6841
|
),
|
|
6797
|
-
/* @__PURE__ */
|
|
6842
|
+
/* @__PURE__ */ jsx44(FilterRemoveButton, { onClick: () => removeFilter(filter.id) })
|
|
6798
6843
|
]
|
|
6799
6844
|
},
|
|
6800
6845
|
filter.id
|
|
@@ -6820,10 +6865,10 @@ var createFilterGroup = (id, label, fields, initialFilters = []) => ({
|
|
|
6820
6865
|
// src/ui/select.tsx
|
|
6821
6866
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
6822
6867
|
import { Check as Check2, ChevronDown as ChevronDown3, ChevronUp as ChevronUp2 } from "@gravity-ui/icons";
|
|
6823
|
-
import { jsx as
|
|
6868
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6824
6869
|
var Select = SelectPrimitive.Root;
|
|
6825
6870
|
function SelectGroup({ className, ...props }) {
|
|
6826
|
-
return /* @__PURE__ */
|
|
6871
|
+
return /* @__PURE__ */ jsx45(
|
|
6827
6872
|
SelectPrimitive.Group,
|
|
6828
6873
|
{
|
|
6829
6874
|
"data-slot": "select-group",
|
|
@@ -6833,7 +6878,7 @@ function SelectGroup({ className, ...props }) {
|
|
|
6833
6878
|
);
|
|
6834
6879
|
}
|
|
6835
6880
|
function SelectValue({ className, ...props }) {
|
|
6836
|
-
return /* @__PURE__ */
|
|
6881
|
+
return /* @__PURE__ */ jsx45(
|
|
6837
6882
|
SelectPrimitive.Value,
|
|
6838
6883
|
{
|
|
6839
6884
|
"data-slot": "select-value",
|
|
@@ -6860,10 +6905,10 @@ function SelectTrigger({
|
|
|
6860
6905
|
...props,
|
|
6861
6906
|
children: [
|
|
6862
6907
|
children,
|
|
6863
|
-
/* @__PURE__ */
|
|
6908
|
+
/* @__PURE__ */ jsx45(
|
|
6864
6909
|
SelectPrimitive.Icon,
|
|
6865
6910
|
{
|
|
6866
|
-
render: /* @__PURE__ */
|
|
6911
|
+
render: /* @__PURE__ */ jsx45(ChevronDown3, { className: "pointer-events-none size-4 text-muted-foreground" })
|
|
6867
6912
|
}
|
|
6868
6913
|
)
|
|
6869
6914
|
]
|
|
@@ -6880,7 +6925,7 @@ function SelectContent({
|
|
|
6880
6925
|
alignItemWithTrigger = true,
|
|
6881
6926
|
...props
|
|
6882
6927
|
}) {
|
|
6883
|
-
return /* @__PURE__ */
|
|
6928
|
+
return /* @__PURE__ */ jsx45(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx45(
|
|
6884
6929
|
SelectPrimitive.Positioner,
|
|
6885
6930
|
{
|
|
6886
6931
|
side,
|
|
@@ -6900,9 +6945,9 @@ function SelectContent({
|
|
|
6900
6945
|
),
|
|
6901
6946
|
...props,
|
|
6902
6947
|
children: [
|
|
6903
|
-
/* @__PURE__ */
|
|
6904
|
-
/* @__PURE__ */
|
|
6905
|
-
/* @__PURE__ */
|
|
6948
|
+
/* @__PURE__ */ jsx45(SelectScrollUpButton, {}),
|
|
6949
|
+
/* @__PURE__ */ jsx45(SelectPrimitive.List, { className: "p-1", children }),
|
|
6950
|
+
/* @__PURE__ */ jsx45(SelectScrollDownButton, {})
|
|
6906
6951
|
]
|
|
6907
6952
|
}
|
|
6908
6953
|
)
|
|
@@ -6913,7 +6958,7 @@ function SelectLabel({
|
|
|
6913
6958
|
className,
|
|
6914
6959
|
...props
|
|
6915
6960
|
}) {
|
|
6916
|
-
return /* @__PURE__ */
|
|
6961
|
+
return /* @__PURE__ */ jsx45(
|
|
6917
6962
|
SelectPrimitive.GroupLabel,
|
|
6918
6963
|
{
|
|
6919
6964
|
"data-slot": "select-label",
|
|
@@ -6937,12 +6982,12 @@ function SelectItem({
|
|
|
6937
6982
|
),
|
|
6938
6983
|
...props,
|
|
6939
6984
|
children: [
|
|
6940
|
-
/* @__PURE__ */
|
|
6941
|
-
/* @__PURE__ */
|
|
6985
|
+
/* @__PURE__ */ jsx45(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children }),
|
|
6986
|
+
/* @__PURE__ */ jsx45(
|
|
6942
6987
|
SelectPrimitive.ItemIndicator,
|
|
6943
6988
|
{
|
|
6944
|
-
render: /* @__PURE__ */
|
|
6945
|
-
children: /* @__PURE__ */
|
|
6989
|
+
render: /* @__PURE__ */ jsx45("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
6990
|
+
children: /* @__PURE__ */ jsx45(Check2, { className: "pointer-events-none" })
|
|
6946
6991
|
}
|
|
6947
6992
|
)
|
|
6948
6993
|
]
|
|
@@ -6953,7 +6998,7 @@ function SelectSeparator({
|
|
|
6953
6998
|
className,
|
|
6954
6999
|
...props
|
|
6955
7000
|
}) {
|
|
6956
|
-
return /* @__PURE__ */
|
|
7001
|
+
return /* @__PURE__ */ jsx45(
|
|
6957
7002
|
SelectPrimitive.Separator,
|
|
6958
7003
|
{
|
|
6959
7004
|
"data-slot": "select-separator",
|
|
@@ -6966,7 +7011,7 @@ function SelectScrollUpButton({
|
|
|
6966
7011
|
className,
|
|
6967
7012
|
...props
|
|
6968
7013
|
}) {
|
|
6969
|
-
return /* @__PURE__ */
|
|
7014
|
+
return /* @__PURE__ */ jsx45(
|
|
6970
7015
|
SelectPrimitive.ScrollUpArrow,
|
|
6971
7016
|
{
|
|
6972
7017
|
"data-slot": "select-scroll-up-button",
|
|
@@ -6975,7 +7020,7 @@ function SelectScrollUpButton({
|
|
|
6975
7020
|
className
|
|
6976
7021
|
),
|
|
6977
7022
|
...props,
|
|
6978
|
-
children: /* @__PURE__ */
|
|
7023
|
+
children: /* @__PURE__ */ jsx45(ChevronUp2, {})
|
|
6979
7024
|
}
|
|
6980
7025
|
);
|
|
6981
7026
|
}
|
|
@@ -6983,7 +7028,7 @@ function SelectScrollDownButton({
|
|
|
6983
7028
|
className,
|
|
6984
7029
|
...props
|
|
6985
7030
|
}) {
|
|
6986
|
-
return /* @__PURE__ */
|
|
7031
|
+
return /* @__PURE__ */ jsx45(
|
|
6987
7032
|
SelectPrimitive.ScrollDownArrow,
|
|
6988
7033
|
{
|
|
6989
7034
|
"data-slot": "select-scroll-down-button",
|
|
@@ -6992,7 +7037,7 @@ function SelectScrollDownButton({
|
|
|
6992
7037
|
className
|
|
6993
7038
|
),
|
|
6994
7039
|
...props,
|
|
6995
|
-
children: /* @__PURE__ */
|
|
7040
|
+
children: /* @__PURE__ */ jsx45(ChevronDown3, {})
|
|
6996
7041
|
}
|
|
6997
7042
|
);
|
|
6998
7043
|
}
|
|
@@ -7002,7 +7047,7 @@ import {
|
|
|
7002
7047
|
forwardRef as forwardRef4,
|
|
7003
7048
|
useLayoutEffect
|
|
7004
7049
|
} from "react";
|
|
7005
|
-
import { jsx as
|
|
7050
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
7006
7051
|
var componentThemeClassName = "[--ic-background:#ffffff] [--ic-foreground:#111111] [--ic-primary:#111111] [--ic-secondary:#646b75] [--ic-surface-border:#e9edf2] [--ic-border:#e3e7ec] [--ic-card:#ffffff] [--ic-card-foreground:#111111] [--ic-muted:#f5f7fa] [--ic-muted-foreground:#6d7480] [--ic-accent:#f3f5f8] [--color-accent:var(--ic-accent)] [--color-accent-foreground:var(--ic-accent-foreground)] [--ic-accent-foreground:#111111] [--ic-input:#e3e7ec] [--ic-ring:rgba(17,17,17,0.16)] [--ic-destructive:#dc2626] [--ic-paper:#fcfcfd] [--ic-popover-foreground:#111111] [--ic-brand:#0ea5e9] [--ic-brand-soft:#bae6fd] [--ic-shadow-soft:0_18px_38px_-24px_rgba(15,23,42,0.35)] [--ic-chart-1:oklch(0.52_0.19_254)] [--ic-chart-2:oklch(0.74_0.11_232)] [--ic-chart-3:oklch(0.42_0.16_262)] [--ic-chart-4:oklch(0.84_0.07_228)] [--ic-chart-5:oklch(0.62_0.14_240)] [--color-background:var(--ic-background)] [--color-foreground:var(--ic-foreground)] [--color-primary:var(--ic-primary)] [--color-secondary:var(--ic-secondary)] [--color-border:var(--ic-border)] [--color-card:var(--ic-card)] [--color-card-foreground:var(--ic-card-foreground)] [--color-muted:var(--ic-muted)] [--color-muted-foreground:var(--ic-muted-foreground)] [--color-accent:var(--ic-accent)] [--color-accent-foreground:var(--ic-accent-foreground)] [--color-input:var(--ic-input)] [--color-ring:var(--ic-ring)] [--color-destructive:var(--ic-destructive)] [--color-paper:var(--ic-paper)] [--color-popover-foreground:var(--ic-popover-foreground)] [--color-brand:var(--ic-brand)] [--color-brand-soft:var(--ic-brand-soft)] [--color-chart-1:var(--ic-chart-1)] [--color-chart-2:var(--ic-chart-2)] [--color-chart-3:var(--ic-chart-3)] [--color-chart-4:var(--ic-chart-4)] [--color-chart-5:var(--ic-chart-5)] dark:[--ic-background:#111111] dark:[--ic-foreground:#f6f3ec] dark:[--ic-primary:#f6f3ec] dark:[--ic-secondary:#cbc6bb] dark:[--ic-surface-border:#2a2a25] dark:[--ic-border:#2b2a25] dark:[--ic-card:#111111] dark:[--ic-card-foreground:#f6f3ec] dark:[--ic-muted:#171716] dark:[--ic-muted-foreground:#9a958a] dark:[--ic-accent:#1a1a18] [--color-accent:var(--ic-accent)] [--color-accent-foreground:var(--ic-accent-foreground)] dark:[--ic-accent-foreground:#f6f3ec] dark:[--ic-input:#2b2a25] dark:[--ic-ring:rgba(246,243,236,0.18)] dark:[--ic-destructive:#f87171] dark:[--ic-paper:#171716] dark:[--ic-popover-foreground:#f6f3ec] dark:[--ic-brand:#38bdf8] dark:[--ic-brand-soft:#0c4a6e] dark:[--ic-shadow-soft:0_20px_44px_-28px_rgba(0,0,0,0.6)] dark:[--ic-chart-1:oklch(0.68_0.17_250)] dark:[--ic-chart-2:oklch(0.82_0.09_225)] dark:[--ic-chart-3:oklch(0.58_0.15_260)] dark:[--ic-chart-4:oklch(0.75_0.12_235)] dark:[--ic-chart-5:oklch(0.88_0.06_220)]";
|
|
7007
7052
|
var STYLE_ID = "iconiq-skeleton-styles";
|
|
7008
7053
|
var SKELETON_CSS = `
|
|
@@ -7123,7 +7168,7 @@ var Skeleton = forwardRef4(function Skeleton2({
|
|
|
7123
7168
|
...style,
|
|
7124
7169
|
"--iconiq-skeleton-duration": `${variantDuration}s`
|
|
7125
7170
|
} : style;
|
|
7126
|
-
return /* @__PURE__ */
|
|
7171
|
+
return /* @__PURE__ */ jsx46(
|
|
7127
7172
|
"div",
|
|
7128
7173
|
{
|
|
7129
7174
|
className: cn(
|
|
@@ -7137,7 +7182,7 @@ var Skeleton = forwardRef4(function Skeleton2({
|
|
|
7137
7182
|
style: animatedStyle,
|
|
7138
7183
|
...resolveSkeletonA11yProps({ animate: animate2, decorative, label }),
|
|
7139
7184
|
...props,
|
|
7140
|
-
children: showShimmer ? /* @__PURE__ */
|
|
7185
|
+
children: showShimmer ? /* @__PURE__ */ jsx46(
|
|
7141
7186
|
"span",
|
|
7142
7187
|
{
|
|
7143
7188
|
"aria-hidden": "true",
|
|
@@ -7152,7 +7197,7 @@ function SkeletonAvatar({
|
|
|
7152
7197
|
className,
|
|
7153
7198
|
...props
|
|
7154
7199
|
}) {
|
|
7155
|
-
return /* @__PURE__ */
|
|
7200
|
+
return /* @__PURE__ */ jsx46(
|
|
7156
7201
|
Skeleton,
|
|
7157
7202
|
{
|
|
7158
7203
|
className: cn("size-10", className),
|
|
@@ -7163,13 +7208,13 @@ function SkeletonAvatar({
|
|
|
7163
7208
|
);
|
|
7164
7209
|
}
|
|
7165
7210
|
function SkeletonText({ className, ...props }) {
|
|
7166
|
-
return /* @__PURE__ */
|
|
7211
|
+
return /* @__PURE__ */ jsx46(Skeleton, { className: cn("h-3", className), decorative: true, ...props });
|
|
7167
7212
|
}
|
|
7168
7213
|
function SkeletonButton({
|
|
7169
7214
|
className,
|
|
7170
7215
|
...props
|
|
7171
7216
|
}) {
|
|
7172
|
-
return /* @__PURE__ */
|
|
7217
|
+
return /* @__PURE__ */ jsx46(
|
|
7173
7218
|
Skeleton,
|
|
7174
7219
|
{
|
|
7175
7220
|
className: cn("h-9 w-24", className),
|
|
@@ -7184,11 +7229,11 @@ var ShimmerSkeleton = Skeleton;
|
|
|
7184
7229
|
// src/ui/sonner.tsx
|
|
7185
7230
|
import { GooeyToaster } from "goey-toast";
|
|
7186
7231
|
import { useTheme } from "next-themes";
|
|
7187
|
-
import { jsx as
|
|
7232
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
7188
7233
|
var Toaster = ({ closeButton = "top-left", ...props }) => {
|
|
7189
7234
|
const { theme = "system" } = useTheme();
|
|
7190
7235
|
const toasterTheme = theme === "dark" ? "dark" : "light";
|
|
7191
|
-
return /* @__PURE__ */
|
|
7236
|
+
return /* @__PURE__ */ jsx47(
|
|
7192
7237
|
GooeyToaster,
|
|
7193
7238
|
{
|
|
7194
7239
|
theme: toasterTheme,
|
|
@@ -7228,11 +7273,11 @@ import {
|
|
|
7228
7273
|
verticalListSortingStrategy
|
|
7229
7274
|
} from "@dnd-kit/sortable";
|
|
7230
7275
|
import { CSS } from "@dnd-kit/utilities";
|
|
7231
|
-
import * as
|
|
7276
|
+
import * as React15 from "react";
|
|
7232
7277
|
import * as ReactDOM from "react-dom";
|
|
7233
7278
|
|
|
7234
7279
|
// src/lib/compose-refs.ts
|
|
7235
|
-
import * as
|
|
7280
|
+
import * as React13 from "react";
|
|
7236
7281
|
function setRef(ref, value) {
|
|
7237
7282
|
if (typeof ref === "function") {
|
|
7238
7283
|
return ref(value);
|
|
@@ -7266,15 +7311,15 @@ function composeRefs(...refs) {
|
|
|
7266
7311
|
};
|
|
7267
7312
|
}
|
|
7268
7313
|
function useComposedRefs(...refs) {
|
|
7269
|
-
return
|
|
7314
|
+
return React13.useCallback(composeRefs(...refs), refs);
|
|
7270
7315
|
}
|
|
7271
7316
|
|
|
7272
7317
|
// src/hooks/use-isomorphic-layout-effect.ts
|
|
7273
|
-
import * as
|
|
7274
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
7318
|
+
import * as React14 from "react";
|
|
7319
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React14.useLayoutEffect : React14.useEffect;
|
|
7275
7320
|
|
|
7276
7321
|
// src/ui/sortable.tsx
|
|
7277
|
-
import { jsx as
|
|
7322
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
7278
7323
|
var orientationConfig = {
|
|
7279
7324
|
vertical: {
|
|
7280
7325
|
modifiers: [restrictToVerticalAxis, restrictToParentElement],
|
|
@@ -7297,9 +7342,9 @@ var CONTENT_NAME = "SortableContent";
|
|
|
7297
7342
|
var ITEM_NAME = "SortableItem";
|
|
7298
7343
|
var ITEM_HANDLE_NAME = "SortableItemHandle";
|
|
7299
7344
|
var OVERLAY_NAME = "SortableOverlay";
|
|
7300
|
-
var SortableRootContext =
|
|
7345
|
+
var SortableRootContext = React15.createContext(null);
|
|
7301
7346
|
function useSortableContext(consumerName) {
|
|
7302
|
-
const context =
|
|
7347
|
+
const context = React15.useContext(SortableRootContext);
|
|
7303
7348
|
if (!context) {
|
|
7304
7349
|
throw new Error(`\`${consumerName}\` must be used within \`${ROOT_NAME}\``);
|
|
7305
7350
|
}
|
|
@@ -7319,8 +7364,8 @@ function Sortable(props) {
|
|
|
7319
7364
|
accessibility,
|
|
7320
7365
|
...sortableProps
|
|
7321
7366
|
} = props;
|
|
7322
|
-
const id =
|
|
7323
|
-
const [activeId, setActiveId] =
|
|
7367
|
+
const id = React15.useId();
|
|
7368
|
+
const [activeId, setActiveId] = React15.useState(null);
|
|
7324
7369
|
const sensors = useSensors(
|
|
7325
7370
|
useSensor(MouseSensor),
|
|
7326
7371
|
useSensor(TouchSensor),
|
|
@@ -7328,11 +7373,11 @@ function Sortable(props) {
|
|
|
7328
7373
|
coordinateGetter: sortableKeyboardCoordinates
|
|
7329
7374
|
})
|
|
7330
7375
|
);
|
|
7331
|
-
const config =
|
|
7376
|
+
const config = React15.useMemo(
|
|
7332
7377
|
() => orientationConfig[orientation],
|
|
7333
7378
|
[orientation]
|
|
7334
7379
|
);
|
|
7335
|
-
const getItemValue =
|
|
7380
|
+
const getItemValue = React15.useCallback(
|
|
7336
7381
|
(item) => {
|
|
7337
7382
|
if (typeof item === "object" && !getItemValueProp) {
|
|
7338
7383
|
throw new Error(
|
|
@@ -7343,10 +7388,10 @@ function Sortable(props) {
|
|
|
7343
7388
|
},
|
|
7344
7389
|
[getItemValueProp]
|
|
7345
7390
|
);
|
|
7346
|
-
const items =
|
|
7391
|
+
const items = React15.useMemo(() => {
|
|
7347
7392
|
return value.map((item) => getItemValue(item));
|
|
7348
7393
|
}, [value, getItemValue]);
|
|
7349
|
-
const onDragStart =
|
|
7394
|
+
const onDragStart = React15.useCallback(
|
|
7350
7395
|
(event) => {
|
|
7351
7396
|
sortableProps.onDragStart?.(event);
|
|
7352
7397
|
if (event.activatorEvent.defaultPrevented) return;
|
|
@@ -7354,7 +7399,7 @@ function Sortable(props) {
|
|
|
7354
7399
|
},
|
|
7355
7400
|
[sortableProps.onDragStart]
|
|
7356
7401
|
);
|
|
7357
|
-
const onDragEnd =
|
|
7402
|
+
const onDragEnd = React15.useCallback(
|
|
7358
7403
|
(event) => {
|
|
7359
7404
|
sortableProps.onDragEnd?.(event);
|
|
7360
7405
|
if (event.activatorEvent.defaultPrevented) return;
|
|
@@ -7376,7 +7421,7 @@ function Sortable(props) {
|
|
|
7376
7421
|
},
|
|
7377
7422
|
[value, onValueChange, onMove, getItemValue, sortableProps.onDragEnd]
|
|
7378
7423
|
);
|
|
7379
|
-
const onDragCancel =
|
|
7424
|
+
const onDragCancel = React15.useCallback(
|
|
7380
7425
|
(event) => {
|
|
7381
7426
|
sortableProps.onDragCancel?.(event);
|
|
7382
7427
|
if (event.activatorEvent.defaultPrevented) return;
|
|
@@ -7384,7 +7429,7 @@ function Sortable(props) {
|
|
|
7384
7429
|
},
|
|
7385
7430
|
[sortableProps.onDragCancel]
|
|
7386
7431
|
);
|
|
7387
|
-
const announcements =
|
|
7432
|
+
const announcements = React15.useMemo(
|
|
7388
7433
|
() => ({
|
|
7389
7434
|
onDragStart({ active }) {
|
|
7390
7435
|
const activeValue = active.id.toString();
|
|
@@ -7426,7 +7471,7 @@ function Sortable(props) {
|
|
|
7426
7471
|
}),
|
|
7427
7472
|
[value]
|
|
7428
7473
|
);
|
|
7429
|
-
const screenReaderInstructions =
|
|
7474
|
+
const screenReaderInstructions = React15.useMemo(
|
|
7430
7475
|
() => ({
|
|
7431
7476
|
draggable: `
|
|
7432
7477
|
To pick up a sortable item, press space or enter.
|
|
@@ -7436,7 +7481,7 @@ function Sortable(props) {
|
|
|
7436
7481
|
}),
|
|
7437
7482
|
[orientation]
|
|
7438
7483
|
);
|
|
7439
|
-
const contextValue =
|
|
7484
|
+
const contextValue = React15.useMemo(
|
|
7440
7485
|
() => ({
|
|
7441
7486
|
id,
|
|
7442
7487
|
items,
|
|
@@ -7459,11 +7504,11 @@ function Sortable(props) {
|
|
|
7459
7504
|
flatCursor
|
|
7460
7505
|
]
|
|
7461
7506
|
);
|
|
7462
|
-
return /* @__PURE__ */
|
|
7507
|
+
return /* @__PURE__ */ jsx48(
|
|
7463
7508
|
SortableRootContext.Provider,
|
|
7464
7509
|
{
|
|
7465
7510
|
value: contextValue,
|
|
7466
|
-
children: /* @__PURE__ */
|
|
7511
|
+
children: /* @__PURE__ */ jsx48(
|
|
7467
7512
|
DndContext,
|
|
7468
7513
|
{
|
|
7469
7514
|
collisionDetection: collisionDetection ?? config.collisionDetection,
|
|
@@ -7484,7 +7529,7 @@ function Sortable(props) {
|
|
|
7484
7529
|
}
|
|
7485
7530
|
);
|
|
7486
7531
|
}
|
|
7487
|
-
var SortableContentContext =
|
|
7532
|
+
var SortableContentContext = React15.createContext(false);
|
|
7488
7533
|
function SortableContent(props) {
|
|
7489
7534
|
const {
|
|
7490
7535
|
strategy: strategyProp,
|
|
@@ -7512,7 +7557,7 @@ function SortableContent(props) {
|
|
|
7512
7557
|
},
|
|
7513
7558
|
enabled: !withoutSlot
|
|
7514
7559
|
});
|
|
7515
|
-
return /* @__PURE__ */
|
|
7560
|
+
return /* @__PURE__ */ jsx48(SortableContentContext.Provider, { value: true, children: /* @__PURE__ */ jsx48(
|
|
7516
7561
|
SortableContext,
|
|
7517
7562
|
{
|
|
7518
7563
|
items: context.items,
|
|
@@ -7521,9 +7566,9 @@ function SortableContent(props) {
|
|
|
7521
7566
|
}
|
|
7522
7567
|
) });
|
|
7523
7568
|
}
|
|
7524
|
-
var SortableItemContext =
|
|
7569
|
+
var SortableItemContext = React15.createContext(null);
|
|
7525
7570
|
function useSortableItemContext(consumerName) {
|
|
7526
|
-
const context =
|
|
7571
|
+
const context = React15.useContext(SortableItemContext);
|
|
7527
7572
|
if (!context) {
|
|
7528
7573
|
throw new Error(`\`${consumerName}\` must be used within \`${ITEM_NAME}\``);
|
|
7529
7574
|
}
|
|
@@ -7540,8 +7585,8 @@ function SortableItem(props) {
|
|
|
7540
7585
|
ref,
|
|
7541
7586
|
...itemProps
|
|
7542
7587
|
} = props;
|
|
7543
|
-
const inSortableContent =
|
|
7544
|
-
const inSortableOverlay =
|
|
7588
|
+
const inSortableContent = React15.useContext(SortableContentContext);
|
|
7589
|
+
const inSortableOverlay = React15.useContext(SortableOverlayContext);
|
|
7545
7590
|
if (!inSortableContent && !inSortableOverlay) {
|
|
7546
7591
|
throw new Error(
|
|
7547
7592
|
`\`${ITEM_NAME}\` must be used within \`${CONTENT_NAME}\` or \`${OVERLAY_NAME}\``
|
|
@@ -7551,7 +7596,7 @@ function SortableItem(props) {
|
|
|
7551
7596
|
throw new Error(`\`${ITEM_NAME}\` value cannot be an empty string`);
|
|
7552
7597
|
}
|
|
7553
7598
|
const context = useSortableContext(ITEM_NAME);
|
|
7554
|
-
const id =
|
|
7599
|
+
const id = React15.useId();
|
|
7555
7600
|
const {
|
|
7556
7601
|
attributes,
|
|
7557
7602
|
listeners,
|
|
@@ -7561,7 +7606,7 @@ function SortableItem(props) {
|
|
|
7561
7606
|
transition,
|
|
7562
7607
|
isDragging
|
|
7563
7608
|
} = useSortable({ id: value, disabled });
|
|
7564
|
-
const onNodeRefChange =
|
|
7609
|
+
const onNodeRefChange = React15.useCallback(
|
|
7565
7610
|
(node) => {
|
|
7566
7611
|
if (disabled) return;
|
|
7567
7612
|
setNodeRef(node);
|
|
@@ -7570,14 +7615,14 @@ function SortableItem(props) {
|
|
|
7570
7615
|
[disabled, asHandle, setNodeRef, setActivatorNodeRef]
|
|
7571
7616
|
);
|
|
7572
7617
|
const composedRef = useComposedRefs(ref, onNodeRefChange);
|
|
7573
|
-
const composedStyle =
|
|
7618
|
+
const composedStyle = React15.useMemo(() => {
|
|
7574
7619
|
return {
|
|
7575
7620
|
transform: CSS.Translate.toString(transform),
|
|
7576
7621
|
transition,
|
|
7577
7622
|
...style
|
|
7578
7623
|
};
|
|
7579
7624
|
}, [transform, transition, style]);
|
|
7580
|
-
const itemContext =
|
|
7625
|
+
const itemContext = React15.useMemo(
|
|
7581
7626
|
() => ({
|
|
7582
7627
|
id,
|
|
7583
7628
|
attributes,
|
|
@@ -7619,7 +7664,7 @@ function SortableItem(props) {
|
|
|
7619
7664
|
...isDragging && { dragging: "" }
|
|
7620
7665
|
}
|
|
7621
7666
|
});
|
|
7622
|
-
return /* @__PURE__ */
|
|
7667
|
+
return /* @__PURE__ */ jsx48(SortableItemContext.Provider, { value: itemContext, children: element });
|
|
7623
7668
|
}
|
|
7624
7669
|
function SortableItemHandle(props) {
|
|
7625
7670
|
const { disabled, className, render, ref, ...itemHandleProps } = props;
|
|
@@ -7627,7 +7672,7 @@ function SortableItemHandle(props) {
|
|
|
7627
7672
|
const itemContext = useSortableItemContext(ITEM_HANDLE_NAME);
|
|
7628
7673
|
const isDisabled = disabled ?? itemContext.disabled;
|
|
7629
7674
|
const { setActivatorNodeRef } = itemContext;
|
|
7630
|
-
const onActivatorNodeRef =
|
|
7675
|
+
const onActivatorNodeRef = React15.useCallback(
|
|
7631
7676
|
(node) => {
|
|
7632
7677
|
if (isDisabled) return;
|
|
7633
7678
|
setActivatorNodeRef(node);
|
|
@@ -7661,7 +7706,7 @@ function SortableItemHandle(props) {
|
|
|
7661
7706
|
}
|
|
7662
7707
|
});
|
|
7663
7708
|
}
|
|
7664
|
-
var SortableOverlayContext =
|
|
7709
|
+
var SortableOverlayContext = React15.createContext(false);
|
|
7665
7710
|
var dropAnimation = {
|
|
7666
7711
|
sideEffects: defaultDropAnimationSideEffects({
|
|
7667
7712
|
styles: {
|
|
@@ -7674,19 +7719,19 @@ var dropAnimation = {
|
|
|
7674
7719
|
function SortableOverlay(props) {
|
|
7675
7720
|
const { container: containerProp, children, ...overlayProps } = props;
|
|
7676
7721
|
const context = useSortableContext(OVERLAY_NAME);
|
|
7677
|
-
const [mounted, setMounted] =
|
|
7722
|
+
const [mounted, setMounted] = React15.useState(false);
|
|
7678
7723
|
useIsomorphicLayoutEffect(() => setMounted(true), []);
|
|
7679
7724
|
const container = containerProp ?? (mounted ? globalThis.document?.body : null);
|
|
7680
7725
|
if (!container) return null;
|
|
7681
7726
|
return ReactDOM.createPortal(
|
|
7682
|
-
/* @__PURE__ */
|
|
7727
|
+
/* @__PURE__ */ jsx48(
|
|
7683
7728
|
DragOverlay,
|
|
7684
7729
|
{
|
|
7685
7730
|
dropAnimation,
|
|
7686
7731
|
modifiers: context.modifiers,
|
|
7687
7732
|
className: cn(!context.flatCursor && "cursor-grabbing"),
|
|
7688
7733
|
...overlayProps,
|
|
7689
|
-
children: /* @__PURE__ */
|
|
7734
|
+
children: /* @__PURE__ */ jsx48(SortableOverlayContext.Provider, { value: true, children: context.activeId ? typeof children === "function" ? children({ value: context.activeId }) : children : null })
|
|
7690
7735
|
}
|
|
7691
7736
|
),
|
|
7692
7737
|
container
|
|
@@ -7695,13 +7740,13 @@ function SortableOverlay(props) {
|
|
|
7695
7740
|
|
|
7696
7741
|
// src/ui/switch.tsx
|
|
7697
7742
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
7698
|
-
import { jsx as
|
|
7743
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
7699
7744
|
function Switch({
|
|
7700
7745
|
className,
|
|
7701
7746
|
size = "default",
|
|
7702
7747
|
...props
|
|
7703
7748
|
}) {
|
|
7704
|
-
return /* @__PURE__ */
|
|
7749
|
+
return /* @__PURE__ */ jsx49(
|
|
7705
7750
|
SwitchPrimitive.Root,
|
|
7706
7751
|
{
|
|
7707
7752
|
"data-slot": "switch",
|
|
@@ -7711,7 +7756,7 @@ function Switch({
|
|
|
7711
7756
|
className
|
|
7712
7757
|
),
|
|
7713
7758
|
...props,
|
|
7714
|
-
children: /* @__PURE__ */
|
|
7759
|
+
children: /* @__PURE__ */ jsx49(
|
|
7715
7760
|
SwitchPrimitive.Thumb,
|
|
7716
7761
|
{
|
|
7717
7762
|
"data-slot": "switch-thumb",
|
|
@@ -7738,6 +7783,7 @@ export {
|
|
|
7738
7783
|
AlertDialogPortal,
|
|
7739
7784
|
AlertDialogTitle,
|
|
7740
7785
|
AlertDialogTrigger,
|
|
7786
|
+
div_default as AnimatedDiv,
|
|
7741
7787
|
Apple,
|
|
7742
7788
|
Ariakit,
|
|
7743
7789
|
Autocomplete,
|