@yuva-devlab/ui 2.0.0 → 2.1.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/dist/common.css +0 -40
- package/dist/components/badge/badge.css +31 -27
- package/dist/components/badge/badge.mdx +6 -4
- package/dist/components/chain-of-thought/chain-of-thought.css +72 -0
- package/dist/components/chain-of-thought/chain-of-thought.mdx +18 -0
- package/dist/components/checkpoint/checkpoint.css +54 -0
- package/dist/components/checkpoint/checkpoint.mdx +18 -0
- package/dist/components/code-block/code-block.css +84 -0
- package/dist/components/code-block/code-block.mdx +26 -0
- package/dist/components/confirmation/confirmation.css +75 -0
- package/dist/components/confirmation/confirmation.mdx +22 -0
- package/dist/components/context/context.css +80 -0
- package/dist/components/context/context.mdx +18 -0
- package/dist/components/data-table/data-table.css +71 -0
- package/dist/components/data-table/data-table.mdx +22 -0
- package/dist/components/file-tree/file-tree.css +58 -0
- package/dist/components/file-tree/file-tree.mdx +18 -0
- package/dist/components/input-number/input-number.css +95 -0
- package/dist/components/input-number/input-number.mdx +34 -0
- package/dist/components/kbd/kbd.css +78 -0
- package/dist/components/kbd/kbd.mdx +30 -0
- package/dist/components/message/message.css +89 -0
- package/dist/components/message/message.mdx +14 -0
- package/dist/components/model-selector/model-selector.css +138 -0
- package/dist/components/model-selector/model-selector.mdx +26 -0
- package/dist/components/multi-select/multi-select.css +212 -0
- package/dist/components/multi-select/multi-select.mdx +30 -0
- package/dist/components/password-input/password-input.css +21 -0
- package/dist/components/password-input/password-input.mdx +30 -0
- package/dist/components/plan/plan.css +106 -0
- package/dist/components/plan/plan.mdx +22 -0
- package/dist/components/popover/popover.css +0 -5
- package/dist/components/prompt-input/prompt-input.css +140 -0
- package/dist/components/prompt-input/prompt-input.mdx +22 -0
- package/dist/components/queue/queue.css +76 -0
- package/dist/components/queue/queue.mdx +18 -0
- package/dist/components/search-input/search-input.css +21 -0
- package/dist/components/search-input/search-input.mdx +30 -0
- package/dist/components/select/select.css +1 -1
- package/dist/components/sonner/sonner.css +68 -17
- package/dist/components/sonner/sonner.mdx +5 -3
- package/dist/components/sources/sources.css +105 -0
- package/dist/components/sources/sources.mdx +18 -0
- package/dist/components/stack-trace/stack-trace.css +105 -0
- package/dist/components/stack-trace/stack-trace.mdx +18 -0
- package/dist/components/subagent/subagent.css +70 -0
- package/dist/components/subagent/subagent.mdx +18 -0
- package/dist/components/suggestion/suggestion.css +52 -0
- package/dist/components/suggestion/suggestion.mdx +14 -0
- package/dist/components/terminal/terminal.css +60 -0
- package/dist/components/terminal/terminal.mdx +26 -0
- package/dist/components/test-results/test-results.css +108 -0
- package/dist/components/test-results/test-results.mdx +18 -0
- package/dist/components/tool-call/tool-call.css +111 -0
- package/dist/components/tool-call/tool-call.mdx +22 -0
- package/dist/components/trace/trace.css +100 -0
- package/dist/components/trace/trace.mdx +18 -0
- package/dist/components.css +2582 -299
- package/dist/index.cjs +3539 -818
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1041 -8
- package/dist/index.d.ts +1041 -8
- package/dist/index.js +3570 -864
- package/dist/index.js.map +1 -1
- package/dist/preset.css +0 -1
- package/dist/styles/common.css +0 -40
- package/dist/styles/components.css +2582 -299
- package/dist/styles/preset.css +0 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas } from "@storybook/blocks";
|
|
2
|
+
import * as DataTableStories from "./data-table.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={DataTableStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Data Table
|
|
9
|
+
|
|
10
|
+
Enterprise-grade data table uniting `@yuva-devlab/ui` Table and Pagination primitives with column sorting, customizable cell renderers, and empty state fallbacks.
|
|
11
|
+
|
|
12
|
+
## Default with Pagination
|
|
13
|
+
|
|
14
|
+
<Canvas of={DataTableStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Static (No Pagination)
|
|
17
|
+
|
|
18
|
+
<Canvas of={DataTableStories.WithoutPagination} />
|
|
19
|
+
|
|
20
|
+
## Empty State Fallback
|
|
21
|
+
|
|
22
|
+
<Canvas of={DataTableStories.Empty} />
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.dl-file-tree {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
font-size: 0.8125rem;
|
|
6
|
+
font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
|
|
7
|
+
user-select: none;
|
|
8
|
+
background-color: var(--card, var(--background));
|
|
9
|
+
border: 1px solid var(--border);
|
|
10
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
11
|
+
padding: 0.375rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dl-file-tree__node {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 0.375rem;
|
|
18
|
+
padding: 0.25rem 0.5rem;
|
|
19
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
color: var(--muted-foreground);
|
|
22
|
+
transition: all 0.12s ease;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dl-file-tree__node:hover {
|
|
26
|
+
background-color: var(--accent);
|
|
27
|
+
color: var(--accent-foreground);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dl-file-tree__node--active {
|
|
31
|
+
background-color: var(--accent);
|
|
32
|
+
color: var(--foreground);
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dl-file-tree__icon {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
width: 1rem;
|
|
41
|
+
height: 1rem;
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dl-file-tree__name {
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dl-file-tree__children {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
position: relative;
|
|
55
|
+
margin-left: 0.75rem;
|
|
56
|
+
padding-left: 0.5rem;
|
|
57
|
+
border-left: 1px solid var(--border);
|
|
58
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as FileTreeStories from "./file-tree.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={FileTreeStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# File Tree
|
|
9
|
+
|
|
10
|
+
Interactive file and folder tree navigation structure for agent workspace inspection and code repositories.
|
|
11
|
+
|
|
12
|
+
## Default
|
|
13
|
+
|
|
14
|
+
<Canvas of={FileTreeStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Component Properties
|
|
17
|
+
|
|
18
|
+
<Controls />
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.dl-input-number {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
max-width: 10rem;
|
|
7
|
+
height: var(--control-height-md, 2.25rem);
|
|
8
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
9
|
+
border: 1px solid var(--input, var(--border));
|
|
10
|
+
background-color: var(--background);
|
|
11
|
+
color: var(--foreground);
|
|
12
|
+
font-size: 0.875rem;
|
|
13
|
+
transition:
|
|
14
|
+
border-color 0.15s ease,
|
|
15
|
+
box-shadow 0.15s ease;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dl-input-number:focus-within {
|
|
20
|
+
outline: none;
|
|
21
|
+
border-color: var(--ring);
|
|
22
|
+
box-shadow: 0 0 0 1px var(--ring);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dl-input-number--disabled {
|
|
26
|
+
opacity: 0.5;
|
|
27
|
+
cursor: not-allowed;
|
|
28
|
+
background-color: var(--muted);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dl-input-number__input {
|
|
32
|
+
flex: 1;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
padding: 0 0.75rem;
|
|
36
|
+
background: transparent;
|
|
37
|
+
border: none;
|
|
38
|
+
color: inherit;
|
|
39
|
+
font-family: inherit;
|
|
40
|
+
font-size: inherit;
|
|
41
|
+
text-align: left;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dl-input-number__input:focus {
|
|
45
|
+
outline: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dl-input-number__controls {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
height: 100%;
|
|
52
|
+
width: 1.5rem;
|
|
53
|
+
border-left: 1px solid var(--border);
|
|
54
|
+
background-color: var(--secondary);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.dl-input-number__btn {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
height: 50%;
|
|
62
|
+
width: 100%;
|
|
63
|
+
background: transparent;
|
|
64
|
+
border: none;
|
|
65
|
+
padding: 0;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
color: var(--muted-foreground);
|
|
68
|
+
transition:
|
|
69
|
+
color 0.15s ease,
|
|
70
|
+
background-color 0.15s ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.dl-input-number__btn:hover:not(:disabled) {
|
|
74
|
+
background-color: var(--accent);
|
|
75
|
+
color: var(--foreground);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.dl-input-number__btn:disabled {
|
|
79
|
+
opacity: 0.35;
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.dl-input-number__btn--up {
|
|
84
|
+
border-bottom: 1px solid var(--border);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.dl-input-number__prefix,
|
|
88
|
+
.dl-input-number__suffix {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
padding: 0 0.5rem;
|
|
92
|
+
color: var(--muted-foreground);
|
|
93
|
+
font-size: 0.75rem;
|
|
94
|
+
user-select: none;
|
|
95
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as InputNumberStories from "./input-number.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={InputNumberStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Input Number
|
|
9
|
+
|
|
10
|
+
Precision numeric input control with integrated stepper buttons, keyboard arrow controls, min/max guards, and prefix/suffix support.
|
|
11
|
+
|
|
12
|
+
## Default
|
|
13
|
+
|
|
14
|
+
<Canvas of={InputNumberStories.Default} />
|
|
15
|
+
|
|
16
|
+
## With Min and Max Bounds
|
|
17
|
+
|
|
18
|
+
<Canvas of={InputNumberStories.WithMinMax} />
|
|
19
|
+
|
|
20
|
+
## Decimal Precision & Step
|
|
21
|
+
|
|
22
|
+
<Canvas of={InputNumberStories.DecimalPrecision} />
|
|
23
|
+
|
|
24
|
+
## Prefix and Suffix Units
|
|
25
|
+
|
|
26
|
+
<Canvas of={InputNumberStories.WithPrefixAndSuffix} />
|
|
27
|
+
|
|
28
|
+
## Disabled State
|
|
29
|
+
|
|
30
|
+
<Canvas of={InputNumberStories.Disabled} />
|
|
31
|
+
|
|
32
|
+
## Component Properties
|
|
33
|
+
|
|
34
|
+
<Controls />
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
.dl-kbd {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
font-family: var(
|
|
6
|
+
--font-mono,
|
|
7
|
+
ui-monospace,
|
|
8
|
+
SFMono-Regular,
|
|
9
|
+
Menlo,
|
|
10
|
+
Monaco,
|
|
11
|
+
Consolas,
|
|
12
|
+
monospace
|
|
13
|
+
);
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
user-select: none;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
vertical-align: baseline;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* ── Sizes ── */
|
|
23
|
+
.dl-kbd--sm {
|
|
24
|
+
min-width: 1.125rem;
|
|
25
|
+
height: 1.125rem;
|
|
26
|
+
padding: 0 0.25rem;
|
|
27
|
+
font-size: 0.625rem;
|
|
28
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dl-kbd--md {
|
|
32
|
+
min-width: 1.375rem;
|
|
33
|
+
height: 1.375rem;
|
|
34
|
+
padding: 0 0.375rem;
|
|
35
|
+
font-size: 0.6875rem;
|
|
36
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dl-kbd--lg {
|
|
40
|
+
min-width: 1.625rem;
|
|
41
|
+
height: 1.625rem;
|
|
42
|
+
padding: 0 0.5rem;
|
|
43
|
+
font-size: 0.75rem;
|
|
44
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ── Variants ── */
|
|
48
|
+
.dl-kbd--default {
|
|
49
|
+
background-color: var(--muted);
|
|
50
|
+
color: var(--muted-foreground);
|
|
51
|
+
border: 1px solid var(--border);
|
|
52
|
+
box-shadow: 0 1px 0 0 var(--border);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.dl-kbd--outline {
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
color: var(--foreground);
|
|
58
|
+
border: 1px solid var(--border);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.dl-kbd--ghost {
|
|
62
|
+
background-color: transparent;
|
|
63
|
+
color: var(--muted-foreground);
|
|
64
|
+
border: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ── KbdGroup ── */
|
|
68
|
+
.dl-kbd-group {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 0.25rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.dl-kbd-separator {
|
|
75
|
+
color: var(--muted-foreground);
|
|
76
|
+
font-size: 0.6875rem;
|
|
77
|
+
user-select: none;
|
|
78
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as KbdStories from "./kbd.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={KbdStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Kbd
|
|
9
|
+
|
|
10
|
+
Semantic keycap element and sequence container for displaying keyboard shortcuts and hotkeys.
|
|
11
|
+
|
|
12
|
+
## Default
|
|
13
|
+
|
|
14
|
+
<Canvas of={KbdStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Sizes
|
|
17
|
+
|
|
18
|
+
<Canvas of={KbdStories.Sizes} />
|
|
19
|
+
|
|
20
|
+
## Variants
|
|
21
|
+
|
|
22
|
+
<Canvas of={KbdStories.Variants} />
|
|
23
|
+
|
|
24
|
+
## Shortcut Combination Groups
|
|
25
|
+
|
|
26
|
+
<Canvas of={KbdStories.ShortcutGroup} />
|
|
27
|
+
|
|
28
|
+
## Component Properties
|
|
29
|
+
|
|
30
|
+
<Controls />
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.dl-message {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 0.75rem;
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 0.75rem 0;
|
|
6
|
+
color: var(--foreground);
|
|
7
|
+
font-size: 0.875rem;
|
|
8
|
+
line-height: 1.5;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dl-message--user {
|
|
12
|
+
flex-direction: row-reverse;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dl-message__avatar {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
width: 2rem;
|
|
20
|
+
height: 2rem;
|
|
21
|
+
border-radius: 9999px;
|
|
22
|
+
background-color: var(--secondary);
|
|
23
|
+
color: var(--secondary-foreground);
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
font-size: 0.75rem;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
border: 1px solid var(--border);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dl-message--assistant .dl-message__avatar {
|
|
31
|
+
background-color: color-mix(in oklch, var(--primary) 12%, transparent);
|
|
32
|
+
color: var(--primary);
|
|
33
|
+
border-color: color-mix(in oklch, var(--primary) 25%, transparent);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dl-message__body {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: 0.375rem;
|
|
40
|
+
max-width: 80%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.dl-message--user .dl-message__body {
|
|
44
|
+
align-items: flex-end;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.dl-message__content {
|
|
48
|
+
border-radius: var(--radius-lg, 0.5rem);
|
|
49
|
+
padding: 0.625rem 0.875rem;
|
|
50
|
+
background-color: var(--card, var(--background));
|
|
51
|
+
border: 1px solid var(--border);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dl-message--user .dl-message__content {
|
|
55
|
+
background-color: var(--primary);
|
|
56
|
+
color: var(--primary-foreground);
|
|
57
|
+
border-color: var(--primary);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.dl-message__actions {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 0.25rem;
|
|
64
|
+
opacity: 0.8;
|
|
65
|
+
transition: opacity 0.15s ease;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.dl-message:hover .dl-message__actions {
|
|
69
|
+
opacity: 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dl-message__action-btn {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
width: 1.5rem;
|
|
77
|
+
height: 1.5rem;
|
|
78
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
79
|
+
border: none;
|
|
80
|
+
background: transparent;
|
|
81
|
+
color: var(--muted-foreground);
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
transition: all 0.15s ease;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.dl-message__action-btn:hover {
|
|
87
|
+
background-color: var(--secondary);
|
|
88
|
+
color: var(--foreground);
|
|
89
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas } from "@storybook/blocks";
|
|
2
|
+
import * as MessageStories from "./message.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={MessageStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Message
|
|
9
|
+
|
|
10
|
+
Conversational turn wrapper for user, assistant, and system messages with avatar slots, message bubble styling, and action toolbars (copy, retry, feedback).
|
|
11
|
+
|
|
12
|
+
## Interactive Chat Thread
|
|
13
|
+
|
|
14
|
+
<Canvas of={MessageStories.Thread} />
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
.dl-model-selector {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dl-model-selector__trigger {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
gap: 0.5rem;
|
|
11
|
+
padding: 0.375rem 0.625rem;
|
|
12
|
+
font-size: 0.8125rem;
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
16
|
+
border: 1px solid var(--border);
|
|
17
|
+
background-color: var(--background);
|
|
18
|
+
color: var(--foreground);
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
transition: all 0.15s ease;
|
|
21
|
+
user-select: none;
|
|
22
|
+
font-family: inherit;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dl-model-selector__trigger:hover:not(:disabled) {
|
|
26
|
+
background-color: var(--accent);
|
|
27
|
+
color: var(--accent-foreground);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dl-model-selector__trigger:focus-visible {
|
|
31
|
+
outline: 2px solid var(--ring);
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.dl-model-selector__trigger:disabled {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
cursor: not-allowed;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dl-model-selector__trigger--sm {
|
|
41
|
+
padding: 0.25rem 0.5rem;
|
|
42
|
+
font-size: 0.75rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dl-model-selector__content {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: calc(100% + 4px);
|
|
48
|
+
left: 0;
|
|
49
|
+
z-index: 50;
|
|
50
|
+
min-width: 16rem;
|
|
51
|
+
max-width: 22rem;
|
|
52
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
53
|
+
border: 1px solid var(--border);
|
|
54
|
+
background-color: var(--popover, var(--background));
|
|
55
|
+
color: var(--popover-foreground, var(--foreground));
|
|
56
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
57
|
+
padding: 0.375rem;
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 0.25rem;
|
|
61
|
+
max-height: 20rem;
|
|
62
|
+
overflow-y: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dl-model-selector__search {
|
|
66
|
+
padding: 0.375rem 0.5rem;
|
|
67
|
+
margin-bottom: 0.25rem;
|
|
68
|
+
font-size: 0.75rem;
|
|
69
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
70
|
+
border: 1px solid var(--border);
|
|
71
|
+
background-color: var(--input);
|
|
72
|
+
color: var(--foreground);
|
|
73
|
+
outline: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dl-model-selector__search:focus {
|
|
77
|
+
border-color: var(--ring);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dl-model-selector__item {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: flex-start;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
gap: 0.5rem;
|
|
85
|
+
padding: 0.5rem;
|
|
86
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
transition: background-color 0.12s ease;
|
|
89
|
+
user-select: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.dl-model-selector__item:hover:not([data-disabled="true"]) {
|
|
93
|
+
background-color: var(--accent);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dl-model-selector__item--active {
|
|
97
|
+
background-color: var(--accent);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.dl-model-selector__item-info {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
gap: 0.125rem;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.dl-model-selector__item-title {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: 0.375rem;
|
|
111
|
+
font-weight: 500;
|
|
112
|
+
font-size: 0.8125rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.dl-model-selector__item-desc {
|
|
116
|
+
font-size: 0.75rem;
|
|
117
|
+
color: var(--muted-foreground);
|
|
118
|
+
line-height: 1.3;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.dl-model-selector__item-tags {
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: 0.25rem;
|
|
125
|
+
margin-top: 0.25rem;
|
|
126
|
+
flex-wrap: wrap;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dl-model-selector__tag {
|
|
130
|
+
display: inline-flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
font-size: 0.6875rem;
|
|
133
|
+
padding: 0.0625rem 0.375rem;
|
|
134
|
+
border-radius: 9999px;
|
|
135
|
+
background-color: var(--muted);
|
|
136
|
+
color: var(--muted-foreground);
|
|
137
|
+
font-weight: 500;
|
|
138
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as ModelSelectorStories from "./model-selector.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={ModelSelectorStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Model Selector
|
|
9
|
+
|
|
10
|
+
Dropdown picker for choosing LLM backends and agent models, complete with provider metadata, capability tags, and filtering.
|
|
11
|
+
|
|
12
|
+
## Default
|
|
13
|
+
|
|
14
|
+
<Canvas of={ModelSelectorStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Small Trigger (Prompt Input Embed)
|
|
17
|
+
|
|
18
|
+
<Canvas of={ModelSelectorStories.SmallTrigger} />
|
|
19
|
+
|
|
20
|
+
## Custom Model Catalog
|
|
21
|
+
|
|
22
|
+
<Canvas of={ModelSelectorStories.CustomModels} />
|
|
23
|
+
|
|
24
|
+
## Component Properties
|
|
25
|
+
|
|
26
|
+
<Controls />
|