@duskmoon-dev/components 0.3.1 → 0.4.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 (109) hide show
  1. package/README.md +61 -2
  2. package/dist/{chunk-r9wkv7xd.js → chunk-fwjzvsrx.js} +3 -3
  3. package/dist/classes/chat.d.ts +43 -0
  4. package/dist/classes/console-page.d.ts +16 -0
  5. package/dist/classes/dropdown.d.ts +5 -5
  6. package/dist/classes/fab.d.ts +11 -0
  7. package/dist/classes/index.d.ts +6 -0
  8. package/dist/classes/index.js +1443 -1210
  9. package/dist/classes/megamenu.d.ts +10 -0
  10. package/dist/classes/otp-input.d.ts +12 -0
  11. package/dist/classes/popover.d.ts +1 -3
  12. package/dist/classes/swap.d.ts +12 -0
  13. package/dist/classes/tree-select.d.ts +6 -6
  14. package/dist/components/anchor/index.js +2 -2
  15. package/dist/components/app/index.js +211 -151
  16. package/dist/components/avatar/Avatar.types.d.ts +1 -1
  17. package/dist/components/avatar/index.js +2 -1
  18. package/dist/components/badge/index.js +1 -1
  19. package/dist/components/button/Button.d.ts +1 -1
  20. package/dist/components/button/Button.types.d.ts +8 -0
  21. package/dist/components/button/index.js +253 -24
  22. package/dist/components/calendar/index.js +44 -19
  23. package/dist/components/cascader/index.js +2 -2
  24. package/dist/components/chat/Chat.d.ts +22 -0
  25. package/dist/components/chat/Chat.types.d.ts +73 -0
  26. package/dist/components/chat/index.d.ts +2 -0
  27. package/dist/components/chat/index.js +309 -0
  28. package/dist/components/color-picker/ColorPicker.types.d.ts +2 -1
  29. package/dist/components/color-picker/index.js +210 -13
  30. package/dist/components/config-provider/index.js +2 -2
  31. package/dist/components/console-page/ConsolePage.d.ts +2 -0
  32. package/dist/components/console-page/ConsolePage.types.d.ts +29 -0
  33. package/dist/components/console-page/index.d.ts +2 -0
  34. package/dist/components/console-page/index.js +205 -0
  35. package/dist/components/date-picker/DatePicker.types.d.ts +1 -0
  36. package/dist/components/date-picker/index.js +537 -35
  37. package/dist/components/date-picker/usePickerDropdown.d.ts +17 -0
  38. package/dist/components/dm-breadcrumb/index.js +18 -18
  39. package/dist/components/dm-date-picker/index.js +635 -133
  40. package/dist/components/dm-drawer/index.js +269 -40
  41. package/dist/components/dm-layout/index.js +575 -208
  42. package/dist/components/dm-menu/index.js +399 -32
  43. package/dist/components/dm-message/index.js +18 -18
  44. package/dist/components/dm-page-header/index.js +537 -247
  45. package/dist/components/dm-pagination/index.js +39 -39
  46. package/dist/components/dm-pro-table/index.js +2374 -1559
  47. package/dist/components/dm-provider/index.js +94 -94
  48. package/dist/components/dm-query/DmQuery.types.d.ts +1 -1
  49. package/dist/components/dm-query/index.js +955 -210
  50. package/dist/components/dm-search/DmSearch.types.d.ts +4 -0
  51. package/dist/components/dm-search/index.js +937 -183
  52. package/dist/components/dm-splitter/index.js +32 -32
  53. package/dist/components/dm-status/index.js +25 -25
  54. package/dist/components/dm-table/index.js +1430 -676
  55. package/dist/components/dm-tabs/index.js +34 -34
  56. package/dist/components/dm-toolbar/index.js +423 -133
  57. package/dist/components/dm-tree/index.js +92 -92
  58. package/dist/components/dm-truncate/index.js +145 -65
  59. package/dist/components/dropdown/Dropdown.types.d.ts +1 -1
  60. package/dist/components/dropdown/index.js +467 -177
  61. package/dist/components/fab/Fab.d.ts +4 -0
  62. package/dist/components/fab/Fab.types.d.ts +25 -0
  63. package/dist/components/fab/index.d.ts +2 -0
  64. package/dist/components/fab/index.js +480 -0
  65. package/dist/components/form/Form.types.d.ts +1 -0
  66. package/dist/components/form/index.js +16 -5
  67. package/dist/components/grid/index.js +2 -2
  68. package/dist/components/input/index.js +4 -4
  69. package/dist/components/markdown/index.js +1 -1
  70. package/dist/components/megamenu/Megamenu.d.ts +2 -0
  71. package/dist/components/megamenu/Megamenu.types.d.ts +32 -0
  72. package/dist/components/megamenu/index.d.ts +2 -0
  73. package/dist/components/megamenu/index.js +214 -0
  74. package/dist/components/message/index.js +5 -5
  75. package/dist/components/modal/index.js +128 -68
  76. package/dist/components/notification/index.js +2 -2
  77. package/dist/components/otp-input/OtpInput.d.ts +2 -0
  78. package/dist/components/otp-input/OtpInput.types.d.ts +16 -0
  79. package/dist/components/otp-input/index.d.ts +2 -0
  80. package/dist/components/otp-input/index.js +112 -0
  81. package/dist/components/popconfirm/index.js +297 -68
  82. package/dist/components/popover/index.js +24 -4
  83. package/dist/components/skeleton/index.js +5 -5
  84. package/dist/components/spin/index.js +2 -2
  85. package/dist/components/steps/index.js +2 -2
  86. package/dist/components/swap/Swap.d.ts +3 -0
  87. package/dist/components/swap/Swap.types.d.ts +22 -0
  88. package/dist/components/swap/index.d.ts +2 -0
  89. package/dist/components/swap/index.js +109 -0
  90. package/dist/components/table/index.js +2 -2
  91. package/dist/components/tabs/index.js +2 -2
  92. package/dist/components/tag/index.js +2 -2
  93. package/dist/components/time-picker/TimePicker.types.d.ts +1 -0
  94. package/dist/components/time-picker/index.js +167 -29
  95. package/dist/components/tooltip/Tooltip.types.d.ts +4 -0
  96. package/dist/components/tooltip/index.js +107 -27
  97. package/dist/components/tour/index.js +315 -86
  98. package/dist/components/tree-select/index.js +8 -8
  99. package/dist/components/typography/index.js +4 -4
  100. package/dist/components/upload/Upload.types.d.ts +1 -0
  101. package/dist/components/upload/index.js +7 -5
  102. package/dist/generated/version.d.ts +1 -1
  103. package/dist/index.d.ts +6 -0
  104. package/dist/index.js +4023 -2134
  105. package/dist/infrastructure.js +11 -11
  106. package/dist/styles.css +13677 -9811
  107. package/dist/theme/index.js +3 -3
  108. package/dist/utils/index.js +5 -5
  109. package/package.json +30 -6
@@ -0,0 +1,10 @@
1
+ export declare const megamenuClass = "megamenu";
2
+ export declare const megamenuBarClass = "megamenu-bar";
3
+ export declare const megamenuItemClass = "megamenu-item";
4
+ export declare const megamenuTriggerClass = "megamenu-trigger";
5
+ export declare const megamenuPanelClass = "megamenu-panel";
6
+ export declare const megamenuGridClass = "megamenu-grid";
7
+ export declare const megamenuGroupClass = "megamenu-group";
8
+ export declare const megamenuHeadingClass = "megamenu-heading";
9
+ export declare const megamenuSupportingClass = "megamenu-supporting";
10
+ export declare const megamenuMobileClass = "megamenu-mobile";
@@ -0,0 +1,12 @@
1
+ import type { OtpInputColor, OtpInputSize, OtpInputVariant } from "../components/otp-input/OtpInput.types";
2
+ export declare const otpInputBaseClass = "otp-input";
3
+ export declare const otpInputCodeClass = "otp-code";
4
+ export declare function getOtpInputClasses({ size, variant, color, wrapperClassName, }: {
5
+ size?: OtpInputSize;
6
+ variant?: OtpInputVariant;
7
+ color?: OtpInputColor;
8
+ wrapperClassName?: string;
9
+ }): string;
10
+ export declare function getOtpInputCodeClasses({ className }: {
11
+ className?: string;
12
+ }): string;
@@ -1,13 +1,11 @@
1
1
  import type { PopoverPlacement } from "../components/popover/Popover.types";
2
2
  export declare const popoverWrapperClass = "popover-wrapper";
3
3
  export declare const popoverBaseClass = "popover";
4
- export declare const popoverShowClass = "popover-show";
5
4
  export declare const popoverArrowClass = "popover-arrow";
6
5
  export declare const popoverNoArrowClass = "popover-no-arrow";
7
6
  export declare const popoverPlacementClasses: Record<PopoverPlacement, string>;
8
- export declare function getPopoverClasses({ placement, open, arrow, className, }: {
7
+ export declare function getPopoverClasses({ placement, arrow, className, }: {
9
8
  placement?: PopoverPlacement;
10
- open?: boolean;
11
9
  arrow?: boolean;
12
10
  className?: string;
13
11
  }): string;
@@ -0,0 +1,12 @@
1
+ export declare const swapBaseClass = "swap";
2
+ export declare const swapInputClass = "swap-input";
3
+ export declare const swapOffClass = "swap-off";
4
+ export declare const swapOnClass = "swap-on";
5
+ export declare const swapRotateClass = "swap-rotate";
6
+ export declare function getSwapClasses({ rotate, wrapperClassName, }: {
7
+ rotate?: boolean;
8
+ wrapperClassName?: string;
9
+ }): string;
10
+ export declare function getSwapInputClasses({ className }: {
11
+ className?: string;
12
+ }): string;
@@ -3,23 +3,23 @@ export declare const treeSelectBaseClass = "tree-select";
3
3
  export declare const treeSelectOpenClass = "tree-select-open";
4
4
  export declare const treeSelectDisabledClass = "tree-select-disabled";
5
5
  export declare const treeSelectMultipleClass = "tree-select-multiple";
6
- export declare const treeSelectSelectionClass = "tree-select-selection";
6
+ export declare const treeSelectSelectionClass = "tree-select-selection tree-select-value";
7
7
  export declare const treeSelectPlaceholderClass = "tree-select-placeholder";
8
8
  export declare const treeSelectTagClass = "tree-select-tag";
9
9
  export declare const treeSelectClearClass = "tree-select-clear";
10
- export declare const treeSelectIconClass = "tree-select-icon";
10
+ export declare const treeSelectIconClass = "tree-select-icon tree-select-arrow";
11
11
  export declare const treeSelectDropdownClass = "tree-select-dropdown";
12
- export declare const treeSelectSearchClass = "tree-select-search";
13
- export declare const treeSelectListClass = "tree-select-list";
12
+ export declare const treeSelectSearchClass = "tree-select-search-input";
13
+ export declare const treeSelectListClass = "tree-select-list tree-select-options";
14
14
  export declare const treeSelectEmptyClass = "tree-select-empty";
15
15
  export declare const treeSelectNodeClass = "tree-select-node";
16
16
  export declare const treeSelectNodeSelectedClass = "tree-select-node-selected";
17
17
  export declare const treeSelectNodeCheckedClass = "tree-select-node-checked";
18
18
  export declare const treeSelectNodeExpandedClass = "tree-select-node-expanded";
19
19
  export declare const treeSelectNodeDisabledClass = "tree-select-node-disabled";
20
- export declare const treeSelectSwitcherClass = "tree-select-switcher";
20
+ export declare const treeSelectSwitcherClass = "tree-select-switcher tree-select-node-toggle";
21
21
  export declare const treeSelectCheckboxClass = "tree-select-checkbox";
22
- export declare const treeSelectTitleClass = "tree-select-title";
22
+ export declare const treeSelectTitleClass = "tree-select-title tree-select-node-label";
23
23
  export declare function getTreeSelectContainerClasses({ open, disabled, multiple, className, }: {
24
24
  open?: boolean;
25
25
  disabled?: boolean;
@@ -235,6 +235,6 @@ var Anchor = forwardRef(({
235
235
  Anchor.displayName = "Anchor";
236
236
  Anchor.Link = AnchorLink;
237
237
  export {
238
- AnchorLink,
239
- Anchor
238
+ Anchor,
239
+ AnchorLink
240
240
  };
@@ -1,7 +1,13 @@
1
1
  "use client";
2
2
 
3
- // src/components/message/Message.tsx
4
- import React, { useSyncExternalStore } from "react";
3
+ // src/components/app/App.tsx
4
+ import {
5
+ createContext,
6
+ forwardRef as forwardRef2,
7
+ useContext,
8
+ useEffect as useEffect3,
9
+ useMemo as useMemo2
10
+ } from "react";
5
11
 
6
12
  // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
7
13
  function r(e) {
@@ -28,6 +34,20 @@ function clsx() {
28
34
  function cn(...inputs) {
29
35
  return clsx(inputs);
30
36
  }
37
+ // src/classes/app.ts
38
+ var appClass = "app";
39
+ var appRootClass = "app-root";
40
+ var appHolderClass = "app-holder";
41
+ function getAppClasses({ className }) {
42
+ return cn(appClass, className);
43
+ }
44
+ function getAppRootClasses({ className }) {
45
+ return cn(appRootClass, className);
46
+ }
47
+
48
+ // src/components/message/Message.tsx
49
+ import React, { useSyncExternalStore } from "react";
50
+
31
51
  // src/classes/message.ts
32
52
  var messageHolderClass = "message-holder";
33
53
  var messageBaseClass = "message";
@@ -154,13 +174,13 @@ function config(nextConfig) {
154
174
  emit();
155
175
  }
156
176
  function MessageHolder({ className }) {
157
- const snapshot2 = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
177
+ const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
158
178
  return /* @__PURE__ */ jsx("div", {
159
179
  className: getMessageHolderClasses({
160
- placement: snapshot2.config.placement,
180
+ placement: snapshot.config.placement,
161
181
  className
162
182
  }),
163
- children: snapshot2.messages.map((item) => /* @__PURE__ */ jsxs("div", {
183
+ children: snapshot.messages.map((item) => /* @__PURE__ */ jsxs("div", {
164
184
  className: getMessageClasses({
165
185
  type: item.type,
166
186
  className: item.className
@@ -204,27 +224,18 @@ import {
204
224
  forwardRef,
205
225
  useCallback,
206
226
  useEffect,
227
+ useId,
207
228
  useRef,
208
229
  useState
209
230
  } from "react";
210
231
 
211
232
  // src/classes/modal.ts
212
- var modalBackdropClass = "modal-backdrop";
213
- var modalOpenClass = "modal-open";
214
- var modalBackdropCenterClass = "modal-backdrop-center";
215
233
  var modalClass = "modal";
216
234
  var modalHeaderClass = "modal-header";
217
235
  var modalTitleClass = "modal-title";
218
236
  var modalCloseClass = "modal-close";
219
237
  var modalBodyClass = "modal-body";
220
238
  var modalFooterClass = "modal-footer";
221
- function getModalBackdropClasses({
222
- open: open2,
223
- centered,
224
- className
225
- }) {
226
- return cn(modalBackdropClass, open2 && modalOpenClass, centered && modalBackdropCenterClass, className);
227
- }
228
239
  function getModalClasses({ className }) {
229
240
  return cn(modalClass, className);
230
241
  }
@@ -233,8 +244,8 @@ function getModalClasses({ className }) {
233
244
  import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
234
245
  var defaultCloseIcon = "x";
235
246
  var serviceHandles = new Set;
236
- function createServiceHandle(config2) {
237
- let currentConfig = config2;
247
+ function createServiceHandle(config) {
248
+ let currentConfig = config;
238
249
  const handle = {
239
250
  destroy: () => {
240
251
  serviceHandles.delete(handle);
@@ -255,8 +266,15 @@ function getModalStyle({
255
266
  ...width !== undefined ? { width } : undefined
256
267
  };
257
268
  }
269
+ function showNativeModal(dialog) {
270
+ if (!dialog.isConnected || dialog.matches(":modal"))
271
+ return;
272
+ if (dialog.open)
273
+ dialog.close();
274
+ dialog.showModal();
275
+ }
258
276
  var ModalBase = forwardRef(({
259
- open: open2,
277
+ open,
260
278
  defaultOpen = false,
261
279
  title,
262
280
  children,
@@ -277,15 +295,41 @@ var ModalBase = forwardRef(({
277
295
  maskClassName,
278
296
  closeIcon = defaultCloseIcon,
279
297
  style,
280
- role = "dialog",
298
+ role,
281
299
  ...props
282
300
  }, ref) => {
283
- const controlled = open2 !== undefined;
301
+ const controlled = open !== undefined;
284
302
  const [innerOpen, setInnerOpen] = useState(defaultOpen);
285
- const mergedOpen = controlled ? Boolean(open2) : innerOpen;
303
+ const mergedOpen = controlled ? Boolean(open) : innerOpen;
286
304
  const previousOpen = useRef(mergedOpen);
305
+ const desiredOpen = useRef(mergedOpen);
306
+ desiredOpen.current = mergedOpen;
307
+ const dialogRef = useRef(null);
308
+ const cancelRequestRef = useRef(null);
309
+ const programmaticClose = useRef(false);
310
+ const titleId = useId();
311
+ const surfaceWidth = width ?? style?.width;
312
+ const callerNamed = props["aria-label"] != null || props["aria-labelledby"] != null;
287
313
  const showClose = closable && closeIcon !== null && closeIcon !== false;
288
314
  const body = children ?? content;
315
+ useEffect(() => {
316
+ const dialog = dialogRef.current;
317
+ if (!dialog)
318
+ return;
319
+ if (mergedOpen) {
320
+ programmaticClose.current = false;
321
+ showNativeModal(dialog);
322
+ } else if (dialog.open) {
323
+ programmaticClose.current = true;
324
+ dialog.close();
325
+ }
326
+ return () => {
327
+ if (dialog.open) {
328
+ programmaticClose.current = true;
329
+ dialog.close();
330
+ }
331
+ };
332
+ }, [mergedOpen]);
289
333
  useEffect(() => {
290
334
  if (previousOpen.current === mergedOpen) {
291
335
  return;
@@ -302,73 +346,109 @@ var ModalBase = forwardRef(({
302
346
  const handleOk = useCallback((event) => {
303
347
  onOk?.(event);
304
348
  }, [onOk]);
305
- const handleMaskClick = useCallback((event) => {
306
- if (event.target !== event.currentTarget || !maskClosable) {
349
+ const requestCancel = useCallback(() => {
350
+ cancelRequestRef.current?.click();
351
+ }, []);
352
+ const handleNativeClose = useCallback(() => {
353
+ const dialog = dialogRef.current;
354
+ if (!dialog || dialog.open || programmaticClose.current) {
355
+ programmaticClose.current = false;
307
356
  return;
308
357
  }
309
- close(event);
310
- }, [close, maskClosable]);
358
+ if (desiredOpen.current) {
359
+ requestCancel();
360
+ if (controlled) {
361
+ queueMicrotask(() => {
362
+ if (desiredOpen.current) {
363
+ showNativeModal(dialog);
364
+ }
365
+ });
366
+ }
367
+ }
368
+ }, [controlled, requestCancel]);
311
369
  if (!mergedOpen && destroyOnClose) {
312
370
  return null;
313
371
  }
314
- return /* @__PURE__ */ jsx2("div", {
315
- "aria-hidden": mergedOpen ? undefined : true,
316
- role: "presentation",
317
- className: getModalBackdropClasses({
318
- open: mergedOpen,
319
- centered,
320
- className: maskClassName
321
- }),
322
- onMouseDown: handleMaskClick,
323
- children: /* @__PURE__ */ jsxs2("div", {
324
- ...props,
325
- ref,
326
- role,
327
- "aria-modal": mergedOpen ? true : undefined,
328
- className: getModalClasses({ className }),
329
- style: getModalStyle({ width, style }),
330
- children: [
331
- title !== undefined || showClose ? /* @__PURE__ */ jsxs2("div", {
332
- className: modalHeaderClass,
333
- children: [
334
- title !== undefined ? /* @__PURE__ */ jsx2("h2", {
335
- className: modalTitleClass,
336
- children: title
337
- }) : null,
338
- showClose ? /* @__PURE__ */ jsx2("button", {
339
- type: "button",
340
- className: modalCloseClass,
341
- "aria-label": "Close",
342
- onClick: close,
343
- children: closeIcon
344
- }) : null
345
- ]
346
- }) : null,
347
- /* @__PURE__ */ jsx2("div", {
348
- className: modalBodyClass,
349
- children: body
350
- }),
351
- footer === null ? null : /* @__PURE__ */ jsx2("div", {
352
- className: modalFooterClass,
353
- children: footer !== undefined ? footer : /* @__PURE__ */ jsxs2(Fragment, {
372
+ return /* @__PURE__ */ jsxs2("dialog", {
373
+ ref: dialogRef,
374
+ role: role === "alertdialog" ? role : undefined,
375
+ "aria-label": props["aria-label"] ?? (!callerNamed && title == null ? "Modal" : undefined),
376
+ "aria-labelledby": props["aria-labelledby"] ?? (!callerNamed && title != null ? titleId : undefined),
377
+ "aria-describedby": props["aria-describedby"],
378
+ className: getModalClasses({ className: cn(maskClassName, centered ? "modal-middle" : "modal-top") }),
379
+ style: surfaceWidth !== undefined ? { width: surfaceWidth, maxWidth: surfaceWidth } : undefined,
380
+ onCancel: (event) => {
381
+ event.preventDefault();
382
+ requestCancel();
383
+ },
384
+ onClose: handleNativeClose,
385
+ onMouseDown: (event) => {
386
+ if (!maskClosable || event.target !== event.currentTarget)
387
+ return;
388
+ const { left, right, top, bottom } = event.currentTarget.getBoundingClientRect();
389
+ if (event.clientX < left || event.clientX > right || event.clientY < top || event.clientY > bottom) {
390
+ requestCancel();
391
+ }
392
+ },
393
+ children: [
394
+ /* @__PURE__ */ jsx2("button", {
395
+ ref: cancelRequestRef,
396
+ type: "button",
397
+ hidden: true,
398
+ tabIndex: -1,
399
+ "aria-hidden": "true",
400
+ onClick: close
401
+ }),
402
+ /* @__PURE__ */ jsxs2("div", {
403
+ ...props,
404
+ ref,
405
+ role,
406
+ className: cn("modal-box", "react-modal-box", className),
407
+ style: getModalStyle({ width, style }),
408
+ children: [
409
+ title !== undefined || showClose ? /* @__PURE__ */ jsxs2("div", {
410
+ className: modalHeaderClass,
354
411
  children: [
355
- /* @__PURE__ */ jsx2("button", {
412
+ title !== undefined ? /* @__PURE__ */ jsx2("h2", {
413
+ id: titleId,
414
+ className: modalTitleClass,
415
+ children: title
416
+ }) : null,
417
+ showClose ? /* @__PURE__ */ jsx2("button", {
356
418
  type: "button",
419
+ className: modalCloseClass,
420
+ "aria-label": "Close",
357
421
  onClick: close,
358
- children: cancelText
359
- }),
360
- /* @__PURE__ */ jsx2("button", {
361
- type: "button",
362
- "aria-busy": confirmLoading,
363
- disabled: confirmLoading,
364
- onClick: handleOk,
365
- children: okText
366
- })
422
+ children: closeIcon
423
+ }) : null
367
424
  ]
425
+ }) : null,
426
+ /* @__PURE__ */ jsx2("div", {
427
+ className: modalBodyClass,
428
+ children: body
429
+ }),
430
+ footer === null ? null : /* @__PURE__ */ jsx2("div", {
431
+ className: modalFooterClass,
432
+ children: footer !== undefined ? footer : /* @__PURE__ */ jsxs2(Fragment, {
433
+ children: [
434
+ /* @__PURE__ */ jsx2("button", {
435
+ type: "button",
436
+ onClick: close,
437
+ children: cancelText
438
+ }),
439
+ /* @__PURE__ */ jsx2("button", {
440
+ type: "button",
441
+ "aria-busy": confirmLoading,
442
+ disabled: confirmLoading,
443
+ onClick: handleOk,
444
+ children: okText
445
+ })
446
+ ]
447
+ })
368
448
  })
369
- })
370
- ]
371
- })
449
+ ]
450
+ })
451
+ ]
372
452
  });
373
453
  });
374
454
  ModalBase.displayName = "Modal";
@@ -425,10 +505,10 @@ function getNotificationHolderClasses({
425
505
  }
426
506
  function getNotificationNoticeClasses({
427
507
  type = "info",
428
- open: open2 = true,
508
+ open = true,
429
509
  className
430
510
  }) {
431
- return cn("toast", "alert", notificationNoticeClass, notificationTypeClasses[type], open2 && "toast-show", open2 && notificationNoticeOpenClass, className);
511
+ return cn("toast", "alert", notificationNoticeClass, notificationTypeClasses[type], open && "toast-show", open && notificationNoticeOpenClass, className);
432
512
  }
433
513
 
434
514
  // src/components/notification/Notification.tsx
@@ -457,11 +537,11 @@ function getKey(key) {
457
537
  globalCounter += 1;
458
538
  return `notification-${globalCounter}`;
459
539
  }
460
- function getDuration(config2, holderConfig) {
461
- return config2.duration ?? holderConfig.duration ?? defaultConfig.duration;
540
+ function getDuration(config, holderConfig) {
541
+ return config.duration ?? holderConfig.duration ?? defaultConfig.duration;
462
542
  }
463
- function getPlacement(config2, holderConfig) {
464
- return config2.placement ?? holderConfig.placement ?? defaultConfig.placement;
543
+ function getPlacement(config, holderConfig) {
544
+ return config.placement ?? holderConfig.placement ?? defaultConfig.placement;
465
545
  }
466
546
  function applyMaxCount(notices, maxCount) {
467
547
  if (!maxCount || notices.length <= maxCount) {
@@ -539,42 +619,42 @@ function destroyGlobal(key) {
539
619
  globalNotices = [];
540
620
  emitGlobal();
541
621
  }
542
- function openGlobal(config2) {
543
- const key = getKey(config2.key);
622
+ function openGlobal(config) {
623
+ const key = getKey(config.key);
544
624
  const notice = {
545
- ...config2,
625
+ ...config,
546
626
  key,
547
- placement: getPlacement(config2, globalConfig2),
548
- type: config2.type ?? "info"
627
+ placement: getPlacement(config, globalConfig2),
628
+ type: config.type ?? "info"
549
629
  };
550
630
  clearTimer2(key);
551
631
  globalNotices = applyMaxCount([...globalNotices.filter((item) => item.key !== key), notice], globalConfig2.maxCount);
552
- const duration = getDuration(config2, globalConfig2);
632
+ const duration = getDuration(config, globalConfig2);
553
633
  if (duration && duration > 0) {
554
634
  globalTimers.set(key, setTimeout(() => closeGlobal(key), duration * 1000));
555
635
  }
556
636
  emitGlobal();
557
637
  }
558
- function withType(type, config2) {
559
- openGlobal({ ...config2, type });
638
+ function withType(type, config) {
639
+ openGlobal({ ...config, type });
560
640
  }
561
641
  var globalApi = {
562
642
  open: openGlobal,
563
- success: (config2) => withType("success", config2),
564
- info: (config2) => withType("info", config2),
565
- warning: (config2) => withType("warning", config2),
566
- error: (config2) => withType("error", config2),
643
+ success: (config) => withType("success", config),
644
+ info: (config) => withType("info", config),
645
+ warning: (config) => withType("warning", config),
646
+ error: (config) => withType("error", config),
567
647
  close: closeGlobal,
568
648
  destroy: destroyGlobal,
569
- config: (config2) => {
570
- globalConfig2 = { ...globalConfig2, ...config2 };
649
+ config: (config) => {
650
+ globalConfig2 = { ...globalConfig2, ...config };
571
651
  emitGlobal();
572
652
  },
573
653
  useNotification
574
654
  };
575
655
  function NotificationHolder({
576
656
  notices,
577
- config: config2,
657
+ config,
578
658
  onClose
579
659
  }) {
580
660
  const groups = groupByPlacement(notices);
@@ -583,7 +663,7 @@ function NotificationHolder({
583
663
  if (group.length === 0) {
584
664
  return null;
585
665
  }
586
- const offsetStyle = placement.startsWith("bottom") && config2.bottom !== undefined ? { bottom: config2.bottom } : config2.top !== undefined ? { top: config2.top } : undefined;
666
+ const offsetStyle = placement.startsWith("bottom") && config.bottom !== undefined ? { bottom: config.bottom } : config.top !== undefined ? { top: config.top } : undefined;
587
667
  return /* @__PURE__ */ jsx3("div", {
588
668
  className: getNotificationHolderClasses({
589
669
  placement
@@ -591,7 +671,7 @@ function NotificationHolder({
591
671
  style: offsetStyle,
592
672
  children: group.map((notice) => /* @__PURE__ */ jsx3(NotificationNotice, {
593
673
  notice,
594
- fallbackCloseIcon: config2.closeIcon,
674
+ fallbackCloseIcon: config.closeIcon,
595
675
  onClose
596
676
  }, notice.key))
597
677
  }, placement);
@@ -678,30 +758,30 @@ function createScopedApi({
678
758
  return current.filter((item) => item.key !== key);
679
759
  });
680
760
  }
681
- function open2(config2) {
682
- const key = getKey(config2.key);
761
+ function open(config) {
762
+ const key = getKey(config.key);
683
763
  const notice = {
684
- ...config2,
764
+ ...config,
685
765
  key,
686
- placement: getPlacement(config2, holderConfig),
687
- type: config2.type ?? "info"
766
+ placement: getPlacement(config, holderConfig),
767
+ type: config.type ?? "info"
688
768
  };
689
769
  clearScopedTimer(key);
690
770
  setNotices((current) => applyMaxCount([...current.filter((item) => item.key !== key), notice], holderConfig.maxCount));
691
- const duration = getDuration(config2, holderConfig);
771
+ const duration = getDuration(config, holderConfig);
692
772
  if (duration && duration > 0) {
693
773
  timerMap.set(key, setTimeout(() => close(key), duration * 1000));
694
774
  }
695
775
  }
696
- function typed(type, config2) {
697
- open2({ ...config2, type });
776
+ function typed(type, config) {
777
+ open({ ...config, type });
698
778
  }
699
779
  return {
700
- open: open2,
701
- success: (config2) => typed("success", config2),
702
- info: (config2) => typed("info", config2),
703
- warning: (config2) => typed("warning", config2),
704
- error: (config2) => typed("error", config2),
780
+ open,
781
+ success: (config) => typed("success", config),
782
+ info: (config) => typed("info", config),
783
+ warning: (config) => typed("warning", config),
784
+ error: (config) => typed("error", config),
705
785
  close,
706
786
  destroy: (key) => {
707
787
  if (key !== undefined) {
@@ -720,24 +800,24 @@ function createScopedApi({
720
800
  }
721
801
  };
722
802
  }
723
- function useNotification(config2 = {}) {
803
+ function useNotification(config = {}) {
724
804
  const holderConfig = useMemo(() => ({
725
805
  ...defaultConfig,
726
- bottom: config2.bottom,
727
- closeIcon: config2.closeIcon,
728
- duration: config2.duration ?? defaultConfig.duration,
729
- getContainer: config2.getContainer,
730
- maxCount: config2.maxCount,
731
- placement: config2.placement ?? defaultConfig.placement,
732
- top: config2.top
806
+ bottom: config.bottom,
807
+ closeIcon: config.closeIcon,
808
+ duration: config.duration ?? defaultConfig.duration,
809
+ getContainer: config.getContainer,
810
+ maxCount: config.maxCount,
811
+ placement: config.placement ?? defaultConfig.placement,
812
+ top: config.top
733
813
  }), [
734
- config2.bottom,
735
- config2.closeIcon,
736
- config2.duration,
737
- config2.getContainer,
738
- config2.maxCount,
739
- config2.placement,
740
- config2.top
814
+ config.bottom,
815
+ config.closeIcon,
816
+ config.duration,
817
+ config.getContainer,
818
+ config.maxCount,
819
+ config.placement,
820
+ config.top
741
821
  ]);
742
822
  const [notices, setNotices] = useState2([]);
743
823
  const [timerMap] = useState2(() => new Map);
@@ -772,26 +852,6 @@ function useNotification(config2 = {}) {
772
852
  ];
773
853
  }
774
854
  var notification = globalApi;
775
- // src/components/app/App.tsx
776
- import {
777
- createContext,
778
- forwardRef as forwardRef2,
779
- useContext,
780
- useEffect as useEffect3,
781
- useMemo as useMemo2
782
- } from "react";
783
-
784
- // src/classes/app.ts
785
- var appClass = "app";
786
- var appRootClass = "app-root";
787
- var appHolderClass = "app-holder";
788
- function getAppClasses({ className }) {
789
- return cn(appClass, className);
790
- }
791
- function getAppRootClasses({ className }) {
792
- return cn(appRootClass, className);
793
- }
794
-
795
855
  // src/components/app/App.tsx
796
856
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
797
857
  var fallbackContext = {
@@ -877,7 +937,7 @@ function AppRoot({ className, ...props }) {
877
937
  });
878
938
  }
879
939
  export {
880
- AppRoot,
940
+ App,
881
941
  AppContext,
882
- App
942
+ AppRoot
883
943
  };
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps } from "react";
2
- export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
2
+ export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
3
3
  export type AvatarShape = "circle" | "square";
4
4
  export interface AvatarProps extends ComponentProps<"span"> {
5
5
  size?: AvatarSize;
@@ -35,7 +35,8 @@ var avatarSizeClasses = {
35
35
  sm: "avatar-sm",
36
36
  md: "avatar-md",
37
37
  lg: "avatar-lg",
38
- xl: "avatar-xl"
38
+ xl: "avatar-xl",
39
+ "2xl": "avatar-2xl"
39
40
  };
40
41
  var avatarShapeClasses = {
41
42
  circle: "avatar-circle",
@@ -41,7 +41,7 @@ var badgeColorClasses = {
41
41
  };
42
42
  var badgeAppearanceClasses = {
43
43
  filled: "",
44
- outline: "badge-outline",
44
+ outline: "badge-outlined badge-outline",
45
45
  tonal: "badge-tonal",
46
46
  ghost: "badge-ghost"
47
47
  };