@dev-dga/react 0.7.0 → 0.8.0

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
@@ -80,6 +80,16 @@ var buttonVariants = cva2("ddga-button", {
80
80
  */
81
81
  inverted: {
82
82
  true: "ddga-button--inverted"
83
+ },
84
+ /**
85
+ * Floating action button: fully-rounded + elevated. Orthogonal to `variant`
86
+ * (color) and `size` — pair with `size="icon"` for a circular FAB, or a text
87
+ * size for an extended pill FAB. Positioning (`position: fixed`, safe-area
88
+ * insets) is the consumer's responsibility — see the placement recipe in the
89
+ * stories. Keep it a modifier, not a `Fab` wrapper component.
90
+ */
91
+ fab: {
92
+ true: "ddga-button--fab"
83
93
  }
84
94
  },
85
95
  compoundVariants: [],
@@ -93,6 +103,7 @@ function Button({
93
103
  size,
94
104
  fullWidth,
95
105
  inverted,
106
+ fab,
96
107
  loading,
97
108
  disabled,
98
109
  startIcon,
@@ -122,7 +133,7 @@ function Button({
122
133
  "aria-busy": loading || void 0,
123
134
  "data-slot": "button",
124
135
  className: cn(
125
- buttonVariants({ variant, size, fullWidth, inverted }),
136
+ buttonVariants({ variant, size, fullWidth, inverted, fab }),
126
137
  loading && "ddga-button--loading",
127
138
  className
128
139
  ),
@@ -704,6 +715,43 @@ function CaretDown(props) {
704
715
  }
705
716
  );
706
717
  }
718
+ function ExternalLink(props) {
719
+ return /* @__PURE__ */ jsxs4(
720
+ "svg",
721
+ {
722
+ xmlns: "http://www.w3.org/2000/svg",
723
+ width: "1em",
724
+ height: "1em",
725
+ viewBox: "0 0 24 24",
726
+ fill: "none",
727
+ stroke: "currentColor",
728
+ strokeWidth: "2",
729
+ strokeLinecap: "round",
730
+ strokeLinejoin: "round",
731
+ ...props,
732
+ children: [
733
+ /* @__PURE__ */ jsx6("path", { d: "M15 3h6v6" }),
734
+ /* @__PURE__ */ jsx6("path", { d: "M10 14 21 3" }),
735
+ /* @__PURE__ */ jsx6("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
736
+ ]
737
+ }
738
+ );
739
+ }
740
+ function QuoteMark(props) {
741
+ return /* @__PURE__ */ jsx6(
742
+ "svg",
743
+ {
744
+ xmlns: "http://www.w3.org/2000/svg",
745
+ width: "1em",
746
+ height: "1em",
747
+ viewBox: "0 0 24 24",
748
+ fill: "currentColor",
749
+ stroke: "none",
750
+ ...props,
751
+ children: /* @__PURE__ */ jsx6("path", { d: "M7 7C4.8 7 3 8.8 3 11s1.8 4 4 4c.2 0 .4 0 .6-.1C7.2 16.4 6 17.5 4.2 17.7L4 17.7V20c3.6-.3 6-3.2 6-7v-1.2C10 8.7 8.4 7 7 7zM18 7c-2.2 0-4 1.8-4 4s1.8 4 4 4c.2 0 .4 0 .6-.1-.4 1.5-1.6 2.6-3.4 2.8l-.2 0V20c3.6-.3 6-3.2 6-7v-1.2C21 8.7 19.4 7 18 7z" })
752
+ }
753
+ );
754
+ }
707
755
  function PanelLeft(props) {
708
756
  return /* @__PURE__ */ jsxs4(
709
757
  "svg",
@@ -1840,9 +1888,10 @@ function ToastItem({ toast: t, store, closeButton, closeLabel, hideIcon }) {
1840
1888
  }
1841
1889
 
1842
1890
  // src/components/Tabs/Tabs.tsx
1891
+ import "react";
1843
1892
  import { Tabs as TabsPrimitive } from "radix-ui";
1844
1893
  import { cva as cva17 } from "class-variance-authority";
1845
- import { jsx as jsx19 } from "react/jsx-runtime";
1894
+ import { Fragment, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
1846
1895
  var tabsVariants = cva17("ddga-tabs", {
1847
1896
  variants: {
1848
1897
  variant: {
@@ -1886,13 +1935,49 @@ function TabsList({ fullWidth, className, ...props }) {
1886
1935
  }
1887
1936
  );
1888
1937
  }
1889
- function TabsTrigger({ className, ...props }) {
1938
+ function TabsTrigger({
1939
+ className,
1940
+ startIcon,
1941
+ endIcon,
1942
+ children,
1943
+ asChild,
1944
+ ...props
1945
+ }) {
1946
+ const hasIcon = startIcon != null || endIcon != null;
1947
+ const hasText = children != null && children !== "" && typeof children !== "boolean";
1948
+ const isIconOnly = !asChild && hasIcon && !hasText;
1949
+ if (process.env.NODE_ENV === "development") {
1950
+ if (isIconOnly && !props["aria-label"] && !props["aria-labelledby"]) {
1951
+ console.warn(
1952
+ "[@dev-dga/react] An icon-only TabsTrigger (icon with no text label) requires an aria-label or aria-labelledby for screen reader accessibility."
1953
+ );
1954
+ }
1955
+ if (asChild && hasIcon) {
1956
+ console.warn(
1957
+ "[@dev-dga/react] TabsTrigger `startIcon`/`endIcon` are ignored when `asChild` is set \u2014 render the icons inside your child element instead."
1958
+ );
1959
+ }
1960
+ }
1890
1961
  return /* @__PURE__ */ jsx19(
1891
1962
  TabsPrimitive.Trigger,
1892
1963
  {
1893
1964
  "data-slot": "tabs-trigger",
1894
- className: cn("ddga-tabs__trigger", className),
1895
- ...props
1965
+ asChild,
1966
+ className: cn("ddga-tabs__trigger", isIconOnly && "ddga-tabs__trigger--icon-only", className),
1967
+ ...props,
1968
+ children: asChild ? children : /* @__PURE__ */ jsxs15(Fragment, { children: [
1969
+ startIcon && /* @__PURE__ */ jsx19(
1970
+ "span",
1971
+ {
1972
+ className: "ddga-tabs__icon",
1973
+ "data-slot": "tabs-trigger-start-icon",
1974
+ "aria-hidden": "true",
1975
+ children: startIcon
1976
+ }
1977
+ ),
1978
+ children,
1979
+ endIcon && /* @__PURE__ */ jsx19("span", { className: "ddga-tabs__icon", "data-slot": "tabs-trigger-end-icon", "aria-hidden": "true", children: endIcon })
1980
+ ] })
1896
1981
  }
1897
1982
  );
1898
1983
  }
@@ -1992,7 +2077,7 @@ function BreadcrumbEllipsis({ className, ...props }) {
1992
2077
  // src/components/Pagination/Pagination.tsx
1993
2078
  import { Slot as SlotPrimitive7 } from "radix-ui";
1994
2079
  import { cva as cva19 } from "class-variance-authority";
1995
- import { Fragment, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
2080
+ import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
1996
2081
  var paginationVariants = cva19("ddga-pagination", {
1997
2082
  variants: {
1998
2083
  size: {
@@ -2063,7 +2148,7 @@ function PaginationPrevious({
2063
2148
  "data-slot": "pagination-previous",
2064
2149
  className: cn("ddga-pagination__nav", "ddga-pagination__nav--previous", className),
2065
2150
  ...props,
2066
- children: children ?? /* @__PURE__ */ jsxs15(Fragment, { children: [
2151
+ children: children ?? /* @__PURE__ */ jsxs16(Fragment2, { children: [
2067
2152
  /* @__PURE__ */ jsx21(ChevronRight, { className: "ddga-pagination__nav-icon ddga-pagination__nav-icon--previous" }),
2068
2153
  /* @__PURE__ */ jsx21("span", { children: label })
2069
2154
  ] })
@@ -2085,7 +2170,7 @@ function PaginationNext({
2085
2170
  "data-slot": "pagination-next",
2086
2171
  className: cn("ddga-pagination__nav", "ddga-pagination__nav--next", className),
2087
2172
  ...props,
2088
- children: children ?? /* @__PURE__ */ jsxs15(Fragment, { children: [
2173
+ children: children ?? /* @__PURE__ */ jsxs16(Fragment2, { children: [
2089
2174
  /* @__PURE__ */ jsx21("span", { children: label }),
2090
2175
  /* @__PURE__ */ jsx21(ChevronRight, { className: "ddga-pagination__nav-icon ddga-pagination__nav-icon--next" })
2091
2176
  ] })
@@ -2109,7 +2194,7 @@ function PaginationEllipsis({ className, ...props }) {
2109
2194
  // src/components/Accordion/Accordion.tsx
2110
2195
  import { Accordion as AccordionPrimitive } from "radix-ui";
2111
2196
  import { cva as cva20 } from "class-variance-authority";
2112
- import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
2197
+ import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
2113
2198
  var accordionVariants = cva20("ddga-accordion", {
2114
2199
  variants: {
2115
2200
  size: {
@@ -2142,7 +2227,7 @@ function AccordionItem({ className, ...props }) {
2142
2227
  );
2143
2228
  }
2144
2229
  function AccordionTrigger({ className, children, ...props }) {
2145
- return /* @__PURE__ */ jsx22(AccordionPrimitive.Header, { className: "ddga-accordion__header", children: /* @__PURE__ */ jsxs16(
2230
+ return /* @__PURE__ */ jsx22(AccordionPrimitive.Header, { className: "ddga-accordion__header", children: /* @__PURE__ */ jsxs17(
2146
2231
  AccordionPrimitive.Trigger,
2147
2232
  {
2148
2233
  "data-slot": "accordion-trigger",
@@ -2176,7 +2261,7 @@ function AccordionContent({ className, children, ...props }) {
2176
2261
 
2177
2262
  // src/components/Steps/Steps.tsx
2178
2263
  import { cva as cva21 } from "class-variance-authority";
2179
- import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
2264
+ import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
2180
2265
  var stepsVariants = cva21("ddga-steps", {
2181
2266
  variants: {
2182
2267
  size: {
@@ -2229,7 +2314,7 @@ function Step({ state, className, ...props }) {
2229
2314
  );
2230
2315
  }
2231
2316
  function StepIndicator({ step, className, ...props }) {
2232
- return /* @__PURE__ */ jsxs17(
2317
+ return /* @__PURE__ */ jsxs18(
2233
2318
  "span",
2234
2319
  {
2235
2320
  "aria-hidden": "true",
@@ -2299,7 +2384,7 @@ function Skeleton({ shape, animation, width, height, className, style, ...props
2299
2384
  // src/components/Progress/Progress.tsx
2300
2385
  import { Progress as ProgressPrimitive } from "radix-ui";
2301
2386
  import { cva as cva23 } from "class-variance-authority";
2302
- import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
2387
+ import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
2303
2388
  var progressVariants = cva23("ddga-progress", {
2304
2389
  variants: {
2305
2390
  size: {
@@ -2362,30 +2447,60 @@ function Progress({ value = null, max = 100, size, color, className, ...props })
2362
2447
  }
2363
2448
  var CIRCULAR_SIZES = { sm: 32, md: 48, lg: 72 };
2364
2449
  var CIRCULAR_DEFAULT_THICKNESS = { sm: 4, md: 5, lg: 6 };
2450
+ var SEGMENT_GAP_FRACTION = 0.16;
2365
2451
  function CircularProgress({
2366
2452
  value = null,
2367
2453
  max = 100,
2368
2454
  size,
2369
2455
  color,
2370
2456
  thickness,
2457
+ segments,
2371
2458
  showLabel = false,
2372
2459
  className,
2373
2460
  ...props
2374
2461
  }) {
2375
2462
  const isIndeterminate = value === null;
2463
+ const isSegmented = typeof segments === "number" && segments >= 2;
2376
2464
  const sizeKey = size ?? "md";
2377
2465
  const diameter = CIRCULAR_SIZES[sizeKey];
2378
2466
  const strokeWidth = thickness ?? CIRCULAR_DEFAULT_THICKNESS[sizeKey];
2379
2467
  const radius = (diameter - strokeWidth) / 2;
2380
2468
  const circumference = 2 * Math.PI * radius;
2469
+ const center = diameter / 2;
2381
2470
  const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, value / max * 100));
2382
2471
  const dashOffset = isIndeterminate ? circumference * 0.75 : circumference * (1 - pct / 100);
2383
2472
  const state = isIndeterminate ? "indeterminate" : value >= max ? "complete" : "loading";
2384
- return /* @__PURE__ */ jsxs18(
2473
+ const segmentEls = isSegmented && segments ? (() => {
2474
+ const filled = isIndeterminate ? 0 : Math.round(pct / 100 * segments);
2475
+ const segAngle = 360 / segments;
2476
+ const gapAngle = segAngle * SEGMENT_GAP_FRACTION;
2477
+ const segLen = circumference * ((1 - SEGMENT_GAP_FRACTION) / segments);
2478
+ return Array.from({ length: segments }, (_, i) => /* @__PURE__ */ jsx25(
2479
+ "circle",
2480
+ {
2481
+ className: cn(
2482
+ "ddga-circular-progress__segment",
2483
+ i < filled && "ddga-circular-progress__segment--filled"
2484
+ ),
2485
+ cx: center,
2486
+ cy: center,
2487
+ r: radius,
2488
+ fill: "none",
2489
+ strokeWidth,
2490
+ strokeLinecap: "butt",
2491
+ strokeDasharray: `${segLen} ${circumference}`,
2492
+ transform: `rotate(${-90 + i * segAngle + gapAngle / 2} ${center} ${center})`
2493
+ },
2494
+ i
2495
+ ));
2496
+ })() : null;
2497
+ const labelText = isSegmented ? `${segments ? Math.round(pct / 100 * segments) : 0}/${segments}` : `${Math.round(pct)}%`;
2498
+ return /* @__PURE__ */ jsxs19(
2385
2499
  "div",
2386
2500
  {
2387
2501
  "data-slot": "circular-progress",
2388
2502
  "data-state": state,
2503
+ "data-segmented": isSegmented ? "" : void 0,
2389
2504
  role: "progressbar",
2390
2505
  "aria-valuemin": 0,
2391
2506
  "aria-valuemax": max,
@@ -2394,7 +2509,7 @@ function CircularProgress({
2394
2509
  style: { inlineSize: diameter, blockSize: diameter },
2395
2510
  ...props,
2396
2511
  children: [
2397
- /* @__PURE__ */ jsxs18(
2512
+ /* @__PURE__ */ jsx25(
2398
2513
  "svg",
2399
2514
  {
2400
2515
  className: "ddga-circular-progress__svg",
@@ -2403,13 +2518,13 @@ function CircularProgress({
2403
2518
  height: diameter,
2404
2519
  "aria-hidden": "true",
2405
2520
  focusable: "false",
2406
- children: [
2521
+ children: isSegmented ? segmentEls : /* @__PURE__ */ jsxs19(Fragment3, { children: [
2407
2522
  /* @__PURE__ */ jsx25(
2408
2523
  "circle",
2409
2524
  {
2410
2525
  className: "ddga-circular-progress__track",
2411
- cx: diameter / 2,
2412
- cy: diameter / 2,
2526
+ cx: center,
2527
+ cy: center,
2413
2528
  r: radius,
2414
2529
  fill: "none",
2415
2530
  strokeWidth
@@ -2419,24 +2534,21 @@ function CircularProgress({
2419
2534
  "circle",
2420
2535
  {
2421
2536
  className: "ddga-circular-progress__indicator",
2422
- cx: diameter / 2,
2423
- cy: diameter / 2,
2537
+ cx: center,
2538
+ cy: center,
2424
2539
  r: radius,
2425
2540
  fill: "none",
2426
2541
  strokeWidth,
2427
2542
  strokeLinecap: "round",
2428
2543
  strokeDasharray: circumference,
2429
2544
  strokeDashoffset: dashOffset,
2430
- transform: `rotate(-90 ${diameter / 2} ${diameter / 2})`
2545
+ transform: `rotate(-90 ${center} ${center})`
2431
2546
  }
2432
2547
  )
2433
- ]
2548
+ ] })
2434
2549
  }
2435
2550
  ),
2436
- showLabel && !isIndeterminate ? /* @__PURE__ */ jsxs18("span", { className: "ddga-circular-progress__label", "aria-hidden": "true", children: [
2437
- Math.round(pct),
2438
- "%"
2439
- ] }) : null
2551
+ showLabel && !isIndeterminate ? /* @__PURE__ */ jsx25("span", { className: "ddga-circular-progress__label", "aria-hidden": "true", children: labelText }) : null
2440
2552
  ]
2441
2553
  }
2442
2554
  );
@@ -2446,7 +2558,7 @@ function CircularProgress({
2446
2558
  import { useContext as useContext5 } from "react";
2447
2559
  import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
2448
2560
  import { cva as cva24 } from "class-variance-authority";
2449
- import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
2561
+ import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
2450
2562
  var dropdownMenuVariants = cva24("ddga-dropdown-menu", {
2451
2563
  variants: {
2452
2564
  size: {
@@ -2490,7 +2602,7 @@ function DropdownMenuItem({
2490
2602
  children,
2491
2603
  ...props
2492
2604
  }) {
2493
- return /* @__PURE__ */ jsxs19(
2605
+ return /* @__PURE__ */ jsxs20(
2494
2606
  DropdownMenuPrimitive.Item,
2495
2607
  {
2496
2608
  "data-slot": "dropdown-menu-item",
@@ -2514,7 +2626,7 @@ function DropdownMenuCheckboxItem({
2514
2626
  const handleSelect = onSelect ?? ((event) => {
2515
2627
  event.preventDefault();
2516
2628
  });
2517
- return /* @__PURE__ */ jsxs19(
2629
+ return /* @__PURE__ */ jsxs20(
2518
2630
  DropdownMenuPrimitive.CheckboxItem,
2519
2631
  {
2520
2632
  "data-slot": "dropdown-menu-checkbox-item",
@@ -2540,7 +2652,7 @@ function DropdownMenuRadioItem({
2540
2652
  const handleSelect = onSelect ?? ((event) => {
2541
2653
  event.preventDefault();
2542
2654
  });
2543
- return /* @__PURE__ */ jsxs19(
2655
+ return /* @__PURE__ */ jsxs20(
2544
2656
  DropdownMenuPrimitive.RadioItem,
2545
2657
  {
2546
2658
  "data-slot": "dropdown-menu-radio-item",
@@ -2586,7 +2698,7 @@ function DropdownMenuSubTrigger({
2586
2698
  children,
2587
2699
  ...props
2588
2700
  }) {
2589
- return /* @__PURE__ */ jsxs19(
2701
+ return /* @__PURE__ */ jsxs20(
2590
2702
  DropdownMenuPrimitive.SubTrigger,
2591
2703
  {
2592
2704
  "data-slot": "dropdown-menu-sub-trigger",
@@ -2617,7 +2729,7 @@ function DropdownMenuSubContent({ size, className, ...props }) {
2617
2729
  import { useContext as useContext6 } from "react";
2618
2730
  import { Dialog as DialogPrimitive2, Slot as SlotPrimitive8 } from "radix-ui";
2619
2731
  import { cva as cva25 } from "class-variance-authority";
2620
- import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
2732
+ import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
2621
2733
  var drawerVariants = cva25("ddga-drawer", {
2622
2734
  variants: {
2623
2735
  side: {
@@ -2655,9 +2767,9 @@ function DrawerContent({
2655
2767
  }) {
2656
2768
  const ctx = useContext6(DgaContext);
2657
2769
  const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
2658
- return /* @__PURE__ */ jsxs20(DialogPrimitive2.Portal, { container: portalContainer, children: [
2770
+ return /* @__PURE__ */ jsxs21(DialogPrimitive2.Portal, { container: portalContainer, children: [
2659
2771
  /* @__PURE__ */ jsx27(DialogPrimitive2.Overlay, { className: "ddga-drawer__overlay", "data-slot": "drawer-overlay" }),
2660
- /* @__PURE__ */ jsxs20(
2772
+ /* @__PURE__ */ jsxs21(
2661
2773
  DialogPrimitive2.Content,
2662
2774
  {
2663
2775
  "data-slot": "drawer-content",
@@ -2731,7 +2843,7 @@ import {
2731
2843
  import { Command } from "cmdk";
2732
2844
  import { Popover as PopoverPrimitive } from "radix-ui";
2733
2845
  import { cva as cva26 } from "class-variance-authority";
2734
- import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
2846
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
2735
2847
  var comboboxTriggerVariants = cva26("ddga-combobox-trigger", {
2736
2848
  variants: {
2737
2849
  size: {
@@ -2835,13 +2947,13 @@ function Combobox({
2835
2947
  return itemLabels.get(value) ?? null;
2836
2948
  }, [value, getLabel, itemLabels]);
2837
2949
  const searchId = useId3();
2838
- return /* @__PURE__ */ jsx28(ComboboxContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs21("div", { "data-slot": "combobox-field", className: "ddga-field", children: [
2839
- label && /* @__PURE__ */ jsxs21("label", { htmlFor: fieldId, className: "ddga-combobox__label", children: [
2950
+ return /* @__PURE__ */ jsx28(ComboboxContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs22("div", { "data-slot": "combobox-field", className: "ddga-field", children: [
2951
+ label && /* @__PURE__ */ jsxs22("label", { htmlFor: fieldId, className: "ddga-combobox__label", children: [
2840
2952
  label,
2841
2953
  required && /* @__PURE__ */ jsx28("span", { "aria-hidden": "true", className: "ddga-combobox__required", children: "*" })
2842
2954
  ] }),
2843
- /* @__PURE__ */ jsxs21(PopoverPrimitive.Root, { open, onOpenChange: setOpen, children: [
2844
- /* @__PURE__ */ jsx28(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs21(
2955
+ /* @__PURE__ */ jsxs22(PopoverPrimitive.Root, { open, onOpenChange: setOpen, children: [
2956
+ /* @__PURE__ */ jsx28(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
2845
2957
  "button",
2846
2958
  {
2847
2959
  type: "button",
@@ -2869,7 +2981,7 @@ function Combobox({
2869
2981
  onOpenAutoFocus: (event) => {
2870
2982
  event.preventDefault();
2871
2983
  },
2872
- children: /* @__PURE__ */ jsxs21(
2984
+ children: /* @__PURE__ */ jsxs22(
2873
2985
  Command,
2874
2986
  {
2875
2987
  id: searchId,
@@ -2885,7 +2997,7 @@ function Combobox({
2885
2997
  className: "ddga-combobox-input"
2886
2998
  }
2887
2999
  ),
2888
- /* @__PURE__ */ jsxs21(Command.List, { "data-slot": "combobox-list", className: "ddga-combobox-list", children: [
3000
+ /* @__PURE__ */ jsxs22(Command.List, { "data-slot": "combobox-list", className: "ddga-combobox-list", children: [
2889
3001
  /* @__PURE__ */ jsx28(Command.Empty, { "data-slot": "combobox-empty", className: "ddga-combobox-empty", children: emptyMessage }),
2890
3002
  children
2891
3003
  ] })
@@ -2910,7 +3022,7 @@ function ComboboxItem({
2910
3022
  }) {
2911
3023
  const { value: selectedValue, select } = useComboboxContext("ComboboxItem");
2912
3024
  const isSelected = selectedValue === value;
2913
- return /* @__PURE__ */ jsxs21(
3025
+ return /* @__PURE__ */ jsxs22(
2914
3026
  Command.Item,
2915
3027
  {
2916
3028
  value,
@@ -2982,7 +3094,7 @@ import {
2982
3094
  toCalendar
2983
3095
  } from "@internationalized/date";
2984
3096
  import { cva as cva27 } from "class-variance-authority";
2985
- import { Fragment as Fragment2, jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
3097
+ import { Fragment as Fragment4, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
2986
3098
  var datePickerTriggerVariants = cva27("ddga-date-picker-trigger", {
2987
3099
  variants: {
2988
3100
  size: {
@@ -3047,7 +3159,7 @@ function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
3047
3159
  return Array.from({ length: end - start + 1 }, (_, i) => start + i);
3048
3160
  }, [focusedDate, focusedCalendar, focusedYear, minValue, maxValue]);
3049
3161
  if (!state || !focusedDate) return null;
3050
- return /* @__PURE__ */ jsxs22("div", { className: "ddga-date-picker-calendar__nav-selects", "data-slot": "date-picker-calendar-nav", children: [
3162
+ return /* @__PURE__ */ jsxs23("div", { className: "ddga-date-picker-calendar__nav-selects", "data-slot": "date-picker-calendar-nav", children: [
3051
3163
  /* @__PURE__ */ jsx29(
3052
3164
  "select",
3053
3165
  {
@@ -3094,14 +3206,14 @@ function CalendarDayCell({ date, showSecondary, calendarSystem }) {
3094
3206
  "data-selected": isSelected ? "" : void 0,
3095
3207
  "data-slot": "date-picker-day-cell",
3096
3208
  onClick: handleSelect,
3097
- children: showSecondary ? /* @__PURE__ */ jsxs22(Fragment2, { children: [
3209
+ children: showSecondary ? /* @__PURE__ */ jsxs23(Fragment4, { children: [
3098
3210
  /* @__PURE__ */ jsx29("span", { className: "ddga-date-picker-calendar__cell-primary", children: date.day }),
3099
3211
  /* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "ddga-date-picker-calendar__cell-secondary", children: secondaryDayNumber(date, calendarSystem) })
3100
3212
  ] }) : String(date.day)
3101
3213
  }
3102
3214
  ) });
3103
3215
  }
3104
- return /* @__PURE__ */ jsx29(AriaCalendarCell, { date, className: "ddga-date-picker-calendar__cell", children: ({ formattedDate }) => showSecondary ? /* @__PURE__ */ jsxs22(Fragment2, { children: [
3216
+ return /* @__PURE__ */ jsx29(AriaCalendarCell, { date, className: "ddga-date-picker-calendar__cell", children: ({ formattedDate }) => showSecondary ? /* @__PURE__ */ jsxs23(Fragment4, { children: [
3105
3217
  /* @__PURE__ */ jsx29("span", { className: "ddga-date-picker-calendar__cell-primary", children: formattedDate }),
3106
3218
  /* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "ddga-date-picker-calendar__cell-secondary", children: secondaryDayNumber(date, calendarSystem) })
3107
3219
  ] }) : formattedDate });
@@ -3179,7 +3291,7 @@ function DatePicker({
3179
3291
  const hasError = !!error;
3180
3292
  const hasErrorMessage = hasError && errorMessage != null && errorMessage !== "";
3181
3293
  const hasHelper = !hasErrorMessage && helperText != null && helperText !== "";
3182
- return /* @__PURE__ */ jsx29(I18nProvider, { locale: ariaLocale, children: /* @__PURE__ */ jsxs22(
3294
+ return /* @__PURE__ */ jsx29(I18nProvider, { locale: ariaLocale, children: /* @__PURE__ */ jsxs23(
3183
3295
  AriaDatePicker,
3184
3296
  {
3185
3297
  value,
@@ -3196,11 +3308,11 @@ function DatePicker({
3196
3308
  className: "ddga-field",
3197
3309
  "data-slot": "date-picker-field",
3198
3310
  children: [
3199
- label && /* @__PURE__ */ jsxs22(AriaLabel, { className: "ddga-date-picker__label", children: [
3311
+ label && /* @__PURE__ */ jsxs23(AriaLabel, { className: "ddga-date-picker__label", children: [
3200
3312
  label,
3201
3313
  required && /* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "ddga-date-picker__required", children: "*" })
3202
3314
  ] }),
3203
- /* @__PURE__ */ jsxs22(
3315
+ /* @__PURE__ */ jsxs23(
3204
3316
  AriaGroup,
3205
3317
  {
3206
3318
  "data-slot": "date-picker-trigger",
@@ -3251,7 +3363,7 @@ function DatePicker({
3251
3363
  "data-slot": "date-picker-popover",
3252
3364
  offset: 6,
3253
3365
  containerPadding: 12,
3254
- children: /* @__PURE__ */ jsxs22(
3366
+ children: /* @__PURE__ */ jsxs23(
3255
3367
  AriaDialog,
3256
3368
  {
3257
3369
  className: "ddga-date-picker-dialog",
@@ -3259,7 +3371,7 @@ function DatePicker({
3259
3371
  "aria-label": dialogAriaLabel,
3260
3372
  "aria-labelledby": ariaLabelledBy,
3261
3373
  children: [
3262
- showToggle && /* @__PURE__ */ jsxs22(
3374
+ showToggle && /* @__PURE__ */ jsxs23(
3263
3375
  "div",
3264
3376
  {
3265
3377
  role: "tablist",
@@ -3294,8 +3406,8 @@ function DatePicker({
3294
3406
  ]
3295
3407
  }
3296
3408
  ),
3297
- /* @__PURE__ */ jsxs22(AriaCalendar, { className: "ddga-date-picker-calendar", "data-slot": "date-picker-calendar", children: [
3298
- /* @__PURE__ */ jsxs22("header", { className: "ddga-date-picker-calendar__header", children: [
3409
+ /* @__PURE__ */ jsxs23(AriaCalendar, { className: "ddga-date-picker-calendar", "data-slot": "date-picker-calendar", children: [
3410
+ /* @__PURE__ */ jsxs23("header", { className: "ddga-date-picker-calendar__header", children: [
3299
3411
  /* @__PURE__ */ jsx29(
3300
3412
  AriaButton,
3301
3413
  {
@@ -3323,7 +3435,7 @@ function DatePicker({
3323
3435
  }
3324
3436
  )
3325
3437
  ] }),
3326
- /* @__PURE__ */ jsxs22(AriaCalendarGrid, { className: "ddga-date-picker-calendar__grid", children: [
3438
+ /* @__PURE__ */ jsxs23(AriaCalendarGrid, { className: "ddga-date-picker-calendar__grid", children: [
3327
3439
  /* @__PURE__ */ jsx29(AriaCalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx29(AriaCalendarHeaderCell, { className: "ddga-date-picker-calendar__weekday", children: day }) }),
3328
3440
  /* @__PURE__ */ jsx29(AriaCalendarGridBody, { children: (date) => /* @__PURE__ */ jsx29(
3329
3441
  CalendarDayCell,
@@ -3347,7 +3459,7 @@ function DatePicker({
3347
3459
 
3348
3460
  // src/components/FileUpload/FileUpload.tsx
3349
3461
  import { useRef, useState as useState5 } from "react";
3350
- import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
3462
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
3351
3463
  function matchesAccept(file, accept) {
3352
3464
  if (!accept) return true;
3353
3465
  const tokens = accept.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
@@ -3451,12 +3563,12 @@ function FileUpload({
3451
3563
  setIsDragging(false);
3452
3564
  }
3453
3565
  }
3454
- return /* @__PURE__ */ jsxs23("div", { "data-slot": "file-upload-field", className: cn("ddga-field", "ddga-file-upload", className), children: [
3455
- label && /* @__PURE__ */ jsxs23("label", { htmlFor: fieldId, className: "ddga-file-upload__label", children: [
3566
+ return /* @__PURE__ */ jsxs24("div", { "data-slot": "file-upload-field", className: cn("ddga-field", "ddga-file-upload", className), children: [
3567
+ label && /* @__PURE__ */ jsxs24("label", { htmlFor: fieldId, className: "ddga-file-upload__label", children: [
3456
3568
  label,
3457
3569
  required && /* @__PURE__ */ jsx30("span", { "aria-hidden": "true", className: "ddga-file-upload__required", children: "*" })
3458
3570
  ] }),
3459
- /* @__PURE__ */ jsxs23(
3571
+ /* @__PURE__ */ jsxs24(
3460
3572
  "div",
3461
3573
  {
3462
3574
  "data-slot": "file-upload-dropzone",
@@ -3499,7 +3611,7 @@ function FileUpload({
3499
3611
  hasHelper && /* @__PURE__ */ jsx30(FieldMessage, { id: helperId, variant: "helper", children: helperText }),
3500
3612
  files.length > 0 && /* @__PURE__ */ jsx30("ul", { "data-slot": "file-upload-list", className: "ddga-file-upload__list", children: files.map((item) => {
3501
3613
  const status = item.status ?? "pending";
3502
- return /* @__PURE__ */ jsxs23(
3614
+ return /* @__PURE__ */ jsxs24(
3503
3615
  "li",
3504
3616
  {
3505
3617
  "data-slot": "file-upload-item",
@@ -3507,8 +3619,8 @@ function FileUpload({
3507
3619
  className: "ddga-file-upload__item",
3508
3620
  children: [
3509
3621
  /* @__PURE__ */ jsx30("span", { className: "ddga-file-upload__item-icon", "aria-hidden": "true", children: status === "success" ? /* @__PURE__ */ jsx30(Check, {}) : status === "error" ? /* @__PURE__ */ jsx30(AlertCircle, {}) : /* @__PURE__ */ jsx30(Upload, {}) }),
3510
- /* @__PURE__ */ jsxs23("div", { className: "ddga-file-upload__item-main", children: [
3511
- /* @__PURE__ */ jsxs23("div", { className: "ddga-file-upload__item-head", children: [
3622
+ /* @__PURE__ */ jsxs24("div", { className: "ddga-file-upload__item-main", children: [
3623
+ /* @__PURE__ */ jsxs24("div", { className: "ddga-file-upload__item-head", children: [
3512
3624
  /* @__PURE__ */ jsx30("span", { className: "ddga-file-upload__item-name", title: item.file.name, children: item.file.name }),
3513
3625
  /* @__PURE__ */ jsx30("span", { className: "ddga-file-upload__item-meta", children: formatBytes(item.file.size) })
3514
3626
  ] }),
@@ -3547,7 +3659,7 @@ function FileUpload({
3547
3659
  import { useId as useId4 } from "react";
3548
3660
  import { Slider as SliderPrimitive } from "radix-ui";
3549
3661
  import { cva as cva28 } from "class-variance-authority";
3550
- import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
3662
+ import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
3551
3663
  var sliderVariants = cva28("ddga-slider", {
3552
3664
  variants: {
3553
3665
  size: {
@@ -3603,12 +3715,12 @@ function Slider({
3603
3715
  const wrap = (next) => isRange ? next : next[0];
3604
3716
  const currentForRender = valueArray ?? defaultArray;
3605
3717
  const fmt = (n) => formatValue ? formatValue(n) : String(n);
3606
- return /* @__PURE__ */ jsxs24("div", { "data-slot": "slider-field", className: "ddga-field", children: [
3607
- (label || showValue) && /* @__PURE__ */ jsxs24("div", { className: "ddga-slider__header", children: [
3718
+ return /* @__PURE__ */ jsxs25("div", { "data-slot": "slider-field", className: "ddga-field", children: [
3719
+ (label || showValue) && /* @__PURE__ */ jsxs25("div", { className: "ddga-slider__header", children: [
3608
3720
  label && /* @__PURE__ */ jsx31("span", { id: labelId, className: "ddga-slider__label", children: label }),
3609
3721
  showValue && /* @__PURE__ */ jsx31("span", { className: "ddga-slider__value", "aria-hidden": "true", children: currentForRender.map(fmt).join(" \u2013 ") })
3610
3722
  ] }),
3611
- /* @__PURE__ */ jsxs24(
3723
+ /* @__PURE__ */ jsxs25(
3612
3724
  SliderPrimitive.Root,
3613
3725
  {
3614
3726
  ...props,
@@ -3647,7 +3759,7 @@ function Slider({
3647
3759
  // src/components/NumberInput/NumberInput.tsx
3648
3760
  import { useState as useState6 } from "react";
3649
3761
  import { cva as cva29 } from "class-variance-authority";
3650
- import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
3762
+ import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
3651
3763
  var numberInputVariants = cva29("ddga-number-input", {
3652
3764
  variants: {
3653
3765
  size: {
@@ -3757,12 +3869,12 @@ function NumberInput({
3757
3869
  }
3758
3870
  const atMin = min != null && numericValue != null && numericValue <= min;
3759
3871
  const atMax = max != null && numericValue != null && numericValue >= max;
3760
- return /* @__PURE__ */ jsxs25("div", { "data-slot": "number-input-field", className: "ddga-field", children: [
3761
- label && /* @__PURE__ */ jsxs25("label", { htmlFor: fieldId, className: "ddga-number-input__label", children: [
3872
+ return /* @__PURE__ */ jsxs26("div", { "data-slot": "number-input-field", className: "ddga-field", children: [
3873
+ label && /* @__PURE__ */ jsxs26("label", { htmlFor: fieldId, className: "ddga-number-input__label", children: [
3762
3874
  label,
3763
3875
  required && /* @__PURE__ */ jsx32("span", { "aria-hidden": "true", className: "ddga-number-input__required", children: "*" })
3764
3876
  ] }),
3765
- /* @__PURE__ */ jsxs25(
3877
+ /* @__PURE__ */ jsxs26(
3766
3878
  "div",
3767
3879
  {
3768
3880
  "data-slot": "number-input-control",
@@ -3822,7 +3934,7 @@ function NumberInput({
3822
3934
  // src/components/Rating/Rating.tsx
3823
3935
  import { useRef as useRef2, useState as useState7 } from "react";
3824
3936
  import { cva as cva30 } from "class-variance-authority";
3825
- import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
3937
+ import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
3826
3938
  var ratingVariants = cva30("ddga-rating", {
3827
3939
  variants: {
3828
3940
  size: {
@@ -3931,7 +4043,7 @@ function Rating({
3931
4043
  }
3932
4044
  const stars = Array.from({ length: max }, (_, index) => {
3933
4045
  const level = fillFor(index, displayValue, allowHalf);
3934
- return /* @__PURE__ */ jsxs26(
4046
+ return /* @__PURE__ */ jsxs27(
3935
4047
  "span",
3936
4048
  {
3937
4049
  "data-slot": "rating-star",
@@ -3956,7 +4068,7 @@ function Rating({
3956
4068
  };
3957
4069
  const labelledBy = label ? `${fieldId}-label` : props["aria-labelledby"];
3958
4070
  const ariaLabel = labelledBy ? void 0 : props["aria-label"] ?? "Rating";
3959
- return /* @__PURE__ */ jsxs26("div", { "data-slot": "rating-field", className: "ddga-field", children: [
4071
+ return /* @__PURE__ */ jsxs27("div", { "data-slot": "rating-field", className: "ddga-field", children: [
3960
4072
  label && /* @__PURE__ */ jsx33("span", { id: `${fieldId}-label`, className: "ddga-rating__label", children: label }),
3961
4073
  readOnly ? /* @__PURE__ */ jsx33("div", { ...sharedProps, role: "img", "aria-label": formatValueText(currentValue, max), children: stars }) : /* @__PURE__ */ jsx33(
3962
4074
  "div",
@@ -4119,7 +4231,7 @@ function DescriptionDetails({ className, ...props }) {
4119
4231
  import "react";
4120
4232
  import { Slot as SlotPrimitive9 } from "radix-ui";
4121
4233
  import { cva as cva33 } from "class-variance-authority";
4122
- import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
4234
+ import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs28 } from "react/jsx-runtime";
4123
4235
  var emptyStateVariants = cva33("ddga-empty-state", {
4124
4236
  variants: {
4125
4237
  variant: {
@@ -4166,11 +4278,11 @@ function EmptyState({
4166
4278
  "data-size": size ?? "md",
4167
4279
  className: cn(emptyStateVariants({ variant, size }), className),
4168
4280
  ...props,
4169
- children: children ?? /* @__PURE__ */ jsxs27(Fragment3, { children: [
4281
+ children: children ?? /* @__PURE__ */ jsxs28(Fragment5, { children: [
4170
4282
  resolvedIcon ? /* @__PURE__ */ jsx36(EmptyStateMedia, { children: resolvedIcon }) : null,
4171
4283
  title ? /* @__PURE__ */ jsx36(EmptyStateTitle, { children: title }) : null,
4172
4284
  description ? /* @__PURE__ */ jsx36(EmptyStateDescription, { children: description }) : null,
4173
- action || secondaryAction ? /* @__PURE__ */ jsxs27(EmptyStateActions, { children: [
4285
+ action || secondaryAction ? /* @__PURE__ */ jsxs28(EmptyStateActions, { children: [
4174
4286
  action,
4175
4287
  secondaryAction
4176
4288
  ] }) : null
@@ -4226,18 +4338,22 @@ function EmptyStateActions({ asChild, className, ...props }) {
4226
4338
  // src/components/Stat/Stat.tsx
4227
4339
  import "react";
4228
4340
  import { cva as cva34 } from "class-variance-authority";
4229
- import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
4341
+ import { jsx as jsx37, jsxs as jsxs29 } from "react/jsx-runtime";
4230
4342
  var statVariants = cva34("ddga-stat", {
4231
4343
  variants: {
4232
4344
  variant: {
4233
4345
  flat: "ddga-stat--flat",
4234
4346
  elevated: "ddga-stat--elevated",
4235
- accent: "ddga-stat--accent"
4347
+ accent: "ddga-stat--accent",
4348
+ // Soft sentiment-tinted gradient surface (reuses the accent tint vars).
4349
+ gradient: "ddga-stat--gradient"
4236
4350
  },
4237
4351
  size: {
4238
4352
  sm: "ddga-stat--sm",
4239
4353
  md: "ddga-stat--md",
4240
- lg: "ddga-stat--lg"
4354
+ lg: "ddga-stat--lg",
4355
+ // Hero/display size for headline KPIs (display-scale value).
4356
+ xl: "ddga-stat--xl"
4241
4357
  }
4242
4358
  },
4243
4359
  defaultVariants: {
@@ -4269,13 +4385,14 @@ function Stat({
4269
4385
  changeLabel,
4270
4386
  trend,
4271
4387
  sentiment,
4388
+ changeVariant,
4272
4389
  icon,
4273
4390
  className,
4274
4391
  children,
4275
4392
  ...props
4276
4393
  }) {
4277
4394
  const resolvedSentiment = resolveSentiment(trend, sentiment);
4278
- return /* @__PURE__ */ jsxs28(
4395
+ return /* @__PURE__ */ jsxs29(
4279
4396
  "div",
4280
4397
  {
4281
4398
  "data-slot": "stat",
@@ -4285,13 +4402,13 @@ function Stat({
4285
4402
  className: cn(statVariants({ variant, size }), className),
4286
4403
  ...props,
4287
4404
  children: [
4288
- label || icon ? /* @__PURE__ */ jsxs28("div", { className: "ddga-stat__label-row", children: [
4405
+ label || icon ? /* @__PURE__ */ jsxs29("div", { className: "ddga-stat__label-row", children: [
4289
4406
  label ? /* @__PURE__ */ jsx37(StatLabel, { children: label }) : null,
4290
4407
  icon ? /* @__PURE__ */ jsx37("span", { className: "ddga-stat__icon", "aria-hidden": "true", children: icon }) : null
4291
4408
  ] }) : null,
4292
4409
  value ? /* @__PURE__ */ jsx37(StatValue, { children: value }) : null,
4293
- change || changeLabel ? /* @__PURE__ */ jsxs28("div", { className: "ddga-stat__change-row", children: [
4294
- change ? /* @__PURE__ */ jsx37(StatChange, { trend, sentiment, children: change }) : null,
4410
+ change || changeLabel ? /* @__PURE__ */ jsxs29("div", { className: "ddga-stat__change-row", children: [
4411
+ change ? /* @__PURE__ */ jsx37(StatChange, { trend, sentiment, variant: changeVariant, children: change }) : null,
4295
4412
  changeLabel ? /* @__PURE__ */ jsx37("span", { className: "ddga-stat__change-label", children: changeLabel }) : null
4296
4413
  ] }) : null,
4297
4414
  children
@@ -4305,9 +4422,12 @@ function StatLabel({ className, ...props }) {
4305
4422
  function StatValue({ className, ...props }) {
4306
4423
  return /* @__PURE__ */ jsx37("div", { "data-slot": "stat-value", className: cn("ddga-stat__value", className), ...props });
4307
4424
  }
4308
- function StatChange({ trend, sentiment, className, children, ...props }) {
4425
+ function StatChart({ className, ...props }) {
4426
+ return /* @__PURE__ */ jsx37("div", { "data-slot": "stat-chart", className: cn("ddga-stat__chart", className), ...props });
4427
+ }
4428
+ function StatChange({ trend, sentiment, variant, className, children, ...props }) {
4309
4429
  const resolvedSentiment = resolveSentiment(trend, sentiment);
4310
- return /* @__PURE__ */ jsxs28(
4430
+ return /* @__PURE__ */ jsxs29(
4311
4431
  "div",
4312
4432
  {
4313
4433
  "data-slot": "stat-change",
@@ -4316,6 +4436,7 @@ function StatChange({ trend, sentiment, className, children, ...props }) {
4316
4436
  className: cn(
4317
4437
  "ddga-stat__change",
4318
4438
  resolvedSentiment ? `ddga-stat__change--${resolvedSentiment}` : null,
4439
+ variant === "chip" && "ddga-stat__change--chip",
4319
4440
  className
4320
4441
  ),
4321
4442
  ...props,
@@ -4367,7 +4488,7 @@ function StatGroup({ orientation, gap, columns, className, style, ...props }) {
4367
4488
  import { useContext as useContext9 } from "react";
4368
4489
  import { Popover as PopoverPrimitive2 } from "radix-ui";
4369
4490
  import { cva as cva36 } from "class-variance-authority";
4370
- import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
4491
+ import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
4371
4492
  var popoverContentVariants = cva36("ddga-popover", {
4372
4493
  variants: {
4373
4494
  size: {
@@ -4403,7 +4524,7 @@ function PopoverContent({
4403
4524
  }
4404
4525
  const ctx = useContext9(DgaContext);
4405
4526
  const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
4406
- return /* @__PURE__ */ jsx39(PopoverPrimitive2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs29(
4527
+ return /* @__PURE__ */ jsx39(PopoverPrimitive2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs30(
4407
4528
  PopoverPrimitive2.Content,
4408
4529
  {
4409
4530
  "data-slot": "popover-content",
@@ -4723,7 +4844,7 @@ function useDir() {
4723
4844
  }
4724
4845
 
4725
4846
  // src/components/Sidebar/SidebarMenu.tsx
4726
- import { jsx as jsx42, jsxs as jsxs30 } from "react/jsx-runtime";
4847
+ import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
4727
4848
  function SidebarMenu({ className, ...props }) {
4728
4849
  return /* @__PURE__ */ jsx42("ul", { "data-slot": "sidebar-menu", className: cn("ddga-sidebar__menu", className), ...props });
4729
4850
  }
@@ -4773,7 +4894,7 @@ function SidebarMenuButton({
4773
4894
  if (!tooltip || state !== "collapsed" || isMobile) {
4774
4895
  return button;
4775
4896
  }
4776
- return /* @__PURE__ */ jsxs30(Tooltip, { children: [
4897
+ return /* @__PURE__ */ jsxs31(Tooltip, { children: [
4777
4898
  /* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx42("span", { "data-slot": "tooltip-trigger", style: { display: "contents" }, children: button }) }),
4778
4899
  /* @__PURE__ */ jsx42(TooltipContent, { side: dir === "rtl" ? "left" : "right", children: tooltip })
4779
4900
  ] });
@@ -4802,7 +4923,7 @@ function SidebarMenuBadge({ className, ...props }) {
4802
4923
  );
4803
4924
  }
4804
4925
  function SidebarMenuSkeleton({ showIcon, className, ...props }) {
4805
- return /* @__PURE__ */ jsxs30(
4926
+ return /* @__PURE__ */ jsxs31(
4806
4927
  "div",
4807
4928
  {
4808
4929
  "data-slot": "sidebar-menu-skeleton",
@@ -4868,7 +4989,7 @@ function SidebarMenuSubButton({
4868
4989
  // src/components/ScrollArea/ScrollArea.tsx
4869
4990
  import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
4870
4991
  import { cva as cva38 } from "class-variance-authority";
4871
- import { jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
4992
+ import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
4872
4993
  var scrollAreaVariants = cva38("ddga-scroll-area", {
4873
4994
  variants: {
4874
4995
  orientation: {
@@ -4905,7 +5026,7 @@ function ScrollArea({
4905
5026
  const showVertical = orientation === "vertical" || orientation === "both";
4906
5027
  const showHorizontal = orientation === "horizontal" || orientation === "both";
4907
5028
  const { className: viewportClassName, ...restViewportProps } = viewportProps ?? {};
4908
- return /* @__PURE__ */ jsxs31(
5029
+ return /* @__PURE__ */ jsxs32(
4909
5030
  ScrollAreaPrimitive.Root,
4910
5031
  {
4911
5032
  "data-slot": "scroll-area",
@@ -4956,7 +5077,7 @@ function ScrollArea({
4956
5077
  import { useContext as useContext11 } from "react";
4957
5078
  import { Menubar as MenubarPrimitive } from "radix-ui";
4958
5079
  import { cva as cva39 } from "class-variance-authority";
4959
- import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
5080
+ import { jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
4960
5081
  var menubarContentVariants = cva39("ddga-menubar-menu", {
4961
5082
  variants: {
4962
5083
  size: {
@@ -5024,7 +5145,7 @@ function MenubarItem({
5024
5145
  children,
5025
5146
  ...props
5026
5147
  }) {
5027
- return /* @__PURE__ */ jsxs32(
5148
+ return /* @__PURE__ */ jsxs33(
5028
5149
  MenubarPrimitive.Item,
5029
5150
  {
5030
5151
  "data-slot": "menubar-item",
@@ -5048,7 +5169,7 @@ function MenubarCheckboxItem({
5048
5169
  const handleSelect = onSelect ?? ((event) => {
5049
5170
  event.preventDefault();
5050
5171
  });
5051
- return /* @__PURE__ */ jsxs32(
5172
+ return /* @__PURE__ */ jsxs33(
5052
5173
  MenubarPrimitive.CheckboxItem,
5053
5174
  {
5054
5175
  "data-slot": "menubar-checkbox-item",
@@ -5069,7 +5190,7 @@ function MenubarRadioItem({ className, children, onSelect, ...props }) {
5069
5190
  const handleSelect = onSelect ?? ((event) => {
5070
5191
  event.preventDefault();
5071
5192
  });
5072
- return /* @__PURE__ */ jsxs32(
5193
+ return /* @__PURE__ */ jsxs33(
5073
5194
  MenubarPrimitive.RadioItem,
5074
5195
  {
5075
5196
  "data-slot": "menubar-radio-item",
@@ -5110,7 +5231,7 @@ function MenubarSub(props) {
5110
5231
  return /* @__PURE__ */ jsx44(MenubarPrimitive.Sub, { ...props });
5111
5232
  }
5112
5233
  function MenubarSubTrigger({ className, startIcon, children, ...props }) {
5113
- return /* @__PURE__ */ jsxs32(
5234
+ return /* @__PURE__ */ jsxs33(
5114
5235
  MenubarPrimitive.SubTrigger,
5115
5236
  {
5116
5237
  "data-slot": "menubar-sub-trigger",
@@ -5227,44 +5348,1105 @@ function TimelineTime({ className, ...props }) {
5227
5348
  return /* @__PURE__ */ jsx45("time", { "data-slot": "timeline-time", className: cn("ddga-timeline__time", className), ...props });
5228
5349
  }
5229
5350
 
5230
- // src/providers/DgaProvider.tsx
5231
- import { useState as useState10, useMemo as useMemo4, useContext as useContext12, useEffect as useEffect3, useRef as useRef3 } from "react";
5232
- import { Direction as DirectionPrimitive, Tooltip as TooltipPrimitive2 } from "radix-ui";
5233
- import { buildTheme } from "@dev-dga/tokens";
5234
- import { jsx as jsx46 } from "react/jsx-runtime";
5235
- function DgaProvider({
5236
- dir = "ltr",
5237
- locale,
5238
- mode = "light",
5239
- theme,
5240
- as: Component = "div",
5351
+ // src/components/Command/Command.tsx
5352
+ import { useCallback as useCallback4, useContext as useContext12, useEffect as useEffect3, useRef as useRef3, useState as useState10 } from "react";
5353
+ import { Command as CommandPrimitive } from "cmdk";
5354
+ import { Dialog as DialogPrimitive3, VisuallyHidden } from "radix-ui";
5355
+ import { cva as cva41 } from "class-variance-authority";
5356
+ import { jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
5357
+ var commandVariants = cva41("ddga-command");
5358
+ function Command2({ className, ...props }) {
5359
+ return /* @__PURE__ */ jsx46(CommandPrimitive, { "data-slot": "command", className: cn(commandVariants(), className), ...props });
5360
+ }
5361
+ function CommandInput({
5241
5362
  className,
5242
- style: consumerStyle,
5363
+ placeholder,
5364
+ "aria-label": ariaLabel,
5365
+ ...props
5366
+ }) {
5367
+ return /* @__PURE__ */ jsxs34("div", { className: "ddga-command__input-wrapper", "data-slot": "command-input-wrapper", children: [
5368
+ /* @__PURE__ */ jsx46(Search, { className: "ddga-command__search-icon", "aria-hidden": "true" }),
5369
+ /* @__PURE__ */ jsx46(
5370
+ CommandPrimitive.Input,
5371
+ {
5372
+ "data-slot": "command-input",
5373
+ className: cn("ddga-command__input", className),
5374
+ placeholder,
5375
+ "aria-label": ariaLabel ?? (typeof placeholder === "string" ? placeholder : void 0),
5376
+ ...props
5377
+ }
5378
+ )
5379
+ ] });
5380
+ }
5381
+ function CommandList({ className, ...props }) {
5382
+ return /* @__PURE__ */ jsx46(
5383
+ CommandPrimitive.List,
5384
+ {
5385
+ "data-slot": "command-list",
5386
+ className: cn("ddga-command__list", className),
5387
+ ...props
5388
+ }
5389
+ );
5390
+ }
5391
+ function CommandEmpty({ className, ...props }) {
5392
+ return /* @__PURE__ */ jsx46(
5393
+ CommandPrimitive.Empty,
5394
+ {
5395
+ "data-slot": "command-empty",
5396
+ className: cn("ddga-command__empty", className),
5397
+ ...props
5398
+ }
5399
+ );
5400
+ }
5401
+ function CommandGroup({ className, ...props }) {
5402
+ return /* @__PURE__ */ jsx46(
5403
+ CommandPrimitive.Group,
5404
+ {
5405
+ "data-slot": "command-group",
5406
+ className: cn("ddga-command__group", className),
5407
+ ...props
5408
+ }
5409
+ );
5410
+ }
5411
+ function CommandSeparator({
5412
+ className,
5413
+ "aria-hidden": ariaHidden = true,
5414
+ ...props
5415
+ }) {
5416
+ return /* @__PURE__ */ jsx46(
5417
+ CommandPrimitive.Separator,
5418
+ {
5419
+ "aria-hidden": ariaHidden,
5420
+ "data-slot": "command-separator",
5421
+ className: cn("ddga-command__separator", className),
5422
+ ...props
5423
+ }
5424
+ );
5425
+ }
5426
+ function CommandItem({
5427
+ startIcon,
5428
+ shortcut,
5429
+ className,
5430
+ children,
5431
+ keywords,
5432
+ ...props
5433
+ }) {
5434
+ const labelText = typeof children === "string" ? children : void 0;
5435
+ const mergedKeywords = labelText && !keywords?.includes(labelText) ? [...keywords ?? [], labelText] : keywords;
5436
+ return /* @__PURE__ */ jsxs34(
5437
+ CommandPrimitive.Item,
5438
+ {
5439
+ "data-slot": "command-item",
5440
+ className: cn("ddga-command__item", className),
5441
+ keywords: mergedKeywords,
5442
+ ...props,
5443
+ children: [
5444
+ startIcon != null && /* @__PURE__ */ jsx46("span", { className: "ddga-command__item-icon", "aria-hidden": "true", children: startIcon }),
5445
+ /* @__PURE__ */ jsx46("span", { className: "ddga-command__item-label", children }),
5446
+ shortcut != null && /* @__PURE__ */ jsx46("span", { className: "ddga-command__item-shortcut", children: shortcut })
5447
+ ]
5448
+ }
5449
+ );
5450
+ }
5451
+ function CommandDialog({
5452
+ open: controlledOpen,
5453
+ defaultOpen,
5454
+ onOpenChange,
5455
+ shortcut = "k",
5456
+ label = "Command palette",
5457
+ description,
5458
+ className,
5459
+ filter,
5460
+ shouldFilter,
5461
+ loop,
5243
5462
  children
5244
5463
  }) {
5245
- const parentCtx = useContext12(DgaContext);
5246
- const isNested = parentCtx !== null;
5247
- const [rootEl, setRootEl] = useState10(null);
5248
- const portalRef = useRef3(null);
5249
- const [portalEl, setPortalEl] = useState10(null);
5250
- const resolvedLocale = locale ?? (dir === "rtl" ? "ar" : "en");
5251
- const themeVars = useMemo4(() => theme ? buildTheme(theme) : null, [theme]);
5464
+ const [internalOpen, setInternalOpen] = useState10(defaultOpen ?? false);
5465
+ const isControlled = controlledOpen !== void 0;
5466
+ const open = isControlled ? controlledOpen : internalOpen;
5467
+ const setOpen = useCallback4(
5468
+ (next) => {
5469
+ if (!isControlled) setInternalOpen(next);
5470
+ onOpenChange?.(next);
5471
+ },
5472
+ [isControlled, onOpenChange]
5473
+ );
5474
+ const openRef = useRef3(open);
5252
5475
  useEffect3(() => {
5253
- if (typeof document === "undefined") return;
5254
- const el = document.createElement("div");
5255
- el.setAttribute("data-slot", "dga-portal");
5256
- el.style.position = "relative";
5257
- el.style.zIndex = "50";
5258
- document.body.appendChild(el);
5259
- portalRef.current = el;
5260
- setPortalEl(el);
5261
- return () => {
5262
- el.remove();
5263
- portalRef.current = null;
5264
- setPortalEl(null);
5265
- };
5266
- }, []);
5476
+ openRef.current = open;
5477
+ });
5267
5478
  useEffect3(() => {
5479
+ if (typeof shortcut !== "string") return;
5480
+ const key = shortcut.toLowerCase();
5481
+ const onKeyDown = (event) => {
5482
+ if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === key) {
5483
+ event.preventDefault();
5484
+ setOpen(!openRef.current);
5485
+ }
5486
+ };
5487
+ document.addEventListener("keydown", onKeyDown);
5488
+ return () => document.removeEventListener("keydown", onKeyDown);
5489
+ }, [shortcut, setOpen]);
5490
+ const ctx = useContext12(DgaContext);
5491
+ const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
5492
+ return /* @__PURE__ */ jsx46(DialogPrimitive3.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs34(DialogPrimitive3.Portal, { container: portalContainer, children: [
5493
+ /* @__PURE__ */ jsx46(DialogPrimitive3.Overlay, { className: "ddga-command__overlay", "data-slot": "command-overlay" }),
5494
+ /* @__PURE__ */ jsxs34(
5495
+ DialogPrimitive3.Content,
5496
+ {
5497
+ "data-slot": "command-dialog",
5498
+ className: cn("ddga-command-dialog", className),
5499
+ ...description == null ? { "aria-describedby": void 0 } : {},
5500
+ children: [
5501
+ /* @__PURE__ */ jsx46(DialogPrimitive3.Title, { asChild: true, children: /* @__PURE__ */ jsx46(VisuallyHidden.Root, { children: label }) }),
5502
+ description != null && /* @__PURE__ */ jsx46(DialogPrimitive3.Description, { asChild: true, children: /* @__PURE__ */ jsx46(VisuallyHidden.Root, { children: description }) }),
5503
+ /* @__PURE__ */ jsx46(
5504
+ Command2,
5505
+ {
5506
+ "data-slot": "command-dialog-command",
5507
+ className: "ddga-command--dialog",
5508
+ label: typeof label === "string" ? label : "Command palette",
5509
+ filter,
5510
+ shouldFilter,
5511
+ loop,
5512
+ children
5513
+ }
5514
+ )
5515
+ ]
5516
+ }
5517
+ )
5518
+ ] }) });
5519
+ }
5520
+
5521
+ // src/components/Table/Table.tsx
5522
+ import { cva as cva42 } from "class-variance-authority";
5523
+ import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs35 } from "react/jsx-runtime";
5524
+ var tableVariants = cva42("ddga-table", {
5525
+ variants: {
5526
+ size: {
5527
+ sm: "ddga-table--sm",
5528
+ md: "ddga-table--md",
5529
+ lg: "ddga-table--lg"
5530
+ },
5531
+ striped: { true: "ddga-table--striped" },
5532
+ divided: { true: "ddga-table--divided" },
5533
+ bordered: { true: "ddga-table--bordered" },
5534
+ stickyHeader: { true: "ddga-table--sticky" }
5535
+ },
5536
+ defaultVariants: {
5537
+ size: "md"
5538
+ }
5539
+ });
5540
+ function Table({
5541
+ size,
5542
+ striped,
5543
+ divided,
5544
+ bordered,
5545
+ stickyHeader,
5546
+ className,
5547
+ maxHeight,
5548
+ "aria-label": ariaLabel,
5549
+ "aria-labelledby": ariaLabelledby,
5550
+ ...props
5551
+ }) {
5552
+ const named = Boolean(ariaLabel || ariaLabelledby);
5553
+ if (process.env.NODE_ENV !== "production" && !named) {
5554
+ console.warn(
5555
+ "[ddga] <Table> wraps its table in a horizontally scrollable container. Pass `aria-label` (or `aria-labelledby`) so keyboard and screen-reader users can identify and scroll it. Without a name it degrades to a plain scroll container with no landmark."
5556
+ );
5557
+ }
5558
+ if (process.env.NODE_ENV !== "production" && ariaLabel && ariaLabelledby) {
5559
+ console.warn(
5560
+ "[ddga] <Table> received both `aria-label` and `aria-labelledby`. `aria-labelledby` takes precedence; `aria-label` will be ignored by assistive technology."
5561
+ );
5562
+ }
5563
+ return /* @__PURE__ */ jsx47(
5564
+ "div",
5565
+ {
5566
+ "data-slot": "table-region",
5567
+ className: "ddga-table__region",
5568
+ style: maxHeight != null ? { maxBlockSize: maxHeight, overflowY: "auto" } : void 0,
5569
+ ...named ? {
5570
+ role: "region",
5571
+ tabIndex: 0,
5572
+ "aria-label": ariaLabel,
5573
+ "aria-labelledby": ariaLabelledby
5574
+ } : {},
5575
+ children: /* @__PURE__ */ jsx47(
5576
+ "table",
5577
+ {
5578
+ "data-slot": "table",
5579
+ className: cn(tableVariants({ size, striped, divided, bordered, stickyHeader }), className),
5580
+ ...props
5581
+ }
5582
+ )
5583
+ }
5584
+ );
5585
+ }
5586
+ function TableHeader({ className, ...props }) {
5587
+ return /* @__PURE__ */ jsx47("thead", { "data-slot": "table-header", className: cn("ddga-table__header", className), ...props });
5588
+ }
5589
+ function TableBody({ className, ...props }) {
5590
+ return /* @__PURE__ */ jsx47("tbody", { "data-slot": "table-body", className: cn("ddga-table__body", className), ...props });
5591
+ }
5592
+ function TableFooter({ className, ...props }) {
5593
+ return /* @__PURE__ */ jsx47("tfoot", { "data-slot": "table-footer", className: cn("ddga-table__footer", className), ...props });
5594
+ }
5595
+ function TableRow({ className, selected, ...props }) {
5596
+ return /* @__PURE__ */ jsx47(
5597
+ "tr",
5598
+ {
5599
+ "data-slot": "table-row",
5600
+ "data-state": selected ? "selected" : void 0,
5601
+ className: cn("ddga-table__row", className),
5602
+ ...props
5603
+ }
5604
+ );
5605
+ }
5606
+ function TableHead({
5607
+ className,
5608
+ align,
5609
+ sortable,
5610
+ sortDirection = false,
5611
+ sortLabel,
5612
+ onClick,
5613
+ children,
5614
+ ...props
5615
+ }) {
5616
+ const headClass = cn("ddga-table__head", align && `ddga-table__head--align-${align}`, className);
5617
+ if (process.env.NODE_ENV !== "production" && sortable && !sortLabel) {
5618
+ console.warn(
5619
+ '[ddga] <TableHead sortable> has no `sortLabel`. `aria-sort` conveys the sort state, but pass a localized cue (e.g. "activate to sort") so a focused sort button announces its action to screen-reader users.'
5620
+ );
5621
+ }
5622
+ if (!sortable) {
5623
+ return /* @__PURE__ */ jsx47("th", { scope: "col", "data-slot": "table-head", className: headClass, ...props, children });
5624
+ }
5625
+ const ariaSort = sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : "none";
5626
+ return /* @__PURE__ */ jsx47("th", { scope: "col", "data-slot": "table-head", "aria-sort": ariaSort, className: headClass, ...props, children: /* @__PURE__ */ jsxs35(
5627
+ "button",
5628
+ {
5629
+ type: "button",
5630
+ "data-slot": "table-sort-button",
5631
+ className: "ddga-table__sort-button",
5632
+ onClick,
5633
+ children: [
5634
+ children,
5635
+ sortLabel ? /* @__PURE__ */ jsx47("span", { className: "ddga-sr-only", children: sortLabel }) : null,
5636
+ /* @__PURE__ */ jsx47("span", { className: "ddga-table__sort-icon", "data-slot": "table-sort-icon", "aria-hidden": "true", children: sortDirection === "asc" ? /* @__PURE__ */ jsx47(CaretUp, {}) : sortDirection === "desc" ? /* @__PURE__ */ jsx47(CaretDown, {}) : (
5637
+ // Neutral affordance: stacked carets, dimmed via CSS.
5638
+ /* @__PURE__ */ jsxs35(Fragment6, { children: [
5639
+ /* @__PURE__ */ jsx47(CaretUp, {}),
5640
+ /* @__PURE__ */ jsx47(CaretDown, {})
5641
+ ] })
5642
+ ) })
5643
+ ]
5644
+ }
5645
+ ) });
5646
+ }
5647
+ function TableCell({ className, align, ...props }) {
5648
+ return /* @__PURE__ */ jsx47(
5649
+ "td",
5650
+ {
5651
+ "data-slot": "table-cell",
5652
+ className: cn("ddga-table__cell", align && `ddga-table__cell--align-${align}`, className),
5653
+ ...props
5654
+ }
5655
+ );
5656
+ }
5657
+ function TableCaption({ className, ...props }) {
5658
+ return /* @__PURE__ */ jsx47(
5659
+ "caption",
5660
+ {
5661
+ "data-slot": "table-caption",
5662
+ className: cn("ddga-table__caption", className),
5663
+ ...props
5664
+ }
5665
+ );
5666
+ }
5667
+
5668
+ // src/components/InputOTP/InputOTP.tsx
5669
+ import { useMemo as useMemo4, useRef as useRef4, useState as useState11, Fragment as Fragment7 } from "react";
5670
+ import { cva as cva43 } from "class-variance-authority";
5671
+ import { jsx as jsx48, jsxs as jsxs36 } from "react/jsx-runtime";
5672
+ var DEFAULT_PATTERN = "^[0-9]*$";
5673
+ var inputOTPVariants = cva43("ddga-input-otp", {
5674
+ variants: {
5675
+ size: {
5676
+ sm: "ddga-input-otp--sm",
5677
+ md: "ddga-input-otp--md",
5678
+ lg: "ddga-input-otp--lg"
5679
+ },
5680
+ error: {
5681
+ true: "ddga-input-otp--error"
5682
+ }
5683
+ },
5684
+ defaultVariants: {
5685
+ size: "md"
5686
+ }
5687
+ });
5688
+ function resolveGroups(length, groupSizes) {
5689
+ if (!groupSizes || groupSizes.length === 0) return [length];
5690
+ const sum = groupSizes.reduce((total, n) => total + n, 0);
5691
+ if (sum !== length) {
5692
+ if (process.env.NODE_ENV === "development") {
5693
+ console.warn(
5694
+ `[@dev-dga/react] InputOTP: groupSizes must sum to length (${length}); got ${sum}. Falling back to a single group.`
5695
+ );
5696
+ }
5697
+ return [length];
5698
+ }
5699
+ return groupSizes;
5700
+ }
5701
+ function Slot({
5702
+ char,
5703
+ active,
5704
+ caret,
5705
+ mask
5706
+ }) {
5707
+ return /* @__PURE__ */ jsxs36(
5708
+ "div",
5709
+ {
5710
+ "data-slot": "input-otp-slot",
5711
+ "data-active": active || void 0,
5712
+ "data-filled": char != null || void 0,
5713
+ className: "ddga-input-otp__slot",
5714
+ children: [
5715
+ char != null ? mask ? "\u2022" : char : null,
5716
+ caret && /* @__PURE__ */ jsx48("div", { "aria-hidden": "true", "data-slot": "input-otp-caret", className: "ddga-input-otp__caret" })
5717
+ ]
5718
+ }
5719
+ );
5720
+ }
5721
+ function InputOTP({
5722
+ id: externalId,
5723
+ length = 6,
5724
+ groupSizes,
5725
+ value,
5726
+ defaultValue,
5727
+ onChange,
5728
+ onComplete,
5729
+ pattern = DEFAULT_PATTERN,
5730
+ mask = false,
5731
+ separator,
5732
+ size,
5733
+ disabled,
5734
+ autoFocus,
5735
+ name,
5736
+ required,
5737
+ label,
5738
+ helperText,
5739
+ errorMessage,
5740
+ error,
5741
+ className,
5742
+ "aria-label": ariaLabel,
5743
+ "aria-labelledby": ariaLabelledby,
5744
+ ...props
5745
+ }) {
5746
+ const inputRef = useRef4(null);
5747
+ const [focused, setFocused] = useState11(false);
5748
+ const isControlled = value !== void 0;
5749
+ const [internal, setInternal] = useState11(defaultValue ?? "");
5750
+ const current = isControlled ? value : internal;
5751
+ const compiledPattern = useMemo4(() => {
5752
+ try {
5753
+ return new RegExp(pattern);
5754
+ } catch {
5755
+ if (process.env.NODE_ENV === "development") {
5756
+ console.warn(
5757
+ `[@dev-dga/react] InputOTP: invalid \`pattern\` regex "${pattern}". Falling back to digits-only.`
5758
+ );
5759
+ }
5760
+ return new RegExp(DEFAULT_PATTERN);
5761
+ }
5762
+ }, [pattern]);
5763
+ const completedRef = useRef4(null);
5764
+ const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
5765
+ name: "InputOTP",
5766
+ id: externalId,
5767
+ label,
5768
+ error,
5769
+ errorMessage,
5770
+ helperText,
5771
+ "aria-label": ariaLabel,
5772
+ "aria-labelledby": ariaLabelledby
5773
+ });
5774
+ function handleChange(event) {
5775
+ const next = event.target.value.replace(/[\s-]/g, "").slice(0, length);
5776
+ if (!compiledPattern.test(next)) return;
5777
+ if (!isControlled) setInternal(next);
5778
+ onChange?.(next);
5779
+ if (next.length === length) {
5780
+ if (completedRef.current !== next) {
5781
+ completedRef.current = next;
5782
+ onComplete?.(next);
5783
+ }
5784
+ } else {
5785
+ completedRef.current = null;
5786
+ }
5787
+ }
5788
+ function moveCaretToEnd() {
5789
+ const el = inputRef.current;
5790
+ if (el) el.setSelectionRange(el.value.length, el.value.length);
5791
+ }
5792
+ const groups = resolveGroups(length, groupSizes);
5793
+ const lastGroup = groups.length - 1;
5794
+ const activeIndex = focused ? Math.min(current.length, length - 1) : -1;
5795
+ const inputMode = pattern === DEFAULT_PATTERN ? "numeric" : "text";
5796
+ return /* @__PURE__ */ jsxs36("div", { "data-slot": "input-otp-field", className: "ddga-field", ...props, children: [
5797
+ label && /* @__PURE__ */ jsxs36("label", { htmlFor: fieldId, className: "ddga-input-otp__label", children: [
5798
+ label,
5799
+ required && /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", className: "ddga-input-otp__required", children: "*" })
5800
+ ] }),
5801
+ /* @__PURE__ */ jsxs36(
5802
+ "div",
5803
+ {
5804
+ className: cn(inputOTPVariants({ size, error: hasError }), className),
5805
+ "data-slot": "input-otp",
5806
+ children: [
5807
+ /* @__PURE__ */ jsx48(
5808
+ "input",
5809
+ {
5810
+ ...controlProps,
5811
+ ref: inputRef,
5812
+ type: "text",
5813
+ inputMode,
5814
+ autoComplete: "one-time-code",
5815
+ value: current,
5816
+ maxLength: length,
5817
+ disabled,
5818
+ autoFocus,
5819
+ name,
5820
+ required,
5821
+ "aria-label": ariaLabel,
5822
+ "aria-labelledby": ariaLabelledby,
5823
+ onChange: handleChange,
5824
+ onFocus: () => {
5825
+ setFocused(true);
5826
+ moveCaretToEnd();
5827
+ },
5828
+ onBlur: () => setFocused(false),
5829
+ onPointerUp: moveCaretToEnd,
5830
+ className: "ddga-input-otp__input",
5831
+ "data-slot": "input-otp-input"
5832
+ }
5833
+ ),
5834
+ /* @__PURE__ */ jsx48("div", { dir: "ltr", "aria-hidden": "true", "data-slot": "input-otp-row", className: "ddga-input-otp__row", children: groups.map((count, groupIndex) => {
5835
+ const start = groups.slice(0, groupIndex).reduce((total, n) => total + n, 0);
5836
+ return /* @__PURE__ */ jsxs36(Fragment7, { children: [
5837
+ /* @__PURE__ */ jsx48("div", { "data-slot": "input-otp-group", className: "ddga-input-otp__group", children: Array.from({ length: count }, (_, offset) => {
5838
+ const index = start + offset;
5839
+ return /* @__PURE__ */ jsx48(
5840
+ Slot,
5841
+ {
5842
+ char: current[index],
5843
+ active: index === activeIndex,
5844
+ caret: index === activeIndex && current.length < length,
5845
+ mask
5846
+ },
5847
+ index
5848
+ );
5849
+ }) }),
5850
+ groupIndex < lastGroup && /* @__PURE__ */ jsx48(
5851
+ "span",
5852
+ {
5853
+ "aria-hidden": "true",
5854
+ "data-slot": "input-otp-separator",
5855
+ className: "ddga-input-otp__separator",
5856
+ children: separator ?? /* @__PURE__ */ jsx48("span", { className: "ddga-input-otp__separator-dash" })
5857
+ }
5858
+ )
5859
+ ] }, groupIndex);
5860
+ }) })
5861
+ ]
5862
+ }
5863
+ ),
5864
+ hasErrorMessage && /* @__PURE__ */ jsx48(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
5865
+ hasHelper && /* @__PURE__ */ jsx48(FieldMessage, { id: helperId, variant: "helper", children: helperText })
5866
+ ] });
5867
+ }
5868
+
5869
+ // src/components/Link/Link.tsx
5870
+ import "react";
5871
+ import { Slot as SlotPrimitive13 } from "radix-ui";
5872
+ import { cva as cva44 } from "class-variance-authority";
5873
+ import { jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
5874
+ var linkVariants = cva44("ddga-link", {
5875
+ variants: {
5876
+ variant: {
5877
+ // Inline links in running prose. Underlined always — color alone fails
5878
+ // WCAG 1.4.1 when a link sits inside a block of text.
5879
+ default: "ddga-link--default",
5880
+ // Links in UI chrome (footers, meta rows) where context makes them
5881
+ // obviously links: no underline until hover.
5882
+ subtle: "ddga-link--subtle",
5883
+ // Block-level CTAs ("Learn more →"): inline-flex with gapped icons,
5884
+ // no underline. Not for mid-sentence use.
5885
+ standalone: "ddga-link--standalone"
5886
+ }
5887
+ },
5888
+ defaultVariants: {
5889
+ variant: "default"
5890
+ }
5891
+ });
5892
+ function Link({
5893
+ variant,
5894
+ external,
5895
+ startIcon,
5896
+ endIcon,
5897
+ iconFlip,
5898
+ asChild,
5899
+ className,
5900
+ children,
5901
+ rel,
5902
+ ...props
5903
+ }) {
5904
+ if (process.env.NODE_ENV === "development" && !asChild && props.href == null) {
5905
+ console.warn(
5906
+ '[@dev-dga/react] Link rendered without an `href`. A link needs an href to be focusable and exposed as a link to assistive tech. Provide `href`, use `asChild` to render your own element (e.g. a router Link), or use `Button variant="ghost"` for an action that is not navigation.'
5907
+ );
5908
+ }
5909
+ const Comp = asChild ? SlotPrimitive13.Slot : "a";
5910
+ const relValue = external ? Array.from(
5911
+ /* @__PURE__ */ new Set([...rel ? rel.split(/\s+/).filter(Boolean) : [], "noopener", "noreferrer"])
5912
+ ).join(" ") : rel;
5913
+ const showExternalIcon = external && !endIcon;
5914
+ return /* @__PURE__ */ jsxs37(
5915
+ Comp,
5916
+ {
5917
+ "data-slot": "link",
5918
+ className: cn(linkVariants({ variant }), className),
5919
+ rel: relValue,
5920
+ ...props,
5921
+ children: [
5922
+ startIcon && /* @__PURE__ */ jsx49(
5923
+ "span",
5924
+ {
5925
+ className: cn("ddga-link__icon", iconFlip && "ddga-icon-flip"),
5926
+ "data-slot": "link-start-icon",
5927
+ "aria-hidden": "true",
5928
+ children: startIcon
5929
+ }
5930
+ ),
5931
+ asChild ? /* @__PURE__ */ jsx49(SlotPrimitive13.Slottable, { children }) : children,
5932
+ endIcon && /* @__PURE__ */ jsx49(
5933
+ "span",
5934
+ {
5935
+ className: cn("ddga-link__icon", iconFlip && "ddga-icon-flip"),
5936
+ "data-slot": "link-end-icon",
5937
+ "aria-hidden": "true",
5938
+ children: endIcon
5939
+ }
5940
+ ),
5941
+ showExternalIcon && /* @__PURE__ */ jsx49(
5942
+ "span",
5943
+ {
5944
+ className: "ddga-link__icon ddga-link__icon--external",
5945
+ "data-slot": "link-external-icon",
5946
+ "aria-hidden": "true",
5947
+ children: /* @__PURE__ */ jsx49(ExternalLink, {})
5948
+ }
5949
+ )
5950
+ ]
5951
+ }
5952
+ );
5953
+ }
5954
+
5955
+ // src/components/SearchBox/SearchBox.tsx
5956
+ import { useRef as useRef5, useState as useState12 } from "react";
5957
+ import { jsx as jsx50 } from "react/jsx-runtime";
5958
+ function setNativeInputValue(el, value) {
5959
+ const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
5960
+ setter?.call(el, value);
5961
+ el.dispatchEvent(new Event("input", { bubbles: true }));
5962
+ }
5963
+ function SearchBox({
5964
+ value,
5965
+ defaultValue,
5966
+ onChange,
5967
+ onKeyDown,
5968
+ onSearch,
5969
+ onClear,
5970
+ clearable = true,
5971
+ clearLabel = "Clear search",
5972
+ className,
5973
+ ...rest
5974
+ }) {
5975
+ const inputRef = useRef5(null);
5976
+ const isControlled = value !== void 0;
5977
+ const [internal, setInternal] = useState12(
5978
+ defaultValue != null ? String(defaultValue) : ""
5979
+ );
5980
+ const currentValue = isControlled ? String(value ?? "") : internal;
5981
+ const handleChange = (event) => {
5982
+ if (!isControlled) setInternal(event.target.value);
5983
+ onChange?.(event);
5984
+ };
5985
+ const clear = () => {
5986
+ const el = inputRef.current;
5987
+ if (!el) return;
5988
+ setNativeInputValue(el, "");
5989
+ el.focus();
5990
+ onClear?.();
5991
+ };
5992
+ const handleKeyDown = (event) => {
5993
+ onKeyDown?.(event);
5994
+ if (event.defaultPrevented) return;
5995
+ if (event.key === "Enter") {
5996
+ onSearch?.(currentValue);
5997
+ } else if (event.key === "Escape" && currentValue.length > 0) {
5998
+ event.preventDefault();
5999
+ event.stopPropagation();
6000
+ clear();
6001
+ }
6002
+ };
6003
+ const showClear = clearable && currentValue.length > 0;
6004
+ return /* @__PURE__ */ jsx50(
6005
+ Input,
6006
+ {
6007
+ ...rest,
6008
+ ref: inputRef,
6009
+ type: "search",
6010
+ value: currentValue,
6011
+ onChange: handleChange,
6012
+ onKeyDown: handleKeyDown,
6013
+ className: cn("ddga-search-box", className),
6014
+ startAdornment: /* @__PURE__ */ jsx50(Search, { "data-slot": "search-box-icon", "aria-hidden": "true" }),
6015
+ endAdornment: showClear ? /* @__PURE__ */ jsx50(
6016
+ Button,
6017
+ {
6018
+ type: "button",
6019
+ variant: "ghost",
6020
+ size: "icon-sm",
6021
+ "aria-label": clearLabel,
6022
+ "data-slot": "search-box-clear",
6023
+ onClick: clear,
6024
+ children: /* @__PURE__ */ jsx50(Close, { "aria-hidden": "true" })
6025
+ }
6026
+ ) : void 0
6027
+ }
6028
+ );
6029
+ }
6030
+
6031
+ // src/components/List/List.tsx
6032
+ import { cva as cva45 } from "class-variance-authority";
6033
+ import { Fragment as Fragment8, jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
6034
+ var listVariants = cva45("ddga-list", {
6035
+ variants: {
6036
+ variant: {
6037
+ plain: "ddga-list--plain",
6038
+ bulleted: "ddga-list--bulleted",
6039
+ numbered: "ddga-list--numbered",
6040
+ lettered: "ddga-list--lettered"
6041
+ },
6042
+ divided: {
6043
+ true: "ddga-list--divided"
6044
+ }
6045
+ },
6046
+ defaultVariants: {
6047
+ variant: "plain"
6048
+ }
6049
+ });
6050
+ function List({ variant, divided, className, start, reversed, ...props }) {
6051
+ const classes = cn(listVariants({ variant, divided }), className);
6052
+ const ordered = variant === "numbered" || variant === "lettered";
6053
+ if (ordered) {
6054
+ return /* @__PURE__ */ jsx51(
6055
+ "ol",
6056
+ {
6057
+ "data-slot": "list",
6058
+ "data-variant": variant,
6059
+ className: classes,
6060
+ start,
6061
+ reversed,
6062
+ ...props
6063
+ }
6064
+ );
6065
+ }
6066
+ return /* @__PURE__ */ jsx51("ul", { "data-slot": "list", "data-variant": variant ?? "plain", className: classes, ...props });
6067
+ }
6068
+ function ListItem({ className, ...props }) {
6069
+ return /* @__PURE__ */ jsx51("li", { "data-slot": "list-item", className: cn("ddga-list__item", className), ...props });
6070
+ }
6071
+ function ListItemIcon({ className, ...props }) {
6072
+ return /* @__PURE__ */ jsx51("span", { "data-slot": "list-item-icon", className: cn("ddga-list__icon", className), ...props });
6073
+ }
6074
+ function ListItemContent({
6075
+ primary,
6076
+ secondary,
6077
+ className,
6078
+ children,
6079
+ ...props
6080
+ }) {
6081
+ if (process.env.NODE_ENV === "development" && children != null && (primary != null || secondary != null)) {
6082
+ console.warn(
6083
+ "[@dev-dga/react] ListItemContent: `children` overrides `primary`/`secondary`. Pass one or the other, not both."
6084
+ );
6085
+ }
6086
+ return /* @__PURE__ */ jsx51("div", { "data-slot": "list-item-content", className: cn("ddga-list__content", className), ...props, children: children ?? /* @__PURE__ */ jsxs38(Fragment8, { children: [
6087
+ primary != null && primary !== "" && /* @__PURE__ */ jsx51("span", { "data-slot": "list-item-primary", className: "ddga-list__primary", children: primary }),
6088
+ secondary != null && secondary !== "" && /* @__PURE__ */ jsx51("span", { "data-slot": "list-item-secondary", className: "ddga-list__secondary", children: secondary })
6089
+ ] }) });
6090
+ }
6091
+ function ListItemAction({ className, ...props }) {
6092
+ return /* @__PURE__ */ jsx51("div", { "data-slot": "list-item-action", className: cn("ddga-list__action", className), ...props });
6093
+ }
6094
+
6095
+ // src/components/Quote/Quote.tsx
6096
+ import "react";
6097
+ import { Slot as SlotPrimitive14 } from "radix-ui";
6098
+ import { cva as cva46 } from "class-variance-authority";
6099
+ import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
6100
+ var quoteVariants = cva46("ddga-quote", {
6101
+ variants: {
6102
+ variant: {
6103
+ /** Inline-start accent border (SA Green). The everyday blockquote. */
6104
+ default: "ddga-quote--default",
6105
+ /** Large editorial quote, centered, prominent mark — breaks up prose. */
6106
+ pullquote: "ddga-quote--pullquote",
6107
+ /** Card surface (border + bg + shadow), sized for an avatar + attribution. */
6108
+ testimonial: "ddga-quote--testimonial",
6109
+ /** Bare — no border, no surface. For inline / tightly-composed use. */
6110
+ plain: "ddga-quote--plain"
6111
+ }
6112
+ },
6113
+ defaultVariants: {
6114
+ variant: "default"
6115
+ }
6116
+ });
6117
+ function Quote({
6118
+ variant,
6119
+ quoteMark = false,
6120
+ avatar,
6121
+ author,
6122
+ byline,
6123
+ source,
6124
+ cite,
6125
+ className,
6126
+ children,
6127
+ ...props
6128
+ }) {
6129
+ const hasAttribution = author != null || byline != null || source != null;
6130
+ const mark = quoteMark ? /* @__PURE__ */ jsx52(QuoteMark, { "aria-hidden": "true", className: "ddga-quote__mark" }) : null;
6131
+ if (!hasAttribution) {
6132
+ return /* @__PURE__ */ jsxs39(
6133
+ "blockquote",
6134
+ {
6135
+ "data-slot": "quote",
6136
+ "data-variant": variant ?? "default",
6137
+ className: cn(quoteVariants({ variant }), className),
6138
+ cite,
6139
+ ...props,
6140
+ children: [
6141
+ mark,
6142
+ /* @__PURE__ */ jsx52(QuoteContent, { children })
6143
+ ]
6144
+ }
6145
+ );
6146
+ }
6147
+ return /* @__PURE__ */ jsxs39(
6148
+ "figure",
6149
+ {
6150
+ "data-slot": "quote",
6151
+ "data-variant": variant ?? "default",
6152
+ className: cn(quoteVariants({ variant }), className),
6153
+ ...props,
6154
+ children: [
6155
+ /* @__PURE__ */ jsxs39("blockquote", { "data-slot": "quote-blockquote", className: "ddga-quote__blockquote", cite, children: [
6156
+ mark,
6157
+ /* @__PURE__ */ jsx52(QuoteContent, { children })
6158
+ ] }),
6159
+ /* @__PURE__ */ jsxs39(QuoteCaption, { children: [
6160
+ avatar != null ? /* @__PURE__ */ jsx52("span", { "data-slot": "quote-avatar", "aria-hidden": "true", className: "ddga-quote__avatar", children: avatar }) : null,
6161
+ /* @__PURE__ */ jsxs39("span", { className: "ddga-quote__attribution", children: [
6162
+ author != null ? /* @__PURE__ */ jsx52(QuoteAuthor, { children: author }) : null,
6163
+ byline != null ? /* @__PURE__ */ jsx52("span", { className: "ddga-quote__byline", children: byline }) : null,
6164
+ source != null ? /* @__PURE__ */ jsx52(QuoteSource, { children: source }) : null
6165
+ ] })
6166
+ ] })
6167
+ ]
6168
+ }
6169
+ );
6170
+ }
6171
+ function QuoteContent({ asChild, className, ...props }) {
6172
+ const Comp = asChild ? SlotPrimitive14.Slot : "div";
6173
+ return /* @__PURE__ */ jsx52(Comp, { "data-slot": "quote-content", className: cn("ddga-quote__content", className), ...props });
6174
+ }
6175
+ function QuoteCaption({ asChild, className, ...props }) {
6176
+ const Comp = asChild ? SlotPrimitive14.Slot : "figcaption";
6177
+ return /* @__PURE__ */ jsx52(Comp, { "data-slot": "quote-caption", className: cn("ddga-quote__caption", className), ...props });
6178
+ }
6179
+ function QuoteAuthor({ asChild, className, ...props }) {
6180
+ const Comp = asChild ? SlotPrimitive14.Slot : "span";
6181
+ return /* @__PURE__ */ jsx52(Comp, { "data-slot": "quote-author", className: cn("ddga-quote__author", className), ...props });
6182
+ }
6183
+ function QuoteSource({ asChild, className, ...props }) {
6184
+ const Comp = asChild ? SlotPrimitive14.Slot : "cite";
6185
+ return /* @__PURE__ */ jsx52(Comp, { "data-slot": "quote-source", className: cn("ddga-quote__source", className), ...props });
6186
+ }
6187
+
6188
+ // src/components/Collapsible/Collapsible.tsx
6189
+ import { Collapsible as CollapsiblePrimitive } from "radix-ui";
6190
+ import { jsx as jsx53 } from "react/jsx-runtime";
6191
+ function Collapsible({ className, ...props }) {
6192
+ return /* @__PURE__ */ jsx53(
6193
+ CollapsiblePrimitive.Root,
6194
+ {
6195
+ "data-slot": "collapsible",
6196
+ className: cn("ddga-collapsible", className),
6197
+ ...props
6198
+ }
6199
+ );
6200
+ }
6201
+ function CollapsibleTrigger({ className, ...props }) {
6202
+ return /* @__PURE__ */ jsx53(
6203
+ CollapsiblePrimitive.Trigger,
6204
+ {
6205
+ "data-slot": "collapsible-trigger",
6206
+ className: cn("ddga-collapsible__trigger", className),
6207
+ ...props
6208
+ }
6209
+ );
6210
+ }
6211
+ function CollapsibleContent({ className, children, ...props }) {
6212
+ return /* @__PURE__ */ jsx53(
6213
+ CollapsiblePrimitive.Content,
6214
+ {
6215
+ "data-slot": "collapsible-content",
6216
+ className: cn("ddga-collapsible__content", className),
6217
+ ...props,
6218
+ children: /* @__PURE__ */ jsx53("div", { className: "ddga-collapsible__content-inner", children })
6219
+ }
6220
+ );
6221
+ }
6222
+
6223
+ // src/components/TagInput/TagInput.tsx
6224
+ import { useRef as useRef6, useState as useState13 } from "react";
6225
+ import { cva as cva47 } from "class-variance-authority";
6226
+ import { jsx as jsx54, jsxs as jsxs40 } from "react/jsx-runtime";
6227
+ var tagInputVariants = cva47("ddga-tag-input", {
6228
+ variants: {
6229
+ size: {
6230
+ sm: "ddga-tag-input--sm",
6231
+ md: "ddga-tag-input--md",
6232
+ lg: "ddga-tag-input--lg"
6233
+ },
6234
+ error: {
6235
+ true: "ddga-tag-input--error"
6236
+ }
6237
+ },
6238
+ defaultVariants: {
6239
+ size: "md"
6240
+ }
6241
+ });
6242
+ function TagInput({
6243
+ id: externalId,
6244
+ value,
6245
+ defaultValue,
6246
+ onChange,
6247
+ label,
6248
+ helperText,
6249
+ errorMessage,
6250
+ error,
6251
+ size,
6252
+ disabled,
6253
+ placeholder,
6254
+ max,
6255
+ allowDuplicates = false,
6256
+ caseSensitive = false,
6257
+ validate,
6258
+ delimiters = [","],
6259
+ chipVariant = "secondary",
6260
+ removeLabel = (tag) => `Remove ${tag}`,
6261
+ formatAnnouncement = (tag, action) => `${tag} ${action === "add" ? "added" : "removed"}`,
6262
+ className,
6263
+ ...props
6264
+ }) {
6265
+ const isControlled = value !== void 0;
6266
+ const [uncontrolledTags, setUncontrolledTags] = useState13(defaultValue ?? []);
6267
+ const tags = isControlled ? value : uncontrolledTags;
6268
+ const [draft, setDraft] = useState13("");
6269
+ const [announcement, setAnnouncement] = useState13("");
6270
+ const inputRef = useRef6(null);
6271
+ const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
6272
+ name: "TagInput",
6273
+ id: externalId,
6274
+ label,
6275
+ error,
6276
+ errorMessage,
6277
+ helperText,
6278
+ "aria-label": props["aria-label"],
6279
+ "aria-labelledby": props["aria-labelledby"]
6280
+ });
6281
+ const commit = (next) => {
6282
+ if (!isControlled) setUncontrolledTags(next);
6283
+ onChange?.(next);
6284
+ };
6285
+ const norm = (t) => caseSensitive ? t : t.toLowerCase();
6286
+ const accept = (raw, current) => {
6287
+ let next = current;
6288
+ for (const fragment of raw) {
6289
+ const trimmed = fragment.trim();
6290
+ if (!trimmed) continue;
6291
+ if (max !== void 0 && next.length >= max) break;
6292
+ if (!allowDuplicates && next.some((t) => norm(t) === norm(trimmed))) continue;
6293
+ if (validate && !validate(trimmed, next)) continue;
6294
+ next = [...next, trimmed];
6295
+ }
6296
+ return next;
6297
+ };
6298
+ const announceAdded = (added) => {
6299
+ if (added.length > 0) {
6300
+ setAnnouncement(added.map((t) => formatAnnouncement(t, "add")).join(", "));
6301
+ }
6302
+ };
6303
+ const commitDraft = () => {
6304
+ const next = accept([draft], tags);
6305
+ if (next.length > tags.length) {
6306
+ commit(next);
6307
+ announceAdded(next.slice(tags.length));
6308
+ setDraft("");
6309
+ }
6310
+ };
6311
+ const splitPaste = (text) => {
6312
+ const escaped = delimiters.map((d) => d.replace(/[.*+?^${}()|[\]\\-]/g, "\\$&"));
6313
+ const pattern = new RegExp(`[${escaped.join("")}\\n\\r]`);
6314
+ return text.split(pattern);
6315
+ };
6316
+ const removeTag = (index) => {
6317
+ const removed = tags[index];
6318
+ commit(tags.filter((_, i) => i !== index));
6319
+ setAnnouncement(formatAnnouncement(removed, "remove"));
6320
+ inputRef.current?.focus();
6321
+ };
6322
+ const handleKeyDown = (event) => {
6323
+ if (disabled) return;
6324
+ if (event.key === "Enter") {
6325
+ event.preventDefault();
6326
+ if (draft.trim()) commitDraft();
6327
+ } else if (delimiters.includes(event.key)) {
6328
+ event.preventDefault();
6329
+ if (draft.trim()) commitDraft();
6330
+ } else if (event.key === "Backspace" && draft === "" && tags.length > 0) {
6331
+ event.preventDefault();
6332
+ removeTag(tags.length - 1);
6333
+ }
6334
+ };
6335
+ const handlePaste = (event) => {
6336
+ if (disabled) return;
6337
+ const text = event.clipboardData.getData("text");
6338
+ const fragments = splitPaste(text);
6339
+ if (fragments.length <= 1) return;
6340
+ event.preventDefault();
6341
+ const next = accept(fragments, tags);
6342
+ if (next.length > tags.length) {
6343
+ commit(next);
6344
+ announceAdded(next.slice(tags.length));
6345
+ setDraft("");
6346
+ }
6347
+ };
6348
+ const handleBoxMouseDown = (event) => {
6349
+ const target = event.target;
6350
+ if (target === inputRef.current || target.closest("button")) return;
6351
+ event.preventDefault();
6352
+ inputRef.current?.focus();
6353
+ };
6354
+ const chipSize = size === "lg" ? "md" : "sm";
6355
+ return /* @__PURE__ */ jsxs40("div", { "data-slot": "tag-input-field", className: "ddga-field", children: [
6356
+ label && /* @__PURE__ */ jsx54("label", { htmlFor: fieldId, className: "ddga-tag-input__label", children: label }),
6357
+ /* @__PURE__ */ jsxs40(
6358
+ "div",
6359
+ {
6360
+ "data-slot": "tag-input-control",
6361
+ className: cn(tagInputVariants({ size, error: hasError }), className),
6362
+ "data-disabled": disabled || void 0,
6363
+ onMouseDown: disabled ? void 0 : handleBoxMouseDown,
6364
+ children: [
6365
+ tags.length > 0 && /* @__PURE__ */ jsx54("ul", { "data-slot": "tag-input-list", className: "ddga-tag-input__list", role: "list", children: tags.map((tag, index) => /* @__PURE__ */ jsx54(
6366
+ "li",
6367
+ {
6368
+ "data-slot": "tag-input-item",
6369
+ className: "ddga-tag-input__item",
6370
+ role: "listitem",
6371
+ children: /* @__PURE__ */ jsx54(
6372
+ Badge,
6373
+ {
6374
+ variant: chipVariant,
6375
+ size: chipSize,
6376
+ open: true,
6377
+ dismissible: !disabled,
6378
+ onDismiss: () => removeTag(index),
6379
+ closeLabel: removeLabel(tag),
6380
+ children: tag
6381
+ }
6382
+ )
6383
+ },
6384
+ `${tag}-${index}`
6385
+ )) }),
6386
+ /* @__PURE__ */ jsx54(
6387
+ "input",
6388
+ {
6389
+ ...props,
6390
+ ...controlProps,
6391
+ ref: inputRef,
6392
+ "data-slot": "tag-input",
6393
+ className: "ddga-tag-input__field",
6394
+ type: "text",
6395
+ value: draft,
6396
+ disabled,
6397
+ placeholder: tags.length === 0 ? placeholder : void 0,
6398
+ onChange: (event) => setDraft(event.target.value),
6399
+ onKeyDown: handleKeyDown,
6400
+ onPaste: handlePaste
6401
+ }
6402
+ )
6403
+ ]
6404
+ }
6405
+ ),
6406
+ /* @__PURE__ */ jsx54("div", { "data-slot": "tag-input-live", className: "ddga-sr-only", role: "status", "aria-live": "polite", children: announcement }),
6407
+ hasErrorMessage && /* @__PURE__ */ jsx54(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
6408
+ hasHelper && /* @__PURE__ */ jsx54(FieldMessage, { id: helperId, variant: "helper", children: helperText })
6409
+ ] });
6410
+ }
6411
+
6412
+ // src/providers/DgaProvider.tsx
6413
+ import { useState as useState14, useMemo as useMemo5, useContext as useContext13, useEffect as useEffect4, useRef as useRef7 } from "react";
6414
+ import { Direction as DirectionPrimitive, Tooltip as TooltipPrimitive2 } from "radix-ui";
6415
+ import { buildTheme } from "@dev-dga/tokens";
6416
+ import { jsx as jsx55 } from "react/jsx-runtime";
6417
+ function DgaProvider({
6418
+ dir = "ltr",
6419
+ locale,
6420
+ mode = "light",
6421
+ theme,
6422
+ as: Component = "div",
6423
+ className,
6424
+ style: consumerStyle,
6425
+ children
6426
+ }) {
6427
+ const parentCtx = useContext13(DgaContext);
6428
+ const isNested = parentCtx !== null;
6429
+ const [rootEl, setRootEl] = useState14(null);
6430
+ const portalRef = useRef7(null);
6431
+ const [portalEl, setPortalEl] = useState14(null);
6432
+ const resolvedLocale = locale ?? (dir === "rtl" ? "ar" : "en");
6433
+ const themeVars = useMemo5(() => theme ? buildTheme(theme) : null, [theme]);
6434
+ useEffect4(() => {
6435
+ if (typeof document === "undefined") return;
6436
+ const el = document.createElement("div");
6437
+ el.setAttribute("data-slot", "dga-portal");
6438
+ el.style.position = "relative";
6439
+ el.style.zIndex = "50";
6440
+ document.body.appendChild(el);
6441
+ portalRef.current = el;
6442
+ setPortalEl(el);
6443
+ return () => {
6444
+ el.remove();
6445
+ portalRef.current = null;
6446
+ setPortalEl(null);
6447
+ };
6448
+ }, []);
6449
+ useEffect4(() => {
5268
6450
  const el = portalRef.current;
5269
6451
  if (!el) return;
5270
6452
  el.setAttribute("data-theme", mode);
@@ -5276,12 +6458,12 @@ function DgaProvider({
5276
6458
  }
5277
6459
  }
5278
6460
  }, [mode, dir, themeVars, portalEl]);
5279
- const ctxValue = useMemo4(
6461
+ const ctxValue = useMemo5(
5280
6462
  () => ({ dir, locale: resolvedLocale, mode, rootEl, portalEl }),
5281
6463
  [dir, resolvedLocale, mode, rootEl, portalEl]
5282
6464
  );
5283
- const inner = /* @__PURE__ */ jsx46(DirectionPrimitive.Provider, { dir, children });
5284
- return /* @__PURE__ */ jsx46(DgaContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx46(
6465
+ const inner = /* @__PURE__ */ jsx55(DirectionPrimitive.Provider, { dir, children });
6466
+ return /* @__PURE__ */ jsx55(DgaContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx55(
5285
6467
  Component,
5286
6468
  {
5287
6469
  ref: setRootEl,
@@ -5291,7 +6473,7 @@ function DgaProvider({
5291
6473
  "data-theme": mode,
5292
6474
  className,
5293
6475
  style: { colorScheme: mode, ...themeVars ?? {}, ...consumerStyle },
5294
- children: isNested ? inner : /* @__PURE__ */ jsx46(TooltipPrimitive2.Provider, { delayDuration: 300, skipDelayDuration: 100, children: inner })
6476
+ children: isNested ? inner : /* @__PURE__ */ jsx55(TooltipPrimitive2.Provider, { delayDuration: 300, skipDelayDuration: 100, children: inner })
5295
6477
  }
5296
6478
  ) });
5297
6479
  }
@@ -5325,10 +6507,21 @@ export {
5325
6507
  CardTitle,
5326
6508
  Checkbox,
5327
6509
  CircularProgress,
6510
+ Collapsible,
6511
+ CollapsibleContent,
6512
+ CollapsibleTrigger,
5328
6513
  Combobox,
5329
6514
  ComboboxGroup,
5330
6515
  ComboboxItem,
5331
6516
  ComboboxSeparator,
6517
+ Command2 as Command,
6518
+ CommandDialog,
6519
+ CommandEmpty,
6520
+ CommandGroup,
6521
+ CommandInput,
6522
+ CommandItem,
6523
+ CommandList,
6524
+ CommandSeparator,
5332
6525
  DatePicker,
5333
6526
  DescriptionDetails,
5334
6527
  DescriptionItem,
@@ -5366,6 +6559,13 @@ export {
5366
6559
  FieldMessage,
5367
6560
  FileUpload,
5368
6561
  Input,
6562
+ InputOTP,
6563
+ Link,
6564
+ List,
6565
+ ListItem,
6566
+ ListItemAction,
6567
+ ListItemContent,
6568
+ ListItemIcon,
5369
6569
  Menubar,
5370
6570
  MenubarCheckboxItem,
5371
6571
  MenubarContent,
@@ -5402,10 +6602,16 @@ export {
5402
6602
  PopoverContent,
5403
6603
  PopoverTrigger,
5404
6604
  Progress,
6605
+ Quote,
6606
+ QuoteAuthor,
6607
+ QuoteCaption,
6608
+ QuoteContent,
6609
+ QuoteSource,
5405
6610
  Radio,
5406
6611
  RadioGroup,
5407
6612
  Rating,
5408
6613
  ScrollArea,
6614
+ SearchBox,
5409
6615
  Select,
5410
6616
  SelectItem,
5411
6617
  Sidebar,
@@ -5435,6 +6641,7 @@ export {
5435
6641
  Spinner,
5436
6642
  Stat,
5437
6643
  StatChange,
6644
+ StatChart,
5438
6645
  StatGroup,
5439
6646
  StatLabel,
5440
6647
  StatValue,
@@ -5444,10 +6651,19 @@ export {
5444
6651
  StepTitle,
5445
6652
  Steps,
5446
6653
  Switch,
6654
+ Table,
6655
+ TableBody,
6656
+ TableCaption,
6657
+ TableCell,
6658
+ TableFooter,
6659
+ TableHead,
6660
+ TableHeader,
6661
+ TableRow,
5447
6662
  Tabs,
5448
6663
  TabsContent,
5449
6664
  TabsList,
5450
6665
  TabsTrigger,
6666
+ TagInput,
5451
6667
  Textarea,
5452
6668
  Timeline,
5453
6669
  TimelineContent,
@@ -5475,6 +6691,7 @@ export {
5475
6691
  cn,
5476
6692
  comboboxTriggerVariants,
5477
6693
  comboboxVariants,
6694
+ commandVariants,
5478
6695
  createToast,
5479
6696
  createToastStore,
5480
6697
  datePickerVariants,
@@ -5483,7 +6700,10 @@ export {
5483
6700
  drawerVariants,
5484
6701
  dropdownMenuVariants,
5485
6702
  emptyStateVariants,
6703
+ inputOTPVariants,
5486
6704
  inputVariants,
6705
+ linkVariants,
6706
+ listVariants,
5487
6707
  menubarContentVariants,
5488
6708
  menubarTriggerVariants,
5489
6709
  modalContentVariants,
@@ -5492,6 +6712,7 @@ export {
5492
6712
  paginationVariants,
5493
6713
  popoverContentVariants,
5494
6714
  progressVariants,
6715
+ quoteVariants,
5495
6716
  radioGroupVariants,
5496
6717
  radioVariants,
5497
6718
  ratingVariants,
@@ -5507,8 +6728,10 @@ export {
5507
6728
  stepVariants,
5508
6729
  stepsVariants,
5509
6730
  switchVariants,
6731
+ tableVariants,
5510
6732
  tabsListVariants,
5511
6733
  tabsVariants,
6734
+ tagInputVariants,
5512
6735
  textareaVariants,
5513
6736
  timelineMarkerVariants,
5514
6737
  timelineVariants,