@bubo-squared/ui-framework 0.2.15 → 0.2.17

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.js CHANGED
@@ -26,6 +26,9 @@ var buttonVariants = cva(
26
26
  "btn-secondary",
27
27
  "focus-ring-secondary"
28
28
  ],
29
+ ghost: [
30
+ "btn-ghost"
31
+ ],
29
32
  outline: [
30
33
  "btn-outline",
31
34
  "focus-ring-outline"
@@ -36,10 +39,10 @@ var buttonVariants = cva(
36
39
  ]
37
40
  },
38
41
  size: {
39
- sm: ["px-1.5", "py-1", "gap-1"],
40
- md: ["px-2", "py-1", "gap-1.5"],
41
- lg: ["px-2.5", "py-1", "gap-1.5"],
42
- xl: ["px-3", "py-0.5", "gap-2"]
42
+ sm: ["px-2", "py-1", "gap-2", "h-9"],
43
+ md: ["px-2", "py-1", "gap-2", "h-10"],
44
+ lg: ["px-2.5", "py-1", "gap-2.5", "h-11"],
45
+ xl: ["px-3", "py-0.5", "gap-3", "h-12"]
43
46
  }
44
47
  },
45
48
  defaultVariants: {
@@ -52,19 +55,19 @@ var buttonIconVariants = cva("relative", {
52
55
  variants: {
53
56
  size: {
54
57
  sm: ["size-5", "*:size-5"],
55
- md: ["size-6", "*:size-6"],
58
+ md: ["size-5", "*:size-5"],
56
59
  lg: ["size-6", "*:size-6"],
57
- xl: ["size-8", "*:size-8"]
60
+ xl: ["size-7", "*:size-7"]
58
61
  }
59
62
  }
60
63
  });
61
64
  var buttonTextVariants = cva("flex text-center justify-center font-normal", {
62
65
  variants: {
63
66
  size: {
64
- sm: ["text-xl", "leading-7"],
65
- md: ["text-2xl", "leading-8"],
66
- lg: ["text-3xl", "leading-9"],
67
- xl: ["text-4xl", "leading-11"]
67
+ sm: ["paragraph-sm"],
68
+ md: ["paragraph-md"],
69
+ lg: ["paragraph-lg"],
70
+ xl: ["subtitle"]
68
71
  }
69
72
  }
70
73
  });
@@ -138,7 +141,7 @@ import { Slot as Slot2 } from "@radix-ui/react-slot";
138
141
  import { cva as cva3 } from "class-variance-authority";
139
142
  import { jsx as jsx4 } from "react/jsx-runtime";
140
143
  var iconButtonVariants = cva3(
141
- "inline-flex items-center justify-center whitespace-nowrap rounded-4 transition-colors disabled:pointer-events-none overflow-hidden p-1.5 cursor-pointer",
144
+ "inline-flex items-center justify-center whitespace-nowrap transition-colors disabled:pointer-events-none overflow-hidden p-2 cursor-pointer",
142
145
  {
143
146
  variants: {
144
147
  variant: {
@@ -150,6 +153,9 @@ var iconButtonVariants = cva3(
150
153
  "btn-secondary",
151
154
  "focus-ring-secondary"
152
155
  ],
156
+ ghost: [
157
+ "btn-ghost"
158
+ ],
153
159
  outline: [
154
160
  "btn-outline",
155
161
  "focus-ring-outline"
@@ -180,13 +186,14 @@ var IconButton = React2.forwardRef(
180
186
  size,
181
187
  asChild = false,
182
188
  icon,
189
+ round = false,
183
190
  ...rest
184
191
  } = props;
185
192
  const Comp = asChild ? Slot2 : "button";
186
193
  return /* @__PURE__ */ jsx4(
187
194
  Comp,
188
195
  {
189
- className: cn(iconButtonVariants({ variant, size }), className),
196
+ className: cn(iconButtonVariants({ variant, size }), round ? "rounded-full" : "rounded-4", className),
190
197
  ref,
191
198
  ...rest,
192
199
  children: /* @__PURE__ */ jsx4("div", { className: "buttonIcon flex items-center justify-center", children: icon })
@@ -1637,6 +1644,8 @@ var Autocomplete = (props) => {
1637
1644
  inputValue,
1638
1645
  defaultInputValue,
1639
1646
  onInputChange,
1647
+ dropdownClassName,
1648
+ listboxClassName,
1640
1649
  placeholder = "Search\u2026",
1641
1650
  onKeyDown,
1642
1651
  onFocus,
@@ -1797,7 +1806,8 @@ var Autocomplete = (props) => {
1797
1806
  className: cn(
1798
1807
  "absolute left-0 right-0 mt-1",
1799
1808
  dropdownSurfaceClass,
1800
- dropdownScrollClass
1809
+ dropdownScrollClass,
1810
+ dropdownClassName
1801
1811
  ),
1802
1812
  children: loading ? /* @__PURE__ */ jsx25(
1803
1813
  "div",
@@ -1813,23 +1823,31 @@ var Autocomplete = (props) => {
1813
1823
  "aria-live": "polite",
1814
1824
  children: noOptionsText
1815
1825
  }
1816
- ) : /* @__PURE__ */ jsx25("ul", { id: listboxId, role: "listbox", className: "flex flex-col", children: options.map((option, index) => /* @__PURE__ */ jsx25(
1817
- "li",
1826
+ ) : /* @__PURE__ */ jsx25(
1827
+ "ul",
1818
1828
  {
1819
- id: `${inputId}-option-${index}`,
1820
- role: "option",
1821
- "aria-selected": index === activeIndex,
1822
- className: cn(
1823
- optionVariants({ size, active: index === activeIndex }),
1824
- "px-(--space-8) pr-(--space-16) text-primary cursor-pointer"
1825
- ),
1826
- onMouseDown: handleOptionMouseDown,
1827
- onMouseEnter: () => setActiveIndex(index),
1828
- onClick: () => handleOptionClick(option),
1829
- children: option
1830
- },
1831
- `${option}-${index}`
1832
- )) })
1829
+ id: listboxId,
1830
+ role: "listbox",
1831
+ className: cn("flex flex-col", listboxClassName),
1832
+ children: options.map((option, index) => /* @__PURE__ */ jsx25(
1833
+ "li",
1834
+ {
1835
+ id: `${inputId}-option-${index}`,
1836
+ role: "option",
1837
+ "aria-selected": index === activeIndex,
1838
+ className: cn(
1839
+ optionVariants({ size, active: index === activeIndex }),
1840
+ "px-(--space-8) pr-(--space-16) text-primary cursor-pointer"
1841
+ ),
1842
+ onMouseDown: handleOptionMouseDown,
1843
+ onMouseEnter: () => setActiveIndex(index),
1844
+ onClick: () => handleOptionClick(option),
1845
+ children: option
1846
+ },
1847
+ `${option}-${index}`
1848
+ ))
1849
+ }
1850
+ )
1833
1851
  }
1834
1852
  )
1835
1853
  ] }) });
@@ -3069,8 +3087,95 @@ var SearchInput = (props) => {
3069
3087
  SearchInput.displayName = "SearchInput";
3070
3088
 
3071
3089
  // src/components/Inputs/Slider.tsx
3072
- import * as React34 from "react";
3073
- import { Fragment as Fragment2, jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
3090
+ import * as React35 from "react";
3091
+
3092
+ // src/components/Feedback/Tooltip.tsx
3093
+ import "react";
3094
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3095
+ import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
3096
+ var TooltipArrow = TooltipPrimitive.Arrow;
3097
+ var mapPlacementToSideAndAlign = (placement) => {
3098
+ switch (placement) {
3099
+ case "top":
3100
+ return { side: "top", align: "center" };
3101
+ case "topLeft":
3102
+ return { side: "top", align: "start" };
3103
+ case "topRight":
3104
+ return { side: "top", align: "end" };
3105
+ case "bottom":
3106
+ return { side: "bottom", align: "center" };
3107
+ case "bottomLeft":
3108
+ return { side: "bottom", align: "start" };
3109
+ case "bottomRight":
3110
+ return { side: "bottom", align: "end" };
3111
+ case "left":
3112
+ return { side: "left", align: "center" };
3113
+ case "leftTop":
3114
+ return { side: "left", align: "start" };
3115
+ case "leftBottom":
3116
+ return { side: "left", align: "end" };
3117
+ case "right":
3118
+ return { side: "right", align: "center" };
3119
+ case "rightTop":
3120
+ return { side: "right", align: "start" };
3121
+ case "rightBottom":
3122
+ return { side: "right", align: "end" };
3123
+ default:
3124
+ return { side: "top", align: "center" };
3125
+ }
3126
+ };
3127
+ var Tooltip = (props) => {
3128
+ const {
3129
+ strapline,
3130
+ title,
3131
+ description,
3132
+ showArrow = true,
3133
+ className,
3134
+ placement = "top",
3135
+ offset = 10,
3136
+ disableHoverableContent,
3137
+ open,
3138
+ defaultOpen,
3139
+ onOpenChange,
3140
+ children
3141
+ } = props;
3142
+ const { side, align } = mapPlacementToSideAndAlign(placement);
3143
+ 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";
3144
+ 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)]";
3145
+ return /* @__PURE__ */ jsxs24(
3146
+ TooltipPrimitive.Root,
3147
+ {
3148
+ open,
3149
+ defaultOpen,
3150
+ onOpenChange,
3151
+ disableHoverableContent,
3152
+ children: [
3153
+ /* @__PURE__ */ jsx36(TooltipPrimitive.Trigger, { asChild: true, children }),
3154
+ /* @__PURE__ */ jsx36(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs24(
3155
+ TooltipPrimitive.Content,
3156
+ {
3157
+ side,
3158
+ align,
3159
+ sideOffset: offset,
3160
+ className: cn(tooltipClasses, className),
3161
+ children: [
3162
+ showArrow && /* @__PURE__ */ jsx36(TooltipArrow, { className: tooltipArrowClasses }),
3163
+ /* @__PURE__ */ jsxs24("div", { className: "grid gap-2", children: [
3164
+ (strapline ?? "") !== "" && /* @__PURE__ */ jsx36("span", { className: "caption text-secondary", children: strapline }),
3165
+ /* @__PURE__ */ jsx36("h4", { className: "subtitle-medium text-primary", children: title }),
3166
+ (description ?? "") !== "" && /* @__PURE__ */ jsx36("p", { className: "paragraph-sm text-primary", children: description })
3167
+ ] })
3168
+ ]
3169
+ }
3170
+ ) })
3171
+ ]
3172
+ }
3173
+ );
3174
+ };
3175
+ Tooltip.displayName = "Tooltip";
3176
+
3177
+ // src/components/Inputs/Slider.tsx
3178
+ import { Fragment as Fragment2, jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
3074
3179
  var wrapperBase = "flex flex-col gap-2 items-start";
3075
3180
  var isRangeProps = (props) => {
3076
3181
  return Array.isArray(props.value) || Array.isArray(props.defaultValue);
@@ -3097,7 +3202,7 @@ var Slider = (props) => {
3097
3202
  const isRange = isRangeProps(props);
3098
3203
  const isControlled = value !== void 0;
3099
3204
  const expectedLength = isRange ? 2 : 1;
3100
- const normalizeArray = React34.useCallback(
3205
+ const normalizeArray = React35.useCallback(
3101
3206
  (arr, fallback) => {
3102
3207
  if (!arr || arr.length === 0) return fallback;
3103
3208
  if (arr.length === expectedLength) return arr;
@@ -3109,16 +3214,16 @@ var Slider = (props) => {
3109
3214
  },
3110
3215
  [expectedLength, max]
3111
3216
  );
3112
- const defaultInternal = React34.useMemo(() => {
3217
+ const defaultInternal = React35.useMemo(() => {
3113
3218
  const defaultValueArray = toArray(defaultValue);
3114
3219
  if (defaultValueArray) return normalizeArray(defaultValueArray, []);
3115
3220
  if (isRange) return [min, Math.min(min + (max - min) / 4, max)];
3116
3221
  return [min + (max - min) / 3];
3117
3222
  }, [defaultValue, min, max, isRange, normalizeArray]);
3118
- const [internalValue, setInternalValue] = React34.useState(
3223
+ const [internalValue, setInternalValue] = React35.useState(
3119
3224
  () => normalizeArray(isControlled ? toArray(value) : defaultInternal, defaultInternal)
3120
3225
  );
3121
- React34.useEffect(() => {
3226
+ React35.useEffect(() => {
3122
3227
  if (isControlled) {
3123
3228
  setInternalValue(
3124
3229
  (current2) => normalizeArray(toArray(value), current2.length ? current2 : defaultInternal)
@@ -3126,15 +3231,16 @@ var Slider = (props) => {
3126
3231
  }
3127
3232
  }, [isControlled, value, normalizeArray, defaultInternal]);
3128
3233
  const current = internalValue;
3129
- const trackRef = React34.useRef(null);
3130
- const [draggingThumbIndex, setDraggingThumbIndex] = React34.useState(null);
3131
- const [hoveredThumbIndex, setHoveredThumbIndex] = React34.useState(null);
3132
- const clamp = React34.useCallback((val) => {
3234
+ const trackRef = React35.useRef(null);
3235
+ const [draggingThumbIndex, setDraggingThumbIndex] = React35.useState(null);
3236
+ const [hoveredThumbIndex, setHoveredThumbIndex] = React35.useState(null);
3237
+ const [focusedThumbIndex, setFocusedThumbIndex] = React35.useState(null);
3238
+ const clamp = React35.useCallback((val) => {
3133
3239
  if (val < min) return min;
3134
3240
  if (val > max) return max;
3135
3241
  return val;
3136
3242
  }, [min, max]);
3137
- const enforceMinGap = React34.useCallback((next, prev) => {
3243
+ const enforceMinGap = React35.useCallback((next, prev) => {
3138
3244
  if (!isRange || next.length !== 2 || step <= 0) return next;
3139
3245
  let [low, high] = next;
3140
3246
  const [prevLow, prevHigh] = prev.length === 2 ? prev : next;
@@ -3158,7 +3264,7 @@ var Slider = (props) => {
3158
3264
  }
3159
3265
  return [low, high];
3160
3266
  }, [isRange, step, clamp]);
3161
- React34.useEffect(() => {
3267
+ React35.useEffect(() => {
3162
3268
  if (!isControlled) {
3163
3269
  setInternalValue((prev) => {
3164
3270
  const clamped = prev.map((v) => clamp(v));
@@ -3292,7 +3398,6 @@ var Slider = (props) => {
3292
3398
  const secondaryPercent = valueToPercent(secondary);
3293
3399
  const showNumeric = display === "numeric";
3294
3400
  const showTooltip = display === "tooltip";
3295
- const isTooltipAbove = tooltipPlacement === "top";
3296
3401
  const isDecimalDomain = !Number.isInteger(step) || !Number.isInteger(min) || !Number.isInteger(max);
3297
3402
  const formatNumber = (num) => {
3298
3403
  if (!isDecimalDomain) {
@@ -3327,55 +3432,11 @@ var Slider = (props) => {
3327
3432
  const trackHeight = 32;
3328
3433
  const thumbWidth = 18;
3329
3434
  const thumbRadius = thumbWidth / 2;
3330
- const renderTooltipBubble = (key, percent, labelText, isVisible) => /* @__PURE__ */ jsx36(
3331
- "div",
3332
- {
3333
- className: cn(
3334
- "absolute -translate-x-1/2 flex flex-col items-center",
3335
- "transition-[opacity,transform] duration-150",
3336
- isVisible ? "opacity-100 scale-100 pointer-events-auto" : "opacity-0 scale-95 pointer-events-none"
3337
- ),
3338
- style: {
3339
- left: `${percent}%`,
3340
- bottom: isTooltipAbove ? "100%" : void 0,
3341
- top: isTooltipAbove ? void 0 : "100%",
3342
- marginBottom: isTooltipAbove ? 8 : void 0,
3343
- marginTop: isTooltipAbove ? void 0 : 8
3344
- },
3345
- children: /* @__PURE__ */ jsxs24(
3346
- "div",
3347
- {
3348
- className: cn("relative rounded-4 shadow-card-md px-(--space-8) py-(--space-4) bg-(--background-tooltip)"),
3349
- children: [
3350
- /* @__PURE__ */ jsx36(
3351
- "p",
3352
- {
3353
- className: cn(
3354
- "paragraph-sm",
3355
- disabled ? "text-secondary" : "text-primary"
3356
- ),
3357
- children: labelText
3358
- }
3359
- ),
3360
- /* @__PURE__ */ jsx36(
3361
- "div",
3362
- {
3363
- className: cn(
3364
- "absolute left-1/2 -translate-x-1/2 w-2 h-2 rotate-45 bg-(--background-tooltip)",
3365
- isTooltipAbove ? "-bottom-1" : "-top-1"
3366
- )
3367
- }
3368
- )
3369
- ]
3370
- }
3371
- )
3372
- },
3373
- key
3374
- );
3375
3435
  const renderHandle = (index, percent, ariaValueText) => {
3376
3436
  const val = index === 0 ? primary : secondary;
3377
3437
  const isDragging = draggingThumbIndex === index;
3378
- return /* @__PURE__ */ jsx36(
3438
+ const isTooltipVisible = showTooltip && (hoveredThumbIndex === index || draggingThumbIndex === index || focusedThumbIndex === index);
3439
+ const handle = /* @__PURE__ */ jsx37(
3379
3440
  "button",
3380
3441
  {
3381
3442
  type: "button",
@@ -3396,7 +3457,7 @@ var Slider = (props) => {
3396
3457
  style: {
3397
3458
  left: `${percent}%`,
3398
3459
  top: `calc(50% - ${trackHeight / 2}px)`,
3399
- "--slider-halo-color": "color-mix(in srgb, var(--color-brand) 10%, transparent)"
3460
+ "--slider-halo-color": "color-mix(in srgb, var(--color-brand) 15%, transparent)"
3400
3461
  },
3401
3462
  onPointerEnter: () => {
3402
3463
  setHoveredThumbIndex(index);
@@ -3404,6 +3465,12 @@ var Slider = (props) => {
3404
3465
  onPointerLeave: () => {
3405
3466
  setHoveredThumbIndex((prev) => prev === index ? null : prev);
3406
3467
  },
3468
+ onFocus: () => {
3469
+ setFocusedThumbIndex(index);
3470
+ },
3471
+ onBlur: () => {
3472
+ setFocusedThumbIndex((prev) => prev === index ? null : prev);
3473
+ },
3407
3474
  onPointerDown: (event) => {
3408
3475
  if (disabled) return;
3409
3476
  if (event.button !== 0) return;
@@ -3414,15 +3481,28 @@ var Slider = (props) => {
3414
3481
  },
3415
3482
  index
3416
3483
  );
3484
+ if (!showTooltip) return handle;
3485
+ return /* @__PURE__ */ jsx37(
3486
+ Tooltip,
3487
+ {
3488
+ title: ariaValueText,
3489
+ placement: tooltipPlacement === "top" ? "top" : "bottom",
3490
+ offset: 8,
3491
+ open: isTooltipVisible,
3492
+ disableHoverableContent: true,
3493
+ className: "z-50 pointer-events-none py-2",
3494
+ children: handle
3495
+ }
3496
+ );
3417
3497
  };
3418
- return /* @__PURE__ */ jsxs24(
3498
+ return /* @__PURE__ */ jsxs25(
3419
3499
  "div",
3420
3500
  {
3421
3501
  className: wrapperBase,
3422
3502
  style: { marginInline: `${thumbRadius}px` },
3423
3503
  children: [
3424
- name && /* @__PURE__ */ jsxs24(Fragment2, { children: [
3425
- /* @__PURE__ */ jsx36(
3504
+ name && /* @__PURE__ */ jsxs25(Fragment2, { children: [
3505
+ /* @__PURE__ */ jsx37(
3426
3506
  "input",
3427
3507
  {
3428
3508
  type: "hidden",
@@ -3431,7 +3511,7 @@ var Slider = (props) => {
3431
3511
  disabled
3432
3512
  }
3433
3513
  ),
3434
- isRange && secondary !== void 0 && /* @__PURE__ */ jsx36(
3514
+ isRange && secondary !== void 0 && /* @__PURE__ */ jsx37(
3435
3515
  "input",
3436
3516
  {
3437
3517
  type: "hidden",
@@ -3441,51 +3521,37 @@ var Slider = (props) => {
3441
3521
  }
3442
3522
  )
3443
3523
  ] }),
3444
- /* @__PURE__ */ jsxs24("div", { className: cn("w-full flex flex-col gap-1", className), children: [
3445
- /* @__PURE__ */ jsxs24("div", { className: "relative w-full", children: [
3446
- showTooltip && primary !== void 0 && renderTooltipBubble(
3447
- "primary",
3448
- primaryPercent,
3449
- formatDisplayValue(primary),
3450
- hoveredThumbIndex === 0 || draggingThumbIndex === 0
3451
- ),
3452
- showTooltip && isRange && secondary !== void 0 && renderTooltipBubble(
3453
- "secondary",
3454
- secondaryPercent,
3455
- formatDisplayValue(secondary),
3456
- hoveredThumbIndex === 1 || draggingThumbIndex === 1
3457
- ),
3458
- /* @__PURE__ */ jsxs24(
3459
- "div",
3460
- {
3461
- className: cn(
3462
- "relative w-full flex items-center rounded-4",
3463
- disabled ? "bg-(--background-primary-disabled) cursor-default" : "bg-(--background-secondary) cursor-pointer"
3464
- ),
3465
- style: { height: `${trackHeight}px` },
3466
- ref: trackRef,
3467
- onPointerDown: handleTrackPointerDown,
3468
- children: [
3469
- /* @__PURE__ */ jsx36(
3470
- "div",
3471
- {
3472
- className: cn(
3473
- "absolute h-full rounded-4",
3474
- disabled ? "bg-(--background-primary-disabled)" : "bg-(--background-secondary)"
3475
- ),
3476
- style: {
3477
- width: `calc(100% + ${thumbWidth}px)`,
3478
- left: `-${thumbRadius}px`
3479
- }
3524
+ /* @__PURE__ */ jsxs25("div", { className: cn("w-full flex flex-col gap-1", className), children: [
3525
+ /* @__PURE__ */ jsx37("div", { className: "relative w-full", children: /* @__PURE__ */ jsxs25(
3526
+ "div",
3527
+ {
3528
+ className: cn(
3529
+ "relative w-full flex items-center rounded-4",
3530
+ disabled ? "bg-(--background-slider-track-disabled) cursor-default" : "bg-(--background-slider-track) cursor-pointer"
3531
+ ),
3532
+ style: { height: `${trackHeight}px` },
3533
+ ref: trackRef,
3534
+ onPointerDown: handleTrackPointerDown,
3535
+ children: [
3536
+ /* @__PURE__ */ jsx37(
3537
+ "div",
3538
+ {
3539
+ className: cn(
3540
+ "absolute h-full rounded-4",
3541
+ disabled ? "bg-(--background-slider-track-disabled)" : "bg-(--background-slider-track)"
3542
+ ),
3543
+ style: {
3544
+ width: `calc(100% + ${thumbWidth}px)`,
3545
+ left: `-${thumbRadius}px`
3480
3546
  }
3481
- ),
3482
- renderHandle(0, primaryPercent, formatDisplayValue(primary)),
3483
- isRange && secondary !== void 0 && renderHandle(1, secondaryPercent, formatDisplayValue(secondary))
3484
- ]
3485
- }
3486
- )
3487
- ] }),
3488
- showNumeric && /* @__PURE__ */ jsx36(
3547
+ }
3548
+ ),
3549
+ renderHandle(0, primaryPercent, formatDisplayValue(primary)),
3550
+ isRange && secondary !== void 0 && renderHandle(1, secondaryPercent, formatDisplayValue(secondary))
3551
+ ]
3552
+ }
3553
+ ) }),
3554
+ showNumeric && /* @__PURE__ */ jsx37(
3489
3555
  "p",
3490
3556
  {
3491
3557
  className: cn(
@@ -3503,9 +3569,9 @@ var Slider = (props) => {
3503
3569
  Slider.displayName = "Slider";
3504
3570
 
3505
3571
  // src/components/Inputs/TextArea.tsx
3506
- import * as React35 from "react";
3572
+ import * as React36 from "react";
3507
3573
  import { MaximizeIcon } from "@bubo-squared/icons";
3508
- import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
3574
+ import { jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
3509
3575
  var TextArea = (props) => {
3510
3576
  const {
3511
3577
  label,
@@ -3525,7 +3591,7 @@ var TextArea = (props) => {
3525
3591
  ...textareaProps
3526
3592
  } = props;
3527
3593
  const isControlled = value !== void 0;
3528
- const [internalValue, setInternalValue] = React35.useState(
3594
+ const [internalValue, setInternalValue] = React36.useState(
3529
3595
  defaultValue ?? ""
3530
3596
  );
3531
3597
  const currentValue = (isControlled ? value : internalValue) ?? "";
@@ -3533,10 +3599,10 @@ var TextArea = (props) => {
3533
3599
  const currentLength = currentValue.length;
3534
3600
  const effectiveMaxLength = type === "character-limit" ? maxLength ?? 144 : void 0;
3535
3601
  const showCharacterLimit = type === "character-limit" && typeof effectiveMaxLength === "number";
3536
- const textareaRef = React35.useRef(null);
3537
- const containerRef = React35.useRef(null);
3538
- const [height, setHeight] = React35.useState(void 0);
3539
- const [width, setWidth] = React35.useState(void 0);
3602
+ const textareaRef = React36.useRef(null);
3603
+ const containerRef = React36.useRef(null);
3604
+ const [height, setHeight] = React36.useState(void 0);
3605
+ const [width, setWidth] = React36.useState(void 0);
3540
3606
  const minHeight = 80;
3541
3607
  const minWidth = 240;
3542
3608
  const handleContainerClick = () => {
@@ -3549,7 +3615,7 @@ var TextArea = (props) => {
3549
3615
  }
3550
3616
  onChange?.(event);
3551
3617
  };
3552
- const generatedId = React35.useId();
3618
+ const generatedId = React36.useId();
3553
3619
  const textareaId = id ?? generatedId;
3554
3620
  const statusBorderClass = {
3555
3621
  default: "",
@@ -3586,7 +3652,7 @@ var TextArea = (props) => {
3586
3652
  window.addEventListener("pointermove", handlePointerMove);
3587
3653
  window.addEventListener("pointerup", handlePointerUp);
3588
3654
  };
3589
- return /* @__PURE__ */ jsx37(
3655
+ return /* @__PURE__ */ jsx38(
3590
3656
  Field,
3591
3657
  {
3592
3658
  className: "w-full",
@@ -3595,7 +3661,7 @@ var TextArea = (props) => {
3595
3661
  hideHint,
3596
3662
  status,
3597
3663
  disabled,
3598
- children: /* @__PURE__ */ jsxs25(
3664
+ children: /* @__PURE__ */ jsxs26(
3599
3665
  "div",
3600
3666
  {
3601
3667
  className: cn(
@@ -3614,7 +3680,7 @@ var TextArea = (props) => {
3614
3680
  onClick: handleContainerClick,
3615
3681
  "aria-disabled": disabled || void 0,
3616
3682
  children: [
3617
- /* @__PURE__ */ jsx37(
3683
+ /* @__PURE__ */ jsx38(
3618
3684
  "textarea",
3619
3685
  {
3620
3686
  id: textareaId,
@@ -3634,7 +3700,7 @@ var TextArea = (props) => {
3634
3700
  ...textareaProps
3635
3701
  }
3636
3702
  ),
3637
- showCharacterLimit && /* @__PURE__ */ jsxs25(
3703
+ showCharacterLimit && /* @__PURE__ */ jsxs26(
3638
3704
  "span",
3639
3705
  {
3640
3706
  className: cn(
@@ -3648,19 +3714,19 @@ var TextArea = (props) => {
3648
3714
  ]
3649
3715
  }
3650
3716
  ),
3651
- type === "responsive" && /* @__PURE__ */ jsx37(
3717
+ type === "responsive" && /* @__PURE__ */ jsx38(
3652
3718
  "div",
3653
3719
  {
3654
3720
  className: "absolute bottom-1 right-1 h-3 w-3 " + (disabled ? "cursor-auto" : "cursor-nwse-resize"),
3655
3721
  onPointerDown: disabled ? void 0 : handleResizePointerDown,
3656
- children: /* @__PURE__ */ jsx37(
3722
+ children: /* @__PURE__ */ jsx38(
3657
3723
  "span",
3658
3724
  {
3659
3725
  className: cn(
3660
3726
  "absolute bottom-0 right-0 flex h-4 w-4 items-center justify-center text-(--icon-primary)",
3661
3727
  disabled && "text-(--icon-primary-disabled)"
3662
3728
  ),
3663
- children: /* @__PURE__ */ jsx37(MaximizeIcon, {})
3729
+ children: /* @__PURE__ */ jsx38(MaximizeIcon, {})
3664
3730
  }
3665
3731
  )
3666
3732
  }
@@ -3674,9 +3740,9 @@ var TextArea = (props) => {
3674
3740
  TextArea.displayName = "TextArea";
3675
3741
 
3676
3742
  // src/components/Inputs/TextInput.tsx
3677
- import * as React36 from "react";
3743
+ import * as React37 from "react";
3678
3744
  import { cva as cva20 } from "class-variance-authority";
3679
- import { jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
3745
+ import { jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
3680
3746
  var inputTextVariants3 = cva20("truncate", {
3681
3747
  variants: {
3682
3748
  size: {
@@ -3727,11 +3793,11 @@ var TextInput = (props) => {
3727
3793
  ...inputProps
3728
3794
  } = props;
3729
3795
  const isControlled = value !== void 0;
3730
- const [internalValue, setInternalValue] = React36.useState(
3796
+ const [internalValue, setInternalValue] = React37.useState(
3731
3797
  defaultValue ?? ""
3732
3798
  );
3733
3799
  const currentValue = (isControlled ? value : internalValue) ?? "";
3734
- const inputRef = React36.useRef(null);
3800
+ const inputRef = React37.useRef(null);
3735
3801
  const handleContainerClick = () => {
3736
3802
  if (disabled) return;
3737
3803
  inputRef.current?.focus();
@@ -3744,7 +3810,7 @@ var TextInput = (props) => {
3744
3810
  };
3745
3811
  const showLeadingIcon = !!leadingIcon;
3746
3812
  const showTrailingIcon = !!trailingIcon;
3747
- return /* @__PURE__ */ jsx38(
3813
+ return /* @__PURE__ */ jsx39(
3748
3814
  Field,
3749
3815
  {
3750
3816
  label,
@@ -3752,7 +3818,7 @@ var TextInput = (props) => {
3752
3818
  hideHint,
3753
3819
  status,
3754
3820
  disabled,
3755
- children: /* @__PURE__ */ jsxs26(
3821
+ children: /* @__PURE__ */ jsxs27(
3756
3822
  InputShell,
3757
3823
  {
3758
3824
  size,
@@ -3761,7 +3827,7 @@ var TextInput = (props) => {
3761
3827
  className,
3762
3828
  onClick: handleContainerClick,
3763
3829
  children: [
3764
- showLeadingIcon && /* @__PURE__ */ jsx38(
3830
+ showLeadingIcon && /* @__PURE__ */ jsx39(
3765
3831
  "span",
3766
3832
  {
3767
3833
  className: cn(
@@ -3770,7 +3836,7 @@ var TextInput = (props) => {
3770
3836
  children: leadingIcon
3771
3837
  }
3772
3838
  ),
3773
- /* @__PURE__ */ jsx38(
3839
+ /* @__PURE__ */ jsx39(
3774
3840
  Input,
3775
3841
  {
3776
3842
  ref: inputRef,
@@ -3788,7 +3854,7 @@ var TextInput = (props) => {
3788
3854
  ...inputProps
3789
3855
  }
3790
3856
  ),
3791
- showTrailingIcon && /* @__PURE__ */ jsx38(
3857
+ showTrailingIcon && /* @__PURE__ */ jsx39(
3792
3858
  "span",
3793
3859
  {
3794
3860
  className: cn(
@@ -3807,10 +3873,10 @@ TextInput.displayName = "TextInput";
3807
3873
 
3808
3874
  // src/components/Inputs/Toggle.tsx
3809
3875
  import "react";
3810
- import { jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
3876
+ import { jsx as jsx40, jsxs as jsxs28 } from "react/jsx-runtime";
3811
3877
  var Toggle = (props) => {
3812
3878
  const { label, className, disabled, ...inputProps } = props;
3813
- return /* @__PURE__ */ jsxs27(
3879
+ return /* @__PURE__ */ jsxs28(
3814
3880
  "label",
3815
3881
  {
3816
3882
  className: cn(
@@ -3818,8 +3884,8 @@ var Toggle = (props) => {
3818
3884
  disabled ? "cursor-default" : "cursor-pointer"
3819
3885
  ),
3820
3886
  children: [
3821
- /* @__PURE__ */ jsxs27("span", { className: "relative inline-flex items-center", children: [
3822
- /* @__PURE__ */ jsx39(
3887
+ /* @__PURE__ */ jsxs28("span", { className: "relative inline-flex items-center", children: [
3888
+ /* @__PURE__ */ jsx40(
3823
3889
  "input",
3824
3890
  {
3825
3891
  type: "checkbox",
@@ -3828,7 +3894,7 @@ var Toggle = (props) => {
3828
3894
  ...inputProps
3829
3895
  }
3830
3896
  ),
3831
- /* @__PURE__ */ jsx39(
3897
+ /* @__PURE__ */ jsx40(
3832
3898
  "span",
3833
3899
  {
3834
3900
  className: cn(
@@ -3868,7 +3934,7 @@ var Toggle = (props) => {
3868
3934
  "peer-disabled:[&>.knob]:peer-checked:bg-(--background-primary-hover)",
3869
3935
  className
3870
3936
  ),
3871
- children: /* @__PURE__ */ jsx39(
3937
+ children: /* @__PURE__ */ jsx40(
3872
3938
  "span",
3873
3939
  {
3874
3940
  className: cn(
@@ -3880,7 +3946,7 @@ var Toggle = (props) => {
3880
3946
  }
3881
3947
  )
3882
3948
  ] }),
3883
- label && /* @__PURE__ */ jsx39(
3949
+ label && /* @__PURE__ */ jsx40(
3884
3950
  "span",
3885
3951
  {
3886
3952
  className: cn(
@@ -3898,7 +3964,7 @@ Toggle.displayName = "Toggle";
3898
3964
 
3899
3965
  // src/components/Inputs/WebsiteInput.tsx
3900
3966
  import "react";
3901
- import { jsx as jsx40, jsxs as jsxs28 } from "react/jsx-runtime";
3967
+ import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
3902
3968
  var WebsiteInput = (props) => {
3903
3969
  const {
3904
3970
  hierarchy = "leading",
@@ -3935,15 +4001,15 @@ var WebsiteInput = (props) => {
3935
4001
  size === "xl" ? "[&>svg]:w-6 [&>svg]:h-6" : size === "sm" ? "[&>svg]:w-4 [&>svg]:h-4" : "[&>svg]:w-5 [&>svg]:h-5",
3936
4002
  disabled ? "text-(--icon-primary-disabled)" : "text-(--icon-primary) group-hover:text-(--icon-primary-hover) group-focus-within:text-(--icon-primary-focus)"
3937
4003
  );
3938
- const leadingAddon = /* @__PURE__ */ jsxs28("div", { className: baseAddonClass, children: [
3939
- /* @__PURE__ */ jsx40("div", { className: addonTextClass, children: protocolLabel }),
3940
- icon != null && /* @__PURE__ */ jsx40("span", { className: iconWrapperClass, children: icon })
4004
+ const leadingAddon = /* @__PURE__ */ jsxs29("div", { className: baseAddonClass, children: [
4005
+ /* @__PURE__ */ jsx41("div", { className: addonTextClass, children: protocolLabel }),
4006
+ icon != null && /* @__PURE__ */ jsx41("span", { className: iconWrapperClass, children: icon })
3941
4007
  ] });
3942
- const trailingAddon = /* @__PURE__ */ jsxs28("div", { className: baseAddonClass, children: [
3943
- icon != null && /* @__PURE__ */ jsx40("span", { className: iconWrapperClass, children: icon }),
3944
- /* @__PURE__ */ jsx40("div", { className: addonTextClass, children: protocolLabel })
4008
+ const trailingAddon = /* @__PURE__ */ jsxs29("div", { className: baseAddonClass, children: [
4009
+ icon != null && /* @__PURE__ */ jsx41("span", { className: iconWrapperClass, children: icon }),
4010
+ /* @__PURE__ */ jsx41("div", { className: addonTextClass, children: protocolLabel })
3945
4011
  ] });
3946
- return /* @__PURE__ */ jsx40(
4012
+ return /* @__PURE__ */ jsx41(
3947
4013
  TextInput,
3948
4014
  {
3949
4015
  ...rest,
@@ -3958,9 +4024,9 @@ var WebsiteInput = (props) => {
3958
4024
  WebsiteInput.displayName = "WebsiteInput";
3959
4025
 
3960
4026
  // src/components/Feedback/Popover.tsx
3961
- import * as React39 from "react";
4027
+ import * as React40 from "react";
3962
4028
  import * as PopoverPrimitive2 from "@radix-ui/react-popover";
3963
- import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
4029
+ import { jsx as jsx42, jsxs as jsxs30 } from "react/jsx-runtime";
3964
4030
  var PopoverArrow = PopoverPrimitive2.Arrow;
3965
4031
  var Popover2 = (props) => {
3966
4032
  const {
@@ -3977,7 +4043,7 @@ var Popover2 = (props) => {
3977
4043
  offset = 10,
3978
4044
  children
3979
4045
  } = props;
3980
- const [open, setOpen] = React39.useState(false);
4046
+ const [open, setOpen] = React40.useState(false);
3981
4047
  const handleCancel = () => {
3982
4048
  onCancel?.();
3983
4049
  setOpen(false);
@@ -4019,9 +4085,9 @@ var Popover2 = (props) => {
4019
4085
  }
4020
4086
  };
4021
4087
  const { side, align } = mapPlacementToSideAndAlign2(placement);
4022
- return /* @__PURE__ */ jsxs29(Popover, { open, onOpenChange: setOpen, children: [
4023
- /* @__PURE__ */ jsx41(PopoverTrigger, { asChild: true, children }),
4024
- /* @__PURE__ */ jsxs29(
4088
+ return /* @__PURE__ */ jsxs30(Popover, { open, onOpenChange: setOpen, children: [
4089
+ /* @__PURE__ */ jsx42(PopoverTrigger, { asChild: true, children }),
4090
+ /* @__PURE__ */ jsxs30(
4025
4091
  PopoverContent,
4026
4092
  {
4027
4093
  side,
@@ -4029,16 +4095,16 @@ var Popover2 = (props) => {
4029
4095
  sideOffset: offset,
4030
4096
  className: cn(popoverClasses, className),
4031
4097
  children: [
4032
- showArrow && /* @__PURE__ */ jsx41(PopoverArrow, { className: popoverArrowClasses }),
4033
- /* @__PURE__ */ jsxs29("div", { className: "grid gap-4", children: [
4034
- /* @__PURE__ */ jsxs29("div", { className: "space-y-2", children: [
4035
- /* @__PURE__ */ jsx41("span", { className: "caption text-secondary", children: strapline }),
4036
- /* @__PURE__ */ jsx41("h4", { className: "subtitle-medium text-primary", children: title }),
4037
- /* @__PURE__ */ jsx41("p", { className: "paragraph-sm text-primary", children: description })
4098
+ showArrow && /* @__PURE__ */ jsx42(PopoverArrow, { className: popoverArrowClasses }),
4099
+ /* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
4100
+ /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
4101
+ /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
4102
+ /* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),
4103
+ /* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
4038
4104
  ] }),
4039
- /* @__PURE__ */ jsxs29("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
4040
- /* @__PURE__ */ jsx41(Button, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),
4041
- /* @__PURE__ */ jsx41(Button, { size: "sm", variant: "primary", onClick: handleOk, children: okText || "Ok" })
4105
+ /* @__PURE__ */ jsxs30("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
4106
+ /* @__PURE__ */ jsx42(Button, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),
4107
+ /* @__PURE__ */ jsx42(Button, { size: "sm", variant: "primary", onClick: handleOk, children: okText || "Ok" })
4042
4108
  ] })
4043
4109
  ] })
4044
4110
  ]
@@ -4048,91 +4114,6 @@ var Popover2 = (props) => {
4048
4114
  };
4049
4115
  Popover2.displayName = "Popover";
4050
4116
 
4051
- // src/components/Feedback/Tooltip.tsx
4052
- import "react";
4053
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
4054
- import { jsx as jsx42, jsxs as jsxs30 } from "react/jsx-runtime";
4055
- var TooltipArrow = TooltipPrimitive.Arrow;
4056
- var mapPlacementToSideAndAlign = (placement) => {
4057
- switch (placement) {
4058
- case "top":
4059
- return { side: "top", align: "center" };
4060
- case "topLeft":
4061
- return { side: "top", align: "start" };
4062
- case "topRight":
4063
- return { side: "top", align: "end" };
4064
- case "bottom":
4065
- return { side: "bottom", align: "center" };
4066
- case "bottomLeft":
4067
- return { side: "bottom", align: "start" };
4068
- case "bottomRight":
4069
- return { side: "bottom", align: "end" };
4070
- case "left":
4071
- return { side: "left", align: "center" };
4072
- case "leftTop":
4073
- return { side: "left", align: "start" };
4074
- case "leftBottom":
4075
- return { side: "left", align: "end" };
4076
- case "right":
4077
- return { side: "right", align: "center" };
4078
- case "rightTop":
4079
- return { side: "right", align: "start" };
4080
- case "rightBottom":
4081
- return { side: "right", align: "end" };
4082
- default:
4083
- return { side: "top", align: "center" };
4084
- }
4085
- };
4086
- var Tooltip = (props) => {
4087
- const {
4088
- strapline,
4089
- title,
4090
- description,
4091
- showArrow = true,
4092
- className,
4093
- placement = "top",
4094
- offset = 10,
4095
- disableHoverableContent,
4096
- open,
4097
- defaultOpen,
4098
- onOpenChange,
4099
- children
4100
- } = props;
4101
- const { side, align } = mapPlacementToSideAndAlign(placement);
4102
- 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";
4103
- 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)]";
4104
- return /* @__PURE__ */ jsxs30(
4105
- TooltipPrimitive.Root,
4106
- {
4107
- open,
4108
- defaultOpen,
4109
- onOpenChange,
4110
- disableHoverableContent,
4111
- children: [
4112
- /* @__PURE__ */ jsx42(TooltipPrimitive.Trigger, { asChild: true, children }),
4113
- /* @__PURE__ */ jsx42(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs30(
4114
- TooltipPrimitive.Content,
4115
- {
4116
- side,
4117
- align,
4118
- sideOffset: offset,
4119
- className: cn(tooltipClasses, className),
4120
- children: [
4121
- showArrow && /* @__PURE__ */ jsx42(TooltipArrow, { className: tooltipArrowClasses }),
4122
- /* @__PURE__ */ jsxs30("div", { className: "grid gap-2", children: [
4123
- (strapline ?? "") !== "" && /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
4124
- /* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),
4125
- (description ?? "") !== "" && /* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
4126
- ] })
4127
- ]
4128
- }
4129
- ) })
4130
- ]
4131
- }
4132
- );
4133
- };
4134
- Tooltip.displayName = "Tooltip";
4135
-
4136
4117
  // src/components/Feedback/TooltipProvider.tsx
4137
4118
  import "react";
4138
4119
  import * as TooltipPrimitive2 from "@radix-ui/react-tooltip";