@cytario/design 9.5.0 → 9.5.2

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
@@ -1755,6 +1755,11 @@ import {
1755
1755
  } from "react-aria-components";
1756
1756
  import { Check as Check3 } from "lucide-react";
1757
1757
  import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
1758
+ function stopToggleForInteractive(e) {
1759
+ if (e.target instanceof Element && e.target.closest("a, button, input, select, textarea")) {
1760
+ e.stopPropagation();
1761
+ }
1762
+ }
1758
1763
  function Checkbox({ children, className, ...props }) {
1759
1764
  return /* @__PURE__ */ jsx22(
1760
1765
  AriaCheckbox,
@@ -1781,7 +1786,16 @@ function Checkbox({ children, className, ...props }) {
1781
1786
  ]
1782
1787
  }
1783
1788
  ),
1784
- children && /* @__PURE__ */ jsx22("span", { children })
1789
+ children && /* @__PURE__ */ jsx22(
1790
+ "span",
1791
+ {
1792
+ onPointerDown: stopToggleForInteractive,
1793
+ onPointerUp: stopToggleForInteractive,
1794
+ onMouseDown: stopToggleForInteractive,
1795
+ onClick: stopToggleForInteractive,
1796
+ children
1797
+ }
1798
+ )
1785
1799
  ] })
1786
1800
  }
1787
1801
  );
@@ -1840,17 +1854,24 @@ import {
1840
1854
  RadioGroup as AriaRadioGroup,
1841
1855
  Radio as AriaRadio
1842
1856
  } from "react-aria-components";
1857
+ import { twMerge as twMerge13 } from "tailwind-merge";
1843
1858
  import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
1844
- function RadioGroup({ children, className, ...props }) {
1859
+ function RadioGroup({
1860
+ children,
1861
+ className,
1862
+ orientation = "vertical",
1863
+ ...props
1864
+ }) {
1845
1865
  return /* @__PURE__ */ jsx24(
1846
1866
  AriaRadioGroup,
1847
1867
  {
1848
1868
  ...props,
1849
- className: [
1850
- "flex flex-col gap-2",
1851
- "disabled:opacity-50",
1869
+ orientation,
1870
+ className: twMerge13(
1871
+ "flex gap-2 disabled:opacity-50",
1872
+ orientation === "horizontal" ? "flex-row" : "flex-col",
1852
1873
  className
1853
- ].filter(Boolean).join(" "),
1874
+ ),
1854
1875
  children
1855
1876
  }
1856
1877
  );
@@ -2033,7 +2054,7 @@ function Breadcrumbs({ items, className }) {
2033
2054
  import {
2034
2055
  ToggleButton as AriaToggleButton2
2035
2056
  } from "react-aria-components";
2036
- import { twMerge as twMerge13 } from "tailwind-merge";
2057
+ import { twMerge as twMerge14 } from "tailwind-merge";
2037
2058
  import { jsx as jsx28 } from "react/jsx-runtime";
2038
2059
  var squareSizeStyles2 = {
2039
2060
  xs: "h-6 w-6 text-xs",
@@ -2083,7 +2104,7 @@ function ToggleButton({
2083
2104
  AriaToggleButton2,
2084
2105
  {
2085
2106
  ...props,
2086
- className: ({ isSelected }) => twMerge13(
2107
+ className: ({ isSelected }) => twMerge14(
2087
2108
  "inline-flex items-center justify-center gap-2 cursor-pointer",
2088
2109
  isSquare ? "rounded-none" : "rounded-md",
2089
2110
  "font-medium",
@@ -2106,7 +2127,7 @@ import {
2106
2127
  MenuItem as AriaMenuItem,
2107
2128
  Popover as Popover2
2108
2129
  } from "react-aria-components";
2109
- import { twMerge as twMerge14 } from "tailwind-merge";
2130
+ import { twMerge as twMerge15 } from "tailwind-merge";
2110
2131
 
2111
2132
  // src/components/Menu/menuStyles.ts
2112
2133
  var popoverStyles = `
@@ -2133,7 +2154,7 @@ function Menu2({
2133
2154
  const selectionProps = selectionMode && selectionMode !== "none" ? { selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange } : {};
2134
2155
  return /* @__PURE__ */ jsxs18(MenuTrigger, { children: [
2135
2156
  children,
2136
- /* @__PURE__ */ jsx29(Popover2, { className: twMerge14(popoverStyles, className), children: items ? /* @__PURE__ */ jsx29(
2157
+ /* @__PURE__ */ jsx29(Popover2, { className: twMerge15(popoverStyles, className), children: items ? /* @__PURE__ */ jsx29(
2137
2158
  AriaMenu,
2138
2159
  {
2139
2160
  items,
@@ -2192,7 +2213,7 @@ import {
2192
2213
  Popover as Popover3,
2193
2214
  Pressable
2194
2215
  } from "react-aria-components";
2195
- import { twMerge as twMerge15 } from "tailwind-merge";
2216
+ import { twMerge as twMerge16 } from "tailwind-merge";
2196
2217
  import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
2197
2218
  function useContextMenu({
2198
2219
  content,
@@ -2258,7 +2279,7 @@ function useContextMenu({
2258
2279
  isNonModal: true,
2259
2280
  placement: "bottom start",
2260
2281
  ref: popoverRef,
2261
- className: twMerge15(popoverStyles, className),
2282
+ className: twMerge16(popoverStyles, className),
2262
2283
  children: /* @__PURE__ */ jsx30(
2263
2284
  AriaMenu2,
2264
2285
  {
@@ -2421,7 +2442,7 @@ import {
2421
2442
  Popover as AriaPopover,
2422
2443
  Button as AriaButton3
2423
2444
  } from "react-aria-components";
2424
- import { twMerge as twMerge16 } from "tailwind-merge";
2445
+ import { twMerge as twMerge17 } from "tailwind-merge";
2425
2446
  import { jsx as jsx36 } from "react/jsx-runtime";
2426
2447
  function Popover4({ children, isOpen, onOpenChange }) {
2427
2448
  return /* @__PURE__ */ jsx36(DialogTrigger, { isOpen, onOpenChange, children });
@@ -2431,7 +2452,7 @@ function PopoverTrigger({ children, className }) {
2431
2452
  inline-flex items-center bg-transparent border-none p-0 outline-none cursor-pointer
2432
2453
  focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm
2433
2454
  `;
2434
- return /* @__PURE__ */ jsx36(AriaButton3, { className: twMerge16(cx, className), children });
2455
+ return /* @__PURE__ */ jsx36(AriaButton3, { className: twMerge17(cx, className), children });
2435
2456
  }
2436
2457
  function PopoverContent({
2437
2458
  placement = "bottom",
@@ -2458,7 +2479,7 @@ function PopoverContent({
2458
2479
  ...rest,
2459
2480
  placement,
2460
2481
  offset: offsetPx,
2461
- className: twMerge16(cx, className),
2482
+ className: twMerge17(cx, className),
2462
2483
  children
2463
2484
  }
2464
2485
  );
@@ -2466,7 +2487,7 @@ function PopoverContent({
2466
2487
 
2467
2488
  // src/components/Tabs/Tabs.tsx
2468
2489
  import { createContext as createContext2, useContext as useContext2 } from "react";
2469
- import { twMerge as twMerge17 } from "tailwind-merge";
2490
+ import { twMerge as twMerge18 } from "tailwind-merge";
2470
2491
  import {
2471
2492
  Tabs as AriaTabs,
2472
2493
  TabList as AriaTabList,
@@ -2496,7 +2517,7 @@ function Tabs({
2496
2517
  {
2497
2518
  ...props,
2498
2519
  orientation,
2499
- className: twMerge17(
2520
+ className: twMerge18(
2500
2521
  orientation === "vertical" ? "flex" : "",
2501
2522
  className
2502
2523
  ),
@@ -2515,7 +2536,7 @@ function TabList({
2515
2536
  AriaTabList,
2516
2537
  {
2517
2538
  ...props,
2518
- className: ({ orientation }) => twMerge17(
2539
+ className: ({ orientation }) => twMerge18(
2519
2540
  baseStyles,
2520
2541
  orientation === "vertical" ? verticalStyles : "",
2521
2542
  className
@@ -2531,14 +2552,14 @@ function Tab({ className, ...props }) {
2531
2552
  ...props,
2532
2553
  className: ({ isSelected, isDisabled, isHovered, isPressed }) => {
2533
2554
  if (variant === "unstyled") {
2534
- return twMerge17(
2555
+ return twMerge18(
2535
2556
  "cursor-pointer outline-none",
2536
2557
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
2537
2558
  isDisabled ? "opacity-50 pointer-events-none" : "",
2538
2559
  className
2539
2560
  );
2540
2561
  }
2541
- return twMerge17(
2562
+ return twMerge18(
2542
2563
  // Base
2543
2564
  "cursor-pointer outline-none transition-colors",
2544
2565
  "font-medium",
@@ -2586,7 +2607,7 @@ function TabPanel({ className, ...props }) {
2586
2607
  AriaTabPanel,
2587
2608
  {
2588
2609
  ...props,
2589
- className: twMerge17(
2610
+ className: twMerge18(
2590
2611
  variant === "unstyled" ? "outline-none" : "mt-4 outline-none",
2591
2612
  className
2592
2613
  )
@@ -2604,7 +2625,7 @@ import {
2604
2625
 
2605
2626
  // src/components/SegmentedControl/SegmentedControl.tsx
2606
2627
  import { createContext as createContext3, useContext as useContext3 } from "react";
2607
- import { twMerge as twMerge18 } from "tailwind-merge";
2628
+ import { twMerge as twMerge19 } from "tailwind-merge";
2608
2629
  import {
2609
2630
  ToggleButtonGroup as AriaToggleButtonGroup,
2610
2631
  ToggleButton as AriaToggleButton3
@@ -2637,7 +2658,7 @@ function SegmentedControl({
2637
2658
  selectedKeys: isNoneMode ? /* @__PURE__ */ new Set() : selectedKeys,
2638
2659
  defaultSelectedKeys: isNoneMode ? void 0 : defaultSelectedKeys,
2639
2660
  onSelectionChange: isNoneMode ? void 0 : onSelectionChange,
2640
- className: twMerge18(
2661
+ className: twMerge19(
2641
2662
  "inline-flex items-center rounded-lg border border-border bg-muted p-0.5 gap-0.5",
2642
2663
  className
2643
2664
  ),
@@ -2654,7 +2675,7 @@ function SegmentedControlItem({
2654
2675
  AriaToggleButton3,
2655
2676
  {
2656
2677
  ...props,
2657
- className: ({ isSelected, isHovered, isPressed, isDisabled }) => twMerge18(
2678
+ className: ({ isSelected, isHovered, isPressed, isDisabled }) => twMerge19(
2658
2679
  // Base layout
2659
2680
  "inline-flex items-center justify-center",
2660
2681
  "rounded-md",
@@ -2675,13 +2696,13 @@ function SegmentedControlItem({
2675
2696
  }
2676
2697
 
2677
2698
  // src/components/Badge/Badge.tsx
2678
- import { twMerge as twMerge20 } from "tailwind-merge";
2699
+ import { twMerge as twMerge21 } from "tailwind-merge";
2679
2700
 
2680
2701
  // src/components/MetricText/MetricText.tsx
2681
- import { twMerge as twMerge19 } from "tailwind-merge";
2702
+ import { twMerge as twMerge20 } from "tailwind-merge";
2682
2703
  import { jsx as jsx39 } from "react/jsx-runtime";
2683
2704
  function MetricText({ className, ...rest }) {
2684
- const cx = twMerge19(
2705
+ const cx = twMerge20(
2685
2706
  "text-xs font-medium leading-none tracking-wider tabular-nums",
2686
2707
  className
2687
2708
  );
@@ -2715,7 +2736,7 @@ function Badge({
2715
2736
  return /* @__PURE__ */ jsxs23(
2716
2737
  MetricText,
2717
2738
  {
2718
- className: twMerge20(
2739
+ className: twMerge21(
2719
2740
  "inline-flex items-center gap-1 rounded-full border",
2720
2741
  colorStyles[color],
2721
2742
  sizeStyles6[size],
@@ -2731,10 +2752,10 @@ function Badge({
2731
2752
  }
2732
2753
 
2733
2754
  // src/components/Card/Card.tsx
2734
- import { twMerge as twMerge21 } from "tailwind-merge";
2755
+ import { twMerge as twMerge22 } from "tailwind-merge";
2735
2756
  import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
2736
2757
  function Card({ children, header, footer, className }) {
2737
- const cx = twMerge21(
2758
+ const cx = twMerge22(
2738
2759
  `
2739
2760
  bg-card p-8
2740
2761
  border border-border
@@ -2752,7 +2773,7 @@ function Card({ children, header, footer, className }) {
2752
2773
 
2753
2774
  // src/components/DeltaIndicator/DeltaIndicator.tsx
2754
2775
  import { ArrowUp as ArrowUp2, ArrowDown as ArrowDown2, Minus as Minus2 } from "lucide-react";
2755
- import { twMerge as twMerge22 } from "tailwind-merge";
2776
+ import { twMerge as twMerge23 } from "tailwind-merge";
2756
2777
  import { jsx as jsx42, jsxs as jsxs25 } from "react/jsx-runtime";
2757
2778
  function getDirection(current, previous) {
2758
2779
  const diff = current - previous;
@@ -2809,7 +2830,7 @@ function DeltaIndicator({
2809
2830
  return /* @__PURE__ */ jsxs25(
2810
2831
  "span",
2811
2832
  {
2812
- className: twMerge22(
2833
+ className: twMerge23(
2813
2834
  "inline-flex items-center gap-1 font-medium",
2814
2835
  "text-muted-foreground",
2815
2836
  className
@@ -2848,7 +2869,7 @@ function DeltaIndicator({
2848
2869
  return /* @__PURE__ */ jsxs25(
2849
2870
  "span",
2850
2871
  {
2851
- className: twMerge22(
2872
+ className: twMerge23(
2852
2873
  "inline-flex items-center gap-1 font-medium",
2853
2874
  colorStyles2,
2854
2875
  isPill && [
@@ -2868,7 +2889,7 @@ function DeltaIndicator({
2868
2889
  }
2869
2890
 
2870
2891
  // src/components/ProgressBar/ProgressBar.tsx
2871
- import { twMerge as twMerge23 } from "tailwind-merge";
2892
+ import { twMerge as twMerge24 } from "tailwind-merge";
2872
2893
  import { jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
2873
2894
  var fillStyles = {
2874
2895
  brand: "bg-progress-fill",
@@ -2892,7 +2913,7 @@ function ProgressBar({
2892
2913
  className
2893
2914
  }) {
2894
2915
  const clampedValue = Math.min(100, Math.max(0, value));
2895
- return /* @__PURE__ */ jsxs26("div", { className: twMerge23("w-full", className), children: [
2916
+ return /* @__PURE__ */ jsxs26("div", { className: twMerge24("w-full", className), children: [
2896
2917
  (label || description || showValue) && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between mb-2", children: [
2897
2918
  /* @__PURE__ */ jsx43("span", { className: "text-sm font-medium text-foreground", children: label }),
2898
2919
  /* @__PURE__ */ jsx43("span", { className: "text-sm text-muted-foreground", children: description ?? (showValue ? `${clampedValue}%` : null) })
@@ -2905,14 +2926,14 @@ function ProgressBar({
2905
2926
  "aria-valuemin": 0,
2906
2927
  "aria-valuemax": 100,
2907
2928
  "aria-label": label ?? "Progress",
2908
- className: twMerge23(
2929
+ className: twMerge24(
2909
2930
  "w-full rounded-full bg-progress-track",
2910
2931
  sizeStyles7[size]
2911
2932
  ),
2912
2933
  children: /* @__PURE__ */ jsx43(
2913
2934
  "div",
2914
2935
  {
2915
- className: twMerge23(
2936
+ className: twMerge24(
2916
2937
  "h-full rounded-full transition-all duration-300",
2917
2938
  fillStyles[variant]
2918
2939
  ),
@@ -2932,7 +2953,7 @@ import {
2932
2953
  AlertCircle as AlertCircle2,
2933
2954
  CheckCircle2 as CheckCircle22
2934
2955
  } from "lucide-react";
2935
- import { twMerge as twMerge24 } from "tailwind-merge";
2956
+ import { twMerge as twMerge25 } from "tailwind-merge";
2936
2957
  import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
2937
2958
  var variantConfig2 = {
2938
2959
  info: {
@@ -2981,7 +3002,7 @@ function Banner({
2981
3002
  "div",
2982
3003
  {
2983
3004
  role: config.role,
2984
- className: twMerge24(
3005
+ className: twMerge25(
2985
3006
  "flex items-start gap-3 rounded-lg border px-4 py-3",
2986
3007
  "text-sm",
2987
3008
  config.containerClass,
@@ -2993,7 +3014,7 @@ function Banner({
2993
3014
  {
2994
3015
  icon: resolvedIcon,
2995
3016
  size: "md",
2996
- className: twMerge24("mt-0.5", config.iconClass)
3017
+ className: twMerge25("mt-0.5", config.iconClass)
2997
3018
  }
2998
3019
  ),
2999
3020
  /* @__PURE__ */ jsxs27("div", { className: "flex-1", children: [
@@ -3019,7 +3040,7 @@ function Banner({
3019
3040
  }
3020
3041
 
3021
3042
  // src/components/MetricCard/MetricCard.tsx
3022
- import { twMerge as twMerge25 } from "tailwind-merge";
3043
+ import { twMerge as twMerge26 } from "tailwind-merge";
3023
3044
  import { Fragment as Fragment8, jsx as jsx45, jsxs as jsxs28 } from "react/jsx-runtime";
3024
3045
  var sizeConfig = {
3025
3046
  sm: {
@@ -3042,18 +3063,18 @@ function MetricCard({
3042
3063
  className
3043
3064
  }) {
3044
3065
  const config = sizeConfig[size];
3045
- const containerClass = twMerge25(
3066
+ const containerClass = twMerge26(
3046
3067
  "bg-background border border-border rounded-lg shadow-sm",
3047
3068
  config.padding,
3048
3069
  href && "block transition-shadow hover:shadow-md hover:border-ring focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none",
3049
3070
  className
3050
3071
  );
3051
3072
  const content = /* @__PURE__ */ jsxs28(Fragment8, { children: [
3052
- /* @__PURE__ */ jsx45("div", { className: twMerge25(config.labelClass, "text-muted-foreground"), children: label }),
3073
+ /* @__PURE__ */ jsx45("div", { className: twMerge26(config.labelClass, "text-muted-foreground"), children: label }),
3053
3074
  /* @__PURE__ */ jsx45(
3054
3075
  "div",
3055
3076
  {
3056
- className: twMerge25(
3077
+ className: twMerge26(
3057
3078
  config.valueClass,
3058
3079
  "font-semibold text-foreground mt-1 tabular-nums"
3059
3080
  ),
@@ -3070,7 +3091,7 @@ function MetricCard({
3070
3091
 
3071
3092
  // src/components/SectionHeader/SectionHeader.tsx
3072
3093
  import { forwardRef as forwardRef7 } from "react";
3073
- import { twMerge as twMerge26 } from "tailwind-merge";
3094
+ import { twMerge as twMerge27 } from "tailwind-merge";
3074
3095
  import { jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
3075
3096
  var SectionHeader = forwardRef7(
3076
3097
  function SectionHeader2({ title, as = "h2", children, className, ...rest }, ref) {
@@ -3078,7 +3099,7 @@ var SectionHeader = forwardRef7(
3078
3099
  "div",
3079
3100
  {
3080
3101
  ref,
3081
- className: twMerge26(
3102
+ className: twMerge27(
3082
3103
  "flex flex-wrap items-center gap-3 pt-0 pb-4",
3083
3104
  className
3084
3105
  ),
@@ -3139,7 +3160,7 @@ function DescriptionListItem({
3139
3160
  DescriptionList.Item = DescriptionListItem;
3140
3161
 
3141
3162
  // src/components/PathPill/PathPill.tsx
3142
- import { twMerge as twMerge27 } from "tailwind-merge";
3163
+ import { twMerge as twMerge28 } from "tailwind-merge";
3143
3164
  import { jsx as jsx48 } from "react/jsx-runtime";
3144
3165
  var hashColors = [
3145
3166
  "purple",
@@ -3169,12 +3190,12 @@ function PathPill({
3169
3190
  return /* @__PURE__ */ jsx48(
3170
3191
  "div",
3171
3192
  {
3172
- className: twMerge27("relative flex", className),
3193
+ className: twMerge28("relative flex", className),
3173
3194
  "aria-label": `Path: ${fullPath}`,
3174
3195
  children: segments.map((segment, i) => {
3175
3196
  const isCollapsed = i < dotCount;
3176
3197
  const isLast = i === segments.length - 1;
3177
- const cx = twMerge27(!isLast && "pr-5 -mr-4", isCollapsed && "pr-3");
3198
+ const cx = twMerge28(!isLast && "pr-5 -mr-4", isCollapsed && "pr-3");
3178
3199
  const color = colorFn ? colorFn(segment, i) : pillColorFromName(segment);
3179
3200
  return /* @__PURE__ */ jsx48(
3180
3201
  Badge,