@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
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
- // src/components/breadcrumb/Breadcrumb.tsx
4
- import React, { forwardRef } from "react";
3
+ // src/components/dm-layout/DmLayout.tsx
4
+ import { forwardRef as forwardRef6, useEffect as useEffect2, useMemo as useMemo3, useState as useState4 } from "react";
5
5
 
6
6
  // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
7
7
  function r(e) {
@@ -28,6 +28,150 @@ function clsx() {
28
28
  function cn(...inputs) {
29
29
  return clsx(inputs);
30
30
  }
31
+ // src/classes/dm-layout.ts
32
+ var dmLayoutClass = "dm-layout";
33
+ var dmLayoutShellClass = "dm-layout-shell";
34
+ var dmLayoutMainClass = "dm-layout-main";
35
+ var dmLayoutSiderClass = "dm-layout-sider";
36
+ var dmLayoutBodyClass = "dm-layout-body";
37
+ var dmLayoutBreadcrumbClass = "dm-layout-breadcrumb";
38
+ var dmLayoutContentClass = "dm-layout-content";
39
+ var dmLayoutAuxiliaryClass = "dm-layout-auxiliary";
40
+ function getDmLayoutClasses({ className }) {
41
+ return cn(dmLayoutClass, className);
42
+ }
43
+
44
+ // src/components/layout/Layout.tsx
45
+ import { forwardRef, useState } from "react";
46
+
47
+ // src/classes/layout.ts
48
+ var layoutBaseClass = "layout";
49
+ var layoutHasSiderClass = "layout-has-sider";
50
+ var layoutHeaderClass = "layout-header";
51
+ var layoutSiderClass = "layout-sider";
52
+ var layoutSiderCollapsedClass = "layout-sider-collapsed";
53
+ var layoutContentClass = "layout-content";
54
+ var layoutFooterClass = "layout-footer";
55
+ var layoutTriggerClass = "layout-trigger";
56
+ function getLayoutClasses({
57
+ hasSider,
58
+ className
59
+ }) {
60
+ return cn(layoutBaseClass, hasSider && layoutHasSiderClass, className);
61
+ }
62
+ function getLayoutSiderClasses({
63
+ collapsed,
64
+ className
65
+ }) {
66
+ return cn(layoutSiderClass, collapsed && layoutSiderCollapsedClass, className);
67
+ }
68
+
69
+ // src/components/layout/Layout.tsx
70
+ import { jsx, jsxs } from "react/jsx-runtime";
71
+ function toSize(value) {
72
+ return typeof value === "number" ? `${value}px` : value;
73
+ }
74
+ var Header = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
75
+ ...props,
76
+ ref,
77
+ className: cn(layoutHeaderClass, className)
78
+ }));
79
+ Header.displayName = "Layout.Header";
80
+ var Content = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
81
+ ...props,
82
+ ref,
83
+ className: cn(layoutContentClass, className)
84
+ }));
85
+ Content.displayName = "Layout.Content";
86
+ var Footer = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
87
+ ...props,
88
+ ref,
89
+ className: cn(layoutFooterClass, className)
90
+ }));
91
+ Footer.displayName = "Layout.Footer";
92
+ var Sider = forwardRef(({
93
+ children,
94
+ collapsible,
95
+ collapsed,
96
+ defaultCollapsed,
97
+ onCollapse,
98
+ width = 200,
99
+ collapsedWidth = 80,
100
+ trigger,
101
+ breakpoint,
102
+ className,
103
+ style,
104
+ ...props
105
+ }, ref) => {
106
+ const controlled = collapsed !== undefined;
107
+ const [internalCollapsed, setInternalCollapsed] = useState(() => defaultCollapsed ?? false);
108
+ const mergedCollapsed = controlled ? collapsed : internalCollapsed;
109
+ const siderWidth = toSize(mergedCollapsed ? collapsedWidth : width);
110
+ function toggleCollapsed() {
111
+ const nextCollapsed = !mergedCollapsed;
112
+ if (!controlled) {
113
+ setInternalCollapsed(nextCollapsed);
114
+ }
115
+ onCollapse?.(nextCollapsed, "clickTrigger");
116
+ }
117
+ return /* @__PURE__ */ jsxs("div", {
118
+ ...props,
119
+ ref,
120
+ "data-breakpoint": breakpoint,
121
+ className: getLayoutSiderClasses({
122
+ collapsed: mergedCollapsed,
123
+ className
124
+ }),
125
+ style: {
126
+ flex: `0 0 ${siderWidth}`,
127
+ maxWidth: siderWidth,
128
+ minWidth: siderWidth,
129
+ width: siderWidth,
130
+ ...style
131
+ },
132
+ children: [
133
+ children,
134
+ collapsible && trigger !== null ? /* @__PURE__ */ jsx("button", {
135
+ type: "button",
136
+ className: layoutTriggerClass,
137
+ "aria-label": mergedCollapsed ? "Expand sider" : "Collapse sider",
138
+ onClick: toggleCollapsed,
139
+ children: trigger ?? (mergedCollapsed ? ">" : "<")
140
+ }) : null
141
+ ]
142
+ });
143
+ });
144
+ Sider.displayName = "Layout.Sider";
145
+ var LayoutRoot = forwardRef(({ hasSider, className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
146
+ ...props,
147
+ ref,
148
+ className: getLayoutClasses({ hasSider, className })
149
+ }));
150
+ LayoutRoot.displayName = "Layout";
151
+ LayoutRoot.Header = Header;
152
+ LayoutRoot.Sider = Sider;
153
+ LayoutRoot.Content = Content;
154
+ LayoutRoot.Footer = Footer;
155
+ var Layout = LayoutRoot;
156
+ // src/components/dm-breadcrumb/DmBreadcrumb.tsx
157
+ import { forwardRef as forwardRef3, useEffect, useMemo, useState as useState2 } from "react";
158
+
159
+ // src/classes/dm-breadcrumb.ts
160
+ var dmBreadcrumbClass = "dm-breadcrumb";
161
+ var dmBreadcrumbCompactClass = "dm-breadcrumb-compact";
162
+ var dmBreadcrumbRecentClass = "dm-breadcrumb-recent";
163
+ var dmBreadcrumbValueClass = "dm-breadcrumb-value";
164
+ function getDmBreadcrumbClasses({
165
+ compact,
166
+ recent,
167
+ className
168
+ }) {
169
+ return cn(dmBreadcrumbClass, compact && dmBreadcrumbCompactClass, recent && dmBreadcrumbRecentClass, className);
170
+ }
171
+
172
+ // src/components/breadcrumb/Breadcrumb.tsx
173
+ import React2, { forwardRef as forwardRef2 } from "react";
174
+
31
175
  // src/classes/breadcrumb.ts
32
176
  var breadcrumbBaseClass = "breadcrumbs";
33
177
  var breadcrumbItemClass = "breadcrumb-item";
@@ -57,7 +201,7 @@ function getBreadcrumbLinkClasses({
57
201
  }
58
202
 
59
203
  // src/components/breadcrumb/Breadcrumb.tsx
60
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
204
+ import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
61
205
  var defaultSeparator = "/";
62
206
  function isSeparatorItem(item) {
63
207
  return "type" in item && item.type === "separator";
@@ -110,9 +254,9 @@ function activateOnKeyboard(event) {
110
254
  }
111
255
  function renderItemBody(item) {
112
256
  const title = getItemTitle(item);
113
- return /* @__PURE__ */ jsxs(Fragment, {
257
+ return /* @__PURE__ */ jsxs2(Fragment, {
114
258
  children: [
115
- item.icon ? /* @__PURE__ */ jsx("span", {
259
+ item.icon ? /* @__PURE__ */ jsx2("span", {
116
260
  className: breadcrumbIconClass,
117
261
  "aria-hidden": "true",
118
262
  children: item.icon
@@ -159,7 +303,7 @@ function renderMenuItems(menu, items = []) {
159
303
  item.onClick?.(event);
160
304
  menu.onClick?.({ key, item, domEvent: event });
161
305
  }
162
- const content = item.disabled ? /* @__PURE__ */ jsx("span", {
306
+ const content = item.disabled ? /* @__PURE__ */ jsx2("span", {
163
307
  role: "menuitem",
164
308
  "aria-disabled": "true",
165
309
  className: getBreadcrumbLinkClasses({
@@ -167,23 +311,23 @@ function renderMenuItems(menu, items = []) {
167
311
  className: breadcrumbMenuItemClass
168
312
  }),
169
313
  children: label
170
- }) : href ? /* @__PURE__ */ jsx("a", {
314
+ }) : href ? /* @__PURE__ */ jsx2("a", {
171
315
  role: "menuitem",
172
316
  className: cn(breadcrumbMenuItemClass, getBreadcrumbLinkClasses({})),
173
317
  href,
174
318
  onClick: handleClick,
175
319
  children: label
176
- }) : /* @__PURE__ */ jsx("button", {
320
+ }) : /* @__PURE__ */ jsx2("button", {
177
321
  type: "button",
178
322
  role: "menuitem",
179
323
  className: cn(breadcrumbMenuItemClass, getBreadcrumbLinkClasses({})),
180
324
  onClick: handleClick,
181
325
  children: label
182
326
  });
183
- return /* @__PURE__ */ jsxs("li", {
327
+ return /* @__PURE__ */ jsxs2("li", {
184
328
  children: [
185
329
  content,
186
- item.children?.length ? /* @__PURE__ */ jsx("ul", {
330
+ item.children?.length ? /* @__PURE__ */ jsx2("ul", {
187
331
  className: breadcrumbMenuListClass,
188
332
  role: "menu",
189
333
  children: renderMenuItems(menu, item.children)
@@ -199,7 +343,7 @@ function renderDefaultItemContent(item, paths, active) {
199
343
  }
200
344
  const href = item.href ?? (!active ? getHref(item, paths) : undefined);
201
345
  if (href) {
202
- return /* @__PURE__ */ jsx("a", {
346
+ return /* @__PURE__ */ jsx2("a", {
203
347
  className: getBreadcrumbLinkClasses({}),
204
348
  href,
205
349
  onClick: item.onClick,
@@ -207,7 +351,7 @@ function renderDefaultItemContent(item, paths, active) {
207
351
  });
208
352
  }
209
353
  if (item.onClick) {
210
- return /* @__PURE__ */ jsx("span", {
354
+ return /* @__PURE__ */ jsx2("span", {
211
355
  role: "button",
212
356
  tabIndex: 0,
213
357
  className: getBreadcrumbLinkClasses({}),
@@ -219,18 +363,18 @@ function renderDefaultItemContent(item, paths, active) {
219
363
  return body;
220
364
  }
221
365
  function renderMenuItem(item, menu, children, disabled) {
222
- return /* @__PURE__ */ jsxs("details", {
366
+ return /* @__PURE__ */ jsxs2("details", {
223
367
  className: getBreadcrumbItemClasses({
224
368
  disabled,
225
369
  className: cn(breadcrumbMenuClass, item.className)
226
370
  }),
227
371
  "aria-disabled": disabled || undefined,
228
372
  children: [
229
- /* @__PURE__ */ jsx("summary", {
373
+ /* @__PURE__ */ jsx2("summary", {
230
374
  className: getBreadcrumbLinkClasses({ disabled }),
231
375
  children
232
376
  }),
233
- /* @__PURE__ */ jsx("ul", {
377
+ /* @__PURE__ */ jsx2("ul", {
234
378
  className: breadcrumbMenuListClass,
235
379
  role: "menu",
236
380
  children: renderMenuItems(menu, menu.items)
@@ -238,7 +382,7 @@ function renderMenuItem(item, menu, children, disabled) {
238
382
  ]
239
383
  });
240
384
  }
241
- var Breadcrumb = forwardRef(({
385
+ var Breadcrumb = forwardRef2(({
242
386
  items,
243
387
  routes,
244
388
  params = {},
@@ -251,7 +395,7 @@ var Breadcrumb = forwardRef(({
251
395
  }, ref) => {
252
396
  const entries = items ?? routes;
253
397
  if (!entries?.length) {
254
- return /* @__PURE__ */ jsx("nav", {
398
+ return /* @__PURE__ */ jsx2("nav", {
255
399
  ...props,
256
400
  ref,
257
401
  "aria-label": ariaLabel,
@@ -262,7 +406,7 @@ var Breadcrumb = forwardRef(({
262
406
  const routeEntries = entries.filter((item) => !isSeparatorItem(item));
263
407
  let routeIndex = -1;
264
408
  let previousRenderedItemWasSeparator = true;
265
- return /* @__PURE__ */ jsx("nav", {
409
+ return /* @__PURE__ */ jsx2("nav", {
266
410
  ...props,
267
411
  ref,
268
412
  "aria-label": ariaLabel,
@@ -270,7 +414,7 @@ var Breadcrumb = forwardRef(({
270
414
  children: entries.map((entry, index) => {
271
415
  if (isSeparatorItem(entry)) {
272
416
  previousRenderedItemWasSeparator = true;
273
- return /* @__PURE__ */ jsx("span", {
417
+ return /* @__PURE__ */ jsx2("span", {
274
418
  className: cn(breadcrumbSeparatorClass, entry.className),
275
419
  "aria-hidden": "true",
276
420
  children: entry.separator ?? separator
@@ -285,14 +429,14 @@ var Breadcrumb = forwardRef(({
285
429
  const applyActiveClass = active && !itemRender && !entry.href && !entry.onClick;
286
430
  const insertSeparator = !previousRenderedItemWasSeparator;
287
431
  previousRenderedItemWasSeparator = false;
288
- return /* @__PURE__ */ jsxs(React.Fragment, {
432
+ return /* @__PURE__ */ jsxs2(React2.Fragment, {
289
433
  children: [
290
- insertSeparator ? /* @__PURE__ */ jsx("span", {
434
+ insertSeparator ? /* @__PURE__ */ jsx2("span", {
291
435
  className: breadcrumbSeparatorClass,
292
436
  "aria-hidden": "true",
293
437
  children: separator
294
438
  }) : null,
295
- menu?.items?.length ? renderMenuItem(entry, menu, content, entry.disabled) : /* @__PURE__ */ jsx("span", {
439
+ menu?.items?.length ? renderMenuItem(entry, menu, content, entry.disabled) : /* @__PURE__ */ jsx2("span", {
296
440
  className: getBreadcrumbItemClasses({
297
441
  active: applyActiveClass,
298
442
  disabled: entry.disabled,
@@ -309,23 +453,7 @@ var Breadcrumb = forwardRef(({
309
453
  });
310
454
  Breadcrumb.displayName = "Breadcrumb";
311
455
  // src/components/dm-breadcrumb/DmBreadcrumb.tsx
312
- import { forwardRef as forwardRef2, useEffect, useMemo, useState } from "react";
313
-
314
- // src/classes/dm-breadcrumb.ts
315
- var dmBreadcrumbClass = "dm-breadcrumb";
316
- var dmBreadcrumbCompactClass = "dm-breadcrumb-compact";
317
- var dmBreadcrumbRecentClass = "dm-breadcrumb-recent";
318
- var dmBreadcrumbValueClass = "dm-breadcrumb-value";
319
- function getDmBreadcrumbClasses({
320
- compact,
321
- recent,
322
- className
323
- }) {
324
- return cn(dmBreadcrumbClass, compact && dmBreadcrumbCompactClass, recent && dmBreadcrumbRecentClass, className);
325
- }
326
-
327
- // src/components/dm-breadcrumb/DmBreadcrumb.tsx
328
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
456
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
329
457
  var defaultStorageKey = "dm-breadcrumb-history-list";
330
458
  var defaultMaxHistoryLength = 10;
331
459
  function canUseSessionStorage() {
@@ -369,11 +497,11 @@ function resolveRecentUrl(item, history, isStoragePath) {
369
497
  function renderTitle(item, index) {
370
498
  if (item.itemRender)
371
499
  return item.itemRender(item);
372
- return /* @__PURE__ */ jsxs2("span", {
500
+ return /* @__PURE__ */ jsxs3("span", {
373
501
  title: typeof item.title === "string" ? item.title : undefined,
374
502
  children: [
375
503
  item.title,
376
- item.value !== undefined && index > 0 ? /* @__PURE__ */ jsxs2("span", {
504
+ item.value !== undefined && index > 0 ? /* @__PURE__ */ jsxs3("span", {
377
505
  className: dmBreadcrumbValueClass,
378
506
  children: [
379
507
  "(",
@@ -396,7 +524,7 @@ function collapseItems(items, maxVisibleItems) {
396
524
  ...items.slice(-tailCount)
397
525
  ];
398
526
  }
399
- var DmBreadcrumb = forwardRef2(({
527
+ var DmBreadcrumb = forwardRef3(({
400
528
  items,
401
529
  isStoragePath = true,
402
530
  storageKey = defaultStorageKey,
@@ -408,7 +536,7 @@ var DmBreadcrumb = forwardRef2(({
408
536
  separator,
409
537
  ...props
410
538
  }, ref) => {
411
- const [currentHistory, setCurrentHistory] = useState(() => history ?? readHistory(storageKey));
539
+ const [currentHistory, setCurrentHistory] = useState2(() => history ?? readHistory(storageKey));
412
540
  useEffect(() => {
413
541
  if (history) {
414
542
  setCurrentHistory(history);
@@ -442,7 +570,7 @@ var DmBreadcrumb = forwardRef2(({
442
570
  });
443
571
  return collapseItems(mappedItems, maxVisibleItems);
444
572
  }, [currentHistory, isStoragePath, items, maxVisibleItems]);
445
- return /* @__PURE__ */ jsx2(Breadcrumb, {
573
+ return /* @__PURE__ */ jsx3(Breadcrumb, {
446
574
  ...props,
447
575
  ref,
448
576
  items: breadcrumbItems,
@@ -455,118 +583,26 @@ var DmBreadcrumb = forwardRef2(({
455
583
  });
456
584
  });
457
585
  DmBreadcrumb.displayName = "DmBreadcrumb";
458
- // src/components/layout/Layout.tsx
459
- import { forwardRef as forwardRef3, useState as useState2 } from "react";
586
+ // src/components/dm-menu/DmMenu.tsx
587
+ import { forwardRef as forwardRef5, useMemo as useMemo2 } from "react";
460
588
 
461
- // src/classes/layout.ts
462
- var layoutBaseClass = "layout";
463
- var layoutHasSiderClass = "layout-has-sider";
464
- var layoutHeaderClass = "layout-header";
465
- var layoutSiderClass = "layout-sider";
466
- var layoutSiderCollapsedClass = "layout-sider-collapsed";
467
- var layoutContentClass = "layout-content";
468
- var layoutFooterClass = "layout-footer";
469
- var layoutTriggerClass = "layout-trigger";
470
- function getLayoutClasses({
471
- hasSider,
472
- className
473
- }) {
474
- return cn(layoutBaseClass, hasSider && layoutHasSiderClass, className);
475
- }
476
- function getLayoutSiderClasses({
477
- collapsed,
589
+ // src/classes/dm-menu.ts
590
+ var dmMenuClass = "dm-menu";
591
+ var dmMenuNoHeaderClass = "dm-menu-no-header";
592
+ var dmMenuCollapsedClass = "dm-menu-collapsed";
593
+ var dmMenuHeaderClass = "dm-menu-header";
594
+ var dmMenuProductIconClass = "dm-menu-product-icon";
595
+ var dmMenuContentClass = "dm-menu-content";
596
+ var dmMenuFooterClass = "dm-menu-footer";
597
+ var dmMenuCollapseButtonClass = "dm-menu-collapse-button";
598
+ function getDmMenuClasses({
599
+ hideProductHeader,
600
+ inlineCollapsed,
478
601
  className
479
602
  }) {
480
- return cn(layoutSiderClass, collapsed && layoutSiderCollapsedClass, className);
603
+ return cn(dmMenuClass, hideProductHeader && dmMenuNoHeaderClass, inlineCollapsed && dmMenuCollapsedClass, className);
481
604
  }
482
605
 
483
- // src/components/layout/Layout.tsx
484
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
485
- function toSize(value) {
486
- return typeof value === "number" ? `${value}px` : value;
487
- }
488
- var Header = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("div", {
489
- ...props,
490
- ref,
491
- className: cn(layoutHeaderClass, className)
492
- }));
493
- Header.displayName = "Layout.Header";
494
- var Content = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("div", {
495
- ...props,
496
- ref,
497
- className: cn(layoutContentClass, className)
498
- }));
499
- Content.displayName = "Layout.Content";
500
- var Footer = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("div", {
501
- ...props,
502
- ref,
503
- className: cn(layoutFooterClass, className)
504
- }));
505
- Footer.displayName = "Layout.Footer";
506
- var Sider = forwardRef3(({
507
- children,
508
- collapsible,
509
- collapsed,
510
- defaultCollapsed,
511
- onCollapse,
512
- width = 200,
513
- collapsedWidth = 80,
514
- trigger,
515
- breakpoint,
516
- className,
517
- style,
518
- ...props
519
- }, ref) => {
520
- const controlled = collapsed !== undefined;
521
- const [internalCollapsed, setInternalCollapsed] = useState2(() => defaultCollapsed ?? false);
522
- const mergedCollapsed = controlled ? collapsed : internalCollapsed;
523
- const siderWidth = toSize(mergedCollapsed ? collapsedWidth : width);
524
- function toggleCollapsed() {
525
- const nextCollapsed = !mergedCollapsed;
526
- if (!controlled) {
527
- setInternalCollapsed(nextCollapsed);
528
- }
529
- onCollapse?.(nextCollapsed, "clickTrigger");
530
- }
531
- return /* @__PURE__ */ jsxs3("div", {
532
- ...props,
533
- ref,
534
- "data-breakpoint": breakpoint,
535
- className: getLayoutSiderClasses({
536
- collapsed: mergedCollapsed,
537
- className
538
- }),
539
- style: {
540
- flex: `0 0 ${siderWidth}`,
541
- maxWidth: siderWidth,
542
- minWidth: siderWidth,
543
- width: siderWidth,
544
- ...style
545
- },
546
- children: [
547
- children,
548
- collapsible && trigger !== null ? /* @__PURE__ */ jsx3("button", {
549
- type: "button",
550
- className: layoutTriggerClass,
551
- "aria-label": mergedCollapsed ? "Expand sider" : "Collapse sider",
552
- onClick: toggleCollapsed,
553
- children: trigger ?? (mergedCollapsed ? ">" : "<")
554
- }) : null
555
- ]
556
- });
557
- });
558
- Sider.displayName = "Layout.Sider";
559
- var LayoutRoot = forwardRef3(({ hasSider, className, ...props }, ref) => /* @__PURE__ */ jsx3("div", {
560
- ...props,
561
- ref,
562
- className: getLayoutClasses({ hasSider, className })
563
- }));
564
- LayoutRoot.displayName = "Layout";
565
- LayoutRoot.Header = Header;
566
- LayoutRoot.Sider = Sider;
567
- LayoutRoot.Content = Content;
568
- LayoutRoot.Footer = Footer;
569
- var Layout = LayoutRoot;
570
606
  // src/components/menu/Menu.tsx
571
607
  import { forwardRef as forwardRef4, useState as useState3 } from "react";
572
608
 
@@ -854,35 +890,342 @@ MenuRoot.Item = MenuItem;
854
890
  MenuRoot.Divider = MenuDivider;
855
891
  MenuRoot.ItemGroup = MenuItemGroup;
856
892
  var Menu = MenuRoot;
857
- // src/components/dm-menu/DmMenu.tsx
858
- import { forwardRef as forwardRef5, useMemo as useMemo2 } from "react";
893
+ // src/components/button/Button.tsx
894
+ import React5 from "react";
895
+ import { createPortal } from "react-dom";
859
896
 
860
- // src/classes/dm-menu.ts
861
- var dmMenuClass = "dm-menu";
862
- var dmMenuNoHeaderClass = "dm-menu-no-header";
863
- var dmMenuCollapsedClass = "dm-menu-collapsed";
864
- var dmMenuHeaderClass = "dm-menu-header";
865
- var dmMenuProductIconClass = "dm-menu-product-icon";
866
- var dmMenuContentClass = "dm-menu-content";
867
- var dmMenuFooterClass = "dm-menu-footer";
868
- var dmMenuCollapseButtonClass = "dm-menu-collapse-button";
869
- function getDmMenuClasses({
870
- hideProductHeader,
871
- inlineCollapsed,
897
+ // src/classes/button.ts
898
+ var buttonBaseClass = "btn";
899
+ var buttonColorClasses = {
900
+ primary: "btn-primary",
901
+ secondary: "btn-secondary",
902
+ tertiary: "btn-tertiary",
903
+ accent: "btn-accent",
904
+ neutral: "btn-neutral",
905
+ base: "btn-base",
906
+ info: "btn-info",
907
+ success: "btn-success",
908
+ warning: "btn-warning",
909
+ error: "btn-error"
910
+ };
911
+ var buttonAppearanceClasses = {
912
+ filled: "",
913
+ outline: "btn-outline",
914
+ tonal: "btn-tonal",
915
+ ghost: "btn-ghost",
916
+ text: "btn-text"
917
+ };
918
+ var buttonShapeClasses = {
919
+ rect: "",
920
+ circle: "btn-circle btn-icon",
921
+ square: "btn-square"
922
+ };
923
+ var buttonSizeClasses = {
924
+ xs: "btn-xs",
925
+ sm: "btn-sm",
926
+ md: "btn-md",
927
+ lg: "btn-lg"
928
+ };
929
+ var buttonBlockClass = "btn-block";
930
+ var buttonIsLoadingClass = "btn-loading";
931
+ function getButtonClasses({
932
+ color = "primary",
933
+ appearance = "filled",
934
+ shape = "rect",
935
+ size = "md",
936
+ block,
937
+ isLoading,
872
938
  className
873
939
  }) {
874
- return cn(dmMenuClass, hideProductHeader && dmMenuNoHeaderClass, inlineCollapsed && dmMenuCollapsedClass, className);
940
+ return cn(buttonBaseClass, buttonColorClasses[color], buttonAppearanceClasses[appearance], buttonShapeClasses[shape], buttonSizeClasses[size], shape === "circle" && size === "xs" && "btn-icon-sm", shape === "circle" && size === "sm" && "btn-icon-sm", shape === "circle" && size === "lg" && "btn-icon-lg", block && buttonBlockClass, isLoading && buttonIsLoadingClass, className);
875
941
  }
876
942
 
943
+ // src/components/button/Button.tsx
944
+ import { jsx as jsx5, jsxs as jsxs5, Fragment as Fragment2 } from "react/jsx-runtime";
945
+ function isPromiseLike(value) {
946
+ return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
947
+ }
948
+ function Button({
949
+ color = "primary",
950
+ appearance = "filled",
951
+ shape = "rect",
952
+ size = "md",
953
+ block,
954
+ isLoading,
955
+ leftIcon,
956
+ rightIcon,
957
+ className,
958
+ children,
959
+ disabled,
960
+ ref,
961
+ confirm,
962
+ onClick,
963
+ ...props
964
+ }) {
965
+ const buttonRef = React5.useRef(null);
966
+ const popoverRef = React5.useRef(null);
967
+ const cancelRef = React5.useRef(null);
968
+ const approvalRef = React5.useRef("idle");
969
+ const pendingRef = React5.useRef(false);
970
+ const actionRef = React5.useRef(0);
971
+ const operationRef = React5.useRef(0);
972
+ const mountedRef = React5.useRef(false);
973
+ const [portalTarget, setPortalTarget] = React5.useState(null);
974
+ const [confirmLoading, setConfirmLoading] = React5.useState(false);
975
+ const [confirmError, setConfirmError] = React5.useState(false);
976
+ const generatedId = React5.useId().replace(/:/g, "");
977
+ const popoverId = `button-confirm-${generatedId}`;
978
+ const titleId = `${popoverId}-title`;
979
+ const descriptionId = `${popoverId}-description`;
980
+ const anchor = `--${popoverId}-anchor`;
981
+ const hasConfirm = Boolean(confirm);
982
+ const confirmation = confirm && typeof confirm === "object" ? confirm : undefined;
983
+ const title = confirmation ? confirmation.title : "Confirm action";
984
+ const hasTitle = title !== undefined && title !== null && title !== false && title !== "";
985
+ const content = confirmation?.component ?? confirmation?.message ?? confirmation?.description;
986
+ const hasContent = content !== undefined && content !== null && content !== false && content !== "";
987
+ const mergedRef = React5.useCallback((node) => {
988
+ buttonRef.current = node;
989
+ if (!node) {
990
+ if (typeof ref === "function")
991
+ ref(null);
992
+ else if (ref)
993
+ ref.current = null;
994
+ return;
995
+ }
996
+ const cleanup = typeof ref === "function" ? ref(node) : undefined;
997
+ if (ref && typeof ref !== "function")
998
+ ref.current = node;
999
+ return () => {
1000
+ buttonRef.current = null;
1001
+ if (typeof cleanup === "function")
1002
+ cleanup();
1003
+ else if (typeof ref === "function")
1004
+ ref(null);
1005
+ else if (ref)
1006
+ ref.current = null;
1007
+ };
1008
+ }, [ref]);
1009
+ React5.useEffect(() => {
1010
+ mountedRef.current = true;
1011
+ return () => {
1012
+ mountedRef.current = false;
1013
+ operationRef.current += 1;
1014
+ };
1015
+ }, []);
1016
+ React5.useEffect(() => {
1017
+ operationRef.current += 1;
1018
+ approvalRef.current = "idle";
1019
+ setConfirmError(false);
1020
+ setPortalTarget(hasConfirm ? document.body : null);
1021
+ }, [hasConfirm]);
1022
+ function closePopover() {
1023
+ if (popoverRef.current?.matches(":popover-open")) {
1024
+ popoverRef.current.hidePopover();
1025
+ }
1026
+ buttonRef.current?.focus();
1027
+ }
1028
+ function handleClick(event) {
1029
+ if (!confirm) {
1030
+ onClick?.(event);
1031
+ return;
1032
+ }
1033
+ if (approvalRef.current === "native") {
1034
+ approvalRef.current = "idle";
1035
+ return;
1036
+ }
1037
+ if (approvalRef.current === "action") {
1038
+ approvalRef.current = "idle";
1039
+ let result;
1040
+ try {
1041
+ result = onClick?.(event);
1042
+ } catch {
1043
+ event.preventDefault();
1044
+ pendingRef.current = false;
1045
+ setConfirmError(true);
1046
+ return;
1047
+ }
1048
+ if (!isPromiseLike(result)) {
1049
+ pendingRef.current = false;
1050
+ closePopover();
1051
+ return;
1052
+ }
1053
+ const userPreventedDefault = event.defaultPrevented;
1054
+ event.preventDefault();
1055
+ setConfirmLoading(true);
1056
+ const action = actionRef.current;
1057
+ const operation = operationRef.current;
1058
+ Promise.resolve(result).then(() => {
1059
+ if (!mountedRef.current || action !== actionRef.current)
1060
+ return;
1061
+ pendingRef.current = false;
1062
+ setConfirmLoading(false);
1063
+ if (operation !== operationRef.current)
1064
+ return;
1065
+ closePopover();
1066
+ if (!userPreventedDefault && !buttonRef.current?.disabled) {
1067
+ approvalRef.current = "native";
1068
+ buttonRef.current?.click();
1069
+ approvalRef.current = "idle";
1070
+ }
1071
+ }, () => {
1072
+ if (!mountedRef.current || action !== actionRef.current)
1073
+ return;
1074
+ pendingRef.current = false;
1075
+ setConfirmLoading(false);
1076
+ if (operation !== operationRef.current)
1077
+ return;
1078
+ setConfirmError(true);
1079
+ cancelRef.current?.focus();
1080
+ });
1081
+ return;
1082
+ }
1083
+ event.preventDefault();
1084
+ if (disabled || isLoading || pendingRef.current)
1085
+ return;
1086
+ if (popoverRef.current?.matches(":popover-open")) {
1087
+ closePopover();
1088
+ return;
1089
+ }
1090
+ setConfirmError(false);
1091
+ popoverRef.current?.showPopover();
1092
+ cancelRef.current?.focus();
1093
+ }
1094
+ function handleConfirm(event) {
1095
+ event.preventDefault();
1096
+ event.stopPropagation();
1097
+ const trigger = buttonRef.current;
1098
+ if (disabled || isLoading || pendingRef.current || !trigger || trigger.disabled || !event.currentTarget.matches(":popover-open"))
1099
+ return;
1100
+ setConfirmError(false);
1101
+ pendingRef.current = true;
1102
+ actionRef.current += 1;
1103
+ approvalRef.current = "action";
1104
+ trigger.click();
1105
+ if (approvalRef.current === "action") {
1106
+ approvalRef.current = "idle";
1107
+ pendingRef.current = false;
1108
+ }
1109
+ }
1110
+ const classes = getButtonClasses({
1111
+ color,
1112
+ appearance,
1113
+ shape,
1114
+ size,
1115
+ block,
1116
+ isLoading,
1117
+ className
1118
+ });
1119
+ const confirmClasses = getButtonClasses({
1120
+ color,
1121
+ size: "sm",
1122
+ isLoading: confirmLoading
1123
+ });
1124
+ return /* @__PURE__ */ jsxs5(Fragment2, {
1125
+ children: [
1126
+ /* @__PURE__ */ jsxs5("button", {
1127
+ ref: confirm ? mergedRef : ref,
1128
+ className: classes,
1129
+ disabled: disabled || isLoading,
1130
+ "aria-busy": isLoading,
1131
+ "aria-disabled": disabled || isLoading,
1132
+ ...props,
1133
+ style: confirm ? { ...props.style, anchorName: anchor } : props.style,
1134
+ "aria-haspopup": confirm ? "dialog" : props["aria-haspopup"],
1135
+ "aria-controls": confirm ? popoverId : props["aria-controls"],
1136
+ onClick: confirm ? handleClick : onClick,
1137
+ children: [
1138
+ isLoading && /* @__PURE__ */ jsx5("span", {
1139
+ className: "btn-spinner"
1140
+ }),
1141
+ !isLoading && leftIcon && /* @__PURE__ */ jsx5("span", {
1142
+ className: "btn-icon-left",
1143
+ children: leftIcon
1144
+ }),
1145
+ /* @__PURE__ */ jsx5("span", {
1146
+ className: "btn-content",
1147
+ children
1148
+ }),
1149
+ !isLoading && rightIcon && /* @__PURE__ */ jsx5("span", {
1150
+ className: "btn-icon-right",
1151
+ children: rightIcon
1152
+ })
1153
+ ]
1154
+ }),
1155
+ confirm && portalTarget && createPortal(/* @__PURE__ */ jsxs5("form", {
1156
+ id: popoverId,
1157
+ ref: popoverRef,
1158
+ popover: "auto",
1159
+ role: "dialog",
1160
+ "aria-labelledby": hasTitle ? titleId : undefined,
1161
+ "aria-label": hasTitle ? undefined : "Confirm action",
1162
+ "aria-describedby": hasContent ? descriptionId : undefined,
1163
+ className: "popover popover-confirm popover-bottom",
1164
+ style: { positionAnchor: anchor },
1165
+ onSubmit: handleConfirm,
1166
+ onClick: (event) => event.stopPropagation(),
1167
+ onToggle: (event) => {
1168
+ if (!event.currentTarget.matches(":popover-open")) {
1169
+ operationRef.current += 1;
1170
+ if (event.currentTarget.contains(document.activeElement) || document.activeElement === document.body) {
1171
+ buttonRef.current?.focus();
1172
+ }
1173
+ }
1174
+ },
1175
+ children: [
1176
+ hasTitle && /* @__PURE__ */ jsx5("div", {
1177
+ className: "popover-header",
1178
+ children: /* @__PURE__ */ jsx5("h3", {
1179
+ id: titleId,
1180
+ className: "popover-title",
1181
+ children: title
1182
+ })
1183
+ }),
1184
+ hasContent && /* @__PURE__ */ jsx5("div", {
1185
+ id: descriptionId,
1186
+ className: "popover-body",
1187
+ children: content
1188
+ }),
1189
+ confirmError && /* @__PURE__ */ jsx5("div", {
1190
+ role: "alert",
1191
+ className: "popover-body",
1192
+ children: "The action failed. Please try again."
1193
+ }),
1194
+ /* @__PURE__ */ jsxs5("div", {
1195
+ className: "popover-footer",
1196
+ children: [
1197
+ /* @__PURE__ */ jsx5("button", {
1198
+ ref: cancelRef,
1199
+ type: "button",
1200
+ className: "btn btn-text btn-sm",
1201
+ popoverTarget: popoverId,
1202
+ popoverTargetAction: "hide",
1203
+ disabled: confirmLoading,
1204
+ children: confirmation?.cancelText ?? "Cancel"
1205
+ }),
1206
+ /* @__PURE__ */ jsx5("button", {
1207
+ type: "submit",
1208
+ className: confirmClasses,
1209
+ disabled: disabled || isLoading || confirmLoading,
1210
+ "aria-busy": confirmLoading,
1211
+ children: confirmation?.confirmText ?? "Confirm"
1212
+ })
1213
+ ]
1214
+ })
1215
+ ]
1216
+ }), portalTarget)
1217
+ ]
1218
+ });
1219
+ }
877
1220
  // src/components/dm-menu/DmMenu.tsx
878
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1221
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
879
1222
  function getMenuLabel(menu, locale) {
880
1223
  return locale === "en-US" && menu.menuNameEn ? menu.menuNameEn : menu.menuName;
881
1224
  }
882
1225
  function renderIcon(icon) {
883
1226
  if (!icon)
884
1227
  return;
885
- return typeof icon === "string" ? /* @__PURE__ */ jsx5("span", {
1228
+ return typeof icon === "string" ? /* @__PURE__ */ jsx6("span", {
886
1229
  className: dmMenuProductIconClass,
887
1230
  "aria-hidden": "true",
888
1231
  children: icon
@@ -907,6 +1250,28 @@ function toMenuItems(menus, locale, byKey) {
907
1250
  function createDmMenuItems(menus, locale) {
908
1251
  return toMenuItems(menus, locale);
909
1252
  }
1253
+ function presentMenuItem(item, collapsed) {
1254
+ if (item.type === "divider")
1255
+ return item;
1256
+ const label = item.label ?? item.title;
1257
+ const initial = typeof label === "string" ? label.trim().slice(0, 1) : "";
1258
+ return {
1259
+ ...item,
1260
+ label: /* @__PURE__ */ jsx6("span", {
1261
+ className: "dm-menu-item-label",
1262
+ children: label
1263
+ }),
1264
+ icon: item.icon || collapsed ? /* @__PURE__ */ jsx6("span", {
1265
+ "aria-hidden": "true",
1266
+ className: "dm-menu-item-symbol",
1267
+ children: item.icon || /* @__PURE__ */ jsx6("span", {
1268
+ className: "dm-menu-item-initial",
1269
+ children: initial || "•"
1270
+ })
1271
+ }) : undefined,
1272
+ children: item.children?.map((child) => presentMenuItem(child, collapsed))
1273
+ };
1274
+ }
910
1275
  var DmMenu = forwardRef5(({
911
1276
  menus = [],
912
1277
  items,
@@ -925,14 +1290,14 @@ var DmMenu = forwardRef5(({
925
1290
  menuByKey.clear();
926
1291
  return toMenuItems(menus, locale, menuByKey);
927
1292
  }, [locale, menuByKey, menus]);
928
- const contentItems = items ?? schemaItems;
1293
+ const contentItems = (items ?? schemaItems).map((item) => presentMenuItem(item, inlineCollapsed));
929
1294
  function handleClick(info) {
930
1295
  onClick?.({
931
1296
  ...info,
932
1297
  menu: menuByKey.get(info.key)
933
1298
  });
934
1299
  }
935
- return /* @__PURE__ */ jsxs5("div", {
1300
+ return /* @__PURE__ */ jsxs6("div", {
936
1301
  ref,
937
1302
  className: getDmMenuClasses({
938
1303
  hideProductHeader,
@@ -940,25 +1305,25 @@ var DmMenu = forwardRef5(({
940
1305
  className
941
1306
  }),
942
1307
  children: [
943
- hideProductHeader ? null : /* @__PURE__ */ jsx5("div", {
1308
+ hideProductHeader ? null : /* @__PURE__ */ jsx6("div", {
944
1309
  className: dmMenuHeaderClass,
945
- children: /* @__PURE__ */ jsx5(Menu, {
1310
+ children: /* @__PURE__ */ jsx6(Menu, {
946
1311
  mode: "inline",
947
1312
  inlineCollapsed,
948
1313
  selectable: false,
949
1314
  items: [
950
- {
1315
+ presentMenuItem({
951
1316
  key: "__product",
952
1317
  label: productTitle,
953
1318
  title: productTitle,
954
1319
  icon: renderIcon(productIcon)
955
- }
1320
+ }, inlineCollapsed)
956
1321
  ]
957
1322
  })
958
1323
  }),
959
- /* @__PURE__ */ jsx5("div", {
1324
+ /* @__PURE__ */ jsx6("div", {
960
1325
  className: dmMenuContentClass,
961
- children: /* @__PURE__ */ jsx5(Menu, {
1326
+ children: /* @__PURE__ */ jsx6(Menu, {
962
1327
  ...props,
963
1328
  mode: props.mode ?? "inline",
964
1329
  items: contentItems,
@@ -966,14 +1331,32 @@ var DmMenu = forwardRef5(({
966
1331
  onClick: handleClick
967
1332
  })
968
1333
  }),
969
- onCollapsed ? /* @__PURE__ */ jsx5("div", {
1334
+ onCollapsed ? /* @__PURE__ */ jsx6("div", {
970
1335
  className: dmMenuFooterClass,
971
- children: /* @__PURE__ */ jsx5("button", {
1336
+ children: /* @__PURE__ */ jsx6(Button, {
972
1337
  type: "button",
1338
+ color: "base",
1339
+ appearance: "ghost",
1340
+ shape: "square",
1341
+ size: "sm",
973
1342
  className: dmMenuCollapseButtonClass,
974
1343
  "aria-label": inlineCollapsed ? "Expand menu" : "Collapse menu",
975
1344
  onClick: onCollapsed,
976
- children: inlineCollapsed ? ">" : "<"
1345
+ children: /* @__PURE__ */ jsx6("svg", {
1346
+ "aria-hidden": "true",
1347
+ focusable: "false",
1348
+ width: "18",
1349
+ height: "18",
1350
+ viewBox: "0 0 24 24",
1351
+ fill: "none",
1352
+ stroke: "currentColor",
1353
+ strokeWidth: "2",
1354
+ strokeLinecap: "round",
1355
+ strokeLinejoin: "round",
1356
+ children: /* @__PURE__ */ jsx6("path", {
1357
+ d: inlineCollapsed ? "m9 18 6-6-6-6" : "m15 18-6-6 6-6"
1358
+ })
1359
+ })
977
1360
  })
978
1361
  }) : null
979
1362
  ]
@@ -981,23 +1364,7 @@ var DmMenu = forwardRef5(({
981
1364
  });
982
1365
  DmMenu.displayName = "DmMenu";
983
1366
  // src/components/dm-layout/DmLayout.tsx
984
- import { forwardRef as forwardRef6, useEffect as useEffect2, useMemo as useMemo3, useState as useState4 } from "react";
985
-
986
- // src/classes/dm-layout.ts
987
- var dmLayoutClass = "dm-layout";
988
- var dmLayoutShellClass = "dm-layout-shell";
989
- var dmLayoutMainClass = "dm-layout-main";
990
- var dmLayoutSiderClass = "dm-layout-sider";
991
- var dmLayoutBodyClass = "dm-layout-body";
992
- var dmLayoutBreadcrumbClass = "dm-layout-breadcrumb";
993
- var dmLayoutContentClass = "dm-layout-content";
994
- var dmLayoutAuxiliaryClass = "dm-layout-auxiliary";
995
- function getDmLayoutClasses({ className }) {
996
- return cn(dmLayoutClass, className);
997
- }
998
-
999
- // src/components/dm-layout/DmLayout.tsx
1000
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1367
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1001
1368
  function getLabel(menu, locale) {
1002
1369
  return locale === "en-US" && menu.menuNameEn ? menu.menuNameEn : menu.menuName;
1003
1370
  }
@@ -1120,23 +1487,23 @@ var DmLayout = forwardRef6(({
1120
1487
  }
1121
1488
  onCollapse?.(nextCollapsed);
1122
1489
  }
1123
- return /* @__PURE__ */ jsx6(Layout, {
1490
+ return /* @__PURE__ */ jsx7(Layout, {
1124
1491
  ...props,
1125
1492
  ref,
1126
1493
  hasSider: true,
1127
1494
  className: getDmLayoutClasses({ className }),
1128
- children: /* @__PURE__ */ jsxs6(Layout, {
1495
+ children: /* @__PURE__ */ jsxs7(Layout, {
1129
1496
  className: dmLayoutShellClass,
1130
1497
  hasSider: true,
1131
1498
  children: [
1132
- /* @__PURE__ */ jsx6(Layout.Sider, {
1499
+ /* @__PURE__ */ jsx7(Layout.Sider, {
1133
1500
  className: dmLayoutSiderClass,
1134
1501
  collapsible: true,
1135
1502
  collapsed: mergedCollapsed,
1136
1503
  collapsedWidth: 60,
1137
1504
  width: 230,
1138
1505
  trigger: null,
1139
- children: /* @__PURE__ */ jsx6(DmMenu, {
1506
+ children: /* @__PURE__ */ jsx7(DmMenu, {
1140
1507
  ...menuProps,
1141
1508
  hideProductHeader,
1142
1509
  productTitle,
@@ -1151,23 +1518,23 @@ var DmLayout = forwardRef6(({
1151
1518
  onClick: (info) => onMenuClick?.(info.key, info.menu)
1152
1519
  })
1153
1520
  }),
1154
- /* @__PURE__ */ jsxs6(Layout, {
1521
+ /* @__PURE__ */ jsxs7(Layout, {
1155
1522
  className: dmLayoutMainClass,
1156
1523
  children: [
1157
- mergedBreadcrumbItems.length ? /* @__PURE__ */ jsx6("div", {
1524
+ mergedBreadcrumbItems.length ? /* @__PURE__ */ jsx7("div", {
1158
1525
  className: dmLayoutBreadcrumbClass,
1159
- children: /* @__PURE__ */ jsx6(DmBreadcrumb, {
1526
+ children: /* @__PURE__ */ jsx7(DmBreadcrumb, {
1160
1527
  items: mergedBreadcrumbItems
1161
1528
  })
1162
1529
  }) : null,
1163
- /* @__PURE__ */ jsxs6(Layout.Content, {
1530
+ /* @__PURE__ */ jsxs7(Layout.Content, {
1164
1531
  className: dmLayoutBodyClass,
1165
1532
  children: [
1166
- mergedTips ? /* @__PURE__ */ jsx6("div", {
1533
+ mergedTips ? /* @__PURE__ */ jsx7("div", {
1167
1534
  className: dmLayoutAuxiliaryClass,
1168
1535
  children: mergedTips
1169
1536
  }) : null,
1170
- /* @__PURE__ */ jsx6("div", {
1537
+ /* @__PURE__ */ jsx7("div", {
1171
1538
  className: dmLayoutContentClass,
1172
1539
  children
1173
1540
  })
@@ -1181,6 +1548,6 @@ var DmLayout = forwardRef6(({
1181
1548
  });
1182
1549
  DmLayout.displayName = "DmLayout";
1183
1550
  export {
1184
- deriveDmLayoutSelection,
1185
- DmLayout
1551
+ DmLayout,
1552
+ deriveDmLayoutSelection
1186
1553
  };