@pixpilot/shadcn-ui 1.32.1 → 1.34.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.
Files changed (60) hide show
  1. package/dist/Button.d.cts +2 -2
  2. package/dist/ButtonExtended.d.cts +2 -2
  3. package/dist/Card.d.cts +3 -3
  4. package/dist/ColorSelect.d.cts +2 -2
  5. package/dist/ContentCard.d.cts +2 -2
  6. package/dist/DatePicker.d.cts +2 -2
  7. package/dist/Rating.d.cts +3 -3
  8. package/dist/Select.d.cts +2 -2
  9. package/dist/confirmation-dialog/ConfirmationDialog.cjs +4 -4
  10. package/dist/confirmation-dialog/ConfirmationDialog.d.cts +1 -1
  11. package/dist/confirmation-dialog/ConfirmationDialog.d.ts +1 -2
  12. package/dist/confirmation-dialog/ConfirmationDialog.js +4 -3
  13. package/dist/confirmation-dialog/confirmation-dialogs.cjs +7 -6
  14. package/dist/confirmation-dialog/confirmation-dialogs.d.cts +6 -1
  15. package/dist/confirmation-dialog/confirmation-dialogs.d.ts +6 -1
  16. package/dist/confirmation-dialog/confirmation-dialogs.js +7 -5
  17. package/dist/confirmation-dialog/index.cjs +0 -1
  18. package/dist/confirmation-dialog/index.d.cts +1 -2
  19. package/dist/confirmation-dialog/index.d.ts +1 -2
  20. package/dist/confirmation-dialog/index.js +1 -2
  21. package/dist/dialog/Dialog.d.cts +5 -5
  22. package/dist/dialog/Dialog.d.ts +5 -5
  23. package/dist/{confirmation-dialog → dialog-provider}/DialogProvider.cjs +1 -1
  24. package/dist/{confirmation-dialog → dialog-provider}/DialogProvider.d.cts +1 -1
  25. package/dist/{confirmation-dialog → dialog-provider}/DialogProvider.d.ts +1 -1
  26. package/dist/{confirmation-dialog → dialog-provider}/DialogProvider.js +1 -1
  27. package/dist/dialog-provider/dialog-registry.cjs +100 -0
  28. package/dist/dialog-provider/dialog-registry.d.cts +150 -0
  29. package/dist/dialog-provider/dialog-registry.d.ts +150 -0
  30. package/dist/dialog-provider/dialog-registry.js +93 -0
  31. package/dist/dialog-provider/index.cjs +4 -0
  32. package/dist/dialog-provider/index.d.cts +4 -0
  33. package/dist/dialog-provider/index.d.ts +4 -0
  34. package/dist/dialog-provider/index.js +4 -0
  35. package/dist/dialog-provider/register-dialog.cjs +64 -0
  36. package/dist/dialog-provider/register-dialog.d.cts +98 -0
  37. package/dist/dialog-provider/register-dialog.d.ts +98 -0
  38. package/dist/dialog-provider/register-dialog.js +61 -0
  39. package/dist/dialog-provider/show-dialog.cjs +30 -0
  40. package/dist/dialog-provider/show-dialog.d.cts +24 -0
  41. package/dist/dialog-provider/show-dialog.d.ts +24 -0
  42. package/dist/dialog-provider/show-dialog.js +28 -0
  43. package/dist/file-upload/FileUpload.d.cts +2 -2
  44. package/dist/file-upload/FileUpload.d.ts +2 -2
  45. package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
  46. package/dist/file-upload-inline/FileUploadInline.d.ts +2 -2
  47. package/dist/file-upload-root/FileUploadRoot.d.cts +2 -2
  48. package/dist/file-upload-root/FileUploadRoot.d.ts +2 -2
  49. package/dist/index.cjs +14 -1
  50. package/dist/index.d.cts +7 -3
  51. package/dist/index.d.ts +7 -3
  52. package/dist/index.js +7 -3
  53. package/dist/input/Input.d.cts +2 -2
  54. package/dist/tags-input/TagsInput.d.cts +2 -2
  55. package/dist/tags-input/TagsInputInline.d.cts +2 -2
  56. package/dist/theme-toggle/ThemeModeDropdown.d.cts +2 -2
  57. package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +2 -2
  58. package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +2 -2
  59. package/dist/theme-toggle/ThemeModeToggleButton.d.cts +2 -2
  60. package/package.json +1 -1
package/dist/Button.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
3
3
  import React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
@@ -27,7 +27,7 @@ interface ButtonProps extends React.ComponentProps<typeof Button>, VariantProps<
27
27
  }
28
28
  declare function Button$1(props: ButtonProps & {
29
29
  ref?: React.Ref<HTMLButtonElement>;
30
- }): react_jsx_runtime2.JSX.Element;
30
+ }): react_jsx_runtime0.JSX.Element;
31
31
  declare namespace Button$1 {
32
32
  var displayName: string;
33
33
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
3
3
  import React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
@@ -50,7 +50,7 @@ interface ButtonExtendedProps extends React.ComponentProps<typeof Button>, Varia
50
50
  }
51
51
  declare function ButtonExtended(props: ButtonExtendedProps & {
52
52
  ref?: React.Ref<HTMLButtonElement>;
53
- }): react_jsx_runtime3.JSX.Element;
53
+ }): react_jsx_runtime1.JSX.Element;
54
54
  declare namespace ButtonExtended {
55
55
  var displayName: string;
56
56
  }
package/dist/Card.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
2
2
  import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@pixpilot/shadcn";
3
3
  import React from "react";
4
4
 
@@ -6,10 +6,10 @@ import React from "react";
6
6
  declare function CardTitle$1({
7
7
  className,
8
8
  ...props
9
- }: React.ComponentProps<typeof CardTitle>): react_jsx_runtime5.JSX.Element;
9
+ }: React.ComponentProps<typeof CardTitle>): react_jsx_runtime2.JSX.Element;
10
10
  declare function CardHeader$1({
11
11
  className,
12
12
  ...props
13
- }: React.ComponentProps<typeof CardHeader>): react_jsx_runtime5.JSX.Element;
13
+ }: React.ComponentProps<typeof CardHeader>): react_jsx_runtime2.JSX.Element;
14
14
  //#endregion
15
15
  export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader$1 as CardHeader, CardTitle$1 as CardTitle };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
  import { Select, SelectContent } from "@pixpilot/shadcn";
3
3
  import React, { ComponentProps } from "react";
4
4
 
@@ -16,6 +16,6 @@ type BaseColorSelectProps = {
16
16
  placeholder?: string;
17
17
  keyboardMode?: 'cycle' | 'dropdown';
18
18
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
19
- declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime7.JSX.Element;
19
+ declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime4.JSX.Element;
20
20
  //#endregion
21
21
  export { BaseColorSelectProps, ColorSelect, ColorSelectOption };
@@ -1,5 +1,5 @@
1
1
  import { Card } from "./Card.cjs";
2
- import * as react_jsx_runtime9 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
3
  import React, { ReactNode } from "react";
4
4
 
5
5
  //#region src/ContentCard.d.ts
@@ -8,7 +8,7 @@ interface SectionCardProps extends React.ComponentProps<typeof Card> {
8
8
  children: ReactNode;
9
9
  marginBottom?: boolean;
10
10
  }
11
- declare function ContentCard(props: SectionCardProps): react_jsx_runtime9.JSX.Element;
11
+ declare function ContentCard(props: SectionCardProps): react_jsx_runtime5.JSX.Element;
12
12
  declare namespace ContentCard {
13
13
  var displayName: string;
14
14
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
  import { Calendar } from "@pixpilot/shadcn";
3
3
  import { ComponentProps } from "react";
4
4
 
@@ -9,7 +9,7 @@ type DatePickerProps = {
9
9
  onChange?: (date: Date | undefined) => void;
10
10
  placeholder?: string;
11
11
  } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
12
- declare function DatePicker(props: DatePickerProps): react_jsx_runtime8.JSX.Element;
12
+ declare function DatePicker(props: DatePickerProps): react_jsx_runtime6.JSX.Element;
13
13
  declare namespace DatePicker {
14
14
  var displayName: string;
15
15
  }
package/dist/Rating.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
2
  import * as React$1 from "react";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as class_variance_authority_types0 from "class-variance-authority/types";
@@ -35,7 +35,7 @@ declare function RatingButton({
35
35
  index,
36
36
  className,
37
37
  ...props
38
- }: RatingButtonProps): react_jsx_runtime0.JSX.Element;
38
+ }: RatingButtonProps): react_jsx_runtime7.JSX.Element;
39
39
  declare function Rating({
40
40
  value: valueProp,
41
41
  defaultValue,
@@ -53,6 +53,6 @@ declare function Rating({
53
53
  children,
54
54
  id,
55
55
  ...props
56
- }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime0.JSX.Element;
56
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime7.JSX.Element;
57
57
  //#endregion
58
58
  export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
package/dist/Select.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
  import { Select, SelectContent } from "@pixpilot/shadcn";
3
3
  import React, { ComponentProps } from "react";
4
4
 
@@ -51,6 +51,6 @@ type BaseSelectProps = {
51
51
  required?: boolean;
52
52
  className?: string;
53
53
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children' | 'disabled' | 'name' | 'required'>;
54
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime4.JSX.Element;
54
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime9.JSX.Element;
55
55
  //#endregion
56
56
  export { Select$1 as Select, SelectContentProps, SelectOption };
@@ -1,12 +1,12 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_get_id = require('../utils/get-id.cjs');
3
3
  const require_variant_config = require('../variant-config.cjs');
4
+ const require_dialog_registry = require('../dialog-provider/dialog-registry.cjs');
5
+ require('../dialog-provider/index.cjs');
4
6
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
5
7
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
6
8
  let react_jsx_runtime = require("react/jsx-runtime");
7
9
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
8
- let __ebay_nice_modal_react = require("@ebay/nice-modal-react");
9
- __ebay_nice_modal_react = require_rolldown_runtime.__toESM(__ebay_nice_modal_react);
10
10
 
11
11
  //#region src/confirmation-dialog/ConfirmationDialog.tsx
12
12
  const variantMap = {
@@ -15,9 +15,9 @@ const variantMap = {
15
15
  primary: "info",
16
16
  default: "default"
17
17
  };
18
- const ConfirmationDialog = __ebay_nice_modal_react.default.create((props) => {
18
+ const ConfirmationDialog = require_dialog_registry.dialog.create((props) => {
19
19
  const { id, title = "Confirmation Dialog", variant, showIcon = true } = props;
20
- const modal = (0, __ebay_nice_modal_react.useModal)();
20
+ const modal = require_dialog_registry.dialog.useDialog();
21
21
  const handleConfirm = () => {
22
22
  props.onConfirm?.();
23
23
  modal.resolve(true);
@@ -1,4 +1,4 @@
1
- import "react";
1
+ import "../index.cjs";
2
2
 
3
3
  //#region src/confirmation-dialog/ConfirmationDialog.d.ts
4
4
  type ConfirmationDialogVariant = 'destructive' | 'warning' | 'primary' | 'default';
@@ -1,5 +1,4 @@
1
- import "react";
2
- import "@ebay/nice-modal-react";
1
+ import "../index.js";
3
2
 
4
3
  //#region src/confirmation-dialog/ConfirmationDialog.d.ts
5
4
  type ConfirmationDialogVariant = 'destructive' | 'warning' | 'primary' | 'default';
@@ -1,8 +1,9 @@
1
1
  import { getId } from "../utils/get-id.js";
2
2
  import { variantConfig } from "../variant-config.js";
3
+ import { dialog } from "../dialog-provider/dialog-registry.js";
4
+ import "../dialog-provider/index.js";
3
5
  import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, cn } from "@pixpilot/shadcn";
4
6
  import { jsx, jsxs } from "react/jsx-runtime";
5
- import NiceModal, { useModal } from "@ebay/nice-modal-react";
6
7
 
7
8
  //#region src/confirmation-dialog/ConfirmationDialog.tsx
8
9
  const variantMap = {
@@ -11,9 +12,9 @@ const variantMap = {
11
12
  primary: "info",
12
13
  default: "default"
13
14
  };
14
- const ConfirmationDialog = NiceModal.create((props) => {
15
+ const ConfirmationDialog = dialog.create((props) => {
15
16
  const { id, title = "Confirmation Dialog", variant, showIcon = true } = props;
16
- const modal = useModal();
17
+ const modal = dialog.useDialog();
17
18
  const handleConfirm = () => {
18
19
  props.onConfirm?.();
19
20
  modal.resolve(true);
@@ -1,14 +1,15 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
1
  const require_ConfirmationDialog = require('./ConfirmationDialog.cjs');
3
- let __ebay_nice_modal_react = require("@ebay/nice-modal-react");
4
- __ebay_nice_modal_react = require_rolldown_runtime.__toESM(__ebay_nice_modal_react);
5
2
 
6
3
  //#region src/confirmation-dialog/confirmation-dialogs.tsx
7
4
  async function showConfirmDialog(props) {
8
- const id = crypto.randomUUID();
9
- __ebay_nice_modal_react.default.register(id, require_ConfirmationDialog.default);
10
- return __ebay_nice_modal_react.default.show(id, props);
5
+ return require_ConfirmationDialog.default.show(props);
11
6
  }
7
+ const confirmDialog = {
8
+ show: showConfirmDialog,
9
+ hide: require_ConfirmationDialog.default.hide,
10
+ remove: require_ConfirmationDialog.default.remove
11
+ };
12
12
 
13
13
  //#endregion
14
+ exports.confirmDialog = confirmDialog;
14
15
  exports.showConfirmDialog = showConfirmDialog;
@@ -3,5 +3,10 @@ import { ConfirmationDialogProps } from "./ConfirmationDialog.cjs";
3
3
  //#region src/confirmation-dialog/confirmation-dialogs.d.ts
4
4
  interface ConfirmDialog extends ConfirmationDialogProps {}
5
5
  declare function showConfirmDialog(props: ConfirmDialog): Promise<boolean>;
6
+ declare const confirmDialog: {
7
+ show: typeof showConfirmDialog;
8
+ hide: <TResult = unknown>() => Promise<TResult>;
9
+ remove: () => void;
10
+ };
6
11
  //#endregion
7
- export { showConfirmDialog };
12
+ export { confirmDialog, showConfirmDialog };
@@ -3,5 +3,10 @@ import { ConfirmationDialogProps } from "./ConfirmationDialog.js";
3
3
  //#region src/confirmation-dialog/confirmation-dialogs.d.ts
4
4
  interface ConfirmDialog extends ConfirmationDialogProps {}
5
5
  declare function showConfirmDialog(props: ConfirmDialog): Promise<boolean>;
6
+ declare const confirmDialog: {
7
+ show: typeof showConfirmDialog;
8
+ hide: <TResult = unknown>() => Promise<TResult>;
9
+ remove: () => void;
10
+ };
6
11
  //#endregion
7
- export { showConfirmDialog };
12
+ export { confirmDialog, showConfirmDialog };
@@ -1,12 +1,14 @@
1
1
  import ConfirmationDialog_default from "./ConfirmationDialog.js";
2
- import NiceModal from "@ebay/nice-modal-react";
3
2
 
4
3
  //#region src/confirmation-dialog/confirmation-dialogs.tsx
5
4
  async function showConfirmDialog(props) {
6
- const id = crypto.randomUUID();
7
- NiceModal.register(id, ConfirmationDialog_default);
8
- return NiceModal.show(id, props);
5
+ return ConfirmationDialog_default.show(props);
9
6
  }
7
+ const confirmDialog = {
8
+ show: showConfirmDialog,
9
+ hide: ConfirmationDialog_default.hide,
10
+ remove: ConfirmationDialog_default.remove
11
+ };
10
12
 
11
13
  //#endregion
12
- export { showConfirmDialog };
14
+ export { confirmDialog, showConfirmDialog };
@@ -3,4 +3,3 @@
3
3
 
4
4
  require('./ConfirmationDialog.cjs');
5
5
  const require_confirmation_dialogs = require('./confirmation-dialogs.cjs');
6
- const require_DialogProvider = require('./DialogProvider.cjs');
@@ -1,3 +1,2 @@
1
1
  import { ConfirmationDialogProps, ConfirmationDialogVariant } from "./ConfirmationDialog.cjs";
2
- import { showConfirmDialog } from "./confirmation-dialogs.cjs";
3
- import { DialogProvider, DialogProviderProps } from "./DialogProvider.cjs";
2
+ import { confirmDialog, showConfirmDialog } from "./confirmation-dialogs.cjs";
@@ -1,3 +1,2 @@
1
1
  import { ConfirmationDialogProps, ConfirmationDialogVariant } from "./ConfirmationDialog.js";
2
- import { showConfirmDialog } from "./confirmation-dialogs.js";
3
- import { DialogProvider, DialogProviderProps } from "./DialogProvider.js";
2
+ import { confirmDialog, showConfirmDialog } from "./confirmation-dialogs.js";
@@ -2,5 +2,4 @@
2
2
 
3
3
 
4
4
  import "./ConfirmationDialog.js";
5
- import { showConfirmDialog } from "./confirmation-dialogs.js";
6
- import { DialogProvider } from "./DialogProvider.js";
5
+ import { confirmDialog, showConfirmDialog } from "./confirmation-dialogs.js";
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime18 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
2
  import { DialogClose, DialogContent } from "@pixpilot/shadcn";
3
3
  import * as React$1 from "react";
4
4
 
@@ -10,18 +10,18 @@ declare const DialogContent$1: React$1.ForwardRefExoticComponent<DialogContentPr
10
10
  declare function DialogHeader({
11
11
  className,
12
12
  ...props
13
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime18.JSX.Element;
13
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
14
14
  declare function DialogBody({
15
15
  className,
16
16
  ...props
17
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime18.JSX.Element;
17
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
18
18
  declare function DialogFooter({
19
19
  className,
20
20
  ...props
21
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime18.JSX.Element;
21
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
22
22
  declare function DialogClose$1({
23
23
  className,
24
24
  ...props
25
- }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime18.JSX.Element;
25
+ }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime11.JSX.Element;
26
26
  //#endregion
27
27
  export { DialogBody, DialogClose$1 as DialogClose, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter, DialogHeader };
@@ -1,6 +1,6 @@
1
1
  import { DialogClose, DialogContent } from "@pixpilot/shadcn";
2
2
  import * as React$1 from "react";
3
- import * as react_jsx_runtime12 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/dialog/Dialog.d.ts
6
6
  interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogContent> {
@@ -10,18 +10,18 @@ declare const DialogContent$1: React$1.ForwardRefExoticComponent<DialogContentPr
10
10
  declare function DialogHeader$1({
11
11
  className,
12
12
  ...props
13
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime12.JSX.Element;
13
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
14
14
  declare function DialogBody({
15
15
  className,
16
16
  ...props
17
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime12.JSX.Element;
17
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
18
18
  declare function DialogFooter$1({
19
19
  className,
20
20
  ...props
21
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime12.JSX.Element;
21
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime11.JSX.Element;
22
22
  declare function DialogClose$1({
23
23
  className,
24
24
  ...props
25
- }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime12.JSX.Element;
25
+ }: React$1.ComponentPropsWithoutRef<typeof DialogClose>): react_jsx_runtime11.JSX.Element;
26
26
  //#endregion
27
27
  export { DialogBody, DialogClose$1 as DialogClose, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter$1 as DialogFooter, DialogHeader$1 as DialogHeader };
@@ -6,7 +6,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
6
6
  let __ebay_nice_modal_react = require("@ebay/nice-modal-react");
7
7
  __ebay_nice_modal_react = require_rolldown_runtime.__toESM(__ebay_nice_modal_react);
8
8
 
9
- //#region src/confirmation-dialog/DialogProvider.tsx
9
+ //#region src/dialog-provider/DialogProvider.tsx
10
10
  const DialogProviderMountedContext = (0, react.createContext)(false);
11
11
  /**
12
12
  * Guards against nested DialogProviders, which would break NiceModal.
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
 
3
- //#region src/confirmation-dialog/DialogProvider.d.ts
3
+ //#region src/dialog-provider/DialogProvider.d.ts
4
4
  interface DialogProviderProps {
5
5
  children: React.ReactNode;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
 
3
- //#region src/confirmation-dialog/DialogProvider.d.ts
3
+ //#region src/dialog-provider/DialogProvider.d.ts
4
4
  interface DialogProviderProps {
5
5
  children: React.ReactNode;
6
6
  }
@@ -2,7 +2,7 @@ import React, { createContext, use } from "react";
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import NiceModal from "@ebay/nice-modal-react";
4
4
 
5
- //#region src/confirmation-dialog/DialogProvider.tsx
5
+ //#region src/dialog-provider/DialogProvider.tsx
6
6
  const DialogProviderMountedContext = createContext(false);
7
7
  /**
8
8
  * Guards against nested DialogProviders, which would break NiceModal.
@@ -0,0 +1,100 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_register_dialog = require('./register-dialog.cjs');
3
+ const require_show_dialog = require('./show-dialog.cjs');
4
+ let __ebay_nice_modal_react = require("@ebay/nice-modal-react");
5
+ __ebay_nice_modal_react = require_rolldown_runtime.__toESM(__ebay_nice_modal_react);
6
+
7
+ //#region src/dialog-provider/dialog-registry.ts
8
+ const useDialog = __ebay_nice_modal_react.useModal;
9
+ function createDialog(component) {
10
+ const CreatedDialog = __ebay_nice_modal_react.default.create(component);
11
+ return Object.assign(CreatedDialog, {
12
+ show: async (props) => __ebay_nice_modal_react.default.show(CreatedDialog, props),
13
+ hide: async () => __ebay_nice_modal_react.default.hide(CreatedDialog),
14
+ remove: () => {
15
+ __ebay_nice_modal_react.default.remove(CreatedDialog);
16
+ }
17
+ });
18
+ }
19
+ /**
20
+ * Hides a registered dialog by id.
21
+ *
22
+ * Use this when the caller only knows the dialog id. If you already have the
23
+ * controller returned by `dialog.register(...)`, prefer `controller.hide()`.
24
+ *
25
+ * @param id - Dialog id that was previously registered.
26
+ * @returns A promise from NiceModal that resolves after the hide action is
27
+ * dispatched.
28
+ *
29
+ * Usage:
30
+ * ```ts
31
+ * await hideDialog('project-dialog');
32
+ * ```
33
+ */
34
+ async function hideDialog(id) {
35
+ return __ebay_nice_modal_react.default.hide(id);
36
+ }
37
+ /**
38
+ * Removes a registered dialog instance from the NiceModal render tree by id.
39
+ *
40
+ * This does not unregister the dialog component; it only removes the mounted
41
+ * instance from the modal tree.
42
+ *
43
+ * @param id - Dialog id that was previously registered.
44
+ * Usage:
45
+ * ```ts
46
+ * removeDialog('project-dialog');
47
+ * ```
48
+ */
49
+ function removeDialog(id) {
50
+ __ebay_nice_modal_react.default.remove(id);
51
+ }
52
+ /**
53
+ * Unregisters a dialog component by id.
54
+ *
55
+ * Use this when a registered dialog should no longer be available through
56
+ * `showDialog(...)` or `dialog.show(...)`.
57
+ *
58
+ * @param id - Dialog id that was previously registered.
59
+ * Usage:
60
+ * ```ts
61
+ * unregisterDialog('project-dialog');
62
+ * ```
63
+ */
64
+ function unregisterDialog(id) {
65
+ (0, __ebay_nice_modal_react.unregister)(id);
66
+ }
67
+ /**
68
+ * Convenience registry facade for dialog operations.
69
+ *
70
+ * Use this when you prefer a single import with discoverable methods instead of
71
+ * importing `registerDialog`, `showDialog`, `hideDialog`, `removeDialog`, and
72
+ * `unregisterDialog` separately.
73
+ *
74
+ * @returns An object of dialog helper functions.
75
+ *
76
+ * Usage:
77
+ * ```ts
78
+ * const projectDialog = dialog.register('project-dialog', ProjectDialog);
79
+ * await projectDialog.show({ projectId: 'project-1' });
80
+ * await dialog.show('project-dialog', { projectId: 'project-2' });
81
+ * dialog.unregister('project-dialog');
82
+ * ```
83
+ */
84
+ const dialog = {
85
+ create: createDialog,
86
+ hide: hideDialog,
87
+ register: require_register_dialog.registerDialog,
88
+ remove: removeDialog,
89
+ show: require_show_dialog.showDialog,
90
+ unregister: unregisterDialog,
91
+ useDialog
92
+ };
93
+
94
+ //#endregion
95
+ exports.createDialog = createDialog;
96
+ exports.dialog = dialog;
97
+ exports.hideDialog = hideDialog;
98
+ exports.removeDialog = removeDialog;
99
+ exports.unregisterDialog = unregisterDialog;
100
+ exports.useDialog = useDialog;
@@ -0,0 +1,150 @@
1
+ import { registerDialog } from "./register-dialog.cjs";
2
+ import { showDialog } from "./show-dialog.cjs";
3
+ import { ComponentType, FC } from "react";
4
+ import { NiceModalHocProps, useModal } from "@ebay/nice-modal-react";
5
+
6
+ //#region src/dialog-provider/dialog-registry.d.ts
7
+ declare const useDialog: typeof useModal;
8
+ interface CreatedDialog<TProps extends object> extends FC<TProps & NiceModalHocProps> {
9
+ show: <TResult = unknown>(props?: TProps) => Promise<TResult>;
10
+ hide: <TResult = unknown>() => Promise<TResult>;
11
+ remove: () => void;
12
+ }
13
+ declare function createDialog<TProps extends object>(component: ComponentType<TProps>): CreatedDialog<TProps>;
14
+ /**
15
+ * Hides a registered dialog by id.
16
+ *
17
+ * Use this when the caller only knows the dialog id. If you already have the
18
+ * controller returned by `dialog.register(...)`, prefer `controller.hide()`.
19
+ *
20
+ * @param id - Dialog id that was previously registered.
21
+ * @returns A promise from NiceModal that resolves after the hide action is
22
+ * dispatched.
23
+ *
24
+ * Usage:
25
+ * ```ts
26
+ * await hideDialog('project-dialog');
27
+ * ```
28
+ */
29
+ declare function hideDialog<TResult = unknown>(id: string): Promise<TResult>;
30
+ /**
31
+ * Removes a registered dialog instance from the NiceModal render tree by id.
32
+ *
33
+ * This does not unregister the dialog component; it only removes the mounted
34
+ * instance from the modal tree.
35
+ *
36
+ * @param id - Dialog id that was previously registered.
37
+ * Usage:
38
+ * ```ts
39
+ * removeDialog('project-dialog');
40
+ * ```
41
+ */
42
+ declare function removeDialog(id: string): void;
43
+ /**
44
+ * Unregisters a dialog component by id.
45
+ *
46
+ * Use this when a registered dialog should no longer be available through
47
+ * `showDialog(...)` or `dialog.show(...)`.
48
+ *
49
+ * @param id - Dialog id that was previously registered.
50
+ * Usage:
51
+ * ```ts
52
+ * unregisterDialog('project-dialog');
53
+ * ```
54
+ */
55
+ declare function unregisterDialog(id: string): void;
56
+ interface DialogRegistry {
57
+ /**
58
+ * Registers a dialog component and returns a typed controller.
59
+ *
60
+ * @returns A controller with `id`, `show`, `hide`, and `remove`.
61
+ *
62
+ * Usage:
63
+ * ```ts
64
+ * const projectDialog = dialog.register('project-dialog', ProjectDialog);
65
+ * ```
66
+ */
67
+ register: typeof registerDialog;
68
+ /**
69
+ * Creates a custom NiceModal dialog component with controller helpers.
70
+ *
71
+ * Use this for dialogs that need to control `useDialog()` directly. For simple
72
+ * shadcn dialogs, prefer `dialog.register(...)`.
73
+ *
74
+ * Usage:
75
+ * ```ts
76
+ * const CustomDialog = dialog.create((props) => {
77
+ * const modal = dialog.useDialog();
78
+ * return <Dialog open={modal.visible} onOpenChange={(open) => !open && modal.hide()} />;
79
+ * });
80
+ *
81
+ * await CustomDialog.show({ projectId: 'project-1' });
82
+ * ```
83
+ */
84
+ create: typeof createDialog;
85
+ /**
86
+ * Shows a registered dialog by id with generic props.
87
+ *
88
+ * @returns A promise resolved by the dialog component.
89
+ *
90
+ * Usage:
91
+ * ```ts
92
+ * await dialog.show('project-dialog', { projectId: 'project-1' });
93
+ * ```
94
+ */
95
+ show: typeof showDialog;
96
+ /**
97
+ * Hides a registered dialog by id.
98
+ *
99
+ * @returns A promise from NiceModal after the hide action is dispatched.
100
+ *
101
+ * Usage:
102
+ * ```ts
103
+ * await dialog.hide('project-dialog');
104
+ * ```
105
+ */
106
+ hide: typeof hideDialog;
107
+ /**
108
+ * Removes a registered dialog instance from the render tree by id.
109
+ *
110
+ * @returns Nothing.
111
+ *
112
+ * Usage:
113
+ * ```ts
114
+ * dialog.remove('project-dialog');
115
+ * ```
116
+ */
117
+ remove: typeof removeDialog;
118
+ /**
119
+ * Unregisters a dialog component by id.
120
+ *
121
+ * @returns Nothing.
122
+ *
123
+ * Usage:
124
+ * ```ts
125
+ * dialog.unregister('project-dialog');
126
+ * ```
127
+ */
128
+ unregister: typeof unregisterDialog;
129
+ useDialog: typeof useDialog;
130
+ }
131
+ /**
132
+ * Convenience registry facade for dialog operations.
133
+ *
134
+ * Use this when you prefer a single import with discoverable methods instead of
135
+ * importing `registerDialog`, `showDialog`, `hideDialog`, `removeDialog`, and
136
+ * `unregisterDialog` separately.
137
+ *
138
+ * @returns An object of dialog helper functions.
139
+ *
140
+ * Usage:
141
+ * ```ts
142
+ * const projectDialog = dialog.register('project-dialog', ProjectDialog);
143
+ * await projectDialog.show({ projectId: 'project-1' });
144
+ * await dialog.show('project-dialog', { projectId: 'project-2' });
145
+ * dialog.unregister('project-dialog');
146
+ * ```
147
+ */
148
+ declare const dialog: DialogRegistry;
149
+ //#endregion
150
+ export { CreatedDialog, DialogRegistry, createDialog, dialog, hideDialog, removeDialog, unregisterDialog, useDialog };