@bubo-squared/ui-framework 0.2.15 → 0.2.16
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.cjs +251 -276
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +250 -275
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -118,10 +118,10 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
118
118
|
]
|
|
119
119
|
},
|
|
120
120
|
size: {
|
|
121
|
-
sm: ["px-
|
|
122
|
-
md: ["px-2", "py-1", "gap-
|
|
123
|
-
lg: ["px-2.5", "py-1", "gap-
|
|
124
|
-
xl: ["px-3", "py-0.5", "gap-
|
|
121
|
+
sm: ["px-2", "py-1", "gap-2", "h-9"],
|
|
122
|
+
md: ["px-2", "py-1", "gap-2", "h-10"],
|
|
123
|
+
lg: ["px-2.5", "py-1", "gap-2.5", "h-11"],
|
|
124
|
+
xl: ["px-3", "py-0.5", "gap-3", "h-12"]
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
defaultVariants: {
|
|
@@ -134,19 +134,19 @@ var buttonIconVariants = (0, import_class_variance_authority.cva)("relative", {
|
|
|
134
134
|
variants: {
|
|
135
135
|
size: {
|
|
136
136
|
sm: ["size-5", "*:size-5"],
|
|
137
|
-
md: ["size-
|
|
137
|
+
md: ["size-5", "*:size-5"],
|
|
138
138
|
lg: ["size-6", "*:size-6"],
|
|
139
|
-
xl: ["size-
|
|
139
|
+
xl: ["size-7", "*:size-7"]
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
var buttonTextVariants = (0, import_class_variance_authority.cva)("flex text-center justify-center font-normal", {
|
|
144
144
|
variants: {
|
|
145
145
|
size: {
|
|
146
|
-
sm: ["
|
|
147
|
-
md: ["
|
|
148
|
-
lg: ["
|
|
149
|
-
xl: ["
|
|
146
|
+
sm: ["paragraph-sm"],
|
|
147
|
+
md: ["paragraph-md"],
|
|
148
|
+
lg: ["paragraph-lg"],
|
|
149
|
+
xl: ["subtitle"]
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
});
|
|
@@ -220,7 +220,7 @@ var import_react_slot2 = require("@radix-ui/react-slot");
|
|
|
220
220
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
221
221
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
222
222
|
var iconButtonVariants = (0, import_class_variance_authority3.cva)(
|
|
223
|
-
"inline-flex items-center justify-center whitespace-nowrap
|
|
223
|
+
"inline-flex items-center justify-center whitespace-nowrap transition-colors disabled:pointer-events-none overflow-hidden p-1.5 cursor-pointer",
|
|
224
224
|
{
|
|
225
225
|
variants: {
|
|
226
226
|
variant: {
|
|
@@ -262,13 +262,14 @@ var IconButton = React2.forwardRef(
|
|
|
262
262
|
size,
|
|
263
263
|
asChild = false,
|
|
264
264
|
icon,
|
|
265
|
+
round = false,
|
|
265
266
|
...rest
|
|
266
267
|
} = props;
|
|
267
268
|
const Comp = asChild ? import_react_slot2.Slot : "button";
|
|
268
269
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
269
270
|
Comp,
|
|
270
271
|
{
|
|
271
|
-
className: cn(iconButtonVariants({ variant, size }), className),
|
|
272
|
+
className: cn(iconButtonVariants({ variant, size }), round ? "rounded-full" : "rounded-4", className),
|
|
272
273
|
ref,
|
|
273
274
|
...rest,
|
|
274
275
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "buttonIcon flex items-center justify-center", children: icon })
|
|
@@ -1713,6 +1714,8 @@ var Autocomplete = (props) => {
|
|
|
1713
1714
|
inputValue,
|
|
1714
1715
|
defaultInputValue,
|
|
1715
1716
|
onInputChange,
|
|
1717
|
+
dropdownClassName,
|
|
1718
|
+
listboxClassName,
|
|
1716
1719
|
placeholder = "Search\u2026",
|
|
1717
1720
|
onKeyDown,
|
|
1718
1721
|
onFocus,
|
|
@@ -1873,7 +1876,8 @@ var Autocomplete = (props) => {
|
|
|
1873
1876
|
className: cn(
|
|
1874
1877
|
"absolute left-0 right-0 mt-1",
|
|
1875
1878
|
dropdownSurfaceClass,
|
|
1876
|
-
dropdownScrollClass
|
|
1879
|
+
dropdownScrollClass,
|
|
1880
|
+
dropdownClassName
|
|
1877
1881
|
),
|
|
1878
1882
|
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1879
1883
|
"div",
|
|
@@ -1889,23 +1893,31 @@ var Autocomplete = (props) => {
|
|
|
1889
1893
|
"aria-live": "polite",
|
|
1890
1894
|
children: noOptionsText
|
|
1891
1895
|
}
|
|
1892
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1893
|
-
"
|
|
1896
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1897
|
+
"ul",
|
|
1894
1898
|
{
|
|
1895
|
-
id:
|
|
1896
|
-
role: "
|
|
1897
|
-
"
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1899
|
+
id: listboxId,
|
|
1900
|
+
role: "listbox",
|
|
1901
|
+
className: cn("flex flex-col", listboxClassName),
|
|
1902
|
+
children: options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1903
|
+
"li",
|
|
1904
|
+
{
|
|
1905
|
+
id: `${inputId}-option-${index}`,
|
|
1906
|
+
role: "option",
|
|
1907
|
+
"aria-selected": index === activeIndex,
|
|
1908
|
+
className: cn(
|
|
1909
|
+
optionVariants({ size, active: index === activeIndex }),
|
|
1910
|
+
"px-(--space-8) pr-(--space-16) text-primary cursor-pointer"
|
|
1911
|
+
),
|
|
1912
|
+
onMouseDown: handleOptionMouseDown,
|
|
1913
|
+
onMouseEnter: () => setActiveIndex(index),
|
|
1914
|
+
onClick: () => handleOptionClick(option),
|
|
1915
|
+
children: option
|
|
1916
|
+
},
|
|
1917
|
+
`${option}-${index}`
|
|
1918
|
+
))
|
|
1919
|
+
}
|
|
1920
|
+
)
|
|
1909
1921
|
}
|
|
1910
1922
|
)
|
|
1911
1923
|
] }) });
|
|
@@ -3145,8 +3157,95 @@ var SearchInput = (props) => {
|
|
|
3145
3157
|
SearchInput.displayName = "SearchInput";
|
|
3146
3158
|
|
|
3147
3159
|
// src/components/Inputs/Slider.tsx
|
|
3148
|
-
var
|
|
3160
|
+
var React35 = __toESM(require("react"), 1);
|
|
3161
|
+
|
|
3162
|
+
// src/components/Feedback/Tooltip.tsx
|
|
3163
|
+
var React34 = require("react");
|
|
3164
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
3149
3165
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3166
|
+
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
3167
|
+
var mapPlacementToSideAndAlign = (placement) => {
|
|
3168
|
+
switch (placement) {
|
|
3169
|
+
case "top":
|
|
3170
|
+
return { side: "top", align: "center" };
|
|
3171
|
+
case "topLeft":
|
|
3172
|
+
return { side: "top", align: "start" };
|
|
3173
|
+
case "topRight":
|
|
3174
|
+
return { side: "top", align: "end" };
|
|
3175
|
+
case "bottom":
|
|
3176
|
+
return { side: "bottom", align: "center" };
|
|
3177
|
+
case "bottomLeft":
|
|
3178
|
+
return { side: "bottom", align: "start" };
|
|
3179
|
+
case "bottomRight":
|
|
3180
|
+
return { side: "bottom", align: "end" };
|
|
3181
|
+
case "left":
|
|
3182
|
+
return { side: "left", align: "center" };
|
|
3183
|
+
case "leftTop":
|
|
3184
|
+
return { side: "left", align: "start" };
|
|
3185
|
+
case "leftBottom":
|
|
3186
|
+
return { side: "left", align: "end" };
|
|
3187
|
+
case "right":
|
|
3188
|
+
return { side: "right", align: "center" };
|
|
3189
|
+
case "rightTop":
|
|
3190
|
+
return { side: "right", align: "start" };
|
|
3191
|
+
case "rightBottom":
|
|
3192
|
+
return { side: "right", align: "end" };
|
|
3193
|
+
default:
|
|
3194
|
+
return { side: "top", align: "center" };
|
|
3195
|
+
}
|
|
3196
|
+
};
|
|
3197
|
+
var Tooltip = (props) => {
|
|
3198
|
+
const {
|
|
3199
|
+
strapline,
|
|
3200
|
+
title,
|
|
3201
|
+
description,
|
|
3202
|
+
showArrow = true,
|
|
3203
|
+
className,
|
|
3204
|
+
placement = "top",
|
|
3205
|
+
offset = 10,
|
|
3206
|
+
disableHoverableContent,
|
|
3207
|
+
open,
|
|
3208
|
+
defaultOpen,
|
|
3209
|
+
onOpenChange,
|
|
3210
|
+
children
|
|
3211
|
+
} = props;
|
|
3212
|
+
const { side, align } = mapPlacementToSideAndAlign(placement);
|
|
3213
|
+
const tooltipClasses = "group bg-(--background-tooltip) max-w-[calc(100vw-2rem)] shadow-card-md border-none rounded-4 p-4 [&>span]:scale-200 data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
3214
|
+
const tooltipArrowClasses = "relative fill-(--background-tooltip) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
|
|
3215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3216
|
+
TooltipPrimitive.Root,
|
|
3217
|
+
{
|
|
3218
|
+
open,
|
|
3219
|
+
defaultOpen,
|
|
3220
|
+
onOpenChange,
|
|
3221
|
+
disableHoverableContent,
|
|
3222
|
+
children: [
|
|
3223
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3225
|
+
TooltipPrimitive.Content,
|
|
3226
|
+
{
|
|
3227
|
+
side,
|
|
3228
|
+
align,
|
|
3229
|
+
sideOffset: offset,
|
|
3230
|
+
className: cn(tooltipClasses, className),
|
|
3231
|
+
children: [
|
|
3232
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipArrow, { className: tooltipArrowClasses }),
|
|
3233
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid gap-2", children: [
|
|
3234
|
+
(strapline ?? "") !== "" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "caption text-secondary", children: strapline }),
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h4", { className: "subtitle-medium text-primary", children: title }),
|
|
3236
|
+
(description ?? "") !== "" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "paragraph-sm text-primary", children: description })
|
|
3237
|
+
] })
|
|
3238
|
+
]
|
|
3239
|
+
}
|
|
3240
|
+
) })
|
|
3241
|
+
]
|
|
3242
|
+
}
|
|
3243
|
+
);
|
|
3244
|
+
};
|
|
3245
|
+
Tooltip.displayName = "Tooltip";
|
|
3246
|
+
|
|
3247
|
+
// src/components/Inputs/Slider.tsx
|
|
3248
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3150
3249
|
var wrapperBase = "flex flex-col gap-2 items-start";
|
|
3151
3250
|
var isRangeProps = (props) => {
|
|
3152
3251
|
return Array.isArray(props.value) || Array.isArray(props.defaultValue);
|
|
@@ -3173,7 +3272,7 @@ var Slider = (props) => {
|
|
|
3173
3272
|
const isRange = isRangeProps(props);
|
|
3174
3273
|
const isControlled = value !== void 0;
|
|
3175
3274
|
const expectedLength = isRange ? 2 : 1;
|
|
3176
|
-
const normalizeArray =
|
|
3275
|
+
const normalizeArray = React35.useCallback(
|
|
3177
3276
|
(arr, fallback) => {
|
|
3178
3277
|
if (!arr || arr.length === 0) return fallback;
|
|
3179
3278
|
if (arr.length === expectedLength) return arr;
|
|
@@ -3185,16 +3284,16 @@ var Slider = (props) => {
|
|
|
3185
3284
|
},
|
|
3186
3285
|
[expectedLength, max]
|
|
3187
3286
|
);
|
|
3188
|
-
const defaultInternal =
|
|
3287
|
+
const defaultInternal = React35.useMemo(() => {
|
|
3189
3288
|
const defaultValueArray = toArray(defaultValue);
|
|
3190
3289
|
if (defaultValueArray) return normalizeArray(defaultValueArray, []);
|
|
3191
3290
|
if (isRange) return [min, Math.min(min + (max - min) / 4, max)];
|
|
3192
3291
|
return [min + (max - min) / 3];
|
|
3193
3292
|
}, [defaultValue, min, max, isRange, normalizeArray]);
|
|
3194
|
-
const [internalValue, setInternalValue] =
|
|
3293
|
+
const [internalValue, setInternalValue] = React35.useState(
|
|
3195
3294
|
() => normalizeArray(isControlled ? toArray(value) : defaultInternal, defaultInternal)
|
|
3196
3295
|
);
|
|
3197
|
-
|
|
3296
|
+
React35.useEffect(() => {
|
|
3198
3297
|
if (isControlled) {
|
|
3199
3298
|
setInternalValue(
|
|
3200
3299
|
(current2) => normalizeArray(toArray(value), current2.length ? current2 : defaultInternal)
|
|
@@ -3202,15 +3301,16 @@ var Slider = (props) => {
|
|
|
3202
3301
|
}
|
|
3203
3302
|
}, [isControlled, value, normalizeArray, defaultInternal]);
|
|
3204
3303
|
const current = internalValue;
|
|
3205
|
-
const trackRef =
|
|
3206
|
-
const [draggingThumbIndex, setDraggingThumbIndex] =
|
|
3207
|
-
const [hoveredThumbIndex, setHoveredThumbIndex] =
|
|
3208
|
-
const
|
|
3304
|
+
const trackRef = React35.useRef(null);
|
|
3305
|
+
const [draggingThumbIndex, setDraggingThumbIndex] = React35.useState(null);
|
|
3306
|
+
const [hoveredThumbIndex, setHoveredThumbIndex] = React35.useState(null);
|
|
3307
|
+
const [focusedThumbIndex, setFocusedThumbIndex] = React35.useState(null);
|
|
3308
|
+
const clamp = React35.useCallback((val) => {
|
|
3209
3309
|
if (val < min) return min;
|
|
3210
3310
|
if (val > max) return max;
|
|
3211
3311
|
return val;
|
|
3212
3312
|
}, [min, max]);
|
|
3213
|
-
const enforceMinGap =
|
|
3313
|
+
const enforceMinGap = React35.useCallback((next, prev) => {
|
|
3214
3314
|
if (!isRange || next.length !== 2 || step <= 0) return next;
|
|
3215
3315
|
let [low, high] = next;
|
|
3216
3316
|
const [prevLow, prevHigh] = prev.length === 2 ? prev : next;
|
|
@@ -3234,7 +3334,7 @@ var Slider = (props) => {
|
|
|
3234
3334
|
}
|
|
3235
3335
|
return [low, high];
|
|
3236
3336
|
}, [isRange, step, clamp]);
|
|
3237
|
-
|
|
3337
|
+
React35.useEffect(() => {
|
|
3238
3338
|
if (!isControlled) {
|
|
3239
3339
|
setInternalValue((prev) => {
|
|
3240
3340
|
const clamped = prev.map((v) => clamp(v));
|
|
@@ -3368,7 +3468,6 @@ var Slider = (props) => {
|
|
|
3368
3468
|
const secondaryPercent = valueToPercent(secondary);
|
|
3369
3469
|
const showNumeric = display === "numeric";
|
|
3370
3470
|
const showTooltip = display === "tooltip";
|
|
3371
|
-
const isTooltipAbove = tooltipPlacement === "top";
|
|
3372
3471
|
const isDecimalDomain = !Number.isInteger(step) || !Number.isInteger(min) || !Number.isInteger(max);
|
|
3373
3472
|
const formatNumber = (num) => {
|
|
3374
3473
|
if (!isDecimalDomain) {
|
|
@@ -3403,55 +3502,11 @@ var Slider = (props) => {
|
|
|
3403
3502
|
const trackHeight = 32;
|
|
3404
3503
|
const thumbWidth = 18;
|
|
3405
3504
|
const thumbRadius = thumbWidth / 2;
|
|
3406
|
-
const renderTooltipBubble = (key, percent, labelText, isVisible) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3407
|
-
"div",
|
|
3408
|
-
{
|
|
3409
|
-
className: cn(
|
|
3410
|
-
"absolute -translate-x-1/2 flex flex-col items-center",
|
|
3411
|
-
"transition-[opacity,transform] duration-150",
|
|
3412
|
-
isVisible ? "opacity-100 scale-100 pointer-events-auto" : "opacity-0 scale-95 pointer-events-none"
|
|
3413
|
-
),
|
|
3414
|
-
style: {
|
|
3415
|
-
left: `${percent}%`,
|
|
3416
|
-
bottom: isTooltipAbove ? "100%" : void 0,
|
|
3417
|
-
top: isTooltipAbove ? void 0 : "100%",
|
|
3418
|
-
marginBottom: isTooltipAbove ? 8 : void 0,
|
|
3419
|
-
marginTop: isTooltipAbove ? void 0 : 8
|
|
3420
|
-
},
|
|
3421
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3422
|
-
"div",
|
|
3423
|
-
{
|
|
3424
|
-
className: cn("relative rounded-4 shadow-card-md px-(--space-8) py-(--space-4) bg-(--background-tooltip)"),
|
|
3425
|
-
children: [
|
|
3426
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3427
|
-
"p",
|
|
3428
|
-
{
|
|
3429
|
-
className: cn(
|
|
3430
|
-
"paragraph-sm",
|
|
3431
|
-
disabled ? "text-secondary" : "text-primary"
|
|
3432
|
-
),
|
|
3433
|
-
children: labelText
|
|
3434
|
-
}
|
|
3435
|
-
),
|
|
3436
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3437
|
-
"div",
|
|
3438
|
-
{
|
|
3439
|
-
className: cn(
|
|
3440
|
-
"absolute left-1/2 -translate-x-1/2 w-2 h-2 rotate-45 bg-(--background-tooltip)",
|
|
3441
|
-
isTooltipAbove ? "-bottom-1" : "-top-1"
|
|
3442
|
-
)
|
|
3443
|
-
}
|
|
3444
|
-
)
|
|
3445
|
-
]
|
|
3446
|
-
}
|
|
3447
|
-
)
|
|
3448
|
-
},
|
|
3449
|
-
key
|
|
3450
|
-
);
|
|
3451
3505
|
const renderHandle = (index, percent, ariaValueText) => {
|
|
3452
3506
|
const val = index === 0 ? primary : secondary;
|
|
3453
3507
|
const isDragging = draggingThumbIndex === index;
|
|
3454
|
-
|
|
3508
|
+
const isTooltipVisible = showTooltip && (hoveredThumbIndex === index || draggingThumbIndex === index || focusedThumbIndex === index);
|
|
3509
|
+
const handle = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3455
3510
|
"button",
|
|
3456
3511
|
{
|
|
3457
3512
|
type: "button",
|
|
@@ -3480,6 +3535,12 @@ var Slider = (props) => {
|
|
|
3480
3535
|
onPointerLeave: () => {
|
|
3481
3536
|
setHoveredThumbIndex((prev) => prev === index ? null : prev);
|
|
3482
3537
|
},
|
|
3538
|
+
onFocus: () => {
|
|
3539
|
+
setFocusedThumbIndex(index);
|
|
3540
|
+
},
|
|
3541
|
+
onBlur: () => {
|
|
3542
|
+
setFocusedThumbIndex((prev) => prev === index ? null : prev);
|
|
3543
|
+
},
|
|
3483
3544
|
onPointerDown: (event) => {
|
|
3484
3545
|
if (disabled) return;
|
|
3485
3546
|
if (event.button !== 0) return;
|
|
@@ -3490,15 +3551,28 @@ var Slider = (props) => {
|
|
|
3490
3551
|
},
|
|
3491
3552
|
index
|
|
3492
3553
|
);
|
|
3554
|
+
if (!showTooltip) return handle;
|
|
3555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3556
|
+
Tooltip,
|
|
3557
|
+
{
|
|
3558
|
+
title: ariaValueText,
|
|
3559
|
+
placement: tooltipPlacement === "top" ? "top" : "bottom",
|
|
3560
|
+
offset: 8,
|
|
3561
|
+
open: isTooltipVisible,
|
|
3562
|
+
disableHoverableContent: true,
|
|
3563
|
+
className: "z-50",
|
|
3564
|
+
children: handle
|
|
3565
|
+
}
|
|
3566
|
+
);
|
|
3493
3567
|
};
|
|
3494
|
-
return /* @__PURE__ */ (0,
|
|
3568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3495
3569
|
"div",
|
|
3496
3570
|
{
|
|
3497
3571
|
className: wrapperBase,
|
|
3498
3572
|
style: { marginInline: `${thumbRadius}px` },
|
|
3499
3573
|
children: [
|
|
3500
|
-
name && /* @__PURE__ */ (0,
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
3575
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3502
3576
|
"input",
|
|
3503
3577
|
{
|
|
3504
3578
|
type: "hidden",
|
|
@@ -3507,7 +3581,7 @@ var Slider = (props) => {
|
|
|
3507
3581
|
disabled
|
|
3508
3582
|
}
|
|
3509
3583
|
),
|
|
3510
|
-
isRange && secondary !== void 0 && /* @__PURE__ */ (0,
|
|
3584
|
+
isRange && secondary !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3511
3585
|
"input",
|
|
3512
3586
|
{
|
|
3513
3587
|
type: "hidden",
|
|
@@ -3517,51 +3591,37 @@ var Slider = (props) => {
|
|
|
3517
3591
|
}
|
|
3518
3592
|
)
|
|
3519
3593
|
] }),
|
|
3520
|
-
/* @__PURE__ */ (0,
|
|
3521
|
-
/* @__PURE__ */ (0,
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
ref: trackRef,
|
|
3543
|
-
onPointerDown: handleTrackPointerDown,
|
|
3544
|
-
children: [
|
|
3545
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3546
|
-
"div",
|
|
3547
|
-
{
|
|
3548
|
-
className: cn(
|
|
3549
|
-
"absolute h-full rounded-4",
|
|
3550
|
-
disabled ? "bg-(--background-primary-disabled)" : "bg-(--background-secondary)"
|
|
3551
|
-
),
|
|
3552
|
-
style: {
|
|
3553
|
-
width: `calc(100% + ${thumbWidth}px)`,
|
|
3554
|
-
left: `-${thumbRadius}px`
|
|
3555
|
-
}
|
|
3594
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("w-full flex flex-col gap-1", className), children: [
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "relative w-full", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3596
|
+
"div",
|
|
3597
|
+
{
|
|
3598
|
+
className: cn(
|
|
3599
|
+
"relative w-full flex items-center rounded-4",
|
|
3600
|
+
disabled ? "bg-(--background-slider-track-disabled) cursor-default" : "bg-(--background-slider-track) cursor-pointer"
|
|
3601
|
+
),
|
|
3602
|
+
style: { height: `${trackHeight}px` },
|
|
3603
|
+
ref: trackRef,
|
|
3604
|
+
onPointerDown: handleTrackPointerDown,
|
|
3605
|
+
children: [
|
|
3606
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3607
|
+
"div",
|
|
3608
|
+
{
|
|
3609
|
+
className: cn(
|
|
3610
|
+
"absolute h-full rounded-4",
|
|
3611
|
+
disabled ? "bg-(--background-slider-track-disabled)" : "bg-(--background-slider-track)"
|
|
3612
|
+
),
|
|
3613
|
+
style: {
|
|
3614
|
+
width: `calc(100% + ${thumbWidth}px)`,
|
|
3615
|
+
left: `-${thumbRadius}px`
|
|
3556
3616
|
}
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
showNumeric && /* @__PURE__ */ (0,
|
|
3617
|
+
}
|
|
3618
|
+
),
|
|
3619
|
+
renderHandle(0, primaryPercent, formatDisplayValue(primary)),
|
|
3620
|
+
isRange && secondary !== void 0 && renderHandle(1, secondaryPercent, formatDisplayValue(secondary))
|
|
3621
|
+
]
|
|
3622
|
+
}
|
|
3623
|
+
) }),
|
|
3624
|
+
showNumeric && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3565
3625
|
"p",
|
|
3566
3626
|
{
|
|
3567
3627
|
className: cn(
|
|
@@ -3579,9 +3639,9 @@ var Slider = (props) => {
|
|
|
3579
3639
|
Slider.displayName = "Slider";
|
|
3580
3640
|
|
|
3581
3641
|
// src/components/Inputs/TextArea.tsx
|
|
3582
|
-
var
|
|
3642
|
+
var React36 = __toESM(require("react"), 1);
|
|
3583
3643
|
var import_icons13 = require("@bubo-squared/icons");
|
|
3584
|
-
var
|
|
3644
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3585
3645
|
var TextArea = (props) => {
|
|
3586
3646
|
const {
|
|
3587
3647
|
label,
|
|
@@ -3601,7 +3661,7 @@ var TextArea = (props) => {
|
|
|
3601
3661
|
...textareaProps
|
|
3602
3662
|
} = props;
|
|
3603
3663
|
const isControlled = value !== void 0;
|
|
3604
|
-
const [internalValue, setInternalValue] =
|
|
3664
|
+
const [internalValue, setInternalValue] = React36.useState(
|
|
3605
3665
|
defaultValue ?? ""
|
|
3606
3666
|
);
|
|
3607
3667
|
const currentValue = (isControlled ? value : internalValue) ?? "";
|
|
@@ -3609,10 +3669,10 @@ var TextArea = (props) => {
|
|
|
3609
3669
|
const currentLength = currentValue.length;
|
|
3610
3670
|
const effectiveMaxLength = type === "character-limit" ? maxLength ?? 144 : void 0;
|
|
3611
3671
|
const showCharacterLimit = type === "character-limit" && typeof effectiveMaxLength === "number";
|
|
3612
|
-
const textareaRef =
|
|
3613
|
-
const containerRef =
|
|
3614
|
-
const [height, setHeight] =
|
|
3615
|
-
const [width, setWidth] =
|
|
3672
|
+
const textareaRef = React36.useRef(null);
|
|
3673
|
+
const containerRef = React36.useRef(null);
|
|
3674
|
+
const [height, setHeight] = React36.useState(void 0);
|
|
3675
|
+
const [width, setWidth] = React36.useState(void 0);
|
|
3616
3676
|
const minHeight = 80;
|
|
3617
3677
|
const minWidth = 240;
|
|
3618
3678
|
const handleContainerClick = () => {
|
|
@@ -3625,7 +3685,7 @@ var TextArea = (props) => {
|
|
|
3625
3685
|
}
|
|
3626
3686
|
onChange?.(event);
|
|
3627
3687
|
};
|
|
3628
|
-
const generatedId =
|
|
3688
|
+
const generatedId = React36.useId();
|
|
3629
3689
|
const textareaId = id ?? generatedId;
|
|
3630
3690
|
const statusBorderClass = {
|
|
3631
3691
|
default: "",
|
|
@@ -3662,7 +3722,7 @@ var TextArea = (props) => {
|
|
|
3662
3722
|
window.addEventListener("pointermove", handlePointerMove);
|
|
3663
3723
|
window.addEventListener("pointerup", handlePointerUp);
|
|
3664
3724
|
};
|
|
3665
|
-
return /* @__PURE__ */ (0,
|
|
3725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3666
3726
|
Field,
|
|
3667
3727
|
{
|
|
3668
3728
|
className: "w-full",
|
|
@@ -3671,7 +3731,7 @@ var TextArea = (props) => {
|
|
|
3671
3731
|
hideHint,
|
|
3672
3732
|
status,
|
|
3673
3733
|
disabled,
|
|
3674
|
-
children: /* @__PURE__ */ (0,
|
|
3734
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3675
3735
|
"div",
|
|
3676
3736
|
{
|
|
3677
3737
|
className: cn(
|
|
@@ -3690,7 +3750,7 @@ var TextArea = (props) => {
|
|
|
3690
3750
|
onClick: handleContainerClick,
|
|
3691
3751
|
"aria-disabled": disabled || void 0,
|
|
3692
3752
|
children: [
|
|
3693
|
-
/* @__PURE__ */ (0,
|
|
3753
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3694
3754
|
"textarea",
|
|
3695
3755
|
{
|
|
3696
3756
|
id: textareaId,
|
|
@@ -3710,7 +3770,7 @@ var TextArea = (props) => {
|
|
|
3710
3770
|
...textareaProps
|
|
3711
3771
|
}
|
|
3712
3772
|
),
|
|
3713
|
-
showCharacterLimit && /* @__PURE__ */ (0,
|
|
3773
|
+
showCharacterLimit && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3714
3774
|
"span",
|
|
3715
3775
|
{
|
|
3716
3776
|
className: cn(
|
|
@@ -3724,19 +3784,19 @@ var TextArea = (props) => {
|
|
|
3724
3784
|
]
|
|
3725
3785
|
}
|
|
3726
3786
|
),
|
|
3727
|
-
type === "responsive" && /* @__PURE__ */ (0,
|
|
3787
|
+
type === "responsive" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3728
3788
|
"div",
|
|
3729
3789
|
{
|
|
3730
3790
|
className: "absolute bottom-1 right-1 h-3 w-3 " + (disabled ? "cursor-auto" : "cursor-nwse-resize"),
|
|
3731
3791
|
onPointerDown: disabled ? void 0 : handleResizePointerDown,
|
|
3732
|
-
children: /* @__PURE__ */ (0,
|
|
3792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3733
3793
|
"span",
|
|
3734
3794
|
{
|
|
3735
3795
|
className: cn(
|
|
3736
3796
|
"absolute bottom-0 right-0 flex h-4 w-4 items-center justify-center text-(--icon-primary)",
|
|
3737
3797
|
disabled && "text-(--icon-primary-disabled)"
|
|
3738
3798
|
),
|
|
3739
|
-
children: /* @__PURE__ */ (0,
|
|
3799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons13.MaximizeIcon, {})
|
|
3740
3800
|
}
|
|
3741
3801
|
)
|
|
3742
3802
|
}
|
|
@@ -3750,9 +3810,9 @@ var TextArea = (props) => {
|
|
|
3750
3810
|
TextArea.displayName = "TextArea";
|
|
3751
3811
|
|
|
3752
3812
|
// src/components/Inputs/TextInput.tsx
|
|
3753
|
-
var
|
|
3813
|
+
var React37 = __toESM(require("react"), 1);
|
|
3754
3814
|
var import_class_variance_authority20 = require("class-variance-authority");
|
|
3755
|
-
var
|
|
3815
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3756
3816
|
var inputTextVariants3 = (0, import_class_variance_authority20.cva)("truncate", {
|
|
3757
3817
|
variants: {
|
|
3758
3818
|
size: {
|
|
@@ -3803,11 +3863,11 @@ var TextInput = (props) => {
|
|
|
3803
3863
|
...inputProps
|
|
3804
3864
|
} = props;
|
|
3805
3865
|
const isControlled = value !== void 0;
|
|
3806
|
-
const [internalValue, setInternalValue] =
|
|
3866
|
+
const [internalValue, setInternalValue] = React37.useState(
|
|
3807
3867
|
defaultValue ?? ""
|
|
3808
3868
|
);
|
|
3809
3869
|
const currentValue = (isControlled ? value : internalValue) ?? "";
|
|
3810
|
-
const inputRef =
|
|
3870
|
+
const inputRef = React37.useRef(null);
|
|
3811
3871
|
const handleContainerClick = () => {
|
|
3812
3872
|
if (disabled) return;
|
|
3813
3873
|
inputRef.current?.focus();
|
|
@@ -3820,7 +3880,7 @@ var TextInput = (props) => {
|
|
|
3820
3880
|
};
|
|
3821
3881
|
const showLeadingIcon = !!leadingIcon;
|
|
3822
3882
|
const showTrailingIcon = !!trailingIcon;
|
|
3823
|
-
return /* @__PURE__ */ (0,
|
|
3883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3824
3884
|
Field,
|
|
3825
3885
|
{
|
|
3826
3886
|
label,
|
|
@@ -3828,7 +3888,7 @@ var TextInput = (props) => {
|
|
|
3828
3888
|
hideHint,
|
|
3829
3889
|
status,
|
|
3830
3890
|
disabled,
|
|
3831
|
-
children: /* @__PURE__ */ (0,
|
|
3891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3832
3892
|
InputShell,
|
|
3833
3893
|
{
|
|
3834
3894
|
size,
|
|
@@ -3837,7 +3897,7 @@ var TextInput = (props) => {
|
|
|
3837
3897
|
className,
|
|
3838
3898
|
onClick: handleContainerClick,
|
|
3839
3899
|
children: [
|
|
3840
|
-
showLeadingIcon && /* @__PURE__ */ (0,
|
|
3900
|
+
showLeadingIcon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3841
3901
|
"span",
|
|
3842
3902
|
{
|
|
3843
3903
|
className: cn(
|
|
@@ -3846,7 +3906,7 @@ var TextInput = (props) => {
|
|
|
3846
3906
|
children: leadingIcon
|
|
3847
3907
|
}
|
|
3848
3908
|
),
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
3909
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3850
3910
|
Input,
|
|
3851
3911
|
{
|
|
3852
3912
|
ref: inputRef,
|
|
@@ -3864,7 +3924,7 @@ var TextInput = (props) => {
|
|
|
3864
3924
|
...inputProps
|
|
3865
3925
|
}
|
|
3866
3926
|
),
|
|
3867
|
-
showTrailingIcon && /* @__PURE__ */ (0,
|
|
3927
|
+
showTrailingIcon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3868
3928
|
"span",
|
|
3869
3929
|
{
|
|
3870
3930
|
className: cn(
|
|
@@ -3882,11 +3942,11 @@ var TextInput = (props) => {
|
|
|
3882
3942
|
TextInput.displayName = "TextInput";
|
|
3883
3943
|
|
|
3884
3944
|
// src/components/Inputs/Toggle.tsx
|
|
3885
|
-
var
|
|
3886
|
-
var
|
|
3945
|
+
var React38 = require("react");
|
|
3946
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3887
3947
|
var Toggle = (props) => {
|
|
3888
3948
|
const { label, className, disabled, ...inputProps } = props;
|
|
3889
|
-
return /* @__PURE__ */ (0,
|
|
3949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3890
3950
|
"label",
|
|
3891
3951
|
{
|
|
3892
3952
|
className: cn(
|
|
@@ -3894,8 +3954,8 @@ var Toggle = (props) => {
|
|
|
3894
3954
|
disabled ? "cursor-default" : "cursor-pointer"
|
|
3895
3955
|
),
|
|
3896
3956
|
children: [
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
3898
|
-
/* @__PURE__ */ (0,
|
|
3957
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "relative inline-flex items-center", children: [
|
|
3958
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3899
3959
|
"input",
|
|
3900
3960
|
{
|
|
3901
3961
|
type: "checkbox",
|
|
@@ -3904,7 +3964,7 @@ var Toggle = (props) => {
|
|
|
3904
3964
|
...inputProps
|
|
3905
3965
|
}
|
|
3906
3966
|
),
|
|
3907
|
-
/* @__PURE__ */ (0,
|
|
3967
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3908
3968
|
"span",
|
|
3909
3969
|
{
|
|
3910
3970
|
className: cn(
|
|
@@ -3944,7 +4004,7 @@ var Toggle = (props) => {
|
|
|
3944
4004
|
"peer-disabled:[&>.knob]:peer-checked:bg-(--background-primary-hover)",
|
|
3945
4005
|
className
|
|
3946
4006
|
),
|
|
3947
|
-
children: /* @__PURE__ */ (0,
|
|
4007
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3948
4008
|
"span",
|
|
3949
4009
|
{
|
|
3950
4010
|
className: cn(
|
|
@@ -3956,7 +4016,7 @@ var Toggle = (props) => {
|
|
|
3956
4016
|
}
|
|
3957
4017
|
)
|
|
3958
4018
|
] }),
|
|
3959
|
-
label && /* @__PURE__ */ (0,
|
|
4019
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3960
4020
|
"span",
|
|
3961
4021
|
{
|
|
3962
4022
|
className: cn(
|
|
@@ -3973,8 +4033,8 @@ var Toggle = (props) => {
|
|
|
3973
4033
|
Toggle.displayName = "Toggle";
|
|
3974
4034
|
|
|
3975
4035
|
// src/components/Inputs/WebsiteInput.tsx
|
|
3976
|
-
var
|
|
3977
|
-
var
|
|
4036
|
+
var React39 = require("react");
|
|
4037
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3978
4038
|
var WebsiteInput = (props) => {
|
|
3979
4039
|
const {
|
|
3980
4040
|
hierarchy = "leading",
|
|
@@ -4011,15 +4071,15 @@ var WebsiteInput = (props) => {
|
|
|
4011
4071
|
size === "xl" ? "[&>svg]:w-6 [&>svg]:h-6" : size === "sm" ? "[&>svg]:w-4 [&>svg]:h-4" : "[&>svg]:w-5 [&>svg]:h-5",
|
|
4012
4072
|
disabled ? "text-(--icon-primary-disabled)" : "text-(--icon-primary) group-hover:text-(--icon-primary-hover) group-focus-within:text-(--icon-primary-focus)"
|
|
4013
4073
|
);
|
|
4014
|
-
const leadingAddon = /* @__PURE__ */ (0,
|
|
4015
|
-
/* @__PURE__ */ (0,
|
|
4016
|
-
icon != null && /* @__PURE__ */ (0,
|
|
4074
|
+
const leadingAddon = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: baseAddonClass, children: [
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: addonTextClass, children: protocolLabel }),
|
|
4076
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: iconWrapperClass, children: icon })
|
|
4017
4077
|
] });
|
|
4018
|
-
const trailingAddon = /* @__PURE__ */ (0,
|
|
4019
|
-
icon != null && /* @__PURE__ */ (0,
|
|
4020
|
-
/* @__PURE__ */ (0,
|
|
4078
|
+
const trailingAddon = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: baseAddonClass, children: [
|
|
4079
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: iconWrapperClass, children: icon }),
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: addonTextClass, children: protocolLabel })
|
|
4021
4081
|
] });
|
|
4022
|
-
return /* @__PURE__ */ (0,
|
|
4082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4023
4083
|
TextInput,
|
|
4024
4084
|
{
|
|
4025
4085
|
...rest,
|
|
@@ -4034,9 +4094,9 @@ var WebsiteInput = (props) => {
|
|
|
4034
4094
|
WebsiteInput.displayName = "WebsiteInput";
|
|
4035
4095
|
|
|
4036
4096
|
// src/components/Feedback/Popover.tsx
|
|
4037
|
-
var
|
|
4097
|
+
var React40 = __toESM(require("react"), 1);
|
|
4038
4098
|
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
4039
|
-
var
|
|
4099
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4040
4100
|
var PopoverArrow = PopoverPrimitive2.Arrow;
|
|
4041
4101
|
var Popover2 = (props) => {
|
|
4042
4102
|
const {
|
|
@@ -4053,7 +4113,7 @@ var Popover2 = (props) => {
|
|
|
4053
4113
|
offset = 10,
|
|
4054
4114
|
children
|
|
4055
4115
|
} = props;
|
|
4056
|
-
const [open, setOpen] =
|
|
4116
|
+
const [open, setOpen] = React40.useState(false);
|
|
4057
4117
|
const handleCancel = () => {
|
|
4058
4118
|
onCancel?.();
|
|
4059
4119
|
setOpen(false);
|
|
@@ -4095,9 +4155,9 @@ var Popover2 = (props) => {
|
|
|
4095
4155
|
}
|
|
4096
4156
|
};
|
|
4097
4157
|
const { side, align } = mapPlacementToSideAndAlign2(placement);
|
|
4098
|
-
return /* @__PURE__ */ (0,
|
|
4099
|
-
/* @__PURE__ */ (0,
|
|
4100
|
-
/* @__PURE__ */ (0,
|
|
4158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverTrigger, { asChild: true, children }),
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4101
4161
|
PopoverContent,
|
|
4102
4162
|
{
|
|
4103
4163
|
side,
|
|
@@ -4105,16 +4165,16 @@ var Popover2 = (props) => {
|
|
|
4105
4165
|
sideOffset: offset,
|
|
4106
4166
|
className: cn(popoverClasses, className),
|
|
4107
4167
|
children: [
|
|
4108
|
-
showArrow && /* @__PURE__ */ (0,
|
|
4109
|
-
/* @__PURE__ */ (0,
|
|
4110
|
-
/* @__PURE__ */ (0,
|
|
4111
|
-
/* @__PURE__ */ (0,
|
|
4112
|
-
/* @__PURE__ */ (0,
|
|
4113
|
-
/* @__PURE__ */ (0,
|
|
4168
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverArrow, { className: popoverArrowClasses }),
|
|
4169
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid gap-4", children: [
|
|
4170
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "space-y-2", children: [
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "caption text-secondary", children: strapline }),
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h4", { className: "subtitle-medium text-primary", children: title }),
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "paragraph-sm text-primary", children: description })
|
|
4114
4174
|
] }),
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4117
|
-
/* @__PURE__ */ (0,
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Button, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Button, { size: "sm", variant: "primary", onClick: handleOk, children: okText || "Ok" })
|
|
4118
4178
|
] })
|
|
4119
4179
|
] })
|
|
4120
4180
|
]
|
|
@@ -4124,91 +4184,6 @@ var Popover2 = (props) => {
|
|
|
4124
4184
|
};
|
|
4125
4185
|
Popover2.displayName = "Popover";
|
|
4126
4186
|
|
|
4127
|
-
// src/components/Feedback/Tooltip.tsx
|
|
4128
|
-
var React40 = require("react");
|
|
4129
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
4130
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4131
|
-
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
4132
|
-
var mapPlacementToSideAndAlign = (placement) => {
|
|
4133
|
-
switch (placement) {
|
|
4134
|
-
case "top":
|
|
4135
|
-
return { side: "top", align: "center" };
|
|
4136
|
-
case "topLeft":
|
|
4137
|
-
return { side: "top", align: "start" };
|
|
4138
|
-
case "topRight":
|
|
4139
|
-
return { side: "top", align: "end" };
|
|
4140
|
-
case "bottom":
|
|
4141
|
-
return { side: "bottom", align: "center" };
|
|
4142
|
-
case "bottomLeft":
|
|
4143
|
-
return { side: "bottom", align: "start" };
|
|
4144
|
-
case "bottomRight":
|
|
4145
|
-
return { side: "bottom", align: "end" };
|
|
4146
|
-
case "left":
|
|
4147
|
-
return { side: "left", align: "center" };
|
|
4148
|
-
case "leftTop":
|
|
4149
|
-
return { side: "left", align: "start" };
|
|
4150
|
-
case "leftBottom":
|
|
4151
|
-
return { side: "left", align: "end" };
|
|
4152
|
-
case "right":
|
|
4153
|
-
return { side: "right", align: "center" };
|
|
4154
|
-
case "rightTop":
|
|
4155
|
-
return { side: "right", align: "start" };
|
|
4156
|
-
case "rightBottom":
|
|
4157
|
-
return { side: "right", align: "end" };
|
|
4158
|
-
default:
|
|
4159
|
-
return { side: "top", align: "center" };
|
|
4160
|
-
}
|
|
4161
|
-
};
|
|
4162
|
-
var Tooltip = (props) => {
|
|
4163
|
-
const {
|
|
4164
|
-
strapline,
|
|
4165
|
-
title,
|
|
4166
|
-
description,
|
|
4167
|
-
showArrow = true,
|
|
4168
|
-
className,
|
|
4169
|
-
placement = "top",
|
|
4170
|
-
offset = 10,
|
|
4171
|
-
disableHoverableContent,
|
|
4172
|
-
open,
|
|
4173
|
-
defaultOpen,
|
|
4174
|
-
onOpenChange,
|
|
4175
|
-
children
|
|
4176
|
-
} = props;
|
|
4177
|
-
const { side, align } = mapPlacementToSideAndAlign(placement);
|
|
4178
|
-
const tooltipClasses = "group bg-(--background-popover) max-w-[calc(100vw-2rem)] shadow-card-md border-none rounded-4 p-4 [&>span]:scale-200 data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
4179
|
-
const tooltipArrowClasses = "relative fill-(--background-popover) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
|
|
4180
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4181
|
-
TooltipPrimitive.Root,
|
|
4182
|
-
{
|
|
4183
|
-
open,
|
|
4184
|
-
defaultOpen,
|
|
4185
|
-
onOpenChange,
|
|
4186
|
-
disableHoverableContent,
|
|
4187
|
-
children: [
|
|
4188
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
4189
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4190
|
-
TooltipPrimitive.Content,
|
|
4191
|
-
{
|
|
4192
|
-
side,
|
|
4193
|
-
align,
|
|
4194
|
-
sideOffset: offset,
|
|
4195
|
-
className: cn(tooltipClasses, className),
|
|
4196
|
-
children: [
|
|
4197
|
-
showArrow && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipArrow, { className: tooltipArrowClasses }),
|
|
4198
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid gap-2", children: [
|
|
4199
|
-
(strapline ?? "") !== "" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "caption text-secondary", children: strapline }),
|
|
4200
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h4", { className: "subtitle-medium text-primary", children: title }),
|
|
4201
|
-
(description ?? "") !== "" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "paragraph-sm text-primary", children: description })
|
|
4202
|
-
] })
|
|
4203
|
-
]
|
|
4204
|
-
}
|
|
4205
|
-
) })
|
|
4206
|
-
]
|
|
4207
|
-
}
|
|
4208
|
-
);
|
|
4209
|
-
};
|
|
4210
|
-
Tooltip.displayName = "Tooltip";
|
|
4211
|
-
|
|
4212
4187
|
// src/components/Feedback/TooltipProvider.tsx
|
|
4213
4188
|
var React41 = require("react");
|
|
4214
4189
|
var TooltipPrimitive2 = __toESM(require("@radix-ui/react-tooltip"), 1);
|