@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.
- package/README.md +61 -2
- package/dist/{chunk-r9wkv7xd.js → chunk-fwjzvsrx.js} +3 -3
- package/dist/classes/chat.d.ts +43 -0
- package/dist/classes/console-page.d.ts +16 -0
- package/dist/classes/dropdown.d.ts +5 -5
- package/dist/classes/fab.d.ts +11 -0
- package/dist/classes/index.d.ts +6 -0
- package/dist/classes/index.js +1443 -1210
- package/dist/classes/megamenu.d.ts +10 -0
- package/dist/classes/otp-input.d.ts +12 -0
- package/dist/classes/popover.d.ts +1 -3
- package/dist/classes/swap.d.ts +12 -0
- package/dist/classes/tree-select.d.ts +6 -6
- package/dist/components/anchor/index.js +2 -2
- package/dist/components/app/index.js +211 -151
- package/dist/components/avatar/Avatar.types.d.ts +1 -1
- package/dist/components/avatar/index.js +2 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button/Button.types.d.ts +8 -0
- package/dist/components/button/index.js +253 -24
- package/dist/components/calendar/index.js +44 -19
- package/dist/components/cascader/index.js +2 -2
- package/dist/components/chat/Chat.d.ts +22 -0
- package/dist/components/chat/Chat.types.d.ts +73 -0
- package/dist/components/chat/index.d.ts +2 -0
- package/dist/components/chat/index.js +309 -0
- package/dist/components/color-picker/ColorPicker.types.d.ts +2 -1
- package/dist/components/color-picker/index.js +210 -13
- package/dist/components/config-provider/index.js +2 -2
- package/dist/components/console-page/ConsolePage.d.ts +2 -0
- package/dist/components/console-page/ConsolePage.types.d.ts +29 -0
- package/dist/components/console-page/index.d.ts +2 -0
- package/dist/components/console-page/index.js +205 -0
- package/dist/components/date-picker/DatePicker.types.d.ts +1 -0
- package/dist/components/date-picker/index.js +537 -35
- package/dist/components/date-picker/usePickerDropdown.d.ts +17 -0
- package/dist/components/dm-breadcrumb/index.js +18 -18
- package/dist/components/dm-date-picker/index.js +635 -133
- package/dist/components/dm-drawer/index.js +269 -40
- package/dist/components/dm-layout/index.js +575 -208
- package/dist/components/dm-menu/index.js +399 -32
- package/dist/components/dm-message/index.js +18 -18
- package/dist/components/dm-page-header/index.js +537 -247
- package/dist/components/dm-pagination/index.js +39 -39
- package/dist/components/dm-pro-table/index.js +2374 -1559
- package/dist/components/dm-provider/index.js +94 -94
- package/dist/components/dm-query/DmQuery.types.d.ts +1 -1
- package/dist/components/dm-query/index.js +955 -210
- package/dist/components/dm-search/DmSearch.types.d.ts +4 -0
- package/dist/components/dm-search/index.js +937 -183
- package/dist/components/dm-splitter/index.js +32 -32
- package/dist/components/dm-status/index.js +25 -25
- package/dist/components/dm-table/index.js +1430 -676
- package/dist/components/dm-tabs/index.js +34 -34
- package/dist/components/dm-toolbar/index.js +423 -133
- package/dist/components/dm-tree/index.js +92 -92
- package/dist/components/dm-truncate/index.js +145 -65
- package/dist/components/dropdown/Dropdown.types.d.ts +1 -1
- package/dist/components/dropdown/index.js +467 -177
- package/dist/components/fab/Fab.d.ts +4 -0
- package/dist/components/fab/Fab.types.d.ts +25 -0
- package/dist/components/fab/index.d.ts +2 -0
- package/dist/components/fab/index.js +480 -0
- package/dist/components/form/Form.types.d.ts +1 -0
- package/dist/components/form/index.js +16 -5
- package/dist/components/grid/index.js +2 -2
- package/dist/components/input/index.js +4 -4
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/megamenu/Megamenu.d.ts +2 -0
- package/dist/components/megamenu/Megamenu.types.d.ts +32 -0
- package/dist/components/megamenu/index.d.ts +2 -0
- package/dist/components/megamenu/index.js +214 -0
- package/dist/components/message/index.js +5 -5
- package/dist/components/modal/index.js +128 -68
- package/dist/components/notification/index.js +2 -2
- package/dist/components/otp-input/OtpInput.d.ts +2 -0
- package/dist/components/otp-input/OtpInput.types.d.ts +16 -0
- package/dist/components/otp-input/index.d.ts +2 -0
- package/dist/components/otp-input/index.js +112 -0
- package/dist/components/popconfirm/index.js +297 -68
- package/dist/components/popover/index.js +24 -4
- package/dist/components/skeleton/index.js +5 -5
- package/dist/components/spin/index.js +2 -2
- package/dist/components/steps/index.js +2 -2
- package/dist/components/swap/Swap.d.ts +3 -0
- package/dist/components/swap/Swap.types.d.ts +22 -0
- package/dist/components/swap/index.d.ts +2 -0
- package/dist/components/swap/index.js +109 -0
- package/dist/components/table/index.js +2 -2
- package/dist/components/tabs/index.js +2 -2
- package/dist/components/tag/index.js +2 -2
- package/dist/components/time-picker/TimePicker.types.d.ts +1 -0
- package/dist/components/time-picker/index.js +167 -29
- package/dist/components/tooltip/Tooltip.types.d.ts +4 -0
- package/dist/components/tooltip/index.js +107 -27
- package/dist/components/tour/index.js +315 -86
- package/dist/components/tree-select/index.js +8 -8
- package/dist/components/typography/index.js +4 -4
- package/dist/components/upload/Upload.types.d.ts +1 -0
- package/dist/components/upload/index.js +7 -5
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4023 -2134
- package/dist/infrastructure.js +11 -11
- package/dist/styles.css +13677 -9811
- package/dist/theme/index.js +3 -3
- package/dist/utils/index.js +5 -5
- package/package.json +30 -6
package/README.md
CHANGED
|
@@ -41,8 +41,8 @@ import { Button, DmTable, theme } from "@duskmoon-dev/components";
|
|
|
41
41
|
|
|
42
42
|
## Public Surface
|
|
43
43
|
|
|
44
|
-
-
|
|
45
|
-
`Typography`.
|
|
44
|
+
- 78 standard components such as `Button`, `Chat`, `OtpInput`, `Swap`, `Fab`,
|
|
45
|
+
`Megamenu`, `ConsolePage`, `Table`, `Modal`, `Select`, and `Typography`.
|
|
46
46
|
- 21 DuskMoon workflow components such as `DmLayout`, `DmSearch`, `DmTable`,
|
|
47
47
|
`DmProTable`, and `DmToolbar`.
|
|
48
48
|
- 13 infrastructure exports including `theme`, `version`,
|
|
@@ -50,6 +50,65 @@ import { Button, DmTable, theme } from "@duskmoon-dev/components";
|
|
|
50
50
|
- Component subpath exports follow `@duskmoon-dev/components/{component-id}`,
|
|
51
51
|
for example `@duskmoon-dev/components/date-picker`.
|
|
52
52
|
|
|
53
|
+
`OtpInput` uses one native input with decorative slots. `Swap` uses a native
|
|
54
|
+
checkbox. `Fab`, `Megamenu`, and the mobile menu in `ConsolePage` use the
|
|
55
|
+
browser's Popover API for opening, Escape dismissal, and focus restoration.
|
|
56
|
+
These components require `@duskmoon-dev/core` 1.20.0 or newer.
|
|
57
|
+
|
|
58
|
+
`Form.Item` associates its label with a single child control, preserving an
|
|
59
|
+
existing child `id`. For composite controls, pass `htmlFor` with the target
|
|
60
|
+
control's `id`. `Badge appearance="outline"` emits both `badge-outlined` and
|
|
61
|
+
the supported `badge-outline` alias.
|
|
62
|
+
|
|
63
|
+
`Chat.Scroll` provides a fixed-height transcript with a sticky reply rail.
|
|
64
|
+
Pair assistant rows and indicator buttons with timeline slots 1–24; user rows
|
|
65
|
+
do not need ticks. `Chat.Status` and `Chat.Actions` accept ordinary content and
|
|
66
|
+
button callbacks, so the application owns generation state and metrics. The
|
|
67
|
+
Chat docs show all ten Core 1.20.3 showcases, including RTL bubbles, live states,
|
|
68
|
+
tool statuses, and message actions. For an LLM reply, place reasoning and tool
|
|
69
|
+
details inside one `Chat.Bubble`, with final content in
|
|
70
|
+
`.chat-bubble-content`. The new Chat styles and the `Avatar` `2xl` size require
|
|
71
|
+
Core 1.20.3 or newer.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { Chat } from "@duskmoon-dev/components/chat";
|
|
75
|
+
import { useId } from "react";
|
|
76
|
+
|
|
77
|
+
export function Conversation() {
|
|
78
|
+
const replyId = useId();
|
|
79
|
+
async function copyReply() {
|
|
80
|
+
await navigator.clipboard.writeText("The build passed.");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Chat.Scroll style={{ height: 320 }} aria-label="Conversation">
|
|
85
|
+
<Chat.ScrollTrack aria-label="Assistant replies">
|
|
86
|
+
<Chat.ScrollIndicator timeline={1} targetId={replyId} />
|
|
87
|
+
</Chat.ScrollTrack>
|
|
88
|
+
<Chat.ScrollBody>
|
|
89
|
+
<Chat id={replyId} timeline={1}>
|
|
90
|
+
<Chat.Bubble>The build passed.</Chat.Bubble>
|
|
91
|
+
<Chat.Status>
|
|
92
|
+
<Chat.StatusItem>Completed</Chat.StatusItem>
|
|
93
|
+
<Chat.StatusItem><Chat.StatusValue>42</Chat.StatusValue> token/s</Chat.StatusItem>
|
|
94
|
+
</Chat.Status>
|
|
95
|
+
<Chat.Actions hover>
|
|
96
|
+
<button type="button" onClick={copyReply}>Copy reply</button>
|
|
97
|
+
</Chat.Actions>
|
|
98
|
+
</Chat>
|
|
99
|
+
</Chat.ScrollBody>
|
|
100
|
+
</Chat.Scroll>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`Modal` requires a modern browser with native `<dialog>` support. It opens and
|
|
106
|
+
closes through `showModal()` and `close()`, while its forwarded ref and div props
|
|
107
|
+
remain on the inner modal box. Controlled callers must update `open` in
|
|
108
|
+
`onCancel`; `maskClassName` is applied to the dialog for `::backdrop` styling.
|
|
109
|
+
The static `Modal.confirm`, `info`, `success`, `error`, and `warning` handles
|
|
110
|
+
remain exported but do not render a service surface yet.
|
|
111
|
+
|
|
53
112
|
## Development
|
|
54
113
|
|
|
55
114
|
```bash
|
|
@@ -20,10 +20,10 @@ function clsx() {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
// src/utils/cn.ts
|
|
23
|
-
function
|
|
23
|
+
function cn2(...inputs) {
|
|
24
24
|
return clsx(inputs);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function duskmoonMerge2(classes) {
|
|
27
27
|
return classes;
|
|
28
28
|
}
|
|
29
|
-
export {
|
|
29
|
+
export { cn2, duskmoonMerge2 };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ChatBubbleColor, ChatBubbleSize, ChatPlacement, ChatToolState } from "../components/chat/Chat.types";
|
|
2
|
+
export declare const chatBaseClass = "chat";
|
|
3
|
+
export declare const chatAvatarClass = "chat-avatar";
|
|
4
|
+
export declare const chatHeaderClass = "chat-header";
|
|
5
|
+
export declare const chatBubbleBaseClass = "chat-bubble";
|
|
6
|
+
export declare const chatFooterClass = "chat-footer";
|
|
7
|
+
export declare const chatStatusClass = "chat-status";
|
|
8
|
+
export declare const chatStatusItemClass = "chat-status-item";
|
|
9
|
+
export declare const chatStatusValueClass = "chat-status-value";
|
|
10
|
+
export declare const chatActionsClass = "chat-actions";
|
|
11
|
+
export declare const chatActionsHoverClass = "chat-actions-hover";
|
|
12
|
+
export declare const chatScrollClass = "chat-scroll";
|
|
13
|
+
export declare const chatScrollBodyClass = "chat-scroll-body";
|
|
14
|
+
export declare const chatScrollTrackClass = "chat-scroll-track";
|
|
15
|
+
export declare const chatScrollIndicatorClass = "chat-scroll-indicator";
|
|
16
|
+
export declare const chatReasoningClass = "chat-reasoning";
|
|
17
|
+
export declare const chatToolBaseClass = "chat-tool";
|
|
18
|
+
export declare const chatToolHeaderClass = "chat-tool-header";
|
|
19
|
+
export declare const chatToolStatusClass = "chat-tool-status";
|
|
20
|
+
export declare const chatToolCallClass = "chat-tool-call";
|
|
21
|
+
export declare const chatToolResultClass = "chat-tool-result";
|
|
22
|
+
export declare const chatTypingClass = "chat-typing";
|
|
23
|
+
export declare const chatBubbleFilledClass = "chat-bubble-filled";
|
|
24
|
+
export declare const chatBubbleStreamingClass = "chat-bubble-streaming";
|
|
25
|
+
export declare const chatPlacementClasses: Record<ChatPlacement, string>;
|
|
26
|
+
export declare const chatBubbleColorClasses: Record<ChatBubbleColor, string>;
|
|
27
|
+
export declare const chatBubbleSizeClasses: Record<ChatBubbleSize, string>;
|
|
28
|
+
export declare const chatToolStateClasses: Record<ChatToolState, string>;
|
|
29
|
+
export declare function getChatClasses({ placement, className, }: {
|
|
30
|
+
placement?: ChatPlacement;
|
|
31
|
+
className?: string;
|
|
32
|
+
}): string;
|
|
33
|
+
export declare function getChatBubbleClasses({ color, size, filled, streaming, className, }: {
|
|
34
|
+
color?: ChatBubbleColor;
|
|
35
|
+
size?: ChatBubbleSize;
|
|
36
|
+
filled?: boolean;
|
|
37
|
+
streaming?: boolean;
|
|
38
|
+
className?: string;
|
|
39
|
+
}): string;
|
|
40
|
+
export declare function getChatToolClasses({ status, className, }: {
|
|
41
|
+
status?: ChatToolState;
|
|
42
|
+
className?: string;
|
|
43
|
+
}): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ConsolePageSidebarState = "expanded" | "compact" | "hidden";
|
|
2
|
+
export declare const consolePageFrameClass = "console-page-frame";
|
|
3
|
+
export declare const consolePageAppbarClass = "console-page-appbar";
|
|
4
|
+
export declare const consolePageSidebarClass = "console-page-sidebar";
|
|
5
|
+
export declare const consolePageSidebarHeaderClass = "console-page-sidebar-header";
|
|
6
|
+
export declare const consolePageSidebarBodyClass = "console-page-sidebar-body";
|
|
7
|
+
export declare const consolePageSidebarFooterClass = "console-page-sidebar-footer";
|
|
8
|
+
export declare const consolePageMainClass = "console-page-main";
|
|
9
|
+
export declare const consolePageNavLabelClass = "console-page-nav-label";
|
|
10
|
+
export declare const consolePageSidebarToggleClass = "console-page-sidebar-toggle";
|
|
11
|
+
export declare const consolePageMenuTriggerClass = "console-page-menu-trigger";
|
|
12
|
+
export declare const consolePageMobileMenuClass = "console-page-mobile-menu";
|
|
13
|
+
export declare function getConsolePageClasses({ sidebarState, className, }: {
|
|
14
|
+
sidebarState?: ConsolePageSidebarState;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { DropdownPlacement } from "../components/dropdown/Dropdown.types";
|
|
2
|
-
export declare const dropdownWrapperClass = "dropdown
|
|
3
|
-
export declare const dropdownBaseClass = "
|
|
4
|
-
export declare const dropdownOpenClass = "
|
|
5
|
-
export declare const dropdownArrowClass = "
|
|
2
|
+
export declare const dropdownWrapperClass = "dropdown";
|
|
3
|
+
export declare const dropdownBaseClass = "dropdown-content";
|
|
4
|
+
export declare const dropdownOpenClass = "";
|
|
5
|
+
export declare const dropdownArrowClass = "dropdown-arrow";
|
|
6
6
|
export declare const dropdownMenuClass = "menu dropdown-menu";
|
|
7
7
|
export declare const dropdownButtonClass = "dropdown-button";
|
|
8
8
|
export declare const dropdownPlacementClasses: Record<DropdownPlacement, string>;
|
|
9
|
-
export declare function getDropdownClasses({
|
|
9
|
+
export declare function getDropdownClasses({ className, }: {
|
|
10
10
|
placement?: DropdownPlacement;
|
|
11
11
|
open?: boolean;
|
|
12
12
|
arrow?: boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const fabClass = "fab";
|
|
2
|
+
export declare const fabTriggerClass = "fab-trigger";
|
|
3
|
+
export declare const fabActionsClass = "fab-actions";
|
|
4
|
+
export declare const fabActionClass = "fab-action";
|
|
5
|
+
export declare const fabLabelClass = "fab-label";
|
|
6
|
+
export declare function getFabClasses({ contained, start, speedDial, className, }: {
|
|
7
|
+
contained?: boolean;
|
|
8
|
+
start?: boolean;
|
|
9
|
+
speedDial?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}): string;
|
package/dist/classes/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export * from "./breadcrumb";
|
|
|
10
10
|
export * from "./button";
|
|
11
11
|
export * from "./calendar";
|
|
12
12
|
export * from "./card";
|
|
13
|
+
export * from "./chat";
|
|
14
|
+
export * from "./console-page";
|
|
13
15
|
export * from "./carousel";
|
|
14
16
|
export * from "./cascader";
|
|
15
17
|
export * from "./checkbox";
|
|
@@ -46,6 +48,7 @@ export * from "./dropdown";
|
|
|
46
48
|
export * from "./empty";
|
|
47
49
|
export * from "./flex";
|
|
48
50
|
export * from "./float-button";
|
|
51
|
+
export * from "./fab";
|
|
49
52
|
export * from "./form";
|
|
50
53
|
export * from "./grid";
|
|
51
54
|
export * from "./image";
|
|
@@ -55,9 +58,11 @@ export * from "./layout";
|
|
|
55
58
|
export * from "./list";
|
|
56
59
|
export * from "./mentions";
|
|
57
60
|
export * from "./menu";
|
|
61
|
+
export * from "./megamenu";
|
|
58
62
|
export * from "./message";
|
|
59
63
|
export * from "./modal";
|
|
60
64
|
export * from "./notification";
|
|
65
|
+
export * from "./otp-input";
|
|
61
66
|
export * from "./pagination";
|
|
62
67
|
export * from "./popover";
|
|
63
68
|
export * from "./popconfirm";
|
|
@@ -77,6 +82,7 @@ export * from "./splitter";
|
|
|
77
82
|
export * from "./statistic";
|
|
78
83
|
export * from "./steps";
|
|
79
84
|
export * from "./switch";
|
|
85
|
+
export * from "./swap";
|
|
80
86
|
export * from "./tabs";
|
|
81
87
|
export * from "./tag";
|
|
82
88
|
export * from "./table";
|