@dimaan/ui 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import * as React10 from 'react';
2
- import React10__default, { createContext, forwardRef, Children, isValidElement, cloneElement, useRef, useImperativeHandle, useLayoutEffect, useId, useState, useMemo, useCallback, createElement, useEffect, useContext } from 'react';
2
+ import React10__default, { forwardRef, Children, isValidElement, cloneElement, createContext, useRef, useImperativeHandle, useLayoutEffect, useId, useState, useMemo, useCallback, createElement, useEffect, useContext } from 'react';
3
3
  import * as ReactDOM from 'react-dom';
4
- import { DirectionProvider } from '@radix-ui/react-direction';
4
+ import * as RadixAlertDialog from '@radix-ui/react-alert-dialog';
5
5
  import { clsx } from 'clsx';
6
6
  import { twMerge } from 'tailwind-merge';
7
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { Loader2, Check, Minus, Calendar, X, ChevronLeft, ChevronRight, ChevronDown, ChevronUp, ArrowLeft, Menu, FileQuestion, ChevronsUpDown, Search, RefreshCw, Inbox, SearchX } from 'lucide-react';
9
+ import { DirectionProvider } from '@radix-ui/react-direction';
9
10
  import * as RadixPopover from '@radix-ui/react-popover';
10
11
  import { DayPicker } from 'react-day-picker';
11
12
  import * as RadixDialog from '@radix-ui/react-dialog';
@@ -14,6 +15,9 @@ import { useFormContext, Controller } from 'react-hook-form';
14
15
  import * as RadixSelect from '@radix-ui/react-select';
15
16
  import * as RadixRadioGroup from '@radix-ui/react-radio-group';
16
17
  import * as RadixSwitch from '@radix-ui/react-switch';
18
+ import { Toaster as Toaster$1 } from 'sonner';
19
+ export { toast } from 'sonner';
20
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
17
21
 
18
22
  var __create = Object.create;
19
23
  var __defProp = Object.defineProperty;
@@ -402,7 +406,7 @@ function createBrowserURLImpl(to, isAbsolute = false) {
402
406
  }
403
407
  return new URL(href2, base);
404
408
  }
405
- function createContext5(defaultValue) {
409
+ function createContext6(defaultValue) {
406
410
  return { defaultValue };
407
411
  }
408
412
  function isUnsupportedLazyRouteObjectKey(key) {
@@ -10480,7 +10484,7 @@ function encodeLocation(to) {
10480
10484
  hash: encoded.hash
10481
10485
  };
10482
10486
  }
10483
- var __typeError, __accessCheck, __privateGet, __privateAdd, __privateSet, Action, PopStateEventType, _map, RouterContextProvider, unsupportedLazyRouteObjectKeys, unsupportedLazyRouteFunctionKeys, paramRe, dynamicSegmentValue, indexRouteValue, emptySegmentValue, staticSegmentValue, splatPenalty, isSplat, ABSOLUTE_URL_REGEX, isAbsoluteUrl, removeDoubleSlashes, joinPaths, removeTrailingSlash, normalizePathname, normalizeSearch, normalizeHash, DataWithResponseInit, redirect, redirectDocument, replace, ErrorResponseImpl, isBrowser, UninstrumentedSymbol, objectProtoNames, validMutationMethodsArr, validMutationMethods, validRequestMethodsArr, validRequestMethods, redirectStatusCodes, redirectPreserveMethodStatusCodes, IDLE_NAVIGATION, IDLE_FETCHER, IDLE_BLOCKER, defaultMapRouteProperties, TRANSITIONS_STORAGE_KEY, ResetLoaderDataSymbol, _routes, _branches, _hmrRoutes, _hmrBranches, DataRoutes, lazyRoutePropertyCache, loadLazyRouteProperty, lazyRouteFunctionCache, invalidProtocols, DataRouterContext, DataRouterStateContext, RSCRouterContext, ViewTransitionContext, FetchersContext, AwaitContext, AwaitContextProvider, NavigationContext, LocationContext, RouteContext, RouteErrorContext, ENABLE_DEV_WARNINGS, ERROR_DIGEST_BASE, ERROR_DIGEST_REDIRECT, ERROR_DIGEST_ROUTE_ERROR_RESPONSE, navigateEffectWarning, OutletContext, defaultErrorElement, RenderErrorBoundary, errorRedirectHandledMap, blockerId, alreadyWarned, alreadyWarned2, USE_OPTIMISTIC, useOptimisticImpl, stableUseOptimisticSetter, hydrationRouteProperties, Deferred, MemoizedDataRoutes, AwaitErrorBoundary, createRoutesFromElements, defaultMethod, defaultEncType, _formDataSupportsSubmitter, supportedFormEncTypes, HOLE, NAN, NEGATIVE_INFINITY, NEGATIVE_ZERO, NULL, POSITIVE_INFINITY, UNDEFINED, TYPE_BIGINT, TYPE_DATE, TYPE_ERROR, TYPE_MAP, TYPE_NULL_OBJECT, TYPE_PROMISE, TYPE_REGEXP, TYPE_SET, TYPE_SYMBOL, TYPE_URL, TYPE_PREVIOUS_RESOLVED, SUPPORTED_ERROR_TYPES, Deferred2, TIME_LIMIT_MS, getNow, yieldToMain, objectProtoNames2, globalObj, ESCAPE_LOOKUP, ESCAPE_REGEX, SingleFetchRedirectSymbol, SingleFetchNoResultError, SINGLE_FETCH_REDIRECT_STATUS, NO_BODY_STATUS_CODES, _isPreloadSupported, nextPaths, discoveredPathsMaxSize, discoveredPaths, URL_LIMIT, MANIFEST_VERSION_STORAGE_KEY, FrameworkContext, CRITICAL_CSS_DATA_ATTRIBUTE, isHydrated, RemixErrorBoundary, isBrowser2, ABSOLUTE_URL_REGEX2, Link, NavLink, Form, fetcherId, getUniqueFetcherId, SCROLL_RESTORATION_STORAGE_KEY, savedScrollPositions, ABSOLUTE_URL_REGEX3;
10487
+ var __typeError, __accessCheck, __privateGet, __privateAdd, __privateSet, Action2, PopStateEventType, _map, RouterContextProvider, unsupportedLazyRouteObjectKeys, unsupportedLazyRouteFunctionKeys, paramRe, dynamicSegmentValue, indexRouteValue, emptySegmentValue, staticSegmentValue, splatPenalty, isSplat, ABSOLUTE_URL_REGEX, isAbsoluteUrl, removeDoubleSlashes, joinPaths, removeTrailingSlash, normalizePathname, normalizeSearch, normalizeHash, DataWithResponseInit, redirect, redirectDocument, replace, ErrorResponseImpl, isBrowser, UninstrumentedSymbol, objectProtoNames, validMutationMethodsArr, validMutationMethods, validRequestMethodsArr, validRequestMethods, redirectStatusCodes, redirectPreserveMethodStatusCodes, IDLE_NAVIGATION, IDLE_FETCHER, IDLE_BLOCKER, defaultMapRouteProperties, TRANSITIONS_STORAGE_KEY, ResetLoaderDataSymbol, _routes, _branches, _hmrRoutes, _hmrBranches, DataRoutes, lazyRoutePropertyCache, loadLazyRouteProperty, lazyRouteFunctionCache, invalidProtocols, DataRouterContext, DataRouterStateContext, RSCRouterContext, ViewTransitionContext, FetchersContext, AwaitContext, AwaitContextProvider, NavigationContext, LocationContext, RouteContext, RouteErrorContext, ENABLE_DEV_WARNINGS, ERROR_DIGEST_BASE, ERROR_DIGEST_REDIRECT, ERROR_DIGEST_ROUTE_ERROR_RESPONSE, navigateEffectWarning, OutletContext, defaultErrorElement, RenderErrorBoundary, errorRedirectHandledMap, blockerId, alreadyWarned, alreadyWarned2, USE_OPTIMISTIC, useOptimisticImpl, stableUseOptimisticSetter, hydrationRouteProperties, Deferred, MemoizedDataRoutes, AwaitErrorBoundary, createRoutesFromElements, defaultMethod, defaultEncType, _formDataSupportsSubmitter, supportedFormEncTypes, HOLE, NAN, NEGATIVE_INFINITY, NEGATIVE_ZERO, NULL, POSITIVE_INFINITY, UNDEFINED, TYPE_BIGINT, TYPE_DATE, TYPE_ERROR, TYPE_MAP, TYPE_NULL_OBJECT, TYPE_PROMISE, TYPE_REGEXP, TYPE_SET, TYPE_SYMBOL, TYPE_URL, TYPE_PREVIOUS_RESOLVED, SUPPORTED_ERROR_TYPES, Deferred2, TIME_LIMIT_MS, getNow, yieldToMain, objectProtoNames2, globalObj, ESCAPE_LOOKUP, ESCAPE_REGEX, SingleFetchRedirectSymbol, SingleFetchNoResultError, SINGLE_FETCH_REDIRECT_STATUS, NO_BODY_STATUS_CODES, _isPreloadSupported, nextPaths, discoveredPathsMaxSize, discoveredPaths, URL_LIMIT, MANIFEST_VERSION_STORAGE_KEY, FrameworkContext, CRITICAL_CSS_DATA_ATTRIBUTE, isHydrated, RemixErrorBoundary, isBrowser2, ABSOLUTE_URL_REGEX2, Link, NavLink, Form, fetcherId, getUniqueFetcherId, SCROLL_RESTORATION_STORAGE_KEY, savedScrollPositions, ABSOLUTE_URL_REGEX3;
10484
10488
  var init_chunk_5KNZJZUH = __esm({
10485
10489
  "node_modules/.pnpm/react-router@7.15.0_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/react-router/dist/development/chunk-5KNZJZUH.mjs"() {
10486
10490
  __typeError = (msg) => {
@@ -10490,12 +10494,12 @@ var init_chunk_5KNZJZUH = __esm({
10490
10494
  __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
10491
10495
  __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10492
10496
  __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
10493
- Action = /* @__PURE__ */ ((Action2) => {
10494
- Action2["Pop"] = "POP";
10495
- Action2["Push"] = "PUSH";
10496
- Action2["Replace"] = "REPLACE";
10497
- return Action2;
10498
- })(Action || {});
10497
+ Action2 = /* @__PURE__ */ ((Action22) => {
10498
+ Action22["Pop"] = "POP";
10499
+ Action22["Push"] = "PUSH";
10500
+ Action22["Replace"] = "REPLACE";
10501
+ return Action22;
10502
+ })(Action2 || {});
10499
10503
  PopStateEventType = "popstate";
10500
10504
  RouterContextProvider = class {
10501
10505
  /**
@@ -15120,7 +15124,7 @@ var init_dom_export = __esm({
15120
15124
  ssrInfo = null;
15121
15125
  router = null;
15122
15126
  defaultManifestPath2 = "/__manifest";
15123
- renderedRoutesContext = createContext5();
15127
+ renderedRoutesContext = createContext6();
15124
15128
  nextPaths2 = /* @__PURE__ */ new Set();
15125
15129
  discoveredPathsMaxSize2 = 1e3;
15126
15130
  discoveredPaths2 = /* @__PURE__ */ new Set();
@@ -15143,7 +15147,7 @@ __export(development_exports, {
15143
15147
  Meta: () => Meta,
15144
15148
  NavLink: () => NavLink,
15145
15149
  Navigate: () => Navigate,
15146
- NavigationType: () => Action,
15150
+ NavigationType: () => Action2,
15147
15151
  Outlet: () => Outlet,
15148
15152
  PrefetchPageLinks: () => PrefetchPageLinks,
15149
15153
  Route: () => Route,
@@ -15194,7 +15198,7 @@ __export(development_exports, {
15194
15198
  UNSAFE_withErrorBoundaryProps: () => withErrorBoundaryProps,
15195
15199
  UNSAFE_withHydrateFallbackProps: () => withHydrateFallbackProps,
15196
15200
  createBrowserRouter: () => createBrowserRouter,
15197
- createContext: () => createContext5,
15201
+ createContext: () => createContext6,
15198
15202
  createCookie: () => createCookie,
15199
15203
  createCookieSessionStorage: () => createCookieSessionStorage,
15200
15204
  createHashRouter: () => createHashRouter,
@@ -15299,6 +15303,225 @@ var require_dist2 = __commonJS({
15299
15303
  __reExport(index_exports, (init_development(), __toCommonJS(development_exports)), module.exports);
15300
15304
  }
15301
15305
  });
15306
+ function cn(...inputs) {
15307
+ return twMerge(clsx(inputs));
15308
+ }
15309
+
15310
+ // src/components/dialog/dialogVariants.ts
15311
+ var dialogOverlayClass = "fixed inset-0 z-50 bg-foreground/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0";
15312
+ var dialogContentClass = "fixed start-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-border bg-background p-6 text-foreground shadow-lg outline-none rtl:translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95";
15313
+ var dialogHeaderClass = "flex flex-col gap-1.5 text-start";
15314
+ var dialogTitleClass = "text-lg font-semibold text-foreground";
15315
+ var dialogDescriptionClass = "text-sm text-muted-foreground";
15316
+ var dialogFooterClass = "flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-end";
15317
+ var dialogCloseButtonClass = "absolute end-4 top-4 inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:pointer-events-none";
15318
+ var AlertDialog = RadixAlertDialog.Root;
15319
+ var AlertDialogTrigger = RadixAlertDialog.Trigger;
15320
+ var AlertDialogPortal = RadixAlertDialog.Portal;
15321
+ var AlertDialogAction = RadixAlertDialog.Action;
15322
+ var AlertDialogCancel = RadixAlertDialog.Cancel;
15323
+ var AlertDialogOverlay = forwardRef(function AlertDialogOverlay2({ className, ...props }, ref) {
15324
+ return /* @__PURE__ */ jsx(
15325
+ RadixAlertDialog.Overlay,
15326
+ {
15327
+ ref,
15328
+ "data-slot": "alert-dialog-overlay",
15329
+ className: cn(dialogOverlayClass, className),
15330
+ ...props
15331
+ }
15332
+ );
15333
+ });
15334
+ var AlertDialogContent = forwardRef(function AlertDialogContent2({ className, ...props }, ref) {
15335
+ return /* @__PURE__ */ jsxs(RadixAlertDialog.Portal, { children: [
15336
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
15337
+ /* @__PURE__ */ jsx(
15338
+ RadixAlertDialog.Content,
15339
+ {
15340
+ ref,
15341
+ "data-slot": "alert-dialog-content",
15342
+ className: cn(dialogContentClass, className),
15343
+ ...props
15344
+ }
15345
+ )
15346
+ ] });
15347
+ });
15348
+ function AlertDialogHeader({ className, ...props }) {
15349
+ return /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-header", className: cn(dialogHeaderClass, className), ...props });
15350
+ }
15351
+ function AlertDialogFooter({ className, ...props }) {
15352
+ return /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-footer", className: cn(dialogFooterClass, className), ...props });
15353
+ }
15354
+ var AlertDialogTitle = forwardRef(function AlertDialogTitle2({ className, ...props }, ref) {
15355
+ return /* @__PURE__ */ jsx(
15356
+ RadixAlertDialog.Title,
15357
+ {
15358
+ ref,
15359
+ "data-slot": "alert-dialog-title",
15360
+ className: cn(dialogTitleClass, className),
15361
+ ...props
15362
+ }
15363
+ );
15364
+ });
15365
+ var AlertDialogDescription = forwardRef(function AlertDialogDescription2({ className, ...props }, ref) {
15366
+ return /* @__PURE__ */ jsx(
15367
+ RadixAlertDialog.Description,
15368
+ {
15369
+ ref,
15370
+ "data-slot": "alert-dialog-description",
15371
+ className: cn(dialogDescriptionClass, className),
15372
+ ...props
15373
+ }
15374
+ );
15375
+ });
15376
+
15377
+ // src/components/button/buttonVariants.ts
15378
+ var buttonVariantClass = {
15379
+ primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 focus-visible:ring-primary/40",
15380
+ secondary: "bg-muted text-foreground hover:bg-muted/80 focus-visible:ring-muted-foreground/30",
15381
+ outline: "border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
15382
+ ghost: "bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
15383
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 focus-visible:ring-destructive/40",
15384
+ success: "bg-success text-success-foreground shadow-sm hover:bg-success/90 focus-visible:ring-success/40",
15385
+ warning: "bg-warning text-warning-foreground shadow-sm hover:bg-warning/90 focus-visible:ring-warning/40",
15386
+ link: "text-primary underline-offset-4 hover:underline focus-visible:ring-primary/40 px-0 shadow-none"
15387
+ };
15388
+ var buttonSizeClass = {
15389
+ sm: "h-8 gap-1.5 rounded-md px-3 text-sm",
15390
+ md: "h-9 gap-2 rounded-md px-4 text-sm",
15391
+ lg: "h-11 gap-2.5 rounded-md px-6 text-base",
15392
+ icon: "h-9 w-9 shrink-0 rounded-md p-0",
15393
+ "icon-sm": "h-8 w-8 shrink-0 rounded-md p-0"
15394
+ };
15395
+ var buttonBaseClass = "group/button relative inline-flex items-center justify-center font-medium select-none whitespace-nowrap outline-none transition-[background-color,color,box-shadow,opacity] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";
15396
+ var Button = forwardRef(function Button2({
15397
+ variant = "primary",
15398
+ size = "md",
15399
+ loading = false,
15400
+ loadingText,
15401
+ leadingIcon,
15402
+ trailingIcon,
15403
+ fullWidth = false,
15404
+ asChild = false,
15405
+ type,
15406
+ disabled,
15407
+ className,
15408
+ children,
15409
+ ...props
15410
+ }, ref) {
15411
+ const isDisabled = disabled || loading;
15412
+ const composedClass = cn(
15413
+ buttonBaseClass,
15414
+ buttonVariantClass[variant],
15415
+ buttonSizeClass[size],
15416
+ fullWidth && "w-full",
15417
+ className
15418
+ );
15419
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
15420
+ loading ? /* @__PURE__ */ jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsx(Slot, { children: leadingIcon }) : null,
15421
+ loading && loadingText !== void 0 ? loadingText : children,
15422
+ !loading && trailingIcon ? /* @__PURE__ */ jsx(Slot, { children: trailingIcon }) : null
15423
+ ] });
15424
+ if (asChild) {
15425
+ const child = Children.only(children);
15426
+ if (!isValidElement(child)) {
15427
+ throw new Error("Button: `asChild` requires a single valid React element as a child.");
15428
+ }
15429
+ const mergedClassName = cn(composedClass, child.props.className);
15430
+ return cloneElement(child, {
15431
+ ...child.props,
15432
+ className: mergedClassName,
15433
+ "aria-disabled": isDisabled ? true : void 0,
15434
+ "data-loading": loading ? "true" : void 0,
15435
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
15436
+ loading ? /* @__PURE__ */ jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsx(Slot, { children: leadingIcon }) : null,
15437
+ loading && loadingText !== void 0 ? loadingText : child.props.children,
15438
+ !loading && trailingIcon ? /* @__PURE__ */ jsx(Slot, { children: trailingIcon }) : null
15439
+ ] })
15440
+ });
15441
+ }
15442
+ return /* @__PURE__ */ jsx(
15443
+ "button",
15444
+ {
15445
+ ref,
15446
+ type: type ?? "button",
15447
+ disabled: isDisabled,
15448
+ "data-loading": loading ? "true" : void 0,
15449
+ className: composedClass,
15450
+ ...props,
15451
+ children: content
15452
+ }
15453
+ );
15454
+ });
15455
+ function Slot({ children }) {
15456
+ return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex h-4 w-4 items-center justify-center", children });
15457
+ }
15458
+ function Spinner() {
15459
+ return /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "h-4 w-4 animate-spin", "data-testid": "button-spinner" });
15460
+ }
15461
+ var ConfirmDialogContext = createContext(null);
15462
+ function ConfirmDialogProvider({ labels, children }) {
15463
+ const [pending, setPending] = useState(null);
15464
+ const pendingRef = useRef(null);
15465
+ pendingRef.current = pending;
15466
+ const confirm = useCallback((options) => {
15467
+ return new Promise((resolve) => {
15468
+ const prior = pendingRef.current;
15469
+ if (prior) {
15470
+ prior.resolve(false);
15471
+ }
15472
+ setPending({ options, resolve });
15473
+ });
15474
+ }, []);
15475
+ const resolveWith = useCallback((value) => {
15476
+ const current = pendingRef.current;
15477
+ if (!current) return;
15478
+ current.resolve(value);
15479
+ setPending(null);
15480
+ }, []);
15481
+ const confirmLabel = pending?.options.confirmLabel ?? labels?.confirm ?? "Confirm";
15482
+ const cancelLabel = pending?.options.cancelLabel ?? labels?.cancel ?? "Cancel";
15483
+ return /* @__PURE__ */ jsxs(ConfirmDialogContext.Provider, { value: confirm, children: [
15484
+ children,
15485
+ /* @__PURE__ */ jsx(
15486
+ AlertDialog,
15487
+ {
15488
+ open: pending !== null,
15489
+ onOpenChange: (open) => {
15490
+ if (!open) resolveWith(false);
15491
+ },
15492
+ children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [
15493
+ /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
15494
+ /* @__PURE__ */ jsx(AlertDialogTitle, { children: pending?.options.title }),
15495
+ pending?.options.description !== void 0 ? /* @__PURE__ */ jsx(AlertDialogDescription, { children: pending.options.description }) : (
15496
+ // Radix logs a warning when AlertDialogDescription is missing —
15497
+ // always render a node even if the consumer didn't supply text.
15498
+ /* @__PURE__ */ jsx(AlertDialogDescription, { className: "sr-only", children: pending?.options.title })
15499
+ )
15500
+ ] }),
15501
+ /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
15502
+ /* @__PURE__ */ jsx(AlertDialogCancel, { asChild: true, children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => resolveWith(false), children: cancelLabel }) }),
15503
+ /* @__PURE__ */ jsx(AlertDialogAction, { asChild: true, children: /* @__PURE__ */ jsx(
15504
+ Button,
15505
+ {
15506
+ type: "button",
15507
+ variant: pending?.options.destructive ? "destructive" : "primary",
15508
+ onClick: () => resolveWith(true),
15509
+ children: confirmLabel
15510
+ }
15511
+ ) })
15512
+ ] })
15513
+ ] })
15514
+ }
15515
+ )
15516
+ ] });
15517
+ }
15518
+ function useConfirm() {
15519
+ const fn = useContext(ConfirmDialogContext);
15520
+ if (!fn) {
15521
+ throw new Error("useConfirm() must be used inside <ConfirmDialogProvider>");
15522
+ }
15523
+ return useMemo(() => fn, [fn]);
15524
+ }
15302
15525
  function readDocumentDirection() {
15303
15526
  if (typeof document === "undefined") return "ltr";
15304
15527
  const dir = document.documentElement.getAttribute("dir");
@@ -15327,9 +15550,6 @@ function useDashboardLayout() {
15327
15550
  }
15328
15551
  return ctx;
15329
15552
  }
15330
- function cn(...inputs) {
15331
- return twMerge(clsx(inputs));
15332
- }
15333
15553
  function DashboardContent({ className, children, ...props }) {
15334
15554
  return /* @__PURE__ */ jsx(
15335
15555
  "main",
@@ -15427,91 +15647,6 @@ function DashboardHeader({ className, children, ...props }) {
15427
15647
  function HeaderActions({ className, children, ...props }) {
15428
15648
  return /* @__PURE__ */ jsx("div", { className: cn("ms-auto flex items-center gap-1", className), ...props, children });
15429
15649
  }
15430
-
15431
- // src/components/button/buttonVariants.ts
15432
- var buttonVariantClass = {
15433
- primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 focus-visible:ring-primary/40",
15434
- secondary: "bg-muted text-foreground hover:bg-muted/80 focus-visible:ring-muted-foreground/30",
15435
- outline: "border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
15436
- ghost: "bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
15437
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 focus-visible:ring-destructive/40",
15438
- success: "bg-success text-success-foreground shadow-sm hover:bg-success/90 focus-visible:ring-success/40",
15439
- warning: "bg-warning text-warning-foreground shadow-sm hover:bg-warning/90 focus-visible:ring-warning/40",
15440
- link: "text-primary underline-offset-4 hover:underline focus-visible:ring-primary/40 px-0 shadow-none"
15441
- };
15442
- var buttonSizeClass = {
15443
- sm: "h-8 gap-1.5 rounded-md px-3 text-sm",
15444
- md: "h-9 gap-2 rounded-md px-4 text-sm",
15445
- lg: "h-11 gap-2.5 rounded-md px-6 text-base",
15446
- icon: "h-9 w-9 shrink-0 rounded-md p-0",
15447
- "icon-sm": "h-8 w-8 shrink-0 rounded-md p-0"
15448
- };
15449
- var buttonBaseClass = "group/button relative inline-flex items-center justify-center font-medium select-none whitespace-nowrap outline-none transition-[background-color,color,box-shadow,opacity] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";
15450
- var Button = forwardRef(function Button2({
15451
- variant = "primary",
15452
- size = "md",
15453
- loading = false,
15454
- loadingText,
15455
- leadingIcon,
15456
- trailingIcon,
15457
- fullWidth = false,
15458
- asChild = false,
15459
- type,
15460
- disabled,
15461
- className,
15462
- children,
15463
- ...props
15464
- }, ref) {
15465
- const isDisabled = disabled || loading;
15466
- const composedClass = cn(
15467
- buttonBaseClass,
15468
- buttonVariantClass[variant],
15469
- buttonSizeClass[size],
15470
- fullWidth && "w-full",
15471
- className
15472
- );
15473
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
15474
- loading ? /* @__PURE__ */ jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsx(Slot, { children: leadingIcon }) : null,
15475
- loading && loadingText !== void 0 ? loadingText : children,
15476
- !loading && trailingIcon ? /* @__PURE__ */ jsx(Slot, { children: trailingIcon }) : null
15477
- ] });
15478
- if (asChild) {
15479
- const child = Children.only(children);
15480
- if (!isValidElement(child)) {
15481
- throw new Error("Button: `asChild` requires a single valid React element as a child.");
15482
- }
15483
- const mergedClassName = cn(composedClass, child.props.className);
15484
- return cloneElement(child, {
15485
- ...child.props,
15486
- className: mergedClassName,
15487
- "aria-disabled": isDisabled ? true : void 0,
15488
- "data-loading": loading ? "true" : void 0,
15489
- children: /* @__PURE__ */ jsxs(Fragment, { children: [
15490
- loading ? /* @__PURE__ */ jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsx(Slot, { children: leadingIcon }) : null,
15491
- loading && loadingText !== void 0 ? loadingText : child.props.children,
15492
- !loading && trailingIcon ? /* @__PURE__ */ jsx(Slot, { children: trailingIcon }) : null
15493
- ] })
15494
- });
15495
- }
15496
- return /* @__PURE__ */ jsx(
15497
- "button",
15498
- {
15499
- ref,
15500
- type: type ?? "button",
15501
- disabled: isDisabled,
15502
- "data-loading": loading ? "true" : void 0,
15503
- className: composedClass,
15504
- ...props,
15505
- children: content
15506
- }
15507
- );
15508
- });
15509
- function Slot({ children }) {
15510
- return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex h-4 w-4 items-center justify-center", children });
15511
- }
15512
- function Spinner() {
15513
- return /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "h-4 w-4 animate-spin", "data-testid": "button-spinner" });
15514
- }
15515
15650
  function HeaderCollapseTrigger({
15516
15651
  icon,
15517
15652
  className,
@@ -16566,15 +16701,6 @@ function DetailPageSkeleton({ rowCount }) {
16566
16701
  key
16567
16702
  )) });
16568
16703
  }
16569
-
16570
- // src/components/dialog/dialogVariants.ts
16571
- var dialogOverlayClass = "fixed inset-0 z-50 bg-foreground/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0";
16572
- var dialogContentClass = "fixed start-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-border bg-background p-6 text-foreground shadow-lg outline-none rtl:translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95";
16573
- var dialogHeaderClass = "flex flex-col gap-1.5 text-start";
16574
- var dialogTitleClass = "text-lg font-semibold text-foreground";
16575
- var dialogDescriptionClass = "text-sm text-muted-foreground";
16576
- var dialogFooterClass = "flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-end";
16577
- var dialogCloseButtonClass = "absolute end-4 top-4 inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:pointer-events-none";
16578
16704
  var Dialog = RadixDialog.Root;
16579
16705
  var DialogTrigger = RadixDialog.Trigger;
16580
16706
  var DialogPortal = RadixDialog.Portal;
@@ -18063,6 +18189,101 @@ var Textarea = forwardRef(function Textarea2({
18063
18189
  }
18064
18190
  );
18065
18191
  });
18192
+
18193
+ // src/components/toast/toastVariants.ts
18194
+ var toastClassNames = {
18195
+ toast: "group/toast pointer-events-auto flex w-full items-start gap-3 rounded-md border border-border bg-popover p-4 text-sm text-popover-foreground shadow-lg",
18196
+ title: "text-sm font-medium text-foreground",
18197
+ description: "text-xs text-muted-foreground",
18198
+ actionButton: "inline-flex h-7 items-center justify-center rounded-sm bg-primary px-2 text-xs font-medium text-primary-foreground hover:bg-primary/90",
18199
+ cancelButton: "inline-flex h-7 items-center justify-center rounded-sm border border-border bg-background px-2 text-xs font-medium text-foreground hover:bg-accent",
18200
+ closeButton: "group-hover/toast:opacity-100 absolute end-2 top-2 inline-flex size-5 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
18201
+ icon: "shrink-0",
18202
+ content: "flex flex-col gap-0.5 min-w-0",
18203
+ success: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-success)]",
18204
+ error: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-destructive)]",
18205
+ warning: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-warning)]",
18206
+ info: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-primary)]"
18207
+ };
18208
+ function Toaster(props) {
18209
+ const dir = useDirection();
18210
+ const defaultPosition = dir === "rtl" ? "bottom-left" : "bottom-right";
18211
+ return /* @__PURE__ */ jsx(
18212
+ Toaster$1,
18213
+ {
18214
+ dir,
18215
+ position: props.position ?? defaultPosition,
18216
+ richColors: props.richColors ?? true,
18217
+ closeButton: props.closeButton ?? true,
18218
+ ...props,
18219
+ toastOptions: {
18220
+ ...props.toastOptions,
18221
+ classNames: {
18222
+ ...toastClassNames,
18223
+ ...props.toastOptions?.classNames ?? {}
18224
+ }
18225
+ }
18226
+ }
18227
+ );
18228
+ }
18229
+
18230
+ // src/components/tooltip/tooltipVariants.ts
18231
+ var tooltipContentClass = "z-50 max-w-xs rounded-md bg-foreground px-2.5 py-1.5 text-xs font-medium text-background shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95";
18232
+ var tooltipArrowClass = "fill-foreground";
18233
+ function TooltipProvider({
18234
+ delayDuration = 200,
18235
+ skipDelayDuration = 300,
18236
+ ...props
18237
+ }) {
18238
+ return /* @__PURE__ */ jsx(
18239
+ RadixTooltip.Provider,
18240
+ {
18241
+ delayDuration,
18242
+ skipDelayDuration,
18243
+ ...props
18244
+ }
18245
+ );
18246
+ }
18247
+ function Tooltip({
18248
+ content,
18249
+ children,
18250
+ side = "top",
18251
+ align = "center",
18252
+ delayDuration,
18253
+ disabled = false,
18254
+ open,
18255
+ defaultOpen,
18256
+ onOpenChange,
18257
+ className,
18258
+ sideOffset = 6
18259
+ }) {
18260
+ if (disabled || content === null || content === void 0 || content === false) {
18261
+ return children;
18262
+ }
18263
+ return /* @__PURE__ */ jsxs(
18264
+ RadixTooltip.Root,
18265
+ {
18266
+ open,
18267
+ defaultOpen,
18268
+ onOpenChange,
18269
+ delayDuration,
18270
+ children: [
18271
+ /* @__PURE__ */ jsx(RadixTooltip.Trigger, { asChild: true, children }),
18272
+ /* @__PURE__ */ jsx(RadixTooltip.Portal, { children: /* @__PURE__ */ jsx(
18273
+ RadixTooltip.Content,
18274
+ {
18275
+ side,
18276
+ align,
18277
+ sideOffset,
18278
+ "data-slot": "tooltip-content",
18279
+ className: cn(tooltipContentClass, className),
18280
+ children: content
18281
+ }
18282
+ ) })
18283
+ ]
18284
+ }
18285
+ );
18286
+ }
18066
18287
  /*! Bundled license information:
18067
18288
 
18068
18289
  react-router/dist/development/chunk-5KNZJZUH.mjs:
@@ -18093,6 +18314,6 @@ react-router-dom/dist/index.js:
18093
18314
  *)
18094
18315
  */
18095
18316
 
18096
- export { AppShell, Avatar, Badge, Button, Checkbox, DashboardContent, DashboardHeader, DashboardLayout, DashboardMain, DatePicker, DetailPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EmptyState, Field, FormPage, HeaderActions, HeaderCollapseTrigger, HeaderMobileTrigger, HeaderSearch, HeaderTitle, Input, LanguageSwitcher, ListPage, PageHeader, RadioGroup, RadioGroupItem, Select, Sidebar, SidebarFooter, SidebarGroup, SidebarHeader, SidebarNav, SidebarNavGroup, SidebarNavItem, Switch, Table, Textarea, badgeBaseClass, badgeDotSizeClass, badgeSizeClass, badgeVariantClass, buttonBaseClass, buttonSizeClass, buttonVariantClass, cn, datePickerCalendarClass, datePickerCaptionClass, datePickerContentClass, datePickerDayBaseClass, datePickerDayWrapperClass, datePickerDisabledClass, datePickerMonthClass, datePickerMonthGridClass, datePickerMonthsClass, datePickerNavButtonClass, datePickerNavClass, datePickerOutsideClass, datePickerPlaceholderClass, datePickerSelectedClass, datePickerTodayClass, datePickerTriggerBaseClass, datePickerTriggerSizeClass, datePickerTriggerVariantClass, datePickerValueClass, datePickerWeekClass, datePickerWeekdayClass, datePickerWeekdaysClass, detailPageBaseClass, detailPageBodyClass, detailPageEmptyClass, detailPageSkeletonRowClass, dialogCloseButtonClass, dialogContentClass, dialogDescriptionClass, dialogFooterClass, dialogHeaderClass, dialogOverlayClass, dialogTitleClass, dropdownMenuContentClass, dropdownMenuItemBaseClass, dropdownMenuItemInsetClass, dropdownMenuItemVariantClass, dropdownMenuLabelClass, dropdownMenuSeparatorClass, dropdownMenuShortcutClass, emptyStateActionsSpacingClass, emptyStateBaseClass, emptyStateContainerSizeClass, emptyStateDescriptionSizeClass, emptyStateIconWrapperBaseClass, emptyStateIconWrapperSizeClass, emptyStateTitleSizeClass, formPageActionsBarClass, formPageBaseClass, formPageBodyClass, formPageSkeletonRowClass, inputBaseClass, inputSizeClass, inputVariantClass, pageHeaderActionsClass, pageHeaderBackClass, pageHeaderBackIconClass, pageHeaderBaseClass, pageHeaderBorderedClass, pageHeaderBreadcrumbsClass, pageHeaderDescriptionClass, pageHeaderTitleBlockClass, pageHeaderTitleClass, pageHeaderTitleRowClass, radioGroupBaseClass, radioGroupOrientationClass, radioIndicatorBaseClass, radioIndicatorDotClass, radioIndicatorSizeClass, radioItemBaseClass, radioItemSizeClass, radioLabelSizeClass, radioOptionRowClass, selectBaseClass, selectSizeClass, selectVariantClass, switchThumbBaseClass, switchThumbClass, switchTrackBaseClass, switchTrackClass, alignClass as tableAlignClass, tableBaseClass, selectedRowClass as tableSelectedRowClass, tableSizeClass, sortIconClass as tableSortIconClass, textareaBaseClass, textareaResizeClass, textareaSizeClass, textareaVariantClass, useDashboardLayout, useDirection };
18317
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, Avatar, Badge, Button, Checkbox, ConfirmDialogProvider, DashboardContent, DashboardHeader, DashboardLayout, DashboardMain, DatePicker, DetailPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EmptyState, Field, FormPage, HeaderActions, HeaderCollapseTrigger, HeaderMobileTrigger, HeaderSearch, HeaderTitle, Input, LanguageSwitcher, ListPage, PageHeader, RadioGroup, RadioGroupItem, Select, Sidebar, SidebarFooter, SidebarGroup, SidebarHeader, SidebarNav, SidebarNavGroup, SidebarNavItem, Switch, Table, Textarea, Toaster, Tooltip, TooltipProvider, badgeBaseClass, badgeDotSizeClass, badgeSizeClass, badgeVariantClass, buttonBaseClass, buttonSizeClass, buttonVariantClass, cn, datePickerCalendarClass, datePickerCaptionClass, datePickerContentClass, datePickerDayBaseClass, datePickerDayWrapperClass, datePickerDisabledClass, datePickerMonthClass, datePickerMonthGridClass, datePickerMonthsClass, datePickerNavButtonClass, datePickerNavClass, datePickerOutsideClass, datePickerPlaceholderClass, datePickerSelectedClass, datePickerTodayClass, datePickerTriggerBaseClass, datePickerTriggerSizeClass, datePickerTriggerVariantClass, datePickerValueClass, datePickerWeekClass, datePickerWeekdayClass, datePickerWeekdaysClass, detailPageBaseClass, detailPageBodyClass, detailPageEmptyClass, detailPageSkeletonRowClass, dialogCloseButtonClass, dialogContentClass, dialogDescriptionClass, dialogFooterClass, dialogHeaderClass, dialogOverlayClass, dialogTitleClass, dropdownMenuContentClass, dropdownMenuItemBaseClass, dropdownMenuItemInsetClass, dropdownMenuItemVariantClass, dropdownMenuLabelClass, dropdownMenuSeparatorClass, dropdownMenuShortcutClass, emptyStateActionsSpacingClass, emptyStateBaseClass, emptyStateContainerSizeClass, emptyStateDescriptionSizeClass, emptyStateIconWrapperBaseClass, emptyStateIconWrapperSizeClass, emptyStateTitleSizeClass, formPageActionsBarClass, formPageBaseClass, formPageBodyClass, formPageSkeletonRowClass, inputBaseClass, inputSizeClass, inputVariantClass, pageHeaderActionsClass, pageHeaderBackClass, pageHeaderBackIconClass, pageHeaderBaseClass, pageHeaderBorderedClass, pageHeaderBreadcrumbsClass, pageHeaderDescriptionClass, pageHeaderTitleBlockClass, pageHeaderTitleClass, pageHeaderTitleRowClass, radioGroupBaseClass, radioGroupOrientationClass, radioIndicatorBaseClass, radioIndicatorDotClass, radioIndicatorSizeClass, radioItemBaseClass, radioItemSizeClass, radioLabelSizeClass, radioOptionRowClass, selectBaseClass, selectSizeClass, selectVariantClass, switchThumbBaseClass, switchThumbClass, switchTrackBaseClass, switchTrackClass, alignClass as tableAlignClass, tableBaseClass, selectedRowClass as tableSelectedRowClass, tableSizeClass, sortIconClass as tableSortIconClass, textareaBaseClass, textareaResizeClass, textareaSizeClass, textareaVariantClass, toastClassNames, tooltipArrowClass, tooltipContentClass, useConfirm, useDashboardLayout, useDirection };
18097
18318
  //# sourceMappingURL=index.js.map
18098
18319
  //# sourceMappingURL=index.js.map