@tutti-os/ui-system 0.0.190 → 0.0.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-S74ESIMT.js → chunk-OW6744SQ.js} +156 -92
- package/dist/chunk-OW6744SQ.js.map +1 -0
- package/dist/components/index.d.ts +8 -2
- package/dist/components/index.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/metadata/components.json +20 -0
- package/dist/metadata/index.js +20 -0
- package/dist/metadata/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-S74ESIMT.js.map +0 -1
|
@@ -3044,14 +3044,77 @@ function ShortcutBadge({ className, ...props }) {
|
|
|
3044
3044
|
);
|
|
3045
3045
|
}
|
|
3046
3046
|
|
|
3047
|
+
// src/components/slider/slider.tsx
|
|
3048
|
+
import * as React10 from "react";
|
|
3049
|
+
import { Slider as SliderPrimitive } from "radix-ui";
|
|
3050
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3051
|
+
function Slider({
|
|
3052
|
+
"aria-label": ariaLabel,
|
|
3053
|
+
"aria-labelledby": ariaLabelledBy,
|
|
3054
|
+
className,
|
|
3055
|
+
defaultValue,
|
|
3056
|
+
value,
|
|
3057
|
+
min = 0,
|
|
3058
|
+
max = 100,
|
|
3059
|
+
thumbAriaLabels,
|
|
3060
|
+
...props
|
|
3061
|
+
}) {
|
|
3062
|
+
const values = React10.useMemo(
|
|
3063
|
+
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min],
|
|
3064
|
+
[defaultValue, min, value]
|
|
3065
|
+
);
|
|
3066
|
+
return /* @__PURE__ */ jsxs14(
|
|
3067
|
+
SliderPrimitive.Root,
|
|
3068
|
+
{
|
|
3069
|
+
"data-slot": "slider",
|
|
3070
|
+
defaultValue,
|
|
3071
|
+
value,
|
|
3072
|
+
min,
|
|
3073
|
+
max,
|
|
3074
|
+
className: cn(
|
|
3075
|
+
"relative flex w-full touch-none items-center select-none outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
3076
|
+
className
|
|
3077
|
+
),
|
|
3078
|
+
...props,
|
|
3079
|
+
children: [
|
|
3080
|
+
/* @__PURE__ */ jsx26(
|
|
3081
|
+
SliderPrimitive.Track,
|
|
3082
|
+
{
|
|
3083
|
+
"data-slot": "slider-track",
|
|
3084
|
+
className: "relative grow overflow-hidden rounded-full bg-[var(--transparency-block)] data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1",
|
|
3085
|
+
children: /* @__PURE__ */ jsx26(
|
|
3086
|
+
SliderPrimitive.Range,
|
|
3087
|
+
{
|
|
3088
|
+
"data-slot": "slider-range",
|
|
3089
|
+
className: "absolute bg-[var(--tutti-purple)] select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
3090
|
+
}
|
|
3091
|
+
)
|
|
3092
|
+
}
|
|
3093
|
+
),
|
|
3094
|
+
Array.from({ length: values.length }, (_, index) => /* @__PURE__ */ jsx26(
|
|
3095
|
+
SliderPrimitive.Thumb,
|
|
3096
|
+
{
|
|
3097
|
+
"aria-disabled": props.disabled || void 0,
|
|
3098
|
+
"aria-label": thumbAriaLabels?.[index] ?? (values.length === 1 ? ariaLabel : void 0),
|
|
3099
|
+
"aria-labelledby": values.length === 1 ? ariaLabelledBy : void 0,
|
|
3100
|
+
"data-slot": "slider-thumb",
|
|
3101
|
+
className: "relative block size-3 shrink-0 rounded-full border border-[var(--tutti-purple)] bg-[var(--background-fronted)] shadow-none transition-[box-shadow] outline-none select-none after:absolute after:-inset-2 hover:ring-3 hover:ring-[color-mix(in_srgb,var(--tutti-purple)_20%,transparent)] focus-visible:ring-3 focus-visible:ring-[color-mix(in_srgb,var(--border-focus)_30%,transparent)] data-disabled:pointer-events-none data-disabled:hover:ring-0"
|
|
3102
|
+
},
|
|
3103
|
+
index
|
|
3104
|
+
))
|
|
3105
|
+
]
|
|
3106
|
+
}
|
|
3107
|
+
);
|
|
3108
|
+
}
|
|
3109
|
+
|
|
3047
3110
|
// src/components/sonner/sonner.tsx
|
|
3048
3111
|
import {
|
|
3049
3112
|
Toaster as SonnerToaster,
|
|
3050
3113
|
toast
|
|
3051
3114
|
} from "sonner";
|
|
3052
|
-
import { jsx as
|
|
3115
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3053
3116
|
function Toaster({ toastOptions, style, ...props }) {
|
|
3054
|
-
return /* @__PURE__ */
|
|
3117
|
+
return /* @__PURE__ */ jsx27(
|
|
3055
3118
|
SonnerToaster,
|
|
3056
3119
|
{
|
|
3057
3120
|
closeButton: true,
|
|
@@ -3060,11 +3123,11 @@ function Toaster({ toastOptions, style, ...props }) {
|
|
|
3060
3123
|
position: "top-right",
|
|
3061
3124
|
visibleToasts: 4,
|
|
3062
3125
|
icons: {
|
|
3063
|
-
error: /* @__PURE__ */
|
|
3064
|
-
info: /* @__PURE__ */
|
|
3065
|
-
loading: /* @__PURE__ */
|
|
3066
|
-
success: /* @__PURE__ */
|
|
3067
|
-
warning: /* @__PURE__ */
|
|
3126
|
+
error: /* @__PURE__ */ jsx27(FailedFilledIcon, { className: "size-4" }),
|
|
3127
|
+
info: /* @__PURE__ */ jsx27(WarningLinedIcon, { className: "size-4" }),
|
|
3128
|
+
loading: /* @__PURE__ */ jsx27(LoadingIcon, { className: "size-4 animate-spin" }),
|
|
3129
|
+
success: /* @__PURE__ */ jsx27(SuccessFilledIcon, { className: "size-4" }),
|
|
3130
|
+
warning: /* @__PURE__ */ jsx27(WarningFilledIcon, { className: "size-4" })
|
|
3068
3131
|
},
|
|
3069
3132
|
style: {
|
|
3070
3133
|
"--normal-bg": "var(--background-fronted)",
|
|
@@ -3093,7 +3156,7 @@ function Toaster({ toastOptions, style, ...props }) {
|
|
|
3093
3156
|
}
|
|
3094
3157
|
|
|
3095
3158
|
// src/components/spinner/spinner.tsx
|
|
3096
|
-
import { jsx as
|
|
3159
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3097
3160
|
function Spinner({
|
|
3098
3161
|
className,
|
|
3099
3162
|
size = 16,
|
|
@@ -3102,7 +3165,7 @@ function Spinner({
|
|
|
3102
3165
|
testId,
|
|
3103
3166
|
trackColor
|
|
3104
3167
|
}) {
|
|
3105
|
-
return /* @__PURE__ */
|
|
3168
|
+
return /* @__PURE__ */ jsx28(
|
|
3106
3169
|
LoadingIcon,
|
|
3107
3170
|
{
|
|
3108
3171
|
"data-slot": "spinner",
|
|
@@ -3148,11 +3211,11 @@ import {
|
|
|
3148
3211
|
} from "@dnd-kit/sortable";
|
|
3149
3212
|
import { CSS } from "@dnd-kit/utilities";
|
|
3150
3213
|
import { Slot as SlotPrimitive } from "radix-ui";
|
|
3151
|
-
import * as
|
|
3214
|
+
import * as React12 from "react";
|
|
3152
3215
|
import * as ReactDOM from "react-dom";
|
|
3153
3216
|
|
|
3154
3217
|
// src/lib/compose-refs.ts
|
|
3155
|
-
import * as
|
|
3218
|
+
import * as React11 from "react";
|
|
3156
3219
|
function setRef(ref, value) {
|
|
3157
3220
|
if (typeof ref === "function") {
|
|
3158
3221
|
return ref(value);
|
|
@@ -3186,11 +3249,11 @@ function composeRefs(...refs) {
|
|
|
3186
3249
|
};
|
|
3187
3250
|
}
|
|
3188
3251
|
function useComposedRefs(...refs) {
|
|
3189
|
-
return
|
|
3252
|
+
return React11.useCallback(composeRefs(...refs), refs);
|
|
3190
3253
|
}
|
|
3191
3254
|
|
|
3192
3255
|
// src/components/sortable/sortable.tsx
|
|
3193
|
-
import { jsx as
|
|
3256
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3194
3257
|
var orientationConfig = {
|
|
3195
3258
|
vertical: {
|
|
3196
3259
|
modifiers: [restrictToVerticalAxis, restrictToParentElement],
|
|
@@ -3213,9 +3276,9 @@ var CONTENT_NAME = "SortableContent";
|
|
|
3213
3276
|
var ITEM_NAME = "SortableItem";
|
|
3214
3277
|
var ITEM_HANDLE_NAME = "SortableItemHandle";
|
|
3215
3278
|
var OVERLAY_NAME = "SortableOverlay";
|
|
3216
|
-
var SortableRootContext =
|
|
3279
|
+
var SortableRootContext = React12.createContext(null);
|
|
3217
3280
|
function useSortableContext(consumerName) {
|
|
3218
|
-
const context =
|
|
3281
|
+
const context = React12.useContext(SortableRootContext);
|
|
3219
3282
|
if (!context) {
|
|
3220
3283
|
throw new Error(`\`${consumerName}\` must be used within \`${ROOT_NAME}\``);
|
|
3221
3284
|
}
|
|
@@ -3235,8 +3298,8 @@ function Sortable(props) {
|
|
|
3235
3298
|
accessibility,
|
|
3236
3299
|
...sortableProps
|
|
3237
3300
|
} = props;
|
|
3238
|
-
const id =
|
|
3239
|
-
const [activeId, setActiveId] =
|
|
3301
|
+
const id = React12.useId();
|
|
3302
|
+
const [activeId, setActiveId] = React12.useState(null);
|
|
3240
3303
|
const sensors = useSensors(
|
|
3241
3304
|
useSensor(MouseSensor, {
|
|
3242
3305
|
activationConstraint: { distance: 6 }
|
|
@@ -3248,11 +3311,11 @@ function Sortable(props) {
|
|
|
3248
3311
|
coordinateGetter: sortableKeyboardCoordinates
|
|
3249
3312
|
})
|
|
3250
3313
|
);
|
|
3251
|
-
const config =
|
|
3314
|
+
const config = React12.useMemo(
|
|
3252
3315
|
() => orientationConfig[orientation],
|
|
3253
3316
|
[orientation]
|
|
3254
3317
|
);
|
|
3255
|
-
const getItemValue =
|
|
3318
|
+
const getItemValue = React12.useCallback(
|
|
3256
3319
|
(item) => {
|
|
3257
3320
|
if (typeof item === "object" && !getItemValueProp) {
|
|
3258
3321
|
throw new Error(
|
|
@@ -3263,17 +3326,17 @@ function Sortable(props) {
|
|
|
3263
3326
|
},
|
|
3264
3327
|
[getItemValueProp]
|
|
3265
3328
|
);
|
|
3266
|
-
const items =
|
|
3329
|
+
const items = React12.useMemo(() => {
|
|
3267
3330
|
return value.map((item) => getItemValue(item));
|
|
3268
3331
|
}, [value, getItemValue]);
|
|
3269
|
-
const onDragStart =
|
|
3332
|
+
const onDragStart = React12.useCallback(
|
|
3270
3333
|
(event) => {
|
|
3271
3334
|
sortableProps.onDragStart?.(event);
|
|
3272
3335
|
setActiveId(event.active.id);
|
|
3273
3336
|
},
|
|
3274
3337
|
[sortableProps.onDragStart]
|
|
3275
3338
|
);
|
|
3276
|
-
const onDragEnd =
|
|
3339
|
+
const onDragEnd = React12.useCallback(
|
|
3277
3340
|
(event) => {
|
|
3278
3341
|
sortableProps.onDragEnd?.(event);
|
|
3279
3342
|
const { active, over } = event;
|
|
@@ -3298,14 +3361,14 @@ function Sortable(props) {
|
|
|
3298
3361
|
},
|
|
3299
3362
|
[value, onValueChange, onMove, getItemValue, sortableProps.onDragEnd]
|
|
3300
3363
|
);
|
|
3301
|
-
const onDragCancel =
|
|
3364
|
+
const onDragCancel = React12.useCallback(
|
|
3302
3365
|
(event) => {
|
|
3303
3366
|
sortableProps.onDragCancel?.(event);
|
|
3304
3367
|
setActiveId(null);
|
|
3305
3368
|
},
|
|
3306
3369
|
[sortableProps.onDragCancel]
|
|
3307
3370
|
);
|
|
3308
|
-
const contextValue =
|
|
3371
|
+
const contextValue = React12.useMemo(
|
|
3309
3372
|
() => ({
|
|
3310
3373
|
id,
|
|
3311
3374
|
items,
|
|
@@ -3328,11 +3391,11 @@ function Sortable(props) {
|
|
|
3328
3391
|
flatCursor
|
|
3329
3392
|
]
|
|
3330
3393
|
);
|
|
3331
|
-
return /* @__PURE__ */
|
|
3394
|
+
return /* @__PURE__ */ jsx29(
|
|
3332
3395
|
SortableRootContext.Provider,
|
|
3333
3396
|
{
|
|
3334
3397
|
value: contextValue,
|
|
3335
|
-
children: /* @__PURE__ */
|
|
3398
|
+
children: /* @__PURE__ */ jsx29(
|
|
3336
3399
|
DndContext,
|
|
3337
3400
|
{
|
|
3338
3401
|
collisionDetection: collisionDetection ?? config.collisionDetection,
|
|
@@ -3349,7 +3412,7 @@ function Sortable(props) {
|
|
|
3349
3412
|
}
|
|
3350
3413
|
);
|
|
3351
3414
|
}
|
|
3352
|
-
var SortableContentContext =
|
|
3415
|
+
var SortableContentContext = React12.createContext(false);
|
|
3353
3416
|
function SortableContent(props) {
|
|
3354
3417
|
const {
|
|
3355
3418
|
strategy: strategyProp,
|
|
@@ -3361,12 +3424,12 @@ function SortableContent(props) {
|
|
|
3361
3424
|
} = props;
|
|
3362
3425
|
const context = useSortableContext(CONTENT_NAME);
|
|
3363
3426
|
const ContentPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
3364
|
-
return /* @__PURE__ */
|
|
3427
|
+
return /* @__PURE__ */ jsx29(SortableContentContext.Provider, { value: true, children: /* @__PURE__ */ jsx29(
|
|
3365
3428
|
SortableContext,
|
|
3366
3429
|
{
|
|
3367
3430
|
items: context.items,
|
|
3368
3431
|
strategy: strategyProp ?? context.strategy,
|
|
3369
|
-
children: withoutSlot ? children : /* @__PURE__ */
|
|
3432
|
+
children: withoutSlot ? children : /* @__PURE__ */ jsx29(
|
|
3370
3433
|
ContentPrimitive,
|
|
3371
3434
|
{
|
|
3372
3435
|
"data-slot": "sortable-content",
|
|
@@ -3378,9 +3441,9 @@ function SortableContent(props) {
|
|
|
3378
3441
|
}
|
|
3379
3442
|
) });
|
|
3380
3443
|
}
|
|
3381
|
-
var SortableItemContext =
|
|
3444
|
+
var SortableItemContext = React12.createContext(null);
|
|
3382
3445
|
function useSortableItemContext(consumerName) {
|
|
3383
|
-
const context =
|
|
3446
|
+
const context = React12.useContext(SortableItemContext);
|
|
3384
3447
|
if (!context) {
|
|
3385
3448
|
throw new Error(`\`${consumerName}\` must be used within \`${ITEM_NAME}\``);
|
|
3386
3449
|
}
|
|
@@ -3397,8 +3460,8 @@ function SortableItem(props) {
|
|
|
3397
3460
|
ref,
|
|
3398
3461
|
...itemProps
|
|
3399
3462
|
} = props;
|
|
3400
|
-
const inSortableContent =
|
|
3401
|
-
const inSortableOverlay =
|
|
3463
|
+
const inSortableContent = React12.useContext(SortableContentContext);
|
|
3464
|
+
const inSortableOverlay = React12.useContext(SortableOverlayContext);
|
|
3402
3465
|
if (!inSortableContent && !inSortableOverlay) {
|
|
3403
3466
|
throw new Error(
|
|
3404
3467
|
`\`${ITEM_NAME}\` must be used within \`${CONTENT_NAME}\` or \`${OVERLAY_NAME}\``
|
|
@@ -3408,7 +3471,7 @@ function SortableItem(props) {
|
|
|
3408
3471
|
throw new Error(`\`${ITEM_NAME}\` value cannot be an empty string`);
|
|
3409
3472
|
}
|
|
3410
3473
|
const context = useSortableContext(ITEM_NAME);
|
|
3411
|
-
const id =
|
|
3474
|
+
const id = React12.useId();
|
|
3412
3475
|
const {
|
|
3413
3476
|
attributes,
|
|
3414
3477
|
listeners,
|
|
@@ -3424,14 +3487,14 @@ function SortableItem(props) {
|
|
|
3424
3487
|
setNodeRef(node);
|
|
3425
3488
|
if (asHandle) setActivatorNodeRef(node);
|
|
3426
3489
|
});
|
|
3427
|
-
const composedStyle =
|
|
3490
|
+
const composedStyle = React12.useMemo(() => {
|
|
3428
3491
|
return {
|
|
3429
3492
|
transform: CSS.Translate.toString(transform),
|
|
3430
3493
|
transition: prefersReducedMotion ? void 0 : transition,
|
|
3431
3494
|
...style
|
|
3432
3495
|
};
|
|
3433
3496
|
}, [prefersReducedMotion, transform, transition, style]);
|
|
3434
|
-
const itemContext =
|
|
3497
|
+
const itemContext = React12.useMemo(
|
|
3435
3498
|
() => ({
|
|
3436
3499
|
id,
|
|
3437
3500
|
attributes,
|
|
@@ -3443,7 +3506,7 @@ function SortableItem(props) {
|
|
|
3443
3506
|
[id, attributes, listeners, setActivatorNodeRef, isDragging, disabled]
|
|
3444
3507
|
);
|
|
3445
3508
|
const ItemPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
3446
|
-
return /* @__PURE__ */
|
|
3509
|
+
return /* @__PURE__ */ jsx29(SortableItemContext.Provider, { value: itemContext, children: /* @__PURE__ */ jsx29(
|
|
3447
3510
|
ItemPrimitive,
|
|
3448
3511
|
{
|
|
3449
3512
|
id,
|
|
@@ -3480,7 +3543,7 @@ function SortableItemHandle(props) {
|
|
|
3480
3543
|
itemContext.setActivatorNodeRef(node);
|
|
3481
3544
|
});
|
|
3482
3545
|
const HandlePrimitive = asChild ? SlotPrimitive.Slot : "button";
|
|
3483
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ jsx29(
|
|
3484
3547
|
HandlePrimitive,
|
|
3485
3548
|
{
|
|
3486
3549
|
type: "button",
|
|
@@ -3502,10 +3565,10 @@ function SortableItemHandle(props) {
|
|
|
3502
3565
|
);
|
|
3503
3566
|
}
|
|
3504
3567
|
function usePrefersReducedMotion() {
|
|
3505
|
-
const [reduced, setReduced] =
|
|
3568
|
+
const [reduced, setReduced] = React12.useState(
|
|
3506
3569
|
() => globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false
|
|
3507
3570
|
);
|
|
3508
|
-
|
|
3571
|
+
React12.useEffect(() => {
|
|
3509
3572
|
const query = globalThis.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
3510
3573
|
if (!query) return;
|
|
3511
3574
|
const update = () => setReduced(query.matches);
|
|
@@ -3515,7 +3578,7 @@ function usePrefersReducedMotion() {
|
|
|
3515
3578
|
}, []);
|
|
3516
3579
|
return reduced;
|
|
3517
3580
|
}
|
|
3518
|
-
var SortableOverlayContext =
|
|
3581
|
+
var SortableOverlayContext = React12.createContext(false);
|
|
3519
3582
|
var defaultDropAnimation = {
|
|
3520
3583
|
sideEffects: defaultDropAnimationSideEffects({
|
|
3521
3584
|
styles: {
|
|
@@ -3534,19 +3597,19 @@ function SortableOverlay(props) {
|
|
|
3534
3597
|
} = props;
|
|
3535
3598
|
const context = useSortableContext(OVERLAY_NAME);
|
|
3536
3599
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
3537
|
-
const [mounted, setMounted] =
|
|
3538
|
-
|
|
3600
|
+
const [mounted, setMounted] = React12.useState(false);
|
|
3601
|
+
React12.useLayoutEffect(() => setMounted(true), []);
|
|
3539
3602
|
const container = containerProp ?? (mounted ? globalThis.document?.body : null);
|
|
3540
3603
|
if (!container) return null;
|
|
3541
3604
|
return ReactDOM.createPortal(
|
|
3542
|
-
/* @__PURE__ */
|
|
3605
|
+
/* @__PURE__ */ jsx29(
|
|
3543
3606
|
DragOverlay,
|
|
3544
3607
|
{
|
|
3545
3608
|
modifiers: context.modifiers,
|
|
3546
3609
|
className: cn(!context.flatCursor && "cursor-grabbing"),
|
|
3547
3610
|
...overlayProps,
|
|
3548
3611
|
dropAnimation: prefersReducedMotion ? null : callerDropAnimation === void 0 ? defaultDropAnimation : callerDropAnimation,
|
|
3549
|
-
children: /* @__PURE__ */
|
|
3612
|
+
children: /* @__PURE__ */ jsx29(SortableOverlayContext.Provider, { value: true, children: context.activeId ? typeof children === "function" ? children({ value: context.activeId }) : children : null })
|
|
3550
3613
|
}
|
|
3551
3614
|
),
|
|
3552
3615
|
container
|
|
@@ -3555,7 +3618,7 @@ function SortableOverlay(props) {
|
|
|
3555
3618
|
|
|
3556
3619
|
// src/components/status-dot/status-dot.tsx
|
|
3557
3620
|
import { cva as cva4 } from "class-variance-authority";
|
|
3558
|
-
import { jsx as
|
|
3621
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3559
3622
|
var statusDotVariants = cva4("inline-flex shrink-0 rounded-full", {
|
|
3560
3623
|
variants: {
|
|
3561
3624
|
tone: {
|
|
@@ -3589,7 +3652,7 @@ function StatusDot({
|
|
|
3589
3652
|
title,
|
|
3590
3653
|
className
|
|
3591
3654
|
}) {
|
|
3592
|
-
return /* @__PURE__ */
|
|
3655
|
+
return /* @__PURE__ */ jsx30(
|
|
3593
3656
|
"span",
|
|
3594
3657
|
{
|
|
3595
3658
|
"aria-hidden": ariaLabel ? void 0 : true,
|
|
@@ -3607,7 +3670,7 @@ function StatusDot({
|
|
|
3607
3670
|
|
|
3608
3671
|
// src/components/switch/switch.tsx
|
|
3609
3672
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
3610
|
-
import { jsx as
|
|
3673
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3611
3674
|
function Switch({
|
|
3612
3675
|
className,
|
|
3613
3676
|
disabled,
|
|
@@ -3615,7 +3678,7 @@ function Switch({
|
|
|
3615
3678
|
size = "default",
|
|
3616
3679
|
...props
|
|
3617
3680
|
}) {
|
|
3618
|
-
return /* @__PURE__ */
|
|
3681
|
+
return /* @__PURE__ */ jsx31(
|
|
3619
3682
|
SwitchPrimitive.Root,
|
|
3620
3683
|
{
|
|
3621
3684
|
"data-slot": "switch",
|
|
@@ -3628,12 +3691,12 @@ function Switch({
|
|
|
3628
3691
|
className
|
|
3629
3692
|
),
|
|
3630
3693
|
...props,
|
|
3631
|
-
children: /* @__PURE__ */
|
|
3694
|
+
children: /* @__PURE__ */ jsx31(
|
|
3632
3695
|
SwitchPrimitive.Thumb,
|
|
3633
3696
|
{
|
|
3634
3697
|
"data-slot": "switch-thumb",
|
|
3635
3698
|
className: "pointer-events-none inline-flex items-center justify-center rounded-full bg-[var(--white-stationary)] ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-[state=checked]:translate-x-[14px] group-data-[size=sm]/switch:data-[state=checked]:translate-x-[10px] group-data-[size=default]/switch:data-[state=unchecked]:translate-x-0 group-data-[size=sm]/switch:data-[state=unchecked]:translate-x-0",
|
|
3636
|
-
children: loading ? /* @__PURE__ */
|
|
3699
|
+
children: loading ? /* @__PURE__ */ jsx31(
|
|
3637
3700
|
LoadingIcon,
|
|
3638
3701
|
{
|
|
3639
3702
|
"aria-hidden": "true",
|
|
@@ -3647,9 +3710,9 @@ function Switch({
|
|
|
3647
3710
|
}
|
|
3648
3711
|
|
|
3649
3712
|
// src/components/textarea/textarea.tsx
|
|
3650
|
-
import { jsx as
|
|
3713
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3651
3714
|
function Textarea({ className, ...props }) {
|
|
3652
|
-
return /* @__PURE__ */
|
|
3715
|
+
return /* @__PURE__ */ jsx32(
|
|
3653
3716
|
"textarea",
|
|
3654
3717
|
{
|
|
3655
3718
|
"data-slot": "textarea",
|
|
@@ -3663,18 +3726,18 @@ function Textarea({ className, ...props }) {
|
|
|
3663
3726
|
}
|
|
3664
3727
|
|
|
3665
3728
|
// src/components/toast/toast.tsx
|
|
3666
|
-
import * as
|
|
3729
|
+
import * as React13 from "react";
|
|
3667
3730
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
3668
3731
|
import { cva as cva5 } from "class-variance-authority";
|
|
3669
|
-
import { jsx as
|
|
3732
|
+
import { jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3670
3733
|
var toastDefaultDurationMs = 3e3;
|
|
3671
3734
|
function ToastProvider({
|
|
3672
3735
|
duration = toastDefaultDurationMs,
|
|
3673
3736
|
...props
|
|
3674
3737
|
}) {
|
|
3675
|
-
return /* @__PURE__ */
|
|
3738
|
+
return /* @__PURE__ */ jsx33(ToastPrimitive.Provider, { duration, ...props });
|
|
3676
3739
|
}
|
|
3677
|
-
var ToastVisualContext =
|
|
3740
|
+
var ToastVisualContext = React13.createContext(null);
|
|
3678
3741
|
var toastStatusIconByVariant = {
|
|
3679
3742
|
destructive: FailedFilledIcon,
|
|
3680
3743
|
success: SuccessFilledIcon
|
|
@@ -3698,7 +3761,7 @@ function formatToastText(children) {
|
|
|
3698
3761
|
if (typeof children === "string") {
|
|
3699
3762
|
return stripToastTrailingSentencePunctuation(children);
|
|
3700
3763
|
}
|
|
3701
|
-
const flatChildren =
|
|
3764
|
+
const flatChildren = React13.Children.toArray(children);
|
|
3702
3765
|
if (flatChildren.length === 1 && typeof flatChildren[0] === "string") {
|
|
3703
3766
|
return stripToastTrailingSentencePunctuation(flatChildren[0]);
|
|
3704
3767
|
}
|
|
@@ -3730,7 +3793,7 @@ function ToastRoot({
|
|
|
3730
3793
|
...props
|
|
3731
3794
|
}) {
|
|
3732
3795
|
const isDestructive = variant === "destructive";
|
|
3733
|
-
return /* @__PURE__ */
|
|
3796
|
+
return /* @__PURE__ */ jsx33(
|
|
3734
3797
|
ToastPrimitive.Root,
|
|
3735
3798
|
{
|
|
3736
3799
|
"aria-busy": busy,
|
|
@@ -3747,7 +3810,7 @@ function ToastRoot({
|
|
|
3747
3810
|
...style
|
|
3748
3811
|
},
|
|
3749
3812
|
...props,
|
|
3750
|
-
children: /* @__PURE__ */
|
|
3813
|
+
children: /* @__PURE__ */ jsx33(ToastVisualContext.Provider, { value: { busy, variant }, children: /* @__PURE__ */ jsx33("span", { className: "flex min-w-0 max-w-full flex-col items-center justify-center whitespace-normal break-words text-center", children }) })
|
|
3751
3814
|
}
|
|
3752
3815
|
);
|
|
3753
3816
|
}
|
|
@@ -3756,9 +3819,9 @@ function ToastTitle({
|
|
|
3756
3819
|
children,
|
|
3757
3820
|
...props
|
|
3758
3821
|
}) {
|
|
3759
|
-
const toastVisual =
|
|
3822
|
+
const toastVisual = React13.useContext(ToastVisualContext);
|
|
3760
3823
|
const StatusIcon = toastVisual?.variant && hasToastStatusIcon(toastVisual.variant) ? toastStatusIconByVariant[toastVisual.variant] : null;
|
|
3761
|
-
return /* @__PURE__ */
|
|
3824
|
+
return /* @__PURE__ */ jsxs15(
|
|
3762
3825
|
ToastPrimitive.Title,
|
|
3763
3826
|
{
|
|
3764
3827
|
"data-slot": "toast-title",
|
|
@@ -3768,7 +3831,7 @@ function ToastTitle({
|
|
|
3768
3831
|
),
|
|
3769
3832
|
...props,
|
|
3770
3833
|
children: [
|
|
3771
|
-
toastVisual?.busy ? /* @__PURE__ */
|
|
3834
|
+
toastVisual?.busy ? /* @__PURE__ */ jsx33(
|
|
3772
3835
|
Spinner,
|
|
3773
3836
|
{
|
|
3774
3837
|
className: "shrink-0 text-current",
|
|
@@ -3776,8 +3839,8 @@ function ToastTitle({
|
|
|
3776
3839
|
strokeWidth: 2,
|
|
3777
3840
|
trackColor: "color-mix(in srgb, currentColor 28%, transparent)"
|
|
3778
3841
|
}
|
|
3779
|
-
) : StatusIcon ? /* @__PURE__ */
|
|
3780
|
-
/* @__PURE__ */
|
|
3842
|
+
) : StatusIcon ? /* @__PURE__ */ jsx33(StatusIcon, { className: "size-4 shrink-0 text-current" }) : null,
|
|
3843
|
+
/* @__PURE__ */ jsx33("span", { className: "min-w-0 break-words", children: formatToastText(children) })
|
|
3781
3844
|
]
|
|
3782
3845
|
}
|
|
3783
3846
|
);
|
|
@@ -3786,7 +3849,7 @@ function ToastDescription({
|
|
|
3786
3849
|
className,
|
|
3787
3850
|
...props
|
|
3788
3851
|
}) {
|
|
3789
|
-
return /* @__PURE__ */
|
|
3852
|
+
return /* @__PURE__ */ jsx33(
|
|
3790
3853
|
ToastPrimitive.Description,
|
|
3791
3854
|
{
|
|
3792
3855
|
"data-slot": "toast-description",
|
|
@@ -3802,7 +3865,7 @@ function ToastClose({
|
|
|
3802
3865
|
className,
|
|
3803
3866
|
...props
|
|
3804
3867
|
}) {
|
|
3805
|
-
return /* @__PURE__ */
|
|
3868
|
+
return /* @__PURE__ */ jsx33(
|
|
3806
3869
|
ToastPrimitive.Close,
|
|
3807
3870
|
{
|
|
3808
3871
|
"data-slot": "toast-close",
|
|
@@ -3811,7 +3874,7 @@ function ToastClose({
|
|
|
3811
3874
|
className
|
|
3812
3875
|
),
|
|
3813
3876
|
...props,
|
|
3814
|
-
children: /* @__PURE__ */
|
|
3877
|
+
children: /* @__PURE__ */ jsx33(CloseIcon, { className: "size-4" })
|
|
3815
3878
|
}
|
|
3816
3879
|
);
|
|
3817
3880
|
}
|
|
@@ -3820,7 +3883,7 @@ function ToastViewport({
|
|
|
3820
3883
|
style,
|
|
3821
3884
|
...props
|
|
3822
3885
|
}) {
|
|
3823
|
-
return /* @__PURE__ */
|
|
3886
|
+
return /* @__PURE__ */ jsx33(
|
|
3824
3887
|
ToastPrimitive.Viewport,
|
|
3825
3888
|
{
|
|
3826
3889
|
"data-slot": "toast-viewport",
|
|
@@ -3836,7 +3899,7 @@ function ToastViewport({
|
|
|
3836
3899
|
|
|
3837
3900
|
// src/components/underline-tabs/underline-tabs.tsx
|
|
3838
3901
|
import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useRef as useRef4, useState as useState8 } from "react";
|
|
3839
|
-
import { jsx as
|
|
3902
|
+
import { jsx as jsx34, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3840
3903
|
function UnderlineTabs({
|
|
3841
3904
|
tabs,
|
|
3842
3905
|
value,
|
|
@@ -3919,7 +3982,7 @@ function UnderlineTabs({
|
|
|
3919
3982
|
behavior: "smooth"
|
|
3920
3983
|
});
|
|
3921
3984
|
};
|
|
3922
|
-
return /* @__PURE__ */
|
|
3985
|
+
return /* @__PURE__ */ jsxs16(
|
|
3923
3986
|
"div",
|
|
3924
3987
|
{
|
|
3925
3988
|
"aria-label": ariaLabel,
|
|
@@ -3931,7 +3994,7 @@ function UnderlineTabs({
|
|
|
3931
3994
|
"data-testid": testId,
|
|
3932
3995
|
role: "tablist",
|
|
3933
3996
|
children: [
|
|
3934
|
-
/* @__PURE__ */
|
|
3997
|
+
/* @__PURE__ */ jsx34(
|
|
3935
3998
|
"div",
|
|
3936
3999
|
{
|
|
3937
4000
|
ref: viewportRef,
|
|
@@ -3945,7 +4008,7 @@ function UnderlineTabs({
|
|
|
3945
4008
|
"data-can-scroll-right": overflow.canScrollRight ? "true" : "false",
|
|
3946
4009
|
"data-slot": "underline-tabs-viewport",
|
|
3947
4010
|
"data-testid": viewportTestId,
|
|
3948
|
-
children: /* @__PURE__ */
|
|
4011
|
+
children: /* @__PURE__ */ jsxs16(
|
|
3949
4012
|
"div",
|
|
3950
4013
|
{
|
|
3951
4014
|
ref: rowRef,
|
|
@@ -3953,7 +4016,7 @@ function UnderlineTabs({
|
|
|
3953
4016
|
children: [
|
|
3954
4017
|
tabs.map((tab) => {
|
|
3955
4018
|
const isActive = value === tab.value;
|
|
3956
|
-
return /* @__PURE__ */
|
|
4019
|
+
return /* @__PURE__ */ jsxs16(
|
|
3957
4020
|
"button",
|
|
3958
4021
|
{
|
|
3959
4022
|
ref: (element) => {
|
|
@@ -3976,14 +4039,14 @@ function UnderlineTabs({
|
|
|
3976
4039
|
onClick: () => onValueChange(tab.value),
|
|
3977
4040
|
onMouseDown: preventMouseDownDefault ? (event) => event.preventDefault() : void 0,
|
|
3978
4041
|
children: [
|
|
3979
|
-
/* @__PURE__ */
|
|
3980
|
-
tab.count !== void 0 ? /* @__PURE__ */
|
|
4042
|
+
/* @__PURE__ */ jsx34("span", { children: tab.label }),
|
|
4043
|
+
tab.count !== void 0 ? /* @__PURE__ */ jsx34("span", { className: "text-[11px] font-medium leading-6 text-[inherit]", children: tab.count }) : null
|
|
3981
4044
|
]
|
|
3982
4045
|
},
|
|
3983
4046
|
tab.value
|
|
3984
4047
|
);
|
|
3985
4048
|
}),
|
|
3986
|
-
/* @__PURE__ */
|
|
4049
|
+
/* @__PURE__ */ jsx34(
|
|
3987
4050
|
"div",
|
|
3988
4051
|
{
|
|
3989
4052
|
"aria-hidden": true,
|
|
@@ -4000,7 +4063,7 @@ function UnderlineTabs({
|
|
|
4000
4063
|
)
|
|
4001
4064
|
}
|
|
4002
4065
|
),
|
|
4003
|
-
/* @__PURE__ */
|
|
4066
|
+
/* @__PURE__ */ jsx34(
|
|
4004
4067
|
"button",
|
|
4005
4068
|
{
|
|
4006
4069
|
"aria-label": scrollLeftLabel,
|
|
@@ -4011,10 +4074,10 @@ function UnderlineTabs({
|
|
|
4011
4074
|
disabled: !overflow.canScrollLeft,
|
|
4012
4075
|
type: "button",
|
|
4013
4076
|
onClick: () => scrollTabs("left"),
|
|
4014
|
-
children: /* @__PURE__ */
|
|
4077
|
+
children: /* @__PURE__ */ jsx34(ArrowLeftIcon, { size: 16 })
|
|
4015
4078
|
}
|
|
4016
4079
|
),
|
|
4017
|
-
/* @__PURE__ */
|
|
4080
|
+
/* @__PURE__ */ jsx34(
|
|
4018
4081
|
"button",
|
|
4019
4082
|
{
|
|
4020
4083
|
"aria-label": scrollRightLabel,
|
|
@@ -4025,7 +4088,7 @@ function UnderlineTabs({
|
|
|
4025
4088
|
disabled: !overflow.canScrollRight,
|
|
4026
4089
|
type: "button",
|
|
4027
4090
|
onClick: () => scrollTabs("right"),
|
|
4028
|
-
children: /* @__PURE__ */
|
|
4091
|
+
children: /* @__PURE__ */ jsx34(ArrowRightIcon, { size: 16 })
|
|
4029
4092
|
}
|
|
4030
4093
|
)
|
|
4031
4094
|
]
|
|
@@ -4034,9 +4097,9 @@ function UnderlineTabs({
|
|
|
4034
4097
|
}
|
|
4035
4098
|
|
|
4036
4099
|
// src/components/viewport-menu-surface/viewport-menu-surface.tsx
|
|
4037
|
-
import * as
|
|
4100
|
+
import * as React14 from "react";
|
|
4038
4101
|
import { createPortal as createPortal3 } from "react-dom";
|
|
4039
|
-
import { jsx as
|
|
4102
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4040
4103
|
var VIEWPORT_MENU_PADDING = 12;
|
|
4041
4104
|
var MENU_BOUNDARY_PADDING = 8;
|
|
4042
4105
|
function clampMenuCoordinate(origin, size, viewportExtent, padding) {
|
|
@@ -4148,7 +4211,7 @@ function assignRef(ref, value) {
|
|
|
4148
4211
|
function callHandler(handler, event) {
|
|
4149
4212
|
handler?.(event);
|
|
4150
4213
|
}
|
|
4151
|
-
var ViewportMenuSurface =
|
|
4214
|
+
var ViewportMenuSurface = React14.forwardRef(function ViewportMenuSurface2({
|
|
4152
4215
|
open,
|
|
4153
4216
|
placement,
|
|
4154
4217
|
children,
|
|
@@ -4164,16 +4227,16 @@ var ViewportMenuSurface = React13.forwardRef(function ViewportMenuSurface2({
|
|
|
4164
4227
|
className,
|
|
4165
4228
|
...rest
|
|
4166
4229
|
}, forwardedRef) {
|
|
4167
|
-
const surfaceRef =
|
|
4168
|
-
const [measuredSize, setMeasuredSize] =
|
|
4169
|
-
const setRefs2 =
|
|
4230
|
+
const surfaceRef = React14.useRef(null);
|
|
4231
|
+
const [measuredSize, setMeasuredSize] = React14.useState(null);
|
|
4232
|
+
const setRefs2 = React14.useCallback(
|
|
4170
4233
|
(node) => {
|
|
4171
4234
|
surfaceRef.current = node;
|
|
4172
4235
|
assignRef(forwardedRef, node);
|
|
4173
4236
|
},
|
|
4174
4237
|
[forwardedRef]
|
|
4175
4238
|
);
|
|
4176
|
-
|
|
4239
|
+
React14.useLayoutEffect(() => {
|
|
4177
4240
|
if (!open) {
|
|
4178
4241
|
setMeasuredSize(null);
|
|
4179
4242
|
return;
|
|
@@ -4197,7 +4260,7 @@ var ViewportMenuSurface = React13.forwardRef(function ViewportMenuSurface2({
|
|
|
4197
4260
|
observer.observe(element);
|
|
4198
4261
|
return () => observer.disconnect();
|
|
4199
4262
|
}, [open, placement]);
|
|
4200
|
-
|
|
4263
|
+
React14.useEffect(() => {
|
|
4201
4264
|
if (!open) {
|
|
4202
4265
|
return;
|
|
4203
4266
|
}
|
|
@@ -4254,7 +4317,7 @@ var ViewportMenuSurface = React13.forwardRef(function ViewportMenuSurface2({
|
|
|
4254
4317
|
onDismiss,
|
|
4255
4318
|
open
|
|
4256
4319
|
]);
|
|
4257
|
-
const resolvedPlacement =
|
|
4320
|
+
const resolvedPlacement = React14.useMemo(() => {
|
|
4258
4321
|
if (placement.type === "absolute") {
|
|
4259
4322
|
const boundary2 = resolveMenuBoundaryFromPoint(
|
|
4260
4323
|
placement.boundaryPoint ?? {
|
|
@@ -4306,7 +4369,7 @@ var ViewportMenuSurface = React13.forwardRef(function ViewportMenuSurface2({
|
|
|
4306
4369
|
}
|
|
4307
4370
|
const portalTarget = resolvedPlacement.portalTarget ?? document.body;
|
|
4308
4371
|
return createPortal3(
|
|
4309
|
-
/* @__PURE__ */
|
|
4372
|
+
/* @__PURE__ */ jsx35(
|
|
4310
4373
|
MenuSurface,
|
|
4311
4374
|
{
|
|
4312
4375
|
...rest,
|
|
@@ -4443,6 +4506,7 @@ export {
|
|
|
4443
4506
|
Separator2 as Separator,
|
|
4444
4507
|
SectionTabs,
|
|
4445
4508
|
ShortcutBadge,
|
|
4509
|
+
Slider,
|
|
4446
4510
|
toast,
|
|
4447
4511
|
Toaster,
|
|
4448
4512
|
Spinner,
|
|
@@ -4465,4 +4529,4 @@ export {
|
|
|
4465
4529
|
UnderlineTabs,
|
|
4466
4530
|
ViewportMenuSurface
|
|
4467
4531
|
};
|
|
4468
|
-
//# sourceMappingURL=chunk-
|
|
4532
|
+
//# sourceMappingURL=chunk-OW6744SQ.js.map
|