@plusui/library 0.1.14 → 0.1.16

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 (127) hide show
  1. package/cdn/components/accordion/accordion.js +1 -1
  2. package/cdn/components/accordion/index.js +1 -1
  3. package/cdn/components/accordion-group/accordion-group.js +1 -1
  4. package/cdn/components/accordion-group/index.js +1 -1
  5. package/cdn/components/alert/alert.js +1 -1
  6. package/cdn/components/alert/index.js +1 -1
  7. package/cdn/components/avatar/avatar.js +1 -1
  8. package/cdn/components/avatar/index.js +1 -1
  9. package/cdn/components/badge/badge.js +1 -1
  10. package/cdn/components/badge/index.js +1 -1
  11. package/cdn/components/base/index.js +1 -1
  12. package/cdn/components/base/tailwind-base.js +1 -1
  13. package/cdn/components/breadcrumb/breadcrumb.js +1 -1
  14. package/cdn/components/breadcrumb/index.js +1 -1
  15. package/cdn/components/breadcrumb-item/breadcrumb-item.js +1 -1
  16. package/cdn/components/breadcrumb-item/index.js +1 -1
  17. package/cdn/components/button/button.js +1 -1
  18. package/cdn/components/button/index.js +1 -1
  19. package/cdn/components/button-group/button-group.js +1 -1
  20. package/cdn/components/button-group/index.js +1 -1
  21. package/cdn/components/checkbox/checkbox.js +1 -1
  22. package/cdn/components/checkbox/index.js +1 -1
  23. package/cdn/components/checkbox-group/checkbox-group.js +1 -1
  24. package/cdn/components/checkbox-group/index.js +1 -1
  25. package/cdn/components/chip/chip.js +1 -1
  26. package/cdn/components/chip/index.js +1 -1
  27. package/cdn/components/divider/divider.js +1 -1
  28. package/cdn/components/divider/index.js +1 -1
  29. package/cdn/components/drawer/drawer.js +1 -1
  30. package/cdn/components/drawer/index.js +1 -1
  31. package/cdn/components/dropdown/dropdown.js +1 -1
  32. package/cdn/components/dropdown/index.js +1 -1
  33. package/cdn/components/dropdown-item/dropdown-item.js +1 -1
  34. package/cdn/components/dropdown-item/index.js +1 -1
  35. package/cdn/components/index.js +1 -1
  36. package/cdn/components/input/index.js +1 -1
  37. package/cdn/components/input/input.js +1 -1
  38. package/cdn/components/link/index.js +1 -1
  39. package/cdn/components/link/link.js +1 -1
  40. package/cdn/components/list-box-item/index.js +1 -1
  41. package/cdn/components/list-box-item/list-box-item.js +1 -1
  42. package/cdn/components/modal/index.js +5 -1
  43. package/cdn/components/modal/modal.js +340 -83
  44. package/cdn/components/modal/modal.style.js +70 -41
  45. package/cdn/components/popconfirm/index.js +1 -1
  46. package/cdn/components/popconfirm/popconfirm.js +1 -1
  47. package/cdn/components/popover/index.js +1 -1
  48. package/cdn/components/popover/popover.js +1 -1
  49. package/cdn/components/radio/index.js +1 -1
  50. package/cdn/components/radio/radio.js +1 -1
  51. package/cdn/components/radio-group/index.js +1 -1
  52. package/cdn/components/radio-group/radio-group.js +1 -1
  53. package/cdn/components/rating/index.js +1 -1
  54. package/cdn/components/rating/rating.js +1 -1
  55. package/cdn/components/segmented-picker/index.js +1 -1
  56. package/cdn/components/segmented-picker/segmented-picker.component.js +1 -1
  57. package/cdn/components/segmented-picker-item/index.js +1 -1
  58. package/cdn/components/segmented-picker-item/segmented-picker-item.component.js +1 -1
  59. package/cdn/components/select/index.js +1 -1
  60. package/cdn/components/select/select.js +1 -1
  61. package/cdn/components/select-item/index.js +1 -1
  62. package/cdn/components/select-item/select-item.js +1 -1
  63. package/cdn/components/service/index.js +1 -1
  64. package/cdn/components/service/service.js +1 -1
  65. package/cdn/components/tab/index.js +1 -1
  66. package/cdn/components/tab/tab.js +1 -1
  67. package/cdn/components/tab-group/index.js +1 -1
  68. package/cdn/components/tab-group/tab-group.js +1 -1
  69. package/cdn/components/tab-panel/index.js +1 -1
  70. package/cdn/components/tab-panel/tab-panel.js +1 -1
  71. package/cdn/components/tag/index.js +1 -1
  72. package/cdn/components/tag/tag.js +1 -1
  73. package/cdn/components/text/index.js +1 -1
  74. package/cdn/components/text/text.js +1 -1
  75. package/cdn/components/textarea/index.js +1 -1
  76. package/cdn/components/textarea/textarea.js +1 -1
  77. package/cdn/components/toast/index.js +1 -1
  78. package/cdn/components/toast/toast.js +1 -1
  79. package/cdn/components/toast-container/index.js +1 -1
  80. package/cdn/components/toast-container/toast-container.js +1 -1
  81. package/cdn/components/toggle/index.js +1 -1
  82. package/cdn/components/toggle/toggle.js +1 -1
  83. package/cdn/components/tooltip/index.js +1 -1
  84. package/cdn/components/tooltip/tooltip.js +1 -1
  85. package/cdn/factory/tailwind-factory.js +1 -1
  86. package/cdn/global-BfmuDcaf.js +1 -0
  87. package/cdn/global-m-W73pez.js +31 -0
  88. package/custom-elements.json +226 -25
  89. package/dist/components/modal/index.js +4 -0
  90. package/dist/components/modal/modal.d.ts +95 -22
  91. package/dist/components/modal/modal.d.ts.map +1 -1
  92. package/dist/components/modal/modal.js +339 -82
  93. package/dist/components/modal/modal.js.map +1 -1
  94. package/dist/components/modal/modal.style.d.ts +297 -122
  95. package/dist/components/modal/modal.style.d.ts.map +1 -1
  96. package/dist/components/modal/modal.style.js +70 -41
  97. package/dist/components/modal/modal.style.js.map +1 -1
  98. package/dist/{if-defined-CAh2WTyo.js → if-defined-DzyJw9oN.js} +1 -1
  99. package/dist/index.css +2 -2
  100. package/dist/{live-CSPSCWrs.js → live-Dlj-D15j.js} +1 -1
  101. package/dist/{property-BXP8koCN.js → property-DRwbRRVL.js} +1 -1
  102. package/dist/{query-DixClzz3.js → query-CVSIfDVf.js} +1 -1
  103. package/dist/{query-assigned-elements-tu2Z4Umd.js → query-assigned-elements-CGjtMDM7.js} +1 -1
  104. package/dist/{state-CRctcY5E.js → state-DibUHyPK.js} +1 -1
  105. package/dist/{style-map-BP6cVC6K.js → style-map-DE-r4ozp.js} +1 -1
  106. package/dist/styles/global.js +2 -2
  107. package/eslint/custom-element-eslint-rules.js +16 -0
  108. package/package.json +1 -1
  109. package/public/html/index.js +406 -124
  110. package/public/react/index.d.ts +145 -33
  111. package/public/react/index.js +430 -125
  112. package/react/PlusModal.d.ts +50 -11
  113. package/react/PlusModal.js +31 -2
  114. package/types/custom-element-jsx.d.ts +42 -11
  115. package/types/custom-element-solidjs.d.ts +42 -11
  116. package/types/custom-element-svelte.d.ts +42 -11
  117. package/types/custom-element-vuejs.d.ts +42 -11
  118. package/vscode.css-custom-data.json +10 -6
  119. package/vscode.html-custom-data.json +26 -1
  120. package/web-types.json +106 -11
  121. package/cdn/global-8uGSRUk7.js +0 -31
  122. package/cdn/global-DklV2dCX.js +0 -1
  123. /package/dist/{base-CesIX8_4.js → base-CJK80TT1.js} +0 -0
  124. /package/dist/{directive-BUtBNK63.js → directive-DJonW9K-.js} +0 -0
  125. /package/dist/{floating-ui.dom-DEPWsfNe.js → floating-ui.dom-Cx1F5m3b.js} +0 -0
  126. /package/dist/{index-CwglOP_H.js → index-B49PNGQM.js} +0 -0
  127. /package/dist/{lit-element-u_ybFE-X.js → lit-element-BS9RbLkf.js} +0 -0
@@ -25,15 +25,33 @@ export interface PlusModalProps
25
25
  /** Whether the modal should take full width */
26
26
  fullWidth?: boolean;
27
27
 
28
+ /** Makes the modal take the full screen (100vw x 100vh, no border radius) */
29
+ fullScreen?: boolean;
30
+
31
+ /** Controls backdrop behavior
32
+ - true: Shows backdrop, modal can be closed by clicking outside
33
+ - false: No backdrop
34
+ - 'static': Shows backdrop but prevents closing by clicking outside (triggers shake animation) */
35
+ backdrop?: boolean | "static";
36
+
28
37
  /** Whether the modal should close when clicking the backdrop */
29
38
  closeOnBackdrop?: boolean;
30
39
 
31
40
  /** Whether the modal should close when pressing the Escape key */
32
41
  closeOnEsc?: boolean;
33
42
 
43
+ /** Hides the header section completely */
44
+ noHeader?: boolean;
45
+
46
+ /** Hides the footer section completely */
47
+ noFooter?: boolean;
48
+
34
49
  /** The size of the modal */
35
50
  size?: PlusModalElement["size"];
36
51
 
52
+ /** The placement of the modal on the screen */
53
+ placement?: PlusModalElement["placement"];
54
+
37
55
  /** The duration of the animation in milliseconds */
38
56
  animationDuration?: PlusModalElement["animationDuration"];
39
57
 
@@ -57,30 +75,51 @@ export interface PlusModalProps
57
75
 
58
76
  /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
59
77
  tabIndex?: number;
78
+
79
+ /** Emitted after the modal has opened */
80
+ onPlusModalOpen?: (event: CustomEvent) => void;
81
+
82
+ /** Emitted after the modal has closed */
83
+ onPlusModalClose?: (event: CustomEvent) => void;
84
+
85
+ /** Emitted before the modal opens (cancelable) */
86
+ onPlusModalBeforeOpen?: (event: CustomEvent) => void;
87
+
88
+ /** Emitted before the modal closes (cancelable) */
89
+ onPlusModalBeforeClose?: (event: CustomEvent) => void;
60
90
  }
61
91
 
62
92
  /**
63
- * Modal dialog component that appears on top of the page content.
93
+ * Modal dialog component built on native HTML Dialog API. Displays content in a layer above the page with full keyboard and focus management.
64
94
  * ---
65
95
  *
66
96
  *
97
+ * ### **Events:**
98
+ * - **plus-modal-open** - Emitted after the modal has opened
99
+ * - **plus-modal-close** - Emitted after the modal has closed
100
+ * - **plus-modal-before-open** - Emitted before the modal opens (cancelable)
101
+ * - **plus-modal-before-close** - Emitted before the modal closes (cancelable)
102
+ *
67
103
  * ### **Methods:**
68
- * - **hide(): _void_** - Hides the modal with animation
69
- * - **show(): _void_** - Shows the modal with animation
104
+ * - **show(): _Promise<void>_** - Shows the modal with animation
105
+ * - **hide(): _Promise<void>_** - Hides the modal with animation
106
+ * - **toggle(): _Promise<void>_** - Toggles the modal open/closed state
70
107
  *
71
108
  * ### **Slots:**
72
- * - **header** - The header content of the modal
73
- * - **body** - The main content of the modal
109
+ * - _default_ - Main content area (same as body slot)
110
+ * - **header** - The header content of the modal
111
+ * - **body** - The main content of the modal (alternative to default slot)
74
112
  * - **footer** - The footer content of the modal
75
113
  * - **close** - Custom close button (defaults to an X icon)
76
114
  *
77
115
  * ### **CSS Parts:**
78
- * - **container** - The main container element
79
- * - **overlay** - The overlay element
80
- * - **modal** - The modal element
81
- * - **header** - The header element
82
- * - **body** - The body element
83
- * - **footer** - The footer element
116
+ * - **dialog** - The native dialog element
117
+ * - **container** - The container wrapper for centering and scrolling
118
+ * - **modal** - The main modal box
119
+ * - **header** - The header section
120
+ * - **header-content** - The content wrapper inside header
121
+ * - **body** - The main content area
122
+ * - **footer** - The footer section
84
123
  * - **close-button** - The close button element
85
124
  */
86
125
  export const PlusModal: React.ForwardRefExoticComponent<PlusModalProps>;
@@ -1,28 +1,53 @@
1
- import React, { forwardRef, useImperativeHandle } from "react";
1
+ import React, {
2
+ forwardRef,
3
+ useImperativeHandle,
4
+ useRef,
5
+ useEffect,
6
+ } from "react";
2
7
  import "../dist/components/modal/index.js";
8
+ import { useEventListener } from "./react-utils.js";
3
9
 
4
10
  export const PlusModal = forwardRef((props, forwardedRef) => {
11
+ const ref = useRef(null);
5
12
  const {
6
13
  isOpen,
7
14
  fullWidth,
15
+ fullScreen,
16
+ backdrop,
8
17
  closeOnBackdrop,
9
18
  closeOnEsc,
19
+ noHeader,
20
+ noFooter,
10
21
  size,
22
+ placement,
11
23
  animationDuration,
12
24
  ...filteredProps
13
25
  } = props;
14
26
 
27
+ /** Event listeners - run once */
28
+ useEventListener(ref, "plus-modal-open", props.onPlusModalOpen);
29
+ useEventListener(ref, "plus-modal-close", props.onPlusModalClose);
30
+ useEventListener(ref, "plus-modal-before-open", props.onPlusModalBeforeOpen);
31
+ useEventListener(
32
+ ref,
33
+ "plus-modal-before-close",
34
+ props.onPlusModalBeforeClose,
35
+ );
36
+
15
37
  /** Methods - uses `useImperativeHandle` hook to pass ref to component */
16
38
  useImperativeHandle(forwardedRef, () => ({
17
- hide: () => ref.current.hide(),
18
39
  show: () => ref.current.show(),
40
+ hide: () => ref.current.hide(),
41
+ toggle: () => ref.current.toggle(),
19
42
  }));
20
43
 
21
44
  return React.createElement(
22
45
  "plus-modal",
23
46
  {
47
+ ref,
24
48
  ...filteredProps,
25
49
  size: props.size,
50
+ placement: props.placement,
26
51
  "animation-duration":
27
52
  props.animationDuration || props["animation-duration"],
28
53
  class: props.className,
@@ -32,8 +57,12 @@ export const PlusModal = forwardRef((props, forwardedRef) => {
32
57
  tabindex: props.tabIndex,
33
58
  "is-open": props.isOpen ? "" : undefined,
34
59
  "full-width": props.fullWidth ? "" : undefined,
60
+ "full-screen": props.fullScreen ? "" : undefined,
61
+ backdrop: props.backdrop ? "" : undefined,
35
62
  "close-on-backdrop": props.closeOnBackdrop ? "" : undefined,
36
63
  "close-on-esc": props.closeOnEsc ? "" : undefined,
64
+ "no-header": props.noHeader ? "" : undefined,
65
+ "no-footer": props.noFooter ? "" : undefined,
37
66
  style: { ...props.style },
38
67
  },
39
68
  props.children,
@@ -414,16 +414,38 @@ export type PlusRadioGroupProps = {
414
414
  export type PlusModalProps = {
415
415
  /** The size of the modal */
416
416
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
417
+ /** The placement of the modal on the screen */
418
+ placement?: "center" | "top";
417
419
  /** Whether the modal is open */
418
420
  "is-open"?: boolean;
419
421
  /** Whether the modal should take full width */
420
422
  "full-width"?: boolean;
423
+ /** Makes the modal take the full screen (100vw x 100vh, no border radius) */
424
+ "full-screen"?: boolean;
425
+ /** Controls backdrop behavior
426
+ - true: Shows backdrop, modal can be closed by clicking outside
427
+ - false: No backdrop
428
+ - 'static': Shows backdrop but prevents closing by clicking outside (triggers shake animation) */
429
+ backdrop?: boolean | "static";
421
430
  /** Whether the modal should close when clicking the backdrop */
422
431
  "close-on-backdrop"?: boolean;
423
432
  /** Whether the modal should close when pressing the Escape key */
424
433
  "close-on-esc"?: boolean;
434
+ /** Hides the header section completely */
435
+ "no-header"?: boolean;
436
+ /** Hides the footer section completely */
437
+ "no-footer"?: boolean;
425
438
  /** The duration of the animation in milliseconds */
426
439
  "animation-duration"?: number;
440
+
441
+ /** Emitted after the modal has opened */
442
+ "onplus-modal-open"?: (e: CustomEvent<never>) => void;
443
+ /** Emitted after the modal has closed */
444
+ "onplus-modal-close"?: (e: CustomEvent<never>) => void;
445
+ /** Emitted before the modal opens (cancelable) */
446
+ "onplus-modal-before-open"?: (e: CustomEvent<never>) => void;
447
+ /** Emitted before the modal closes (cancelable) */
448
+ "onplus-modal-before-close"?: (e: CustomEvent<never>) => void;
427
449
  };
428
450
 
429
451
  export type PlusDrawerProps = {
@@ -1330,27 +1352,36 @@ export type CustomElements = {
1330
1352
  "plus-radio-group": Partial<PlusRadioGroupProps & BaseProps & BaseEvents>;
1331
1353
 
1332
1354
  /**
1333
- * Modal dialog component that appears on top of the page content.
1355
+ * Modal dialog component built on native HTML Dialog API. Displays content in a layer above the page with full keyboard and focus management.
1334
1356
  * ---
1335
1357
  *
1336
1358
  *
1359
+ * ### **Events:**
1360
+ * - **plus-modal-open** - Emitted after the modal has opened
1361
+ * - **plus-modal-close** - Emitted after the modal has closed
1362
+ * - **plus-modal-before-open** - Emitted before the modal opens (cancelable)
1363
+ * - **plus-modal-before-close** - Emitted before the modal closes (cancelable)
1364
+ *
1337
1365
  * ### **Methods:**
1338
- * - **hide(): _void_** - Hides the modal with animation
1339
- * - **show(): _void_** - Shows the modal with animation
1366
+ * - **show(): _Promise<void>_** - Shows the modal with animation
1367
+ * - **hide(): _Promise<void>_** - Hides the modal with animation
1368
+ * - **toggle(): _Promise<void>_** - Toggles the modal open/closed state
1340
1369
  *
1341
1370
  * ### **Slots:**
1342
- * - **header** - The header content of the modal
1343
- * - **body** - The main content of the modal
1371
+ * - _default_ - Main content area (same as body slot)
1372
+ * - **header** - The header content of the modal
1373
+ * - **body** - The main content of the modal (alternative to default slot)
1344
1374
  * - **footer** - The footer content of the modal
1345
1375
  * - **close** - Custom close button (defaults to an X icon)
1346
1376
  *
1347
1377
  * ### **CSS Parts:**
1348
- * - **container** - The main container element
1349
- * - **overlay** - The overlay element
1350
- * - **modal** - The modal element
1351
- * - **header** - The header element
1352
- * - **body** - The body element
1353
- * - **footer** - The footer element
1378
+ * - **dialog** - The native dialog element
1379
+ * - **container** - The container wrapper for centering and scrolling
1380
+ * - **modal** - The main modal box
1381
+ * - **header** - The header section
1382
+ * - **header-content** - The content wrapper inside header
1383
+ * - **body** - The main content area
1384
+ * - **footer** - The footer section
1354
1385
  * - **close-button** - The close button element
1355
1386
  */
1356
1387
  "plus-modal": Partial<PlusModalProps & BaseProps & BaseEvents>;
@@ -442,16 +442,38 @@ type PlusRadioGroupProps = {
442
442
  type PlusModalProps = {
443
443
  /** The size of the modal */
444
444
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
445
+ /** The placement of the modal on the screen */
446
+ placement?: "center" | "top";
445
447
  /** Whether the modal is open */
446
448
  "is-open"?: boolean;
447
449
  /** Whether the modal should take full width */
448
450
  "full-width"?: boolean;
451
+ /** Makes the modal take the full screen (100vw x 100vh, no border radius) */
452
+ "full-screen"?: boolean;
453
+ /** Controls backdrop behavior
454
+ - true: Shows backdrop, modal can be closed by clicking outside
455
+ - false: No backdrop
456
+ - 'static': Shows backdrop but prevents closing by clicking outside (triggers shake animation) */
457
+ backdrop?: boolean | "static";
449
458
  /** Whether the modal should close when clicking the backdrop */
450
459
  "close-on-backdrop"?: boolean;
451
460
  /** Whether the modal should close when pressing the Escape key */
452
461
  "close-on-esc"?: boolean;
462
+ /** Hides the header section completely */
463
+ "no-header"?: boolean;
464
+ /** Hides the footer section completely */
465
+ "no-footer"?: boolean;
453
466
  /** The duration of the animation in milliseconds */
454
467
  "animation-duration"?: number;
468
+
469
+ /** Emitted after the modal has opened */
470
+ "on:plus-modal-open"?: (e: CustomEvent<never>) => void;
471
+ /** Emitted after the modal has closed */
472
+ "on:plus-modal-close"?: (e: CustomEvent<never>) => void;
473
+ /** Emitted before the modal opens (cancelable) */
474
+ "on:plus-modal-before-open"?: (e: CustomEvent<never>) => void;
475
+ /** Emitted before the modal closes (cancelable) */
476
+ "on:plus-modal-before-close"?: (e: CustomEvent<never>) => void;
455
477
  } & JSX.DirectiveFunctionAttributes<PlusModal> &
456
478
  JSX.OnAttributes<PlusModal> &
457
479
  JSX.OnCaptureAttributes<PlusModal>;
@@ -1414,27 +1436,36 @@ export type CustomElements = {
1414
1436
  "plus-radio-group": Partial<PlusRadioGroupProps & BaseProps & BaseEvents>;
1415
1437
 
1416
1438
  /**
1417
- * Modal dialog component that appears on top of the page content.
1439
+ * Modal dialog component built on native HTML Dialog API. Displays content in a layer above the page with full keyboard and focus management.
1418
1440
  * ---
1419
1441
  *
1420
1442
  *
1443
+ * ### **Events:**
1444
+ * - **plus-modal-open** - Emitted after the modal has opened
1445
+ * - **plus-modal-close** - Emitted after the modal has closed
1446
+ * - **plus-modal-before-open** - Emitted before the modal opens (cancelable)
1447
+ * - **plus-modal-before-close** - Emitted before the modal closes (cancelable)
1448
+ *
1421
1449
  * ### **Methods:**
1422
- * - **hide(): _void_** - Hides the modal with animation
1423
- * - **show(): _void_** - Shows the modal with animation
1450
+ * - **show(): _Promise<void>_** - Shows the modal with animation
1451
+ * - **hide(): _Promise<void>_** - Hides the modal with animation
1452
+ * - **toggle(): _Promise<void>_** - Toggles the modal open/closed state
1424
1453
  *
1425
1454
  * ### **Slots:**
1426
- * - **header** - The header content of the modal
1427
- * - **body** - The main content of the modal
1455
+ * - _default_ - Main content area (same as body slot)
1456
+ * - **header** - The header content of the modal
1457
+ * - **body** - The main content of the modal (alternative to default slot)
1428
1458
  * - **footer** - The footer content of the modal
1429
1459
  * - **close** - Custom close button (defaults to an X icon)
1430
1460
  *
1431
1461
  * ### **CSS Parts:**
1432
- * - **container** - The main container element
1433
- * - **overlay** - The overlay element
1434
- * - **modal** - The modal element
1435
- * - **header** - The header element
1436
- * - **body** - The body element
1437
- * - **footer** - The footer element
1462
+ * - **dialog** - The native dialog element
1463
+ * - **container** - The container wrapper for centering and scrolling
1464
+ * - **modal** - The main modal box
1465
+ * - **header** - The header section
1466
+ * - **header-content** - The content wrapper inside header
1467
+ * - **body** - The main content area
1468
+ * - **footer** - The footer section
1438
1469
  * - **close-button** - The close button element
1439
1470
  */
1440
1471
  "plus-modal": Partial<PlusModalProps & BaseProps & BaseEvents>;
@@ -391,16 +391,38 @@ type PlusRadioGroupProps = {
391
391
  type PlusModalProps = {
392
392
  /** The size of the modal */
393
393
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
394
+ /** The placement of the modal on the screen */
395
+ placement?: "center" | "top";
394
396
  /** Whether the modal is open */
395
397
  "is-open"?: boolean;
396
398
  /** Whether the modal should take full width */
397
399
  "full-width"?: boolean;
400
+ /** Makes the modal take the full screen (100vw x 100vh, no border radius) */
401
+ "full-screen"?: boolean;
402
+ /** Controls backdrop behavior
403
+ - true: Shows backdrop, modal can be closed by clicking outside
404
+ - false: No backdrop
405
+ - 'static': Shows backdrop but prevents closing by clicking outside (triggers shake animation) */
406
+ backdrop?: boolean | "static";
398
407
  /** Whether the modal should close when clicking the backdrop */
399
408
  "close-on-backdrop"?: boolean;
400
409
  /** Whether the modal should close when pressing the Escape key */
401
410
  "close-on-esc"?: boolean;
411
+ /** Hides the header section completely */
412
+ "no-header"?: boolean;
413
+ /** Hides the footer section completely */
414
+ "no-footer"?: boolean;
402
415
  /** The duration of the animation in milliseconds */
403
416
  "animation-duration"?: number;
417
+
418
+ /** Emitted after the modal has opened */
419
+ "on:plus-modal-open"?: (e: CustomEvent<never>) => void;
420
+ /** Emitted after the modal has closed */
421
+ "on:plus-modal-close"?: (e: CustomEvent<never>) => void;
422
+ /** Emitted before the modal opens (cancelable) */
423
+ "on:plus-modal-before-open"?: (e: CustomEvent<never>) => void;
424
+ /** Emitted before the modal closes (cancelable) */
425
+ "on:plus-modal-before-close"?: (e: CustomEvent<never>) => void;
404
426
  };
405
427
 
406
428
  type PlusDrawerProps = {
@@ -1307,27 +1329,36 @@ export type CustomElements = {
1307
1329
  "plus-radio-group": Partial<PlusRadioGroupProps & BaseProps & BaseEvents>;
1308
1330
 
1309
1331
  /**
1310
- * Modal dialog component that appears on top of the page content.
1332
+ * Modal dialog component built on native HTML Dialog API. Displays content in a layer above the page with full keyboard and focus management.
1311
1333
  * ---
1312
1334
  *
1313
1335
  *
1336
+ * ### **Events:**
1337
+ * - **plus-modal-open** - Emitted after the modal has opened
1338
+ * - **plus-modal-close** - Emitted after the modal has closed
1339
+ * - **plus-modal-before-open** - Emitted before the modal opens (cancelable)
1340
+ * - **plus-modal-before-close** - Emitted before the modal closes (cancelable)
1341
+ *
1314
1342
  * ### **Methods:**
1315
- * - **hide(): _void_** - Hides the modal with animation
1316
- * - **show(): _void_** - Shows the modal with animation
1343
+ * - **show(): _Promise<void>_** - Shows the modal with animation
1344
+ * - **hide(): _Promise<void>_** - Hides the modal with animation
1345
+ * - **toggle(): _Promise<void>_** - Toggles the modal open/closed state
1317
1346
  *
1318
1347
  * ### **Slots:**
1319
- * - **header** - The header content of the modal
1320
- * - **body** - The main content of the modal
1348
+ * - _default_ - Main content area (same as body slot)
1349
+ * - **header** - The header content of the modal
1350
+ * - **body** - The main content of the modal (alternative to default slot)
1321
1351
  * - **footer** - The footer content of the modal
1322
1352
  * - **close** - Custom close button (defaults to an X icon)
1323
1353
  *
1324
1354
  * ### **CSS Parts:**
1325
- * - **container** - The main container element
1326
- * - **overlay** - The overlay element
1327
- * - **modal** - The modal element
1328
- * - **header** - The header element
1329
- * - **body** - The body element
1330
- * - **footer** - The footer element
1355
+ * - **dialog** - The native dialog element
1356
+ * - **container** - The container wrapper for centering and scrolling
1357
+ * - **modal** - The main modal box
1358
+ * - **header** - The header section
1359
+ * - **header-content** - The content wrapper inside header
1360
+ * - **body** - The main content area
1361
+ * - **footer** - The footer section
1331
1362
  * - **close-button** - The close button element
1332
1363
  */
1333
1364
  "plus-modal": Partial<PlusModalProps & BaseProps & BaseEvents>;
@@ -354,16 +354,38 @@ type PlusRadioGroupProps = {
354
354
  type PlusModalProps = {
355
355
  /** The size of the modal */
356
356
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
357
+ /** The placement of the modal on the screen */
358
+ placement?: "center" | "top";
357
359
  /** Whether the modal is open */
358
360
  "is-open"?: boolean;
359
361
  /** Whether the modal should take full width */
360
362
  "full-width"?: boolean;
363
+ /** Makes the modal take the full screen (100vw x 100vh, no border radius) */
364
+ "full-screen"?: boolean;
365
+ /** Controls backdrop behavior
366
+ - true: Shows backdrop, modal can be closed by clicking outside
367
+ - false: No backdrop
368
+ - 'static': Shows backdrop but prevents closing by clicking outside (triggers shake animation) */
369
+ backdrop?: boolean | "static";
361
370
  /** Whether the modal should close when clicking the backdrop */
362
371
  "close-on-backdrop"?: boolean;
363
372
  /** Whether the modal should close when pressing the Escape key */
364
373
  "close-on-esc"?: boolean;
374
+ /** Hides the header section completely */
375
+ "no-header"?: boolean;
376
+ /** Hides the footer section completely */
377
+ "no-footer"?: boolean;
365
378
  /** The duration of the animation in milliseconds */
366
379
  "animation-duration"?: number;
380
+
381
+ /** Emitted after the modal has opened */
382
+ "onplus-modal-open"?: (e: CustomEvent<never>) => void;
383
+ /** Emitted after the modal has closed */
384
+ "onplus-modal-close"?: (e: CustomEvent<never>) => void;
385
+ /** Emitted before the modal opens (cancelable) */
386
+ "onplus-modal-before-open"?: (e: CustomEvent<never>) => void;
387
+ /** Emitted before the modal closes (cancelable) */
388
+ "onplus-modal-before-close"?: (e: CustomEvent<never>) => void;
367
389
  };
368
390
 
369
391
  type PlusDrawerProps = {
@@ -1270,27 +1292,36 @@ export type CustomElements = {
1270
1292
  "plus-radio-group": DefineComponent<PlusRadioGroupProps>;
1271
1293
 
1272
1294
  /**
1273
- * Modal dialog component that appears on top of the page content.
1295
+ * Modal dialog component built on native HTML Dialog API. Displays content in a layer above the page with full keyboard and focus management.
1274
1296
  * ---
1275
1297
  *
1276
1298
  *
1299
+ * ### **Events:**
1300
+ * - **plus-modal-open** - Emitted after the modal has opened
1301
+ * - **plus-modal-close** - Emitted after the modal has closed
1302
+ * - **plus-modal-before-open** - Emitted before the modal opens (cancelable)
1303
+ * - **plus-modal-before-close** - Emitted before the modal closes (cancelable)
1304
+ *
1277
1305
  * ### **Methods:**
1278
- * - **hide(): _void_** - Hides the modal with animation
1279
- * - **show(): _void_** - Shows the modal with animation
1306
+ * - **show(): _Promise<void>_** - Shows the modal with animation
1307
+ * - **hide(): _Promise<void>_** - Hides the modal with animation
1308
+ * - **toggle(): _Promise<void>_** - Toggles the modal open/closed state
1280
1309
  *
1281
1310
  * ### **Slots:**
1282
- * - **header** - The header content of the modal
1283
- * - **body** - The main content of the modal
1311
+ * - _default_ - Main content area (same as body slot)
1312
+ * - **header** - The header content of the modal
1313
+ * - **body** - The main content of the modal (alternative to default slot)
1284
1314
  * - **footer** - The footer content of the modal
1285
1315
  * - **close** - Custom close button (defaults to an X icon)
1286
1316
  *
1287
1317
  * ### **CSS Parts:**
1288
- * - **container** - The main container element
1289
- * - **overlay** - The overlay element
1290
- * - **modal** - The modal element
1291
- * - **header** - The header element
1292
- * - **body** - The body element
1293
- * - **footer** - The footer element
1318
+ * - **dialog** - The native dialog element
1319
+ * - **container** - The container wrapper for centering and scrolling
1320
+ * - **modal** - The main modal box
1321
+ * - **header** - The header section
1322
+ * - **header-content** - The content wrapper inside header
1323
+ * - **body** - The main content area
1324
+ * - **footer** - The footer section
1294
1325
  * - **close-button** - The close button element
1295
1326
  */
1296
1327
  "plus-modal": DefineComponent<PlusModalProps>;
@@ -365,15 +365,19 @@
365
365
  "name": "::part(animation-overlay)",
366
366
  "description": "The animation overlay element."
367
367
  },
368
+ { "name": "::part(dialog)", "description": "The native dialog element" },
368
369
  {
369
370
  "name": "::part(container)",
370
- "description": "The main container element"
371
+ "description": "The container wrapper for centering and scrolling"
371
372
  },
372
- { "name": "::part(overlay)", "description": "The overlay element" },
373
- { "name": "::part(modal)", "description": "The modal element" },
374
- { "name": "::part(header)", "description": "The header element" },
375
- { "name": "::part(body)", "description": "The body element" },
376
- { "name": "::part(footer)", "description": "The footer element" },
373
+ { "name": "::part(modal)", "description": "The main modal box" },
374
+ { "name": "::part(header)", "description": "The header section" },
375
+ {
376
+ "name": "::part(header-content)",
377
+ "description": "The content wrapper inside header"
378
+ },
379
+ { "name": "::part(body)", "description": "The main content area" },
380
+ { "name": "::part(footer)", "description": "The footer section" },
377
381
  {
378
382
  "name": "::part(close-button)",
379
383
  "description": "The close button element"
@@ -656,7 +656,7 @@
656
656
  },
657
657
  {
658
658
  "name": "plus-modal",
659
- "description": "Modal dialog component that appears on top of the page content.\n---\n\n\n### **Methods:**\n - **hide(): _void_** - Hides the modal with animation\n- **show(): _void_** - Shows the modal with animation\n\n### **Slots:**\n - **header** - The header content of the modal\n- **body** - The main content of the modal\n- **footer** - The footer content of the modal\n- **close** - Custom close button (defaults to an X icon)\n\n### **CSS Parts:**\n - **container** - The main container element\n- **overlay** - The overlay element\n- **modal** - The modal element\n- **header** - The header element\n- **body** - The body element\n- **footer** - The footer element\n- **close-button** - The close button element",
659
+ "description": "Modal dialog component built on native HTML Dialog API. Displays content in a layer above the page with full keyboard and focus management.\n---\n\n\n### **Events:**\n - **plus-modal-open** - Emitted after the modal has opened\n- **plus-modal-close** - Emitted after the modal has closed\n- **plus-modal-before-open** - Emitted before the modal opens (cancelable)\n- **plus-modal-before-close** - Emitted before the modal closes (cancelable)\n\n### **Methods:**\n - **show(): _Promise<void>_** - Shows the modal with animation\n- **hide(): _Promise<void>_** - Hides the modal with animation\n- **toggle(): _Promise<void>_** - Toggles the modal open/closed state\n\n### **Slots:**\n - _default_ - Main content area (same as body slot)\n- **header** - The header content of the modal\n- **body** - The main content of the modal (alternative to default slot)\n- **footer** - The footer content of the modal\n- **close** - Custom close button (defaults to an X icon)\n\n### **CSS Parts:**\n - **dialog** - The native dialog element\n- **container** - The container wrapper for centering and scrolling\n- **modal** - The main modal box\n- **header** - The header section\n- **header-content** - The content wrapper inside header\n- **body** - The main content area\n- **footer** - The footer section\n- **close-button** - The close button element",
660
660
  "attributes": [
661
661
  {
662
662
  "name": "size",
@@ -670,6 +670,11 @@
670
670
  { "name": "full" }
671
671
  ]
672
672
  },
673
+ {
674
+ "name": "placement",
675
+ "description": "The placement of the modal on the screen",
676
+ "values": [{ "name": "center" }, { "name": "top" }]
677
+ },
673
678
  {
674
679
  "name": "is-open",
675
680
  "description": "Whether the modal is open",
@@ -680,6 +685,16 @@
680
685
  "description": "Whether the modal should take full width",
681
686
  "values": []
682
687
  },
688
+ {
689
+ "name": "full-screen",
690
+ "description": "Makes the modal take the full screen (100vw x 100vh, no border radius)",
691
+ "values": []
692
+ },
693
+ {
694
+ "name": "backdrop",
695
+ "description": "Controls backdrop behavior\n- true: Shows backdrop, modal can be closed by clicking outside\n- false: No backdrop\n- 'static': Shows backdrop but prevents closing by clicking outside (triggers shake animation)",
696
+ "values": [{ "name": "static" }]
697
+ },
683
698
  {
684
699
  "name": "close-on-backdrop",
685
700
  "description": "Whether the modal should close when clicking the backdrop",
@@ -690,6 +705,16 @@
690
705
  "description": "Whether the modal should close when pressing the Escape key",
691
706
  "values": []
692
707
  },
708
+ {
709
+ "name": "no-header",
710
+ "description": "Hides the header section completely",
711
+ "values": []
712
+ },
713
+ {
714
+ "name": "no-footer",
715
+ "description": "Hides the footer section completely",
716
+ "values": []
717
+ },
693
718
  {
694
719
  "name": "animation-duration",
695
720
  "description": "The duration of the animation in milliseconds",