@dev-dga/react 0.6.0 → 0.7.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
@@ -632,6 +632,99 @@ function Upload(props) {
632
632
  }
633
633
  );
634
634
  }
635
+ function Inbox(props) {
636
+ return /* @__PURE__ */ jsxs4(
637
+ "svg",
638
+ {
639
+ xmlns: "http://www.w3.org/2000/svg",
640
+ width: "1em",
641
+ height: "1em",
642
+ viewBox: "0 0 24 24",
643
+ fill: "none",
644
+ stroke: "currentColor",
645
+ strokeWidth: "2",
646
+ strokeLinecap: "round",
647
+ strokeLinejoin: "round",
648
+ ...props,
649
+ children: [
650
+ /* @__PURE__ */ jsx6("path", { d: "M22 12h-6l-2 3h-4l-2-3H2" }),
651
+ /* @__PURE__ */ jsx6("path", { d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" })
652
+ ]
653
+ }
654
+ );
655
+ }
656
+ function Search(props) {
657
+ return /* @__PURE__ */ jsxs4(
658
+ "svg",
659
+ {
660
+ xmlns: "http://www.w3.org/2000/svg",
661
+ width: "1em",
662
+ height: "1em",
663
+ viewBox: "0 0 24 24",
664
+ fill: "none",
665
+ stroke: "currentColor",
666
+ strokeWidth: "2",
667
+ strokeLinecap: "round",
668
+ strokeLinejoin: "round",
669
+ ...props,
670
+ children: [
671
+ /* @__PURE__ */ jsx6("circle", { cx: "11", cy: "11", r: "8" }),
672
+ /* @__PURE__ */ jsx6("path", { d: "m21 21-4.3-4.3" })
673
+ ]
674
+ }
675
+ );
676
+ }
677
+ function CaretUp(props) {
678
+ return /* @__PURE__ */ jsx6(
679
+ "svg",
680
+ {
681
+ xmlns: "http://www.w3.org/2000/svg",
682
+ width: "1em",
683
+ height: "1em",
684
+ viewBox: "0 0 24 24",
685
+ fill: "currentColor",
686
+ stroke: "none",
687
+ ...props,
688
+ children: /* @__PURE__ */ jsx6("path", { d: "m12 8-6 8h12z" })
689
+ }
690
+ );
691
+ }
692
+ function CaretDown(props) {
693
+ return /* @__PURE__ */ jsx6(
694
+ "svg",
695
+ {
696
+ xmlns: "http://www.w3.org/2000/svg",
697
+ width: "1em",
698
+ height: "1em",
699
+ viewBox: "0 0 24 24",
700
+ fill: "currentColor",
701
+ stroke: "none",
702
+ ...props,
703
+ children: /* @__PURE__ */ jsx6("path", { d: "m12 16 6-8H6z" })
704
+ }
705
+ );
706
+ }
707
+ function PanelLeft(props) {
708
+ return /* @__PURE__ */ jsxs4(
709
+ "svg",
710
+ {
711
+ xmlns: "http://www.w3.org/2000/svg",
712
+ width: "1em",
713
+ height: "1em",
714
+ viewBox: "0 0 24 24",
715
+ fill: "none",
716
+ stroke: "currentColor",
717
+ strokeWidth: "2",
718
+ strokeLinecap: "round",
719
+ strokeLinejoin: "round",
720
+ ...props,
721
+ children: [
722
+ /* @__PURE__ */ jsx6("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
723
+ /* @__PURE__ */ jsx6("path", { d: "M9 3v18" })
724
+ ]
725
+ }
726
+ );
727
+ }
635
728
 
636
729
  // src/components/Checkbox/Checkbox.tsx
637
730
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -4022,78 +4115,1185 @@ function DescriptionDetails({ className, ...props }) {
4022
4115
  );
4023
4116
  }
4024
4117
 
4025
- // src/providers/DgaProvider.tsx
4026
- import { useState as useState8, useMemo as useMemo3, useContext as useContext9, useEffect, useRef as useRef3 } from "react";
4027
- import { Direction as DirectionPrimitive, Tooltip as TooltipPrimitive2 } from "radix-ui";
4028
- import { buildTheme } from "@dev-dga/tokens";
4029
- import { jsx as jsx36 } from "react/jsx-runtime";
4030
- function DgaProvider({
4031
- dir = "ltr",
4032
- locale,
4033
- mode = "light",
4034
- theme,
4035
- as: Component = "div",
4118
+ // src/components/EmptyState/EmptyState.tsx
4119
+ import "react";
4120
+ import { Slot as SlotPrimitive9 } from "radix-ui";
4121
+ import { cva as cva33 } from "class-variance-authority";
4122
+ import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
4123
+ var emptyStateVariants = cva33("ddga-empty-state", {
4124
+ variants: {
4125
+ variant: {
4126
+ default: "ddga-empty-state--default",
4127
+ search: "ddga-empty-state--search",
4128
+ error: "ddga-empty-state--error",
4129
+ success: "ddga-empty-state--success"
4130
+ },
4131
+ size: {
4132
+ sm: "ddga-empty-state--sm",
4133
+ md: "ddga-empty-state--md",
4134
+ lg: "ddga-empty-state--lg"
4135
+ }
4136
+ },
4137
+ defaultVariants: {
4138
+ variant: "default",
4139
+ size: "md"
4140
+ }
4141
+ });
4142
+ var DEFAULT_ICONS3 = {
4143
+ default: /* @__PURE__ */ jsx36(Inbox, { "aria-hidden": "true" }),
4144
+ search: /* @__PURE__ */ jsx36(Search, { "aria-hidden": "true" }),
4145
+ error: /* @__PURE__ */ jsx36(AlertCircle, { "aria-hidden": "true" }),
4146
+ success: /* @__PURE__ */ jsx36(Check, { "aria-hidden": "true" })
4147
+ };
4148
+ function EmptyState({
4149
+ variant,
4150
+ size,
4151
+ icon,
4152
+ title,
4153
+ description,
4154
+ action,
4155
+ secondaryAction,
4036
4156
  className,
4037
- style: consumerStyle,
4038
- children
4157
+ children,
4158
+ ...props
4039
4159
  }) {
4040
- const parentCtx = useContext9(DgaContext);
4041
- const isNested = parentCtx !== null;
4042
- const [rootEl, setRootEl] = useState8(null);
4043
- const portalRef = useRef3(null);
4044
- const [portalEl, setPortalEl] = useState8(null);
4045
- const resolvedLocale = locale ?? (dir === "rtl" ? "ar" : "en");
4046
- const themeVars = useMemo3(() => theme ? buildTheme(theme) : null, [theme]);
4047
- useEffect(() => {
4048
- if (typeof document === "undefined") return;
4049
- const el = document.createElement("div");
4050
- el.setAttribute("data-slot", "dga-portal");
4051
- el.style.position = "relative";
4052
- el.style.zIndex = "50";
4053
- document.body.appendChild(el);
4054
- portalRef.current = el;
4055
- setPortalEl(el);
4056
- return () => {
4057
- el.remove();
4058
- portalRef.current = null;
4059
- setPortalEl(null);
4060
- };
4061
- }, []);
4062
- useEffect(() => {
4063
- const el = portalRef.current;
4064
- if (!el) return;
4065
- el.setAttribute("data-theme", mode);
4066
- el.setAttribute("dir", dir);
4067
- el.style.colorScheme = mode;
4068
- if (themeVars) {
4069
- for (const [k, v] of Object.entries(themeVars)) {
4070
- el.style.setProperty(k, String(v));
4071
- }
4160
+ const resolvedIcon = icon === false ? null : icon !== void 0 ? icon : DEFAULT_ICONS3[variant ?? "default"];
4161
+ return /* @__PURE__ */ jsx36(
4162
+ "div",
4163
+ {
4164
+ "data-slot": "empty-state",
4165
+ "data-variant": variant ?? "default",
4166
+ "data-size": size ?? "md",
4167
+ className: cn(emptyStateVariants({ variant, size }), className),
4168
+ ...props,
4169
+ children: children ?? /* @__PURE__ */ jsxs27(Fragment3, { children: [
4170
+ resolvedIcon ? /* @__PURE__ */ jsx36(EmptyStateMedia, { children: resolvedIcon }) : null,
4171
+ title ? /* @__PURE__ */ jsx36(EmptyStateTitle, { children: title }) : null,
4172
+ description ? /* @__PURE__ */ jsx36(EmptyStateDescription, { children: description }) : null,
4173
+ action || secondaryAction ? /* @__PURE__ */ jsxs27(EmptyStateActions, { children: [
4174
+ action,
4175
+ secondaryAction
4176
+ ] }) : null
4177
+ ] })
4072
4178
  }
4073
- }, [mode, dir, themeVars, portalEl]);
4074
- const ctxValue = useMemo3(
4075
- () => ({ dir, locale: resolvedLocale, mode, rootEl, portalEl }),
4076
- [dir, resolvedLocale, mode, rootEl, portalEl]
4077
4179
  );
4078
- const inner = /* @__PURE__ */ jsx36(DirectionPrimitive.Provider, { dir, children });
4079
- return /* @__PURE__ */ jsx36(DgaContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx36(
4080
- Component,
4180
+ }
4181
+ function EmptyStateMedia({ className, ...props }) {
4182
+ return /* @__PURE__ */ jsx36(
4183
+ "div",
4081
4184
  {
4082
- ref: setRootEl,
4083
- dir,
4084
- lang: resolvedLocale,
4085
- "data-slot": "dga-root",
4086
- "data-theme": mode,
4087
- className,
4088
- style: { colorScheme: mode, ...themeVars ?? {}, ...consumerStyle },
4089
- children: isNested ? inner : /* @__PURE__ */ jsx36(TooltipPrimitive2.Provider, { delayDuration: 300, skipDelayDuration: 100, children: inner })
4185
+ "data-slot": "empty-state-media",
4186
+ "aria-hidden": "true",
4187
+ className: cn("ddga-empty-state__media", className),
4188
+ ...props
4090
4189
  }
4091
- ) });
4190
+ );
4191
+ }
4192
+ function EmptyStateTitle({ asChild, className, ...props }) {
4193
+ const Comp = asChild ? SlotPrimitive9.Slot : "h3";
4194
+ return /* @__PURE__ */ jsx36(
4195
+ Comp,
4196
+ {
4197
+ "data-slot": "empty-state-title",
4198
+ className: cn("ddga-empty-state__title", className),
4199
+ ...props
4200
+ }
4201
+ );
4202
+ }
4203
+ function EmptyStateDescription({ asChild, className, ...props }) {
4204
+ const Comp = asChild ? SlotPrimitive9.Slot : "p";
4205
+ return /* @__PURE__ */ jsx36(
4206
+ Comp,
4207
+ {
4208
+ "data-slot": "empty-state-description",
4209
+ className: cn("ddga-empty-state__description", className),
4210
+ ...props
4211
+ }
4212
+ );
4213
+ }
4214
+ function EmptyStateActions({ asChild, className, ...props }) {
4215
+ const Comp = asChild ? SlotPrimitive9.Slot : "div";
4216
+ return /* @__PURE__ */ jsx36(
4217
+ Comp,
4218
+ {
4219
+ "data-slot": "empty-state-actions",
4220
+ className: cn("ddga-empty-state__actions", className),
4221
+ ...props
4222
+ }
4223
+ );
4092
4224
  }
4093
4225
 
4094
- // src/hooks/useDir.ts
4095
- function useDir() {
4096
- return useDga().dir;
4226
+ // src/components/Stat/Stat.tsx
4227
+ import "react";
4228
+ import { cva as cva34 } from "class-variance-authority";
4229
+ import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
4230
+ var statVariants = cva34("ddga-stat", {
4231
+ variants: {
4232
+ variant: {
4233
+ flat: "ddga-stat--flat",
4234
+ elevated: "ddga-stat--elevated",
4235
+ accent: "ddga-stat--accent"
4236
+ },
4237
+ size: {
4238
+ sm: "ddga-stat--sm",
4239
+ md: "ddga-stat--md",
4240
+ lg: "ddga-stat--lg"
4241
+ }
4242
+ },
4243
+ defaultVariants: {
4244
+ variant: "flat",
4245
+ size: "md"
4246
+ }
4247
+ });
4248
+ var TREND_ICONS = {
4249
+ up: /* @__PURE__ */ jsx37(CaretUp, { "aria-hidden": "true" }),
4250
+ down: /* @__PURE__ */ jsx37(CaretDown, { "aria-hidden": "true" }),
4251
+ flat: /* @__PURE__ */ jsx37(Minus, { "aria-hidden": "true" })
4252
+ };
4253
+ var TREND_SENTIMENT = {
4254
+ up: "positive",
4255
+ down: "negative",
4256
+ flat: "neutral"
4257
+ };
4258
+ function resolveSentiment(trend, sentiment) {
4259
+ if (sentiment) return sentiment;
4260
+ if (trend) return TREND_SENTIMENT[trend];
4261
+ return void 0;
4262
+ }
4263
+ function Stat({
4264
+ variant,
4265
+ size,
4266
+ label,
4267
+ value,
4268
+ change,
4269
+ changeLabel,
4270
+ trend,
4271
+ sentiment,
4272
+ icon,
4273
+ className,
4274
+ children,
4275
+ ...props
4276
+ }) {
4277
+ const resolvedSentiment = resolveSentiment(trend, sentiment);
4278
+ return /* @__PURE__ */ jsxs28(
4279
+ "div",
4280
+ {
4281
+ "data-slot": "stat",
4282
+ "data-variant": variant ?? "flat",
4283
+ "data-trend": trend,
4284
+ "data-sentiment": resolvedSentiment,
4285
+ className: cn(statVariants({ variant, size }), className),
4286
+ ...props,
4287
+ children: [
4288
+ label || icon ? /* @__PURE__ */ jsxs28("div", { className: "ddga-stat__label-row", children: [
4289
+ label ? /* @__PURE__ */ jsx37(StatLabel, { children: label }) : null,
4290
+ icon ? /* @__PURE__ */ jsx37("span", { className: "ddga-stat__icon", "aria-hidden": "true", children: icon }) : null
4291
+ ] }) : null,
4292
+ 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,
4295
+ changeLabel ? /* @__PURE__ */ jsx37("span", { className: "ddga-stat__change-label", children: changeLabel }) : null
4296
+ ] }) : null,
4297
+ children
4298
+ ]
4299
+ }
4300
+ );
4301
+ }
4302
+ function StatLabel({ className, ...props }) {
4303
+ return /* @__PURE__ */ jsx37("div", { "data-slot": "stat-label", className: cn("ddga-stat__label", className), ...props });
4304
+ }
4305
+ function StatValue({ className, ...props }) {
4306
+ return /* @__PURE__ */ jsx37("div", { "data-slot": "stat-value", className: cn("ddga-stat__value", className), ...props });
4307
+ }
4308
+ function StatChange({ trend, sentiment, className, children, ...props }) {
4309
+ const resolvedSentiment = resolveSentiment(trend, sentiment);
4310
+ return /* @__PURE__ */ jsxs28(
4311
+ "div",
4312
+ {
4313
+ "data-slot": "stat-change",
4314
+ "data-trend": trend,
4315
+ "data-sentiment": resolvedSentiment,
4316
+ className: cn(
4317
+ "ddga-stat__change",
4318
+ resolvedSentiment ? `ddga-stat__change--${resolvedSentiment}` : null,
4319
+ className
4320
+ ),
4321
+ ...props,
4322
+ children: [
4323
+ trend ? /* @__PURE__ */ jsx37("span", { className: "ddga-stat__change-icon", children: TREND_ICONS[trend] }) : null,
4324
+ children
4325
+ ]
4326
+ }
4327
+ );
4328
+ }
4329
+
4330
+ // src/components/Stat/StatGroup.tsx
4331
+ import { cva as cva35 } from "class-variance-authority";
4332
+ import { jsx as jsx38 } from "react/jsx-runtime";
4333
+ var statGroupVariants = cva35("ddga-stat-group", {
4334
+ variants: {
4335
+ orientation: {
4336
+ horizontal: "ddga-stat-group--horizontal",
4337
+ vertical: "ddga-stat-group--vertical"
4338
+ },
4339
+ gap: {
4340
+ sm: "ddga-stat-group--gap-sm",
4341
+ md: "ddga-stat-group--gap-md",
4342
+ lg: "ddga-stat-group--gap-lg"
4343
+ }
4344
+ },
4345
+ defaultVariants: {
4346
+ orientation: "horizontal",
4347
+ gap: "md"
4348
+ }
4349
+ });
4350
+ function StatGroup({ orientation, gap, columns, className, style, ...props }) {
4351
+ return /* @__PURE__ */ jsx38(
4352
+ "div",
4353
+ {
4354
+ "data-slot": "stat-group",
4355
+ className: cn(
4356
+ statGroupVariants({ orientation, gap }),
4357
+ columns != null && "ddga-stat-group--cols",
4358
+ className
4359
+ ),
4360
+ style: columns != null ? { "--ddga-stat-group-columns": columns, ...style } : style,
4361
+ ...props
4362
+ }
4363
+ );
4364
+ }
4365
+
4366
+ // src/components/Popover/Popover.tsx
4367
+ import { useContext as useContext9 } from "react";
4368
+ import { Popover as PopoverPrimitive2 } from "radix-ui";
4369
+ import { cva as cva36 } from "class-variance-authority";
4370
+ import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
4371
+ var popoverContentVariants = cva36("ddga-popover", {
4372
+ variants: {
4373
+ size: {
4374
+ sm: "ddga-popover--sm",
4375
+ md: "ddga-popover--md"
4376
+ }
4377
+ },
4378
+ defaultVariants: {
4379
+ size: "md"
4380
+ }
4381
+ });
4382
+ function Popover(props) {
4383
+ return /* @__PURE__ */ jsx39(PopoverPrimitive2.Root, { ...props });
4384
+ }
4385
+ function PopoverTrigger({ className, ...props }) {
4386
+ return /* @__PURE__ */ jsx39(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", className, ...props });
4387
+ }
4388
+ function PopoverAnchor(props) {
4389
+ return /* @__PURE__ */ jsx39(PopoverPrimitive2.Anchor, { "data-slot": "popover-anchor", ...props });
4390
+ }
4391
+ function PopoverContent({
4392
+ size,
4393
+ arrow = false,
4394
+ sideOffset = 6,
4395
+ className,
4396
+ children,
4397
+ ...props
4398
+ }) {
4399
+ if (process.env.NODE_ENV === "development" && !props["aria-label"] && !props["aria-labelledby"]) {
4400
+ console.warn(
4401
+ '[@dev-dga/react] PopoverContent renders role="dialog" and should have an `aria-label` or `aria-labelledby` so the panel has an accessible name.'
4402
+ );
4403
+ }
4404
+ const ctx = useContext9(DgaContext);
4405
+ const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
4406
+ return /* @__PURE__ */ jsx39(PopoverPrimitive2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs29(
4407
+ PopoverPrimitive2.Content,
4408
+ {
4409
+ "data-slot": "popover-content",
4410
+ sideOffset,
4411
+ className: cn(popoverContentVariants({ size }), className),
4412
+ ...props,
4413
+ children: [
4414
+ children,
4415
+ arrow ? /* @__PURE__ */ jsx39(PopoverPrimitive2.Arrow, { className: "ddga-popover__arrow", width: 16, height: 8 }) : null
4416
+ ]
4417
+ }
4418
+ ) });
4419
+ }
4420
+ function PopoverClose({
4421
+ className,
4422
+ children,
4423
+ closeLabel = "Close",
4424
+ asChild,
4425
+ ...props
4426
+ }) {
4427
+ const hasRenderableChildren = children != null && children !== false;
4428
+ if (asChild || hasRenderableChildren) {
4429
+ return /* @__PURE__ */ jsx39(
4430
+ PopoverPrimitive2.Close,
4431
+ {
4432
+ "data-slot": "popover-close",
4433
+ asChild,
4434
+ className,
4435
+ ...props,
4436
+ children
4437
+ }
4438
+ );
4439
+ }
4440
+ return /* @__PURE__ */ jsx39(
4441
+ PopoverPrimitive2.Close,
4442
+ {
4443
+ "data-slot": "popover-close",
4444
+ "aria-label": closeLabel,
4445
+ className: cn("ddga-popover__close", className),
4446
+ ...props,
4447
+ children: /* @__PURE__ */ jsx39(Close, { "aria-hidden": "true" })
4448
+ }
4449
+ );
4450
+ }
4451
+
4452
+ // src/components/Sidebar/Sidebar.tsx
4453
+ import { useCallback as useCallback3, useEffect as useEffect2, useMemo as useMemo3, useState as useState9 } from "react";
4454
+ import { Slot as SlotPrimitive10 } from "radix-ui";
4455
+
4456
+ // src/components/Sidebar/SidebarContext.ts
4457
+ import { createContext as createContext3, useContext as useContext10 } from "react";
4458
+ var SidebarContext = createContext3(null);
4459
+ function useSidebar() {
4460
+ const ctx = useContext10(SidebarContext);
4461
+ if (!ctx) {
4462
+ throw new Error("useSidebar must be used within a <SidebarProvider>");
4463
+ }
4464
+ return ctx;
4465
+ }
4466
+
4467
+ // src/components/Sidebar/useIsMobile.ts
4468
+ import { useEffect, useState as useState8 } from "react";
4469
+ function useIsMobile(breakpoint = 768) {
4470
+ const [isMobile, setIsMobile] = useState8(false);
4471
+ useEffect(() => {
4472
+ const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
4473
+ const onChange = () => setIsMobile(mql.matches);
4474
+ onChange();
4475
+ mql.addEventListener("change", onChange);
4476
+ return () => mql.removeEventListener("change", onChange);
4477
+ }, [breakpoint]);
4478
+ return isMobile;
4479
+ }
4480
+
4481
+ // src/components/Sidebar/Sidebar.tsx
4482
+ import { jsx as jsx40 } from "react/jsx-runtime";
4483
+ function SidebarProvider({
4484
+ defaultOpen = true,
4485
+ open: openProp,
4486
+ onOpenChange,
4487
+ mobileBreakpoint = 768,
4488
+ keyboardShortcut = true,
4489
+ className,
4490
+ style,
4491
+ children,
4492
+ ...props
4493
+ }) {
4494
+ const isMobile = useIsMobile(mobileBreakpoint);
4495
+ const [openMobile, setOpenMobile] = useState9(false);
4496
+ const isControlled = openProp !== void 0;
4497
+ const [openInternal, setOpenInternal] = useState9(defaultOpen);
4498
+ const open = isControlled ? openProp : openInternal;
4499
+ const setOpen = useCallback3(
4500
+ (value2) => {
4501
+ if (!isControlled) setOpenInternal(value2);
4502
+ onOpenChange?.(value2);
4503
+ },
4504
+ [isControlled, onOpenChange]
4505
+ );
4506
+ const toggleSidebar = useCallback3(() => {
4507
+ if (isMobile) {
4508
+ setOpenMobile((v) => !v);
4509
+ return;
4510
+ }
4511
+ if (isControlled) {
4512
+ onOpenChange?.(!open);
4513
+ } else {
4514
+ setOpenInternal((v) => !v);
4515
+ }
4516
+ }, [isMobile, isControlled, onOpenChange, open]);
4517
+ useEffect2(() => {
4518
+ if (!keyboardShortcut) return;
4519
+ const onKeyDown = (e) => {
4520
+ if (e.key.toLowerCase() === "b" && (e.metaKey || e.ctrlKey)) {
4521
+ e.preventDefault();
4522
+ toggleSidebar();
4523
+ }
4524
+ };
4525
+ window.addEventListener("keydown", onKeyDown);
4526
+ return () => window.removeEventListener("keydown", onKeyDown);
4527
+ }, [keyboardShortcut, toggleSidebar]);
4528
+ const state = open ? "expanded" : "collapsed";
4529
+ const value = useMemo3(
4530
+ () => ({ state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }),
4531
+ [state, open, setOpen, openMobile, isMobile, toggleSidebar]
4532
+ );
4533
+ return /* @__PURE__ */ jsx40(SidebarContext.Provider, { value, children: /* @__PURE__ */ jsx40(
4534
+ "div",
4535
+ {
4536
+ "data-slot": "sidebar-wrapper",
4537
+ className: cn("ddga-sidebar-wrapper", className),
4538
+ style,
4539
+ ...props,
4540
+ children
4541
+ }
4542
+ ) });
4543
+ }
4544
+ function Sidebar({
4545
+ variant = "sidebar",
4546
+ collapsible = "icon",
4547
+ side = "start",
4548
+ className,
4549
+ children,
4550
+ "aria-label": ariaLabel = "Sidebar",
4551
+ ...props
4552
+ }) {
4553
+ const { isMobile, openMobile, setOpenMobile, state } = useSidebar();
4554
+ if (isMobile) {
4555
+ return /* @__PURE__ */ jsx40(Drawer, { open: openMobile, onOpenChange: setOpenMobile, children: /* @__PURE__ */ jsx40(
4556
+ DrawerContent,
4557
+ {
4558
+ side,
4559
+ size: "sm",
4560
+ "aria-label": ariaLabel,
4561
+ "data-mobile": "true",
4562
+ "data-variant": variant,
4563
+ "data-side": side,
4564
+ className: cn("ddga-sidebar", "ddga-sidebar--mobile", className),
4565
+ children
4566
+ }
4567
+ ) });
4568
+ }
4569
+ return /* @__PURE__ */ jsx40(
4570
+ "aside",
4571
+ {
4572
+ "data-slot": "sidebar",
4573
+ "aria-label": ariaLabel,
4574
+ "data-state": state,
4575
+ "data-collapsible": collapsible,
4576
+ "data-variant": variant,
4577
+ "data-side": side,
4578
+ className: cn("ddga-sidebar", className),
4579
+ ...props,
4580
+ children
4581
+ }
4582
+ );
4583
+ }
4584
+ function SidebarTrigger({
4585
+ asChild,
4586
+ className,
4587
+ onClick,
4588
+ children,
4589
+ "aria-label": ariaLabel = "Toggle sidebar",
4590
+ ...props
4591
+ }) {
4592
+ const { toggleSidebar, open, openMobile, isMobile } = useSidebar();
4593
+ const Comp = asChild ? SlotPrimitive10.Slot : "button";
4594
+ return /* @__PURE__ */ jsx40(
4595
+ Comp,
4596
+ {
4597
+ type: asChild ? void 0 : "button",
4598
+ "data-slot": "sidebar-trigger",
4599
+ "aria-label": asChild ? void 0 : ariaLabel,
4600
+ "aria-haspopup": isMobile ? "dialog" : void 0,
4601
+ "aria-expanded": isMobile ? openMobile : open,
4602
+ className: cn("ddga-sidebar__trigger", className),
4603
+ onClick: (e) => {
4604
+ onClick?.(e);
4605
+ toggleSidebar();
4606
+ },
4607
+ ...props,
4608
+ children: children ?? /* @__PURE__ */ jsx40(PanelLeft, { "aria-hidden": "true" })
4609
+ }
4610
+ );
4611
+ }
4612
+ function SidebarRail({
4613
+ className,
4614
+ "aria-label": ariaLabel = "Toggle sidebar",
4615
+ ...props
4616
+ }) {
4617
+ const { toggleSidebar } = useSidebar();
4618
+ return /* @__PURE__ */ jsx40(
4619
+ "button",
4620
+ {
4621
+ type: "button",
4622
+ "data-slot": "sidebar-rail",
4623
+ "aria-label": ariaLabel,
4624
+ title: ariaLabel,
4625
+ tabIndex: -1,
4626
+ className: cn("ddga-sidebar__rail", className),
4627
+ onClick: toggleSidebar,
4628
+ ...props
4629
+ }
4630
+ );
4631
+ }
4632
+ function SidebarInset({ asChild, className, ...props }) {
4633
+ const Comp = asChild ? SlotPrimitive10.Slot : "main";
4634
+ return /* @__PURE__ */ jsx40(Comp, { "data-slot": "sidebar-inset", className: cn("ddga-sidebar-inset", className), ...props });
4635
+ }
4636
+ function SidebarHeader({ asChild, className, ...props }) {
4637
+ const Comp = asChild ? SlotPrimitive10.Slot : "div";
4638
+ return /* @__PURE__ */ jsx40(Comp, { "data-slot": "sidebar-header", className: cn("ddga-sidebar__header", className), ...props });
4639
+ }
4640
+ function SidebarContent({ asChild, className, ...props }) {
4641
+ const Comp = asChild ? SlotPrimitive10.Slot : "div";
4642
+ return /* @__PURE__ */ jsx40(
4643
+ Comp,
4644
+ {
4645
+ "data-slot": "sidebar-content",
4646
+ className: cn("ddga-sidebar__content", className),
4647
+ ...props
4648
+ }
4649
+ );
4650
+ }
4651
+ function SidebarFooter({ asChild, className, ...props }) {
4652
+ const Comp = asChild ? SlotPrimitive10.Slot : "div";
4653
+ return /* @__PURE__ */ jsx40(Comp, { "data-slot": "sidebar-footer", className: cn("ddga-sidebar__footer", className), ...props });
4654
+ }
4655
+ function SidebarSeparator({ className, ...props }) {
4656
+ return /* @__PURE__ */ jsx40(
4657
+ "hr",
4658
+ {
4659
+ "data-slot": "sidebar-separator",
4660
+ className: cn("ddga-sidebar__separator", className),
4661
+ ...props
4662
+ }
4663
+ );
4664
+ }
4665
+
4666
+ // src/components/Sidebar/SidebarGroup.tsx
4667
+ import { Slot as SlotPrimitive11 } from "radix-ui";
4668
+ import { jsx as jsx41 } from "react/jsx-runtime";
4669
+ function SidebarGroup({ asChild, className, ...props }) {
4670
+ const Comp = asChild ? SlotPrimitive11.Slot : "div";
4671
+ return /* @__PURE__ */ jsx41(
4672
+ Comp,
4673
+ {
4674
+ "data-slot": "sidebar-group",
4675
+ role: "group",
4676
+ className: cn("ddga-sidebar__group", className),
4677
+ ...props
4678
+ }
4679
+ );
4680
+ }
4681
+ function SidebarGroupLabel({ asChild, className, ...props }) {
4682
+ const Comp = asChild ? SlotPrimitive11.Slot : "div";
4683
+ return /* @__PURE__ */ jsx41(
4684
+ Comp,
4685
+ {
4686
+ "data-slot": "sidebar-group-label",
4687
+ className: cn("ddga-sidebar__group-label", className),
4688
+ ...props
4689
+ }
4690
+ );
4691
+ }
4692
+ function SidebarGroupAction({ asChild, className, ...props }) {
4693
+ const Comp = asChild ? SlotPrimitive11.Slot : "button";
4694
+ return /* @__PURE__ */ jsx41(
4695
+ Comp,
4696
+ {
4697
+ type: asChild ? void 0 : "button",
4698
+ "data-slot": "sidebar-group-action",
4699
+ className: cn("ddga-sidebar__group-action", className),
4700
+ ...props
4701
+ }
4702
+ );
4703
+ }
4704
+ function SidebarGroupContent({ asChild, className, ...props }) {
4705
+ const Comp = asChild ? SlotPrimitive11.Slot : "div";
4706
+ return /* @__PURE__ */ jsx41(
4707
+ Comp,
4708
+ {
4709
+ "data-slot": "sidebar-group-content",
4710
+ className: cn("ddga-sidebar__group-content", className),
4711
+ ...props
4712
+ }
4713
+ );
4714
+ }
4715
+
4716
+ // src/components/Sidebar/SidebarMenu.tsx
4717
+ import { Slot as SlotPrimitive12 } from "radix-ui";
4718
+ import { cva as cva37 } from "class-variance-authority";
4719
+
4720
+ // src/hooks/useDir.ts
4721
+ function useDir() {
4722
+ return useDga().dir;
4723
+ }
4724
+
4725
+ // src/components/Sidebar/SidebarMenu.tsx
4726
+ import { jsx as jsx42, jsxs as jsxs30 } from "react/jsx-runtime";
4727
+ function SidebarMenu({ className, ...props }) {
4728
+ return /* @__PURE__ */ jsx42("ul", { "data-slot": "sidebar-menu", className: cn("ddga-sidebar__menu", className), ...props });
4729
+ }
4730
+ function SidebarMenuItem({ className, ...props }) {
4731
+ return /* @__PURE__ */ jsx42(
4732
+ "li",
4733
+ {
4734
+ "data-slot": "sidebar-menu-item",
4735
+ className: cn("ddga-sidebar__menu-item", className),
4736
+ ...props
4737
+ }
4738
+ );
4739
+ }
4740
+ var sidebarMenuButtonVariants = cva37("ddga-sidebar__menu-button", {
4741
+ variants: {
4742
+ size: {
4743
+ sm: "ddga-sidebar__menu-button--sm",
4744
+ md: "ddga-sidebar__menu-button--md",
4745
+ lg: "ddga-sidebar__menu-button--lg"
4746
+ }
4747
+ },
4748
+ defaultVariants: { size: "md" }
4749
+ });
4750
+ function SidebarMenuButton({
4751
+ asChild,
4752
+ isActive,
4753
+ size,
4754
+ tooltip,
4755
+ className,
4756
+ ...props
4757
+ }) {
4758
+ const { state, isMobile } = useSidebar();
4759
+ const dir = useDir();
4760
+ const Comp = asChild ? SlotPrimitive12.Slot : "button";
4761
+ const button = /* @__PURE__ */ jsx42(
4762
+ Comp,
4763
+ {
4764
+ type: asChild ? void 0 : "button",
4765
+ "data-slot": "sidebar-menu-button",
4766
+ "data-active": isActive || void 0,
4767
+ "data-size": size ?? "md",
4768
+ "aria-current": isActive ? "page" : void 0,
4769
+ className: cn(sidebarMenuButtonVariants({ size }), className),
4770
+ ...props
4771
+ }
4772
+ );
4773
+ if (!tooltip || state !== "collapsed" || isMobile) {
4774
+ return button;
4775
+ }
4776
+ return /* @__PURE__ */ jsxs30(Tooltip, { children: [
4777
+ /* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx42("span", { "data-slot": "tooltip-trigger", style: { display: "contents" }, children: button }) }),
4778
+ /* @__PURE__ */ jsx42(TooltipContent, { side: dir === "rtl" ? "left" : "right", children: tooltip })
4779
+ ] });
4780
+ }
4781
+ function SidebarMenuAction({ asChild, showOnHover, className, ...props }) {
4782
+ const Comp = asChild ? SlotPrimitive12.Slot : "button";
4783
+ return /* @__PURE__ */ jsx42(
4784
+ Comp,
4785
+ {
4786
+ type: asChild ? void 0 : "button",
4787
+ "data-slot": "sidebar-menu-action",
4788
+ "data-show-on-hover": showOnHover || void 0,
4789
+ className: cn("ddga-sidebar__menu-action", className),
4790
+ ...props
4791
+ }
4792
+ );
4793
+ }
4794
+ function SidebarMenuBadge({ className, ...props }) {
4795
+ return /* @__PURE__ */ jsx42(
4796
+ "span",
4797
+ {
4798
+ "data-slot": "sidebar-menu-badge",
4799
+ className: cn("ddga-sidebar__menu-badge", className),
4800
+ ...props
4801
+ }
4802
+ );
4803
+ }
4804
+ function SidebarMenuSkeleton({ showIcon, className, ...props }) {
4805
+ return /* @__PURE__ */ jsxs30(
4806
+ "div",
4807
+ {
4808
+ "data-slot": "sidebar-menu-skeleton",
4809
+ className: cn("ddga-sidebar__menu-skeleton", className),
4810
+ ...props,
4811
+ children: [
4812
+ showIcon ? /* @__PURE__ */ jsx42(Skeleton, { shape: "circle", width: "1rem", height: "1rem" }) : null,
4813
+ /* @__PURE__ */ jsx42(Skeleton, { shape: "text", className: "ddga-sidebar__menu-skeleton-text" })
4814
+ ]
4815
+ }
4816
+ );
4817
+ }
4818
+ function SidebarMenuSub({ className, ...props }) {
4819
+ return /* @__PURE__ */ jsx42(
4820
+ "ul",
4821
+ {
4822
+ "data-slot": "sidebar-menu-sub",
4823
+ className: cn("ddga-sidebar__menu-sub", className),
4824
+ ...props
4825
+ }
4826
+ );
4827
+ }
4828
+ function SidebarMenuSubItem({ className, ...props }) {
4829
+ return /* @__PURE__ */ jsx42(
4830
+ "li",
4831
+ {
4832
+ "data-slot": "sidebar-menu-sub-item",
4833
+ className: cn("ddga-sidebar__menu-sub-item", className),
4834
+ ...props
4835
+ }
4836
+ );
4837
+ }
4838
+ var sidebarMenuSubButtonVariants = cva37("ddga-sidebar__menu-sub-button", {
4839
+ variants: {
4840
+ size: {
4841
+ sm: "ddga-sidebar__menu-sub-button--sm",
4842
+ md: "ddga-sidebar__menu-sub-button--md"
4843
+ }
4844
+ },
4845
+ defaultVariants: { size: "md" }
4846
+ });
4847
+ function SidebarMenuSubButton({
4848
+ asChild,
4849
+ isActive,
4850
+ size,
4851
+ className,
4852
+ ...props
4853
+ }) {
4854
+ const Comp = asChild ? SlotPrimitive12.Slot : "a";
4855
+ return /* @__PURE__ */ jsx42(
4856
+ Comp,
4857
+ {
4858
+ "data-slot": "sidebar-menu-sub-button",
4859
+ "data-active": isActive || void 0,
4860
+ "data-size": size ?? "md",
4861
+ "aria-current": isActive ? "page" : void 0,
4862
+ className: cn(sidebarMenuSubButtonVariants({ size }), className),
4863
+ ...props
4864
+ }
4865
+ );
4866
+ }
4867
+
4868
+ // src/components/ScrollArea/ScrollArea.tsx
4869
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
4870
+ import { cva as cva38 } from "class-variance-authority";
4871
+ import { jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
4872
+ var scrollAreaVariants = cva38("ddga-scroll-area", {
4873
+ variants: {
4874
+ orientation: {
4875
+ vertical: "ddga-scroll-area--vertical",
4876
+ horizontal: "ddga-scroll-area--horizontal",
4877
+ both: "ddga-scroll-area--both"
4878
+ }
4879
+ },
4880
+ defaultVariants: {
4881
+ orientation: "vertical"
4882
+ }
4883
+ });
4884
+ function warnMissingLabel(ariaLabel, ariaLabelledby) {
4885
+ if (process.env.NODE_ENV === "production") return;
4886
+ if (ariaLabel || ariaLabelledby) return;
4887
+ console.warn(
4888
+ "[dga/ScrollArea] <ScrollArea> has no accessible name. The scroll viewport is keyboard-focusable; pass `aria-label` or `aria-labelledby` so screen-reader users know what region they are scrolling. If the content is itself focusable (e.g. a list of links) and you do not want a labelled region, pass `viewportProps={{ tabIndex: -1 }}`."
4889
+ );
4890
+ }
4891
+ function ScrollArea({
4892
+ className,
4893
+ orientation = "vertical",
4894
+ type = "hover",
4895
+ scrollHideDelay = 600,
4896
+ viewportRef,
4897
+ viewportProps,
4898
+ children,
4899
+ "aria-label": ariaLabel,
4900
+ "aria-labelledby": ariaLabelledby,
4901
+ ...props
4902
+ }) {
4903
+ warnMissingLabel(ariaLabel, ariaLabelledby);
4904
+ const hasLabel = Boolean(ariaLabel || ariaLabelledby);
4905
+ const showVertical = orientation === "vertical" || orientation === "both";
4906
+ const showHorizontal = orientation === "horizontal" || orientation === "both";
4907
+ const { className: viewportClassName, ...restViewportProps } = viewportProps ?? {};
4908
+ return /* @__PURE__ */ jsxs31(
4909
+ ScrollAreaPrimitive.Root,
4910
+ {
4911
+ "data-slot": "scroll-area",
4912
+ type,
4913
+ scrollHideDelay,
4914
+ className: cn(scrollAreaVariants({ orientation }), className),
4915
+ ...props,
4916
+ children: [
4917
+ /* @__PURE__ */ jsx43(
4918
+ ScrollAreaPrimitive.Viewport,
4919
+ {
4920
+ "data-slot": "scroll-area-viewport",
4921
+ className: cn("ddga-scroll-area__viewport", viewportClassName),
4922
+ ref: viewportRef,
4923
+ tabIndex: 0,
4924
+ role: hasLabel ? "region" : void 0,
4925
+ "aria-label": ariaLabel,
4926
+ "aria-labelledby": ariaLabelledby,
4927
+ ...restViewportProps,
4928
+ children
4929
+ }
4930
+ ),
4931
+ showVertical ? /* @__PURE__ */ jsx43(
4932
+ ScrollAreaPrimitive.Scrollbar,
4933
+ {
4934
+ "data-slot": "scroll-area-scrollbar",
4935
+ orientation: "vertical",
4936
+ className: "ddga-scroll-area__scrollbar",
4937
+ children: /* @__PURE__ */ jsx43(ScrollAreaPrimitive.Thumb, { className: "ddga-scroll-area__thumb" })
4938
+ }
4939
+ ) : null,
4940
+ showHorizontal ? /* @__PURE__ */ jsx43(
4941
+ ScrollAreaPrimitive.Scrollbar,
4942
+ {
4943
+ "data-slot": "scroll-area-scrollbar",
4944
+ orientation: "horizontal",
4945
+ className: "ddga-scroll-area__scrollbar",
4946
+ children: /* @__PURE__ */ jsx43(ScrollAreaPrimitive.Thumb, { className: "ddga-scroll-area__thumb" })
4947
+ }
4948
+ ) : null,
4949
+ orientation === "both" ? /* @__PURE__ */ jsx43(ScrollAreaPrimitive.Corner, { className: "ddga-scroll-area__corner" }) : null
4950
+ ]
4951
+ }
4952
+ );
4953
+ }
4954
+
4955
+ // src/components/Menubar/Menubar.tsx
4956
+ import { useContext as useContext11 } from "react";
4957
+ import { Menubar as MenubarPrimitive } from "radix-ui";
4958
+ import { cva as cva39 } from "class-variance-authority";
4959
+ import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
4960
+ var menubarContentVariants = cva39("ddga-menubar-menu", {
4961
+ variants: {
4962
+ size: {
4963
+ sm: "ddga-menubar-menu--sm",
4964
+ md: "ddga-menubar-menu--md"
4965
+ }
4966
+ },
4967
+ defaultVariants: {
4968
+ size: "md"
4969
+ }
4970
+ });
4971
+ var menubarTriggerVariants = cva39("ddga-menubar__trigger", {
4972
+ variants: {
4973
+ variant: {
4974
+ default: "ddga-menubar__trigger--default",
4975
+ outline: "ddga-menubar__trigger--outline"
4976
+ }
4977
+ },
4978
+ defaultVariants: {
4979
+ variant: "default"
4980
+ }
4981
+ });
4982
+ function Menubar({ className, ...props }) {
4983
+ return /* @__PURE__ */ jsx44(
4984
+ MenubarPrimitive.Root,
4985
+ {
4986
+ "data-slot": "menubar",
4987
+ className: cn("ddga-menubar", className),
4988
+ ...props
4989
+ }
4990
+ );
4991
+ }
4992
+ function MenubarMenu(props) {
4993
+ return /* @__PURE__ */ jsx44(MenubarPrimitive.Menu, { ...props });
4994
+ }
4995
+ function MenubarTrigger({ variant, className, ...props }) {
4996
+ return /* @__PURE__ */ jsx44(
4997
+ MenubarPrimitive.Trigger,
4998
+ {
4999
+ "data-slot": "menubar-trigger",
5000
+ "data-variant": variant ?? "default",
5001
+ className: cn(menubarTriggerVariants({ variant }), className),
5002
+ ...props
5003
+ }
5004
+ );
5005
+ }
5006
+ function MenubarContent({ size, className, sideOffset = 6, ...props }) {
5007
+ const ctx = useContext11(DgaContext);
5008
+ const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
5009
+ return /* @__PURE__ */ jsx44(MenubarPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx44(
5010
+ MenubarPrimitive.Content,
5011
+ {
5012
+ "data-slot": "menubar-content",
5013
+ sideOffset,
5014
+ className: cn(menubarContentVariants({ size }), className),
5015
+ ...props
5016
+ }
5017
+ ) });
5018
+ }
5019
+ function MenubarItem({
5020
+ className,
5021
+ destructive,
5022
+ startIcon,
5023
+ shortcut,
5024
+ children,
5025
+ ...props
5026
+ }) {
5027
+ return /* @__PURE__ */ jsxs32(
5028
+ MenubarPrimitive.Item,
5029
+ {
5030
+ "data-slot": "menubar-item",
5031
+ "data-destructive": destructive ? "" : void 0,
5032
+ className: cn("ddga-menubar-menu__item", className),
5033
+ ...props,
5034
+ children: [
5035
+ startIcon ? /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__icon", "aria-hidden": "true", children: startIcon }) : null,
5036
+ /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__label", children }),
5037
+ shortcut ? /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__shortcut", "aria-hidden": "true", children: shortcut }) : null
5038
+ ]
5039
+ }
5040
+ );
5041
+ }
5042
+ function MenubarCheckboxItem({
5043
+ className,
5044
+ children,
5045
+ onSelect,
5046
+ ...props
5047
+ }) {
5048
+ const handleSelect = onSelect ?? ((event) => {
5049
+ event.preventDefault();
5050
+ });
5051
+ return /* @__PURE__ */ jsxs32(
5052
+ MenubarPrimitive.CheckboxItem,
5053
+ {
5054
+ "data-slot": "menubar-checkbox-item",
5055
+ className: cn("ddga-menubar-menu__item", "ddga-menubar-menu__item--checkable", className),
5056
+ onSelect: handleSelect,
5057
+ ...props,
5058
+ children: [
5059
+ /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx44(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx44(Check, { className: "ddga-menubar-menu__indicator-icon" }) }) }),
5060
+ /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__label", children })
5061
+ ]
5062
+ }
5063
+ );
5064
+ }
5065
+ function MenubarRadioGroup(props) {
5066
+ return /* @__PURE__ */ jsx44(MenubarPrimitive.RadioGroup, { "data-slot": "menubar-radio-group", ...props });
5067
+ }
5068
+ function MenubarRadioItem({ className, children, onSelect, ...props }) {
5069
+ const handleSelect = onSelect ?? ((event) => {
5070
+ event.preventDefault();
5071
+ });
5072
+ return /* @__PURE__ */ jsxs32(
5073
+ MenubarPrimitive.RadioItem,
5074
+ {
5075
+ "data-slot": "menubar-radio-item",
5076
+ className: cn("ddga-menubar-menu__item", "ddga-menubar-menu__item--checkable", className),
5077
+ onSelect: handleSelect,
5078
+ ...props,
5079
+ children: [
5080
+ /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx44(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__radio-dot" }) }) }),
5081
+ /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__label", children })
5082
+ ]
5083
+ }
5084
+ );
5085
+ }
5086
+ function MenubarLabel({ className, ...props }) {
5087
+ return /* @__PURE__ */ jsx44(
5088
+ MenubarPrimitive.Label,
5089
+ {
5090
+ "data-slot": "menubar-label",
5091
+ className: cn("ddga-menubar-menu__group-label", className),
5092
+ ...props
5093
+ }
5094
+ );
5095
+ }
5096
+ function MenubarSeparator({ className, ...props }) {
5097
+ return /* @__PURE__ */ jsx44(
5098
+ MenubarPrimitive.Separator,
5099
+ {
5100
+ "data-slot": "menubar-separator",
5101
+ className: cn("ddga-menubar-menu__separator", className),
5102
+ ...props
5103
+ }
5104
+ );
5105
+ }
5106
+ function MenubarGroup(props) {
5107
+ return /* @__PURE__ */ jsx44(MenubarPrimitive.Group, { "data-slot": "menubar-group", ...props });
5108
+ }
5109
+ function MenubarSub(props) {
5110
+ return /* @__PURE__ */ jsx44(MenubarPrimitive.Sub, { ...props });
5111
+ }
5112
+ function MenubarSubTrigger({ className, startIcon, children, ...props }) {
5113
+ return /* @__PURE__ */ jsxs32(
5114
+ MenubarPrimitive.SubTrigger,
5115
+ {
5116
+ "data-slot": "menubar-sub-trigger",
5117
+ className: cn("ddga-menubar-menu__item", "ddga-menubar-menu__item--sub", className),
5118
+ ...props,
5119
+ children: [
5120
+ startIcon ? /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__icon", "aria-hidden": "true", children: startIcon }) : null,
5121
+ /* @__PURE__ */ jsx44("span", { className: "ddga-menubar-menu__label", children }),
5122
+ /* @__PURE__ */ jsx44(ChevronRight, { className: "ddga-menubar-menu__sub-chevron", "aria-hidden": "true" })
5123
+ ]
5124
+ }
5125
+ );
5126
+ }
5127
+ function MenubarSubContent({ size, className, ...props }) {
5128
+ const ctx = useContext11(DgaContext);
5129
+ const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
5130
+ return /* @__PURE__ */ jsx44(MenubarPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx44(
5131
+ MenubarPrimitive.SubContent,
5132
+ {
5133
+ "data-slot": "menubar-sub-content",
5134
+ className: cn(menubarContentVariants({ size }), className),
5135
+ ...props
5136
+ }
5137
+ ) });
5138
+ }
5139
+
5140
+ // src/components/Timeline/Timeline.tsx
5141
+ import { cva as cva40 } from "class-variance-authority";
5142
+ import { jsx as jsx45 } from "react/jsx-runtime";
5143
+ var timelineVariants = cva40("ddga-timeline", {
5144
+ variants: {
5145
+ size: {
5146
+ sm: "ddga-timeline--sm",
5147
+ md: "ddga-timeline--md"
5148
+ },
5149
+ orientation: {
5150
+ vertical: "ddga-timeline--vertical",
5151
+ horizontal: "ddga-timeline--horizontal"
5152
+ }
5153
+ },
5154
+ defaultVariants: {
5155
+ size: "md",
5156
+ orientation: "vertical"
5157
+ }
5158
+ });
5159
+ var timelineMarkerVariants = cva40("ddga-timeline__marker", {
5160
+ variants: {
5161
+ status: {
5162
+ default: "ddga-timeline__marker--default",
5163
+ success: "ddga-timeline__marker--success",
5164
+ error: "ddga-timeline__marker--error",
5165
+ warning: "ddga-timeline__marker--warning",
5166
+ info: "ddga-timeline__marker--info"
5167
+ }
5168
+ },
5169
+ defaultVariants: {
5170
+ status: "default"
5171
+ }
5172
+ });
5173
+ function Timeline({ size, orientation, className, ...props }) {
5174
+ return /* @__PURE__ */ jsx45(
5175
+ "ol",
5176
+ {
5177
+ "data-slot": "timeline",
5178
+ "data-orientation": orientation ?? "vertical",
5179
+ className: cn(timelineVariants({ size, orientation }), className),
5180
+ ...props
5181
+ }
5182
+ );
5183
+ }
5184
+ function TimelineItem({ className, ...props }) {
5185
+ return /* @__PURE__ */ jsx45("li", { "data-slot": "timeline-item", className: cn("ddga-timeline__item", className), ...props });
5186
+ }
5187
+ function TimelineMarker({ status, className, children, ...props }) {
5188
+ const resolved = status ?? "default";
5189
+ const reached = resolved !== "default";
5190
+ return /* @__PURE__ */ jsx45(
5191
+ "span",
5192
+ {
5193
+ "aria-hidden": "true",
5194
+ "data-slot": "timeline-marker",
5195
+ "data-status": resolved,
5196
+ "data-reached": reached ? "" : void 0,
5197
+ className: cn(timelineMarkerVariants({ status }), className),
5198
+ ...props,
5199
+ children: children ?? /* @__PURE__ */ jsx45("span", { className: "ddga-timeline__dot" })
5200
+ }
5201
+ );
5202
+ }
5203
+ function TimelineContent({ className, ...props }) {
5204
+ return /* @__PURE__ */ jsx45(
5205
+ "div",
5206
+ {
5207
+ "data-slot": "timeline-content",
5208
+ className: cn("ddga-timeline__content", className),
5209
+ ...props
5210
+ }
5211
+ );
5212
+ }
5213
+ function TimelineTitle({ className, ...props }) {
5214
+ return /* @__PURE__ */ jsx45("span", { "data-slot": "timeline-title", className: cn("ddga-timeline__title", className), ...props });
5215
+ }
5216
+ function TimelineDescription({ className, ...props }) {
5217
+ return /* @__PURE__ */ jsx45(
5218
+ "span",
5219
+ {
5220
+ "data-slot": "timeline-description",
5221
+ className: cn("ddga-timeline__description", className),
5222
+ ...props
5223
+ }
5224
+ );
5225
+ }
5226
+ function TimelineTime({ className, ...props }) {
5227
+ return /* @__PURE__ */ jsx45("time", { "data-slot": "timeline-time", className: cn("ddga-timeline__time", className), ...props });
5228
+ }
5229
+
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",
5241
+ className,
5242
+ style: consumerStyle,
5243
+ children
5244
+ }) {
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]);
5252
+ 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
+ }, []);
5267
+ useEffect3(() => {
5268
+ const el = portalRef.current;
5269
+ if (!el) return;
5270
+ el.setAttribute("data-theme", mode);
5271
+ el.setAttribute("dir", dir);
5272
+ el.style.colorScheme = mode;
5273
+ if (themeVars) {
5274
+ for (const [k, v] of Object.entries(themeVars)) {
5275
+ el.style.setProperty(k, String(v));
5276
+ }
5277
+ }
5278
+ }, [mode, dir, themeVars, portalEl]);
5279
+ const ctxValue = useMemo4(
5280
+ () => ({ dir, locale: resolvedLocale, mode, rootEl, portalEl }),
5281
+ [dir, resolvedLocale, mode, rootEl, portalEl]
5282
+ );
5283
+ const inner = /* @__PURE__ */ jsx46(DirectionPrimitive.Provider, { dir, children });
5284
+ return /* @__PURE__ */ jsx46(DgaContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx46(
5285
+ Component,
5286
+ {
5287
+ ref: setRootEl,
5288
+ dir,
5289
+ lang: resolvedLocale,
5290
+ "data-slot": "dga-root",
5291
+ "data-theme": mode,
5292
+ className,
5293
+ style: { colorScheme: mode, ...themeVars ?? {}, ...consumerStyle },
5294
+ children: isNested ? inner : /* @__PURE__ */ jsx46(TooltipPrimitive2.Provider, { delayDuration: 300, skipDelayDuration: 100, children: inner })
5295
+ }
5296
+ ) });
4097
5297
  }
4098
5298
  export {
4099
5299
  Accordion,
@@ -4158,9 +5358,28 @@ export {
4158
5358
  DropdownMenuSubContent,
4159
5359
  DropdownMenuSubTrigger,
4160
5360
  DropdownMenuTrigger,
5361
+ EmptyState,
5362
+ EmptyStateActions,
5363
+ EmptyStateDescription,
5364
+ EmptyStateMedia,
5365
+ EmptyStateTitle,
4161
5366
  FieldMessage,
4162
5367
  FileUpload,
4163
5368
  Input,
5369
+ Menubar,
5370
+ MenubarCheckboxItem,
5371
+ MenubarContent,
5372
+ MenubarGroup,
5373
+ MenubarItem,
5374
+ MenubarLabel,
5375
+ MenubarMenu,
5376
+ MenubarRadioGroup,
5377
+ MenubarRadioItem,
5378
+ MenubarSeparator,
5379
+ MenubarSub,
5380
+ MenubarSubContent,
5381
+ MenubarSubTrigger,
5382
+ MenubarTrigger,
4164
5383
  Modal,
4165
5384
  ModalClose,
4166
5385
  ModalContent,
@@ -4177,15 +5396,48 @@ export {
4177
5396
  PaginationLink,
4178
5397
  PaginationNext,
4179
5398
  PaginationPrevious,
5399
+ Popover,
5400
+ PopoverAnchor,
5401
+ PopoverClose,
5402
+ PopoverContent,
5403
+ PopoverTrigger,
4180
5404
  Progress,
4181
5405
  Radio,
4182
5406
  RadioGroup,
4183
5407
  Rating,
5408
+ ScrollArea,
4184
5409
  Select,
4185
5410
  SelectItem,
5411
+ Sidebar,
5412
+ SidebarContent,
5413
+ SidebarFooter,
5414
+ SidebarGroup,
5415
+ SidebarGroupAction,
5416
+ SidebarGroupContent,
5417
+ SidebarGroupLabel,
5418
+ SidebarHeader,
5419
+ SidebarInset,
5420
+ SidebarMenu,
5421
+ SidebarMenuAction,
5422
+ SidebarMenuBadge,
5423
+ SidebarMenuButton,
5424
+ SidebarMenuItem,
5425
+ SidebarMenuSkeleton,
5426
+ SidebarMenuSub,
5427
+ SidebarMenuSubButton,
5428
+ SidebarMenuSubItem,
5429
+ SidebarProvider,
5430
+ SidebarRail,
5431
+ SidebarSeparator,
5432
+ SidebarTrigger,
4186
5433
  Skeleton,
4187
5434
  Slider,
4188
5435
  Spinner,
5436
+ Stat,
5437
+ StatChange,
5438
+ StatGroup,
5439
+ StatLabel,
5440
+ StatValue,
4189
5441
  Step,
4190
5442
  StepDescription,
4191
5443
  StepIndicator,
@@ -4197,6 +5449,13 @@ export {
4197
5449
  TabsList,
4198
5450
  TabsTrigger,
4199
5451
  Textarea,
5452
+ Timeline,
5453
+ TimelineContent,
5454
+ TimelineDescription,
5455
+ TimelineItem,
5456
+ TimelineMarker,
5457
+ TimelineTime,
5458
+ TimelineTitle,
4200
5459
  Toaster,
4201
5460
  Toggle,
4202
5461
  ToggleGroup,
@@ -4223,25 +5482,36 @@ export {
4223
5482
  dividerVariants,
4224
5483
  drawerVariants,
4225
5484
  dropdownMenuVariants,
5485
+ emptyStateVariants,
4226
5486
  inputVariants,
5487
+ menubarContentVariants,
5488
+ menubarTriggerVariants,
4227
5489
  modalContentVariants,
4228
5490
  numberInputVariants,
4229
5491
  paginationLinkVariants,
4230
5492
  paginationVariants,
5493
+ popoverContentVariants,
4231
5494
  progressVariants,
4232
5495
  radioGroupVariants,
4233
5496
  radioVariants,
4234
5497
  ratingVariants,
5498
+ scrollAreaVariants,
4235
5499
  selectTriggerVariants,
5500
+ sidebarMenuButtonVariants,
5501
+ sidebarMenuSubButtonVariants,
4236
5502
  skeletonVariants,
4237
5503
  sliderVariants,
4238
5504
  spinnerVariants,
5505
+ statGroupVariants,
5506
+ statVariants,
4239
5507
  stepVariants,
4240
5508
  stepsVariants,
4241
5509
  switchVariants,
4242
5510
  tabsListVariants,
4243
5511
  tabsVariants,
4244
5512
  textareaVariants,
5513
+ timelineMarkerVariants,
5514
+ timelineVariants,
4245
5515
  toast,
4246
5516
  toastStore,
4247
5517
  toastVariants,
@@ -4251,6 +5521,8 @@ export {
4251
5521
  tooltipContentVariants,
4252
5522
  useDga,
4253
5523
  useDir,
4254
- useFieldA11y
5524
+ useFieldA11y,
5525
+ useIsMobile,
5526
+ useSidebar
4255
5527
  };
4256
5528
  //# sourceMappingURL=index.js.map