@tutti-os/ui-system 0.0.221 → 0.0.223
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-BHO2ZGYJ.js → chunk-FQWIOPDU.js} +185 -68
- package/dist/chunk-FQWIOPDU.js.map +1 -0
- package/dist/components/index.d.ts +20 -1
- package/dist/components/index.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/styles/base.css +19 -0
- package/package.json +1 -1
- package/dist/chunk-BHO2ZGYJ.js.map +0 -1
|
@@ -3124,10 +3124,126 @@ function SectionTabs({
|
|
|
3124
3124
|
);
|
|
3125
3125
|
}
|
|
3126
3126
|
|
|
3127
|
+
// src/components/segment-bar/segment-bar.tsx
|
|
3128
|
+
import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState8 } from "react";
|
|
3129
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3130
|
+
function SegmentBar({
|
|
3131
|
+
segments,
|
|
3132
|
+
value,
|
|
3133
|
+
onValueChange,
|
|
3134
|
+
ariaLabel,
|
|
3135
|
+
className,
|
|
3136
|
+
testId
|
|
3137
|
+
}) {
|
|
3138
|
+
const containerRef = useRef4(null);
|
|
3139
|
+
const buttonRefs = useRef4({});
|
|
3140
|
+
const [indicator, setIndicator] = useState8({
|
|
3141
|
+
left: 0,
|
|
3142
|
+
width: 0,
|
|
3143
|
+
ready: false
|
|
3144
|
+
});
|
|
3145
|
+
useLayoutEffect2(() => {
|
|
3146
|
+
const button = buttonRefs.current[value];
|
|
3147
|
+
if (!button) {
|
|
3148
|
+
setIndicator(
|
|
3149
|
+
(current) => current.ready ? current : { ...current, ready: false }
|
|
3150
|
+
);
|
|
3151
|
+
return;
|
|
3152
|
+
}
|
|
3153
|
+
const next = {
|
|
3154
|
+
left: button.offsetLeft,
|
|
3155
|
+
width: button.offsetWidth,
|
|
3156
|
+
ready: true
|
|
3157
|
+
};
|
|
3158
|
+
setIndicator(
|
|
3159
|
+
(current) => current.left === next.left && current.width === next.width && current.ready === next.ready ? current : next
|
|
3160
|
+
);
|
|
3161
|
+
}, [segments, value]);
|
|
3162
|
+
useEffect5(() => {
|
|
3163
|
+
const container = containerRef.current;
|
|
3164
|
+
if (!container || typeof ResizeObserver === "undefined") {
|
|
3165
|
+
return;
|
|
3166
|
+
}
|
|
3167
|
+
const sync = () => {
|
|
3168
|
+
const button = buttonRefs.current[value];
|
|
3169
|
+
if (!button) {
|
|
3170
|
+
return;
|
|
3171
|
+
}
|
|
3172
|
+
setIndicator(
|
|
3173
|
+
(current) => current.left === button.offsetLeft && current.width === button.offsetWidth ? current : {
|
|
3174
|
+
left: button.offsetLeft,
|
|
3175
|
+
width: button.offsetWidth,
|
|
3176
|
+
ready: true
|
|
3177
|
+
}
|
|
3178
|
+
);
|
|
3179
|
+
};
|
|
3180
|
+
const observer = new ResizeObserver(sync);
|
|
3181
|
+
observer.observe(container);
|
|
3182
|
+
for (const key of Object.keys(buttonRefs.current)) {
|
|
3183
|
+
const node = buttonRefs.current[key];
|
|
3184
|
+
if (node) {
|
|
3185
|
+
observer.observe(node);
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
return () => observer.disconnect();
|
|
3189
|
+
}, [segments, value]);
|
|
3190
|
+
return /* @__PURE__ */ jsxs15(
|
|
3191
|
+
"div",
|
|
3192
|
+
{
|
|
3193
|
+
"aria-label": ariaLabel,
|
|
3194
|
+
className: cn(
|
|
3195
|
+
"relative inline-flex h-8 shrink-0 items-center gap-0.5 rounded-md bg-[var(--transparency-block)] p-0.5",
|
|
3196
|
+
className
|
|
3197
|
+
),
|
|
3198
|
+
"data-slot": "segment-bar",
|
|
3199
|
+
"data-testid": testId,
|
|
3200
|
+
ref: containerRef,
|
|
3201
|
+
role: "tablist",
|
|
3202
|
+
children: [
|
|
3203
|
+
indicator.ready ? /* @__PURE__ */ jsx26(
|
|
3204
|
+
"span",
|
|
3205
|
+
{
|
|
3206
|
+
"aria-hidden": "true",
|
|
3207
|
+
className: "absolute top-0.5 bottom-0.5 rounded-[5px] bg-[var(--background-board-card)] transition-[left,width] duration-150 ease-out",
|
|
3208
|
+
"data-slot": "segment-bar-indicator",
|
|
3209
|
+
style: { left: indicator.left, width: indicator.width }
|
|
3210
|
+
}
|
|
3211
|
+
) : null,
|
|
3212
|
+
segments.map((segment) => {
|
|
3213
|
+
const isActive = value === segment.value;
|
|
3214
|
+
return /* @__PURE__ */ jsx26(
|
|
3215
|
+
"button",
|
|
3216
|
+
{
|
|
3217
|
+
"aria-selected": isActive,
|
|
3218
|
+
className: cn(
|
|
3219
|
+
"relative z-[1] inline-flex h-7 shrink-0 items-center justify-center whitespace-nowrap rounded-[5px] px-2.5 text-[12px] font-semibold leading-none transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25",
|
|
3220
|
+
isActive ? "text-[var(--text-primary)]" : "text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
|
|
3221
|
+
),
|
|
3222
|
+
"data-active": isActive ? "true" : "false",
|
|
3223
|
+
"data-slot": "segment-bar-segment",
|
|
3224
|
+
"data-testid": segment.testId,
|
|
3225
|
+
ref: (node) => {
|
|
3226
|
+
if (node) {
|
|
3227
|
+
buttonRefs.current[segment.value] = node;
|
|
3228
|
+
}
|
|
3229
|
+
},
|
|
3230
|
+
role: "tab",
|
|
3231
|
+
type: "button",
|
|
3232
|
+
onClick: () => onValueChange(segment.value),
|
|
3233
|
+
children: segment.label
|
|
3234
|
+
},
|
|
3235
|
+
segment.value
|
|
3236
|
+
);
|
|
3237
|
+
})
|
|
3238
|
+
]
|
|
3239
|
+
}
|
|
3240
|
+
);
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3127
3243
|
// src/components/shortcut-badge/shortcut-badge.tsx
|
|
3128
|
-
import { jsx as
|
|
3244
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3129
3245
|
function ShortcutBadge({ className, ...props }) {
|
|
3130
|
-
return /* @__PURE__ */
|
|
3246
|
+
return /* @__PURE__ */ jsx27(
|
|
3131
3247
|
"kbd",
|
|
3132
3248
|
{
|
|
3133
3249
|
"data-slot": "shortcut-badge",
|
|
@@ -3143,7 +3259,7 @@ function ShortcutBadge({ className, ...props }) {
|
|
|
3143
3259
|
// src/components/slider/slider.tsx
|
|
3144
3260
|
import * as React10 from "react";
|
|
3145
3261
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
3146
|
-
import { jsx as
|
|
3262
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3147
3263
|
function Slider({
|
|
3148
3264
|
"aria-label": ariaLabel,
|
|
3149
3265
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -3159,7 +3275,7 @@ function Slider({
|
|
|
3159
3275
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min],
|
|
3160
3276
|
[defaultValue, min, value]
|
|
3161
3277
|
);
|
|
3162
|
-
return /* @__PURE__ */
|
|
3278
|
+
return /* @__PURE__ */ jsxs16(
|
|
3163
3279
|
SliderPrimitive.Root,
|
|
3164
3280
|
{
|
|
3165
3281
|
"data-slot": "slider",
|
|
@@ -3173,12 +3289,12 @@ function Slider({
|
|
|
3173
3289
|
),
|
|
3174
3290
|
...props,
|
|
3175
3291
|
children: [
|
|
3176
|
-
/* @__PURE__ */
|
|
3292
|
+
/* @__PURE__ */ jsx28(
|
|
3177
3293
|
SliderPrimitive.Track,
|
|
3178
3294
|
{
|
|
3179
3295
|
"data-slot": "slider-track",
|
|
3180
3296
|
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",
|
|
3181
|
-
children: /* @__PURE__ */
|
|
3297
|
+
children: /* @__PURE__ */ jsx28(
|
|
3182
3298
|
SliderPrimitive.Range,
|
|
3183
3299
|
{
|
|
3184
3300
|
"data-slot": "slider-range",
|
|
@@ -3187,7 +3303,7 @@ function Slider({
|
|
|
3187
3303
|
)
|
|
3188
3304
|
}
|
|
3189
3305
|
),
|
|
3190
|
-
Array.from({ length: values.length }, (_, index) => /* @__PURE__ */
|
|
3306
|
+
Array.from({ length: values.length }, (_, index) => /* @__PURE__ */ jsx28(
|
|
3191
3307
|
SliderPrimitive.Thumb,
|
|
3192
3308
|
{
|
|
3193
3309
|
"aria-disabled": props.disabled || void 0,
|
|
@@ -3208,9 +3324,9 @@ import {
|
|
|
3208
3324
|
Toaster as SonnerToaster,
|
|
3209
3325
|
toast
|
|
3210
3326
|
} from "sonner";
|
|
3211
|
-
import { jsx as
|
|
3327
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3212
3328
|
function Toaster({ toastOptions, style, ...props }) {
|
|
3213
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ jsx29(
|
|
3214
3330
|
SonnerToaster,
|
|
3215
3331
|
{
|
|
3216
3332
|
closeButton: true,
|
|
@@ -3219,11 +3335,11 @@ function Toaster({ toastOptions, style, ...props }) {
|
|
|
3219
3335
|
position: "top-right",
|
|
3220
3336
|
visibleToasts: 4,
|
|
3221
3337
|
icons: {
|
|
3222
|
-
error: /* @__PURE__ */
|
|
3223
|
-
info: /* @__PURE__ */
|
|
3224
|
-
loading: /* @__PURE__ */
|
|
3225
|
-
success: /* @__PURE__ */
|
|
3226
|
-
warning: /* @__PURE__ */
|
|
3338
|
+
error: /* @__PURE__ */ jsx29(FailedFilledIcon, { className: "size-4" }),
|
|
3339
|
+
info: /* @__PURE__ */ jsx29(WarningLinedIcon, { className: "size-4" }),
|
|
3340
|
+
loading: /* @__PURE__ */ jsx29(LoadingIcon, { className: "size-4 animate-spin" }),
|
|
3341
|
+
success: /* @__PURE__ */ jsx29(SuccessFilledIcon, { className: "size-4" }),
|
|
3342
|
+
warning: /* @__PURE__ */ jsx29(WarningFilledIcon, { className: "size-4" })
|
|
3227
3343
|
},
|
|
3228
3344
|
style: {
|
|
3229
3345
|
"--normal-bg": "var(--background-fronted)",
|
|
@@ -3252,7 +3368,7 @@ function Toaster({ toastOptions, style, ...props }) {
|
|
|
3252
3368
|
}
|
|
3253
3369
|
|
|
3254
3370
|
// src/components/spinner/spinner.tsx
|
|
3255
|
-
import { jsx as
|
|
3371
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3256
3372
|
function Spinner({
|
|
3257
3373
|
className,
|
|
3258
3374
|
size = 16,
|
|
@@ -3261,7 +3377,7 @@ function Spinner({
|
|
|
3261
3377
|
testId,
|
|
3262
3378
|
trackColor
|
|
3263
3379
|
}) {
|
|
3264
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ jsx30(
|
|
3265
3381
|
LoadingIcon,
|
|
3266
3382
|
{
|
|
3267
3383
|
"data-slot": "spinner",
|
|
@@ -3349,7 +3465,7 @@ function useComposedRefs(...refs) {
|
|
|
3349
3465
|
}
|
|
3350
3466
|
|
|
3351
3467
|
// src/components/sortable/sortable.tsx
|
|
3352
|
-
import { jsx as
|
|
3468
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3353
3469
|
var orientationConfig = {
|
|
3354
3470
|
vertical: {
|
|
3355
3471
|
modifiers: [restrictToVerticalAxis, restrictToParentElement],
|
|
@@ -3487,11 +3603,11 @@ function Sortable(props) {
|
|
|
3487
3603
|
flatCursor
|
|
3488
3604
|
]
|
|
3489
3605
|
);
|
|
3490
|
-
return /* @__PURE__ */
|
|
3606
|
+
return /* @__PURE__ */ jsx31(
|
|
3491
3607
|
SortableRootContext.Provider,
|
|
3492
3608
|
{
|
|
3493
3609
|
value: contextValue,
|
|
3494
|
-
children: /* @__PURE__ */
|
|
3610
|
+
children: /* @__PURE__ */ jsx31(
|
|
3495
3611
|
DndContext,
|
|
3496
3612
|
{
|
|
3497
3613
|
collisionDetection: collisionDetection ?? config.collisionDetection,
|
|
@@ -3520,12 +3636,12 @@ function SortableContent(props) {
|
|
|
3520
3636
|
} = props;
|
|
3521
3637
|
const context = useSortableContext(CONTENT_NAME);
|
|
3522
3638
|
const ContentPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
3523
|
-
return /* @__PURE__ */
|
|
3639
|
+
return /* @__PURE__ */ jsx31(SortableContentContext.Provider, { value: true, children: /* @__PURE__ */ jsx31(
|
|
3524
3640
|
SortableContext,
|
|
3525
3641
|
{
|
|
3526
3642
|
items: context.items,
|
|
3527
3643
|
strategy: strategyProp ?? context.strategy,
|
|
3528
|
-
children: withoutSlot ? children : /* @__PURE__ */
|
|
3644
|
+
children: withoutSlot ? children : /* @__PURE__ */ jsx31(
|
|
3529
3645
|
ContentPrimitive,
|
|
3530
3646
|
{
|
|
3531
3647
|
"data-slot": "sortable-content",
|
|
@@ -3602,7 +3718,7 @@ function SortableItem(props) {
|
|
|
3602
3718
|
[id, attributes, listeners, setActivatorNodeRef, isDragging, disabled]
|
|
3603
3719
|
);
|
|
3604
3720
|
const ItemPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
3605
|
-
return /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ jsx31(SortableItemContext.Provider, { value: itemContext, children: /* @__PURE__ */ jsx31(
|
|
3606
3722
|
ItemPrimitive,
|
|
3607
3723
|
{
|
|
3608
3724
|
id,
|
|
@@ -3639,7 +3755,7 @@ function SortableItemHandle(props) {
|
|
|
3639
3755
|
itemContext.setActivatorNodeRef(node);
|
|
3640
3756
|
});
|
|
3641
3757
|
const HandlePrimitive = asChild ? SlotPrimitive.Slot : "button";
|
|
3642
|
-
return /* @__PURE__ */
|
|
3758
|
+
return /* @__PURE__ */ jsx31(
|
|
3643
3759
|
HandlePrimitive,
|
|
3644
3760
|
{
|
|
3645
3761
|
type: "button",
|
|
@@ -3698,14 +3814,14 @@ function SortableOverlay(props) {
|
|
|
3698
3814
|
const container = containerProp ?? (mounted ? globalThis.document?.body : null);
|
|
3699
3815
|
if (!container) return null;
|
|
3700
3816
|
return ReactDOM.createPortal(
|
|
3701
|
-
/* @__PURE__ */
|
|
3817
|
+
/* @__PURE__ */ jsx31(
|
|
3702
3818
|
DragOverlay,
|
|
3703
3819
|
{
|
|
3704
3820
|
modifiers: context.modifiers,
|
|
3705
3821
|
className: cn(!context.flatCursor && "cursor-grabbing"),
|
|
3706
3822
|
...overlayProps,
|
|
3707
3823
|
dropAnimation: prefersReducedMotion ? null : callerDropAnimation === void 0 ? defaultDropAnimation : callerDropAnimation,
|
|
3708
|
-
children: /* @__PURE__ */
|
|
3824
|
+
children: /* @__PURE__ */ jsx31(SortableOverlayContext.Provider, { value: true, children: context.activeId ? typeof children === "function" ? children({ value: context.activeId }) : children : null })
|
|
3709
3825
|
}
|
|
3710
3826
|
),
|
|
3711
3827
|
container
|
|
@@ -3714,7 +3830,7 @@ function SortableOverlay(props) {
|
|
|
3714
3830
|
|
|
3715
3831
|
// src/components/status-dot/status-dot.tsx
|
|
3716
3832
|
import { cva as cva4 } from "class-variance-authority";
|
|
3717
|
-
import { jsx as
|
|
3833
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3718
3834
|
var statusDotVariants = cva4("inline-flex shrink-0 rounded-full", {
|
|
3719
3835
|
variants: {
|
|
3720
3836
|
tone: {
|
|
@@ -3748,7 +3864,7 @@ function StatusDot({
|
|
|
3748
3864
|
title,
|
|
3749
3865
|
className
|
|
3750
3866
|
}) {
|
|
3751
|
-
return /* @__PURE__ */
|
|
3867
|
+
return /* @__PURE__ */ jsx32(
|
|
3752
3868
|
"span",
|
|
3753
3869
|
{
|
|
3754
3870
|
"aria-hidden": ariaLabel ? void 0 : true,
|
|
@@ -3766,7 +3882,7 @@ function StatusDot({
|
|
|
3766
3882
|
|
|
3767
3883
|
// src/components/switch/switch.tsx
|
|
3768
3884
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
3769
|
-
import { jsx as
|
|
3885
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3770
3886
|
function Switch({
|
|
3771
3887
|
className,
|
|
3772
3888
|
disabled,
|
|
@@ -3774,7 +3890,7 @@ function Switch({
|
|
|
3774
3890
|
size = "default",
|
|
3775
3891
|
...props
|
|
3776
3892
|
}) {
|
|
3777
|
-
return /* @__PURE__ */
|
|
3893
|
+
return /* @__PURE__ */ jsx33(
|
|
3778
3894
|
SwitchPrimitive.Root,
|
|
3779
3895
|
{
|
|
3780
3896
|
"data-slot": "switch",
|
|
@@ -3787,12 +3903,12 @@ function Switch({
|
|
|
3787
3903
|
className
|
|
3788
3904
|
),
|
|
3789
3905
|
...props,
|
|
3790
|
-
children: /* @__PURE__ */
|
|
3906
|
+
children: /* @__PURE__ */ jsx33(
|
|
3791
3907
|
SwitchPrimitive.Thumb,
|
|
3792
3908
|
{
|
|
3793
3909
|
"data-slot": "switch-thumb",
|
|
3794
3910
|
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",
|
|
3795
|
-
children: loading ? /* @__PURE__ */
|
|
3911
|
+
children: loading ? /* @__PURE__ */ jsx33(
|
|
3796
3912
|
LoadingIcon,
|
|
3797
3913
|
{
|
|
3798
3914
|
"aria-hidden": "true",
|
|
@@ -3806,9 +3922,9 @@ function Switch({
|
|
|
3806
3922
|
}
|
|
3807
3923
|
|
|
3808
3924
|
// src/components/textarea/textarea.tsx
|
|
3809
|
-
import { jsx as
|
|
3925
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3810
3926
|
function Textarea({ className, ...props }) {
|
|
3811
|
-
return /* @__PURE__ */
|
|
3927
|
+
return /* @__PURE__ */ jsx34(
|
|
3812
3928
|
"textarea",
|
|
3813
3929
|
{
|
|
3814
3930
|
"data-slot": "textarea",
|
|
@@ -3825,13 +3941,13 @@ function Textarea({ className, ...props }) {
|
|
|
3825
3941
|
import * as React13 from "react";
|
|
3826
3942
|
import { Toast as ToastPrimitive } from "radix-ui";
|
|
3827
3943
|
import { cva as cva5 } from "class-variance-authority";
|
|
3828
|
-
import { jsx as
|
|
3944
|
+
import { jsx as jsx35, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3829
3945
|
var toastDefaultDurationMs = 3e3;
|
|
3830
3946
|
function ToastProvider({
|
|
3831
3947
|
duration = toastDefaultDurationMs,
|
|
3832
3948
|
...props
|
|
3833
3949
|
}) {
|
|
3834
|
-
return /* @__PURE__ */
|
|
3950
|
+
return /* @__PURE__ */ jsx35(ToastPrimitive.Provider, { duration, ...props });
|
|
3835
3951
|
}
|
|
3836
3952
|
var ToastVisualContext = React13.createContext(null);
|
|
3837
3953
|
var toastStatusIconByVariant = {
|
|
@@ -3889,7 +4005,7 @@ function ToastRoot({
|
|
|
3889
4005
|
...props
|
|
3890
4006
|
}) {
|
|
3891
4007
|
const isDestructive = variant === "destructive";
|
|
3892
|
-
return /* @__PURE__ */
|
|
4008
|
+
return /* @__PURE__ */ jsx35(
|
|
3893
4009
|
ToastPrimitive.Root,
|
|
3894
4010
|
{
|
|
3895
4011
|
"aria-busy": busy,
|
|
@@ -3906,7 +4022,7 @@ function ToastRoot({
|
|
|
3906
4022
|
...style
|
|
3907
4023
|
},
|
|
3908
4024
|
...props,
|
|
3909
|
-
children: /* @__PURE__ */
|
|
4025
|
+
children: /* @__PURE__ */ jsx35(ToastVisualContext.Provider, { value: { busy, variant }, children: /* @__PURE__ */ jsx35("span", { className: "flex min-w-0 max-w-full flex-col items-center justify-center whitespace-normal break-words text-center", children }) })
|
|
3910
4026
|
}
|
|
3911
4027
|
);
|
|
3912
4028
|
}
|
|
@@ -3917,7 +4033,7 @@ function ToastTitle({
|
|
|
3917
4033
|
}) {
|
|
3918
4034
|
const toastVisual = React13.useContext(ToastVisualContext);
|
|
3919
4035
|
const StatusIcon = toastVisual?.variant && hasToastStatusIcon(toastVisual.variant) ? toastStatusIconByVariant[toastVisual.variant] : null;
|
|
3920
|
-
return /* @__PURE__ */
|
|
4036
|
+
return /* @__PURE__ */ jsxs17(
|
|
3921
4037
|
ToastPrimitive.Title,
|
|
3922
4038
|
{
|
|
3923
4039
|
"data-slot": "toast-title",
|
|
@@ -3927,7 +4043,7 @@ function ToastTitle({
|
|
|
3927
4043
|
),
|
|
3928
4044
|
...props,
|
|
3929
4045
|
children: [
|
|
3930
|
-
toastVisual?.busy ? /* @__PURE__ */
|
|
4046
|
+
toastVisual?.busy ? /* @__PURE__ */ jsx35(
|
|
3931
4047
|
Spinner,
|
|
3932
4048
|
{
|
|
3933
4049
|
className: "shrink-0 text-current",
|
|
@@ -3935,8 +4051,8 @@ function ToastTitle({
|
|
|
3935
4051
|
strokeWidth: 2,
|
|
3936
4052
|
trackColor: "color-mix(in srgb, currentColor 28%, transparent)"
|
|
3937
4053
|
}
|
|
3938
|
-
) : StatusIcon ? /* @__PURE__ */
|
|
3939
|
-
/* @__PURE__ */
|
|
4054
|
+
) : StatusIcon ? /* @__PURE__ */ jsx35(StatusIcon, { className: "size-4 shrink-0 text-current" }) : null,
|
|
4055
|
+
/* @__PURE__ */ jsx35("span", { className: "min-w-0 break-words", children: formatToastText(children) })
|
|
3940
4056
|
]
|
|
3941
4057
|
}
|
|
3942
4058
|
);
|
|
@@ -3945,7 +4061,7 @@ function ToastDescription({
|
|
|
3945
4061
|
className,
|
|
3946
4062
|
...props
|
|
3947
4063
|
}) {
|
|
3948
|
-
return /* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsx35(
|
|
3949
4065
|
ToastPrimitive.Description,
|
|
3950
4066
|
{
|
|
3951
4067
|
"data-slot": "toast-description",
|
|
@@ -3961,7 +4077,7 @@ function ToastClose({
|
|
|
3961
4077
|
className,
|
|
3962
4078
|
...props
|
|
3963
4079
|
}) {
|
|
3964
|
-
return /* @__PURE__ */
|
|
4080
|
+
return /* @__PURE__ */ jsx35(
|
|
3965
4081
|
ToastPrimitive.Close,
|
|
3966
4082
|
{
|
|
3967
4083
|
"data-slot": "toast-close",
|
|
@@ -3970,7 +4086,7 @@ function ToastClose({
|
|
|
3970
4086
|
className
|
|
3971
4087
|
),
|
|
3972
4088
|
...props,
|
|
3973
|
-
children: /* @__PURE__ */
|
|
4089
|
+
children: /* @__PURE__ */ jsx35(CloseIcon, { className: "size-4" })
|
|
3974
4090
|
}
|
|
3975
4091
|
);
|
|
3976
4092
|
}
|
|
@@ -3979,7 +4095,7 @@ function ToastViewport({
|
|
|
3979
4095
|
style,
|
|
3980
4096
|
...props
|
|
3981
4097
|
}) {
|
|
3982
|
-
return /* @__PURE__ */
|
|
4098
|
+
return /* @__PURE__ */ jsx35(
|
|
3983
4099
|
ToastPrimitive.Viewport,
|
|
3984
4100
|
{
|
|
3985
4101
|
"data-slot": "toast-viewport",
|
|
@@ -3994,8 +4110,8 @@ function ToastViewport({
|
|
|
3994
4110
|
}
|
|
3995
4111
|
|
|
3996
4112
|
// src/components/underline-tabs/underline-tabs.tsx
|
|
3997
|
-
import { useEffect as
|
|
3998
|
-
import { jsx as
|
|
4113
|
+
import { useEffect as useEffect7, useLayoutEffect as useLayoutEffect4, useRef as useRef5, useState as useState10 } from "react";
|
|
4114
|
+
import { jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3999
4115
|
function UnderlineTabs({
|
|
4000
4116
|
tabs,
|
|
4001
4117
|
value,
|
|
@@ -4010,15 +4126,15 @@ function UnderlineTabs({
|
|
|
4010
4126
|
scrollRightTestId,
|
|
4011
4127
|
preventMouseDownDefault = false
|
|
4012
4128
|
}) {
|
|
4013
|
-
const viewportRef =
|
|
4014
|
-
const rowRef =
|
|
4015
|
-
const buttonRefs =
|
|
4016
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
4017
|
-
const [overflow, setOverflow] =
|
|
4129
|
+
const viewportRef = useRef5(null);
|
|
4130
|
+
const rowRef = useRef5(null);
|
|
4131
|
+
const buttonRefs = useRef5({});
|
|
4132
|
+
const [indicatorStyle, setIndicatorStyle] = useState10({ left: 0, width: 0 });
|
|
4133
|
+
const [overflow, setOverflow] = useState10({
|
|
4018
4134
|
canScrollLeft: false,
|
|
4019
4135
|
canScrollRight: false
|
|
4020
4136
|
});
|
|
4021
|
-
|
|
4137
|
+
useLayoutEffect4(() => {
|
|
4022
4138
|
const row = rowRef.current;
|
|
4023
4139
|
const button = buttonRefs.current[value];
|
|
4024
4140
|
if (!row || !button) {
|
|
@@ -4035,7 +4151,7 @@ function UnderlineTabs({
|
|
|
4035
4151
|
(current) => current.left === nextStyle.left && current.width === nextStyle.width ? current : nextStyle
|
|
4036
4152
|
);
|
|
4037
4153
|
}, [tabs, value]);
|
|
4038
|
-
|
|
4154
|
+
useEffect7(() => {
|
|
4039
4155
|
const viewport = viewportRef.current;
|
|
4040
4156
|
if (!viewport) {
|
|
4041
4157
|
return;
|
|
@@ -4078,7 +4194,7 @@ function UnderlineTabs({
|
|
|
4078
4194
|
behavior: "smooth"
|
|
4079
4195
|
});
|
|
4080
4196
|
};
|
|
4081
|
-
return /* @__PURE__ */
|
|
4197
|
+
return /* @__PURE__ */ jsxs18(
|
|
4082
4198
|
"div",
|
|
4083
4199
|
{
|
|
4084
4200
|
"aria-label": ariaLabel,
|
|
@@ -4090,7 +4206,7 @@ function UnderlineTabs({
|
|
|
4090
4206
|
"data-testid": testId,
|
|
4091
4207
|
role: "tablist",
|
|
4092
4208
|
children: [
|
|
4093
|
-
/* @__PURE__ */
|
|
4209
|
+
/* @__PURE__ */ jsx36(
|
|
4094
4210
|
"div",
|
|
4095
4211
|
{
|
|
4096
4212
|
ref: viewportRef,
|
|
@@ -4104,7 +4220,7 @@ function UnderlineTabs({
|
|
|
4104
4220
|
"data-can-scroll-right": overflow.canScrollRight ? "true" : "false",
|
|
4105
4221
|
"data-slot": "underline-tabs-viewport",
|
|
4106
4222
|
"data-testid": viewportTestId,
|
|
4107
|
-
children: /* @__PURE__ */
|
|
4223
|
+
children: /* @__PURE__ */ jsxs18(
|
|
4108
4224
|
"div",
|
|
4109
4225
|
{
|
|
4110
4226
|
ref: rowRef,
|
|
@@ -4112,7 +4228,7 @@ function UnderlineTabs({
|
|
|
4112
4228
|
children: [
|
|
4113
4229
|
tabs.map((tab) => {
|
|
4114
4230
|
const isActive = value === tab.value;
|
|
4115
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ jsxs18(
|
|
4116
4232
|
"button",
|
|
4117
4233
|
{
|
|
4118
4234
|
ref: (element) => {
|
|
@@ -4135,14 +4251,14 @@ function UnderlineTabs({
|
|
|
4135
4251
|
onClick: () => onValueChange(tab.value),
|
|
4136
4252
|
onMouseDown: preventMouseDownDefault ? (event) => event.preventDefault() : void 0,
|
|
4137
4253
|
children: [
|
|
4138
|
-
/* @__PURE__ */
|
|
4139
|
-
tab.count !== void 0 ? /* @__PURE__ */
|
|
4254
|
+
/* @__PURE__ */ jsx36("span", { children: tab.label }),
|
|
4255
|
+
tab.count !== void 0 ? /* @__PURE__ */ jsx36("span", { className: "text-[11px] font-medium leading-6 text-[inherit]", children: tab.count }) : null
|
|
4140
4256
|
]
|
|
4141
4257
|
},
|
|
4142
4258
|
tab.value
|
|
4143
4259
|
);
|
|
4144
4260
|
}),
|
|
4145
|
-
/* @__PURE__ */
|
|
4261
|
+
/* @__PURE__ */ jsx36(
|
|
4146
4262
|
"div",
|
|
4147
4263
|
{
|
|
4148
4264
|
"aria-hidden": true,
|
|
@@ -4159,7 +4275,7 @@ function UnderlineTabs({
|
|
|
4159
4275
|
)
|
|
4160
4276
|
}
|
|
4161
4277
|
),
|
|
4162
|
-
/* @__PURE__ */
|
|
4278
|
+
/* @__PURE__ */ jsx36(
|
|
4163
4279
|
"button",
|
|
4164
4280
|
{
|
|
4165
4281
|
"aria-label": scrollLeftLabel,
|
|
@@ -4170,10 +4286,10 @@ function UnderlineTabs({
|
|
|
4170
4286
|
disabled: !overflow.canScrollLeft,
|
|
4171
4287
|
type: "button",
|
|
4172
4288
|
onClick: () => scrollTabs("left"),
|
|
4173
|
-
children: /* @__PURE__ */
|
|
4289
|
+
children: /* @__PURE__ */ jsx36(ArrowLeftIcon, { size: 16 })
|
|
4174
4290
|
}
|
|
4175
4291
|
),
|
|
4176
|
-
/* @__PURE__ */
|
|
4292
|
+
/* @__PURE__ */ jsx36(
|
|
4177
4293
|
"button",
|
|
4178
4294
|
{
|
|
4179
4295
|
"aria-label": scrollRightLabel,
|
|
@@ -4184,7 +4300,7 @@ function UnderlineTabs({
|
|
|
4184
4300
|
disabled: !overflow.canScrollRight,
|
|
4185
4301
|
type: "button",
|
|
4186
4302
|
onClick: () => scrollTabs("right"),
|
|
4187
|
-
children: /* @__PURE__ */
|
|
4303
|
+
children: /* @__PURE__ */ jsx36(ArrowRightIcon, { size: 16 })
|
|
4188
4304
|
}
|
|
4189
4305
|
)
|
|
4190
4306
|
]
|
|
@@ -4195,7 +4311,7 @@ function UnderlineTabs({
|
|
|
4195
4311
|
// src/components/viewport-menu-surface/viewport-menu-surface.tsx
|
|
4196
4312
|
import * as React14 from "react";
|
|
4197
4313
|
import { createPortal as createPortal3 } from "react-dom";
|
|
4198
|
-
import { jsx as
|
|
4314
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4199
4315
|
var VIEWPORT_MENU_PADDING = 12;
|
|
4200
4316
|
var MENU_BOUNDARY_PADDING = 8;
|
|
4201
4317
|
function clampMenuCoordinate(origin, size, viewportExtent, padding) {
|
|
@@ -4465,7 +4581,7 @@ var ViewportMenuSurface = React14.forwardRef(function ViewportMenuSurface2({
|
|
|
4465
4581
|
}
|
|
4466
4582
|
const portalTarget = resolvedPlacement.portalTarget ?? document.body;
|
|
4467
4583
|
return createPortal3(
|
|
4468
|
-
/* @__PURE__ */
|
|
4584
|
+
/* @__PURE__ */ jsx37(
|
|
4469
4585
|
MenuSurface,
|
|
4470
4586
|
{
|
|
4471
4587
|
...rest,
|
|
@@ -4602,6 +4718,7 @@ export {
|
|
|
4602
4718
|
SelectScrollDownButton,
|
|
4603
4719
|
Separator2 as Separator,
|
|
4604
4720
|
SectionTabs,
|
|
4721
|
+
SegmentBar,
|
|
4605
4722
|
ShortcutBadge,
|
|
4606
4723
|
Slider,
|
|
4607
4724
|
toast,
|
|
@@ -4626,4 +4743,4 @@ export {
|
|
|
4626
4743
|
UnderlineTabs,
|
|
4627
4744
|
ViewportMenuSurface
|
|
4628
4745
|
};
|
|
4629
|
-
//# sourceMappingURL=chunk-
|
|
4746
|
+
//# sourceMappingURL=chunk-FQWIOPDU.js.map
|