@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.cjs +354 -109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +304 -2
- package/dist/index.d.ts +304 -2
- package/dist/index.js +333 -112
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.cjs
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var React10 = require('react');
|
|
4
4
|
var ReactDOM = require('react-dom');
|
|
5
|
-
var
|
|
5
|
+
var RadixAlertDialog = require('@radix-ui/react-alert-dialog');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var lucideReact = require('lucide-react');
|
|
10
|
+
var reactDirection = require('@radix-ui/react-direction');
|
|
10
11
|
var RadixPopover = require('@radix-ui/react-popover');
|
|
11
12
|
var reactDayPicker = require('react-day-picker');
|
|
12
13
|
var RadixDialog = require('@radix-ui/react-dialog');
|
|
@@ -15,6 +16,8 @@ var reactHookForm = require('react-hook-form');
|
|
|
15
16
|
var RadixSelect = require('@radix-ui/react-select');
|
|
16
17
|
var RadixRadioGroup = require('@radix-ui/react-radio-group');
|
|
17
18
|
var RadixSwitch = require('@radix-ui/react-switch');
|
|
19
|
+
var sonner = require('sonner');
|
|
20
|
+
var RadixTooltip = require('@radix-ui/react-tooltip');
|
|
18
21
|
|
|
19
22
|
function _interopNamespace(e) {
|
|
20
23
|
if (e && e.__esModule) return e;
|
|
@@ -36,12 +39,14 @@ function _interopNamespace(e) {
|
|
|
36
39
|
|
|
37
40
|
var React10__namespace = /*#__PURE__*/_interopNamespace(React10);
|
|
38
41
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
42
|
+
var RadixAlertDialog__namespace = /*#__PURE__*/_interopNamespace(RadixAlertDialog);
|
|
39
43
|
var RadixPopover__namespace = /*#__PURE__*/_interopNamespace(RadixPopover);
|
|
40
44
|
var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
41
45
|
var RadixDropdown__namespace = /*#__PURE__*/_interopNamespace(RadixDropdown);
|
|
42
46
|
var RadixSelect__namespace = /*#__PURE__*/_interopNamespace(RadixSelect);
|
|
43
47
|
var RadixRadioGroup__namespace = /*#__PURE__*/_interopNamespace(RadixRadioGroup);
|
|
44
48
|
var RadixSwitch__namespace = /*#__PURE__*/_interopNamespace(RadixSwitch);
|
|
49
|
+
var RadixTooltip__namespace = /*#__PURE__*/_interopNamespace(RadixTooltip);
|
|
45
50
|
|
|
46
51
|
var __create = Object.create;
|
|
47
52
|
var __defProp = Object.defineProperty;
|
|
@@ -430,7 +435,7 @@ function createBrowserURLImpl(to, isAbsolute = false) {
|
|
|
430
435
|
}
|
|
431
436
|
return new URL(href2, base);
|
|
432
437
|
}
|
|
433
|
-
function
|
|
438
|
+
function createContext6(defaultValue) {
|
|
434
439
|
return { defaultValue };
|
|
435
440
|
}
|
|
436
441
|
function isUnsupportedLazyRouteObjectKey(key) {
|
|
@@ -10508,7 +10513,7 @@ function encodeLocation(to) {
|
|
|
10508
10513
|
hash: encoded.hash
|
|
10509
10514
|
};
|
|
10510
10515
|
}
|
|
10511
|
-
var __typeError, __accessCheck, __privateGet, __privateAdd, __privateSet,
|
|
10516
|
+
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;
|
|
10512
10517
|
var init_chunk_5KNZJZUH = __esm({
|
|
10513
10518
|
"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"() {
|
|
10514
10519
|
__typeError = (msg) => {
|
|
@@ -10518,12 +10523,12 @@ var init_chunk_5KNZJZUH = __esm({
|
|
|
10518
10523
|
__privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
10519
10524
|
__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);
|
|
10520
10525
|
__privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
return
|
|
10526
|
-
})(
|
|
10526
|
+
Action2 = /* @__PURE__ */ ((Action22) => {
|
|
10527
|
+
Action22["Pop"] = "POP";
|
|
10528
|
+
Action22["Push"] = "PUSH";
|
|
10529
|
+
Action22["Replace"] = "REPLACE";
|
|
10530
|
+
return Action22;
|
|
10531
|
+
})(Action2 || {});
|
|
10527
10532
|
PopStateEventType = "popstate";
|
|
10528
10533
|
RouterContextProvider = class {
|
|
10529
10534
|
/**
|
|
@@ -15148,7 +15153,7 @@ var init_dom_export = __esm({
|
|
|
15148
15153
|
ssrInfo = null;
|
|
15149
15154
|
router = null;
|
|
15150
15155
|
defaultManifestPath2 = "/__manifest";
|
|
15151
|
-
renderedRoutesContext =
|
|
15156
|
+
renderedRoutesContext = createContext6();
|
|
15152
15157
|
nextPaths2 = /* @__PURE__ */ new Set();
|
|
15153
15158
|
discoveredPathsMaxSize2 = 1e3;
|
|
15154
15159
|
discoveredPaths2 = /* @__PURE__ */ new Set();
|
|
@@ -15171,7 +15176,7 @@ __export(development_exports, {
|
|
|
15171
15176
|
Meta: () => Meta,
|
|
15172
15177
|
NavLink: () => NavLink,
|
|
15173
15178
|
Navigate: () => Navigate,
|
|
15174
|
-
NavigationType: () =>
|
|
15179
|
+
NavigationType: () => Action2,
|
|
15175
15180
|
Outlet: () => Outlet,
|
|
15176
15181
|
PrefetchPageLinks: () => PrefetchPageLinks,
|
|
15177
15182
|
Route: () => Route,
|
|
@@ -15222,7 +15227,7 @@ __export(development_exports, {
|
|
|
15222
15227
|
UNSAFE_withErrorBoundaryProps: () => withErrorBoundaryProps,
|
|
15223
15228
|
UNSAFE_withHydrateFallbackProps: () => withHydrateFallbackProps,
|
|
15224
15229
|
createBrowserRouter: () => createBrowserRouter,
|
|
15225
|
-
createContext: () =>
|
|
15230
|
+
createContext: () => createContext6,
|
|
15226
15231
|
createCookie: () => createCookie,
|
|
15227
15232
|
createCookieSessionStorage: () => createCookieSessionStorage,
|
|
15228
15233
|
createHashRouter: () => createHashRouter,
|
|
@@ -15327,6 +15332,225 @@ var require_dist2 = __commonJS({
|
|
|
15327
15332
|
__reExport(index_exports, (init_development(), __toCommonJS(development_exports)), module.exports);
|
|
15328
15333
|
}
|
|
15329
15334
|
});
|
|
15335
|
+
function cn(...inputs) {
|
|
15336
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
15337
|
+
}
|
|
15338
|
+
|
|
15339
|
+
// src/components/dialog/dialogVariants.ts
|
|
15340
|
+
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";
|
|
15341
|
+
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";
|
|
15342
|
+
var dialogHeaderClass = "flex flex-col gap-1.5 text-start";
|
|
15343
|
+
var dialogTitleClass = "text-lg font-semibold text-foreground";
|
|
15344
|
+
var dialogDescriptionClass = "text-sm text-muted-foreground";
|
|
15345
|
+
var dialogFooterClass = "flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-end";
|
|
15346
|
+
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";
|
|
15347
|
+
var AlertDialog = RadixAlertDialog__namespace.Root;
|
|
15348
|
+
var AlertDialogTrigger = RadixAlertDialog__namespace.Trigger;
|
|
15349
|
+
var AlertDialogPortal = RadixAlertDialog__namespace.Portal;
|
|
15350
|
+
var AlertDialogAction = RadixAlertDialog__namespace.Action;
|
|
15351
|
+
var AlertDialogCancel = RadixAlertDialog__namespace.Cancel;
|
|
15352
|
+
var AlertDialogOverlay = React10.forwardRef(function AlertDialogOverlay2({ className, ...props }, ref) {
|
|
15353
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15354
|
+
RadixAlertDialog__namespace.Overlay,
|
|
15355
|
+
{
|
|
15356
|
+
ref,
|
|
15357
|
+
"data-slot": "alert-dialog-overlay",
|
|
15358
|
+
className: cn(dialogOverlayClass, className),
|
|
15359
|
+
...props
|
|
15360
|
+
}
|
|
15361
|
+
);
|
|
15362
|
+
});
|
|
15363
|
+
var AlertDialogContent = React10.forwardRef(function AlertDialogContent2({ className, ...props }, ref) {
|
|
15364
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RadixAlertDialog__namespace.Portal, { children: [
|
|
15365
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
|
|
15366
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15367
|
+
RadixAlertDialog__namespace.Content,
|
|
15368
|
+
{
|
|
15369
|
+
ref,
|
|
15370
|
+
"data-slot": "alert-dialog-content",
|
|
15371
|
+
className: cn(dialogContentClass, className),
|
|
15372
|
+
...props
|
|
15373
|
+
}
|
|
15374
|
+
)
|
|
15375
|
+
] });
|
|
15376
|
+
});
|
|
15377
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
15378
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "alert-dialog-header", className: cn(dialogHeaderClass, className), ...props });
|
|
15379
|
+
}
|
|
15380
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
15381
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "alert-dialog-footer", className: cn(dialogFooterClass, className), ...props });
|
|
15382
|
+
}
|
|
15383
|
+
var AlertDialogTitle = React10.forwardRef(function AlertDialogTitle2({ className, ...props }, ref) {
|
|
15384
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15385
|
+
RadixAlertDialog__namespace.Title,
|
|
15386
|
+
{
|
|
15387
|
+
ref,
|
|
15388
|
+
"data-slot": "alert-dialog-title",
|
|
15389
|
+
className: cn(dialogTitleClass, className),
|
|
15390
|
+
...props
|
|
15391
|
+
}
|
|
15392
|
+
);
|
|
15393
|
+
});
|
|
15394
|
+
var AlertDialogDescription = React10.forwardRef(function AlertDialogDescription2({ className, ...props }, ref) {
|
|
15395
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15396
|
+
RadixAlertDialog__namespace.Description,
|
|
15397
|
+
{
|
|
15398
|
+
ref,
|
|
15399
|
+
"data-slot": "alert-dialog-description",
|
|
15400
|
+
className: cn(dialogDescriptionClass, className),
|
|
15401
|
+
...props
|
|
15402
|
+
}
|
|
15403
|
+
);
|
|
15404
|
+
});
|
|
15405
|
+
|
|
15406
|
+
// src/components/button/buttonVariants.ts
|
|
15407
|
+
var buttonVariantClass = {
|
|
15408
|
+
primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 focus-visible:ring-primary/40",
|
|
15409
|
+
secondary: "bg-muted text-foreground hover:bg-muted/80 focus-visible:ring-muted-foreground/30",
|
|
15410
|
+
outline: "border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
|
|
15411
|
+
ghost: "bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
|
|
15412
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 focus-visible:ring-destructive/40",
|
|
15413
|
+
success: "bg-success text-success-foreground shadow-sm hover:bg-success/90 focus-visible:ring-success/40",
|
|
15414
|
+
warning: "bg-warning text-warning-foreground shadow-sm hover:bg-warning/90 focus-visible:ring-warning/40",
|
|
15415
|
+
link: "text-primary underline-offset-4 hover:underline focus-visible:ring-primary/40 px-0 shadow-none"
|
|
15416
|
+
};
|
|
15417
|
+
var buttonSizeClass = {
|
|
15418
|
+
sm: "h-8 gap-1.5 rounded-md px-3 text-sm",
|
|
15419
|
+
md: "h-9 gap-2 rounded-md px-4 text-sm",
|
|
15420
|
+
lg: "h-11 gap-2.5 rounded-md px-6 text-base",
|
|
15421
|
+
icon: "h-9 w-9 shrink-0 rounded-md p-0",
|
|
15422
|
+
"icon-sm": "h-8 w-8 shrink-0 rounded-md p-0"
|
|
15423
|
+
};
|
|
15424
|
+
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";
|
|
15425
|
+
var Button = React10.forwardRef(function Button2({
|
|
15426
|
+
variant = "primary",
|
|
15427
|
+
size = "md",
|
|
15428
|
+
loading = false,
|
|
15429
|
+
loadingText,
|
|
15430
|
+
leadingIcon,
|
|
15431
|
+
trailingIcon,
|
|
15432
|
+
fullWidth = false,
|
|
15433
|
+
asChild = false,
|
|
15434
|
+
type,
|
|
15435
|
+
disabled,
|
|
15436
|
+
className,
|
|
15437
|
+
children,
|
|
15438
|
+
...props
|
|
15439
|
+
}, ref) {
|
|
15440
|
+
const isDisabled = disabled || loading;
|
|
15441
|
+
const composedClass = cn(
|
|
15442
|
+
buttonBaseClass,
|
|
15443
|
+
buttonVariantClass[variant],
|
|
15444
|
+
buttonSizeClass[size],
|
|
15445
|
+
fullWidth && "w-full",
|
|
15446
|
+
className
|
|
15447
|
+
);
|
|
15448
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15449
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: leadingIcon }) : null,
|
|
15450
|
+
loading && loadingText !== void 0 ? loadingText : children,
|
|
15451
|
+
!loading && trailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: trailingIcon }) : null
|
|
15452
|
+
] });
|
|
15453
|
+
if (asChild) {
|
|
15454
|
+
const child = React10.Children.only(children);
|
|
15455
|
+
if (!React10.isValidElement(child)) {
|
|
15456
|
+
throw new Error("Button: `asChild` requires a single valid React element as a child.");
|
|
15457
|
+
}
|
|
15458
|
+
const mergedClassName = cn(composedClass, child.props.className);
|
|
15459
|
+
return React10.cloneElement(child, {
|
|
15460
|
+
...child.props,
|
|
15461
|
+
className: mergedClassName,
|
|
15462
|
+
"aria-disabled": isDisabled ? true : void 0,
|
|
15463
|
+
"data-loading": loading ? "true" : void 0,
|
|
15464
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15465
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: leadingIcon }) : null,
|
|
15466
|
+
loading && loadingText !== void 0 ? loadingText : child.props.children,
|
|
15467
|
+
!loading && trailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: trailingIcon }) : null
|
|
15468
|
+
] })
|
|
15469
|
+
});
|
|
15470
|
+
}
|
|
15471
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15472
|
+
"button",
|
|
15473
|
+
{
|
|
15474
|
+
ref,
|
|
15475
|
+
type: type ?? "button",
|
|
15476
|
+
disabled: isDisabled,
|
|
15477
|
+
"data-loading": loading ? "true" : void 0,
|
|
15478
|
+
className: composedClass,
|
|
15479
|
+
...props,
|
|
15480
|
+
children: content
|
|
15481
|
+
}
|
|
15482
|
+
);
|
|
15483
|
+
});
|
|
15484
|
+
function Slot({ children }) {
|
|
15485
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "inline-flex h-4 w-4 items-center justify-center", children });
|
|
15486
|
+
}
|
|
15487
|
+
function Spinner() {
|
|
15488
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { "aria-hidden": "true", className: "h-4 w-4 animate-spin", "data-testid": "button-spinner" });
|
|
15489
|
+
}
|
|
15490
|
+
var ConfirmDialogContext = React10.createContext(null);
|
|
15491
|
+
function ConfirmDialogProvider({ labels, children }) {
|
|
15492
|
+
const [pending, setPending] = React10.useState(null);
|
|
15493
|
+
const pendingRef = React10.useRef(null);
|
|
15494
|
+
pendingRef.current = pending;
|
|
15495
|
+
const confirm = React10.useCallback((options) => {
|
|
15496
|
+
return new Promise((resolve) => {
|
|
15497
|
+
const prior = pendingRef.current;
|
|
15498
|
+
if (prior) {
|
|
15499
|
+
prior.resolve(false);
|
|
15500
|
+
}
|
|
15501
|
+
setPending({ options, resolve });
|
|
15502
|
+
});
|
|
15503
|
+
}, []);
|
|
15504
|
+
const resolveWith = React10.useCallback((value) => {
|
|
15505
|
+
const current = pendingRef.current;
|
|
15506
|
+
if (!current) return;
|
|
15507
|
+
current.resolve(value);
|
|
15508
|
+
setPending(null);
|
|
15509
|
+
}, []);
|
|
15510
|
+
const confirmLabel = pending?.options.confirmLabel ?? labels?.confirm ?? "Confirm";
|
|
15511
|
+
const cancelLabel = pending?.options.cancelLabel ?? labels?.cancel ?? "Cancel";
|
|
15512
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ConfirmDialogContext.Provider, { value: confirm, children: [
|
|
15513
|
+
children,
|
|
15514
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15515
|
+
AlertDialog,
|
|
15516
|
+
{
|
|
15517
|
+
open: pending !== null,
|
|
15518
|
+
onOpenChange: (open) => {
|
|
15519
|
+
if (!open) resolveWith(false);
|
|
15520
|
+
},
|
|
15521
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogContent, { children: [
|
|
15522
|
+
/* @__PURE__ */ jsxRuntime.jsxs(AlertDialogHeader, { children: [
|
|
15523
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogTitle, { children: pending?.options.title }),
|
|
15524
|
+
pending?.options.description !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(AlertDialogDescription, { children: pending.options.description }) : (
|
|
15525
|
+
// Radix logs a warning when AlertDialogDescription is missing —
|
|
15526
|
+
// always render a node even if the consumer didn't supply text.
|
|
15527
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogDescription, { className: "sr-only", children: pending?.options.title })
|
|
15528
|
+
)
|
|
15529
|
+
] }),
|
|
15530
|
+
/* @__PURE__ */ jsxRuntime.jsxs(AlertDialogFooter, { children: [
|
|
15531
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogCancel, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: () => resolveWith(false), children: cancelLabel }) }),
|
|
15532
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogAction, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15533
|
+
Button,
|
|
15534
|
+
{
|
|
15535
|
+
type: "button",
|
|
15536
|
+
variant: pending?.options.destructive ? "destructive" : "primary",
|
|
15537
|
+
onClick: () => resolveWith(true),
|
|
15538
|
+
children: confirmLabel
|
|
15539
|
+
}
|
|
15540
|
+
) })
|
|
15541
|
+
] })
|
|
15542
|
+
] })
|
|
15543
|
+
}
|
|
15544
|
+
)
|
|
15545
|
+
] });
|
|
15546
|
+
}
|
|
15547
|
+
function useConfirm() {
|
|
15548
|
+
const fn = React10.useContext(ConfirmDialogContext);
|
|
15549
|
+
if (!fn) {
|
|
15550
|
+
throw new Error("useConfirm() must be used inside <ConfirmDialogProvider>");
|
|
15551
|
+
}
|
|
15552
|
+
return React10.useMemo(() => fn, [fn]);
|
|
15553
|
+
}
|
|
15330
15554
|
function readDocumentDirection() {
|
|
15331
15555
|
if (typeof document === "undefined") return "ltr";
|
|
15332
15556
|
const dir = document.documentElement.getAttribute("dir");
|
|
@@ -15355,9 +15579,6 @@ function useDashboardLayout() {
|
|
|
15355
15579
|
}
|
|
15356
15580
|
return ctx;
|
|
15357
15581
|
}
|
|
15358
|
-
function cn(...inputs) {
|
|
15359
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
15360
|
-
}
|
|
15361
15582
|
function DashboardContent({ className, children, ...props }) {
|
|
15362
15583
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15363
15584
|
"main",
|
|
@@ -15455,91 +15676,6 @@ function DashboardHeader({ className, children, ...props }) {
|
|
|
15455
15676
|
function HeaderActions({ className, children, ...props }) {
|
|
15456
15677
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("ms-auto flex items-center gap-1", className), ...props, children });
|
|
15457
15678
|
}
|
|
15458
|
-
|
|
15459
|
-
// src/components/button/buttonVariants.ts
|
|
15460
|
-
var buttonVariantClass = {
|
|
15461
|
-
primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 focus-visible:ring-primary/40",
|
|
15462
|
-
secondary: "bg-muted text-foreground hover:bg-muted/80 focus-visible:ring-muted-foreground/30",
|
|
15463
|
-
outline: "border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
|
|
15464
|
-
ghost: "bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
|
|
15465
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 focus-visible:ring-destructive/40",
|
|
15466
|
-
success: "bg-success text-success-foreground shadow-sm hover:bg-success/90 focus-visible:ring-success/40",
|
|
15467
|
-
warning: "bg-warning text-warning-foreground shadow-sm hover:bg-warning/90 focus-visible:ring-warning/40",
|
|
15468
|
-
link: "text-primary underline-offset-4 hover:underline focus-visible:ring-primary/40 px-0 shadow-none"
|
|
15469
|
-
};
|
|
15470
|
-
var buttonSizeClass = {
|
|
15471
|
-
sm: "h-8 gap-1.5 rounded-md px-3 text-sm",
|
|
15472
|
-
md: "h-9 gap-2 rounded-md px-4 text-sm",
|
|
15473
|
-
lg: "h-11 gap-2.5 rounded-md px-6 text-base",
|
|
15474
|
-
icon: "h-9 w-9 shrink-0 rounded-md p-0",
|
|
15475
|
-
"icon-sm": "h-8 w-8 shrink-0 rounded-md p-0"
|
|
15476
|
-
};
|
|
15477
|
-
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";
|
|
15478
|
-
var Button = React10.forwardRef(function Button2({
|
|
15479
|
-
variant = "primary",
|
|
15480
|
-
size = "md",
|
|
15481
|
-
loading = false,
|
|
15482
|
-
loadingText,
|
|
15483
|
-
leadingIcon,
|
|
15484
|
-
trailingIcon,
|
|
15485
|
-
fullWidth = false,
|
|
15486
|
-
asChild = false,
|
|
15487
|
-
type,
|
|
15488
|
-
disabled,
|
|
15489
|
-
className,
|
|
15490
|
-
children,
|
|
15491
|
-
...props
|
|
15492
|
-
}, ref) {
|
|
15493
|
-
const isDisabled = disabled || loading;
|
|
15494
|
-
const composedClass = cn(
|
|
15495
|
-
buttonBaseClass,
|
|
15496
|
-
buttonVariantClass[variant],
|
|
15497
|
-
buttonSizeClass[size],
|
|
15498
|
-
fullWidth && "w-full",
|
|
15499
|
-
className
|
|
15500
|
-
);
|
|
15501
|
-
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15502
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: leadingIcon }) : null,
|
|
15503
|
-
loading && loadingText !== void 0 ? loadingText : children,
|
|
15504
|
-
!loading && trailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: trailingIcon }) : null
|
|
15505
|
-
] });
|
|
15506
|
-
if (asChild) {
|
|
15507
|
-
const child = React10.Children.only(children);
|
|
15508
|
-
if (!React10.isValidElement(child)) {
|
|
15509
|
-
throw new Error("Button: `asChild` requires a single valid React element as a child.");
|
|
15510
|
-
}
|
|
15511
|
-
const mergedClassName = cn(composedClass, child.props.className);
|
|
15512
|
-
return React10.cloneElement(child, {
|
|
15513
|
-
...child.props,
|
|
15514
|
-
className: mergedClassName,
|
|
15515
|
-
"aria-disabled": isDisabled ? true : void 0,
|
|
15516
|
-
"data-loading": loading ? "true" : void 0,
|
|
15517
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15518
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : leadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: leadingIcon }) : null,
|
|
15519
|
-
loading && loadingText !== void 0 ? loadingText : child.props.children,
|
|
15520
|
-
!loading && trailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(Slot, { children: trailingIcon }) : null
|
|
15521
|
-
] })
|
|
15522
|
-
});
|
|
15523
|
-
}
|
|
15524
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15525
|
-
"button",
|
|
15526
|
-
{
|
|
15527
|
-
ref,
|
|
15528
|
-
type: type ?? "button",
|
|
15529
|
-
disabled: isDisabled,
|
|
15530
|
-
"data-loading": loading ? "true" : void 0,
|
|
15531
|
-
className: composedClass,
|
|
15532
|
-
...props,
|
|
15533
|
-
children: content
|
|
15534
|
-
}
|
|
15535
|
-
);
|
|
15536
|
-
});
|
|
15537
|
-
function Slot({ children }) {
|
|
15538
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "inline-flex h-4 w-4 items-center justify-center", children });
|
|
15539
|
-
}
|
|
15540
|
-
function Spinner() {
|
|
15541
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { "aria-hidden": "true", className: "h-4 w-4 animate-spin", "data-testid": "button-spinner" });
|
|
15542
|
-
}
|
|
15543
15679
|
function HeaderCollapseTrigger({
|
|
15544
15680
|
icon,
|
|
15545
15681
|
className,
|
|
@@ -16594,15 +16730,6 @@ function DetailPageSkeleton({ rowCount }) {
|
|
|
16594
16730
|
key
|
|
16595
16731
|
)) });
|
|
16596
16732
|
}
|
|
16597
|
-
|
|
16598
|
-
// src/components/dialog/dialogVariants.ts
|
|
16599
|
-
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";
|
|
16600
|
-
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";
|
|
16601
|
-
var dialogHeaderClass = "flex flex-col gap-1.5 text-start";
|
|
16602
|
-
var dialogTitleClass = "text-lg font-semibold text-foreground";
|
|
16603
|
-
var dialogDescriptionClass = "text-sm text-muted-foreground";
|
|
16604
|
-
var dialogFooterClass = "flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-end";
|
|
16605
|
-
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";
|
|
16606
16733
|
var Dialog = RadixDialog__namespace.Root;
|
|
16607
16734
|
var DialogTrigger = RadixDialog__namespace.Trigger;
|
|
16608
16735
|
var DialogPortal = RadixDialog__namespace.Portal;
|
|
@@ -18091,6 +18218,101 @@ var Textarea = React10.forwardRef(function Textarea2({
|
|
|
18091
18218
|
}
|
|
18092
18219
|
);
|
|
18093
18220
|
});
|
|
18221
|
+
|
|
18222
|
+
// src/components/toast/toastVariants.ts
|
|
18223
|
+
var toastClassNames = {
|
|
18224
|
+
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",
|
|
18225
|
+
title: "text-sm font-medium text-foreground",
|
|
18226
|
+
description: "text-xs text-muted-foreground",
|
|
18227
|
+
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",
|
|
18228
|
+
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",
|
|
18229
|
+
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",
|
|
18230
|
+
icon: "shrink-0",
|
|
18231
|
+
content: "flex flex-col gap-0.5 min-w-0",
|
|
18232
|
+
success: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-success)]",
|
|
18233
|
+
error: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-destructive)]",
|
|
18234
|
+
warning: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-warning)]",
|
|
18235
|
+
info: "[--normal-bg:var(--color-popover)] [--normal-border:var(--color-primary)]"
|
|
18236
|
+
};
|
|
18237
|
+
function Toaster(props) {
|
|
18238
|
+
const dir = useDirection();
|
|
18239
|
+
const defaultPosition = dir === "rtl" ? "bottom-left" : "bottom-right";
|
|
18240
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18241
|
+
sonner.Toaster,
|
|
18242
|
+
{
|
|
18243
|
+
dir,
|
|
18244
|
+
position: props.position ?? defaultPosition,
|
|
18245
|
+
richColors: props.richColors ?? true,
|
|
18246
|
+
closeButton: props.closeButton ?? true,
|
|
18247
|
+
...props,
|
|
18248
|
+
toastOptions: {
|
|
18249
|
+
...props.toastOptions,
|
|
18250
|
+
classNames: {
|
|
18251
|
+
...toastClassNames,
|
|
18252
|
+
...props.toastOptions?.classNames ?? {}
|
|
18253
|
+
}
|
|
18254
|
+
}
|
|
18255
|
+
}
|
|
18256
|
+
);
|
|
18257
|
+
}
|
|
18258
|
+
|
|
18259
|
+
// src/components/tooltip/tooltipVariants.ts
|
|
18260
|
+
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";
|
|
18261
|
+
var tooltipArrowClass = "fill-foreground";
|
|
18262
|
+
function TooltipProvider({
|
|
18263
|
+
delayDuration = 200,
|
|
18264
|
+
skipDelayDuration = 300,
|
|
18265
|
+
...props
|
|
18266
|
+
}) {
|
|
18267
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18268
|
+
RadixTooltip__namespace.Provider,
|
|
18269
|
+
{
|
|
18270
|
+
delayDuration,
|
|
18271
|
+
skipDelayDuration,
|
|
18272
|
+
...props
|
|
18273
|
+
}
|
|
18274
|
+
);
|
|
18275
|
+
}
|
|
18276
|
+
function Tooltip({
|
|
18277
|
+
content,
|
|
18278
|
+
children,
|
|
18279
|
+
side = "top",
|
|
18280
|
+
align = "center",
|
|
18281
|
+
delayDuration,
|
|
18282
|
+
disabled = false,
|
|
18283
|
+
open,
|
|
18284
|
+
defaultOpen,
|
|
18285
|
+
onOpenChange,
|
|
18286
|
+
className,
|
|
18287
|
+
sideOffset = 6
|
|
18288
|
+
}) {
|
|
18289
|
+
if (disabled || content === null || content === void 0 || content === false) {
|
|
18290
|
+
return children;
|
|
18291
|
+
}
|
|
18292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18293
|
+
RadixTooltip__namespace.Root,
|
|
18294
|
+
{
|
|
18295
|
+
open,
|
|
18296
|
+
defaultOpen,
|
|
18297
|
+
onOpenChange,
|
|
18298
|
+
delayDuration,
|
|
18299
|
+
children: [
|
|
18300
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Trigger, { asChild: true, children }),
|
|
18301
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18302
|
+
RadixTooltip__namespace.Content,
|
|
18303
|
+
{
|
|
18304
|
+
side,
|
|
18305
|
+
align,
|
|
18306
|
+
sideOffset,
|
|
18307
|
+
"data-slot": "tooltip-content",
|
|
18308
|
+
className: cn(tooltipContentClass, className),
|
|
18309
|
+
children: content
|
|
18310
|
+
}
|
|
18311
|
+
) })
|
|
18312
|
+
]
|
|
18313
|
+
}
|
|
18314
|
+
);
|
|
18315
|
+
}
|
|
18094
18316
|
/*! Bundled license information:
|
|
18095
18317
|
|
|
18096
18318
|
react-router/dist/development/chunk-5KNZJZUH.mjs:
|
|
@@ -18121,11 +18343,27 @@ react-router-dom/dist/index.js:
|
|
|
18121
18343
|
*)
|
|
18122
18344
|
*/
|
|
18123
18345
|
|
|
18346
|
+
Object.defineProperty(exports, "toast", {
|
|
18347
|
+
enumerable: true,
|
|
18348
|
+
get: function () { return sonner.toast; }
|
|
18349
|
+
});
|
|
18350
|
+
exports.AlertDialog = AlertDialog;
|
|
18351
|
+
exports.AlertDialogAction = AlertDialogAction;
|
|
18352
|
+
exports.AlertDialogCancel = AlertDialogCancel;
|
|
18353
|
+
exports.AlertDialogContent = AlertDialogContent;
|
|
18354
|
+
exports.AlertDialogDescription = AlertDialogDescription;
|
|
18355
|
+
exports.AlertDialogFooter = AlertDialogFooter;
|
|
18356
|
+
exports.AlertDialogHeader = AlertDialogHeader;
|
|
18357
|
+
exports.AlertDialogOverlay = AlertDialogOverlay;
|
|
18358
|
+
exports.AlertDialogPortal = AlertDialogPortal;
|
|
18359
|
+
exports.AlertDialogTitle = AlertDialogTitle;
|
|
18360
|
+
exports.AlertDialogTrigger = AlertDialogTrigger;
|
|
18124
18361
|
exports.AppShell = AppShell;
|
|
18125
18362
|
exports.Avatar = Avatar;
|
|
18126
18363
|
exports.Badge = Badge;
|
|
18127
18364
|
exports.Button = Button;
|
|
18128
18365
|
exports.Checkbox = Checkbox;
|
|
18366
|
+
exports.ConfirmDialogProvider = ConfirmDialogProvider;
|
|
18129
18367
|
exports.DashboardContent = DashboardContent;
|
|
18130
18368
|
exports.DashboardHeader = DashboardHeader;
|
|
18131
18369
|
exports.DashboardLayout = DashboardLayout;
|
|
@@ -18176,6 +18414,9 @@ exports.SidebarNavItem = SidebarNavItem;
|
|
|
18176
18414
|
exports.Switch = Switch;
|
|
18177
18415
|
exports.Table = Table;
|
|
18178
18416
|
exports.Textarea = Textarea;
|
|
18417
|
+
exports.Toaster = Toaster;
|
|
18418
|
+
exports.Tooltip = Tooltip;
|
|
18419
|
+
exports.TooltipProvider = TooltipProvider;
|
|
18179
18420
|
exports.badgeBaseClass = badgeBaseClass;
|
|
18180
18421
|
exports.badgeDotSizeClass = badgeDotSizeClass;
|
|
18181
18422
|
exports.badgeSizeClass = badgeSizeClass;
|
|
@@ -18273,6 +18514,10 @@ exports.textareaBaseClass = textareaBaseClass;
|
|
|
18273
18514
|
exports.textareaResizeClass = textareaResizeClass;
|
|
18274
18515
|
exports.textareaSizeClass = textareaSizeClass;
|
|
18275
18516
|
exports.textareaVariantClass = textareaVariantClass;
|
|
18517
|
+
exports.toastClassNames = toastClassNames;
|
|
18518
|
+
exports.tooltipArrowClass = tooltipArrowClass;
|
|
18519
|
+
exports.tooltipContentClass = tooltipContentClass;
|
|
18520
|
+
exports.useConfirm = useConfirm;
|
|
18276
18521
|
exports.useDashboardLayout = useDashboardLayout;
|
|
18277
18522
|
exports.useDirection = useDirection;
|
|
18278
18523
|
//# sourceMappingURL=index.cjs.map
|